@github/copilot-linuxmusl-arm64
Advanced tools
+6
-25
@@ -9,27 +9,8 @@ #!/usr/bin/env node | ||
| var tt=Object.create;var K=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var X=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var it=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nt(t))!st.call(e,o)&&o!==r&&K(e,o,{get:()=>t[o],enumerable:!(s=rt(t,o))||s.enumerable});return e};var ct=(e,t,r)=>(r=e!=null?tt(ot(e)):{},it(t||!e||!e.__esModule?K(r,"default",{value:e,enumerable:!0}):r,e));var de=k((wr,le)=>{"use strict";var ue=()=>process.platform==="linux",N=null,Pt=()=>{if(!N)if(ue()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,N=process.report.getReport(),process.report.excludeNetwork=e}else N={};return N};le.exports={isLinux:ue,getReport:Pt}});var pe=k((xr,fe)=>{"use strict";var _=X("fs"),Ot="/usr/bin/ldd",wt="/proc/self/exe",A=2048,xt=e=>{let t=_.openSync(e,"r"),r=Buffer.alloc(A),s=_.readSync(t,r,0,A,0);return _.close(t,()=>{}),r.subarray(0,s)},Tt=e=>new Promise((t,r)=>{_.open(e,"r",(s,o)=>{if(s)r(s);else{let n=Buffer.alloc(A);_.read(o,n,0,A,0,(c,d)=>{t(n.subarray(0,d)),_.close(o,()=>{})})}})});fe.exports={LDD_PATH:Ot,SELF_PATH:wt,readFileSync:xt,readFile:Tt}});var ge=k((Tr,me)=>{"use strict";var It=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),s=e.readUInt16LE(56);for(let o=0;o<s;o++){let n=t+o*r;if(e.readUInt32LE(n)===3){let d=e.readUInt32LE(n+8),O=e.readUInt32LE(n+32);return e.subarray(d,d+O).toString().replace(/\0.*$/g,"")}}return null};me.exports={interpreterPath:It}});var Ne=k((Ir,Re)=>{"use strict";var ye=X("child_process"),{isLinux:L,getReport:be}=de(),{LDD_PATH:$,SELF_PATH:ve,readFile:V,readFileSync:W}=pe(),{interpreterPath:Se}=ge(),y,b,v,Ee="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",T="",Pe=()=>T||new Promise(e=>{ye.exec(Ee,(t,r)=>{T=t?" ":r,e(T)})}),Oe=()=>{if(!T)try{T=ye.execSync(Ee,{encoding:"utf8"})}catch{T=" "}return T},P="glibc",we=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,I="musl",_t=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),xe=()=>{let e=be();return e.header&&e.header.glibcVersionRuntime?P:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(_t)?I:null},Te=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(P)?P:r&&r.includes(I)?I:null},Ie=e=>{if(e){if(e.includes("/ld-musl-"))return I;if(e.includes("/ld-linux-"))return P}return null},_e=e=>(e=e.toString(),e.includes("musl")?I:e.includes("GNU C Library")?P:null),Lt=async()=>{if(b!==void 0)return b;b=null;try{let e=await V($);b=_e(e)}catch{}return b},Ft=()=>{if(b!==void 0)return b;b=null;try{let e=W($);b=_e(e)}catch{}return b},Ct=async()=>{if(y!==void 0)return y;y=null;try{let e=await V(ve),t=Se(e);y=Ie(t)}catch{}return y},kt=()=>{if(y!==void 0)return y;y=null;try{let e=W(ve),t=Se(e);y=Ie(t)}catch{}return y},Le=async()=>{let e=null;if(L()&&(e=await Ct(),!e&&(e=await Lt(),e||(e=xe()),!e))){let t=await Pe();e=Te(t)}return e},Fe=()=>{let e=null;if(L()&&(e=kt(),!e&&(e=Ft(),e||(e=xe()),!e))){let t=Oe();e=Te(t)}return e},Rt=async()=>L()&&await Le()!==P,Nt=()=>L()&&Fe()!==P,At=async()=>{if(v!==void 0)return v;v=null;try{let t=(await V($)).match(we);t&&(v=t[1])}catch{}return v},$t=()=>{if(v!==void 0)return v;v=null;try{let t=W($).match(we);t&&(v=t[1])}catch{}return v},Ce=()=>{let e=be();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},he=e=>e.trim().split(/\s+/)[1],ke=e=>{let[t,r,s]=e.split(/[\r\n]+/);return t&&t.includes(P)?he(t):r&&s&&r.includes(I)?he(s):null},Ht=async()=>{let e=null;if(L()&&(e=await At(),e||(e=Ce()),!e)){let t=await Pe();e=ke(t)}return e},Ut=()=>{let e=null;if(L()&&(e=$t(),e||(e=Ce()),!e)){let t=Oe();e=ke(t)}return e};Re.exports={GLIBC:P,MUSL:I,family:Le,familySync:Fe,isNonGlibcLinux:Rt,isNonGlibcLinuxSync:Nt,version:Ht,versionSync:Ut}});import Kt from"node:module";import{spawn as Xt}from"node:child_process";import{chmodSync as Ve,copyFileSync as We,mkdirSync as zt,readFileSync as qe,realpathSync as Qt,rmSync as q,statSync as Zt,writeFileSync as Je,writeSync as er}from"node:fs";import{basename as Qe,dirname as tr,join as u,sep as Ye}from"node:path";import{createInterface as rr}from"node:readline";import*as Ze from"node:sea";import{fileURLToPath as et,pathToFileURL as M}from"node:url";var at=new Set;function z(e,t){let r=Object.create(null);if(e)for(let[o,n]of Object.entries(e))r[o]=n;let s=t??at;return new Proxy(process.env,{get(o,n){if(typeof n=="string"){if(Object.hasOwn(r,n))return r[n];if(!s.has(n))return process.env[n]}},set(o,n,c){return r[n]=c,!0},has(o,n){return typeof n!="string"?!1:Object.hasOwn(r,n)?r[n]!==void 0:s.has(n)?!1:n in process.env},ownKeys(o){let n=new Set(Object.keys(process.env));for(let c of s)n.delete(c);for(let c of Object.keys(r))r[c]!==void 0?n.add(c):n.delete(c);return[...n]},getOwnPropertyDescriptor(o,n){if(typeof n!="string")return;let c;if(Object.hasOwn(r,n))c=r[n];else{if(s.has(n))return;c=process.env[n]}if(c!==void 0)return{value:c,writable:!0,enumerable:!0,configurable:!0}},deleteProperty(o,n){return r[n]=void 0,!0}})}import{existsSync as ut}from"node:fs";import{basename as lt,resolve as dt}from"node:path";var Q="extension_bootstrap.mjs";function Z(e,t,r=ut){let s=e.find(c=>lt(c)===Q);if(!s)return;process.stderr.write(`[extension-fork] resolveBootstrapPath: __dir=${t}, argv-bootstrap=${s} | ||
| `);let o=dt(t,"preloads",Q),n=r(o);if(process.stderr.write(`[extension-fork] resolveBootstrapPath: localBootstrap=${o}, localExists=${n} | ||
| `),n)return o}var ft=new Set(["--server","--headless","--acp"]),pt=new Set(["completion","help","init","login","mcp","plugin","update","version"]);function mt(e){return e==="--prompt"||e.startsWith("--prompt=")||e==="-p"||e.startsWith("-p")&&e.length>2}function gt(e){if(e.some(r=>ft.has(r)||mt(r)))return!0;let t=e.find(r=>!r.startsWith("-"));return t!==void 0&&pt.has(t)}function ee(e){return gt(e)}import{readdir as ht,access as yt,constants as bt}from"node:fs/promises";import{join as f,basename as te}from"node:path";import{homedir as R}from"node:os";function ne(){return process.env.XDG_CACHE_HOME||f(R(),".cache")}function oe(){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 se(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function vt(){if(process.platform==="darwin")return f(R(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||f(R(),".cache");return f(e,"copilot")}return f(ne(),"copilot")}function ie(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(f(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(f(vt(),"pkg")),e.push(f(ne(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(f(process.env.COPILOT_HOME,"pkg")),e.push(f(R(),".copilot","pkg")),[...new Set(e)]}function re(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}function St(e,t){let r=re(e),s=re(t);if(!r&&!s)return 0;if(!r)return-1;if(!s)return 1;for(let c=0;c<3;c++)if(r[c]!==s[c])return r[c]-s[c];let o=e.includes("-"),n=t.includes("-");return o!==n?o?-1:1:e.localeCompare(t)}async function ce(e,...t){let r=[];for(let s of t){let o;try{o=await ht(s)}catch{continue}for(let n of o){let c=f(s,n);try{await yt(f(c,e),bt.R_OK),r.push(c)}catch{continue}}}return r.sort((s,o)=>{let n=St(te(o),te(s));return n!==0?n:s.localeCompare(o)}),r}import je from"node:path";import{fileURLToPath as Yt}from"node:url";function Et(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),r=e.substring(0,t).trim();return r?`${r} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function ae(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 Et(t)}import{createRequire as Mt}from"node:module";import{platform as Dt,type as jt}from"node:os";import{join as $e,resolve as Gt}from"node:path";import{fileURLToPath as Bt}from"node:url";var H=ct(Ne(),1);function U(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??H.familySync)()===H.MUSL?"musl":"gnu"}function Ae(e=process.platform,t){let r=t??(e==="linux"?U():"gnu");return e==="linux"&&r==="musl"?"linuxmusl":e}function Vt(){let e=Ue(),t=e==="linux"?U({platform:e}):"gnu";return`${Ae(e,t)}-${process.arch}`}function Wt(){let e=Ue(),{arch:t}=process;switch(e){case"win32":return`win32-${t}-msvc`;case"darwin":return`darwin-${t}`;case"linux":return`linux-${t}-${U({platform:e})}`;default:throw new Error(`Unsupported platform: ${e}/${t}`)}}var p;function Ue(){if(p!==void 0)return p;switch(jt()){case"Windows_NT":p="win32";break;case"Darwin":p="darwin";break;case"Linux":p="linux";break;case"AIX":p="aix";break;case"FreeBSD":case"DragonFly":p="freebsd";break;case"OpenBSD":p="openbsd";break;case"NetBSD":p="netbsd";break;case"SunOS":p="sunos";break;default:p=Dt();break}return p}function Me(e,t){let r=Vt(),s=`${e}.node`,o=`${e}.${Wt()}.node`,n=[];for(let d of t){let O=Gt(d),C=$e(O,"prebuilds",r,s),w=He(C);if(w.ok)return w.value;n.push({path:C,err:w.err});let i=$e(O,o),a=He(i);if(a.ok)return a.value;n.push({path:i,err:a.err})}let c=n.map(d=>` ${d.path}: ${qt(d.err)}`).join(` | ||
| var He=Object.create;var D=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty;var j=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ve=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of je(t))!Ue.call(e,n)&&n!==r&&D(e,n,{get:()=>t[n],enumerable:!(o=De(t,n))||o.enumerable});return e};var Be=(e,t,r)=>(r=e!=null?He(Me(e)):{},Ve(t||!e||!e.__esModule?D(r,"default",{value:e,enumerable:!0}):r,e));var X=v((Mt,K)=>{"use strict";var Y=()=>process.platform==="linux",_=null,Ke=()=>{if(!_)if(Y()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,_=process.report.getReport(),process.report.excludeNetwork=e}else _={};return _};K.exports={isLinux:Y,getReport:Ke}});var Q=v((Ut,z)=>{"use strict";var y=j("fs"),Xe="/usr/bin/ldd",ze="/proc/self/exe",C=2048,Qe=e=>{let t=y.openSync(e,"r"),r=Buffer.alloc(C),o=y.readSync(t,r,0,C,0);return y.close(t,()=>{}),r.subarray(0,o)},Ze=e=>new Promise((t,r)=>{y.open(e,"r",(o,n)=>{if(o)r(o);else{let s=Buffer.alloc(C);y.read(n,s,0,C,0,(i,c)=>{t(s.subarray(0,c)),y.close(n,()=>{})})}})});z.exports={LDD_PATH:Xe,SELF_PATH:ze,readFileSync:Qe,readFile:Ze}});var ee=v((Vt,Z)=>{"use strict";var et=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),o=e.readUInt16LE(56);for(let n=0;n<o;n++){let s=t+n*r;if(e.readUInt32LE(s)===3){let c=e.readUInt32LE(s+8),h=e.readUInt32LE(s+32);return e.subarray(c,c+h).toString().replace(/\0.*$/g,"")}}return null};Z.exports={interpreterPath:et}});var Ee=v((Bt,be)=>{"use strict";var re=j("child_process"),{isLinux:b,getReport:ne}=X(),{LDD_PATH:w,SELF_PATH:oe,readFile:A,readFileSync:I}=Q(),{interpreterPath:se}=ee(),l,f,d,ie="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",m="",ce=()=>m||new Promise(e=>{re.exec(ie,(t,r)=>{m=t?" ":r,e(m)})}),ae=()=>{if(!m)try{m=re.execSync(ie,{encoding:"utf8"})}catch{m=" "}return m},p="glibc",ue=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,g="musl",tt=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),le=()=>{let e=ne();return e.header&&e.header.glibcVersionRuntime?p:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(tt)?g:null},fe=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(p)?p:r&&r.includes(g)?g:null},de=e=>{if(e){if(e.includes("/ld-musl-"))return g;if(e.includes("/ld-linux-"))return p}return null},pe=e=>(e=e.toString(),e.includes("musl")?g:e.includes("GNU C Library")?p:null),rt=async()=>{if(f!==void 0)return f;f=null;try{let e=await A(w);f=pe(e)}catch{}return f},nt=()=>{if(f!==void 0)return f;f=null;try{let e=I(w);f=pe(e)}catch{}return f},ot=async()=>{if(l!==void 0)return l;l=null;try{let e=await A(oe),t=se(e);l=de(t)}catch{}return l},st=()=>{if(l!==void 0)return l;l=null;try{let e=I(oe),t=se(e);l=de(t)}catch{}return l},me=async()=>{let e=null;if(b()&&(e=await ot(),!e&&(e=await rt(),e||(e=le()),!e))){let t=await ce();e=fe(t)}return e},ge=()=>{let e=null;if(b()&&(e=st(),!e&&(e=nt(),e||(e=le()),!e))){let t=ae();e=fe(t)}return e},it=async()=>b()&&await me()!==p,ct=()=>b()&&ge()!==p,at=async()=>{if(d!==void 0)return d;d=null;try{let t=(await A(w)).match(ue);t&&(d=t[1])}catch{}return d},ut=()=>{if(d!==void 0)return d;d=null;try{let t=I(w).match(ue);t&&(d=t[1])}catch{}return d},he=()=>{let e=ne();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},te=e=>e.trim().split(/\s+/)[1],ye=e=>{let[t,r,o]=e.split(/[\r\n]+/);return t&&t.includes(p)?te(t):r&&o&&r.includes(g)?te(o):null},lt=async()=>{let e=null;if(b()&&(e=await at(),e||(e=he()),!e)){let t=await ce();e=ye(t)}return e},ft=()=>{let e=null;if(b()&&(e=ut(),e||(e=he()),!e)){let t=ae();e=ye(t)}return e};be.exports={GLIBC:p,MUSL:g,family:me,familySync:ge,isNonGlibcLinux:it,isNonGlibcLinuxSync:ct,version:lt,versionSync:ft}});import St from"node:module";import{basename as kt,dirname as Tt,join as At}from"node:path";import*as $e from"node:sea";import{fileURLToPath as It,pathToFileURL as P}from"node:url";import{basename as dt,join as N}from"node:path";var M="0.0.1";import{readdir as qe,access as Ge,constants as We}from"node:fs/promises";import{join as a,basename as U}from"node:path";import{homedir as x}from"node:os";function B(){return process.env.XDG_CACHE_HOME||a(x(),".cache")}function q(){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 G(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function Je(){if(process.platform==="darwin")return a(x(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||a(x(),".cache");return a(e,"copilot")}return a(B(),"copilot")}function W(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(a(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(a(Je(),"pkg")),e.push(a(B(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(a(process.env.COPILOT_HOME,"pkg")),e.push(a(x(),".copilot","pkg")),[...new Set(e)]}function V(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}function Ye(e,t){let r=V(e),o=V(t);if(!r&&!o)return 0;if(!r)return-1;if(!o)return 1;for(let i=0;i<3;i++)if(r[i]!==o[i])return r[i]-o[i];let n=e.includes("-"),s=t.includes("-");return n!==s?n?-1:1:e.localeCompare(t)}async function J(e,...t){let r=[];for(let o of t){let n;try{n=await qe(o)}catch{continue}for(let s of n){let i=a(o,s);try{await Ge(a(i,e),We.R_OK),r.push(i)}catch{continue}}}return r.sort((o,n)=>{let s=Ye(U(n),U(o));return s!==0?s:o.localeCompare(n)}),r}import{join as xe}from"node:path";var O=Be(Ee(),1);function L(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??O.familySync)()===O.MUSL?"musl":"gnu"}function F(e=process.platform,t){let r=t??(e==="linux"?L():"gnu");return e==="linux"&&r==="musl"?"linuxmusl":e}function ve(e=process.platform,t,r=process.arch){return`${F(e,t)}-${r}`}function _e(){let e=ve();return W().flatMap(t=>[xe(t,"universal"),xe(t,e)])}function pt(){return process.env.COPILOT_CLI_VERSION?process.env.COPILOT_CLI_VERSION:"1.0.64-2"}async function Ce(e,t){let r=N(e,"app.js"),o=pt()===M,n=G();if(t&&(n||q()&&!o)){let s=_e(),i=await J("app.js",...s);if(n){let c=i.find(h=>dt(h)===n);c?r=N(c,"app.js"):process.stderr.write(`Warning: preferred version ${n} not found in package cache, using built-in version | ||
| `)}else i.length>0&&(r=N(i[0],"app.js"))}return r}import{existsSync as mt}from"node:fs";import{basename as gt,resolve as ht}from"node:path";var we="extension_bootstrap.mjs";function Oe(e,t,r=mt){let o=e.find(i=>gt(i)===we);if(!o)return;process.stderr.write(`[extension-fork] resolveBootstrapPath: __dir=${t}, argv-bootstrap=${o} | ||
| `);let n=ht(t,"preloads",we),s=r(n);if(process.stderr.write(`[extension-fork] resolveBootstrapPath: localBootstrap=${n}, localExists=${s} | ||
| `),s)return n}import Ie from"node:path";import{fileURLToPath as Pt}from"node:url";function yt(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),r=e.substring(0,t).trim();return r?`${r} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function Le(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 yt(t)}import{createRequire as bt}from"node:module";import{platform as Et,type as vt}from"node:os";import{join as Pe,resolve as xt}from"node:path";import{fileURLToPath as _t}from"node:url";function Ct(){let e=ke(),t=e==="linux"?L({platform:e}):"gnu";return`${F(e,t)}-${process.arch}`}function wt(){let e=ke(),{arch:t}=process;switch(e){case"win32":return`win32-${t}-msvc`;case"darwin":return`darwin-${t}`;case"linux":return`linux-${t}-${L({platform:e})}`;default:throw new Error(`Unsupported platform: ${e}/${t}`)}}var u;function ke(){if(u!==void 0)return u;switch(vt()){case"Windows_NT":u="win32";break;case"Darwin":u="darwin";break;case"Linux":u="linux";break;case"AIX":u="aix";break;case"FreeBSD":case"DragonFly":u="freebsd";break;case"OpenBSD":u="openbsd";break;case"NetBSD":u="netbsd";break;case"SunOS":u="sunos";break;default:u=Et();break}return u}function Te(e,t){let r=Ct(),o=`${e}.node`,n=`${e}.${wt()}.node`,s=[];for(let c of t){let h=xt(c),$=Pe(h,"prebuilds",r,o),k=Se($);if(k.ok)return k.value;s.push({path:$,err:k.err});let H=Pe(h,n),T=Se(H);if(T.ok)return T.value;s.push({path:H,err:T.err})}let i=s.map(c=>` ${c.path}: ${Ot(c.err)}`).join(` | ||
| `);throw new Error(`Native addon "${e}" not found for ${r}. Tried: | ||
| ${c}`)}function qt(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}function He(e){try{return{ok:!0,value:Jt(e)}}catch(t){return{ok:!1,err:t}}}function Jt(e){return Mt(Bt(import.meta.url))(e)}var F,De=je.dirname(Yt(import.meta.url));function Ge(){if(F){if(F.kind==="ok")return F.addon;throw F.error}try{let e=Me("cli-native",[De,je.resolve(De,"..","native","cli")]);return F={kind:"ok",addon:e},e}catch(e){let t=e instanceof Error?e:new Error(`Failed to load cli-native addon: ${ae(e)}`);throw F={kind:"error",error:t},t}}function Be(){if(process.platform==="win32")return Ge()}try{Kt.enableCompileCache?.()}catch{}var nr=75;function Ke(){if(process.stdin.isTTY&&typeof process.stdin.setRawMode=="function")try{process.stdin.setRawMode(!1)}catch{}if(process.stdout.isTTY)try{er(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 J=tr(et(import.meta.url)),Xe=Ze.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=Be();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var D=process.argv.find(e=>Qe(e).startsWith("conpty_console_list_agent")),ze=Z(process.argv,J);if(D){let e=D.endsWith(".js")?D:D+".js";await import(M(e).href)}else if(ze)await import(M(ze).href);else if(process.env.COPILOT_VOICE_SERVER_MODE==="1"){let e=u(J,"voice-server.js");try{let{runVoiceServer:t}=await import(M(e).href);await t()}catch(t){process.stderr.write(`voice server: fatal at ${e}: ${t.stack??String(t)} | ||
| `),process.exit(1)}}else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:t,body:r}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:t,body:r,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else if(process.env.COPILOT_RUN_APP==="1"||ee(process.argv.slice(2))){let e=u(J,"app.js"),t=se();if(Xe&&(oe()||t)){let r=ie().flatMap(o=>[u(o,"universal"),u(o,`${process.platform}-${process.arch}`)]),s=await ce("app.js",...r);if(t){let o=s.find(n=>Qe(n)===t);o?e=u(o,"app.js"):process.stderr.write(`Warning: preferred version ${t} not found in package cache, using built-in version | ||
| `)}else s.length>0&&(e=u(s[0],"app.js"))}await import(M(e).href)}else{let t=function(){let i=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot");return u(i,"restart",`${e}.json`)},r=function(){let i=t();try{let a=qe(i,"utf-8");return q(i,{force:!0}),JSON.parse(a)}catch{return}},s=function(){try{q(t(),{force:!0})}catch{}},o=function(){let i=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot");return u(i,"crash-context",`${e}.json`)},n=function(){try{let i=qe(o(),"utf-8");return JSON.parse(i)}catch{return}},c=function(){try{q(o(),{force:!0})}catch{}},d=function(i,a){return new Promise(h=>{let m=rr({input:process.stdin,output:process.stdout}),l=i.toString(16).toUpperCase();if(process.stdout.write(` | ||
| *** Copilot exited unexpectedly (exit code ${i} = 0x${l}) *** | ||
| `),a){let S=a.length>200?a.slice(0,200)+"\u2026":a;process.stdout.write(`Error: ${S} | ||
| `)}process.stdout.write(` | ||
| A crash report can be saved locally. | ||
| It will include session events, process logs, and error details. | ||
| The report may contain file paths and conversation context. | ||
| `),m.question("Save crash report? [y/N] ",S=>{m.close(),h(S.trim().toLowerCase()==="y")})})},O=function(i,a){try{let h=Qt(i);return h.startsWith(a+Ye)?Zt(h).isFile():!1}catch{return!1}},w=function(i,a){let h=Xe?i:[...process.execArgv,et(import.meta.url),...i],m=Xt(process.execPath,h,{stdio:"inherit",cwd:a,env:z({COPILOT_RUN_APP:"1",COPILOT_LOADER_PID:e})});process.env.COPILOT_LOADER_DEBUG&&process.stderr.write(`[loader] spawned app child: pid=${m.pid} (loader pid=${e}) | ||
| `);let l=g=>{try{m.kill(g)}catch{}},S=()=>l("SIGINT"),E=()=>l("SIGTERM"),j=()=>l("SIGHUP"),G=()=>l("SIGQUIT");process.on("SIGINT",S),process.on("SIGTERM",E),process.on("SIGHUP",j),process.on("SIGQUIT",G),m.on("error",g=>{process.off("SIGINT",S),process.off("SIGTERM",E),process.off("SIGHUP",j),process.off("SIGQUIT",G),s(),process.stderr.write(`Failed to start: ${g.message} | ||
| `),process.exit(1)}),m.on("exit",(g,Y)=>{if(process.off("SIGINT",S),process.off("SIGTERM",E),process.off("SIGHUP",j),process.off("SIGQUIT",G),g===nr){let x=r();if(x){let B=[...x.argv,"--session-id",x.sessionId];w(B,x.cwd||a)}else w(i,a);return}if(s(),Y)c(),Ke(),process.kill(process.pid,Y);else if(g!==0){Ke();let x=n();x&&process.stdin.isTTY?d(g??1,x.lastError).then(async B=>{B&&await C(x,g??1),c(),process.exit(g??1)}).catch(()=>{c(),process.exit(g??1)}):(c(),process.exit(g??1))}else c(),process.exit(0)})};or=t,sr=r,ir=s,cr=o,ar=n,ur=c,lr=d,dr=O,fr=w;let e=String(process.pid);async function C(i,a){try{let h=new Date().toISOString().replace(/[:.]/g,"-"),m=process.env.COPILOT_HOME||u(process.env.HOME||process.env.USERPROFILE||"",".copilot"),l=u(m,"crash-reports",`crash-${i.sessionId}-${h}`);zt(l,{recursive:!0,mode:448}),Je(u(l,"crash-context.json"),JSON.stringify(i,null,2),{mode:384});let S=["# Crash Report","",`**Exit code**: ${a}`,i.errorType?`**Error type**: ${i.errorType}`:"",i.lastError?`**Error**: ${i.lastError}`:"",`**Timestamp**: ${new Date().toISOString()}`,`**Session ID**: ${i.sessionId}`,`**Working directory**: ${i.cwd}`,i.stackTrace?` | ||
| ## Stack Trace | ||
| \`\`\` | ||
| ${i.stackTrace} | ||
| \`\`\``:"",""].filter(Boolean).join(` | ||
| `);if(Je(u(l,"feedback.md"),S,{mode:384}),i.sessionFilePath&&O(i.sessionFilePath,m))try{let E=u(l,"events.jsonl");We(i.sessionFilePath,E),Ve(E,384)}catch{}if(i.logFilePath&&O(i.logFilePath,m))try{let E=u(l,"process.log");We(i.logFilePath,E),Ve(E,384)}catch{}process.stdout.write(` | ||
| Crash report saved to: ${l}${Ye} | ||
| `)}catch(h){process.stderr.write(`Failed to create crash report: ${String(h)} | ||
| `)}}w(process.argv.slice(2),process.cwd())}var or,sr,ir,cr,ar,ur,lr,dr,fr; | ||
| ${i}`)}function Ot(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}function Se(e){try{return{ok:!0,value:Lt(e)}}catch(t){return{ok:!1,err:t}}}function Lt(e){return bt(_t(import.meta.url))(e)}var E,Ae=Ie.dirname(Pt(import.meta.url));function Fe(){if(E){if(E.kind==="ok")return E.addon;throw E.error}try{let e=Te("cli-native",[Ae,Ie.resolve(Ae,"..","native","cli")]);return E={kind:"ok",addon:e},e}catch(e){let t=e instanceof Error?e:new Error(`Failed to load cli-native addon: ${Le(e)}`);throw E={kind:"error",error:t},t}}function Ne(){if(process.platform==="win32")return Fe()}try{St.enableCompileCache?.()}catch{}var R=Tt(It(import.meta.url)),Ft=$e.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=Ne();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var S=process.argv.find(e=>kt(e).startsWith("conpty_console_list_agent")),Re=Oe(process.argv,R);if(S){let e=S.endsWith(".js")?S:S+".js";await import(P(e).href)}else if(Re)await import(P(Re).href);else if(process.env.COPILOT_VOICE_SERVER_MODE==="1"){let e=At(R,"voice-server.js");try{let{runVoiceServer:t}=await import(P(e).href);await t()}catch(t){process.stderr.write(`voice server: fatal at ${e}: ${t.stack??String(t)} | ||
| `),process.exit(1)}}else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:t,body:r}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:t,body:r,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else{let e=await Ce(R,Ft);await import(P(e).href)} |
+1
-1
| { | ||
| "name": "@github/copilot-linuxmusl-arm64", | ||
| "version": "1.0.64-1", | ||
| "version": "1.0.64-2", | ||
| "description": "GitHub Copilot CLI for linuxmusl-arm64", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
@@ -1,2 +0,2 @@ | ||
| (()=>{const stack=new Error().stack;stack&&(globalThis._sentryDebugIds=globalThis._sentryDebugIds||{},globalThis._sentryDebugIds[stack]="b9574cfd-c34f-573a-bb44-bcc9523e9ce0",globalThis._sentryDebugIdIdentifier="sentry-dbid-b9574cfd-c34f-573a-bb44-bcc9523e9ce0");})(); | ||
| (()=>{const stack=new Error().stack;stack&&(globalThis._sentryDebugIds=globalThis._sentryDebugIds||{},globalThis._sentryDebugIds[stack]="49025cfe-73d3-5d32-8006-df3826a84f3a",globalThis._sentryDebugIdIdentifier="sentry-dbid-49025cfe-73d3-5d32-8006-df3826a84f3a");})(); | ||
@@ -53,4 +53,4 @@ /*--------------------------------------------------------------------------------------------- | ||
| const __dirname = __path.dirname(__filename); | ||
| import{parentPort as T,workerData as B}from"node:worker_threads";var m=class{initialQueue=[];initialQueueResolvers=Promise.withResolvers();logWriter=null;writePromise=this.initialQueueResolvers.promise;setLogWriter(r){this.logWriter=r;for(let t of this.initialQueue)this.writePromise=this.logWriter.writeLog(t.method,t.message);this.initialQueue=[],this.initialQueueResolvers.resolve()}async flush(){await this.writePromise}async dispose(){await this.flush()}outputPath(){return this.logWriter?.outputPath()}logToLevel(r,t){this.logWriter?this.writePromise=this.logWriter.writeLog(r,t):this.initialQueue.push({method:r,message:t})}info(r){this.logToLevel("info",r)}debug(r){this.logToLevel("debug",r)}warning(r){this.logToLevel("warning",r)}error(r){this.logToLevel("error",r instanceof Error?r.message:r)}log(r){this.error(r)}isDebug(){return!1}shouldLog(r){return!0}notice(r){this.info(r instanceof Error?r.message:r)}startGroup(r,t){this.info(`--- Start of group: ${r} ---`)}endGroup(r){this.info("--- End of group ---")}},u=new m;import{createRequire as j}from"node:module";import*as n from"node:fs/promises";import*as a from"node:path";import{createHash as W}from"node:crypto";import{join as l,basename as oe}from"node:path";import{homedir as h}from"node:os";function A(){return process.env.XDG_CACHE_HOME||l(h(),".cache")}function b(){if(process.platform==="darwin")return l(h(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||l(h(),".cache");return l(e,"copilot")}return l(A(),"copilot")}function D(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),t=e.substring(0,r).trim();return t?`${t} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function y(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 D(r)}var H=1,I=".complete";var w={"win32-x64":"win-x64","win32-arm64":"win-arm64","linux-x64":"linux-x64","darwin-arm64":"osx-arm64"};function S(){return typeof __foundryRequire<"u"&&__foundryRequire||j(import.meta.url)}var f;function U(){if(f)return f;try{let e=S()("foundry-local-sdk/script/install-utils.cjs");if(typeof e.runInstall!="function")throw new Error(`Expected exports {runInstall: function}, got: ${JSON.stringify(Object.fromEntries(Object.entries(e).map(([r,t])=>[r,typeof t])))}`);return f=e,f}catch(e){throw new Error(`Failed to load foundry-local-sdk/script/install-utils.cjs: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}var p;function J(){if(p)return p;try{let e=S()("foundry-local-sdk/deps_versions.json");if(typeof e["foundry-local-core"]?.nuget!="string"||typeof e.onnxruntime?.version!="string"||typeof e["onnxruntime-genai"]?.version!="string")throw new Error('deps_versions.json is missing one of the expected version keys: ["foundry-local-core"].nuget, .onnxruntime.version, ["onnxruntime-genai"].version');return p=e,p}catch(e){throw new Error(`Failed to load foundry-local-sdk/deps_versions.json: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}function O(e=process.platform){let r=J();return[{name:"Microsoft.AI.Foundry.Local.Core",version:r["foundry-local-core"].nuget},{name:e==="linux"?"Microsoft.ML.OnnxRuntime.Gpu.Linux":"Microsoft.ML.OnnxRuntime.Foundry",version:r.onnxruntime.version},{name:"Microsoft.ML.OnnxRuntimeGenAI.Foundry",version:r["onnxruntime-genai"].version}]}function C(e){return e==="win32"?".dll":e==="darwin"?".dylib":".so"}function V(e,r){return a.join(e,`Microsoft.AI.Foundry.Local.Core${C(r)}`)}function q(e){let r=C(e),t=e==="win32"?"":"lib";return[`Microsoft.AI.Foundry.Local.Core${r}`,`${t}onnxruntime${r}`,`${t}onnxruntime-genai${r}`]}function G(e,r=process.platform,t=process.arch){let o=w[`${r}-${t}`];if(!o)throw new Error(`Voice mode not supported on ${r}-${t}`);let i=e??process.env.COPILOT_CACHE_HOME??b(),s=O(r),c=W("sha256").update(JSON.stringify({schema:H,artifacts:s})).digest("hex").slice(0,12);return a.join(i,"foundry",c,o)}async function _(e={}){let r=e.platform??process.platform,t=e.arch??process.arch,o=`${r}-${t}`;if(!w[o])throw new Error(`Voice mode is not supported on ${o}. Supported platforms: ${Object.keys(w).join(", ")}.`);let s=G(e.cacheRoot,r,t),c=V(s,r),d=q(r);return await M(s,d)?{corePath:c}:(e.onDownloadStart?.(),await Y(s,r,d,e.runInstall),{corePath:c})}async function M(e,r){return await v(a.join(e,I))?(await Promise.all(r.map(o=>v(a.join(e,o))))).every(Boolean):!1}async function v(e){try{return await n.access(e),!0}catch{return!1}}async function Y(e,r,t,o){let i=a.dirname(e);await n.mkdir(i,{recursive:!0});let s=a.join(i,`.tmp-${a.basename(e)}-${process.pid}-${Date.now()}`);await n.mkdir(s,{recursive:!0});try{let c=o??U().runInstall,d=O(r);await z(()=>c(d,{binDir:s}));for(let P of t)if(!await v(a.join(s,P)))throw new Error(`Foundry runtime download finished but required file is missing: ${P}. RID for ${r} may not be supported by the published packages.`);await n.writeFile(a.join(s,I),""),await K(s,e,t)}catch(c){throw await n.rm(s,{recursive:!0,force:!0}).catch(()=>{}),c}}async function K(e,r,t){try{await n.rename(e,r)}catch(o){let i=o.code;if(i==="ENOTEMPTY"||i==="EEXIST"||i==="EPERM"){if(await M(r,t)){await n.rm(e,{recursive:!0,force:!0}).catch(()=>{});return}await n.rm(r,{recursive:!0,force:!0}),await n.rename(e,r);return}throw o}}async function z(e){let r=process.stdout.write.bind(process.stdout),t=process.stderr.write.bind(process.stderr);process.stdout.write=(()=>!0),process.stderr.write=(()=>!0);try{return await e()}finally{process.stdout.write=r,process.stderr.write=t}}var E=class extends Error{constructor(t,o,i){super(t,i);this.code=o;this.name="VoiceBackendError"}};function N(e){return e instanceof E?{message:e.message,code:e.code}:e instanceof Error?{message:e.message}:{message:String(e)}}function R(e){return e instanceof Error?e:new Error(String(e))}var Q=16;function x(e){return $(e,new WeakSet,0)}function $(e,r,t){if(t>=Q)return"<cause chain truncated>";if(typeof e=="object"&&e!==null){if(r.has(e))return"<cyclic cause>";r.add(e)}if(!(e instanceof Error))return String(e);let o=e.stack??`${e.name}: ${e.message}`;if(e.cause===void 0)return o;let i=$(e.cause,r,t+1);return`${o} | ||
| Caused by: ${i}`}var k=16*1024,L=class{constructor(r){this.port=r}writeLog(r,t){let o={kind:"log",level:r,message:X(t)};try{this.port.postMessage(o)}catch{}return Promise.resolve()}outputPath(){return"<voice-worker>"}};function F(e,r=u){r.setLogWriter(new L(e))}function X(e){return e.length<=k?e:`${e.slice(0,k)}\u2026 [truncated, ${e.length-k} more chars]`}if(!T)throw new Error("voice-installer.worker.js must be loaded as a worker thread.");var g=T;F(g);var Z=B??{};async function ee(){try{let r={kind:"ok",location:await _({cacheRoot:Z.cacheRoot,onDownloadStart:()=>{let t={kind:"download-started"};g.postMessage(t)}})};g.postMessage(r)}catch(e){let r=R(e);u.error(`[voice-installer worker] install failed: ${x(r)}`);let t={kind:"error",error:N(r)};g.postMessage(t)}finally{setImmediate(()=>process.exit(0))}}ee().catch(e=>{u.error(`[voice-installer worker] fatal: ${x(e)}`),process.exit(1)}); | ||
| import{parentPort as T,workerData as B}from"node:worker_threads";var m=class{initialQueue=[];initialQueueResolvers=Promise.withResolvers();logWriter=null;writePromise=this.initialQueueResolvers.promise;setLogWriter(r){this.logWriter=r;for(let t of this.initialQueue)this.writePromise=this.logWriter.writeLog(t.method,t.message);this.initialQueue=[],this.initialQueueResolvers.resolve()}async flush(){await this.writePromise}async dispose(){await this.flush()}outputPath(){return this.logWriter?.outputPath()}logToLevel(r,t){this.logWriter?this.writePromise=this.logWriter.writeLog(r,t):this.initialQueue.push({method:r,message:t})}info(r){this.logToLevel("info",r)}debug(r){this.logToLevel("debug",r)}warning(r){this.logToLevel("warning",r)}error(r){this.logToLevel("error",r instanceof Error?r.message:r)}log(r){this.error(r)}isDebug(){return!1}shouldLog(r){return!0}notice(r){this.info(r instanceof Error?r.message:r)}startGroup(r,t){this.info(`--- Start of group: ${r} ---`)}endGroup(r){this.info("--- End of group ---")}},u=new m;import{createRequire as j}from"node:module";import*as o from"node:fs/promises";import*as a from"node:path";import{createHash as W}from"node:crypto";import{join as l,basename as ne}from"node:path";import{homedir as h}from"node:os";function F(){return process.env.XDG_CACHE_HOME||l(h(),".cache")}function b(){if(process.platform==="darwin")return l(h(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||l(h(),".cache");return l(e,"copilot")}return l(F(),"copilot")}function D(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),t=e.substring(0,r).trim();return t?`${t} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function y(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 D(r)}var H=1,S=".complete";var w={"win32-x64":"win-x64","win32-arm64":"win-arm64","linux-x64":"linux-x64","darwin-arm64":"osx-arm64"};function I(){return typeof __foundryRequire<"u"&&__foundryRequire||j(import.meta.url)}var f;function U(){if(f)return f;try{let e=I()("foundry-local-sdk/script/install-utils.cjs");if(typeof e.runInstall!="function")throw new Error(`Expected exports {runInstall: function}, got: ${JSON.stringify(Object.fromEntries(Object.entries(e).map(([r,t])=>[r,typeof t])))}`);return f=e,f}catch(e){throw new Error(`Failed to load foundry-local-sdk/script/install-utils.cjs: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}var g;function J(){if(g)return g;try{let e=I()("foundry-local-sdk/deps_versions.json");if(typeof e["foundry-local-core"]?.nuget!="string"||typeof e.onnxruntime?.version!="string"||typeof e["onnxruntime-genai"]?.version!="string")throw new Error('deps_versions.json is missing one of the expected version keys: ["foundry-local-core"].nuget, .onnxruntime.version, ["onnxruntime-genai"].version');return g=e,g}catch(e){throw new Error(`Failed to load foundry-local-sdk/deps_versions.json: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}function O(e=process.platform){let r=J();return[{name:"Microsoft.AI.Foundry.Local.Core",version:r["foundry-local-core"].nuget},{name:e==="linux"?"Microsoft.ML.OnnxRuntime.Gpu.Linux":"Microsoft.ML.OnnxRuntime.Foundry",version:r.onnxruntime.version},{name:"Microsoft.ML.OnnxRuntimeGenAI.Foundry",version:r["onnxruntime-genai"].version}]}function C(e){return e==="win32"?".dll":e==="darwin"?".dylib":".so"}function G(e,r){return a.join(e,`Microsoft.AI.Foundry.Local.Core${C(r)}`)}function V(e){let r=C(e),t=e==="win32"?"":"lib";return[`Microsoft.AI.Foundry.Local.Core${r}`,`${t}onnxruntime${r}`,`${t}onnxruntime-genai${r}`]}function q(e,r=process.platform,t=process.arch){let n=w[`${r}-${t}`];if(!n)throw new Error(`Voice mode not supported on ${r}-${t}`);let s=e??process.env.COPILOT_CACHE_HOME??b(),i=O(r),c=W("sha256").update(JSON.stringify({schema:H,artifacts:i})).digest("hex").slice(0,12);return a.join(s,"foundry",c,n)}async function _(e={}){let r=e.platform??process.platform,t=e.arch??process.arch,n=`${r}-${t}`;if(!w[n])throw new Error(`Voice mode is not supported on ${n}. Supported platforms: ${Object.keys(w).join(", ")}.`);let i=q(e.cacheRoot,r,t),c=G(i,r),d=V(r);return await R(i,d)?{corePath:c}:(e.onDownloadStart?.(),await Y(i,r,d,e.runInstall),{corePath:c})}async function R(e,r){return await v(a.join(e,S))?(await Promise.all(r.map(n=>v(a.join(e,n))))).every(Boolean):!1}async function v(e){try{return await o.access(e),!0}catch{return!1}}async function Y(e,r,t,n){let s=a.dirname(e);await o.mkdir(s,{recursive:!0});let i=a.join(s,`.tmp-${a.basename(e)}-${process.pid}-${Date.now()}`);await o.mkdir(i,{recursive:!0});try{let c=n??U().runInstall,d=O(r);await X(()=>c(d,{binDir:i}));for(let P of t)if(!await v(a.join(i,P)))throw new Error(`Foundry runtime download finished but required file is missing: ${P}. RID for ${r} may not be supported by the published packages.`);await o.writeFile(a.join(i,S),""),await K(i,e,t)}catch(c){throw await o.rm(i,{recursive:!0,force:!0}).catch(()=>{}),c}}async function K(e,r,t){try{await o.rename(e,r)}catch(n){let s=n.code;if(s==="ENOTEMPTY"||s==="EEXIST"||s==="EPERM"){if(await R(r,t)){await o.rm(e,{recursive:!0,force:!0}).catch(()=>{});return}await o.rm(r,{recursive:!0,force:!0}),await o.rename(e,r);return}throw n}}async function X(e){let r=process.stdout.write.bind(process.stdout),t=process.stderr.write.bind(process.stderr);process.stdout.write=(()=>!0),process.stderr.write=(()=>!0);try{return await e()}finally{process.stdout.write=r,process.stderr.write=t}}var E=class extends Error{constructor(t,n,s){super(t,s);this.code=n;this.name="VoiceBackendError"}};function $(e){return e instanceof E?{message:e.message,code:e.code}:e instanceof Error?{message:e.message}:{message:String(e)}}function M(e){return e instanceof Error?e:new Error(String(e))}var z=16;function k(e){return N(e,new WeakSet,0)}function N(e,r,t){if(t>=z)return"<cause chain truncated>";if(typeof e=="object"&&e!==null){if(r.has(e))return"<cyclic cause>";r.add(e)}if(!(e instanceof Error))return String(e);let n=e.stack??`${e.name}: ${e.message}`;if(e.cause===void 0)return n;let s=N(e.cause,r,t+1);return`${n} | ||
| Caused by: ${s}`}var x=16*1024,L=class{constructor(r){this.port=r}writeLog(r,t){let n={kind:"log",level:r,message:Q(t)};try{this.port.postMessage(n)}catch{}return Promise.resolve()}outputPath(){return"<voice-worker>"}};function A(e,r=u){r.setLogWriter(new L(e))}function Q(e){return e.length<=x?e:`${e.slice(0,x)}\u2026 [truncated, ${e.length-x} more chars]`}if(!T)throw new Error("voice-installer.worker.js must be loaded as a worker thread.");var p=T;A(p);var Z=B??{};async function ee(){try{let r={kind:"ok",location:await _({cacheRoot:Z.cacheRoot,onDownloadStart:()=>{let t={kind:"download-started"};p.postMessage(t)}})};p.postMessage(r)}catch(e){let r=M(e);u.error(`[voice-installer worker] install failed: ${k(r)}`);let t={kind:"error",error:$(r)};p.postMessage(t)}finally{setImmediate(()=>process.exit(0))}}ee().catch(e=>{u.error(`[voice-installer worker] fatal: ${k(e)}`),process.exit(1)}); | ||
| //# sourceMappingURL=voice-installer.worker.js.map |
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 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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
255023433
1.65%86
-14%34
-5.56%197
-0.51%221293
-0.28%