@reason-machines/cli-linux-x64 0.2.401 → 0.2.402

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.
Files changed (98) hide show
  1. package/bin/reason +2 -2
  2. package/bin/runtime/srt/sandbox-runtime.mjs +31 -31
  3. package/bin/vm-hands/api-credentials-21wv0h6t.js +2 -0
  4. package/bin/vm-hands/api-e050y588.js +2 -0
  5. package/bin/vm-hands/{ask-relay-f46eb3zs.js → ask-relay-zc05zxz4.js} +3 -3
  6. package/bin/vm-hands/connect-cli-npxeps2h.js +2 -0
  7. package/bin/vm-hands/{custom-endpoint-device-2hzektq4.js → custom-endpoint-device-z400ftnh.js} +1 -1
  8. package/bin/vm-hands/desktop-account-t2f1aa9e.js +2 -0
  9. package/bin/vm-hands/{device-workspace-1n8aaz1j.js → device-workspace-ne4269qk.js} +1 -1
  10. package/bin/vm-hands/hands-worker-source-8621y83c.js +2 -0
  11. package/bin/vm-hands/{index-58750fwy.js → index-vaq4cqv7.js} +1 -1
  12. package/bin/vm-hands/{install-receipt-jddye4b2.js → install-receipt-23tf4870.js} +1 -1
  13. package/bin/vm-hands/local-automation-541wzbef.js +2 -0
  14. package/bin/vm-hands/local-capabilities-ymex3mmw.js +2 -0
  15. package/bin/vm-hands/local-desktop-users-4n5g9c2v.js +2 -0
  16. package/bin/vm-hands/local-display-mac-cqfc5xnc.js +2 -0
  17. package/bin/vm-hands/local-display-session-7e6wqe5c.js +2 -0
  18. package/bin/vm-hands/local-pty-session-wyrzfc50.js +2 -0
  19. package/bin/vm-hands/managed-runtime-f9nnr42a.js +2 -0
  20. package/bin/vm-hands/{network-contract-h7dq97gc.js → network-contract-hak6865b.js} +1 -1
  21. package/bin/vm-hands/package-jr4xjp4y.js +2 -0
  22. package/bin/vm-hands/permissions-pkk45vxx.js +2 -0
  23. package/bin/vm-hands/{reason-hands-protocol-bexqzhq5.js → reason-hands-protocol-ane0wwzb.js} +1 -1
  24. package/bin/vm-hands/serve-service-fpwme38f.js +2 -0
  25. package/bin/vm-hands/{status-n78zf8a8.js → status-sf4634w4.js} +2 -2
  26. package/bin/vm-hands/version-98dbzrna.js +2 -0
  27. package/bin/vm-hands/{vm-hands-entry-lite-psw2ymp5.js → vm-hands-entry-lite-0badx5n8.js} +2 -2
  28. package/bin/vm-hands/{vm-hands-entry-lite-k90ysszf.js → vm-hands-entry-lite-0dr3sp75.js} +2 -2
  29. package/bin/vm-hands/{vm-hands-entry-lite-6ffdqdyw.js → vm-hands-entry-lite-0mk8rxqv.js} +1 -1
  30. package/bin/vm-hands/{vm-hands-entry-lite-z9y1sb0f.js → vm-hands-entry-lite-0tkwcetg.js} +2 -2
  31. package/bin/vm-hands/{vm-hands-entry-lite-shm5nhjk.js → vm-hands-entry-lite-26d4ttdx.js} +1 -1
  32. package/bin/vm-hands/{vm-hands-entry-lite-qmtk8vgg.js → vm-hands-entry-lite-2grs67fz.js} +3 -3
  33. package/bin/vm-hands/{vm-hands-entry-lite-n71rv7kv.js → vm-hands-entry-lite-2k459na8.js} +1 -1
  34. package/bin/vm-hands/{vm-hands-entry-lite-fgdtrsf4.js → vm-hands-entry-lite-2yt333v3.js} +2 -2
  35. package/bin/vm-hands/{vm-hands-entry-lite-x64d3bdx.js → vm-hands-entry-lite-399rn7a2.js} +1 -1
  36. package/bin/vm-hands/{vm-hands-entry-lite-fkkmhfjc.js → vm-hands-entry-lite-400hmvkg.js} +2 -2
  37. package/bin/vm-hands/{vm-hands-entry-lite-rmaawtgm.js → vm-hands-entry-lite-8v6qhfxc.js} +1 -1
  38. package/bin/vm-hands/{vm-hands-entry-lite-09yt840b.js → vm-hands-entry-lite-afjzr3v2.js} +2 -2
  39. package/bin/vm-hands/{vm-hands-entry-lite-11ge54k1.js → vm-hands-entry-lite-apwve08w.js} +1 -1
  40. package/bin/vm-hands/{vm-hands-entry-lite-3pecyp8y.js → vm-hands-entry-lite-arw53mkf.js} +1 -1
  41. package/bin/vm-hands/{vm-hands-entry-lite-jn0wjv5q.js → vm-hands-entry-lite-b3jmyabq.js} +2 -2
  42. package/bin/vm-hands/{vm-hands-entry-lite-04y4b7c6.js → vm-hands-entry-lite-b8bcnenf.js} +1 -1
  43. package/bin/vm-hands/{vm-hands-entry-lite-bw28d85m.js → vm-hands-entry-lite-bk5acpe9.js} +1 -1
  44. package/bin/vm-hands/{vm-hands-entry-lite-sqyf9q9z.js → vm-hands-entry-lite-c1rexgd8.js} +2 -2
  45. package/bin/vm-hands/{vm-hands-entry-lite-4yw8vx5h.js → vm-hands-entry-lite-c3e25cks.js} +1 -1
  46. package/bin/vm-hands/{vm-hands-entry-lite-923jmcs3.js → vm-hands-entry-lite-caxtg4j7.js} +2 -2
  47. package/bin/vm-hands/{vm-hands-entry-lite-80jthkkx.js → vm-hands-entry-lite-cwd9y2pv.js} +3 -3
  48. package/bin/vm-hands/{vm-hands-entry-lite-mrw8bv5s.js → vm-hands-entry-lite-dj65hfea.js} +2 -2
  49. package/bin/vm-hands/{vm-hands-entry-lite-hkvkfq0z.js → vm-hands-entry-lite-f28ehysx.js} +1 -1
  50. package/bin/vm-hands/{vm-hands-entry-lite-shsqhwgs.js → vm-hands-entry-lite-gbf8h13w.js} +2 -2
  51. package/bin/vm-hands/vm-hands-entry-lite-gp85aqkt.js +9 -0
  52. package/bin/vm-hands/{vm-hands-entry-lite-qwxmr70t.js → vm-hands-entry-lite-heehk76b.js} +2 -2
  53. package/bin/vm-hands/{vm-hands-entry-lite-xz9w76j7.js → vm-hands-entry-lite-k9amte6k.js} +2 -2
  54. package/bin/vm-hands/{vm-hands-entry-lite-cbkszaqs.js → vm-hands-entry-lite-kaht6v11.js} +2 -2
  55. package/bin/vm-hands/{vm-hands-entry-lite-0kzefw0a.js → vm-hands-entry-lite-kntkyezs.js} +2 -2
  56. package/bin/vm-hands/{vm-hands-entry-lite-8bqyx62p.js → vm-hands-entry-lite-m7vam0j2.js} +2 -2
  57. package/bin/vm-hands/{vm-hands-entry-lite-m2y0x4v3.js → vm-hands-entry-lite-mwj7bnse.js} +2 -2
  58. package/bin/vm-hands/{vm-hands-entry-lite-cneah70y.js → vm-hands-entry-lite-nhhpc9n2.js} +3 -3
  59. package/bin/vm-hands/{vm-hands-entry-lite-h3vmfk68.js → vm-hands-entry-lite-nnrypv7q.js} +2 -2
  60. package/bin/vm-hands/{vm-hands-entry-lite-g7h6wjqy.js → vm-hands-entry-lite-nqvb7a2m.js} +1 -1
  61. package/bin/vm-hands/{vm-hands-entry-lite-ew7amfaf.js → vm-hands-entry-lite-qg11k3bf.js} +2 -2
  62. package/bin/vm-hands/{vm-hands-entry-lite-mkynexaq.js → vm-hands-entry-lite-rbjky7rd.js} +2 -2
  63. package/bin/vm-hands/{vm-hands-entry-lite-rtt2w6c6.js → vm-hands-entry-lite-swwb5mp2.js} +1 -1
  64. package/bin/vm-hands/{vm-hands-entry-lite-ecgyzbdp.js → vm-hands-entry-lite-wsnr4fx8.js} +2 -2
  65. package/bin/vm-hands/{vm-hands-entry-lite-ht482g94.js → vm-hands-entry-lite-wtc8ebkr.js} +2 -2
  66. package/bin/vm-hands/{vm-hands-entry-lite-39wk67c3.js → vm-hands-entry-lite-wts79wdn.js} +2 -2
  67. package/bin/vm-hands/{vm-hands-entry-lite-ajmxhzs9.js → vm-hands-entry-lite-x0x1t6gp.js} +2 -2
  68. package/bin/vm-hands/vm-hands-entry-lite-x914078k.js +11 -0
  69. package/bin/vm-hands/{vm-hands-entry-lite-0a1ch6wx.js → vm-hands-entry-lite-x96qadgp.js} +1 -1
  70. package/bin/vm-hands/{vm-hands-entry-lite-saemagkr.js → vm-hands-entry-lite-xaaxvbk8.js} +2 -2
  71. package/bin/vm-hands/{vm-hands-entry-lite-18kfytsa.js → vm-hands-entry-lite-ysk49bnz.js} +2 -2
  72. package/bin/vm-hands/{vm-hands-entry-lite-4yw77epm.js → vm-hands-entry-lite-yz6a02cp.js} +1 -1
  73. package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
  74. package/bin/vm-hands/{vm-hands-executor-bvhh1xjv.js → vm-hands-executor-6bm919bz.js} +1 -1
  75. package/bin/vm-hands/vm-hands-op-runner-zr3ajywy.js +2 -0
  76. package/bin/vm-hands/{vm-hands-runtime-ak2je4yk.js → vm-hands-runtime-p24enq6p.js} +3 -3
  77. package/bin/vm-hands/worker-sandbox-mn60tmqv.js +2 -0
  78. package/package.json +1 -1
  79. package/bin/vm-hands/api-5fk9zhcg.js +0 -2
  80. package/bin/vm-hands/api-credentials-y4f0h1hq.js +0 -2
  81. package/bin/vm-hands/connect-cli-y59ghysm.js +0 -2
  82. package/bin/vm-hands/desktop-account-skdwydhn.js +0 -2
  83. package/bin/vm-hands/hands-worker-source-2x76smhs.js +0 -2
  84. package/bin/vm-hands/local-automation-0axsbkmj.js +0 -2
  85. package/bin/vm-hands/local-capabilities-kwvv8626.js +0 -2
  86. package/bin/vm-hands/local-desktop-users-aqjt40m2.js +0 -2
  87. package/bin/vm-hands/local-display-mac-r6nm1tb1.js +0 -2
  88. package/bin/vm-hands/local-display-session-e1dyfwns.js +0 -2
  89. package/bin/vm-hands/local-pty-session-ysfq0rq1.js +0 -2
  90. package/bin/vm-hands/managed-runtime-wca3sxsg.js +0 -2
  91. package/bin/vm-hands/package-9c803cqw.js +0 -2
  92. package/bin/vm-hands/permissions-6bkgyzy0.js +0 -2
  93. package/bin/vm-hands/serve-service-jxpty0gj.js +0 -2
  94. package/bin/vm-hands/version-8aqjarhj.js +0 -2
  95. package/bin/vm-hands/vm-hands-entry-lite-h8ykfv9r.js +0 -9
  96. package/bin/vm-hands/vm-hands-entry-lite-qmjrfhkv.js +0 -11
  97. package/bin/vm-hands/vm-hands-op-runner-vxwpb2sp.js +0 -2
  98. package/bin/vm-hands/worker-sandbox-0bwwxmxz.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{D as T,F as U}from"./vm-hands-entry-lite-n71rv7kv.js";import{_c as V}from"./vm-hands-entry-lite-rtt2w6c6.js";import{ti as M,vi as Q}from"./vm-hands-entry-lite-923jmcs3.js";import{Ji as G}from"./vm-hands-entry-lite-shm5nhjk.js";function W(j,B){let k=G(j,"REASON_API_URL")?.trim();if(!k)return Q(B);let z=new URL(k);if(z.protocol!=="https:"&&!(z.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(z.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return z.origin}function X(j){return G(j,"REASON_API_URL")?.trim()?W(j,"production"):void 0}function $(j){return G(j,"REASON_API_KEY")?.trim()||void 0}async function N(j,B){let k=j.env??process.env,z=$(k);if(!z)return(j.getCredentials??T)({apiOrigin:X(k),signal:B});let J=W(k,j.channel??M({env:k})),D=await(j.fetchImpl??fetch)(J+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+z,accept:"application/json"},signal:B}),L=await D.json().catch(()=>({})),w=V(L)?L:{};if(!D.ok){let H=typeof w.detail==="string"?w.detail:typeof w.message==="string"?w.message:"API key authentication failed ("+D.status+")";throw new U(D.status,typeof w.error==="string"?w.error:"api_key_auth_failed",H)}if(typeof w.org_id!=="string"||!w.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let Z=Array.isArray(w.scopes)?w.scopes.filter((H)=>typeof H==="string"):[];return{credentialKind:"api_key",apiOrigin:J,accessToken:z,orgId:w.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:Z}}async function P(j){let B=await N(j),k=X(j.env??process.env);if(!B)throw Error(k?`Not signed in to ${k}. Set REASON_API_KEY, or run \`reason login --api-url ${k}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return B}
2
+ import{D as T,F as U}from"./vm-hands-entry-lite-2k459na8.js";import{ad as V}from"./vm-hands-entry-lite-swwb5mp2.js";import{vi as M,xi as Q}from"./vm-hands-entry-lite-caxtg4j7.js";import{Li as G}from"./vm-hands-entry-lite-26d4ttdx.js";function W(j,B){let k=G(j,"REASON_API_URL")?.trim();if(!k)return Q(B);let z=new URL(k);if(z.protocol!=="https:"&&!(z.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(z.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return z.origin}function X(j){return G(j,"REASON_API_URL")?.trim()?W(j,"production"):void 0}function $(j){return G(j,"REASON_API_KEY")?.trim()||void 0}async function N(j,B){let k=j.env??process.env,z=$(k);if(!z)return(j.getCredentials??T)({apiOrigin:X(k),signal:B});let J=W(k,j.channel??M({env:k})),D=await(j.fetchImpl??fetch)(J+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+z,accept:"application/json"},signal:B}),L=await D.json().catch(()=>({})),w=V(L)?L:{};if(!D.ok){let H=typeof w.detail==="string"?w.detail:typeof w.message==="string"?w.message:"API key authentication failed ("+D.status+")";throw new U(D.status,typeof w.error==="string"?w.error:"api_key_auth_failed",H)}if(typeof w.org_id!=="string"||!w.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let Z=Array.isArray(w.scopes)?w.scopes.filter((H)=>typeof H==="string"):[];return{credentialKind:"api_key",apiOrigin:J,accessToken:z,orgId:w.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:Z}}async function P(j){let B=await N(j),k=X(j.env??process.env);if(!B)throw Error(k?`Not signed in to ${k}. Set REASON_API_KEY, or run \`reason login --api-url ${k}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return B}
3
3
  export{W as v,X as w,$ as x,N as y,P as z};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./vm-hands-entry-lite-h3vmfk68.js";import"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-18kfytsa.js";import{Sk as A}from"./vm-hands-entry-lite-4yw8vx5h.js";import{readFileSync as J}from"fs";var G=performance.now();delete process.env.BUN_BE_BUN;var q=(j,b={})=>console.log(JSON.stringify({stage:j,ms:Math.round(performance.now()),...b}));async function K(){if(process.argv.includes("--vm-hands-op-runner")){let{runVmHandsOpRunner:D}=await import("./vm-hands-op-runner-vxwpb2sp.js");await D();return}q("parsed",{t0:Math.round(G)});let j="";try{j=J(3,"utf8")}catch{}q("fd3_read",{bytes:j.length});let b=null;if(j.trim())try{b=JSON.parse(j)}catch{b=null}if(!b||typeof b!=="object"||Array.isArray(b))q(j.trim()?"identity_invalid":"identity_free"),await new Promise(()=>{setInterval(()=>{return},1073741824)});let{parseVmHandsInit:B,runVmHands:C}=await import("./vm-hands-runtime-ak2je4yk.js"),z=B(b);if(!z)q("identity_invalid"),await new Promise(()=>{setInterval(()=>{return},1073741824)});await C(z,q),process.exit(0)}K();
2
+ import"./vm-hands-entry-lite-nnrypv7q.js";import"./vm-hands-entry-lite-afjzr3v2.js";import"./vm-hands-entry-lite-ysk49bnz.js";import{Vk as A}from"./vm-hands-entry-lite-c3e25cks.js";import{readFileSync as J}from"fs";var G=performance.now();delete process.env.BUN_BE_BUN;var q=(j,b={})=>console.log(JSON.stringify({stage:j,ms:Math.round(performance.now()),...b}));async function K(){if(process.argv.includes("--vm-hands-op-runner")){let{runVmHandsOpRunner:D}=await import("./vm-hands-op-runner-zr3ajywy.js");await D();return}q("parsed",{t0:Math.round(G)});let j="";try{j=J(3,"utf8")}catch{}q("fd3_read",{bytes:j.length});let b=null;if(j.trim())try{b=JSON.parse(j)}catch{b=null}if(!b||typeof b!=="object"||Array.isArray(b))q(j.trim()?"identity_invalid":"identity_free"),await new Promise(()=>{setInterval(()=>{return},1073741824)});let{parseVmHandsInit:B,runVmHands:C}=await import("./vm-hands-runtime-p24enq6p.js"),z=B(b);if(!z)q("identity_invalid"),await new Promise(()=>{setInterval(()=>{return},1073741824)});await C(z,q),process.exit(0)}K();
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{s as wq}from"./vm-hands-entry-lite-11ge54k1.js";import{Mb as Nq,qc as Aq,wb as jq,wc as Rq}from"./vm-hands-entry-lite-qmtk8vgg.js";import"./vm-hands-entry-lite-fkkmhfjc.js";import"./vm-hands-entry-lite-xz9w76j7.js";import"./vm-hands-entry-lite-39wk67c3.js";import"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";import{spawn as gq}from"child_process";import{chmodSync as Sq,chownSync as Eq,existsSync as l,lstatSync as e,mkdirSync as r,mkdtempSync as yq,readdirSync as s,readFileSync as I,realpathSync as mq,rmdirSync as qq,rmSync as uq,writeFileSync as y}from"fs";import{join as L}from"path";import{readFileSync as Wq,readlinkSync as Gq}from"fs";import{relative as _q}from"path";var Jq=16;function Yq(X){return X.replace(/\\([0-7]{3})/g,($,W)=>String.fromCharCode(Number.parseInt(W,8)))}function hq(X){let $=[];for(let W of X.split(`
2
+ import{s as wq}from"./vm-hands-entry-lite-apwve08w.js";import{Ob as Nq,sc as Aq,yb as jq,yc as Rq}from"./vm-hands-entry-lite-2grs67fz.js";import"./vm-hands-entry-lite-400hmvkg.js";import"./vm-hands-entry-lite-k9amte6k.js";import"./vm-hands-entry-lite-wts79wdn.js";import"./vm-hands-entry-lite-afjzr3v2.js";import"./vm-hands-entry-lite-wtc8ebkr.js";import"./vm-hands-entry-lite-kntkyezs.js";import"./vm-hands-entry-lite-8v6qhfxc.js";import"./vm-hands-entry-lite-0dr3sp75.js";import"./vm-hands-entry-lite-399rn7a2.js";import"./vm-hands-entry-lite-caxtg4j7.js";import"./vm-hands-entry-lite-26d4ttdx.js";import"./vm-hands-entry-lite-0mk8rxqv.js";import"./vm-hands-entry-lite-wsnr4fx8.js";import"./vm-hands-entry-lite-arw53mkf.js";import"./vm-hands-entry-lite-b3jmyabq.js";import"./vm-hands-entry-lite-ysk49bnz.js";import"./vm-hands-entry-lite-dj65hfea.js";import"./vm-hands-entry-lite-rbjky7rd.js";import"./vm-hands-entry-lite-b8bcnenf.js";import"./vm-hands-entry-lite-x96qadgp.js";import"./vm-hands-entry-lite-f28ehysx.js";import"./vm-hands-entry-lite-c3e25cks.js";import{spawn as gq}from"child_process";import{chmodSync as Sq,chownSync as Eq,existsSync as l,lstatSync as e,mkdirSync as r,mkdtempSync as yq,readdirSync as s,readFileSync as I,realpathSync as mq,rmdirSync as qq,rmSync as uq,writeFileSync as y}from"fs";import{join as L}from"path";import{readFileSync as Wq,readlinkSync as Gq}from"fs";import{relative as _q}from"path";var Jq=16;function Yq(X){return X.replace(/\\([0-7]{3})/g,($,W)=>String.fromCharCode(Number.parseInt(W,8)))}function hq(X){let $=[];for(let W of X.split(`
3
3
  `)){let q=W.split(" ");if(q.length<10||!/^\d+:\d+$/.test(q[2]))continue;$.push({device:q[2],root:Yq(q[3]),mountPoint:Yq(q[4])})}return $}function kq(X,$,W){let q=X.replace(/\/+$/,"")||"/",J=(F)=>q==="/"||F===q||F.startsWith(`${q}/`),G=(F)=>new Map(hq(F).filter((R)=>J(R.mountPoint)).map((R)=>[`${R.mountPoint}\x00${R.device}\x00${R.root}`,R.mountPoint])),Y=G($),A=G(W),j=(F)=>_q(q,F)||".",f=[...Y].filter(([F])=>!A.has(F)).map(([,F])=>j(F)),O=[...A].filter(([F])=>!Y.has(F)).map(([,F])=>j(F));return{missing:f,extra:O,referenceCount:Y.size,ownCount:A.size}}function Kq(X,$,W,q="/proc"){let J,G,Y=null;try{J=Wq(`${q}/1/mountinfo`,"utf8"),G=Wq(`${q}/self/mountinfo`,"utf8")}catch(R){let v=R&&typeof R==="object"&&"code"in R&&typeof R.code==="string"?R.code:"unreadable";$("vm_hands.mount_check_unavailable",{code:v});return}try{Y=Gq(`${q}/1/ns/mnt`)===Gq(`${q}/self/ns/mnt`)}catch{}let{missing:A,extra:j,referenceCount:f,ownCount:O}=kq(X,J,G),F={reference_count:f,own_count:O,missing_count:A.length,extra_count:j.length,same_namespace:Y};if(j.length)$("vm_hands.mount_extra",{...F,extra:j.slice(0,Jq)});if(A.length)throw $("vm_hands.mount_mismatch",{...F,missing:A.slice(0,Jq)}),W(`${A.length} mount(s) under the Session root are missing from vm-hands' namespace`)}var Pq="/sys/fs/cgroup/reason-payload",H="vm-hands",lq="/run/ara-srt/fallbacks.jsonl",E="/reason-person",Xq=5000,cq=1e4,Bq="__VM_HANDS_PROOF_DIR__",pq="__VM_HANDS_PROBE_NONCE__";class D extends Error{code;constructor(X,$){super($);this.code=X}}function aq(X,$){if(!/^[0-9a-f-]{36}$/i.test($))throw new D("vm_hands_bind_invalid","bad bind id");return L(X,H,`b-${$.toLowerCase()}`)}var tq=5000,Iq=(X)=>`'${X.replaceAll("'","'\\''")}'`;function JX(X){let $=X.cgroup??Pq,W=X.init.layout.payload_uid,q=X.log??(()=>{}),J=new Map,G=new Map,Y=0,A=()=>{try{let Z=I("/run/ara-srt/starts.jsonl","utf8"),z=Z.slice(Y>Z.length?0:Y).split(`
4
4
  `).filter(Boolean);Y=Z.length;let K=z.map((U)=>{try{return Number(JSON.parse(U).elapsed_ms)||0}catch{return 0}});if(K.length)q("vm_hands.srt_server_starts",{count:K.length,elapsed_ms:K.slice(0,8)})}catch{}},j=null,f=!1,O=X.srtCgroup??"/sys/fs/cgroup/reason-srt",F=()=>{j??=Uq()},R=0,v=()=>{try{let Z=I(lq,"utf8"),z=Z.slice(R>Z.length?0:R);R=Z.length;let K=z.split(`
5
5
  `).filter(Boolean).slice(0,1000);if(!K.length)return null;let U={},T=0;for(let N of K)try{let M=JSON.parse(N),B=typeof M.code==="string"&&/^[a-z_]{1,40}$/.test(M.code)?M.code:"other";if(U[B]=(U[B]??0)+1,typeof M.elapsed_ms==="number")T=Math.max(T,M.elapsed_ms)}catch{U.unparsed=(U.unparsed??0)+1}return q("vm_hands.srt_fallbacks",{count:K.length,codes:U,max_elapsed_ms:T}),{count:K.length,codes:U,max_elapsed_ms:T}}catch{return null}},P=!1,m=(Z,z,K)=>{if(P)throw Error("vm_hands_pool_held");return vq(Z,z,K)},i=(Z)=>(z,K,U)=>gq("/bin/sh",["-c",`echo $$ > ${Iq(L(Z,"cgroup.procs"))} || exit 125; exec "$@"`,"vm-hands-join",z,...K],U),vq=i(L($,H)),u=L($,H,"probe"),g=(Z)=>aq($,Z),bq=(Z)=>{let z=g(Z);try{r(z,{mode:493})}catch(K){if(!(K&&typeof K==="object"&&("code"in K)&&K.code==="EEXIST"))throw new D("vm_hands_bind_failed","bind cgroup")}return z},xq=(Z)=>{try{qq(g(Z))}catch{}},x=X.prespawn?Nq({spawnProcess:m,...X.relayDependencies?.sourceEntrypoint?{sourceEntrypoint:X.relayDependencies.sourceEntrypoint}:{},log:(Z,z)=>q(Z,z??{})}):null;x?.arm();let n=x?setInterval(()=>{x.arm()},tq):null;n?.unref?.();async function c(Z){let z=J.get(Z);if(J.delete(Z),!z)return;z.abort.abort(),await z.done}return{bindCgroup:g,async startExecutor(Z){if(F(),G.set(Z.bindId,Uq()),f=!0,!Z.claim)throw new D("vm_hands_bind_invalid","an executor needs the claim it serves");await c(Z.bindId);let{claim:z,bindId:K}=Z,U=bq(K),T=z.owner;if(!T||typeof T.device_id!=="string"||typeof z.root_id!=="string")throw new D("vm_hands_bind_invalid","claim without its owner Device or root");let N=new AbortController,M,B,V=new Promise((Q,w)=>{M=Q,B=w}),_,C=new Promise((Q)=>{_=Q}),S=Rq({headless:!0,hostExecution:!0,runtimeDirectory:X.runtimeDirectory,deviceIdentity:{deviceId:T.device_id,rootId:z.root_id,apiOrigin:X.apiOrigin},claimOwner:z.owner,root:X.root,runId:z.run_id,operationId:z.operation_id,attemptId:z.attempt_id,payload:Object.fromEntries(Object.entries(z.payload).filter(([Q])=>!Q.startsWith("vm_hands_"))),signal:N.signal,...Z.workspaceGrant?{workspaceGrant:Z.workspaceGrant}:{},emitEvent:async(Q,w)=>{if(Q==="hands.ready"){M(w);return}if(Q==="hands.started"||Q==="hands.stopped"||Q==="hands.failed")return;await X.forward(K,Q,w)}},{...X.relayDependencies,spawnWorker:(Q)=>i(U)(Q.command,Q.args,Q.options),...x?{takePrespawnedWorker:(Q)=>{let w=x.take(Q);if(!w?.pid)return w;try{return y(L(U,"cgroup.procs"),String(w.pid)),w}catch{try{w.kill("SIGKILL")}catch{}return null}},adoptSpawnedWorker:x.adopt}:{}}).then(()=>{_("executor_stopped")},(Q)=>{let w=Q&&typeof Q==="object"&&"code"in Q?String(Q.code):"executor_failed";B(new D(w,Q instanceof Error?Q.message:String(Q))),_(w)}).finally(()=>B(new D("vm_hands_executor_exited","executor ended before it was ready")));J.set(K,{abort:N,done:S,exited:C,operationId:z.operation_id,runId:z.run_id,expiresAtMs:Date.parse(String(z.payload.expires_at??""))||0});let h=await V,p=h.executor_launch_id;if(typeof p!=="string")throw new D("vm_hands_bind_failed","executor ready without a launch id");return{launchId:p,readyData:h,applied:{hands_confinement:typeof z.payload.hands_confinement==="string"?z.payload.hands_confinement:null,browser_egress:z.payload.browser_egress??null}}},takeSrtFallbacks:v,executorExited(Z){return J.get(Z)?.exited??new Promise(()=>{})},freezeBind(Z){let z=g(Z);if(l(L(z,"cgroup.freeze")))y(L(z,"cgroup.freeze"),"1")},async killAndVerifyPayload(Z){let z=new Set(Z?.keep??[]);if(z.size||Z?.own)return Hq(Z?.bindId??null,z,Z?.own===!0);P=!0;let K=Tq();try{await Mq();let U=Promise.all([...J.keys()].map((B)=>c(B).catch(()=>{return})));A();let T=Date.now()+Xq;await a($,T,"payload"),await U;let N=(f||X.srtWarmLate?.()===!0)&&l(L(O,"cgroup.events"));if(N)await a(O,T,"srt");let M=$q(W).filter((B)=>!b(B,E));if(j!==null){let B=Zq(j).filter((V)=>V!==process.pid&&!b(V,E));if(B.length)throw q("vm_hands.kill_strays",{strays:t(B)}),new D("vm_hands_kill_unverified",`${B.length} process(es) the run started survived it`);j=null}if(f=!1,N)X.onSrtReset?.();if(M.length)throw q("vm_hands.kill_survivors",{pids:M.slice(0,16)}),new D("vm_hands_kill_unverified",`${M.length} payload-uid process(es) outside the payload cgroup`);G.clear();for(let B of zq())try{qq(L($,H,B))}catch{}}finally{P=!1,K()}if(x)setTimeout(()=>{if(!J.size)x.arm()},100).unref?.()},async killProbe(){let Z=Date.now()+Xq;if(l(L(u,"cgroup.events"))){await a(u,Z,"probe");try{qq(u)}catch{}}let z=Qq(process.pid);if(z===null)throw new D("vm_hands_kill_unverified","agent start time unreadable");await dq($,z,Z);let K=(T)=>{let N=Qq(T);return N!==null&&N<=z},U=$q(W).filter((T)=>K(T)&&!b(T,E));if(U.length)throw q("vm_hands.kill_survivors",{pids:U.slice(0,16),at:"attest"}),new D("vm_hands_kill_unverified",`${U.length} payload-uid process(es) from before this agent`);if(j!==null){let T=[$,L($,H)].map((B)=>B.replace(/^\/sys\/fs\/cgroup/,"")),N=O.replace(/^\/sys\/fs\/cgroup/,""),M=Zq(j).filter((B)=>B!==process.pid&&!b(B,E)&&!b(B,"/reason-vm-hands")&&!b(B,N)&&!T.some((V)=>Lq(B,V)));if(M.length&&f)throw q("vm_hands.kill_strays",{strays:t(M),at:"attest"}),new D("vm_hands_kill_unverified",`${M.length} process(es) the run started survived it`);if(M.length)q("vm_hands.attest_concurrent",{processes:t(M),count:M.length});j=null}},async runProbe({nonce:Z,script:z}){if(F(),!z.includes(Bq))throw new D("vm_hands_probe_failed","probe names no proof directory");let K=X.proofParent??"/tmp/reason-vm-hands-proof";r(K,{mode:457,recursive:!0});let U=e(K);if(U.isSymbolicLink()||!U.isDirectory()||U.uid!==(process.getuid?.()??-1)||(U.mode&4095)!==457)throw new D("vm_hands_probe_failed","proof parent is not root's 0711 directory");let T=yq(L(K,"p-")),N=!1;try{if(!/^[A-Za-z0-9/._-]+$/.test(T)||!/^[A-Za-z0-9_-]{1,128}$/.test(Z))throw new D("vm_hands_probe_failed","proof directory path or nonce");Eq(T,W,W),Sq(T,448);let M=e(T).ino;try{r(u,{mode:493})}catch(C){if(!(C&&typeof C==="object"&&("code"in C)&&C.code==="EEXIST"))throw new D("vm_hands_probe_failed","probe cgroup")}let B=i(u)("/bin/bash",["-c",z.replaceAll(Bq,T).replaceAll(pq,Z)],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:["ignore","pipe","ignore"]}),V="";B.stdout?.on("data",(C)=>{if(V.length<16384)V+=C.toString("utf8").slice(0,16384-V.length)});let _=await new Promise((C)=>{let S=setTimeout(()=>{N=!0,B.kill("SIGKILL"),C(124)},cq);B.once("error",()=>{clearTimeout(S),C(127)}),B.once("close",(h)=>{clearTimeout(S),C(h??1)})});return q("vm_hands.probe",{nonce_len:Z.length,exit_code:_}),{exitCode:_,markers:V,proofDirInode:M}}finally{if(!N)uq(T,{recursive:!0,force:!0})}},restatLayout(){let{session_root:Z,alias:z}=X.init.layout,K="invalid";try{Aq(Z),K="0:0:755"}catch{}let U=!1,T=-1;try{let N=e(z);T=N.uid,U=K==="0:0:755"&&z===L(Z,"repo")&&!N.isSymbolicLink()&&N.isDirectory()&&mq(z)===z&&N.uid===W}catch{}return{root_mode:K,alias_ok:U,owner_uid:T}},verifyMounts(){Kq(X.init.layout.session_root,q,(Z)=>new D("vm_hands_mount_mismatch",Z))},installEnvironment(Z,z){let K=J.get(Z);if(!K)throw new D("environment_unavailable","no executor owns an environment");return jq({root:X.root,operationId:K.operationId,payload:z}).installed_revision},async stop(){if(n)clearInterval(n);x?.close(),await Promise.all([...J.keys()].map((Z)=>c(Z)))}};function zq(){try{return s(L($,H),{withFileTypes:!0}).filter((Z)=>Z.isDirectory()&&/^b-[0-9a-f-]{36}$/.test(Z.name)).map((Z)=>Z.name)}catch{return[]}}async function Hq(Z,z,K=!1){let U=new Set([...z].map((N)=>N.toLowerCase())),T=Tq();try{await Mq();let N=Date.now()+Xq,M=new Set(zq().filter((Q)=>!U.has(Q.slice(2))).map((Q)=>Q.slice(2)));if(Z)M.add(Z.toLowerCase());let B=null;for(let Q of M){let w=c(Q).catch(()=>{return}),o=G.get(Q);if(o!==void 0)B=B===null?o:Math.min(B,o);if(l(L(g(Q),"cgroup.events")))await a(g(Q),N,"bind");await w}let V=[...U].map((Q)=>g(Q).replace(/^\/sys\/fs\/cgroup/,"")),_=[$,L($,H)].map((Q)=>Q.replace(/^\/sys\/fs\/cgroup/,"")),C=O.replace(/^\/sys\/fs\/cgroup/,""),S=(Q)=>b(Q,E)||V.some((w)=>b(Q,w)),h=K?[]:$q(W).filter((Q)=>!S(Q));if(h.length)throw q("vm_hands.kill_survivors",{pids:h.slice(0,16),beside:U.size}),new D("vm_hands_kill_unverified",`${h.length} payload-uid process(es) outside a live bind`);let p=(Q)=>!S(Q)&&!b(Q,"/reason-vm-hands")&&!b(Q,C)&&!_.some((w)=>Lq(Q,w));if(B!==null){let Q=Zq(B).filter((w)=>w!==process.pid&&p(w));if(Q.length)throw q("vm_hands.kill_strays",{strays:t(Q),beside:U.size}),new D("vm_hands_kill_unverified",`${Q.length} process(es) the run started survived it`)}for(let Q of M)G.delete(Q),xq(Q)}finally{T()}}}function Qq(X,$="/proc"){try{let W=I(L($,String(X),"stat"),"utf8"),q=Number(W.slice(W.lastIndexOf(")")+2).split(" ")[19]);return Number.isFinite(q)?q:null}catch{return null}}function Cq(X,$="/proc"){try{let W=I(L($,String(X),"stat"),"utf8"),q=Number(W.slice(W.lastIndexOf(")")+2).split(" ")[1]);return Number.isFinite(q)?q:null}catch{return null}}async function dq(X,$,W){try{y(L(X,"cgroup.freeze"),"1")}catch(q){throw new D("vm_hands_kill_unverified",`payload cgroup.freeze: ${q instanceof Error?q.message:String(q)}`)}try{for(;;){let q=Oq(X).filter((G)=>fq(G,X)),J=new Set(q.filter((G)=>{let Y=Qq(G);return Y!==null&&Y<=$}));for(let G=!0;G;){G=!1;for(let Y of q){if(J.has(Y))continue;let A=Cq(Y);if(A!==null&&J.has(A))J.add(Y),G=!0}}if(J.size===0)return;if(Date.now()>W)throw new D("vm_hands_kill_unverified",`${J.size} previous-boot process(es) survived`);for(let G of J)try{process.kill(G,"SIGKILL")}catch{}await new Promise((G)=>setTimeout(G,10))}}finally{try{y(L(X,"cgroup.freeze"),"0")}catch{}}}function Lq(X,$,W="/proc"){try{return I(L(W,String(X),"cgroup"),"utf8").split(`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{s as a,t as b,u as c}from"./vm-hands-entry-lite-apwve08w.js";import"./vm-hands-entry-lite-f28ehysx.js";import"./vm-hands-entry-lite-c3e25cks.js";export{b as spawnSessionPty,c as runVmHandsOpRunner,a as VM_HANDS_OP_RUNNER_PERSON_ARG};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{xa as k,ya as m,za as l}from"./vm-hands-entry-lite-h3vmfk68.js";import{Me as p}from"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-18kfytsa.js";import{Sk as F}from"./vm-hands-entry-lite-4yw8vx5h.js";import{spawn as i}from"child_process";import{createHash as t}from"crypto";import{lstatSync as A,mkdirSync as s,readFileSync as d,statSync as e,writeFileSync as c}from"fs";var C="/run/reason-vm-hands",R="/run/reason-vm-hands/env",h="/home/runner/.reason/workspace",jj=/^https:\/\/[a-z0-9.-]+(?::\d{1,5})?$/,S="/sys/fs/cgroup/reason-srt",qj=["/usr/local/bin/reason-srt-exec","/usr/local/bin/ara-srt-exec"],Jj=65536,Qj=21600000;function Zj(Q,j="/run/ara-srt"){try{if((process.getuid?.()??-1)!==0)return;s(j,{recursive:!0,mode:448});let q=A(j);if(!q.isDirectory()||q.uid!==0||(q.mode&63)!==0){Q("srt_base_keyed_skipped",{reason:"socket_dir_unsafe"});return}c(`${j}/base-keyed`,`1
3
- `,{mode:420}),Q("srt_base_keyed",{})}catch{Q("srt_base_keyed_skipped",{reason:"error"})}}function y(Q,j){let q=(G)=>{return j("srt_warm_skipped",{reason:G}),Promise.resolve()};if(typeof Q.srt_base_settings!=="string")return q("no_settings");let Z=Buffer.from(Q.srt_base_settings,"base64");if(Z.length===0||Z.length>Jj||Z.toString("base64")!==Q.srt_base_settings)return q("settings_invalid");let X;try{let G=A(S);if(!G.isDirectory()||G.uid!==0||(G.mode&18)!==0)return q("cgroup_unsafe");let L=qj.find((M)=>A(M,{throwIfNoEntry:!1})!==void 0);if(!L)return q("cgroup_or_exec_missing");X=L;for(let[M,H]of[[X,!1],["/usr/local/bin",!0]]){let Y=A(M);if((H?!Y.isDirectory():!Y.isFile())||Y.uid!==0||(Y.mode&18)!==0)return q("srt_exec_unsafe")}}catch{return q("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return q("not_root");let z=performance.now(),f=t("sha256").update(Z).digest("hex"),D=`${C}/srt-base-settings.json`;try{c(D,Z,{mode:384,flag:"w"})}catch{return q("settings_write")}let W=i("/bin/sh",["-c",`echo $$ > ${S}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",X,"--settings",D,"--idle-ms",String(Qj),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((G)=>{W.once("error",()=>{j("srt_warm_failed",{reason:"spawn"}),G()}),W.once("close",(L)=>{j(L===0?"srt_warm_done":"srt_warm_failed",{exit_code:L,warm_ms:Math.round(performance.now()-z),settings_sha256:f}),G()})})}var u=3000;function Nj(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let j=Q,q=j.layout,Z=j.device_key,X=j.credential;return typeof j.workspace_id==="string"&&Number.isSafeInteger(j.instance_generation)&&typeof j.api_origin==="string"&&jj.test(j.api_origin)&&typeof j.manifest_digest==="string"&&!!X&&typeof X.key_id==="string"&&Number.isSafeInteger(X.expires_at_ms)&&typeof X.signature==="string"&&!!q&&typeof q.session_root==="string"&&typeof q.alias==="string"&&Number.isSafeInteger(q.payload_uid)&&typeof q.kind==="string"&&!!Z&&typeof Z.pkcs8==="string"&&typeof Z.spki==="string"?j:null}function v(Q){s(Q,{recursive:!0,mode:448});let j=e(Q);if(!j.isDirectory()||(j.mode&63)!==0||j.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${Q}`)}async function $j(Q){let[{CLI_VERSION:j},q,Z,X]=await Promise.all([import("./version-8aqjarhj.js"),import("./hands-worker-source-2x76smhs.js"),import("./network-contract-h7dq97gc.js"),import("./device-workspace-1n8aaz1j.js")]),{REASON_HANDS_PROTOCOL_VERSION:z}=await import("./reason-hands-protocol-bexqzhq5.js");return{reason_runtime_version:j,bridge_version:j,protocol_version:p,execution_eligible:!0,instance_generation:Q.instance_generation,capabilities:{supported_operations:["hands.connect"],hands_worker_artifact_sha256:q.REASON_HANDS_WORKER_ARTIFACT_SHA256,hands_worker_entrypoint:q.REASON_HANDS_WORKER_ENTRYPOINT,hands_slots:1,max_payload_bytes:Z.LOCAL_OPERATION_MAX_BYTES,max_result_bytes:Z.LOCAL_OPERATION_MAX_BYTES,operation_constraints:{"hands.connect":{ready:!0,execution_mode:"host",transport:"wss_relay",worker:"ara_hands",slots:1,session_group:Z.HANDS_SESSION_GROUP,worker_version:q.REASON_HANDS_WORKER_VERSION,protocol_version:z,worker_artifact_sha256:q.REASON_HANDS_WORKER_ARTIFACT_SHA256,worker_entrypoint:q.REASON_HANDS_WORKER_ENTRYPOINT,policy_mode:"full_access",policy_version:1,workspace_base:X.REASON_WORKSPACE_BASE,workspace_layout:X.SESSION_WORKSPACE_LAYOUT,browser_state:"optional_headless",desktop:!1,max_session_ms:43200000,environment_delivery:Z.HANDS_ENVIRONMENT_DELIVERY,[Z.HANDS_ENVIRONMENT_AT_CLAIM_KEY]:Z.HANDS_ENVIRONMENT_AT_CLAIM,[Z.HANDS_CLOUD_ACCESS_KEY]:Z.HANDS_CLOUD_ACCESS,[Z.HANDS_LARGE_ENVIRONMENT_KEY]:Z.HANDS_LARGE_ENVIRONMENT,[Z.HANDS_CONFINEMENT_KEY]:Z.HANDS_CONFINEMENT,[Z.HANDS_JOBS_USER_KEY]:Z.HANDS_JOBS_USER,vm_hands:"v1"}}}}}var P=["fs.read","fs.write","fs.export","fs.import","exec.run","exec.full","process.list","ports.list","pty.start","jobs.control","automation.call.v1"],Xj=new Set(["pty.start","jobs.control"]);function zj(Q,j){let q=j([{id:"vm-hands",label:"workspace",path:h,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}],{worker:{executionMode:"unsandboxed",readiness:Object.fromEntries(P.map((z)=>[z,!0]))}}),Z=Q.capabilities,X={...Z.operation_constraints};for(let z of P)X[z]={...q.operation_constraints?.[z]??{},ready:!0,execution_mode:q.operation_constraints?.[z]?.execution_mode??"host"};return{...Q,capabilities:{...Z,supported_operations:["hands.connect",...P],operation_constraints:X}}}function Gj(Q){for(let j of d("/etc/passwd","utf8").split(`
4
- `)){let q=j.split(":");if(q.length>=4&&Number(q[2])===Q&&/^\d+$/.test(q[3]??"")&&Number(q[3])>0)return Number(q[3])}throw Error("vm_hands_payload_account_unavailable")}function Fj(Q,j){let q=j.owner;if(!q||typeof q.organization_id!=="string"||typeof q.device_id!=="string"||typeof j.root_id!=="string")return null;return{version:4,apiOrigin:Q.api_origin,orgId:q.organization_id,deviceId:q.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:j.root_id,label:"workspace",path:h,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}function Kj(Q=process.platform,j="/proc/self/oom_score_adj"){if(Q!=="linux")return null;let q;try{q=d(j,"utf8").trim()}catch{return{value:"unreadable"}}if(!/^-?\d+$/.test(q))return{value:"unreadable"};let Z=Number(q);return Z<0?{value:Z}:null}async function Wj(Q,j){let q=Kj();if(q)j("vm_hands.oom_protected",{code:"vm_hands_oom_protected",value:q.value}),await new Promise(()=>{setInterval(()=>{return},1073741824)});v(C),v(R),Zj(j);let Z=y(Q,j),X=!1,z=async()=>{if(!await Promise.race([Z.then(()=>!0),new Promise(($)=>setTimeout(()=>$(!1),u).unref?.())]))X=!0,j("srt_warm_late",{wait_ms:u})},[{configureDesktopAccount:f},{configureWorkerSandbox:D}]=await Promise.all([import("./desktop-account-skdwydhn.js"),import("./worker-sandbox-0bwwxmxz.js")]);D();try{f({value:String(Q.layout.payload_uid)})}catch{j("payload_account_unavailable"),await new Promise(()=>{setInterval(()=>{return},1073741824)})}let W=new AbortController;for(let J of["SIGTERM","SIGINT"])process.on(J,()=>W.abort());let G=new Map,L,M=new Promise((J)=>{L=J}),H=M.then(()=>import("./vm-hands-executor-bvhh1xjv.js")).then(({createVmHandsExecutor:J})=>{let $=J({init:Q,root:h,runtimeDirectory:C,apiOrigin:Q.api_origin,prespawn:!0,onSrtReset:()=>{X=!1,Z=y(Q,j)},srtWarmLate:()=>X,forward:(B,K,g)=>G.get(B)?.(K,g)??Promise.reject(Error("vm_hands_not_bound")),log:(B,K)=>j(B,K)});return j("executor_loaded"),$}),Y=(J)=>async(...$)=>(await H)[J](...$),w=null;H.then((J)=>{w=($)=>J.executorExited($)});let N={startExecutor:async(...J)=>{return await z(),Y("startExecutor")(...J)},killAndVerifyPayload:Y("killAndVerifyPayload"),killProbe:Y("killProbe"),runProbe:async(...J)=>{return await z(),Y("runProbe")(...J)},restatLayout:()=>{throw Error("replaced below")},verifyMounts:()=>{throw Error("replaced below")},installEnvironment:()=>{throw Error("replaced below")},executorExited:(J)=>w?w(J):new Promise(()=>{}),takeSrtFallbacks:()=>null};H.then((J)=>{N.restatLayout=()=>J.restatLayout(),N.verifyMounts=()=>J.verifyMounts(),N.installEnvironment=($,B)=>J.installEnvironment($,B),N.freezeBind=($)=>J.freezeBind($),N.takeSrtFallbacks=()=>J.takeSrtFallbacks?.()??null});let o=await k(Q),n=new m(Q,o,N,{envRoot:R}),b=$j(Q),E=null,a=Promise.all([b,import("./local-capabilities-kwvv8626.js")]).then(([J,$])=>{E=zj(J,$.capabilityInventoryForRoots),j("device_ops_loaded")}).catch((J)=>j("device_ops_unavailable",{error:J instanceof Error?J.name:"error"})),T=M.then(()=>import("./vm-hands-executor-bvhh1xjv.js")).then(({createVmHandsOpRunners:J,vmHandsBindCgroup:$,VM_HANDS_PAYLOAD_CGROUP:B})=>J({payloadUid:Q.layout.payload_uid,payloadGid:Gj(Q.layout.payload_uid),bindCgroup:(K)=>$(B,K),log:(K,g)=>j(K,g)})).catch(()=>null);T.then((J)=>J?.warm("person")),j("agent_ready"),await l({apiOrigin:Q.api_origin,agent:n,signal:W.signal,heartbeat:async()=>E??await b,executeOp:async({kind:J,claim:$,bindId:B,signal:K,emit:g})=>{let x=Fj(Q,$);if(!x)return{status:"failed",error_code:"vm_hands_bind_invalid"};let _={executionMode:"unsandboxed",runtimeDirectory:C,readiness:Object.fromEntries(P.map((U)=>[U,!0]))},I=(U)=>{let V=typeof U.kind==="string"?U.kind:"";if(V)g({kind:V,...U.data&&typeof U.data==="object"?{data:U.data}:{}})};if($.capability==="exec.full"&&J!=="person")return{status:"failed",error_code:"capability_not_granted"};if($.capability==="automation.call.v1"&&J!=="model")return{status:"failed",error_code:"capability_not_granted"};let r=$.capability==="pty.start"&&J==="person"&&!$.authority;if(Xj.has(String($.capability))&&!r){let{executeLocalOperation:U}=await import("./local-capabilities-kwvv8626.js");return U(x,$,{worker:_,signal:K,emit:(V)=>I(V)})}let O=await T;if(!O)return{status:"failed",error_code:"vm_hands_payload_account_unavailable"};return O.run(J,{id:String($.attempt_id),claim:$,state:x,worker:_},I,K,B)},readyData:({launchId:J})=>({executor_launch_id:J}),log:(J,$)=>{if(J==="vm_hands.registered"||J==="vm_hands.reconnected")L();j(J,$)},onTurn:(J,$)=>{if($)G.set(J,$);else G.delete(J)}}),await(await H).stop(),(await T)?.stop()}export{Kj as vmHandsOomProtection,y as startBaseSrtServer,Wj as runVmHands,Nj as parseVmHandsInit,$j as heartbeatBody,Zj as enableBaseKeyedSrt};
2
+ import{Aa as m,Ba as l,za as k}from"./vm-hands-entry-lite-nnrypv7q.js";import{Oe as p}from"./vm-hands-entry-lite-afjzr3v2.js";import"./vm-hands-entry-lite-ysk49bnz.js";import{Vk as F}from"./vm-hands-entry-lite-c3e25cks.js";import{spawn as i}from"child_process";import{createHash as t}from"crypto";import{lstatSync as A,mkdirSync as s,readFileSync as d,statSync as e,writeFileSync as c}from"fs";var C="/run/reason-vm-hands",R="/run/reason-vm-hands/env",h="/home/runner/.reason/workspace",jj=/^https:\/\/[a-z0-9.-]+(?::\d{1,5})?$/,S="/sys/fs/cgroup/reason-srt",qj=["/usr/local/bin/reason-srt-exec","/usr/local/bin/ara-srt-exec"],Jj=65536,Qj=21600000;function Zj(Q,j="/run/ara-srt"){try{if((process.getuid?.()??-1)!==0)return;s(j,{recursive:!0,mode:448});let q=A(j);if(!q.isDirectory()||q.uid!==0||(q.mode&63)!==0){Q("srt_base_keyed_skipped",{reason:"socket_dir_unsafe"});return}c(`${j}/base-keyed`,`1
3
+ `,{mode:420}),Q("srt_base_keyed",{})}catch{Q("srt_base_keyed_skipped",{reason:"error"})}}function y(Q,j){let q=(G)=>{return j("srt_warm_skipped",{reason:G}),Promise.resolve()};if(typeof Q.srt_base_settings!=="string")return q("no_settings");let Z=Buffer.from(Q.srt_base_settings,"base64");if(Z.length===0||Z.length>Jj||Z.toString("base64")!==Q.srt_base_settings)return q("settings_invalid");let X;try{let G=A(S);if(!G.isDirectory()||G.uid!==0||(G.mode&18)!==0)return q("cgroup_unsafe");let L=qj.find((M)=>A(M,{throwIfNoEntry:!1})!==void 0);if(!L)return q("cgroup_or_exec_missing");X=L;for(let[M,H]of[[X,!1],["/usr/local/bin",!0]]){let Y=A(M);if((H?!Y.isDirectory():!Y.isFile())||Y.uid!==0||(Y.mode&18)!==0)return q("srt_exec_unsafe")}}catch{return q("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return q("not_root");let z=performance.now(),f=t("sha256").update(Z).digest("hex"),D=`${C}/srt-base-settings.json`;try{c(D,Z,{mode:384,flag:"w"})}catch{return q("settings_write")}let W=i("/bin/sh",["-c",`echo $$ > ${S}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",X,"--settings",D,"--idle-ms",String(Qj),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((G)=>{W.once("error",()=>{j("srt_warm_failed",{reason:"spawn"}),G()}),W.once("close",(L)=>{j(L===0?"srt_warm_done":"srt_warm_failed",{exit_code:L,warm_ms:Math.round(performance.now()-z),settings_sha256:f}),G()})})}var u=3000;function Nj(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let j=Q,q=j.layout,Z=j.device_key,X=j.credential;return typeof j.workspace_id==="string"&&Number.isSafeInteger(j.instance_generation)&&typeof j.api_origin==="string"&&jj.test(j.api_origin)&&typeof j.manifest_digest==="string"&&!!X&&typeof X.key_id==="string"&&Number.isSafeInteger(X.expires_at_ms)&&typeof X.signature==="string"&&!!q&&typeof q.session_root==="string"&&typeof q.alias==="string"&&Number.isSafeInteger(q.payload_uid)&&typeof q.kind==="string"&&!!Z&&typeof Z.pkcs8==="string"&&typeof Z.spki==="string"?j:null}function v(Q){s(Q,{recursive:!0,mode:448});let j=e(Q);if(!j.isDirectory()||(j.mode&63)!==0||j.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${Q}`)}async function $j(Q){let[{CLI_VERSION:j},q,Z,X]=await Promise.all([import("./version-98dbzrna.js"),import("./hands-worker-source-8621y83c.js"),import("./network-contract-hak6865b.js"),import("./device-workspace-ne4269qk.js")]),{REASON_HANDS_PROTOCOL_VERSION:z}=await import("./reason-hands-protocol-ane0wwzb.js");return{reason_runtime_version:j,bridge_version:j,protocol_version:p,execution_eligible:!0,instance_generation:Q.instance_generation,capabilities:{supported_operations:["hands.connect"],hands_worker_artifact_sha256:q.REASON_HANDS_WORKER_ARTIFACT_SHA256,hands_worker_entrypoint:q.REASON_HANDS_WORKER_ENTRYPOINT,hands_slots:1,max_payload_bytes:Z.LOCAL_OPERATION_MAX_BYTES,max_result_bytes:Z.LOCAL_OPERATION_MAX_BYTES,operation_constraints:{"hands.connect":{ready:!0,execution_mode:"host",transport:"wss_relay",worker:"ara_hands",slots:1,session_group:Z.HANDS_SESSION_GROUP,worker_version:q.REASON_HANDS_WORKER_VERSION,protocol_version:z,worker_artifact_sha256:q.REASON_HANDS_WORKER_ARTIFACT_SHA256,worker_entrypoint:q.REASON_HANDS_WORKER_ENTRYPOINT,policy_mode:"full_access",policy_version:1,workspace_base:X.REASON_WORKSPACE_BASE,workspace_layout:X.SESSION_WORKSPACE_LAYOUT,browser_state:"optional_headless",desktop:!1,max_session_ms:43200000,environment_delivery:Z.HANDS_ENVIRONMENT_DELIVERY,[Z.HANDS_ENVIRONMENT_AT_CLAIM_KEY]:Z.HANDS_ENVIRONMENT_AT_CLAIM,[Z.HANDS_CLOUD_ACCESS_KEY]:Z.HANDS_CLOUD_ACCESS,[Z.HANDS_LARGE_ENVIRONMENT_KEY]:Z.HANDS_LARGE_ENVIRONMENT,[Z.HANDS_CONFINEMENT_KEY]:Z.HANDS_CONFINEMENT,[Z.HANDS_JOBS_USER_KEY]:Z.HANDS_JOBS_USER,vm_hands:"v1"}}}}}var P=["fs.read","fs.write","fs.export","fs.import","exec.run","exec.full","process.list","ports.list","pty.start","jobs.control","automation.call.v1"],Xj=new Set(["pty.start","jobs.control"]);function zj(Q,j){let q=j([{id:"vm-hands",label:"workspace",path:h,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}],{worker:{executionMode:"unsandboxed",readiness:Object.fromEntries(P.map((z)=>[z,!0]))}}),Z=Q.capabilities,X={...Z.operation_constraints};for(let z of P)X[z]={...q.operation_constraints?.[z]??{},ready:!0,execution_mode:q.operation_constraints?.[z]?.execution_mode??"host"};return{...Q,capabilities:{...Z,supported_operations:["hands.connect",...P],operation_constraints:X}}}function Gj(Q){for(let j of d("/etc/passwd","utf8").split(`
4
+ `)){let q=j.split(":");if(q.length>=4&&Number(q[2])===Q&&/^\d+$/.test(q[3]??"")&&Number(q[3])>0)return Number(q[3])}throw Error("vm_hands_payload_account_unavailable")}function Fj(Q,j){let q=j.owner;if(!q||typeof q.organization_id!=="string"||typeof q.device_id!=="string"||typeof j.root_id!=="string")return null;return{version:4,apiOrigin:Q.api_origin,orgId:q.organization_id,deviceId:q.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:j.root_id,label:"workspace",path:h,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}function Kj(Q=process.platform,j="/proc/self/oom_score_adj"){if(Q!=="linux")return null;let q;try{q=d(j,"utf8").trim()}catch{return{value:"unreadable"}}if(!/^-?\d+$/.test(q))return{value:"unreadable"};let Z=Number(q);return Z<0?{value:Z}:null}async function Wj(Q,j){let q=Kj();if(q)j("vm_hands.oom_protected",{code:"vm_hands_oom_protected",value:q.value}),await new Promise(()=>{setInterval(()=>{return},1073741824)});v(C),v(R),Zj(j);let Z=y(Q,j),X=!1,z=async()=>{if(!await Promise.race([Z.then(()=>!0),new Promise(($)=>setTimeout(()=>$(!1),u).unref?.())]))X=!0,j("srt_warm_late",{wait_ms:u})},[{configureDesktopAccount:f},{configureWorkerSandbox:D}]=await Promise.all([import("./desktop-account-t2f1aa9e.js"),import("./worker-sandbox-mn60tmqv.js")]);D();try{f({value:String(Q.layout.payload_uid)})}catch{j("payload_account_unavailable"),await new Promise(()=>{setInterval(()=>{return},1073741824)})}let W=new AbortController;for(let J of["SIGTERM","SIGINT"])process.on(J,()=>W.abort());let G=new Map,L,M=new Promise((J)=>{L=J}),H=M.then(()=>import("./vm-hands-executor-6bm919bz.js")).then(({createVmHandsExecutor:J})=>{let $=J({init:Q,root:h,runtimeDirectory:C,apiOrigin:Q.api_origin,prespawn:!0,onSrtReset:()=>{X=!1,Z=y(Q,j)},srtWarmLate:()=>X,forward:(B,K,g)=>G.get(B)?.(K,g)??Promise.reject(Error("vm_hands_not_bound")),log:(B,K)=>j(B,K)});return j("executor_loaded"),$}),Y=(J)=>async(...$)=>(await H)[J](...$),w=null;H.then((J)=>{w=($)=>J.executorExited($)});let N={startExecutor:async(...J)=>{return await z(),Y("startExecutor")(...J)},killAndVerifyPayload:Y("killAndVerifyPayload"),killProbe:Y("killProbe"),runProbe:async(...J)=>{return await z(),Y("runProbe")(...J)},restatLayout:()=>{throw Error("replaced below")},verifyMounts:()=>{throw Error("replaced below")},installEnvironment:()=>{throw Error("replaced below")},executorExited:(J)=>w?w(J):new Promise(()=>{}),takeSrtFallbacks:()=>null};H.then((J)=>{N.restatLayout=()=>J.restatLayout(),N.verifyMounts=()=>J.verifyMounts(),N.installEnvironment=($,B)=>J.installEnvironment($,B),N.freezeBind=($)=>J.freezeBind($),N.takeSrtFallbacks=()=>J.takeSrtFallbacks?.()??null});let o=await k(Q),n=new m(Q,o,N,{envRoot:R}),b=$j(Q),E=null,a=Promise.all([b,import("./local-capabilities-ymex3mmw.js")]).then(([J,$])=>{E=zj(J,$.capabilityInventoryForRoots),j("device_ops_loaded")}).catch((J)=>j("device_ops_unavailable",{error:J instanceof Error?J.name:"error"})),T=M.then(()=>import("./vm-hands-executor-6bm919bz.js")).then(({createVmHandsOpRunners:J,vmHandsBindCgroup:$,VM_HANDS_PAYLOAD_CGROUP:B})=>J({payloadUid:Q.layout.payload_uid,payloadGid:Gj(Q.layout.payload_uid),bindCgroup:(K)=>$(B,K),log:(K,g)=>j(K,g)})).catch(()=>null);T.then((J)=>J?.warm("person")),j("agent_ready"),await l({apiOrigin:Q.api_origin,agent:n,signal:W.signal,heartbeat:async()=>E??await b,executeOp:async({kind:J,claim:$,bindId:B,signal:K,emit:g})=>{let x=Fj(Q,$);if(!x)return{status:"failed",error_code:"vm_hands_bind_invalid"};let _={executionMode:"unsandboxed",runtimeDirectory:C,readiness:Object.fromEntries(P.map((U)=>[U,!0]))},I=(U)=>{let V=typeof U.kind==="string"?U.kind:"";if(V)g({kind:V,...U.data&&typeof U.data==="object"?{data:U.data}:{}})};if($.capability==="exec.full"&&J!=="person")return{status:"failed",error_code:"capability_not_granted"};if($.capability==="automation.call.v1"&&J!=="model")return{status:"failed",error_code:"capability_not_granted"};let r=$.capability==="pty.start"&&J==="person"&&!$.authority;if(Xj.has(String($.capability))&&!r){let{executeLocalOperation:U}=await import("./local-capabilities-ymex3mmw.js");return U(x,$,{worker:_,signal:K,emit:(V)=>I(V)})}let O=await T;if(!O)return{status:"failed",error_code:"vm_hands_payload_account_unavailable"};return O.run(J,{id:String($.attempt_id),claim:$,state:x,worker:_},I,K,B)},readyData:({launchId:J})=>({executor_launch_id:J}),log:(J,$)=>{if(J==="vm_hands.registered"||J==="vm_hands.reconnected")L();j(J,$)},onTurn:(J,$)=>{if($)G.set(J,$);else G.delete(J)}}),await(await H).stop(),(await T)?.stop()}export{Kj as vmHandsOomProtection,y as startBaseSrtServer,Wj as runVmHands,Nj as parseVmHandsInit,$j as heartbeatBody,Zj as enableBaseKeyedSrt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{r as a}from"./vm-hands-entry-lite-bk5acpe9.js";import"./vm-hands-entry-lite-heehk76b.js";import"./vm-hands-entry-lite-400hmvkg.js";import"./vm-hands-entry-lite-nqvb7a2m.js";import"./vm-hands-entry-lite-0mk8rxqv.js";import"./vm-hands-entry-lite-rbjky7rd.js";import"./vm-hands-entry-lite-b8bcnenf.js";import"./vm-hands-entry-lite-x96qadgp.js";import"./vm-hands-entry-lite-f28ehysx.js";import"./vm-hands-entry-lite-c3e25cks.js";export{a as configureWorkerSandbox};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reason-machines/cli-linux-x64",
3
- "version": "0.2.401",
3
+ "version": "0.2.402",
4
4
  "description": "Reason CLI native binary for linux-x64",
5
5
  "os": [
6
6
  "linux"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{F as a,G as b,H as c,I as d,J as e,K as f}from"./vm-hands-entry-lite-n71rv7kv.js";import"./vm-hands-entry-lite-sqyf9q9z.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{d as sessionPlace,c as sessionMachine,e as createMachineEnrollmentTicketWithToken,f as ReasonApi,b as REASONING_EFFORTS,a as ApiError};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{v as a,w as b,x as c,y as d,z as e}from"./vm-hands-entry-lite-4yw77epm.js";import"./vm-hands-entry-lite-n71rv7kv.js";import"./vm-hands-entry-lite-sqyf9q9z.js";import"./vm-hands-entry-lite-rtt2w6c6.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{d as resolveApiCredentials,e as requireApiCredentials,b as explicitApiOrigin,c as environmentApiKey,a as apiOriginFromEnvironment};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m}from"./vm-hands-entry-lite-8bqyx62p.js";import"./vm-hands-entry-lite-bw28d85m.js";import"./vm-hands-entry-lite-4yw77epm.js";import"./vm-hands-entry-lite-n71rv7kv.js";import"./vm-hands-entry-lite-qmjrfhkv.js";import"./vm-hands-entry-lite-sqyf9q9z.js";import"./vm-hands-entry-lite-80jthkkx.js";import"./vm-hands-entry-lite-qmtk8vgg.js";import"./vm-hands-entry-lite-qwxmr70t.js";import"./vm-hands-entry-lite-fkkmhfjc.js";import"./vm-hands-entry-lite-xz9w76j7.js";import"./vm-hands-entry-lite-rtt2w6c6.js";import"./vm-hands-entry-lite-39wk67c3.js";import"./vm-hands-entry-lite-g7h6wjqy.js";import"./vm-hands-entry-lite-saemagkr.js";import"./vm-hands-entry-lite-m2y0x4v3.js";import"./vm-hands-entry-lite-cbkszaqs.js";import"./vm-hands-entry-lite-ajmxhzs9.js";import"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-psw2ymp5.js";import"./vm-hands-entry-lite-fgdtrsf4.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-cneah70y.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{g as runDisconnectCli,f as runConnectCli,m as restartConnectionWhenIdle,l as restartConnection,h as logoutConnection,k as connectionUsesUserChrome,i as connectionReport,j as connectionForBrowserExtension,c as connectionDirectory,d as computerDisconnected,e as addConnectionFolder,b as DISCONNECT_HELP,a as CONNECT_HELP};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vg as a,Wg as b,Xg as c,Yg as d,Zg as e}from"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{b as passwdAccount,e as desktopHome,d as desktopAccount,c as configureDesktopAccount,a as DESKTOP_USER_ENV};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rc as a,Sc as b,Tc as c,Uc as d,Vc as e,Wc as f,Xc as g,Yc as h,Zc as i}from"./vm-hands-entry-lite-xz9w76j7.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{e as selectCloudChildPath,a as REASON_HANDS_WORKER_VERSION,h as REASON_HANDS_WORKER_SOURCE,b as REASON_HANDS_WORKER_ENTRYPOINT,i as REASON_HANDS_WORKER_ARTIFACT_SHA256,f as REASON_HANDS_MAC_PTY_MEMBER_SOURCE,g as REASON_HANDS_LINUX_PTY_PROBE_SOURCE,d as REASON_HANDS_CLOUD_CHILD_PATH_MACOS,c as REASON_HANDS_CLOUD_CHILD_PATH_LINUX};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Dd as a,Ed as b,Fd as c,Gd as d,Hd as e,Id as f,Jd as g,Kd as h,Ld as i,Md as j,Nd as k,Od as l}from"./vm-hands-entry-lite-m2y0x4v3.js";import"./vm-hands-entry-lite-cbkszaqs.js";import"./vm-hands-entry-lite-ajmxhzs9.js";import"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-psw2ymp5.js";import"./vm-hands-entry-lite-fgdtrsf4.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-cneah70y.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{d as runRelayed,e as runMacComputerUse,l as runLocalAutomation,k as runAutomationCallLocally,b as parseAutomationPayload,g as localUserChromeProfiles,h as localUserChromeInstance,f as localUserChromeHost,j as localBrowserProfile,c as localAutomationAvailable,i as ensureLocalBrowser,a as AUTOMATION_CHUNK_BYTES};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$a as m,Ra as c,Sa as d,Ta as e,Ua as f,Va as g,Wa as h,Xa as i,Ya as j,Za as k,_a as l,ab as n,bb as o,cb as p,db as q,eb as r,fb as s,gb as t,hb as u}from"./vm-hands-entry-lite-80jthkkx.js";import"./vm-hands-entry-lite-qmtk8vgg.js";import"./vm-hands-entry-lite-qwxmr70t.js";import"./vm-hands-entry-lite-fkkmhfjc.js";import"./vm-hands-entry-lite-xz9w76j7.js";import"./vm-hands-entry-lite-rtt2w6c6.js";import"./vm-hands-entry-lite-39wk67c3.js";import"./vm-hands-entry-lite-g7h6wjqy.js";import"./vm-hands-entry-lite-saemagkr.js";import"./vm-hands-entry-lite-m2y0x4v3.js";import"./vm-hands-entry-lite-cbkszaqs.js";import"./vm-hands-entry-lite-ajmxhzs9.js";import"./vm-hands-entry-lite-09yt840b.js";import"./vm-hands-entry-lite-psw2ymp5.js";import"./vm-hands-entry-lite-fgdtrsf4.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-cneah70y.js";import{aj as b}from"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import{Mk as a}from"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{j as writeOpenFlags,g as spawnCaptured,f as sandboxProfile,e as safeEnvironment,k as runTransferCapability,i as runFileCapability,t as rebindLocalHandsControl,b as isProtectedLocalPath,u as executeLocalOperation,m as enrolledWorkspaceRootFingerprint,q as enrolledRootPaths,p as enrolledHomeContainedRootFingerprints,n as enrolledAccountRootPath,o as enrolledAccountRootFingerprint,s as deliverLocalHandsEnvironment,h as defaultLocalCommandRunner,d as confinedExecutionShell,r as capabilityInventoryForRoots,c as SHORT_REQUEST_CAPABILITIES,a as LocalCapabilityError,l as LOCAL_CAPABILITY_REGISTRY};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qk as a,rk as b,sk as c,tk as d,uk as e,vk as f,wk as g}from"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{f as trackDesktopRun,c as releaseLocalDesktop,a as noteLocalDesktopUse,g as holdLocalDesktop,b as forgetLocalDesktopUse,e as DESKTOP_WAIT_MS,d as DESKTOP_IDLE_MS};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ik as a,jk as b,kk as c,lk as d,mk as e,nk as f,ok as g}from"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{c as requestMacScreenAccess,d as parseMacWindowBounds,a as parseMacScreenStatus,e as openMacWindowBounds,g as openMacInput,b as macScreenStatus,f as MacInputTranslator};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{lg as a,mg as b,ng as c,og as d,pg as e,qg as f,rg as g,sg as h}from"./vm-hands-entry-lite-psw2ymp5.js";import"./vm-hands-entry-lite-fgdtrsf4.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-0kzefw0a.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-cneah70y.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-mrw8bv5s.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{h as runLocalDisplayStream,f as privateDirectory,c as parseDisplayStreamPayload,e as localDisplayReady,d as localDisplayAvailable,g as ensureLinuxDesktop,a as LOCAL_DISPLAY_MAX_SESSION_MS,b as LINUX_WORKER_DISPLAY};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ag as g,Bg as h,Cg as i,Dg as j,ug as a,vg as b,wg as c,xg as d,yg as e,zg as f}from"./vm-hands-entry-lite-fgdtrsf4.js";import"./vm-hands-entry-lite-ht482g94.js";import"./vm-hands-entry-lite-rmaawtgm.js";import"./vm-hands-entry-lite-k90ysszf.js";import"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-18kfytsa.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{j as runLocalPtySession,e as resolvePtyWorkingDirectory,g as ptyRuntimeSupported,d as parsePtyStartPayload,h as defaultSpawnPty,f as defaultLoginShell,i as defaultConnect,a as LOCAL_PTY_MAX_SESSION_MS,c as LOCAL_PTY_MAX_SESSIONS,b as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$ as D,L as n,M as o,N as p,O as q,P as r,Q as s,R as t,S as u,T as v,U as w,V as x,W as y,X as z,Y as A,Z as B,_ as C,aa as E,ba as F,ca as G,da as H,ea as I,fa as J,ga as K,ha as L,ia as M,ja as N,ka as O,la as P,ma as Q,na as R,oa as S,pa as T,qa as U,ra as V,sa as W,ta as X,ua as Y}from"./vm-hands-entry-lite-qmjrfhkv.js";import"./vm-hands-entry-lite-39wk67c3.js";import"./vm-hands-entry-lite-g7h6wjqy.js";import{ci as a,di as b,ei as c,fi as d,gi as e,hi as f,ii as g,ji as h,li as i,mi as j,oi as k,pi as l,qi as m}from"./vm-hands-entry-lite-x64d3bdx.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{E as verifyManagedRuntimeCodeSignatures,m as verifyManagedRuntimeArtifact,H as updateManagedRuntime,l as sha256Hex,Q as rollbackManagedRuntime,R as recoverManagedRuntimeActivation,V as recordManagedRuntimeLifecycle,U as readManagedRuntimeLifecycleEvents,j as parseAndVerifyManagedRuntimeManifest,k as parseAndVerifyLegacyManagedRuntimeManifest,z as managedRuntimeVersionPath,C as managedRuntimeTarget,K as managedRuntimePointerVersion,x as managedRuntimePaths,O as managedRuntimeExecutableVersion,A as managedRuntimeCredentialLibraryPath,h as managedRuntimeCredentialLibraryAssetName,g as managedRuntimeAssetName,y as legacyManagedRuntimePaths,N as isManagedRuntimeVersionExecutable,M as isManagedRuntimeExecutable,J as installManagedRuntimeLauncher,I as installManagedRuntimeArtifact,X as flushManagedRuntimeLifecycleEvents,F as fetchManagedRuntimeBytes,G as defaultManagedRuntimeHealthCheck,L as currentManagedRuntimeVersion,B as compareManagedRuntimeVersions,i as canonicalJson,Y as bootstrapManagedRuntime,D as assertManagedRuntimeSignatureEvidence,P as activateManagedRuntime,T as acquireManagedRuntimeLock,S as acquireManagedRuntimeDirectoryLock,W as acknowledgeManagedRuntimeLifecycleEvents,f as ManagedRuntimeError,v as MANAGED_RUNTIME_UPDATE_HEALTH_TIMEOUT_MS,e as MANAGED_RUNTIME_TARGETS,d as MANAGED_RUNTIME_MAX_MANIFEST_BYTES,p as MANAGED_RUNTIME_MAX_LIFECYCLE_EVENTS,q as MANAGED_RUNTIME_MAX_LIFECYCLE_BYTES,c as MANAGED_RUNTIME_MAX_ARTIFACT_BYTES,b as MANAGED_RUNTIME_MANIFEST_VERSION,r as MANAGED_RUNTIME_MANIFEST_URL,o as MANAGED_RUNTIME_LIFECYCLE_VERSION,w as MANAGED_RUNTIME_LIFECYCLE_EVENTS,n as MANAGED_RUNTIME_LAYOUT_VERSION,u as MANAGED_RUNTIME_HEALTH_TIMEOUT_MS,s as MANAGED_RUNTIME_FETCH_TIMEOUT_MS,t as MANAGED_RUNTIME_ARTIFACT_FETCH_TIMEOUT_MS,a as LEGACY_MANAGED_RUNTIME_MANIFEST_VERSION};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Aa as a}from"./vm-hands-entry-lite-z9y1sb0f.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oi as a,Pi as b,Qi as c,Ri as d,Si as e,Ti as f,Ui as g,Vi as h,Wi as i,Xi as j}from"./vm-hands-entry-lite-cneah70y.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-ew7amfaf.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{j as runPermissionsCli,d as reasonIdentity,e as readMacPermissions,f as permissionsSummary,i as parsePermissionsArgs,c as fullDiskAccessTarget,g as formatMacPermissions,h as allowMacPermissions,a as PERMISSIONS_HELP,b as MAC_PERMISSION_IDS};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$d as l,Qd as a,Rd as b,Sd as c,Td as d,Ud as e,Vd as f,Wd as g,Xd as h,Yd as i,Zd as j,_d as k,ae as m,be as n,ce as o,de as p,ee as q,fe as r}from"./vm-hands-entry-lite-cbkszaqs.js";import"./vm-hands-entry-lite-ajmxhzs9.js";import"./vm-hands-entry-lite-923jmcs3.js";import"./vm-hands-entry-lite-shm5nhjk.js";import"./vm-hands-entry-lite-h8ykfv9r.js";import"./vm-hands-entry-lite-ecgyzbdp.js";import"./vm-hands-entry-lite-3pecyp8y.js";import"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{g as workerServiceRetargetPending,f as workerServiceProgram,m as workerServiceProcessRunning,e as workerServiceLauncher,j as workerServiceDefinitions,n as workerServiceDefinitionCurrent,l as retireLegacyWorkerService,q as retargetWorkerServiceLogs,p as restartWorkerService,r as removeWorkerService,i as isConnectServiceLabel,k as installedWorkerService,o as installWorkerService,c as defaultWorkerServiceHost,h as connectServiceLabel,d as WorkerServiceError,a as WORKER_SERVICE_ENV,b as WORKER_IDENTITY_UNAVAILABLE_CODE};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sj as a,Tj as b,Uj as c,Vj as d}from"./vm-hands-entry-lite-shsqhwgs.js";import"./vm-hands-entry-lite-jn0wjv5q.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{c as compareCliVersions,d as cliAndAgentVersion,b as CLI_VERSION_PATTERN,a as CLI_VERSION};
@@ -1,9 +0,0 @@
1
- // @bun
2
- import{sj as F}from"./vm-hands-entry-lite-ecgyzbdp.js";import{Sj as b}from"./vm-hands-entry-lite-shsqhwgs.js";import{randomUUID as d}from"crypto";import{spawnSync as C}from"child_process";import{chmodSync as zj,cpSync as Jj,existsSync as U,lstatSync as M,mkdirSync as h,readdirSync as Wj,readFileSync as I,readlinkSync as Zj,realpathSync as R,renameSync as P,rmdirSync as $j,rmSync as G,symlinkSync as E,writeFileSync as qj}from"fs";import{dirname as B,join as K,relative as Kj,resolve as Qj}from"path";var s="so.ara.cli",Vj="5LJFSBRY2F",wj="Background/Reason.app",m="ReasonBackgroundIdentity",Sj="Contents/Helpers/ReasonPermissionTile";var S="AraBackgroundIdentity",Xj="Reason",Dj=`anchor apple generic and identifier "${s}" and certificate leaf[subject.OU] = "${Vj}"`;class H extends Error{code;constructor(j,z){super(z);this.code=j;this.name="MacOSBackgroundIdentityError"}}var T="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function v(j=F()){return K(j,"Library","Application Support","Reason","Background","Reason.app")}function _(j=F()){return K(j,"Library","Application Support","Ara","Background","Ara.app")}function fj(j=process.execPath){return K(B(R(j)),wj)}function Fj(j){try{return M(j).isFile()}catch{return!1}}function f(j){return[m,S].map((z)=>K(j,"Contents","MacOS",z)).find(Fj)??null}function w(j){try{if(!M(j).isDirectory())return!1;let z=I(K(j,"Contents","Info.plist"),"utf8");return z.includes(`<string>${s}</string>`)&&(z.includes(`<string>${Xj}</string>`)||z.includes("<string>Ara</string>"))&&f(j)!==null}catch{return!1}}function u(j=F()){let z=v(j);if(!w(z))return null;try{let J=I(K(z,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(J)?.[1]??null}catch{return null}}function Gj(j,z=F()){let J=u(z);return J===null||p(A(J.split(".")),A(j.split(/[.-]/).slice(0,3)))}var Yj=1e4;function i(j,z){return C(j,[...z],{stdio:"ignore",timeout:Yj}).status??1}var l=new Set;function r(j){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let z=(J)=>{try{return R(J)}catch{return Qj(J)}};if(j!==void 0&&z(j)!==z(F()))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 c=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.(?:ara|reason)(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,o=new Set(["ara","ara.exe","reason","reason.exe"]);function A(j){return j.map((z)=>Number(z))}function p(j,z){for(let J=0;J<3;J+=1)if(j[J]!==z[J])return j[J]<z[J];return!1}var Nj=[0,2,161];function Pj(j){if(j===null)return!0;let z=Nj,J=null;try{J=R(process.execPath)}catch{}return j.some((W)=>{let Z=c.exec(W);if(Z){let X=Z[1]===void 0?Z.slice(4,7):Z.slice(1,4);return p(A(X),z)}let $=W.slice(W.lastIndexOf("/")+1);return o.has($)&&W!==J&&W!==process.execPath})}function Bj(){let j=C("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(j.status!==0)return null;let z=[];for(let J of j.stdout.split(`
3
- `)){let W=/^\s*(\d+)\s+(\S.*)$/.exec(J);if(!W||Number(W[1])===process.pid)continue;let Z=W[2].trimEnd(),$=Z.slice(Z.lastIndexOf("/")+1);if(!c.test(Z)&&o.has($)){let Q=C("/usr/sbin/lsof",["-a","-p",W[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
4
- `).find((V)=>V.startsWith("n/"));if(Q)Z=Q.slice(1)}z.push(Z)}return z}function vj(j){if(r(j.home),!w(j.sourceApp))throw new H("identity_invalid","The packaged Reason background identity is missing or invalid.");let z=j.command??i,J=v(j.home),W=B(J);h(W,{recursive:!0,mode:448}),zj(W,448);let Z=R(j.sourceApp),$=null;try{$=R(J)}catch{}if(Z!==$){let X=`${process.pid}.${d()}`,Q=K(W,`.Reason.app.${X}.tmp`),V=K(W,`.Reason.app.${X}.old`),Y=!1;try{if(Jj(Z,Q,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!w(Q))throw new H("identity_invalid","The copied Reason background identity is invalid.");let O=j.releaseSigned?["--test-requirement",`=${Dj}`]:[];if(z("/usr/bin/codesign",["--verify","--strict",...O,Q])!==0)throw new H("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let L=!1;for(let D=0;D<4;D+=1){let N=!1;try{P(J,V),N=!0,Y=!0}catch(q){if(q.code!=="ENOENT")throw q}if(D===0)j.beforePublish?.();try{P(Q,J),L=!0}catch(q){let jj=q.code;if(!["EEXIST","ENOTEMPTY"].includes(jj??""))throw q;if(N)G(V,{recursive:!0,force:!0}),Y=!1;if(D===3)throw q;continue}if(N)G(V,{recursive:!0,force:!0}),Y=!1;break}if(!L)throw Error("Could not publish Reason's background identity.")}catch(O){if(Y&&!U(J)&&U(V))P(V,J);throw O}finally{G(Q,{recursive:!0,force:!0}),G(V,{recursive:!0,force:!0})}}return e(J,j,{verified:Z!==$}),J}function n(j){return K(B(j),".Reason.app.registered")}function t(j){try{let z=M(j);return z.isDirectory()?`${z.ino}:${z.birthtimeMs}`:null}catch{return null}}function k(j){let z=t(j);try{return z!==null&&I(n(j),"utf8")===z}catch{return!1}}function a(j){if(w(j))return"bundle";try{if(M(K(j,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return M(K(j,"Contents","MacOS",S)).isSymbolicLink()?"retired":null}catch{return null}}function e(j,z,J={}){let W=z.command??i;if(!J.verified&&W("/usr/bin/codesign",["--verify","--strict",j])!==0)throw new H("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if(W(T,["-f",j])!==0)throw new H("identity_register_failed","Could not register Reason's macOS background identity.");let Z=t(j);try{if(Z)qj(n(j),Z,{mode:384})}catch{}try{Oj(j,z.home,W,z.runningExecutables??Bj)}catch($){let X=$.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${X})
5
- `)}}function Oj(j,z,J,W){let Z=f(j);if(!Z)return;let $=_(z),X=B($),Q=(q)=>K(q,"Contents","MacOS",S),V=Kj(B(Q($)),Z),Y=`${process.pid}.${d()}`,O=a($);if(O===null)return;let L=O==="bundle";if(L)J(T,["-u",$]);let D=K(X,`.Ara.app.${Y}.old`);if(!l.has($)&&!Pj(W())){if(!L)J(T,["-u",$]);try{P($,D)}catch(q){if(q.code==="ENOENT")return;throw q}G(D,{recursive:!0,force:!0}),Lj(X);return}if(!L){if(Zj(Q($))===V)return;let q=`${Q($)}.${Y}`;E(V,q);try{P(q,Q($))}finally{G(q,{force:!0})}return}let N=K(X,`.Ara.app.${Y}.shim`);h(B(Q(N)),{recursive:!0}),E(V,Q(N));try{try{P($,D)}catch(q){if(q.code==="ENOENT")return;throw q}try{P(N,$)}catch(q){if(U($))return;throw P(D,$),q}}finally{G(N,{recursive:!0,force:!0}),G(D,{recursive:!0,force:!0})}}function Lj(j){try{if(Wj(j).some((J)=>J!==".DS_Store"))return;G(K(j,".DS_Store"),{force:!0}),$j(j)}catch{}}var x=new Map;function Hj(j=F()){let z=x.get(j);if(z)return z;if(process.platform!=="darwin")return[];let J=g(j);if(J===null&&U(B(v(j))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),J=g(j);if(J===null)return[];return x.set(j,J),J}function g(j){let z=v(j),J=_(j);if(!w(z)||!k(z))try{Mj({home:j,skipWhenSettled:!0})}catch{}let W=w(z)&&(k(z)||!w(J))?z:w(J)?J:null,Z=W?f(W):null;if(!Z)return null;if(W===J)l.add(J);let $=C(Z,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return $.status===0&&$.stdout===`spawn
6
- `?[Z,"--spawn"]:[]}var y=new Map;function Cj(j=F()){let z=Hj(j),J=z[0];if(!J)return[];let W=y.get(J);if(W===void 0){let Z=C(J,["--can-spawn-computer-use"],{env:{},timeout:2000,encoding:"utf8"});W=Z.status===0&&Z.stdout===`spawn
7
- `,y.set(J,W)}return W?z:[]}function Ej(j=Cj(),z=F()){if(j.length>0)return null;if(u(z)===null)return"computer_use_identity_missing";return Gj(b,z)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function Mj(j={}){r(j.home);let z=v(j.home);if(j.skipWhenSettled&&w(z)&&k(z)&&a(_(j.home))===null)return!0;if(!w(z)){let J=_(j.home);if(!w(J))return!1;try{return vj({...j,sourceApp:J}),!0}catch(W){if(!w(z))throw W}}return e(z,j),!0}var Rj="REASON_WORKER_IDENTITY_APP";function xj(j,z=process.env,J=F()){let W=z[Rj];return W&&W===v(J)?W:j}function gj(j,z){if(process.platform!=="darwin")return null;let J=v(j),W=K(J,"Contents","MacOS",m),Z=C(W,["--can-run-worker",z],{env:{},timeout:2000,encoding:"utf8"});return Z.status===0&&Z.stdout===`run-worker
8
- `?{app:J,executable:W}:null}
9
- export{s as bj,Vj as cj,Sj as dj,H as ej,T as fj,v as gj,fj as hj,u as ij,Gj as jj,vj as kj,Hj as lj,Cj as mj,Ej as nj,Mj as oj,Rj as pj,xj as qj,gj as rj};
@@ -1,11 +0,0 @@
1
- // @bun
2
- import{ed as hq,fd as lq}from"./vm-hands-entry-lite-g7h6wjqy.js";import{ai as Nq,bi as vq,fi as Wq,gi as Xq,hi as X,ki as dq,mi as Aq,ni as cq,pi as c,qi as P,ri as Bq}from"./vm-hands-entry-lite-x64d3bdx.js";import{Ji as Kq}from"./vm-hands-entry-lite-shm5nhjk.js";import{cj as oq,ej as sq,hj as uq,ij as pq,jj as nq,kj as Dq}from"./vm-hands-entry-lite-h8ykfv9r.js";import{sj as d}from"./vm-hands-entry-lite-ecgyzbdp.js";import{Ik as Gq}from"./vm-hands-entry-lite-mkynexaq.js";import{randomUUID as T}from"crypto";import{chmodSync as Jq,closeSync as u,constants as m,existsSync as E,fstatSync as rq,lstatSync as A,mkdirSync as r,openSync as iq,readFileSync as g,readdirSync as Oq,readlinkSync as I,realpathSync as S,renameSync as k,rmSync as v,statSync as x,symlinkSync as Qq,unlinkSync as C,writeFileSync as h}from"fs";import{basename as n,dirname as D,isAbsolute as NG,join as K,relative as AG,resolve as O,sep as aq}from"path";import{spawnSync as Eq}from"child_process";import{createRequire as eq}from"module";var Zq=1,tq=1,qG=128,BG=65536,DG="https://reasonmachines.com/api/runtime-manifest-v2",OG=30000,EG=600000,Vq=1e4,IG=60000,CG=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;var Pq=/^[a-z0-9_.-]{1,80}$/,TG=64,SG="so.ara.device-broker",gq=["com.apple.security.cs.allow-jit","com.apple.security.cs.allow-unsigned-executable-memory"],FG=["service.install_started","service.install_completed","service.install_failed","service.launcher_adopted","service.launcher_conflict","service.started","service.reconnecting","service.reconnected","service.idle_sleep_held","service.idle_sleep_released","service.idle_sleep_failed","service.start_failed","service.stopped","service.exit_failed","service.singleton_rejected","credential.migration_started","credential.migration_completed","credential.migration_failed","credential.store_started","credential.store_completed","credential.store_failed","credential.delete_started","credential.delete_completed","credential.delete_failed","update.check_started","update.not_available","update.download_started","update.downloaded","update.verified","update.activated","update.rollback","update.failed","executor.update.check_started","executor.update.not_available","executor.update.download_started","executor.update.downloaded","executor.update.verified","executor.update.activated","executor.update.rollback","executor.update.failed","identity.refresh_completed","identity.refresh_failed","update.device_moved","update.components_installed","update.deferred","update.deferral_expired","worker.previous_exit","worker.capabilities_withheld","identity.computer_use_unavailable"];function t(q){if(q?.aborted)throw new X("update_cancelled","Managed runtime update request was cancelled.")}function Iq(q){return Boolean(q)&&typeof q==="object"&&!Array.isArray(q)}function Cq(q,G,J=[]){let Q=new Set([...G,...J]);return G.every((R)=>(R in q))&&Object.keys(q).every((R)=>Q.has(R))}function B(q){return typeof q==="string"&&CG.test(q)}function GG(q){return typeof q==="string"&&!Number.isNaN(Date.parse(q))&&new Date(q).toISOString()===q}function LG(q){return Xq.includes(q)}function b(q){r(q,{recursive:!0,mode:448}),Jq(q,448)}function JG(q,G){b(D(q));let J=`${q}.${process.pid}.${T()}.tmp`;try{h(J,G,{mode:384,flag:"wx"}),Jq(J,384),k(J,q)}finally{if(E(J))C(J)}}function Tq(q={}){if((q.platform??process.platform)!=="darwin")throw new X("unsupported_platform","The managed Reason runtime is currently available only on macOS.");let J=q.environment??process.env,Q=Kq(J,"REASON_CLI_CHANNEL")==="staging",R=Q?Kq(J,"REASON_MANAGED_RUNTIME_ROOT")?.trim():void 0,U=q.root!==void 0||Boolean(R&&NG(R))?null:K(q.home??d(),"Library","Application Support"),_=q.root??(U?K(U,Q?"Reason Staging":"Reason","CLI"):R);return{executableName:"reason",root:_,...U?{legacyRoot:K(U,"Ara",...Q?["staging","runtime"]:["runtime"])}:{},versions:K(_,"versions"),current:K(_,"current"),previous:K(_,"previous"),brokerLock:K(_,"broker.lock"),transitionLock:K(_,"transition.lock"),lifecycleEvents:K(_,"lifecycle-events")}}function yJ(q){let G=q.legacyRoot;if(!G)return null;return{root:G,versions:K(G,"versions"),current:K(G,"current"),previous:K(G,"previous"),brokerLock:K(G,"broker.lock"),transitionLock:K(G,"transition.lock"),lifecycleEvents:K(G,"lifecycle-events")}}function F(q,G){if(!B(G))throw new X("invalid_version","Invalid managed Reason runtime version.");let J=K(q.versions,G,"ara");if(!q.executableName)return J;let Q=K(q.versions,G,q.executableName),R=(_)=>{try{return A(_),!0}catch(Z){if(Z.code==="ENOENT")return!1;throw Z}},W=R(J),U=R(Q);if(W&&U)throw new X("installed_artifact_mismatch","Ambiguous managed runtime executable layout.");return W?J:Q}function i(q,G){if(!B(G))throw new X("invalid_version","Invalid managed Reason runtime version.");return Sq(F(q,G))}function Sq(q){return K(D(q),n(q)==="reason"?vq:Nq)}function QG(q,G){if(!B(q)||!B(G))throw new X("invalid_version","Invalid managed Reason runtime version.");let[J,Q]=q.split("-",2),[R,W]=G.split("-",2),U=J.split(".").map(Number),_=R.split(".").map(Number);for(let H=0;H<3;H+=1){let j=U[H]-_[H];if(j!==0)return j<0?-1:1}if(Q===void 0||W===void 0){if(Q===W)return 0;return Q===void 0?1:-1}let Z=Q.split("."),$=W.split("."),Y=Math.max(Z.length,$.length);for(let H=0;H<Y;H+=1){let j=Z[H],z=$[H];if(j===void 0||z===void 0){if(j===z)return 0;return j===void 0?-1:1}if(j===z)continue;let M=/^\d+$/.test(j),w=/^\d+$/.test(z);if(M&&w)return Number(j)<Number(z)?-1:1;if(M!==w)return M?-1:1;return j<z?-1:1}return 0}function wG(q=process.arch){let G=`darwin-${q}`;if(!LG(G))throw new X("unsupported_architecture","The managed Reason runtime supports only Apple Silicon and Intel Macs.");return G}function bq(q){return[...q.matchAll(/<key>\s*([^<]+?)\s*<\/key>/g)].map((G)=>G[1].trim())}function yq(q){let G=q.match(/^CodeDirectory .*$/gm)??[];return G.length>0&&G.every((J)=>{return(/ flags=0x[0-9a-f]+\(([^)]*)\)(?: |$)/.exec(J)?.[1]?.split(/[ ,]+/).filter(Boolean)??[]).includes("runtime")})}function kG(q){let G=`TeamIdentifier=${oq}`,J=`Identifier=${SG}`,Q=bq(q.brokerEntitlements),R=bq(q.credentialLibraryEntitlements);if(!q.brokerDetail.split(`
3
- `).includes(G)||!q.brokerDetail.split(`
4
- `).includes(J)||!yq(q.brokerDetail)||Q.length!==gq.length||gq.some((W)=>!new RegExp(`<key>\\s*${W.replaceAll(".","\\.")}\\s*</key>\\s*<true\\s*/>`).test(q.brokerEntitlements)))throw new X("invalid_code_signature","Managed runtime broker has an invalid Reason signature, identifier, or entitlement set.");if(!q.credentialLibraryDetail.split(`
5
- `).includes(G)||!yq(q.credentialLibraryDetail)||R.length!==0)throw new X("invalid_code_signature","Managed runtime credential library has an invalid signature or entitlement.")}function y(q,G){let J=Eq("/usr/bin/codesign",q,{stdio:["ignore","pipe","pipe"]});if(J.status!==0)throw new X("invalid_code_signature",G);return[new TextDecoder().decode(J.stdout??new Uint8Array),new TextDecoder().decode(J.stderr??new Uint8Array)].join("")}var Fq=(q,G)=>{y(["--verify","--strict","--verbose=2",q],"Managed runtime broker code signature is invalid."),y(["--verify","--strict","--verbose=2",G],"Managed runtime credential library code signature is invalid."),kG({brokerDetail:y(["-d","--verbose=4",q],"Managed runtime broker signer could not be inspected."),brokerEntitlements:y(["-d","--entitlements",":-",q],"Managed runtime broker entitlements could not be inspected."),credentialLibraryDetail:y(["-d","--verbose=4",G],"Managed runtime credential library signer could not be inspected."),credentialLibraryEntitlements:y(["-d","--entitlements",":-",G],"Managed runtime credential library entitlements could not be inspected.")})};async function xG(q,G,J){let Q=q.headers.get("content-length");if(Q!==null){let Y=Number(Q);if(!Number.isSafeInteger(Y)||Y<0||Y>G)throw new X("response_too_large","Managed runtime response exceeded its size limit.")}if(!q.body){let Y=new Uint8Array(await q.arrayBuffer());if(Y.byteLength>G)throw new X("response_too_large","Managed runtime response exceeded its size limit.");return Y}let R=q.body.getReader(),W=[],U=0,_=()=>{if(!J)return R.read();return new Promise((Y,H)=>{let j=()=>{J.removeEventListener("abort",j),R.cancel(J.reason).catch(()=>{}),H(J.reason??new DOMException("Aborted","AbortError"))};if(J.aborted){j();return}J.addEventListener("abort",j,{once:!0}),R.read().then((z)=>{J.removeEventListener("abort",j),Y(z)},(z)=>{J.removeEventListener("abort",j),H(z)})})};try{while(!0){let Y=await _();if(Y.done)break;if(U+=Y.value.byteLength,U>G)throw await R.cancel(),new X("response_too_large","Managed runtime response exceeded its size limit.");W.push(Y.value)}}finally{try{R.releaseLock()}catch{}}let Z=new Uint8Array(U),$=0;for(let Y of W)Z.set(Y,$),$+=Y.byteLength;return Z}async function p(q){let G;try{G=new URL(q.url)}catch{throw new X("invalid_update_url","Managed runtime update URL is invalid.")}if(G.protocol!=="https:"||G.username||G.password||G.hash)throw new X("invalid_update_url","Managed runtime update URL must use HTTPS.");let J=new AbortController,Q,R=()=>{Q??="caller",J.abort(q.signal?.reason)};if(q.signal?.aborted)R();else q.signal?.addEventListener("abort",R,{once:!0});let W=setTimeout(()=>{Q??="timeout",J.abort(Error("managed runtime fetch timed out"))},q.timeoutMs),U=(_,Z)=>{if(_ instanceof X)return _;if(Q==="caller")return new X("update_cancelled","Managed runtime update request was cancelled.");if(Q==="timeout")return new X("update_fetch_timeout","Managed runtime update request timed out.");return new X("update_fetch_failed",Z)};try{let _;try{if(_=await q.fetchImpl(G,{headers:{accept:q.accept},signal:J.signal}),J.signal.aborted)throw U(J.signal.reason,"Managed runtime update request was cancelled.")}catch(Z){throw U(Z,"Managed runtime update request failed.")}if(!_.ok)throw new X("update_http_error","Managed runtime update request was rejected.");if(_.url&&new URL(_.url).protocol!=="https:")throw new X("insecure_redirect","Managed runtime update redirected to an insecure URL.");try{let Z=await xG(_,q.maximumBytes,J.signal);if(J.signal.aborted)throw U(J.signal.reason,"Managed runtime update response was cancelled.");return Z}catch(Z){throw U(Z,"Managed runtime update response failed.")}}finally{clearTimeout(W),q.signal?.removeEventListener("abort",R)}}async function RG(q,G,J=Vq,Q){let R=typeof J==="number"?J:Vq,W=typeof J==="number"?Q:J;if(W?.aborted)return!1;let U=await hq([q,"--version"],{timeoutMs:R,...W?{signal:W}:{}});return U.exitCode===0&&U.stdout.trim().replace(/^v/,"")===G}async function VG(q){let G=!1,J=null,Q=null,R=(W)=>{try{N(q.paths,W,{now:q.now})}catch{}};try{let W=q.home??d();if(!nq(q.manifest.version,W))return{status:"current"};Q=pq(W);let U=await p({url:new URL(dq,q.manifest.artifacts[q.target].broker.url).toString(),maximumBytes:Wq,fetchImpl:async(j,z)=>{let M=await q.fetchImpl(j,z);return G=M.status===404,M},timeoutMs:q.timeoutMs,accept:"application/json",signal:q.signal}),{manifest:_}=cq(new TextDecoder().decode(U),q.trustedKeys);if(_.version!==q.manifest.version||_.published_at!==q.manifest.published_at)throw new X("identity_manifest_mismatch","Background identity manifest names another release.");let Z=_.artifacts[q.target],$=await p({url:Z.url,maximumBytes:Z.size_bytes,fetchImpl:q.fetchImpl,timeoutMs:q.timeoutMs,accept:"application/octet-stream",signal:q.signal});P($,Z),b(q.workDirectory),J=K(q.workDirectory,`.identity-${process.pid}-${T()}`),r(J,{mode:448});let Y=K(J,"identity.tgz");if(h(Y,$,{mode:384,flag:"wx"}),Eq("/usr/bin/tar",["-xzf",Y,"-C",J],{stdio:"ignore",timeout:60000}).status!==0)throw new X("identity_extract_failed","Background identity archive could not be extracted.");return Dq({sourceApp:K(J,"Reason.app"),home:W,releaseSigned:!0,...q.command?{command:q.command}:{}}),R({event:"identity.refresh_completed",runtime_version:q.manifest.version,...Q?{from_version:Q}:{},to_version:q.manifest.version}),{status:"installed"}}catch(W){if(G)return{status:"unpublished"};let U=W instanceof X||W instanceof sq?W.code:"identity_install_failed";return process.stderr.write(`Reason background identity: identity_update_failed (${U})
6
- `),R({event:"identity.refresh_failed",runtime_version:q.manifest.version,...Q?{from_version:Q}:{},to_version:q.manifest.version,reason_code:U}),{status:"failed",code:U}}finally{if(J)v(J,{recursive:!0,force:!0})}}async function fJ(q){if(!B(q.currentVersion))throw new X("invalid_version","Invalid current managed runtime version.");let G=q.paths??Tq(),J=q.target??wG(),Q=q.fetchImpl??fetch,R=q.timeoutMs??OG,W=q.timeoutMs??EG,U=q.healthCheck??((H,j,z)=>RG(H,j,IG,z)),_=q.verifyCodeSignatures??Fq,Z=q.now?.()??new Date,$,Y=!1;N(G,{event:"update.check_started",runtime_version:q.currentVersion,from_version:q.currentVersion},{now:()=>Z});try{await lG({paths:G,verifyCodeSignatures:_,healthCheck:U});let H=await p({url:q.manifestUrl??DG,maximumBytes:Wq,fetchImpl:Q,timeoutMs:R,accept:"application/json",signal:q.signal}),j=Aq(new TextDecoder().decode(H),q.trustedKeys);$=j.manifest.version;let z=()=>VG({paths:G,...q.now?{now:q.now}:{},manifest:j.manifest,target:J,trustedKeys:q.trustedKeys,fetchImpl:Q,timeoutMs:W,workDirectory:G.versions,...q.home?{home:q.home}:{},...q.identityCommand?{command:q.identityCommand}:{},...q.signal?{signal:q.signal}:{}});if(QG($,q.currentVersion)<=0)return N(G,{event:"update.not_available",runtime_version:q.currentVersion,from_version:q.currentVersion,to_version:$,duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-Z.getTime())},{now:q.now}),Yq(G),{status:"not_available",currentVersion:q.currentVersion,offeredVersion:$,...$===q.currentVersion?{identity:await z()}:{}};let M=j.manifest.artifacts[J];N(G,{event:"update.download_started",runtime_version:q.currentVersion,from_version:q.currentVersion,to_version:$},{now:q.now});let w=await p({url:M.broker.url,maximumBytes:M.broker.size_bytes,fetchImpl:Q,timeoutMs:W,accept:"application/octet-stream",signal:q.signal});P(w,M.broker),t(q.signal);let e=await p({url:M.credential_library.url,maximumBytes:M.credential_library.size_bytes,fetchImpl:Q,timeoutMs:W,accept:"application/octet-stream",signal:q.signal});P(e,M.credential_library),N(G,{event:"update.downloaded",runtime_version:q.currentVersion,from_version:q.currentVersion,to_version:$},{now:q.now}),N(G,{event:"update.verified",runtime_version:q.currentVersion,from_version:q.currentVersion,to_version:$},{now:q.now}),t(q.signal);let kq=UG({paths:G,version:$,artifact:M.broker,bytes:w,credentialLibraryArtifact:M.credential_library,credentialLibraryBytes:e,verifyCodeSignatures:_}),xq;try{xq=await U(kq.executablePath,$,q.signal)}catch(l){throw t(q.signal),l}if(t(q.signal),!xq)throw new X("pre_activation_health_failed","Managed runtime preflight failed.");let V=vG(G,$);if(!V.changed&&V.toVersion!==$)return N(G,{event:"update.not_available",runtime_version:V.toVersion,from_version:V.toVersion,to_version:$,duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-Z.getTime())},{now:q.now}),{status:"not_available",currentVersion:V.toVersion,offeredVersion:$};if(Y=V.changed,!await U(G.current,$)){if(V.fromVersion){let l=KG(G,$);N(G,{event:"update.rollback",runtime_version:l.toVersion,from_version:l.fromVersion,to_version:l.toVersion,reason_code:"post_activation_health_failed"},{now:q.now})}else YG(G,$);throw f(G),Y=!1,new X("post_activation_health_failed","Managed runtime activation failed.")}return f(G),Yq(G),N(G,{event:"update.activated",runtime_version:$,from_version:q.currentVersion,to_version:$,duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-Z.getTime())},{now:q.now}),{status:"activated",fromVersion:q.currentVersion,toVersion:$,installed:kq.installed,identity:await z()}}catch(H){throw N(G,{event:"update.failed",runtime_version:Y?$??q.currentVersion:q.currentVersion,from_version:q.currentVersion,...$?{to_version:$}:{},reason_code:H instanceof X?H.code:"update_failed",duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-Z.getTime())},{now:q.now}),H}}function fq(q,G,J){try{let Q=A(D(q));if(!Q.isDirectory()||Q.isSymbolicLink())return!1;let R=A(q);if(!R.isFile()||R.isSymbolicLink()||R.size!==G.size_bytes)return!1;let W=Sq(q),U=A(W);return U.isFile()&&!U.isSymbolicLink()&&U.size===J.size_bytes&&c(g(q))===G.sha256&&c(g(W))===J.sha256}catch{return!1}}function UG(q){let G=F(q.paths,q.version);P(q.bytes,q.artifact),P(q.credentialLibraryBytes,q.credentialLibraryArtifact);let J=q.verifyCodeSignatures??Fq;if(b(q.paths.root),b(q.paths.versions),E(D(G))){if(!fq(G,q.artifact,q.credentialLibraryArtifact))throw new X("installed_artifact_mismatch","The installed runtime version does not match the verified artifact.");return J(G,i(q.paths,q.version)),{installed:!1,executablePath:G}}let Q=K(q.paths.versions,`.install-${q.version}-${process.pid}-${T()}`),R=K(Q,n(G)),W=Sq(R);r(Q,{mode:448});try{h(R,q.bytes,{mode:448,flag:"wx"}),Jq(R,448),h(W,q.credentialLibraryBytes,{mode:448,flag:"wx"}),Jq(W,448),J(R,W);try{k(Q,D(G))}catch(U){if(!fq(G,q.artifact,q.credentialLibraryArtifact))throw U;return{installed:!1,executablePath:G}}return{installed:!0,executablePath:G}}finally{v(Q,{recursive:!0,force:!0})}}function PG(q,G){if(!B(G))throw new X("invalid_version","Invalid managed Reason runtime version.");return`versions/${G}/${n(F(q,G))}`}function Rq(q,G){b(D(q));let J=`${q}.${process.pid}.${T()}.tmp`;try{Qq(G,J),k(J,q)}finally{if(E(J))C(J)}}var gG=/^\.(?:ara|reason)-worker-(\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)-(darwin-(?:arm64|x64))\.([0-9A-Za-z]{6})$/,bG=new Set(["reason","ara"]);function WG(q,G){let J=D(q),Q=O(J,G),R=D(Q),W=gG.exec(n(R));if(!bG.has(n(Q))||D(R)!==J||!W||!B(W[1])||!Xq.includes(W[2]))return!1;try{return A(R).isDirectory()&&D(S(R))===S(J)&&A(Q).isFile()&&A(Bq(R)).isFile()}catch(U){if(U.code==="ENOENT")return!1;throw U}}function XG(q,G,J){try{if(I(q)!==G)return!1;C(q)}catch(Q){if(Q.code==="ENOENT")return!1;throw Q}try{return Qq(J,q),!0}catch(Q){if(Q.code==="EEXIST")return!1;try{Qq(G,q)}catch(R){if(R.code!=="EEXIST")throw R}throw Q}}function ZG(q,G){if(!q.legacyRoot)return!1;let J;try{if(!A(G).isSymbolicLink())return!1;J=I(G)}catch(R){if(R.code==="ENOENT")return!1;throw R}if(O(D(G),J)!==K(q.legacyRoot,"current"))return!1;if(!XG(G,J,q.current))return!1;let Q=L(q);if(Q)N(q,{event:"service.launcher_adopted",runtime_version:Q,to_version:Q,reason_code:"legacy_runtime_root"});return!0}function yG(q,G){let J=K(q,".local","bin"),Q=K(J,"ara"),R=K(J,"reason"),W=A(Q,{throwIfNoEntry:!1});if(W?.isSymbolicLink()&&I(Q)==="reason")return R;if(W||!A(R,{throwIfNoEntry:!1})?.isSymbolicLink())return Q;let U=I(R);return U===G.current||WG(R,U)?R:Q}function fG(q){let G=q.launcherPath??yG(q.home??d(),q.paths);try{if(A(G).isSymbolicLink()){let Q=I(G);if(Q===q.paths.current)return"managed";if(WG(G,Q)&&XG(G,Q,q.paths.current)){let R=_q(q.paths.current,q.paths.executableName)??"unknown";return N(q.paths,{event:"service.launcher_adopted",runtime_version:R,to_version:R,reason_code:"legacy_curl_entrypoint"}),"adopted"}if(ZG(q.paths,G))return"adopted"}return"conflict"}catch(J){if(J.code!=="ENOENT")throw J}r(D(G),{recursive:!0,mode:448});for(let J=0;J<4;J+=1)try{return Qq(q.paths.current,G),"created"}catch(Q){if(Q.code!=="EEXIST")throw Q;try{return A(G).isSymbolicLink()&&I(G)===q.paths.current?"managed":"conflict"}catch(R){if(R.code!=="ENOENT")throw R}}return"conflict"}function _q(q,G){let J;try{if(!A(q).isSymbolicLink())return null;J=I(q)}catch{return null}let Q=J.match(/^versions\/(\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)\/(ara|Reason|reason)$/);return Q&&(Q[2]==="ara"||Q[2]===G)?Q[1]:null}function L(q){return _q(q.current,q.executableName)}function mJ(q,G=process.execPath){try{return S(q.current)===S(G)}catch{return!1}}function Uq(q,G,J){let R=AG(G,q).split(aq);return R.length===2&&B(R[0])&&(R[1]==="ara"||J!==void 0&&R[1]===J)?R[0]:null}function _G(q,G){try{return A(G).isSymbolicLink()&&O(D(G),I(G))===O(q.current)}catch{return!1}}function vJ(q,G=process.execPath){try{return Uq(S(G),S(q.versions),q.executableName)!==null}catch{let J=O(G);return J===O(q.current)||_G(q,J)||Uq(J,O(q.versions),q.executableName)!==null}}function dJ(q,G=process.execPath){try{return Uq(S(G),S(q.versions),q.executableName)}catch{let J=O(G);if(J===O(q.current)||_G(q,J))return L(q);return Uq(J,O(q.versions),q.executableName)}}function mG(q,G,J={}){let Q=F(q,G),R=i(q,G);if(!E(Q)||!x(Q).isFile()||!E(R)||!x(R).isFile())throw new X("runtime_not_installed","Managed Reason runtime version is not installed.");let W=Lq(q,G,J.allowDowngrade);if(W)return W;return a(q,G,()=>{return $G(q,G,void 0,J.allowDowngrade)})}function Lq(q,G,J=!1){let Q=L(q);if(!Q)return null;if(Q===G)return{changed:!1,fromVersion:Q,toVersion:Q};if(!J&&QG(G,Q)<=0&&!(/^\d+\.\d+\.\d+-desktop\.v1\.\d+\.\d+\.\d+$/.test(G)&&/^\d+\.\d+\.\d+-desktopdev\./.test(Q)))return{changed:!1,fromVersion:Q,toVersion:Q};return null}function $G(q,G,J,Q=!1){let R=Lq(q,G,Q);if(R)return R;let W=L(q);if(J?.(W),W)Rq(q.previous,I(q.current));else if(E(q.previous))C(q.previous);return Rq(q.current,PG(q,G)),{changed:!0,fromVersion:W,toVersion:G}}function vG(q,G){let J=F(q,G),Q=i(q,G);if(!E(J)||!x(J).isFile()||!E(Q)||!x(Q).isFile())throw new X("runtime_not_installed","Managed Reason runtime version is not installed.");return a(q,G,()=>$G(q,G,(R)=>{hG(q,{schema_version:Zq,from_version:R,to_version:G})}))}function KG(q,G){return a(q,G,()=>{if(L(q)!==G)throw new X("rollback_fence_failed","Managed runtime changed before rollback could be applied.");let J=_q(q.previous,q.executableName);if(!J||J===G)throw new X("rollback_unavailable","No previous managed runtime is available.");let Q=F(q,J),R=i(q,J);if(!E(Q)||!x(Q).isFile()||!E(R)||!x(R).isFile())throw new X("rollback_unavailable","Previous managed runtime is not installed.");let W=I(q.previous),U=I(q.current);if(O(D(q.previous),W)!==O(Q))throw new X("rollback_fence_failed","Previous runtime pointer does not match its installed layout.");return Rq(q.current,W),Rq(q.previous,U),{fromVersion:G,toVersion:J}})}function dG(){let q=Eq("/bin/ps",["-axww","-o","args="],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5000,maxBuffer:16777216});return q.status===0&&typeof q.stdout==="string"?q.stdout:null}function Yq(q){let G=[];try{let J=L(q);if(!J||jq(q))return G;let Q=Oq(q.versions).filter((W)=>B(W));if(Q.length<=2)return G;let R=dG();if(R===null)return G;a(q,J,()=>{let W=new Set([L(q),_q(q.previous,q.executableName)]);if(jq(q))return;for(let U of Q){if(W.has(U))continue;let _=K(q.versions,U);if(R.includes(`${_}${aq}`))continue;try{v(_,{recursive:!0,force:!0}),G.push(U)}catch{}}})}catch{}return G}function YG(q,G){a(q,G,()=>{if(L(q)!==G)throw new X("rollback_fence_failed","Managed runtime changed before rollback could be applied.");C(q.current)})}function wq(q){return q.activationState??K(q.root,"activation.json")}function cG(q){return Iq(q)&&Cq(q,["schema_version","from_version","to_version"])&&q.schema_version===Zq&&(q.from_version===null||B(q.from_version))&&B(q.to_version)}function jq(q){try{let G=wq(q),J=A(G);if(!J.isFile()||J.isSymbolicLink()||J.nlink!==1||(J.mode&63)!==0||J.size>4096)throw new X("invalid_activation_state","Managed runtime activation state is invalid.");let Q=JSON.parse(g(G,"utf8"));if(!cG(Q))throw new X("invalid_activation_state","Managed runtime activation state is invalid.");return Q}catch(G){if(G instanceof X)throw G;if(G.code==="ENOENT")return null;throw new X("invalid_activation_state","Managed runtime activation state is invalid.")}}function hG(q,G){JG(wq(q),JSON.stringify(G)+`
7
- `)}function f(q){try{C(wq(q))}catch(G){if(G.code!=="ENOENT")throw G}}async function lG(q){let G=jq(q.paths);if(!G)return"none";let J=L(q.paths);if(J===G.from_version)return f(q.paths),"cleared";if(J!==G.to_version)throw new X("rollback_fence_failed","Managed runtime changed before activation recovery could be applied.");let Q=q.verifyCodeSignatures??Fq,R=q.healthCheck??RG,W=!1;try{let U=F(q.paths,G.to_version);Q(U,i(q.paths,G.to_version)),W=await R(U,G.to_version)}catch{W=!1}if(W)return f(q.paths),N(q.paths,{event:"update.activated",runtime_version:G.to_version,...G.from_version?{from_version:G.from_version}:{},to_version:G.to_version,reason_code:"restart_recovery"}),"committed";if(G.from_version){let U=KG(q.paths,G.to_version);return f(q.paths),N(q.paths,{event:"update.rollback",runtime_version:U.toVersion,from_version:U.fromVersion,to_version:U.toVersion,reason_code:"restart_recovery"}),"rolled_back"}return YG(q.paths,G.to_version),f(q.paths),N(q.paths,{event:"update.rollback",runtime_version:G.to_version,from_version:G.to_version,reason_code:"restart_recovery"}),"rolled_back"}function oG(q){return Iq(q)&&Cq(q,["schema_version","pid","nonce","started_at","runtime_version"])&&q.schema_version===Zq&&typeof q.pid==="number"&&Number.isSafeInteger(q.pid)&&q.pid>0&&typeof q.nonce==="string"&&/^[0-9a-f-]{36}$/.test(q.nonce)&&GG(q.started_at)&&B(q.runtime_version)}function jG(q,G){try{let J=A(q);if(!J.isDirectory()||!Gq(J))return null;let Q=iq(K(q,G),m.O_RDONLY|m.O_NOFOLLOW|m.O_NONBLOCK);try{let R=rq(Q);if(!R.isFile()||R.nlink!==1||!Gq(R)||R.size>4096)return null;return g(Q,"utf8")}finally{u(Q)}}catch{return null}}function Hq(q){try{let G=JSON.parse(jG(q,"owner.json")??"null");return oG(G)?G:null}catch{return null}}function HG(q){try{return process.kill(q,0),!0}catch(G){return!(G instanceof Error&&("code"in G)&&G.code==="ESRCH")}}var mq="lease",sG=2,uG=4,o;function pG(){if(o!==void 0)return o;if(o=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let q;try{q=eq(import.meta.url)("bun:ffi")}catch{return null}let G=process.platform==="darwin"?"__error":"__errno_location",J=process.platform==="darwin"?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`];for(let Q of J)try{let R=q.dlopen(Q,{flock:{args:[q.FFIType.i32,q.FFIType.i32],returns:q.FFIType.i32},[G]:{args:[],returns:q.FFIType.ptr}}),W=R.symbols[G]();if(W===null)continue;return o={flock:(U,_)=>R.symbols.flock(U,_),errno:()=>q.read.i32(W),wouldBlock:process.platform==="darwin"?35:11},o}catch{}return null}var s,nG=3221225472,rG=4,iG=128,aG=32;function eG(q){if(s===void 0){s=null;try{let W=eq(import.meta.url)("bun:ffi"),{FFIType:U}=W;s={kernel:W.dlopen("kernel32.dll",{CreateFileW:{args:[U.ptr,U.u32,U.u32,U.ptr,U.u32,U.u32,U.ptr],returns:U.i64_fast},CloseHandle:{args:[U.i64_fast],returns:U.i32},GetLastError:{args:[],returns:U.u32}}).symbols,ptr:(Z)=>W.ptr(Z)}}catch{return null}}if(!s)return null;let{kernel:G,ptr:J}=s,Q=Buffer.from(`${q}\x00`,"utf16le"),R=G.CreateFileW(J(Q),nG,0,null,rG,iG,null);if(Number(R)===-1)return G.GetLastError()===aG?"busy":null;return{release:()=>{G.CloseHandle(R)}}}function tG(q){if(process.platform==="win32")return eG(`${q}.lease`);let G=pG();if(!G)return null;let J=iq(`${q}.lease`,m.O_RDWR|m.O_CREAT|m.O_NOFOLLOW,384);try{let Q=rq(J);if(!Q.isFile()||Q.nlink!==1||!Gq(Q))return u(J),"busy";if(G.flock(J,sG|uG)===0)return{release:()=>u(J)};let R=G.errno();return u(J),R===G.wouldBlock?"busy":null}catch(Q){throw u(J),Q}}function zq(q){b(D(q.path));let G=tG(q.path);if(G==="busy")return{acquired:!1,owner:Hq(q.path),recoveredStaleOwner:!1};let J=G!==null;try{let Q=qJ(q,G);if(Q.acquired)J=!1;return Q}finally{if(J)G.release()}}function qJ(q,G){let J=q.alive??HG,Q=!1;for(let R=0;R<4;R+=1){let W={schema_version:Zq,pid:q.pid??process.pid,nonce:q.nonce?.()??T(),started_at:(q.now?.()??new Date).toISOString(),runtime_version:q.runtimeVersion},U=`${q.path}.init-${process.pid}-${T()}`,_=!1;try{if(r(U,{mode:448}),h(K(U,"owner.json"),`${JSON.stringify(W)}
8
- `,{mode:384,flag:"wx"}),G!==null)h(K(U,mq),`flock
9
- `,{mode:384,flag:"wx"});q.beforePublish?.();try{throw A(q.path),Object.assign(Error("Managed runtime lock exists."),{code:"EEXIST"})}catch($){if($.code!=="ENOENT")throw $}k(U,q.path),_=!0;let Z=!1;return{acquired:!0,owner:W,recoveredStaleOwner:Q,release(){if(Z)return;if(Z=!0,Hq(q.path)?.nonce===W.nonce)v(q.path,{recursive:!0,force:!0});G?.release()}}}catch(Z){let $=Z.code;if(!["EEXIST","ENOTEMPTY"].includes($??""))throw Z;let Y=Hq(q.path),H=(q.now?.()??new Date).getTime(),j=Y&&q.staleAfterMs!==void 0?H-Date.parse(Y.started_at)<q.staleAfterMs:!1,z=Y!==null&&!(G!==null&&jG(q.path,mq)!==null)&&J(Y.pid);if(!Y||z||j)return{acquired:!1,owner:Y,recoveredStaleOwner:!1};let M=`${q.path}.stale-${process.pid}-${T()}`;try{k(q.path,M),v(M,{recursive:!0,force:!0}),Q=!0}catch(w){let e=w.code;if(!["ENOENT","EEXIST"].includes(e??""))throw w}}finally{if(!_)v(U,{recursive:!0,force:!0})}}throw new X("lock_unavailable","Could not acquire the managed Reason runtime lock.")}var GJ=20000;function a(q,G,J){if(!B(G))throw new X("invalid_version","Invalid managed Reason runtime version.");let Q=Date.now()+GJ,R=zq({path:q.transitionLock,runtimeVersion:G,staleAfterMs:60000});while(!R.acquired&&Date.now()<Q)lq(100),R=zq({path:q.transitionLock,runtimeVersion:G,staleAfterMs:60000});if(!R.acquired)throw new X("transition_busy","Another managed Reason runtime transition is in progress.");try{return J()}finally{R.release()}}function cJ(q){if(!B(q.runtimeVersion))throw new X("invalid_version","Invalid managed Reason runtime version.");let G=q.paths??Tq();return zq({path:G.brokerLock,runtimeVersion:q.runtimeVersion,...q.pid===void 0?{}:{pid:q.pid},...q.now===void 0?{}:{now:q.now},...q.nonce===void 0?{}:{nonce:q.nonce},...q.alive===void 0?{}:{alive:q.alive},...q.beforePublish===void 0?{}:{beforePublish:q.beforePublish}})}function zG(q){return Iq(q)&&Cq(q,["schema_version","event_id","occurred_at","event","runtime_version"],["from_version","to_version","reason_code","duration_ms","attempt_count","retry_in_ms","capabilities"])&&q.schema_version===tq&&typeof q.event_id==="string"&&/^[0-9a-f-]{36}$/.test(q.event_id)&&GG(q.occurred_at)&&typeof q.event==="string"&&FG.includes(q.event)&&B(q.runtime_version)&&(q.from_version===void 0||B(q.from_version))&&(q.to_version===void 0||B(q.to_version))&&(q.reason_code===void 0||typeof q.reason_code==="string"&&Pq.test(q.reason_code))&&(q.duration_ms===void 0||typeof q.duration_ms==="number"&&Number.isSafeInteger(q.duration_ms)&&q.duration_ms>=0&&q.duration_ms<=86400000)&&(q.attempt_count===void 0||typeof q.attempt_count==="number"&&Number.isSafeInteger(q.attempt_count)&&q.attempt_count>=1&&q.attempt_count<=1e5)&&(q.retry_in_ms===void 0||typeof q.retry_in_ms==="number"&&Number.isSafeInteger(q.retry_in_ms)&&q.retry_in_ms>=0&&q.retry_in_ms<=30000)&&(q.capabilities===void 0||Array.isArray(q.capabilities)&&q.capabilities.length<=TG&&q.capabilities.every((G)=>typeof G==="string"&&Pq.test(G)))}var JJ=/^(\d{22}-[0-9a-f-]{36}\.json)$/,QJ=/^(\d{22}-[0-9a-f-]{36}\.json)\.sending-(\d+)-[0-9a-f-]{36}$/,RJ=300000,qq=0n;function UJ(q){let G=BigInt(new Date(q.occurred_at).getTime())*1000000n;return qq=G>qq?G:qq+1n,`${String(qq).padStart(22,"0")}-${q.event_id}.json`}function $q(q){try{return Oq(q.lifecycleEvents).filter((G)=>JJ.test(G)).sort()}catch{return[]}}function Mq(q){try{let G=JSON.parse(g(q,"utf8"));return zG(G)?G:null}catch{return null}}function MG(q,G=HG,J=Date.now()){let Q;try{Q=Oq(q.lifecycleEvents)}catch{return}for(let R of Q){let W=R.match(QJ);if(!W)continue;let U=K(q.lifecycleEvents,R),_=K(q.lifecycleEvents,W[1]),Z=!G(Number(W[2]));if(!Z)try{Z=J-x(U).mtimeMs>=RJ}catch{continue}if(!Z)continue;try{k(U,_)}catch($){let Y=$.code;if(Y==="EEXIST")C(U);else if(Y!=="ENOENT")throw $}}}function WJ(q){let J=$q(q).flatMap((R)=>{try{return[{name:R,size:x(K(q.lifecycleEvents,R)).size}]}catch{return[]}}),Q=J.reduce((R,W)=>R+W.size,0);while(J.length>qG||Q>BG){let R=J.shift();if(!R)break;try{C(K(q.lifecycleEvents,R.name)),Q-=R.size}catch(W){if(W.code!=="ENOENT")throw W}}}function hJ(q){return MG(q),$q(q).map((G)=>Mq(K(q.lifecycleEvents,G))).filter((G)=>G!==null).slice(-qG)}function N(q,G,J={}){let Q={schema_version:tq,event_id:J.eventId?.()??T(),occurred_at:(J.now?.()??new Date).toISOString(),...G};if(!zG(Q))throw new X("invalid_lifecycle_event","Managed runtime lifecycle event is invalid.");return b(q.lifecycleEvents),JG(K(q.lifecycleEvents,UJ(Q)),`${JSON.stringify(Q)}
10
- `),WJ(q),Q}function lJ(q,G){if(G.length===0)return 0;let J=new Set(G),Q=0;for(let R of $q(q)){let W=R.slice(23,-5);if(!J.has(W))continue;try{C(K(q.lifecycleEvents,R)),Q+=1}catch(U){if(U.code!=="ENOENT")throw U}}return Q}async function oJ(q,G,J){MG(q);let Q=0;for(let R of $q(q)){let W=K(q.lifecycleEvents,R);if(J){let Z=Mq(W);if(!Z||!J(Z))continue}let U=`${W}.sending-${process.pid}-${T()}`;try{k(W,U)}catch(Z){if(Z.code==="ENOENT")continue;throw Z}let _=Mq(U);if(!_){C(U);continue}try{await G(_),C(U),Q+=1}catch{try{k(U,W)}catch(Z){if(Z.code!=="ENOENT")throw Z}break}}return Q}function sJ(q){let G=q.paths??Tq(),J=q.sourceExecutable??process.execPath,Q=q.sourceCredentialLibrary??Bq(D(S(J))),R=q.now?.()??new Date,W=E(F(G,q.version))&&Lq(G,q.version,q.allowDowngrade)!==null;if(!W)N(G,{event:"service.install_started",runtime_version:q.version,to_version:q.version},{now:()=>R});try{let U=g(J),_;try{_=g(Q)}catch{throw new X("credential_boundary_unavailable","Managed runtime credential boundary is unavailable.")}let Z={url:"https://bootstrap.invalid/ara",sha256:c(U),size_bytes:U.byteLength},$={url:`https://bootstrap.invalid/${Nq}`,sha256:c(_),size_bytes:_.byteLength},Y=UG({paths:G,version:q.version,artifact:Z,bytes:U,credentialLibraryArtifact:$,credentialLibraryBytes:_,...q.verifyCodeSignatures?{verifyCodeSignatures:q.verifyCodeSignatures}:{}}),H=uq(J);if(E(H))Dq({sourceApp:H,home:q.home??d()});let j=mG(G,q.version,{allowDowngrade:q.allowDowngrade});if(!W)Yq(G);let z=q.home??d(),M=q.installLauncher===!1?"skipped":fG({paths:G,...q.launcherPath?{launcherPath:q.launcherPath}:{home:z}});if(q.installLauncher!==!1&&!q.launcherPath)ZG(G,K(z,".local","bin","reason"));if(M==="conflict")N(G,{event:"service.launcher_conflict",runtime_version:q.version,to_version:q.version,reason_code:"existing_entrypoint"},{now:q.now});if(!W)N(G,{event:"service.install_completed",runtime_version:q.version,to_version:q.version,duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-R.getTime())},{now:q.now});return{installed:Y.installed,activated:j.changed,activeVersion:j.toVersion,executablePath:F(G,j.toVersion),launcher:M}}catch(U){throw N(G,{event:"service.install_failed",runtime_version:q.version,to_version:q.version,reason_code:U instanceof X?U.code:"install_failed",duration_ms:Math.max(0,(q.now?.()??new Date).getTime()-R.getTime())},{now:q.now}),U}}
11
- export{Zq as L,tq as M,qG as N,BG as O,DG as P,OG as Q,EG as R,Vq as S,IG as T,FG as U,Tq as V,yJ as W,F as X,i as Y,QG as Z,wG as _,kG as $,Fq as aa,p as ba,RG as ca,fJ as da,UG as ea,fG as fa,_q as ga,L as ha,mJ as ia,vJ as ja,dJ as ka,mG as la,KG as ma,lG as na,zq as oa,cJ as pa,hJ as qa,N as ra,lJ as sa,oJ as ta,sJ as ua};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{s as a,t as b,u as c}from"./vm-hands-entry-lite-11ge54k1.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{b as spawnSessionPty,c as runVmHandsOpRunner,a as VM_HANDS_OP_RUNNER_PERSON_ARG};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{r as a}from"./vm-hands-entry-lite-bw28d85m.js";import"./vm-hands-entry-lite-qwxmr70t.js";import"./vm-hands-entry-lite-fkkmhfjc.js";import"./vm-hands-entry-lite-g7h6wjqy.js";import"./vm-hands-entry-lite-6ffdqdyw.js";import"./vm-hands-entry-lite-mkynexaq.js";import"./vm-hands-entry-lite-04y4b7c6.js";import"./vm-hands-entry-lite-0a1ch6wx.js";import"./vm-hands-entry-lite-hkvkfq0z.js";import"./vm-hands-entry-lite-4yw8vx5h.js";export{a as configureWorkerSandbox};