@github/copilot
Advanced tools
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
+11
-11
@@ -9,6 +9,6 @@ #!/usr/bin/env node | ||
| import ye from"node:module";import{spawn as Ie}from"node:child_process";import{chmodSync as V,copyFileSync as K,mkdirSync as xe,readFileSync as Q,realpathSync as _e,rmSync as x,statSync as Ae,writeFileSync as X,writeSync as $e}from"node:fs";import{basename as $,dirname as ke,join as u,resolve as ne,sep as A}from"node:path";import{createInterface as Re}from"node:readline";import*as se from"node:sea";import{fileURLToPath as oe,pathToFileURL as _}from"node:url";var ae=new Set;function R(e,t){let s=Object.create(null);if(e)for(let[i,r]of Object.entries(e))s[i]=r;let c=t??ae;return new Proxy(process.env,{get(i,r){if(typeof r=="string"){if(Object.hasOwn(s,r))return s[r];if(!c.has(r))return process.env[r]}},set(i,r,o){return s[r]=o,!0},has(i,r){return typeof r!="string"?!1:Object.hasOwn(s,r)?s[r]!==void 0:c.has(r)?!1:r in process.env},ownKeys(i){let r=new Set(Object.keys(process.env));for(let o of c)r.delete(o);for(let o of Object.keys(s))s[o]!==void 0?r.add(o):r.delete(o);return[...r]},getOwnPropertyDescriptor(i,r){if(typeof r!="string")return;let o;if(Object.hasOwn(s,r))o=s[r];else{if(c.has(r))return;o=process.env[r]}if(o!==void 0)return{value:o,writable:!0,enumerable:!0,configurable:!0}},deleteProperty(i,r){return s[r]=void 0,!0}})}var ue=new Set(["--server","--headless","--acp"]);function de(e){return e==="--prompt"||e.startsWith("--prompt=")||e==="-p"||e.startsWith("-p")&&e.length>2}function pe(e){return e.some(t=>ue.has(t)||de(t))}function N(e){return pe(e)}import{readdir as fe,access as le,constants as ge}from"node:fs/promises";import{join as p,basename as C}from"node:path";import{homedir as E}from"node:os";function L(){return process.env.XDG_CACHE_HOME||p(E(),".cache")}function F(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function U(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function me(){if(process.platform==="darwin")return p(E(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||p(E(),".cache");return p(e,"copilot")}return p(L(),"copilot")}function M(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(p(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(p(me(),"pkg")),e.push(p(L(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(p(process.env.COPILOT_HOME,"pkg")),e.push(p(E(),".copilot","pkg")),[...new Set(e)]}function H(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}function he(e,t){let s=H(e),c=H(t);if(!s&&!c)return 0;if(!s)return-1;if(!c)return 1;for(let o=0;o<3;o++)if(s[o]!==c[o])return s[o]-c[o];let i=e.includes("-"),r=t.includes("-");return i!==r?i?-1:1:e.localeCompare(t)}async function j(e,...t){let s=[];for(let c of t){let i;try{i=await fe(c)}catch{continue}for(let r of i){let o=p(c,r);try{await le(p(o,e),ge.R_OK),s.push(o)}catch{continue}}}return s.sort((c,i)=>{let r=he(C(i),C(c));return r!==0?r:c.localeCompare(i)}),s}import J from"node:path";import{fileURLToPath as Pe}from"node:url";function ve(e){if(e.includes("<!DOCTYPE")||e.includes("<html")){let t=Math.min(e.indexOf("<!DOCTYPE")!==-1?e.indexOf("<!DOCTYPE"):1/0,e.indexOf("<html")!==-1?e.indexOf("<html"):1/0),s=e.substring(0,t).trim();return s?`${s} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function D(e){let t;if(e instanceof Error)t=String(e);else if(typeof e=="object"&&e!==null)try{t=JSON.stringify(e)??"[object]"}catch{return"[object with circular reference]"}else t=String(e);return ve(t)}import{existsSync as G}from"node:fs";import{createRequire as be}from"node:module";import{join as W,resolve as Oe}from"node:path";import{fileURLToPath as Se}from"node:url";function we(){return`${process.platform}-${process.arch}`}function Ee(){let{platform:e,arch:t}=process;switch(e){case"win32":return`win32-${t}-msvc`;case"darwin":return`darwin-${t}`;case"linux":return`linux-${t}-gnu`;default:throw new Error(`Unsupported platform: ${e}/${t}`)}}function q(e,t){let s=we(),c=`${e}.node`,i=`${e}.${Ee()}.node`;for(let r of t){let o=Oe(r),S=W(o,"prebuilds",s,c);if(G(S))return Y(S);let b=W(o,i);if(G(b))return Y(b)}throw new Error(`Native addon "${e}" not found for ${s}.`)}function Y(e){return be(Se(import.meta.url))(e)}var O;function B(){if(process.platform==="win32"){if(O){if(O.kind==="ok")return O.addon;throw O.error}try{let e=Te();return O={kind:"ok",addon:e},e}catch(e){let t=e instanceof Error?e:new Error(`Failed to load Win32 native addon: ${D(e)}`);throw O={kind:"error",error:t},t}}}function Te(){let e=J.dirname(Pe(import.meta.url));return q("win32-native",[e,J.resolve(e,"..","native","win32")])}try{ye.enableCompileCache?.()}catch{}var Ne=75;function z(){if(process.stdin.isTTY&&typeof process.stdin.setRawMode=="function")try{process.stdin.setRawMode(!1)}catch{}if(process.stdout.isTTY)try{$e(1,"\x1B[<u\x1B[?1049h\x1B[?1049l\x1B[?1006l\x1B[?1003l\x1B[?1002l\x1B[?2004l\x1B[?1004l\x1B[?25h\x1B[?2026l"+(process.env.TERM!=="dumb"?"\x1B[23;2t":""))}catch{}}var ie=ke(oe(import.meta.url)),Z=se.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=B();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var P=process.argv.find(e=>$(e).startsWith("conpty_console_list_agent")),ee=process.argv.find(e=>$(e)==="extension_bootstrap.mjs"),te=ee?ne(ee):void 0,re=te?.startsWith(ne(ie,"preloads")+A)?te:void 0;if(P){let e=P.endsWith(".js")?P:P+".js";await import(_(e).href)}else if(re)await import(_(re).href);else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:t,body:s}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:t,body:s,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else if(process.env.COPILOT_RUN_APP==="1"||N(process.argv.slice(2))){let e=u(ie,"app.js"),t=U();if(Z&&(F()||t)){let s=M().map(i=>u(i,"universal")),c=await j("app.js",...s);if(t){let i=c.find(r=>$(r)===t);i?e=u(i,"app.js"):process.stderr.write(`Warning: preferred version ${t} not found in package cache, using built-in version | ||
| `)}else c.length>0&&(e=u(c[0],"app.js"))}await import(_(e).href)}else{let t=function(){let n=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot");return u(n,"restart",`${e}.json`)},s=function(){let n=t();try{let a=Q(n,"utf-8");return x(n,{force:!0}),JSON.parse(a)}catch{return}},c=function(){try{x(t(),{force:!0})}catch{}},i=function(){let n=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot");return u(n,"crash-context",`${e}.json`)},r=function(){try{let n=Q(i(),"utf-8");return JSON.parse(n)}catch{return}},o=function(){try{x(i(),{force:!0})}catch{}},S=function(n,a){return new Promise(g=>{let f=Re({input:process.stdin,output:process.stdout}),d=n.toString(16).toUpperCase();if(process.stdout.write(` | ||
| *** Copilot exited unexpectedly (exit code ${n} = 0x${d}) *** | ||
| `),a){let m=a.length>200?a.slice(0,200)+"\u2026":a;process.stdout.write(`Error: ${m} | ||
| import Ae from"node:module";import{spawn as $e}from"node:child_process";import{chmodSync as Q,copyFileSync as X,mkdirSync as Le,readFileSync as z,realpathSync as Re,rmSync as _,statSync as ke,writeFileSync as Z,writeSync as He}from"node:fs";import{basename as L,dirname as Ne,join as a,resolve as oe,sep as $}from"node:path";import{createInterface as Ce}from"node:readline";import*as ie from"node:sea";import{fileURLToPath as ce,pathToFileURL as A}from"node:url";var de=new Set;function k(e,r){let n=Object.create(null);if(e)for(let[i,t]of Object.entries(e))n[i]=t;let c=r??de;return new Proxy(process.env,{get(i,t){if(typeof t=="string"){if(Object.hasOwn(n,t))return n[t];if(!c.has(t))return process.env[t]}},set(i,t,o){return n[t]=o,!0},has(i,t){return typeof t!="string"?!1:Object.hasOwn(n,t)?n[t]!==void 0:c.has(t)?!1:t in process.env},ownKeys(i){let t=new Set(Object.keys(process.env));for(let o of c)t.delete(o);for(let o of Object.keys(n))n[o]!==void 0?t.add(o):t.delete(o);return[...t]},getOwnPropertyDescriptor(i,t){if(typeof t!="string")return;let o;if(Object.hasOwn(n,t))o=n[t];else{if(c.has(t))return;o=process.env[t]}if(o!==void 0)return{value:o,writable:!0,enumerable:!0,configurable:!0}},deleteProperty(i,t){return n[t]=void 0,!0}})}var pe=new Set(["--server","--headless","--acp"]);function le(e){return e==="--prompt"||e.startsWith("--prompt=")||e==="-p"||e.startsWith("-p")&&e.length>2}function fe(e){return e.some(r=>pe.has(r)||le(r))}function H(e){return fe(e)}import{readdir as ge,access as me,constants as he}from"node:fs/promises";import{join as p,basename as N}from"node:path";import{homedir as P}from"node:os";function F(){return process.env.XDG_CACHE_HOME||p(P(),".cache")}function j(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function M(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function be(){if(process.platform==="darwin")return p(P(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||p(P(),".cache");return p(e,"copilot")}return p(F(),"copilot")}function U(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(p(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(p(be(),"pkg")),e.push(p(F(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(p(process.env.COPILOT_HOME,"pkg")),e.push(p(P(),".copilot","pkg")),[...new Set(e)]}function C(e){let r=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(r)return[Number(r[1]),Number(r[2]),Number(r[3])]}function ve(e,r){let n=C(e),c=C(r);if(!n&&!c)return 0;if(!n)return-1;if(!c)return 1;for(let o=0;o<3;o++)if(n[o]!==c[o])return n[o]-c[o];let i=e.includes("-"),t=r.includes("-");return i!==t?i?-1:1:e.localeCompare(r)}async function D(e,...r){let n=[];for(let c of r){let i;try{i=await ge(c)}catch{continue}for(let t of i){let o=p(c,t);try{await me(p(o,e),he.R_OK),n.push(o)}catch{continue}}}return n.sort((c,i)=>{let t=ve(N(i),N(c));return t!==0?t:c.localeCompare(i)}),n}import B from"node:path";import{fileURLToPath as Ie}from"node:url";function Oe(e){if(e.includes("<!DOCTYPE")||e.includes("<html")){let r=Math.min(e.indexOf("<!DOCTYPE")!==-1?e.indexOf("<!DOCTYPE"):1/0,e.indexOf("<html")!==-1?e.indexOf("<html"):1/0),n=e.substring(0,r).trim();return n?`${n} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function G(e){let r;if(e instanceof Error)r=String(e);else if(typeof e=="object"&&e!==null)try{r=JSON.stringify(e)??"[object]"}catch{return"[object with circular reference]"}else r=String(e);return Oe(r)}import{existsSync as Y}from"node:fs";import{createRequire as Pe}from"node:module";import{join as q,resolve as we}from"node:path";import{fileURLToPath as Ee}from"node:url";import{existsSync as Se,readFileSync as ye}from"node:fs";function I(){if(process.platform!=="linux")return"gnu";try{let e=process.report?.getReport?.();if(e?.header?.glibcVersionRuntime)return"gnu";if(Array.isArray(e?.sharedObjects))return e.sharedObjects.some(n=>n.includes("libc.musl-")||n.includes("ld-musl-"))?"musl":"gnu"}catch{}try{if(Se("/usr/bin/ldd")&&ye("/usr/bin/ldd","utf8").includes("musl"))return"musl"}catch{}return"gnu"}function W(e=process.platform,r){let n=r??(e==="linux"?I():"gnu");return e==="linux"&&n==="musl"?"linuxmusl":e}function Te(){return`${W()}-${process.arch}`}function xe(){let{platform:e,arch:r}=process;switch(e){case"win32":return`win32-${r}-msvc`;case"darwin":return`darwin-${r}`;case"linux":return`linux-${r}-${I()}`;default:throw new Error(`Unsupported platform: ${e}/${r}`)}}function V(e,r){let n=Te(),c=`${e}.node`,i=`${e}.${xe()}.node`;for(let t of r){let o=we(t),S=q(o,"prebuilds",n,c);if(Y(S))return J(S);let v=q(o,i);if(Y(v))return J(v)}throw new Error(`Native addon "${e}" not found for ${n}.`)}function J(e){return Pe(Ee(import.meta.url))(e)}var O;function K(){if(process.platform==="win32"){if(O){if(O.kind==="ok")return O.addon;throw O.error}try{let e=_e();return O={kind:"ok",addon:e},e}catch(e){let r=e instanceof Error?e:new Error(`Failed to load Win32 native addon: ${G(e)}`);throw O={kind:"error",error:r},r}}}function _e(){let e=B.dirname(Ie(import.meta.url));return V("win32-native",[e,B.resolve(e,"..","native","win32")])}try{Ae.enableCompileCache?.()}catch{}var Fe=75;function ee(){if(process.stdin.isTTY&&typeof process.stdin.setRawMode=="function")try{process.stdin.setRawMode(!1)}catch{}if(process.stdout.isTTY)try{He(1,"\x1B[<u\x1B[?1049h\x1B[?1049l\x1B[?1006l\x1B[?1003l\x1B[?1002l\x1B[?2004l\x1B[?1004l\x1B[?25h\x1B[?2026l"+(process.env.TERM!=="dumb"?"\x1B[23;2t":""))}catch{}}var ae=Ne(ce(import.meta.url)),re=ie.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=K();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var w=process.argv.find(e=>L(e).startsWith("conpty_console_list_agent")),te=process.argv.find(e=>L(e)==="extension_bootstrap.mjs"),ne=te?oe(te):void 0,se=ne?.startsWith(oe(ae,"preloads")+$)?ne:void 0;if(w){let e=w.endsWith(".js")?w:w+".js";await import(A(e).href)}else if(se)await import(A(se).href);else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:r,body:n}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:r,body:n,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else if(process.env.COPILOT_RUN_APP==="1"||H(process.argv.slice(2))){let e=a(ae,"app.js"),r=M();if(re&&(j()||r)){let n=U().flatMap(i=>[a(i,"universal"),a(i,`${process.platform}-${process.arch}`)]),c=await D("app.js",...n);if(r){let i=c.find(t=>L(t)===r);i?e=a(i,"app.js"):process.stderr.write(`Warning: preferred version ${r} not found in package cache, using built-in version | ||
| `)}else c.length>0&&(e=a(c[0],"app.js"))}await import(A(e).href)}else{let r=function(){let s=process.env.COPILOT_HOME||a(process.env.HOME||process.env.USERPROFILE||"",".copilot");return a(s,"restart",`${e}.json`)},n=function(){let s=r();try{let u=z(s,"utf-8");return _(s,{force:!0}),JSON.parse(u)}catch{return}},c=function(){try{_(r(),{force:!0})}catch{}},i=function(){let s=process.env.COPILOT_HOME||a(process.env.HOME||process.env.USERPROFILE||"",".copilot");return a(s,"crash-context",`${e}.json`)},t=function(){try{let s=z(i(),"utf-8");return JSON.parse(s)}catch{return}},o=function(){try{_(i(),{force:!0})}catch{}},S=function(s,u){return new Promise(g=>{let l=Ce({input:process.stdin,output:process.stdout}),d=s.toString(16).toUpperCase();if(process.stdout.write(` | ||
| *** Copilot exited unexpectedly (exit code ${s} = 0x${d}) *** | ||
| `),u){let m=u.length>200?u.slice(0,200)+"\u2026":u;process.stdout.write(`Error: ${m} | ||
| `)}process.stdout.write(` | ||
@@ -19,13 +19,13 @@ A crash report can be saved locally. | ||
| `),f.question("Save crash report? [y/N] ",m=>{f.close(),g(m.trim().toLowerCase()==="y")})})},b=function(n,a){try{let g=_e(n);return g.startsWith(a+A)?Ae(g).isFile():!1}catch{return!1}},w=function(n,a){let g=Z?n:[...process.execArgv,oe(import.meta.url),...n],f=Ie(process.execPath,g,{stdio:"inherit",cwd:a,env:R({COPILOT_RUN_APP:"1",COPILOT_LOADER_PID:e})});process.env.COPILOT_LOADER_DEBUG&&process.stderr.write(`[loader] spawned app child: pid=${f.pid} (loader pid=${e}) | ||
| `);let d=l=>{try{f.kill(l)}catch{}},m=()=>d("SIGINT"),h=()=>d("SIGTERM"),T=()=>d("SIGHUP"),y=()=>d("SIGQUIT");process.on("SIGINT",m),process.on("SIGTERM",h),process.on("SIGHUP",T),process.on("SIGQUIT",y),f.on("error",l=>{process.off("SIGINT",m),process.off("SIGTERM",h),process.off("SIGHUP",T),process.off("SIGQUIT",y),c(),process.stderr.write(`Failed to start: ${l.message} | ||
| `),process.exit(1)}),f.on("exit",(l,k)=>{if(process.off("SIGINT",m),process.off("SIGTERM",h),process.off("SIGHUP",T),process.off("SIGQUIT",y),l===Ne){let v=s();if(v){let I=[...v.argv,"--resume",v.sessionId];w(I,v.cwd||a)}else w(n,a);return}if(c(),k)o(),z(),process.kill(process.pid,k);else if(l!==0){z();let v=r();v&&process.stdin.isTTY?S(l??1,v.lastError).then(async I=>{I&&await ce(v,l??1),o(),process.exit(l??1)}).catch(()=>{o(),process.exit(l??1)}):(o(),process.exit(l??1))}else o(),process.exit(0)})};Ce=t,He=s,Le=c,Fe=i,Ue=r,Me=o,je=S,De=b,Ge=w;let e=String(process.pid);async function ce(n,a){try{let g=new Date().toISOString().replace(/[:.]/g,"-"),f=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot"),d=u(f,"crash-reports",`crash-${n.sessionId}-${g}`);xe(d,{recursive:!0,mode:448}),X(u(d,"crash-context.json"),JSON.stringify(n,null,2),{mode:384});let m=["# Crash Report","",`**Exit code**: ${a}`,n.errorType?`**Error type**: ${n.errorType}`:"",n.lastError?`**Error**: ${n.lastError}`:"",`**Timestamp**: ${new Date().toISOString()}`,`**Session ID**: ${n.sessionId}`,`**Working directory**: ${n.cwd}`,n.stackTrace?` | ||
| `),l.question("Save crash report? [y/N] ",m=>{l.close(),g(m.trim().toLowerCase()==="y")})})},v=function(s,u){try{let g=Re(s);return g.startsWith(u+$)?ke(g).isFile():!1}catch{return!1}},y=function(s,u){let g=re?s:[...process.execArgv,ce(import.meta.url),...s],l=$e(process.execPath,g,{stdio:"inherit",cwd:u,env:k({COPILOT_RUN_APP:"1",COPILOT_LOADER_PID:e})});process.env.COPILOT_LOADER_DEBUG&&process.stderr.write(`[loader] spawned app child: pid=${l.pid} (loader pid=${e}) | ||
| `);let d=f=>{try{l.kill(f)}catch{}},m=()=>d("SIGINT"),h=()=>d("SIGTERM"),E=()=>d("SIGHUP"),T=()=>d("SIGQUIT");process.on("SIGINT",m),process.on("SIGTERM",h),process.on("SIGHUP",E),process.on("SIGQUIT",T),l.on("error",f=>{process.off("SIGINT",m),process.off("SIGTERM",h),process.off("SIGHUP",E),process.off("SIGQUIT",T),c(),process.stderr.write(`Failed to start: ${f.message} | ||
| `),process.exit(1)}),l.on("exit",(f,R)=>{if(process.off("SIGINT",m),process.off("SIGTERM",h),process.off("SIGHUP",E),process.off("SIGQUIT",T),f===Fe){let b=n();if(b){let x=[...b.argv,"--resume",b.sessionId];y(x,b.cwd||u)}else y(s,u);return}if(c(),R)o(),ee(),process.kill(process.pid,R);else if(f!==0){ee();let b=t();b&&process.stdin.isTTY?S(f??1,b.lastError).then(async x=>{x&&await ue(b,f??1),o(),process.exit(f??1)}).catch(()=>{o(),process.exit(f??1)}):(o(),process.exit(f??1))}else o(),process.exit(0)})};je=r,Me=n,Ue=c,De=i,Ge=t,We=o,Ye=S,qe=v,Je=y;let e=String(process.pid);async function ue(s,u){try{let g=new Date().toISOString().replace(/[:.]/g,"-"),l=process.env.COPILOT_HOME||a(process.env.HOME||process.env.USERPROFILE||"",".copilot"),d=a(l,"crash-reports",`crash-${s.sessionId}-${g}`);Le(d,{recursive:!0,mode:448}),Z(a(d,"crash-context.json"),JSON.stringify(s,null,2),{mode:384});let m=["# Crash Report","",`**Exit code**: ${u}`,s.errorType?`**Error type**: ${s.errorType}`:"",s.lastError?`**Error**: ${s.lastError}`:"",`**Timestamp**: ${new Date().toISOString()}`,`**Session ID**: ${s.sessionId}`,`**Working directory**: ${s.cwd}`,s.stackTrace?` | ||
| ## Stack Trace | ||
| \`\`\` | ||
| ${n.stackTrace} | ||
| ${s.stackTrace} | ||
| \`\`\``:"",""].filter(Boolean).join(` | ||
| `);if(X(u(d,"feedback.md"),m,{mode:384}),n.sessionFilePath&&b(n.sessionFilePath,f))try{let h=u(d,"events.jsonl");K(n.sessionFilePath,h),V(h,384)}catch{}if(n.logFilePath&&b(n.logFilePath,f))try{let h=u(d,"process.log");K(n.logFilePath,h),V(h,384)}catch{}process.stdout.write(` | ||
| Crash report saved to: ${d}${A} | ||
| `);if(Z(a(d,"feedback.md"),m,{mode:384}),s.sessionFilePath&&v(s.sessionFilePath,l))try{let h=a(d,"events.jsonl");X(s.sessionFilePath,h),Q(h,384)}catch{}if(s.logFilePath&&v(s.logFilePath,l))try{let h=a(d,"process.log");X(s.logFilePath,h),Q(h,384)}catch{}process.stdout.write(` | ||
| Crash report saved to: ${d}${$} | ||
| `)}catch(g){process.stderr.write(`Failed to create crash report: ${String(g)} | ||
| `)}}w(process.argv.slice(2),process.cwd())}var Ce,He,Le,Fe,Ue,Me,je,De,Ge; | ||
| `)}}y(process.argv.slice(2),process.cwd())}var je,Me,Ue,De,Ge,We,Ye,qe,Je; |
+1
-1
@@ -7,2 +7,2 @@ #!/usr/bin/env node | ||
| import{spawnSync as e}from"node:child_process";import{fileURLToPath as s}from"node:url";async function t(){try{const o=s(import.meta.resolve(`@github/copilot-${process.platform}-${process.arch}`)),r=e(o,process.argv.slice(2),{stdio:"inherit"});process.exit(r.status??1)}catch{}parseInt(process.versions.node.split(".")[0],10)<24&&(console.error(`GitHub Copilot CLI requires Node.js v24 or higher. Currently using v${process.versions.node}.`),process.exit(1));try{await import("./index.js")}catch(o){console.error("Failed to load GitHub Copilot CLI:",o),process.exit(1)}}t().catch(()=>{}); | ||
| import{spawnSync as o}from"node:child_process";import{fileURLToPath as i}from"node:url";async function n(){for(const r of c())try{const t=i(import.meta.resolve(`@github/copilot-${r}-${process.arch}`)),s=o(t,process.argv.slice(2),{stdio:"inherit"});if(s.error)throw s.error;process.exit(s.status??1)}catch{}parseInt(process.versions.node.split(".")[0],10)<24&&(console.error(`GitHub Copilot CLI requires Node.js v24 or higher. Currently using v${process.versions.node}.`),process.exit(1));try{await import("./index.js")}catch(r){console.error("Failed to load GitHub Copilot CLI:",r),process.exit(1)}}n().catch(()=>{});function c(){return process.platform==="linux"?a()?["linuxmusl","linux"]:["linux"]:[process.platform]}function a(){if(process.platform!=="linux")return!1;try{const e=process.report?.getReport?.();return e?.header?.glibcVersionRuntime?!1:Array.isArray(e?.sharedObjects)?e.sharedObjects.some(r=>r.includes("libc.musl-")||r.includes("ld-musl-")):!0}catch{return!0}} |
+10
-8
| { | ||
| "name": "@github/copilot", | ||
| "description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.", | ||
| "version": "1.0.49-1", | ||
| "version": "1.0.49-2", | ||
| "license": "SEE LICENSE IN LICENSE.md", | ||
@@ -70,12 +70,14 @@ "type": "module", | ||
| "buildMetadata": { | ||
| "gitCommit": "e33b10c" | ||
| "gitCommit": "0f895b5" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@github/copilot-linux-x64": "1.0.49-1", | ||
| "@github/copilot-linux-arm64": "1.0.49-1", | ||
| "@github/copilot-darwin-x64": "1.0.49-1", | ||
| "@github/copilot-darwin-arm64": "1.0.49-1", | ||
| "@github/copilot-win32-x64": "1.0.49-1", | ||
| "@github/copilot-win32-arm64": "1.0.49-1" | ||
| "@github/copilot-linux-x64": "1.0.49-2", | ||
| "@github/copilot-linux-arm64": "1.0.49-2", | ||
| "@github/copilot-linuxmusl-x64": "1.0.49-2", | ||
| "@github/copilot-linuxmusl-arm64": "1.0.49-2", | ||
| "@github/copilot-darwin-x64": "1.0.49-2", | ||
| "@github/copilot-darwin-arm64": "1.0.49-2", | ||
| "@github/copilot-win32-x64": "1.0.49-2", | ||
| "@github/copilot-win32-arm64": "1.0.49-2" | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 22 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 22 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
267973883
15.02%324
2.86%163112
0.41%8
33.33%9
12.5%121
8.04%