@reason-machines/cli-linux-x64 0.2.525 → 0.2.528
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reason +2 -2
- package/bin/vm-hands/api-credentials-5g66v8kk.js +2 -0
- package/bin/vm-hands/api-efs3jmyr.js +2 -0
- package/bin/vm-hands/connect-cli-zd9z2x4s.js +2 -0
- package/bin/vm-hands/credentials-ts56n6gk.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-hzgdnyx2.js → custom-endpoint-device-7tgcmhbz.js} +1 -1
- package/bin/vm-hands/desktop-account-jdqya1ff.js +2 -0
- package/bin/vm-hands/desktop-wallpaper-fd8f2wb2.jpg +0 -0
- package/bin/vm-hands/device-workspace-rxqaw78v.js +2 -0
- package/bin/vm-hands/dock-browser-y53t41cx.png +0 -0
- package/bin/vm-hands/dock-files-cp52htdw.png +0 -0
- package/bin/vm-hands/dock-terminal-1es514yq.png +0 -0
- package/bin/vm-hands/hands-worker-source-hkjndq4w.js +2 -0
- package/bin/vm-hands/install-receipt-8tpfepde.js +2 -0
- package/bin/vm-hands/local-automation-0yeamh23.js +2 -0
- package/bin/vm-hands/local-capabilities-xcgvjt4m.js +2 -0
- package/bin/vm-hands/local-desktop-users-tjcpyakd.js +2 -0
- package/bin/vm-hands/{local-display-mac-4654wqzs.js → local-display-mac-gtp439kc.js} +1 -1
- package/bin/vm-hands/local-display-session-2zb2t48b.js +2 -0
- package/bin/vm-hands/local-display-video-74qvb6rn.js +2 -0
- package/bin/vm-hands/local-managed-process-fk555zb4.js +2 -0
- package/bin/vm-hands/local-pty-session-tnz6jwtt.js +2 -0
- package/bin/vm-hands/managed-runtime-12kqhvk9.js +2 -0
- package/bin/vm-hands/{network-contract-5wc6wbn2.js → network-contract-e98v6mwd.js} +1 -1
- package/bin/vm-hands/permissions-jxstmabp.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-zffy7kc8.js → reason-hands-protocol-39wqa1xa.js} +1 -1
- package/bin/vm-hands/serve-service-g5fjd1bx.js +2 -0
- package/bin/vm-hands/{status-nvm1fe9h.js → status-qwjpxcsp.js} +1 -1
- package/bin/vm-hands/version-nj7n5by8.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-krnvgf71.js → vm-hands-entry-lite-04x5xjt6.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-0ry43hpj.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-0tavq3p4.js → vm-hands-entry-lite-13s0mfpr.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-kwmjn9y3.js → vm-hands-entry-lite-2hfrcr50.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-11dq75hb.js → vm-hands-entry-lite-2yx1aaq2.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-mfvtp7py.js → vm-hands-entry-lite-37b5045h.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-3gbf905c.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-vf02kfyy.js → vm-hands-entry-lite-3x6zetc0.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-t82dzcxb.js → vm-hands-entry-lite-4anjdcth.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tash5m18.js → vm-hands-entry-lite-4r1yn35v.js} +22 -22
- package/bin/vm-hands/vm-hands-entry-lite-5jd2gqs8.js +150 -0
- package/bin/vm-hands/{vm-hands-entry-lite-a6w60nv9.js → vm-hands-entry-lite-5tnma5qb.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-0zby1r00.js → vm-hands-entry-lite-610728bf.js} +21 -21
- package/bin/vm-hands/{vm-hands-entry-lite-70hq7mrs.js → vm-hands-entry-lite-72nj66ab.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tns12zqc.js → vm-hands-entry-lite-73f4cgkf.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-nj4kjex8.js → vm-hands-entry-lite-7h86g4gd.js} +30 -30
- package/bin/vm-hands/{vm-hands-entry-lite-89ahrw19.js → vm-hands-entry-lite-8nzq0bpa.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-60t7x9vw.js → vm-hands-entry-lite-8v8x8zn2.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-wfc0agnt.js → vm-hands-entry-lite-9azmqs47.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-39qv4sqt.js → vm-hands-entry-lite-a0g6c3wr.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-a64cxaqn.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-x5048q8d.js → vm-hands-entry-lite-av0j90wn.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-1kt82jes.js → vm-hands-entry-lite-b6gsggvp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-x1vm200a.js → vm-hands-entry-lite-b7ar9xhg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hc11hecd.js → vm-hands-entry-lite-cgddp0y3.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-bvqwsd3b.js → vm-hands-entry-lite-ct4mtq1m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-h0s6n13f.js → vm-hands-entry-lite-gdggtj2d.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-c4959xva.js → vm-hands-entry-lite-hfx1q0b0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-c0t5xpzh.js → vm-hands-entry-lite-hv3dxd5k.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5wsygx6n.js → vm-hands-entry-lite-j5t2pj4v.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-haws181e.js → vm-hands-entry-lite-jvszqt0z.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-sfmeafdm.js → vm-hands-entry-lite-k9vk84wa.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5qanp33p.js → vm-hands-entry-lite-m9416h05.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9knf91et.js → vm-hands-entry-lite-mzj7j4hp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-scvg31ds.js → vm-hands-entry-lite-nwq5fgz9.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-r31yba20.js → vm-hands-entry-lite-q3mgvd2b.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-88yjxxvf.js → vm-hands-entry-lite-qc6gxqgs.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-n3274tws.js → vm-hands-entry-lite-vj7xzb3y.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9x81cr3a.js → vm-hands-entry-lite-xe0benev.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-y5hv1gjv.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-td73npv3.js → vm-hands-entry-lite-y9jarm7q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ckezse0f.js → vm-hands-entry-lite-yptpy066.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-4cdn822w.js → vm-hands-entry-lite-ztsp4gs8.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-ftg1qx7c.js → vm-hands-executor-htmapgrt.js} +2 -2
- package/bin/vm-hands/{vm-hands-op-runner-agy05x0c.js → vm-hands-op-runner-gmsqah3r.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-kbdb0rj5.js → vm-hands-runtime-004m9v3r.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-84stxabw.js +2 -0
- package/bin/vm-hands/worker-sandbox-563c5g2f.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-468skzhq.js +0 -2
- package/bin/vm-hands/api-credentials-9f82kd61.js +0 -2
- package/bin/vm-hands/connect-cli-4t15y12x.js +0 -2
- package/bin/vm-hands/credentials-md79hkqh.js +0 -2
- package/bin/vm-hands/desktop-account-gm7m5bwr.js +0 -2
- package/bin/vm-hands/desktop-wallpaper-0pjhgyfk.jpg +0 -0
- package/bin/vm-hands/device-workspace-qjyzphga.js +0 -2
- package/bin/vm-hands/dock-browser-afp005mt.png +0 -0
- package/bin/vm-hands/dock-files-rywdm96b.png +0 -0
- package/bin/vm-hands/dock-terminal-s41cj1jp.png +0 -0
- package/bin/vm-hands/hands-worker-source-hzkacxxz.js +0 -2
- package/bin/vm-hands/install-receipt-qtwtzafq.js +0 -2
- package/bin/vm-hands/local-automation-wjsbhagn.js +0 -2
- package/bin/vm-hands/local-capabilities-45tqt3q6.js +0 -2
- package/bin/vm-hands/local-desktop-users-qdpbfh6s.js +0 -2
- package/bin/vm-hands/local-display-session-efjd2gvs.js +0 -2
- package/bin/vm-hands/local-display-video-bdmm490z.js +0 -2
- package/bin/vm-hands/local-managed-process-z5jpvttg.js +0 -2
- package/bin/vm-hands/local-pty-session-s60ca00y.js +0 -2
- package/bin/vm-hands/managed-runtime-ze7n8w7x.js +0 -2
- package/bin/vm-hands/permissions-k1tnx28f.js +0 -2
- package/bin/vm-hands/serve-service-3kj6xp04.js +0 -2
- package/bin/vm-hands/version-qxsa289q.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-413em054.js +0 -150
- package/bin/vm-hands/vm-hands-entry-lite-9y3dvyfj.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-dhb4fwrv.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-f8ts9y2q.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-mcjca0ez.js +0 -3
- package/bin/vm-hands/worker-preview-readiness-8ftb3nbw.js +0 -2
- package/bin/vm-hands/worker-sandbox-k0vx97tx.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qe}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Qe}from"./vm-hands-entry-lite-a64cxaqn.js";import{a}from"./vm-hands-entry-lite-jvszqt0z.js";import{randomUUID as L}from"crypto";import{spawnSync as b}from"child_process";import{chmodSync as ee,cpSync as te,existsSync as x,lstatSync as A,mkdirSync as Y,readdirSync as ne,readFileSync as w,readlinkSync as re,realpathSync as T,renameSync as E,rmdirSync as ie,rmSync as g,symlinkSync as M,writeFileSync as oe}from"fs";import{dirname as I,join as u,relative as se,resolve as ce}from"path";var Yn="so.ara.cli",k=[Yn,"com.reasonmachines.cli"],F="5LJFSBRY2F";function Gr(e){return`(${e.map((t)=>`identifier "${t}"`).join(" or ")}) and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists and certificate leaf[subject.OU] = "${F}"`}var G="ReasonBackgroundIdentity",$o="Contents/Helpers/ReasonPermissionTile",ae="so.ara.cli.permission-tile",Ne=Gr([ae,"com.reasonmachines.cli.permission-tile"]),v="AraBackgroundIdentity",ue="Reason",Ce=Gr(k),de=`anchor apple generic and (${k.map((e)=>`identifier "${e}"`).join(" or ")}) and certificate leaf[subject.OU] = "${F}"`;class h extends Error{code;constructor(e,t){super(t);this.code=e;this.name="MacOSBackgroundIdentityError"}}var R="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function le(e=a()){return u(e,"Library","Application Support","Reason","Background","Reason.app")}function O(e=a()){return u(e,"Library","Application Support","Ara","Background","Ara.app")}function fe(e){try{return A(e).isFile()}catch{return!1}}function D(e){return[G,v].map((t)=>u(e,"Contents","MacOS",t)).find(fe)??null}function d(e){try{if(!A(e).isDirectory())return!1;let t=w(u(e,"Contents","Info.plist"),"utf8");return k.some((n)=>t.includes(`<string>${n}</string>`))&&(t.includes(`<string>${ue}</string>`)||t.includes("<string>Ara</string>"))&&D(e)!==null}catch{return!1}}function Kr(e=a()){let t=le(e);if(!d(t))return null;try{let n=w(u(t,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(n)?.[1]??null}catch{return null}}function pe(e,t=a()){let n=Kr(t);return n===null||j(N(n.split(".")),N(e.split(/[.-]/).slice(0,3)))}var ge=1e4;function K(e,t){return b(e,[...t],{stdio:"ignore",timeout:ge}).status??1}var W=new Set;function H(e){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let t=(n)=>{try{return T(n)}catch{return ce(n)}};if(e!==void 0&&t(e)!==t(a()))return;throw Error("A test tried to change this computer's real Reason background identity; pass a temporary home. Refused by scripts/test-env.ts.")}var V=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.(?:ara|reason)(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,J=new Set(["ara","ara.exe","reason","reason.exe"]);function N(e){return e.map((t)=>Number(t))}function j(e,t){for(let n=0;n<3;n+=1)if(e[n]!==t[n])return e[n]<t[n];return!1}var ye=[0,2,161];function me(e){if(e===null)return!0;let t=ye,n=null;try{n=T(process.execPath)}catch{}return e.some((r)=>{let i=V.exec(r);if(i){let f=i[1]===void 0?i.slice(4,7):i.slice(1,4);return j(N(f),t)}let o=r.slice(r.lastIndexOf("/")+1);return J.has(o)&&r!==n&&r!==process.execPath})}function Ee(){let e=b("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(e.status!==0)return null;let t=[];for(let n of e.stdout.split(`
|
|
3
3
|
`)){let r=/^\s*(\d+)\s+(\S.*)$/.exec(n);if(!r||Number(r[1])===process.pid)continue;let i=r[2].trimEnd(),o=i.slice(i.lastIndexOf("/")+1);if(!V.test(i)&&J.has(o)){let c=b("/usr/sbin/lsof",["-a","-p",r[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
|
|
4
4
|
`).find((l)=>l.startsWith("n/"));if(c)i=c.slice(1)}t.push(i)}return t}function _e(e){if(H(e.home),!d(e.sourceApp))throw new h("identity_invalid","The packaged Reason background identity is missing or invalid.");let t=e.command??K,n=le(e.home),r=I(n);Y(r,{recursive:!0,mode:448}),ee(r,448);let i=T(e.sourceApp),o=null;try{o=T(n)}catch{}if(i!==o){let f=`${process.pid}.${L()}`,c=u(r,`.Reason.app.${f}.tmp`),l=u(r,`.Reason.app.${f}.old`),y=!1;try{if(te(i,c,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!d(c))throw new h("identity_invalid","The copied Reason background identity is invalid.");let _=e.releaseSigned?["--test-requirement",`=${de}`]:[];if(t("/usr/bin/codesign",["--verify","--strict",..._,c])!==0)throw new h("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let S=!1;for(let p=0;p<4;p+=1){let m=!1;try{E(n,l),m=!0,y=!0}catch(s){if(s.code!=="ENOENT")throw s}if(p===0)e.beforePublish?.();try{E(c,n),S=!0}catch(s){let Z=s.code;if(!["EEXIST","ENOTEMPTY"].includes(Z??""))throw s;if(m)g(l,{recursive:!0,force:!0}),y=!1;if(p===3)throw s;continue}if(m)g(l,{recursive:!0,force:!0}),y=!1;break}if(!S)throw Error("Could not publish Reason's background identity.")}catch(_){if(y&&!x(n)&&x(l))E(l,n);throw _}finally{g(c,{recursive:!0,force:!0}),g(l,{recursive:!0,force:!0})}}return z(n,e,{verified:i!==o}),n}function X(e){return u(I(e),".Reason.app.registered")}function q(e){try{let t=A(e);return t.isDirectory()?`${t.ino}:${t.birthtimeMs}`:null}catch{return null}}function C(e){let t=q(e);try{return t!==null&&w(X(e),"utf8")===t}catch{return!1}}function Q(e){if(d(e))return"bundle";try{if(A(u(e,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return A(u(e,"Contents","MacOS",v)).isSymbolicLink()?"retired":null}catch{return null}}function z(e,t,n={}){let r=t.command??K;if(!n.verified&&r("/usr/bin/codesign",["--verify","--strict",e])!==0)throw new h("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if(r(R,["-f",e])!==0)throw new h("identity_register_failed","Could not register Reason's macOS background identity.");let i=q(e);try{if(i)oe(X(e),i,{mode:384})}catch{}try{Se(e,t.home,r,t.runningExecutables??Ee)}catch(o){let f=o.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${f})
|
|
5
|
-
`)}}function Se(e,t,n,r){let i=D(e);if(!i)return;let o=O(t),f=I(o),c=(s)=>u(s,"Contents","MacOS",v),l=se(I(c(o)),i),y=`${process.pid}.${L()}`,_=Q(o);if(_===null)return;let S=_==="bundle";if(S)n(R,["-u",o]);let p=u(f,`.Ara.app.${y}.old`);if(!W.has(o)&&!me(r())){if(!S)n(R,["-u",o]);try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}g(p,{recursive:!0,force:!0}),Ie(f);return}if(!S){if(re(c(o))===l)return;let s=`${c(o)}.${y}`;M(l,s);try{E(s,c(o))}finally{g(s,{force:!0})}return}let m=u(f,`.Ara.app.${y}.shim`);Y(I(c(m)),{recursive:!0}),M(l,c(m));try{try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}try{E(m,o)}catch(s){if(x(o))return;throw E(p,o),s}}finally{g(m,{recursive:!0,force:!0}),g(p,{recursive:!0,force:!0})}}function Ie(e){try{if(ne(e).some((n)=>n!==".DS_Store"))return;g(u(e,".DS_Store"),{force:!0}),ie(e)}catch{}}var B=new Map;function
|
|
6
|
-
`?[i,"--spawn"]:[]}var P=new Map;function gt(e=a()){let t=
|
|
7
|
-
`,P.set(n,r)}return r?t:[]}function Mo(e=gt(),t=a()){if(e.length>0)return null;if(Kr(t)===null)return"computer_use_identity_missing";return pe(Qe,t)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function he(e={}){H(e.home);let t=le(e.home);if(e.skipWhenSettled&&d(t)&&C(t)&&Q(O(e.home))===null)return!0;if(!d(t)){let n=O(e.home);if(!d(n))return!1;try{return _e({...e,sourceApp:n}),!0}catch(r){if(!d(t))throw r}}return z(t,e),!0}var er="REASON_WORKER_IDENTITY_APP";function
|
|
5
|
+
`)}}function Se(e,t,n,r){let i=D(e);if(!i)return;let o=O(t),f=I(o),c=(s)=>u(s,"Contents","MacOS",v),l=se(I(c(o)),i),y=`${process.pid}.${L()}`,_=Q(o);if(_===null)return;let S=_==="bundle";if(S)n(R,["-u",o]);let p=u(f,`.Ara.app.${y}.old`);if(!W.has(o)&&!me(r())){if(!S)n(R,["-u",o]);try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}g(p,{recursive:!0,force:!0}),Ie(f);return}if(!S){if(re(c(o))===l)return;let s=`${c(o)}.${y}`;M(l,s);try{E(s,c(o))}finally{g(s,{force:!0})}return}let m=u(f,`.Ara.app.${y}.shim`);Y(I(c(m)),{recursive:!0}),M(l,c(m));try{try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}try{E(m,o)}catch(s){if(x(o))return;throw E(p,o),s}}finally{g(m,{recursive:!0,force:!0}),g(p,{recursive:!0,force:!0})}}function Ie(e){try{if(ne(e).some((n)=>n!==".DS_Store"))return;g(u(e,".DS_Store"),{force:!0}),ie(e)}catch{}}var B=new Map;function Zn(e=a()){let t=B.get(e);if(t)return t;if(process.platform!=="darwin")return[];let n=U(e);if(n===null&&x(I(le(e))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),n=U(e);if(n===null)return[];return B.set(e,n),n}function U(e){let t=le(e),n=O(e);if(!d(t)||!C(t))try{he({home:e,skipWhenSettled:!0})}catch{}let r=d(t)&&(C(t)||!d(n))?t:d(n)?n:null,i=r?D(r):null;if(!i)return null;if(r===n)W.add(n);let o=b(i,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return o.status===0&&o.stdout===`spawn
|
|
6
|
+
`?[i,"--spawn"]:[]}var P=new Map;function gt(e=a()){let t=Zn(e),n=t[0];if(!n)return[];let r=P.get(n);if(r===void 0){let i=b(n,["--can-spawn-computer-use"],{env:{},timeout:2000,encoding:"utf8"});r=i.status===0&&i.stdout===`spawn
|
|
7
|
+
`,P.set(n,r)}return r?t:[]}function Mo(e=gt(),t=a()){if(e.length>0)return null;if(Kr(t)===null)return"computer_use_identity_missing";return pe(Qe,t)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function he(e={}){H(e.home);let t=le(e.home);if(e.skipWhenSettled&&d(t)&&C(t)&&Q(O(e.home))===null)return!0;if(!d(t)){let n=O(e.home);if(!d(n))return!1;try{return _e({...e,sourceApp:n}),!0}catch(r){if(!d(t))throw r}}return z(t,e),!0}var er="REASON_WORKER_IDENTITY_APP";function Bo(e,t=process.env,n=a()){let r=t[er];return r&&r===le(n)?r:e}function Fo(e,t){if(process.platform!=="darwin")return null;let n=le(e),r=u(n,"Contents","MacOS",G),i=b(r,["--can-run-worker",t],{env:{},timeout:2000,encoding:"utf8"});return i.status===0&&i.stdout===`run-worker
|
|
8
8
|
`?{app:n,executable:r}:null}
|
|
9
|
-
export{
|
|
9
|
+
export{Yn,Gr,$o,le,Kr,Zn,gt,Mo,er,Bo,Fo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R}from"./vm-hands-entry-lite-a3p6xz53.js";import{basename as ln}from"path";var _t=["production","staging"],un="https://api.reasonmachines.com",fn="https://staging-api.reasonmachines.com";var A={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},gn=new Set(["ara-staging","ara-staging.exe","reason-staging","reason-staging.exe"]);function _(n={}){let e=R(n.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(e){if(_t.includes(e))return e;throw Error(`Unknown Reason CLI channel: ${e}`)}let r=ln(n.executablePath??process.execPath).toLowerCase();return gn.has(r)?"staging":"production"}function rr(n){return n==="staging"?fn:un}var U={production:["https://api.ara.so",A.production.api],staging:["https://api-staging.ara.so",A.staging.api]};function
|
|
3
|
-
export{_t,_,rr,
|
|
2
|
+
import{R}from"./vm-hands-entry-lite-a3p6xz53.js";import{basename as ln}from"path";var _t=["production","staging"],un="https://api.reasonmachines.com",fn="https://staging-api.reasonmachines.com";var A={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},gn=new Set(["ara-staging","ara-staging.exe","reason-staging","reason-staging.exe"]);function _(n={}){let e=R(n.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(e){if(_t.includes(e))return e;throw Error(`Unknown Reason CLI channel: ${e}`)}let r=ln(n.executablePath??process.execPath).toLowerCase();return gn.has(r)?"staging":"production"}function rr(n){return n==="staging"?fn:un}var U={production:["https://api.ara.so",A.production.api],staging:["https://api-staging.ara.so",A.staging.api]};function Yr(n){let e;try{e=new URL(n).origin}catch{return n}let r=_t.find((t)=>U[t].includes(e));return r?rr(r):e}function jo(n,e){return n===e||Yr(n)===Yr(e)}function Ho(n,e){return _t.some((r)=>U[r].includes(n)&&e===rr(r))}function Uo(n,e){try{let r=new URL(e);return!r.username&&!r.password&&(r.origin===rr(n)||r.origin===A[n].api)}catch{return!1}}function ri(n){try{let e=new URL(n).hostname.replace(/^\[|\]$/g,"").toLowerCase();return e==="localhost"||e==="127.0.0.1"||e==="::1"}catch{return!1}}import{randomBytes as J}from"crypto";import{chmodSync as q,closeSync as B,constants as bn,linkSync as V,lstatSync as I,mkdirSync as z,openSync as En,readdirSync as T,readFileSync as Wn,readlinkSync as v,renameSync as S,rmdirSync as Q,symlinkSync as N,unlinkSync as d}from"fs";import{createRequire as Nn}from"module";import{constants as Sn}from"os";import{basename as w,join as l,sep as kn}from"path";import{existsSync as D,lstatSync as j,readdirSync as pn,readFileSync as mn,readlinkSync as dn,realpathSync as yn}from"fs";import{join as m,sep as hn}from"path";function G(n,...e){let r=m(n,"ara"),t=m(n,"reason");if(!Zr(r))return m(t,...e);if(!D(t))return m(r,...e);return D(m(r,...e))&&!D(m(t,...e))?m(r,...e):m(t,...e)}function Zr(n){try{let e=j(n);if(!e.isSymbolicLink())return e.isDirectory();return dn(n)!=="reason"&&D(n)}catch{return!1}}function X(n,e=[]){if(!Zr(n))return!1;let r;try{r=[n,...pn(n,{withFileTypes:!0}).filter((t)=>t.isDirectory()).map((t)=>m(n,t.name))]}catch{return!1}return r.some((t)=>["connect","connect-once"].filter((i)=>!e.includes(m(t,i))).some((i)=>{let s=m(t,i,"worker.json");try{j(s)}catch{return!1}try{let a=JSON.parse(mn(s,"utf8"))?.stateDirectory;if(typeof a!=="string")return!0;let c=(o,u)=>o===u||o.startsWith(u+hn);return c(a,n)||c(M(a),M(n))}catch{return!0}}))}function M(n){try{return yn(n)}catch{return n}}var P=new Set(["credentials.json","local-device.json","local-device.revoked.json","local-device.auth-migration.json","local-device.json.registration-pending.json","local-daemon.json","local-daemon.json.workspaces.json","local-root-fingerprint-key.json","instances","workspaces"]),Z=new Set(["local-device.proxy.json"]),Cn=new Set(["local-device.key","local-device.binding"]),W=new Map;function yt(n,e,r){let t=l(n,"ara");if(process.platform==="win32"||/[/\\]\.reason-ssh[/\\][^/\\]+[/\\]installer-home[/\\]\.config$/.test(n))return{state:p(t)?.isDirectory()?"kept":"absent"};return vn(t,l(n,"reason"),{linkAlways:!0,kept:(i)=>X(i,r??[]),native:e===void 0?An:()=>e},r!==void 0)}function ke(n,...e){return yt(n),G(n,...e)}var nn="config_rename_unavailable:busy";function vn(n,e,r,t=!1){let i=t?void 0:W.get(n);if(i)return i;let s;try{s=_n(n,e,r)}catch(a){let c=`config_rename_unavailable:${b(a)??"failed"}`;try{return{state:p(n)?.isDirectory()?"kept":"absent",problem:c}}catch{return{state:"kept",problem:c}}}if(!(s.state==="absent"&&r.linkAlways)&&s.problem!==nn&&!(s.state==="kept"&&!s.problem))W.set(n,s);return s}function _n(n,e,r){wn(e,r.native);let t=!1;for(let i=0;i<8;i+=1){let s=p(n);if(s?.isSymbolicLink())return v(n)===w(e)?{state:t?"renamed":"linked"}:{state:"kept"};if(!s){if(L(e))f(()=>d(e),"ENOENT");if(!(t||r.linkAlways)||!x(e))return{state:"absent"};let o=C(e,"link");N(w(e),o);try{f(()=>S(o,n),"EISDIR","ENOTEMPTY","EEXIST","ENOTDIR")}finally{f(()=>d(o),"ENOENT")}continue}if(!s.isDirectory())return{state:"absent"};if(r.kept(n))return K(e),{state:"kept"};let a=r.native();if(!a)return K(e),{state:"kept",problem:"config_rename_unavailable:no_native"};let c=In(a,n);if(!c)return{state:"kept",problem:nn};try{if(I(n).isSymbolicLink())continue;let o=Rn(a,n,e);if(o)return{state:"kept",problem:o};t=!0}finally{c()}}throw Object.assign(Error("legacy directory rename did not settle"),{code:"unsettled"})}function Rn(n,e,r){let t=p(r);if(!t||L(r)){if(!t)N(w(r),r);try{n.exchange(e,r)}catch(o){if(L(r))f(()=>d(r),"ENOENT");return`config_rename_unavailable:${b(o)??"exchange_failed"}`}return null}if(!t.isDirectory())return"config_rename_unavailable:ENOTDIR";if(t.dev!==I(e).dev)return"config_rename_unavailable:EXDEV";let i=[C(r,"probe"),C(r,"probe")];try{N("a",i[0]),N("b",i[1]),n.exchange(i[0],i[1])}catch(o){return`config_rename_unavailable:${b(o)??"exchange_failed"}`}finally{for(let o of i)f(()=>d(o),"ENOENT")}let s=cn(r);for(let o of Cn){let u=p(l(r,o)),g=p(l(e,o));if(u&&g&&u.ino!==g.ino)z(`${s}-replaced`,{mode:448,recursive:!0}),S(l(r,o),l(`${s}-replaced`,o))}let a={linked:new Map,unitsKept:new Set};rn(e,r,"",a);let c=C(r,"rename");N(w(r),c);try{n.exchange(e,c)}catch(o){return f(()=>d(c),"ENOENT"),`config_rename_unavailable:${b(o)??"exchange_failed"}`}return tn(c,r,a,s),null}function en(n){return n===""||!n.includes(kn)}function rn(n,e,r,t){let i=en(r)&&sn(l(e,r),l(n,r));if(i)t.unitsKept.add(r);for(let s of T(l(n,r))){if(i&&(P.has(s)||Z.has(s)))continue;let a=l(r,s),c=l(n,a),o=l(e,a),u=p(c);if(!u)continue;let g=p(o);if(u.isDirectory()){if(!g)f(()=>z(o,{mode:u.mode&4095}),"EEXIST"),q(o,u.mode&4095);if(x(o))rn(n,e,a,t)}else if(!g){if(u.isSymbolicLink())f(()=>N(v(c),o),"EEXIST");else if(f(()=>V(c,o),"EEXIST","ENOENT"))t.linked.set(a,u.ino)}}}function wn(n,e){let r;try{if(!x(n))return;r=T(n)}catch{return}for(let t of r){let i=/^\.(rename|link|probe|claim)-(\d+)-[0-9a-f]+$/.exec(t);if(!i)continue;let s=l(n,t),a=p(s);if(!a)continue;if(!a.isDirectory()){if(!Y(Number(i[2])))f(()=>d(s),"ENOENT");continue}let c=e(),o=null;if(c){try{o=c.lock(s)}catch{continue}if(!o)continue}else if(Y(Number(i[2])))continue;try{let u=C(n,"claim");if(f(()=>S(s,u),"ENOENT"))tn(u,n,null,cn(n))}finally{o?.()}}}function tn(n,e,r,t){for(let[i,s]of r?.linked??[])if(!p(l(n,i))&&p(l(e,i))?.ino===s)f(()=>d(l(e,i)),"ENOENT");if(on(n,e,"",r),f(()=>Q(n),"ENOTEMPTY","EEXIST"))return;S(n,t),q(t,448)}function on(n,e,r,t){let i=en(r)&&(t?t.unitsKept.has(r):sn(l(e,r),l(n,r)));for(let s of T(l(n,r))){let a=l(r,s),c=l(n,a),o=l(e,a),u=I(c),g=p(o);if(g&&u.ino===g.ino&&u.dev===g.dev){d(c);continue}if(u.isFile()&&g?.isFile()&&t?.linked.get(a)===g.ino){S(c,o);continue}if(i&&(P.has(s)||Z.has(s)))continue;if(!g){if(u.isFile()){if(f(()=>V(c,o),"EEXIST"))d(c)}else f(()=>S(c,o),"EEXIST","ENOTEMPTY");continue}if(u.isDirectory()&&g.isDirectory())on(n,e,a,t),f(()=>Q(c),"ENOTEMPTY","EEXIST")}}function sn(n,e){for(let r of P)if(an(l(n,r),l(e,r)))return!0;return!1}function an(n,e){let r=p(n);if(!r)return!1;let t=p(e);if(!t)return!0;if(r.isDirectory()){if(!t.isDirectory())return!0;return T(n).some((i)=>an(l(n,i),l(e,i)))}if(r.isSymbolicLink())return!t.isSymbolicLink()||v(n)!==v(e);return r.ino!==t.ino||r.dev!==t.dev}function K(n){if(L(n))f(()=>d(n),"ENOENT")}function cn(n){return l(n,`.pre-rename-${new Date().toISOString().replace(/[:.]/g,"-")}-${J(3).toString("hex")}`)}function L(n){try{return I(n).isSymbolicLink()&&v(n)===w(n)}catch{return!1}}function x(n){let e=p(n);return e!==null&&e.isDirectory()}function In(n,e){for(let r=0;r<40;r+=1){let t=n.lock(e);if(t)return t;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,50)}return null}function C(n,e){return l(n,`.${e}-${process.pid}-${J(6).toString("hex")}`)}function Y(n){if(n===process.pid)return!1;try{return process.kill(n,0),!0}catch(e){return b(e)==="EPERM"}}function p(n){try{return I(n)}catch(e){if(b(e)==="ENOENT"||b(e)==="ENOTDIR")return null;throw e}}function f(n,...e){try{return n(),!0}catch(r){if(e.includes(b(r)??""))return!1;throw r}}function b(n){return n instanceof Error&&"code"in n&&typeof n.code==="string"?n.code:void 0}var k,On=2,Dn=4,Ln=2,Tn=2,H=-100;function An(){if(k!==void 0)return k;if(k=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let n;try{n=Nn(import.meta.url)("bun:ffi")}catch{return null}let e=process.platform==="darwin",r=e?"__error":"__errno_location",t=e?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`],{FFIType:i}=n;for(let s of t)try{let a=e?"renamex_np":"renameat2",o=n.dlopen(s,{flock:{args:[i.i32,i.i32],returns:i.i32},[r]:{args:[],returns:i.ptr},[a]:e?{args:[i.ptr,i.ptr,i.u32],returns:i.i32}:{args:[i.i32,i.ptr,i.i32,i.ptr,i.u32],returns:i.i32}}).symbols,u=o[r]();if(u===null)continue;let g=(E)=>{let h=n.read.i32(u),y=Object.entries(Sn.errno).find(([,O])=>O===h)?.[0]??`errno_${h}`;return Object.assign(Error(`${E} failed: ${y}`),{code:y})},F=(E)=>Buffer.from(`${E}\x00`,"utf8");return k={exchange(E,h){let y=F(E),O=F(h);if((e?o[a](n.ptr(y),n.ptr(O),Ln):o[a](H,n.ptr(y),H,n.ptr(O),Tn))!==0)throw g("exchange")},lock(E){let h=En(E,bn.O_RDONLY);if(o.flock(h,On|Dn)===0)return()=>B(h);let y=g("lock");if(B(h),y.code==="EWOULDBLOCK"||y.code==="EAGAIN")return null;throw y}},k}catch{}return null}
|
|
3
|
+
export{_t,_,rr,Yr,jo,Ho,Uo,ri,Zr,yt,ke};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qr,en,tn,or}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Qr,en,tn,or}from"./vm-hands-entry-lite-a0g6c3wr.js";import{Do,Oo,P,Br,Fr,zn,ft,qn,jr,Je,Se,Wn,Xe,ne,Ye,Ee,Zt,Hr,Ur,Gn}from"./vm-hands-entry-lite-hv3dxd5k.js";import{lr}from"./vm-hands-entry-lite-s85p7tqp.js";import{Xt}from"./vm-hands-entry-lite-y9jarm7q.js";import{ve}from"./vm-hands-entry-lite-72nj66ab.js";var r=["cgroup_membership_read_failed","cgroup_v2_membership_absent","cgroup_scope_invalid","cgroup_root_unavailable","cgroup_directory_unavailable","cgroup_limit_read_failed","cgroup_events_read_failed","cgroup_current_read_failed","cgroup_stat_read_failed","boot_id_read_failed","boot_id_invalid","guest_meminfo_read_failed","guest_vmstat_read_failed","memory_counter_invalid","memory_field_missing","memory_capacity_invalid"];var o=String.raw`(function(fs, path) {
|
|
3
3
|
const fail = (message, reasonCode) => { throw Object.assign(Error(message), {reasonCode}); };
|
|
4
4
|
const read = (p, reasonCode, trim=true) => { try { const text=fs.readFileSync(p, "utf8"); return trim?text.trim():text; }
|
|
5
5
|
catch { fail("memory_read", reasonCode); } };
|
|
@@ -309,7 +309,7 @@ function fileOperation(request) {
|
|
|
309
309
|
});
|
|
310
310
|
return { promise, cancel() {} };
|
|
311
311
|
}
|
|
312
|
-
`;var s="a3e39eb55160acfc116fa9871ccc594c68be7a642d2331b24baa707c8f601ec0";import{createHash as
|
|
312
|
+
`;var s="a3e39eb55160acfc116fa9871ccc594c68be7a642d2331b24baa707c8f601ec0";import{createHash as I}from"crypto";var H=Object.freeze({"api.ara.so":"api.reasonmachines.com","api.reasonmachines.ai":"api.reasonmachines.com","api-staging.ara.so":"staging-api.reasonmachines.com","staging-api.reasonmachines.ai":"staging-api.reasonmachines.com"});var a=Object.freeze({trailingSlashPattern:/\/+$/.source,keyPrefix:"http.",keySuffix:"/.extraheader",valuePrefix:"Authorization: Bearer "});var l=Object.freeze({tokenEnv:"ARA_GIT_BROKER_TOKEN",reasonTokenEnv:"REASON_GIT_BROKER_TOKEN",urlEnv:"ARA_GIT_BROKER_URL",keyPrefix:"credential.",keySuffix:"/.helper",value:'!f(){ printf "username=%s\\npassword=%s\\n" "ara-run" "${REASON_GIT_BROKER_TOKEN:-$ARA_GIT_BROKER_TOKEN}"; };f'});var Lt=/^[A-Za-z_][A-Za-z0-9_]*$/;var h=new Set(["ARA_INFERENCE_TOKEN","AI_GATEWAY_API_KEY","CLOUD_AGENT_AI_GATEWAY_API_KEY","INFERENCE_V2_GATEWAY_API_KEY","VERCEL_AI_GATEWAY_API_KEY","INFERENCE_V2_CONCENTRATE_API_KEY","INFERENCE_V2_OPENAI_API_KEY","INFERENCE_V2_ANTHROPIC_API_KEY","INFERENCE_V2_FINGERPRINT_SECRET","OPENAI_API_KEY","OPENROUTER_API_KEY","ANTHROPIC_API_KEY","CODEX_ACCESS_TOKEN","GITHUB_COPILOT_API_KEY","AZURE_OPENAI_API_KEY","AZURE_OPENAI_CLIENT_SECRET"]),m=new Set(["ARA_OPERATOR_KEY","BL_API_KEY","BLAXEL_API_KEY","NSC_TOKEN","NSC_TOKEN_FILE","NAMESPACE_API_KEY","NAMESPACE_ACCESS_TOKEN","NAMESPACE_TOKEN","NAMESPACE_TOKEN_JSON","NAMESPACE_SANDBOX_TOKEN_JSON","ARA_LOCAL_QA_NAMESPACE_WORKLOAD_TOKEN_FILE","NAMESPACE_SANDBOX_USE_LOCAL_USER_TOKEN","COMPUTE_SERVICE_TOKEN"]),g=["INFISICAL_","NSC_"],_=new Set(["ARA_JOB_ENV","ARA_DELIVERY_BASE_SHA","WORK_ROOT","REPO_DIR","ARA_CONTROL_DIR","ARA_PRESERVE_WORKSPACE","ARA_PINNED_CHECKOUT_REUSE","FOLLOWUP_BRANCH","REPO_URL","TOKENLESS_URL","REPOSITORY_IDENTITY_URL","DEFAULT_BRANCH","BRANCH","BRANCH_GENERATED","BASE_REF","REPO_EMPTY","REPO_WRITABLE","ARA_DELIVERY_BASE_BRANCH","ARA_SERVER_GIT_PUBLICATION","ARA_EMPTY_REPOSITORY_COMMIT","REASON_MODEL","REASON_DELIVERY_BASE_BRANCH","REASON_DELIVERY_BASE_SHA","REASON_EMPTY_REPOSITORY_COMMIT","REASON_SCRATCH_SESSION_ID","REASON_SERVER_GIT_PUBLICATION","REASON_ALLOW_INSTALL_SCRIPTS","SCM_TOKEN","SCM_TOKEN_USER","REASON_OIDC_TOKEN_URL","REASON_OIDC_REQUEST_TOKEN","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","BASH_ENV","ENV","BASHOPTS","SHELLOPTS","PS4","IFS","CDPATH","GLOBIGNORE","PROMPT_COMMAND","PATH","HOME","TMPDIR","TMP","TEMP","XDG_CONFIG_HOME","GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_COMMON_DIR","GIT_NAMESPACE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM","GIT_SHALLOW_FILE","GIT_ALLOW_PROTOCOL","GIT_PROTOCOL_FROM_USER","GIT_REPLACE_REF_BASE","NODE_OPTIONS","NODE_PATH","NODE_REPL_EXTERNAL_MODULES","CLASSPATH","PYTHONPATH","PYTHONSTARTUP","PYTHONHOME","RUBYOPT","RUBYLIB","PERL5LIB","PERL5OPT","JAVA_TOOL_OPTIONS","_JAVA_OPTIONS","JDK_JAVA_OPTIONS","GEM_PATH","GEM_HOME","GIT_SSH","GIT_SSH_COMMAND","GIT_EXEC_PATH","GIT_TEMPLATE_DIR","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_PROXY_COMMAND","GIT_EXTERNAL_DIFF","GIT_PAGER","GIT_EDITOR","GIT_ASKPASS","SSH_ASKPASS","PAGER","EDITOR","TAR_OPTIONS","CURL_HOME","WGETRC","APT_CONFIG","PERLLIB","GIT_GRAFT_FILE","POSIXLY_CORRECT"]),y=["GIT_TRACE","CONTEXT_REPO_","ARA_CHECKPOINT_BOOTSTRAP_","_","ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","LD_","DYLD_","GIT_CONFIG","BASH_FUNC_"];var t="^(?!(?:"+[...h,...m,..._].join("|")+")$)(?!(?:"+[...g,...y].join("|")+"))"+Lt.source.slice(1),W=new RegExp(t);var v=["HOME","PWD","OLDPWD","TMPDIR","TMP","TEMP","SHELL","USER","LOGNAME","SCM_TOKEN","SCM_TOKEN_USER","GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","GITLAB_TOKEN"],E=["ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","BUN_"],S="^(?!(?:"+v.join("|")+")$)(?!(?:"+E.join("|")+"))"+t.slice(1),w="ARA_DELIVERY_BASE_SHA|WORK_ROOT|FOLLOWUP_BRANCH|ARA_PRESERVE_WORKSPACE|ARA_PINNED_CHECKOUT_REUSE|CONTEXT_REPO_[A-Z0-9_]+|REPO_URL|TOKENLESS_URL|REPOSITORY_IDENTITY_URL|DEFAULT_BRANCH|BRANCH|BRANCH_GENERATED|BASE_REF|REPO_EMPTY|REPO_WRITABLE|ARA_DELIVERY_BASE_BRANCH|ARA_SERVER_GIT_PUBLICATION|ARA_EMPTY_REPOSITORY_COMMIT|REASON_MODEL|REASON_DELIVERY_BASE_BRANCH|REASON_DELIVERY_BASE_SHA|REASON_EMPTY_REPOSITORY_COMMIT|REASON_SCRATCH_SESSION_ID|REASON_SERVER_GIT_PUBLICATION|REASON_ALLOW_INSTALL_SCRIPTS",n="^(?:"+w+"|"+S.slice(1,-1)+")$",R=new RegExp(n);function Pr(u){return R.test(u)}var lt=Object.freeze({tokenPath:"/identity/token",awsPath:"/identity/aws",tokenPattern:/^[A-Za-z0-9_.~-]+$/.source}),V=Object.freeze({variables:256,valueBytes:130816,snapshotBytes:1048576}),Z=Object.freeze({valueChars:16384,snapshotBytes:65536});var c=["set -g history-limit 50000","set -g status off","set -g window-size smallest","set -gq fill-character ' '","set -g escape-time 10","set -g prefix None","set -g prefix2 None","set -g terminal-overrides ',*:smcup@:rmcup@'"];var O=2,T="ara-hands-worker.cjs",d=["/usr/local/go/bin","/opt/node/bin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin","/usr/local/cargo/bin"],A=d.join(":"),k=["/opt/homebrew/bin",...d].join(":"),N='(platform, linuxPath, macosPath) => platform === "darwin" ? macosPath : linuxPath';var C=String.raw`(function(anchor, pid, native) {
|
|
313
313
|
const token = native.identity(pid);
|
|
314
314
|
const session = native.session(pid);
|
|
315
315
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
@@ -317,7 +317,7 @@ function fileOperation(request) {
|
|
|
317
317
|
if (session.id !== anchor[5]) throw new Error("pty_member_session_changed");
|
|
318
318
|
if (!token) return { retry: true, token: null };
|
|
319
319
|
return { retry: false, token };
|
|
320
|
-
})`,
|
|
320
|
+
})`,x=String.raw`(function(native) {
|
|
321
321
|
let probe;
|
|
322
322
|
try {
|
|
323
323
|
try {
|
|
@@ -327,7 +327,7 @@ function fileOperation(request) {
|
|
|
327
327
|
native.signal(probe);
|
|
328
328
|
} finally { if (probe) native.release(probe); }
|
|
329
329
|
} catch (error) { native.close(); throw error; }
|
|
330
|
-
})`,
|
|
330
|
+
})`,D=String.raw`(function(bootstrap) {
|
|
331
331
|
const { dlopen, ptr } = require("bun:ffi");
|
|
332
332
|
const api = dlopen("libc.so.6", {
|
|
333
333
|
prctl: { args: ["i32", "u64", "u64", "u64", "u64"], returns: "i32" },
|
|
@@ -363,15 +363,15 @@ const DEVICE_CLOUD_ACCESS_POLICY = ${JSON.stringify(lt)};
|
|
|
363
363
|
const DEVICE_ENVIRONMENT_LIMITS = ${JSON.stringify(V)};
|
|
364
364
|
|
|
365
365
|
const VERSION = ${P};
|
|
366
|
-
const WORKER_VERSION = ${
|
|
366
|
+
const WORKER_VERSION = ${O};
|
|
367
367
|
const WORKER_ENTRYPOINT = ${JSON.stringify(T)};
|
|
368
368
|
const GUEST_MEMORY_UNAVAILABLE_REASONS = ${JSON.stringify(r)};
|
|
369
369
|
const sampleGuestMemory = ${o};
|
|
370
|
-
const inspectMacPtyMember = ${
|
|
371
|
-
const probeLinuxPtyLibrary = ${
|
|
372
|
-
const windowsPtyApi = ${
|
|
373
|
-
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(
|
|
374
|
-
const CLOSE_CODES = ${JSON.stringify(
|
|
370
|
+
const inspectMacPtyMember = ${C};
|
|
371
|
+
const probeLinuxPtyLibrary = ${x};
|
|
372
|
+
const windowsPtyApi = ${Xt};
|
|
373
|
+
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(D)};
|
|
374
|
+
const CLOSE_CODES = ${JSON.stringify(Ur)};
|
|
375
375
|
const SHA256_RE = /^[0-9a-f]{64}$/;
|
|
376
376
|
const MAX_FRAME_BYTES = ${Br};
|
|
377
377
|
const MAX_INPUT_CHARS = ${Fr};
|
|
@@ -387,9 +387,9 @@ const MAX_JOB_OUTPUT_CHUNKS = ${Se};
|
|
|
387
387
|
const MAX_JOBS = ${Wn};
|
|
388
388
|
const MAX_JOB_RECORD_BYTES = 262144;
|
|
389
389
|
const MAX_JOB_JOURNAL_BYTES = MAX_JOBS * MAX_JOB_RECORD_BYTES;
|
|
390
|
-
const MAX_JOB_CONTROL_FRAME_BYTES = ${
|
|
390
|
+
const MAX_JOB_CONTROL_FRAME_BYTES = ${Xe};
|
|
391
391
|
const MAX_PTY_INPUT_BYTES = ${ne};
|
|
392
|
-
const MAX_PTY_OUTPUT_BYTES = ${
|
|
392
|
+
const MAX_PTY_OUTPUT_BYTES = ${Ye};
|
|
393
393
|
const MAX_PTY_DIMENSION = ${Ee};
|
|
394
394
|
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/;
|
|
395
395
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
@@ -492,9 +492,9 @@ function jobsUserPrefix(model) {
|
|
|
492
492
|
return user ? ["/usr/bin/setpriv", "--reuid=" + user.uid, "--regid=" + gid, "--clear-groups", "--no-new-privs", "--",
|
|
493
493
|
"/usr/bin/env", "HOME=" + user.home, "USER=" + user.username, "LOGNAME=" + user.username] : [];
|
|
494
494
|
}
|
|
495
|
-
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
496
|
-
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
497
|
-
const selectCloudChildPath = ${
|
|
495
|
+
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(A)};
|
|
496
|
+
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(k)};
|
|
497
|
+
const selectCloudChildPath = ${N};
|
|
498
498
|
const config = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
499
499
|
const FIXED_BASH = WINDOWS ? config.bashExecutable : "/bin/bash";
|
|
500
500
|
const allowedTools = config.allowedTools === undefined
|
|
@@ -2347,7 +2347,7 @@ function windowsPtyOperation(request, managed) {
|
|
|
2347
2347
|
try {
|
|
2348
2348
|
if (pty.activeProcesses() > 0) pty.terminate();
|
|
2349
2349
|
for (const startedAt = Date.now(); pty.activeProcesses() > 0;) {
|
|
2350
|
-
if (Date.now() - startedAt > ${
|
|
2350
|
+
if (Date.now() - startedAt > ${Zt}) throw new Error("pty_cleanup_timeout");
|
|
2351
2351
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
2352
2352
|
}
|
|
2353
2353
|
pty.close();
|
|
@@ -2795,7 +2795,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2795
2795
|
const { members, empty } = native.session(anchor, device);
|
|
2796
2796
|
try {
|
|
2797
2797
|
if (empty && exitCode !== null && subreaper) break;
|
|
2798
|
-
if (Date.now() - startedAt > ${
|
|
2798
|
+
if (Date.now() - startedAt > ${Zt}) throw new Error("pty_cleanup_timeout");
|
|
2799
2799
|
for (const token of members) {
|
|
2800
2800
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
2801
2801
|
const id = native.identityKey(token);
|
|
@@ -2811,7 +2811,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2811
2811
|
controlReleased = true;
|
|
2812
2812
|
let exitTimer;
|
|
2813
2813
|
try { await Promise.race([child.exited, new Promise((_, reject) => {
|
|
2814
|
-
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${
|
|
2814
|
+
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${Hr});
|
|
2815
2815
|
})]); } finally { clearTimeout(exitTimer); }
|
|
2816
2816
|
if (timedOut) finish("timeout", 124);
|
|
2817
2817
|
else if (cancelled) finish("cancelled", 130);
|
|
@@ -3362,10 +3362,10 @@ const PI_EXIT_STDIO_GRACE_MS = 100;
|
|
|
3362
3362
|
// the token once under quoteDepth layers of single quoting, so the confined
|
|
3363
3363
|
// script is byte-identical to what the Brain's confineBashPayload gives the
|
|
3364
3364
|
// bash tool: srt/bwrap, the payload uid, the network allowlist and allowWrite.
|
|
3365
|
-
const PI_TOOL_CONFINEMENT_TOKEN = "${
|
|
3365
|
+
const PI_TOOL_CONFINEMENT_TOKEN = "${Do}";
|
|
3366
3366
|
function validPiToolConfinement(value) {
|
|
3367
3367
|
return hasOnlyKeys(value, ["template", "quoteDepth"]) && typeof value.template === "string"
|
|
3368
|
-
&& value.template.length <= ${
|
|
3368
|
+
&& value.template.length <= ${Oo} && !value.template.includes("\0")
|
|
3369
3369
|
&& value.template.split(PI_TOOL_CONFINEMENT_TOKEN).length === 2 && [1, 2, 3].includes(value.quoteDepth);
|
|
3370
3370
|
}
|
|
3371
3371
|
// The script T when this command is exactly this policy's confineBashPayload(T)
|
|
@@ -4176,5 +4176,5 @@ void startJobControl().then(() => {
|
|
|
4176
4176
|
try { loadJobs(); prepareRequestJournal(); } catch { process.exit(44); }
|
|
4177
4177
|
if (validPrivateJob) markReady(); else connect();
|
|
4178
4178
|
}, () => process.exit(45));
|
|
4179
|
-
`.trimStart();var b=
|
|
4180
|
-
export{Lt,Pr,lt,V,
|
|
4179
|
+
`.trimStart();var b=I("sha256").update(cs,"utf8").digest("hex"),Cn={42:"worker_config_invalid",43:"workspace_alias_failed",44:"job_journal_unavailable",45:"job_control_failed",46:"job_journal_owned"};
|
|
4180
|
+
export{Lt,Pr,lt,V,O,T,cs,b,Cn};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$n,Mn,To,Wt}from"./vm-hands-entry-lite-k9vk84wa.js";import{Tn,Ve,_o,In,Dn,On,Rr,x}from"./vm-hands-entry-lite-8v8x8zn2.js";import{Pt}from"./vm-hands-entry-lite-xe0benev.js";import{Nr}from"./vm-hands-entry-lite-j5t2pj4v.js";import{j}from"./vm-hands-entry-lite-cgddp0y3.js";import{a}from"./vm-hands-entry-lite-jvszqt0z.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ce,spawn as ne}from"child_process";import{randomBytes as Oe}from"crypto";import{chmodSync as he,existsSync as ae,lstatSync as Je,mkdirSync as Qe,readFileSync as oe,rmSync as ie,writeFileSync as u}from"fs";import{connect as Se}from"net";import{join as I}from"path";var B=32,Y=76;var m="./desktop-wallpaper-fd8f2wb2.jpg";var v="./dock-browser-y53t41cx.png";var Z="./dock-files-cp52htdw.png";var V="./dock-terminal-1es514yq.png";var z="./grok-wallpaper-71zwn2pj.jpg";var W="./grok-dock-browser-pzw59wnd.png";var U="./grok-dock-files-eckq444x.png";var ee="./grok-dock-terminal-hcpz3e43.png";var re=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
|
|
3
|
+
# The native Blaxel image ships no feh, hsetroot or compositor, but it does ship
|
|
4
|
+
# python3-gi and libX11. tint2 reads _XROOTPMAP_ID to draw its transparent panel.
|
|
5
|
+
# Usage: DISPLAY=:99 python3 set-root-wallpaper.py IMAGE
|
|
6
|
+
import ctypes, sys
|
|
7
|
+
import gi
|
|
8
|
+
gi.require_version("GdkPixbuf", "2.0")
|
|
9
|
+
from gi.repository import GdkPixbuf
|
|
10
|
+
x = ctypes.cdll.LoadLibrary("libX11.so.6")
|
|
11
|
+
x.XOpenDisplay.restype = ctypes.c_void_p
|
|
12
|
+
x.XOpenDisplay.argtypes = [ctypes.c_char_p]
|
|
13
|
+
d = x.XOpenDisplay(None)
|
|
14
|
+
if not d: sys.exit("no display")
|
|
15
|
+
for name, res, args in [
|
|
16
|
+
("XDefaultScreen", ctypes.c_int, [ctypes.c_void_p]),
|
|
17
|
+
("XRootWindow", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_int]),
|
|
18
|
+
("XDisplayWidth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
19
|
+
("XDisplayHeight", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
20
|
+
("XDefaultDepth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
21
|
+
("XDefaultVisual", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
22
|
+
("XDefaultGC", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
23
|
+
("XCreatePixmap", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_uint, ctypes.c_uint, ctypes.c_uint]),
|
|
24
|
+
("XCreateImage", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint, ctypes.c_int, ctypes.c_int]),
|
|
25
|
+
("XPutImage", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_uint, ctypes.c_uint]),
|
|
26
|
+
("XInternAtom", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int]),
|
|
27
|
+
("XChangeProperty", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_int, ctypes.c_int, ctypes.c_void_p, ctypes.c_int]),
|
|
28
|
+
("XSetWindowBackgroundPixmap", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong]),
|
|
29
|
+
("XClearWindow", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong]),
|
|
30
|
+
("XSetCloseDownMode", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
31
|
+
("XCloseDisplay", ctypes.c_int, [ctypes.c_void_p]),
|
|
32
|
+
]:
|
|
33
|
+
f = getattr(x, name); f.restype = res; f.argtypes = args
|
|
34
|
+
s = x.XDefaultScreen(d); root = x.XRootWindow(d, s)
|
|
35
|
+
w, h = x.XDisplayWidth(d, s), x.XDisplayHeight(d, s)
|
|
36
|
+
if x.XDefaultDepth(d, s) != 24: sys.exit("unsupported depth")
|
|
37
|
+
# Scale to cover the screen, then crop the centre.
|
|
38
|
+
src = GdkPixbuf.Pixbuf.new_from_file(sys.argv[1])
|
|
39
|
+
k = max(w / src.get_width(), h / src.get_height())
|
|
40
|
+
sw, sh = max(w, round(src.get_width() * k)), max(h, round(src.get_height() * k))
|
|
41
|
+
pb = src.scale_simple(sw, sh, GdkPixbuf.InterpType.BILINEAR).new_subpixbuf((sw - w) // 2, (sh - h) // 2, w, h).copy()
|
|
42
|
+
if pb.get_has_alpha(): pb = pb.composite_color_simple(w, h, GdkPixbuf.InterpType.NEAREST, 255, 1, 0, 0)
|
|
43
|
+
rgb, stride = pb.get_pixels(), pb.get_rowstride()
|
|
44
|
+
bgrx = bytearray(w * h * 4)
|
|
45
|
+
for y in range(h):
|
|
46
|
+
row = rgb[y * stride:y * stride + w * 3]; o = y * w * 4
|
|
47
|
+
bgrx[o:o + w * 4:4] = row[2::3]; bgrx[o + 1:o + w * 4:4] = row[1::3]; bgrx[o + 2:o + w * 4:4] = row[0::3]
|
|
48
|
+
buf = ctypes.create_string_buffer(bytes(bgrx), len(bgrx))
|
|
49
|
+
pix = x.XCreatePixmap(d, root, w, h, 24)
|
|
50
|
+
img = x.XCreateImage(d, x.XDefaultVisual(d, s), 24, 2, 0, buf, w, h, 32, 0) # ZPixmap
|
|
51
|
+
x.XPutImage(d, pix, x.XDefaultGC(d, s), img, 0, 0, 0, 0, w, h)
|
|
52
|
+
ref = ctypes.c_ulong(pix)
|
|
53
|
+
for atom in (b"_XROOTPMAP_ID", b"ESETROOT_PMAP_ID"):
|
|
54
|
+
x.XChangeProperty(d, root, x.XInternAtom(d, atom, 0), 20, 32, 0, ctypes.byref(ref), 1) # XA_PIXMAP, PropModeReplace
|
|
55
|
+
x.XSetWindowBackgroundPixmap(d, root, pix)
|
|
56
|
+
x.XClearWindow(d, root)
|
|
57
|
+
x.XSetCloseDownMode(d, 1) # RetainPermanent: the pixmap outlives this process
|
|
58
|
+
x.XCloseDisplay(d)
|
|
59
|
+
`;function Ye(e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
60
|
+
<openbox_config xmlns="http://openbox.org/3.4/rc">
|
|
61
|
+
<theme><keepBorder>no</keepBorder></theme>
|
|
62
|
+
<applications>
|
|
63
|
+
<!-- Debian Chromium is "Chromium"; Chrome for Testing is "Chromium-browser". -->
|
|
64
|
+
<application class="Chromium*">
|
|
65
|
+
<decor>no</decor>
|
|
66
|
+
<position force="yes"><x>${B}</x><y>${B}</y></position>
|
|
67
|
+
<size><width>${e.width-B*2}</width><height>${e.height-B-Y}</height></size>
|
|
68
|
+
</application>
|
|
69
|
+
</applications>
|
|
70
|
+
</openbox_config>`}var Ne=`# Remote sandbox dock \u2014 launcher icons only, centred, no panel fill
|
|
71
|
+
panel_items = L
|
|
72
|
+
panel_size = 100% 46
|
|
73
|
+
panel_margin = 0 10
|
|
74
|
+
panel_padding = 0 0 10
|
|
75
|
+
panel_position = bottom center horizontal
|
|
76
|
+
panel_shrink = 1
|
|
77
|
+
panel_background_id = 0
|
|
78
|
+
panel_layer = top
|
|
79
|
+
mouse_effects = 1
|
|
80
|
+
mouse_hover_icon_asb = 100 0 12
|
|
81
|
+
mouse_pressed_icon_asb = 100 0 -12
|
|
82
|
+
|
|
83
|
+
launcher_icon_size = 46
|
|
84
|
+
launcher_padding = 0 0 10
|
|
85
|
+
launcher_background_id = 0
|
|
86
|
+
launcher_tooltip = 1
|
|
87
|
+
|
|
88
|
+
launcher_item_app = /tmp/ara-chromium.desktop
|
|
89
|
+
launcher_item_app = /tmp/ara-files.desktop
|
|
90
|
+
launcher_item_app = /tmp/ara-terminal.desktop
|
|
91
|
+
`,De=32,ue=`# Remote sandbox dock (grok look) \u2014 small launcher icons only, centred, no panel fill
|
|
92
|
+
panel_items = L
|
|
93
|
+
panel_size = 100% ${De+16}
|
|
94
|
+
panel_margin = 0 0
|
|
95
|
+
panel_padding = 0 0 8
|
|
96
|
+
panel_position = bottom center horizontal
|
|
97
|
+
panel_shrink = 1
|
|
98
|
+
panel_background_id = 0
|
|
99
|
+
panel_layer = top
|
|
100
|
+
mouse_effects = 1
|
|
101
|
+
mouse_hover_icon_asb = 100 0 10
|
|
102
|
+
mouse_pressed_icon_asb = 100 0 -10
|
|
103
|
+
|
|
104
|
+
launcher_icon_size = ${De}
|
|
105
|
+
launcher_padding = 0 0 8
|
|
106
|
+
launcher_background_id = 0
|
|
107
|
+
launcher_tooltip = 1
|
|
108
|
+
|
|
109
|
+
launcher_item_app = /tmp/ara-chromium.desktop
|
|
110
|
+
launcher_item_app = /tmp/ara-files.desktop
|
|
111
|
+
launcher_item_app = /tmp/ara-terminal.desktop
|
|
112
|
+
`,Re=`corner-radius = 12;
|
|
113
|
+
rounded-corners-exclude = [
|
|
114
|
+
"class_g = 'tint2'",
|
|
115
|
+
"window_type = 'dock'",
|
|
116
|
+
"window_type = 'desktop'"
|
|
117
|
+
];
|
|
118
|
+
backend = "xrender";
|
|
119
|
+
shadow = false;
|
|
120
|
+
fading = false;
|
|
121
|
+
vsync = false;
|
|
122
|
+
inactive-opacity = 1.0;
|
|
123
|
+
active-opacity = 1.0;
|
|
124
|
+
`,ge="/tmp/ara-dock-browser.png",Ke=`[Desktop Entry]
|
|
125
|
+
Name=Chrome
|
|
126
|
+
Exec=chromium --no-sandbox %U
|
|
127
|
+
Icon=${ge}
|
|
128
|
+
Type=Application
|
|
129
|
+
Categories=Network;WebBrowser;
|
|
130
|
+
`,Fe=`[Desktop Entry]
|
|
131
|
+
Name=Terminal
|
|
132
|
+
Exec=bash -c "DISPLAY=:99 xterm -fa DejaVuSansMono -fs 11 -bg black -fg white"
|
|
133
|
+
Icon=/tmp/ara-dock-terminal.png
|
|
134
|
+
Type=Application
|
|
135
|
+
Categories=System;TerminalEmulator;
|
|
136
|
+
`,$e=`[Desktop Entry]
|
|
137
|
+
Name=Files
|
|
138
|
+
Exec=bash -c "DISPLAY=:99 pcmanfm --no-desktop"
|
|
139
|
+
Icon=/tmp/ara-dock-files.png
|
|
140
|
+
Type=Application
|
|
141
|
+
Categories=System;FileManager;
|
|
142
|
+
`;var te={"wallpaper.jpg":m,"dock-browser.png":v,"dock-terminal.png":V,"dock-files.png":Z,"grok-wallpaper.jpg":z,"grok-dock-browser.png":W,"grok-dock-terminal.png":ee,"grok-dock-files.png":U},Ce=re,Ge='set_wallpaper() { if command -v feh >/dev/null 2>&1; then feh --bg-fill "$1"; else python3 "$2" "$1"; fi; }';function de(e){let D=(p)=>p.replaceAll("DISPLAY=:99",`DISPLAY=${e.display}`).replaceAll("/tmp/ara-",`${e.root}/ara-`),s=e.look==="grok",d=new Set(e.absent??[]),t=d.has("files")&&e.filesViewerExec?e.filesViewerExec:null;if(t)d.delete("files");let c=(s?ue:Ne).split(`
|
|
143
|
+
`).filter((p)=>!(d.has("terminal")&&p.endsWith("/ara-terminal.desktop"))&&!(d.has("files")&&p.endsWith("/ara-files.desktop"))).join(`
|
|
144
|
+
`),n=(p)=>s?p.replace("/tmp/ara-dock-","/tmp/ara-grok-dock-"):p,o=t?$e.replace(/^Exec=.*$/m,`Exec=${t}`).replace("Categories=System;FileManager;","Categories=Utility;Viewer;"):$e,f=s?"ara-grok-wallpaper.jpg":"ara-wallpaper.jpg",i={"openbox/rc.xml":Ye(e.screen),"tint2/tint2rc":D(c),"picom/picom.conf":Re,...d.has("terminal")?{}:{"ara-terminal.desktop":D(n(Fe))},...d.has("files")?{}:{"ara-files.desktop":D(n(o))},"ara-chromium.desktop":D(n(Ke)).replace("chromium --no-sandbox %U",e.browserExec),"ara-set-root-wallpaper.py":Ce},X=[...N.slice(0,3),Ge,`[ ! -f "$ROOT/${f}" ] || set_wallpaper "$ROOT/${f}" "$ROOT/ara-set-root-wallpaper.py" || true`,'if alive tint2 && ! cmp -s "$ROOT/tint2/tint2rc" "$ROOT/tint2/applied"; then read -r pid _ <"$ROOT/tint2.pid"; kill -USR1 "$pid" 2>/dev/null || true; fi','cp "$ROOT/tint2/tint2rc" "$ROOT/tint2/applied" 2>/dev/null || true',...N.slice(3)];return{files:i,start:X}}var N=['ticks() { line=$(cat "/proc/$1/stat" 2>/dev/null) || return 1; rest=${line##*) }; case $rest in Z*|X*) return 1;; esac; printf "%s" "$rest" | cut -d " " -f20; }','alive() { [ -f "$ROOT/$1.pid" ] || return 1; read -r pid start <"$ROOT/$1.pid"; current=$(ticks "$pid") || return 1; [ "$current" = "$start" ] && kill -0 "$pid" 2>/dev/null; }','launch() { name=$1; shift; "$@" 9>&- >"$ROOT/$name.log" 2>&1 & pid=$!; start=$(ticks "$pid"); printf "%s %s\\n" "$pid" "$start" >"$ROOT/$name.pid"; }','if [ -f "$ROOT/tint2/tint2rc" ] && ! alive tint2 && command -v tint2 >/dev/null 2>&1; then launch tint2 tint2 -c "$ROOT/tint2/tint2rc"; fi','if [ -f "$ROOT/picom/picom.conf" ] && ! alive picom && command -v picom >/dev/null 2>&1; then launch picom picom --config "$ROOT/picom/picom.conf"; fi'];var Te=43200000,A=":99",ke=60000,P=15000,R={width:1280,height:800},_e=/^[A-Za-z0-9._:-]{1,160}$/;function we(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}var Me=["video","viewer","viewer_same_network","viewer_network","look"];function me(e,D=Date.now()){let s=["relay_url","session_id","expires_at"];if(!we(e)||s.some((f)=>!(f in e))||Object.keys(e).some((f)=>!s.includes(f)&&!Me.includes(f)))throw new r("invalid_display_request","Reason desktop request is malformed.");let d="video"in e?To(e.video):void 0,t="viewer"in e?$n(e.viewer):null,c="look"in e?Mn(e.look):null;if(d===null)throw new r("invalid_display_request","Reason desktop video request is invalid.");let n=null;try{n=typeof e.relay_url==="string"?new URL(e.relay_url):null}catch{}if(!n||n.protocol!=="wss:"&&n.protocol!=="ws:"||n.username||n.password)throw new r("invalid_display_request","Reason desktop relay URL is invalid.");if(typeof e.session_id!=="string"||!_e.test(e.session_id))throw new r("invalid_display_request","Reason desktop session identity is invalid.");let o=typeof e.expires_at==="string"?Date.parse(e.expires_at):Number.NaN;if(!Number.isFinite(o)||o<=D)throw new r("invalid_display_request","Reason desktop session has already expired.");return{relay_url:e.relay_url,session_id:e.session_id,expires_at:new Date(Math.min(o,D+Te)).toISOString(),...d?{video:d}:{},...t?{viewer:t}:{},...d&&e.viewer_same_network===!0?{viewer_same_network:!0}:{},...c?{look:c}:{}}}function Ft(e=process.platform){return(e==="linux"||e==="darwin"||e==="win32")&&x()?.features.display===!0}async function Vs(){if(process.platform==="win32")return Ft()&&await Rr();if(process.platform!=="darwin")return Ft();return await Rr()}function G(e){Qe(e,{recursive:!0,mode:448});let D=Je(e);if(!D.isDirectory()||D.isSymbolicLink()||process.getuid&&D.uid!==process.getuid())throw new r("display_unavailable","Reason desktop state directory is not private.");he(e,448)}function ve(e,D){let s=(t)=>{let c=Buffer.alloc(2);return c.writeUInt16BE(t.length),Buffer.concat([c,t])},d=Buffer.from([255,255]);return Buffer.concat([d,s(Buffer.alloc(0)),s(Buffer.from(e)),s(Buffer.from("MIT-MAGIC-COOKIE-1")),s(D)])}function y(e,D,s=2000){return new Promise((d)=>{let t=Se(e),c="",n=(o)=>{t.destroy(),d(o)};t.setTimeout(s,()=>n(!1)),t.once("error",()=>n(!1)),t.once("close",()=>n(!1)),t.once("connect",()=>{if(!D)n(!0)}),t.on("data",(o)=>{if(c+=o.toString("latin1"),c.length>=4)n(c.startsWith("RFB "))})})}async function Q(e,D){let s=Date.now()+D;while(Date.now()<s){if(await e())return!0;await new Promise((d)=>setTimeout(d,100))}return!1}function g(e,D,s){return new Promise((d)=>{let t=ne(e,D,{detached:!0,stdio:"ignore",env:s});t.once("error",()=>d(-1)),t.once("exit",(c)=>d(c)),t.unref(),setTimeout(()=>d(null),P).unref()})}var J=null;function qe(e=a()){return J??=Ze(e).finally(()=>{J=null}),J}async function Ze(e){let D=x({home:e});if(!D?.xvfb||!D.x11vnc||!D.openbox)throw new r("display_unavailable","Run `reason desktop install` on this machine to enable its desktop.");Pt({root:D.root,automation:D.automation,extensionDir:D.extensionDir});let s=I(D.root,"display");G(s);let d=await We(e,s,D.x11vnc);if(d)return d;let t={display:A,xauthority:I(s,"Xauthority"),rfbSocket:I(s,"rfb.sock")},c=I(s,"pulse"),n=(async()=>{try{G(c)}catch{return null}return await _o(c,D.pulseaudio)})();G(I(s,"home"));let o=S(s,t,D.pulseaudio),f=async()=>({...t,sound:await n});if(await y({path:t.rfbSocket},!0))return be(I(s,"theme"),N,o),await f();if(!ae(t.xauthority))u(t.xauthority,ve(A.slice(1),Oe(16)),{mode:384,flag:"wx"});let i=T(I(s,"theme"),t.display,R,e),X={path:`/tmp/.X11-unix/X${A.slice(1)}`};if(!await y(X,!1)){let p=`${R.width}x${R.height}`;if(D.xvnc)ie(t.rfbSocket,{force:!0}),g(D.xvnc,[t.display,"-geometry",p,"-depth","24","-nolisten","tcp","-auth",t.xauthority,"-rfbport","-1","-rfbunixpath",t.rfbSocket,"-SecurityTypes","None","-UseBlacklist=0","-AlwaysShared","-desktop","Reason"],o);else g(D.xvfb,[t.display,"-screen","0",`${p}x24`,"-nolisten","tcp","-auth",t.xauthority],o);if(!await Q(()=>y(X,!1),P)||D.xvnc&&!await Q(()=>y({path:t.rfbSocket},!0),P))throw new r("display_unavailable","Reason could not start the virtual display.");g(D.openbox,["--config-file",i.openboxConfig],o)}if(await k(i,o),!await fe(D.x11vnc,t,s,"x11vnc.log",o))throw new r("display_unavailable","Reason could not start the desktop server.");return await f()}function S(e,D,s){let d={HOME:I(e,"home"),PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:D.display,XAUTHORITY:D.xauthority};if(s)d.PULSE_SERVER=Ve(Tn(I(e,"pulse")));return d}async function fe(e,D,s,d,t){if(await y({path:D.rfbSocket},!0))return!0;ie(D.rfbSocket,{force:!0});let c=await g(e,["-display",D.display,"-auth",D.xauthority,"-rfbport","0","-rfbportv6","-1","-unixsock",D.rfbSocket,"-nopw","-forever","-shared","-noxdamage","-sb","0","-rfbversion","3.7","-quiet","-bg","-o",I(s,d)],t);if(c!==null&&c!==0)return!1;return await Q(()=>y({path:D.rfbSocket},!0),P)}async function ze(){let e=["DISPLAY","XAUTHORITY","WAYLAND_DISPLAY","XDG_SESSION_TYPE"],D=(s)=>Object.fromEntries(e.flatMap((d)=>s[d]?[[d,s[d]]]:[]));if(process.env.DISPLAY)return D(process.env);try{let s=await new Promise((d,t)=>ce("systemctl",["--user","show-environment"],{encoding:"utf8",timeout:2000},(c,n)=>c?t(c):d(n)));return D(Object.fromEntries(s.split(`
|
|
145
|
+
`).flatMap((d)=>{let t=d.indexOf("=");return t>0?[[d.slice(0,t),d.slice(t+1)]]:[]})))}catch{return{}}}var se=new Set;async function We(e,D,s){let d=await ze(),t=/^:(\d+)(?:\.\d+)?$/.exec(d.DISPLAY??"")?.[1];if(!t||`:${t}`===A||d.WAYLAND_DISPLAY||d.XDG_SESSION_TYPE==="wayland")return null;let c={display:`:${t}`,xauthority:d.XAUTHORITY??I(e,".Xauthority"),rfbSocket:I(D,`rfb-${t}.sock`)},n=`${c.display} ${c.xauthority}`;if(se.has(n)||!await y({path:`/tmp/.X11-unix/X${t}`},!1))return null;let o={HOME:e,PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:c.display,XAUTHORITY:c.xauthority};if(await fe(s,c,D,`x11vnc-${t}.log`,o))return{...c,sound:null};return se.add(n),process.stderr.write(`Reason worker: your screen ${c.display} could not be served; using the virtual desktop
|
|
146
|
+
`),null}var Ie="look";function pe(e){try{return Mn(oe(I(e,Ie),"utf8").trim())??"reason"}catch{return"reason"}}function T(e,D,s,d,t=pe(e)){let c=`chromium --no-first-run --no-default-browser-check${process.geteuid?.()===0?" --no-sandbox":""} %U`,n=[["terminal","xterm"],["files","pcmanfm"]].filter(([,i])=>!ae(`/usr/bin/${i}`)).map(([i])=>i),o=`${c.replace(/ %U$/,"")} --app=file://${I(d,".reason","workspace")}/`,f=de({root:e,display:D,screen:s,browserExec:c,absent:n,look:t,filesViewerExec:o});for(let i of["","openbox","tint2","picom"])G(I(e,i));u(I(e,Ie),`${t}
|
|
147
|
+
`,{mode:384});for(let[i,X]of Object.entries(f.files))u(I(e,i),X,{mode:384});for(let[i,X]of Object.entries(te))u(I(e,`ara-${i}`),oe(X),{mode:384});return{root:e,openboxConfig:I(e,"openbox","rc.xml"),start:f.start}}function k(e,D){return be(e.root,[...e.start,"openbox --reconfigure >/dev/null 2>&1 || true"],D)}function be(e,D,s){let d=[`ROOT=${JSON.stringify(e)}`,...D].join(`
|
|
148
|
+
`);return new Promise((t)=>{let c=ne("/bin/sh",["-c",d],{stdio:"ignore",env:{...s,PATH:"/usr/bin:/bin"}}),n=setTimeout(()=>{c.kill(),t()},P);c.once("error",()=>{clearTimeout(n),t()}),c.once("exit",()=>{clearTimeout(n),t()})})}var je=2073600,Ue=320;function er(e,D){let s=Math.min(1,Math.sqrt(je/(e.width*e.height))),d=(t,c)=>Math.min(Math.floor(c/8)*8,Math.max(Ue,Math.round(t*s/8)*8));return{width:d(e.width,D.width),height:d(e.height,D.height)}}function _(e,D,s){return new Promise((d)=>ce(e,D,{env:s,encoding:"utf8",timeout:5000},(t,c)=>d(t?null:c)))}function Xe(e){let D=/current (\d+) x (\d+), maximum (\d+) x (\d+)/.exec(e),s=e.split(`
|
|
149
|
+
`),d=s.findIndex((c)=>/^\S+ connected/.test(c));if(!D||d<0)return null;let t=[];for(let c of s.slice(d+1)){let n=/^\s+(\d+x\d+)\s/.exec(c);if(!n)break;t.push(n[1])}return{current:{width:Number(D[1]),height:Number(D[2])},maximum:{width:Number(D[3]),height:Number(D[4])},output:s[d].split(" ")[0],modes:t}}async function rr(e,D,s){if(e.display!==A)return null;let d={PATH:"/usr/bin:/bin",DISPLAY:e.display,XAUTHORITY:e.xauthority},t=(f)=>_("xrandr",f,d),c=Xe(await t(["--query"])??"");if(!c||c.maximum.width<=c.current.width&&c.maximum.height<=c.current.height)return null;let n=er(D,c.maximum);if(n.width===c.current.width&&n.height===c.current.height)return{size:n,changed:!1};let o=`${n.width}x${n.height}`;if(!c.modes.includes(o)){if(await t(["--newmode",o,"60",...[n.width,n.width,n.width,n.width,n.height,n.height,n.height,n.height].map(String)]),await t(["--addmode",c.output,o])===null)return null}return s(),await t(["--output",c.output,"--mode",o])===null?null:{size:n,changed:!0}}async function Dr(e,D){let s=a(),d=x({home:s});if(!d)return;let t=I(d.root,"display"),c=S(t,e,d.pulseaudio);await k(T(I(t,"theme"),e.display,D,s),c);let n=D.width-B*2,o=D.height-B-Y;await _("xdotool",["search","--onlyvisible","--class","Chromium","windowsize","%@",String(n),String(o),"windowmove","%@",String(B),String(B)],{...c,PATH:"/usr/bin:/bin"})}var K=Promise.resolve();function $r(e,D,s=()=>{}){let d=K.then(()=>rr(e,D,s));return K=d.then((t)=>t?.changed?Dr(e,t.size):void 0).catch(()=>{}),d.then((t)=>t?.size??null,()=>null)}function tr(e,D){if(e.display!==A)return Promise.resolve();let s=K.then(async()=>{let d=a(),t=x({home:d});if(!t)return;let c=I(t.root,"display"),n=I(c,"theme");if(pe(n)===D)return;let o=S(c,e,t.pulseaudio),f=Xe(await _("xrandr",["--query"],{PATH:"/usr/bin:/bin",DISPLAY:e.display,XAUTHORITY:e.xauthority})??"");await k(T(n,e.display,f?.current??R,d,D),o)});return K=s.catch(()=>{}),s.catch(()=>{})}async function jt(e,D={}){let s=D.now??Date.now,d=me(e.payload,s());if(e.signal.throwIfAborted(),!d.video)throw new r("display_video_required","Reason desktops stream as video now; this request came without it.");let t=D.platform??process.platform;if(t!=="linux"&&t!=="darwin"&&t!=="win32")throw new r("display_video_unsupported","This machine does not serve desktop video.");let{video:c,look:n}=d,o=(D.video?.desktop??(t==="darwin"?async()=>In:t==="win32"?async()=>Dn:async()=>{let f=await qe();if(n)await tr(f,n);return f}))();return await dr(e.signal,d,D,s,(f)=>On(f,{request:c,desktop:o,...d.viewer?{viewer:d.viewer}:{},viewerSameNetwork:d.viewer_same_network===!0},{resizeDesktop:$r,...D.video}),(f)=>Wt({type:"error",code:f}))}function dr(e,D,s,d,t,c){let n=d();return new Promise((o,f)=>{let i=null,X=!1,p=!1,w,F,L,q=!1,l=null,E=(b)=>{if(p)return;if(l)b=l.outcome;p=!0,clearTimeout(w),clearTimeout(F),e.removeEventListener("abort",O),L?.close();try{i?.close(1000,"display_session_over")}catch{}if("error"in b){f(b.error);return}o({reason:b.reason,...L?.summary(),duration_ms:Math.max(0,d()-n)})},C=()=>E({error:new r("display_relay_unavailable","Reason could not reach the desktop relay.")}),O=()=>{let b=e.reason;E({error:b instanceof r?b:new r("cancelled","Reason closed the desktop session.")})},M=()=>{if(!l||!i)return;let{outcome:b}=l,H=!("error"in b)?b.reason:b.error instanceof r?b.error.code:"display_unavailable";if(!l.told)try{i.send(c(H))}catch{}E(b)};if(L=t({get done(){return p||l!==null},get open(){return X&&!p&&l===null},get bufferedAmount(){return i?.bufferedAmount??0},send(b){if(p||l||!X||!i)return;try{i.send(b)}catch{E({reason:"relay_closed"})}},end:(b)=>{if(p||l)return;if(!("error"in b)&&q&&X){E(b);return}if(l={outcome:b,told:!("error"in b)&&X},q&&X)M()}}),p){L.close();return}if(e.aborted){O();return}e.addEventListener("abort",O,{once:!0}),w=setTimeout(()=>E({reason:"session_expired"}),Math.max(1,Date.parse(D.expires_at)-d())),F=setTimeout(()=>E({reason:"viewer_absent"}),s.viewerWaitMs??ke);try{i=(s.connect??Nr)(D.relay_url,(s.loadProxy??j)()?.url)}catch{C();return}i.binaryType="arraybuffer",i.onopen=()=>{if(p||!i)return;X=!0,L?.opened()},i.onmessage=(b)=>{if(p)return;let H=b.data,h=H instanceof ArrayBuffer?new Uint8Array(H):ArrayBuffer.isView(H)?new Uint8Array(H.buffer,H.byteOffset,H.byteLength):null;if(!h||h.byteLength===0)return;if(clearTimeout(F),q=!0,l){M();return}L?.received(h)},i.onclose=()=>{if(p)return;if(!X){C();return}E({reason:"relay_closed"})},i.onerror=()=>{if(p||X)return;C()}})}
|
|
150
|
+
export{Ft,Vs,G,qe,jt};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{E}from"./vm-hands-entry-lite-
|
|
3
|
-
`).at(-1)??"",o=[];for(let i of r.split(n?";":":")){let s=i.trim();if(n?!u.isAbsolute(s):!s.startsWith("/"))continue;if(s.includes("\x00"))continue;if(E(s))continue;o.push(s)}return h(o)}function xn(t){let e=t?.home??m(),n=t?.directoryExists??p,r=b.map((o)=>f(e,...o)).filter((o)=>{try{return n(o)}catch{return!1}});return h([...r,...process.platform==="win32"?Ar(process.env.PATH??process.env.Path??""):[],...P]).join(g)}async function C(t){let e=t?.shell??process.env.SHELL,n=()=>({path:xn({home:t?.home,directoryExists:t?.directoryExists}),source:"fallback"});if(process.platform==="win32"||!w(e))return n();let r;try{r=await(t?.runLoginShell??x)(e,["-lic",'printf %s "$PATH"'])}catch{return n()}if(Buffer.byteLength(r,"utf8")>S)return n();let o=Ar(r);if(o.length===0)return n();return{path:h([...o,...P]).join(":"),source:"login_shell"}}function
|
|
2
|
+
import{E}from"./vm-hands-entry-lite-72nj66ab.js";import{fe,De,Ne,Le,$e}from"./vm-hands-entry-lite-b6gsggvp.js";import{spawn as y}from"child_process";import{existsSync as p,mkdirSync as T,readFileSync as _,writeFileSync as A}from"fs";import{homedir as m}from"os";import{basename as H,delimiter as g,join as f,win32 as u}from"path";var Cr=process.platform==="win32"?De("win32"):"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",P=Cr.split(g),R=5000,S=65536,O=new Set(["zsh","bash"]),b=[[".local","bin"],[".bun","bin"],[".cargo","bin"],["go","bin"]],x=(t,e)=>new Promise((n,r)=>{let o;try{o=y(t,[...e],{...Ne(),stdio:["ignore","pipe","ignore"]}),Le(o)}catch(c){r(c);return}let i=[],s=0,a=null,L=(c)=>{a??=Error(c);try{if(o.pid!==void 0)$e(o.pid,"SIGKILL")}catch{}},d=setTimeout(()=>L("login_shell_timeout"),R);o.stdout?.on("data",(c)=>{if(s+=c.length,s>S)L("login_shell_output_too_large");else i.push(c)}),o.once("error",(c)=>{clearTimeout(d),r(c)}),o.once("close",(c)=>{if(clearTimeout(d),a)r(a);else if(c!==0)r(Error("login_shell_exit_nonzero"));else n(Buffer.concat(i).toString("utf8"))})});function w(t){return typeof t==="string"&&t.startsWith("/")&&!t.includes("\x00")&&O.has(H(t))}function h(t){let e=new Set,n=[];for(let r of t){if(e.has(r))continue;e.add(r),n.push(r)}return n}function Ar(t,e=process.platform){let n=e==="win32",r=t.split(`
|
|
3
|
+
`).at(-1)??"",o=[];for(let i of r.split(n?";":":")){let s=i.trim();if(n?!u.isAbsolute(s):!s.startsWith("/"))continue;if(s.includes("\x00"))continue;if(E(s))continue;o.push(s)}return h(o)}function xn(t){let e=t?.home??m(),n=t?.directoryExists??p,r=b.map((o)=>f(e,...o)).filter((o)=>{try{return n(o)}catch{return!1}});return h([...r,...process.platform==="win32"?Ar(process.env.PATH??process.env.Path??""):[],...P]).join(g)}async function C(t){let e=t?.shell??process.env.SHELL,n=()=>({path:xn({home:t?.home,directoryExists:t?.directoryExists}),source:"fallback"});if(process.platform==="win32"||!w(e))return n();let r;try{r=await(t?.runLoginShell??x)(e,["-lic",'printf %s "$PATH"'])}catch{return n()}if(Buffer.byteLength(r,"utf8")>S)return n();let o=Ar(r);if(o.length===0)return n();return{path:h([...o,...P]).join(":"),source:"login_shell"}}function uo(t){let e=null;return()=>(e??=C(t),e)}function l(t){if(t===void 0||t.includes("\x00")||Buffer.byteLength(t,"utf8")>32768)return;return t}function Ue(t){let e=t.source??process.env,n={HOME:t.home,PATH:t.path??Cr,TMPDIR:t.temporaryDirectory,SHELL:l(e.SHELL)??"/bin/zsh",LANG:l(e.LANG)??"C.UTF-8",LC_ALL:l(e.LC_ALL)??l(e.LANG)??"C.UTF-8"},r=l(e.LC_CTYPE),o=l(e.TERM),i=l(e.COLORTERM);if(r)n.LC_CTYPE=r;if(o)n.TERM=o;if(i)n.COLORTERM=i;if(process.platform==="win32"){for(let s of I){let a=l(e[s]);if(a)n[s]=a}n.TEMP=n.TMP=t.temporaryDirectory,n.SHELL=fe()??n.SHELL,n.PATH=kn(n.PATH)}return n}function kn(t,e=f(m(),".reason","python3")){let n=(i)=>t.split(u.delimiter).filter((s)=>s&&!/[\\/]WindowsApps[\\/]?$/i.test(s)).map((s)=>u.join(s,i)).find((s)=>p(s)),r=n("python.exe");if(n("python3.exe")||!r)return t;let o=`#!/bin/sh
|
|
4
4
|
exec "${r.replaceAll("\\","/")}" "$@"
|
|
5
5
|
`;try{let i=f(e,"python3");if(!p(i)||_(i,"utf8")!==o)T(e,{recursive:!0}),A(i,o)}catch{return t}return[e,t].join(u.delimiter)}var I=["SystemRoot","SystemDrive","windir","ComSpec","PATHEXT","USERPROFILE","USERNAME","USERDOMAIN","APPDATA","LOCALAPPDATA","ProgramData","ProgramFiles","ProgramFiles(x86)","ProgramW6432","CommonProgramFiles","NUMBER_OF_PROCESSORS","PROCESSOR_ARCHITECTURE","OS"];
|
|
6
|
-
export{Cr,Ar,xn,
|
|
6
|
+
export{Cr,Ar,xn,uo,Ue,kn};
|