@reason-machines/cli-linux-arm64-musl 0.2.358 → 0.2.359

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 (96) hide show
  1. package/bin/ara +1 -1
  2. package/bin/vm-hands/api-credentials-axffq0pk.js +2 -0
  3. package/bin/vm-hands/api-texm6ayv.js +2 -0
  4. package/bin/vm-hands/ask-relay-fkb3bj30.js +8 -0
  5. package/bin/vm-hands/connect-cli-ev4xex04.js +2 -0
  6. package/bin/vm-hands/{custom-endpoint-device-j3e3zjd5.js → custom-endpoint-device-bsanzqj2.js} +1 -1
  7. package/bin/vm-hands/desktop-account-jxfva4m1.js +2 -0
  8. package/bin/vm-hands/{device-workspace-7yg5x68n.js → device-workspace-fhbpenda.js} +1 -1
  9. package/bin/vm-hands/hands-worker-source-ze6q6h8b.js +2 -0
  10. package/bin/vm-hands/{index-swa20ch8.js → index-tv4kcb2a.js} +1 -1
  11. package/bin/vm-hands/install-receipt-3s9amwp3.js +2 -0
  12. package/bin/vm-hands/local-automation-f8f33qpp.js +2 -0
  13. package/bin/vm-hands/local-capabilities-ya6yzxh5.js +2 -0
  14. package/bin/vm-hands/local-desktop-users-3th2aaac.js +2 -0
  15. package/bin/vm-hands/local-display-mac-neweyjpa.js +2 -0
  16. package/bin/vm-hands/local-display-session-v00nv1fm.js +2 -0
  17. package/bin/vm-hands/local-pty-session-2crsy5td.js +2 -0
  18. package/bin/vm-hands/managed-runtime-mg7kmckn.js +2 -0
  19. package/bin/vm-hands/{network-contract-rm9x646s.js → network-contract-gq8x3ehk.js} +1 -1
  20. package/bin/vm-hands/package-s3eg9zrd.js +2 -0
  21. package/bin/vm-hands/permissions-3kjdp3ge.js +2 -0
  22. package/bin/vm-hands/{reason-hands-protocol-3z7bas06.js → reason-hands-protocol-67d4b6fm.js} +1 -1
  23. package/bin/vm-hands/serve-service-nqshfese.js +2 -0
  24. package/bin/vm-hands/{status-psxtsknj.js → status-f146chye.js} +2 -2
  25. package/bin/vm-hands/version-ss25ccvh.js +2 -0
  26. package/bin/vm-hands/{vm-hands-entry-lite-he2z2137.js → vm-hands-entry-lite-07er2w8q.js} +2 -2
  27. package/bin/vm-hands/{vm-hands-entry-lite-5b29hq7h.js → vm-hands-entry-lite-1j9r1fca.js} +2 -2
  28. package/bin/vm-hands/vm-hands-entry-lite-22we2jrv.js +3 -0
  29. package/bin/vm-hands/{vm-hands-entry-lite-xhjbc3e4.js → vm-hands-entry-lite-3ew5ftk0.js} +2 -2
  30. package/bin/vm-hands/vm-hands-entry-lite-463aheya.js +3 -0
  31. package/bin/vm-hands/vm-hands-entry-lite-5kgvss4p.js +3 -0
  32. package/bin/vm-hands/vm-hands-entry-lite-5xtkyx25.js +3 -0
  33. package/bin/vm-hands/{vm-hands-entry-lite-jfwz0br7.js → vm-hands-entry-lite-9z6k7898.js} +2 -2
  34. package/bin/vm-hands/vm-hands-entry-lite-bybpy28m.js +5 -0
  35. package/bin/vm-hands/vm-hands-entry-lite-c0m2jewa.js +11 -0
  36. package/bin/vm-hands/{vm-hands-entry-lite-3zxjyj62.js → vm-hands-entry-lite-c7krpmd8.js} +3 -3
  37. package/bin/vm-hands/{vm-hands-entry-lite-dys7am1h.js → vm-hands-entry-lite-d2hbz0r4.js} +2 -2
  38. package/bin/vm-hands/{vm-hands-entry-lite-nvhzj5b0.js → vm-hands-entry-lite-f4gvypnx.js} +1 -1
  39. package/bin/vm-hands/{vm-hands-entry-lite-wpx6sg6d.js → vm-hands-entry-lite-gxjxx1r2.js} +2 -2
  40. package/bin/vm-hands/vm-hands-entry-lite-gzxxsjmr.js +62 -0
  41. package/bin/vm-hands/{vm-hands-entry-lite-nd1k2jz9.js → vm-hands-entry-lite-h2xemq1f.js} +1 -1
  42. package/bin/vm-hands/{vm-hands-entry-lite-c9wp99nr.js → vm-hands-entry-lite-ha1ej910.js} +2 -2
  43. package/bin/vm-hands/{vm-hands-entry-lite-nbtpm59m.js → vm-hands-entry-lite-j05685sg.js} +2 -2
  44. package/bin/vm-hands/{vm-hands-entry-lite-6f5eypjm.js → vm-hands-entry-lite-jn95s3j4.js} +2 -2
  45. package/bin/vm-hands/vm-hands-entry-lite-kt4831mq.js +340 -0
  46. package/bin/vm-hands/{vm-hands-entry-lite-k17ntg9v.js → vm-hands-entry-lite-kv0qat0x.js} +2 -2
  47. package/bin/vm-hands/vm-hands-entry-lite-kxdw4myj.js +3 -0
  48. package/bin/vm-hands/{vm-hands-entry-lite-0hv9ek0t.js → vm-hands-entry-lite-n867d88m.js} +9 -68
  49. package/bin/vm-hands/{vm-hands-entry-lite-c8hfat7y.js → vm-hands-entry-lite-p8662x7z.js} +2 -2
  50. package/bin/vm-hands/vm-hands-entry-lite-pf1gagky.js +37 -0
  51. package/bin/vm-hands/{vm-hands-entry-lite-rr0hhz7g.js → vm-hands-entry-lite-qbnz4h30.js} +3 -3
  52. package/bin/vm-hands/{vm-hands-entry-lite-8jmwhybq.js → vm-hands-entry-lite-qhgfnhjt.js} +2 -2
  53. package/bin/vm-hands/{vm-hands-entry-lite-trcg4jv7.js → vm-hands-entry-lite-qm18wqgz.js} +2 -2
  54. package/bin/vm-hands/{vm-hands-entry-lite-beannz0s.js → vm-hands-entry-lite-r5y08n0q.js} +2 -2
  55. package/bin/vm-hands/vm-hands-entry-lite-r6pap1kh.js +3 -0
  56. package/bin/vm-hands/vm-hands-entry-lite-s98hjhz3.js +5 -0
  57. package/bin/vm-hands/{vm-hands-entry-lite-zrvaqawr.js → vm-hands-entry-lite-sx2gpbap.js} +2 -2
  58. package/bin/vm-hands/{vm-hands-entry-lite-qf01e5f1.js → vm-hands-entry-lite-szfy3kx7.js} +2 -2
  59. package/bin/vm-hands/{vm-hands-entry-lite-95k4g3jj.js → vm-hands-entry-lite-taw01cp4.js} +1 -1
  60. package/bin/vm-hands/{vm-hands-entry-lite-0tdpjsxc.js → vm-hands-entry-lite-tg2bkah3.js} +2 -2
  61. package/bin/vm-hands/{vm-hands-entry-lite-mybm2kyz.js → vm-hands-entry-lite-v08mjs3f.js} +2 -2
  62. package/bin/vm-hands/{vm-hands-entry-lite-84d59wrf.js → vm-hands-entry-lite-w88zkzhr.js} +1 -1
  63. package/bin/vm-hands/vm-hands-entry-lite-wej1p1ry.js +3 -0
  64. package/bin/vm-hands/{vm-hands-entry-lite-gcn3rmz6.js → vm-hands-entry-lite-wry37am5.js} +1 -1
  65. package/bin/vm-hands/vm-hands-entry-lite-x4j4058x.js +9 -0
  66. package/bin/vm-hands/{vm-hands-entry-lite-tj1y61bg.js → vm-hands-entry-lite-ygx9kj92.js} +1 -1
  67. package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
  68. package/bin/vm-hands/{vm-hands-executor-dqqdgtqq.js → vm-hands-executor-5nqmf61x.js} +1 -1
  69. package/bin/vm-hands/vm-hands-op-runner-zedtdcmk.js +2 -0
  70. package/bin/vm-hands/{vm-hands-runtime-y89fmev1.js → vm-hands-runtime-hnpk8xmf.js} +3 -3
  71. package/bin/vm-hands/worker-sandbox-vmp22sk6.js +2 -0
  72. package/package.json +1 -1
  73. package/bin/vm-hands/api-credentials-emdf5nm5.js +0 -2
  74. package/bin/vm-hands/api-js29ghm5.js +0 -2
  75. package/bin/vm-hands/ask-relay-qv9ddzr1.js +0 -8
  76. package/bin/vm-hands/connect-cli-8nxph9td.js +0 -2
  77. package/bin/vm-hands/desktop-account-gcysz0m3.js +0 -2
  78. package/bin/vm-hands/hands-worker-source-hbp5n31r.js +0 -2
  79. package/bin/vm-hands/local-automation-nw3bj9b5.js +0 -2
  80. package/bin/vm-hands/local-capabilities-7m54wthn.js +0 -2
  81. package/bin/vm-hands/local-desktop-users-pccz3sz9.js +0 -2
  82. package/bin/vm-hands/local-display-mac-gj72gkfb.js +0 -2
  83. package/bin/vm-hands/local-display-session-5ajajxtg.js +0 -2
  84. package/bin/vm-hands/local-pty-session-zen80k1k.js +0 -2
  85. package/bin/vm-hands/package-1e3w44ve.js +0 -2
  86. package/bin/vm-hands/permissions-0ej6xgrj.js +0 -2
  87. package/bin/vm-hands/version-fw3dwa12.js +0 -2
  88. package/bin/vm-hands/vm-hands-entry-lite-33ttamma.js +0 -5
  89. package/bin/vm-hands/vm-hands-entry-lite-3ms5bb0b.js +0 -43
  90. package/bin/vm-hands/vm-hands-entry-lite-6qfax5p2.js +0 -3
  91. package/bin/vm-hands/vm-hands-entry-lite-d9k3dzaq.js +0 -3
  92. package/bin/vm-hands/vm-hands-entry-lite-dyy62gt3.js +0 -3
  93. package/bin/vm-hands/vm-hands-entry-lite-pm0j47qj.js +0 -343
  94. package/bin/vm-hands/vm-hands-entry-lite-tdgbgcer.js +0 -3
  95. package/bin/vm-hands/vm-hands-op-runner-msdteb31.js +0 -2
  96. package/bin/vm-hands/worker-sandbox-yw24sxyp.js +0 -2
package/bin/ara CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/ara
3
3
  size: 98479992 bytes
4
- sha256: 80b9d7f590f8f9543ca06efea654b98c82cdcd8496be92260a0d416a2fc8419b
4
+ sha256: e977c59ec45e538733b3976c7748e80902cbff38b98432472cc3b64cf20fe1c8
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{v as a,w as b,x as c,y as d,z as e}from"./vm-hands-entry-lite-463aheya.js";import"./vm-hands-entry-lite-taw01cp4.js";import"./vm-hands-entry-lite-qm18wqgz.js";import"./vm-hands-entry-lite-wry37am5.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{d as resolveApiCredentials,e as requireApiCredentials,b as explicitApiOrigin,c as environmentApiKey,a as apiOriginFromEnvironment};
@@ -0,0 +1,2 @@
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-taw01cp4.js";import"./vm-hands-entry-lite-qm18wqgz.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{d as sessionPlace,c as sessionMachine,e as createMachineEnrollmentTicketWithToken,f as ReasonApi,b as REASONING_EFFORTS,a as ApiError};
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ import{va as N}from"./vm-hands-entry-lite-qm18wqgz.js";import{pj as g}from"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-kv0qat0x.js";import{ak as G}from"./vm-hands-entry-lite-h2xemq1f.js";import{existsSync as Nq,mkdirSync as gq,readFileSync as Eq,writeFileSync as wq}from"fs";import{homedir as Yq}from"os";import{dirname as e,join as kq}from"path";import{spawnSync as P}from"child_process";import{createHash as Bq}from"crypto";import{chmodSync as Qq,closeSync as Kq,existsSync as U,lstatSync as Jq,mkdirSync as c,mkdtempSync as Lq,openSync as Wq,readFileSync as Dq,readSync as Hq,renameSync as p,rmSync as b,statSync as s,symlinkSync as Cq,writeFileSync as a}from"fs";import{connect as Fq}from"net";import{homedir as F}from"os";import{dirname as y,join as J}from"path";class x extends Error{}var C="reason-network",H="0.10.3",xq={"aarch64-apple-darwin":"1e793a89ea8b53c603cddbc65ac08b0dd83f1dbfc30a1987858e2c52e2ed907c","x86_64-apple-darwin":"ef1f0f8d7d9e8a286de54eeb78f8ff8a53152c1a661c50b6182bfefa8eef8a02","aarch64-unknown-linux-musl":"75fdfd10314225ffb2875acc7ac73c66de23b5678b684d70b4678eb16ba35124","x86_64-unknown-linux-musl":"17111a623396eed0a2d98aa4d3bb03f00da37c25bdc39b6d0ba3ab202dfbe874"},Vq="https://reasonmachines.com/cli/engine",f="REASON_AGENT_NETWORK_BIN";function Pq(){let q=process.arch==="arm64"?"aarch64":process.arch==="x64"?"x86_64":null,z=process.platform==="darwin"?"apple-darwin":process.platform==="linux"?"unknown-linux-musl":null;return q&&z?`${q}-${z}`:null}function E(q){let z=P(q,["--version"],{encoding:"utf8",timeout:5000}),[X,Y]=z.status===0?z.stdout.trim().split(/\s+/):[];return X===C?Y??null:null}function A(q,z){let X=q.split(".").map(Number),Y=z.split(".").map(Number);for(let Z=0;Z<3;Z+=1)if((X[Z]??0)!==(Y[Z]??0))return(X[Z]??0)>(Y[Z]??0);return!0}function u(q=F()){return J(q,".reason","bin","reason-network")}var M=`~/.local/bin/${C}`;async function Uq(q=process.env,z=()=>{}){if(q[f])return q[f];let X=u(),Y=t(),Z=Y?.path===X&&j(X)===Y.fingerprint?Y:null,B=Z?.kept,$=k(q)?null:Gq(B);if(Z?.version===H&&!$)return X;let Q=U(X)?E(X):null;if($){let K=E($.path),L=Q&&A(Q,H)?Q:H;if(!K||!A(L,K)){if(K)z(`Reason Network: ${M} (${K}) is newer than the engine reason network uses (${L}), so it was left as it is.`);B=$.fingerprint,$=null}}if(Z?.version===H&&!$)return h(X,B);if(!Q||!A(Q,H))await Mq(X);let W=P(X,["setup",...k(q)?["--no-service"]:[]],{env:await i(q),encoding:"utf8",timeout:60000});if(W.status!==0){let K=T((W.stderr||W.stdout||"").trim().split(`
3
+ `).pop()??"");if(Z)return r(F(),{...Z,fingerprint:j(X)??Z.fingerprint,...B?{kept:B}:{}}),z($?`Reason Network: couldn't move your agents off ${M}${K?` (${K})`:""}; they keep using it. Run reason network setup to try again.`:`Reason Network: couldn't finish setting up the network engine${K?` (${K})`:""}. Run reason network setup to try again.`),X;throw new x(`Couldn't connect this computer's agents to the network${K?` (${K})`:""}. Run reason network setup to try again.`)}if($)B=fq($,X,z);return h(X,B),P(X,["stop"],{env:q,stdio:"ignore",timeout:15000}),X}function Gq(q){let z=J(F(),".local","bin",C),X;try{X=Jq(z)}catch{return null}let Y=`${X.size}:${X.mtimeMs}:${X.ino}`;if(!X.isFile()||Y===q)return null;try{let Z=s(u());if(Z.ino===X.ino&&Z.dev===X.dev)return null}catch{}try{let Z=Buffer.alloc(2),B=Wq(z,"r");try{Hq(B,Z,0,2,0)}finally{Kq(B)}if(Z.toString("latin1")==="#!")return null}catch{return null}return{path:z,fingerprint:Y}}function fq(q,z,X){let Y=`${q.path}.reason-${process.pid}`;try{b(Y,{force:!0}),Cq(z,Y),p(Y,q.path),X(`Reason Network: your agents now use the engine reason network keeps up to date; ${M} points to it. Restart a running agent to pick it up.`);return}catch(Z){return b(Y,{force:!0}),X(`Reason Network: your agents now use the engine reason network keeps up to date, but ${M} couldn't be pointed to it (${Z instanceof Error?Z.message:String(Z)}). Remove that copy so it can't take them back.`),q.fingerprint}}async function i(q){if(q[w])return q;try{let{defaultWorkerServiceHost:z,workerServiceLauncher:X}=await import("./serve-service-nqshfese.js");return{...q,[w]:X(z(F()),q)}}catch{return q}}var w="REASON_NETWORK_REASON_BIN";function k(q=process.env){return Boolean(q.REASON_NETWORK_NO_SERVICE||q.TINCAN_NO_SERVICE)}var S=(q)=>J(q,".reason","ask-engine.json");function j(q){try{let z=s(q);return`${z.size}:${z.mtimeMs}:${z.ino}`}catch{return null}}function t(q=F()){try{let z=JSON.parse(Dq(S(q),"utf8"));if(typeof z.path!=="string"||typeof z.fingerprint!=="string"||typeof z.version!=="string")return null;return{path:z.path,fingerprint:z.fingerprint,version:z.version,...typeof z.kept==="string"?{kept:z.kept}:{}}}catch{return null}}function r(q,z){c(y(S(q)),{recursive:!0}),a(S(q),JSON.stringify(z))}function h(q,z){let X=j(q);if(X)r(F(),{path:q,fingerprint:X,version:H,...z?{kept:z}:{}});return q}async function Mq(q){let z=Pq(),X=z?xq[z]:void 0;if(!z||!X)throw new x(`Reason Network runs on macOS and Linux (arm64 or x64); this is ${process.platform} ${process.arch}.`);let Y=`${Vq}/${H}/${C}-${z}.tar.gz`,Z;try{let Q=await fetch(Y,{signal:AbortSignal.timeout(120000)});if(!Q.ok)throw Error(`HTTP ${Q.status}`);Z=Buffer.from(await Q.arrayBuffer())}catch(Q){let W=Q instanceof Error&&Q.name==="TimeoutError"?"no download within 2 minutes":Q instanceof Error?Q.message.replace(/\.$/,""):String(Q);throw new x(`Couldn't download the network engine from ${new URL(Y).host} (${W}). Check the connection and run reason network again.`)}if(Bq("sha256").update(Z).digest("hex")!==X)throw new x("The downloaded network engine didn't match its checksum, so it wasn't installed.");c(y(q),{recursive:!0});let $=Lq(J(y(q),".reason-engine-"));try{if(a(J($,"engine.tar.gz"),Z),P("tar",["-xzf",J($,"engine.tar.gz"),"-C",$]).status!==0||!U(J($,C)))throw new x("Couldn't unpack the network engine.");Qq(J($,C),493),p(J($,C),q)}finally{b($,{recursive:!0,force:!0})}}function jq(q=process.env,z=F()){let X=q.REASON_NETWORK_HOME?.trim()||q.TINCAN_HOME?.trim();if(X)return X;let Y=J(z,".reason","network"),Z=J(z,".tincan");return!d(Y)&&d(Z)?Z:Y}var d=(q)=>U(J(q,"network.db"))||U(J(q,"tincan.db"));function Oq(q){let z=U(J(q,"network.db"))||!U(J(q,"tincan.db")),X=J(q,z?"network.sock":"tincan.sock");if(Buffer.byteLength(X)<100)return X;let Y=0xcbf29ce484222325n;for(let Z of Buffer.from(X))Y=BigInt.asUintN(64,(Y^BigInt(Z))*0x100000001b3n);return J("/tmp",`${z?"reason-network":"tincan"}-${process.getuid?.()??0}`,`${Y.toString(16).padStart(16,"0")}.sock`)}var o=15000,Tq=new Set(["who","team","inbox","unread","held"]),Rq=90000,Iq="the network daemon closed the connection";class O{socket;nextId=1;buffer="";pending=new Map;closed=null;hungUp=!1;constructor(q){this.socket=q;q.setEncoding("utf8"),q.on("data",(X)=>this.read(X));let z=(X)=>{this.closed=X;for(let Y of this.pending.values())Y.reject(X);this.pending.clear()};q.on("error",(X)=>z(X)),q.on("close",()=>z(Error(this.hungUp?"the connection to the network daemon was closed here":Iq)))}static open(q){return new Promise((z,X)=>{let Y=Fq(q);Y.once("connect",()=>z(new O(Y))),Y.once("error",X)})}read(q){this.buffer+=q;let z=this.buffer.indexOf(`
4
+ `);while(z>=0){let X=this.buffer.slice(0,z);if(this.buffer=this.buffer.slice(z+1),z=this.buffer.indexOf(`
5
+ `),!X.trim())continue;let Y;try{Y=JSON.parse(X)}catch{continue}if(typeof Y.id!=="number")continue;let Z=this.pending.get(Y.id);if(!Z)continue;if(this.pending.delete(Y.id),Y.ok)Z.resolve(Y.result);else Z.reject(Error(T(Y.error??"the network daemon refused the request")))}}call(q,z={},X=o){if(this.closed)return Promise.reject(this.closed);let Y=this.nextId++;return this.socket.write(`${JSON.stringify({id:Y,op:q,...z})}
6
+ `),new Promise((Z,B)=>{let $=setTimeout(()=>{this.pending.delete(Y),B(Error(`the network daemon didn't answer ${q} within ${Math.round(X/1000)}s`))},X);this.pending.set(Y,{resolve:(Q)=>{clearTimeout($),Z(Q)},reject:(Q)=>{clearTimeout($),B(Q)}})})}get isClosed(){return this.closed!==null}close(){this.hungUp=!0,this.socket.end()}}var _=/^(Claude Code|Grok|Codex) \u00B7 (.*)$/,Aq={"Claude Code":"claude-code",Grok:"grok",Codex:"codex"},_q=/^ask-[0-9a-f]{6}$/;function l(q){return{id:q.id,from:q.from,fromAgent:q.from_agent,to:q.to,replyTo:q.reply_to,body:q.body,sentAt:q.sent_at}}function m(q){return{person:q.person,machine:q.machine,isMe:q.is_me,online:q.online,link:q.link,rttMs:q.rtt_ms}}class V{engine;env;connection=null;waits=new Set;constructor(q,z){this.engine=q;this.env=z}static async open(q=process.env,z){return new V(await Uq(q,z),q)}static openInstalled(q=process.env){if(q[f])return new V(q[f],q);let z=u(),X=t();return X?.path===z&&j(z)===X.fingerprint?new V(z,q):null}socketPath(){return Oq(jq(this.env))}async open(){try{return await O.open(this.socketPath())}catch{return P(this.engine,["who","--json"],{env:this.env,stdio:"ignore",timeout:15000}),await O.open(this.socketPath())}}async call(q,z={},X){if(!this.connection||this.connection.isClosed)this.connection=await this.open();try{return await this.connection.call(q,z,X)}catch(Y){if(!/closed|ECONNRESET|EPIPE/.test(String(Y)))throw Y;if(this.connection=await this.open(),!Tq.has(q))throw Y;return await this.connection.call(q,z)}}async waitOn(q,z){let X=await this.open();this.waits.add(X);try{return await X.call(q,z,z.wait_secs*1000+o)}finally{this.waits.delete(X),X.close()}}close(){this.connection?.close(),this.connection=null;for(let q of this.waits)q.close();this.waits.clear()}async team(){try{let q=await this.call("team");return{...q,machines:q.machines.map(m)}}catch(q){if(/team/i.test(String(q)))return null;throw q}}async snapshot(q={}){let z=await this.call("who",{all:Boolean(q.all),...q.filter?{filter:q.filter}:{}}),X=new Set(z.sessions.filter((Z)=>_.test(Z.doing??"")).map((Z)=>`${Z.person}/${Z.machine}:${Z.cwd}`)),Y=z.sessions.filter((Z)=>q.all||!_q.test(Z.name)).filter((Z)=>_.test(Z.doing??"")||!X.has(`${Z.person}/${Z.machine}:${Z.cwd}`)).map((Z)=>{let B=_.exec(Z.doing??"");return{address:Z.address,name:Z.name,person:Z.person,machine:Z.machine,agent:B?Aq[B[1]]:Z.agent,cwd:Z.cwd,repo:Z.repo,branch:Z.branch,status:B?B[2]==="ready for work"?"idle":B[2]==="stopped"?"offline":"busy":Z.status,since:Z.since,doing:B?B[2]:Z.doing,isMe:Z.is_me,worker:Boolean(B),tier:Z.tier??null}});return{team:z.team,person:z.person,machine:z.machine,machines:z.machines.map(m),sessions:Y}}async send(q,z,X={}){if(!X.from)await this.call("hook",{agent:"cli",event:"stop",session_id:"terminal",name:"terminal",cwd:process.cwd(),mail:!1});let Y=await this.call("send",{from:X.from??"terminal",to:q,body:z,...X.replyTo?{reply_to:X.replyTo}:{},wake:X.wake??!0,...X.notify?{notify:!0}:{}});return{ids:Y.ids,recipients:Y.recipients.map((Z)=>Z.address),deliveries:Y.recipients.map((Z)=>({address:Z.address,state:Z.state,note:Z.note??""}))}}async session(q,z={}){let X=z.agent??"cli",Y=($,Q={})=>this.call("hook",{agent:X,event:$,session_id:q,name:q,cwd:process.cwd(),mail:!1,...Q}),Z=await Y("stop"),B=`${X}:${q}`;return{name:q,address:Z.address??q,next:async($)=>{return(await this.waitOn("inbox",{key:B,wait_secs:$,peek:!0})).messages.map(l)},ack:async($)=>{if($.length)await this.call("delivered",{key:B,ids:$})},busy:async($)=>{if(await Y("prompt"),$)await Y("doing",{doing:$})},idle:async($)=>{if(await Y("stop"),$)await Y("doing",{doing:$})},doing:async($)=>{await Y("doing",{doing:$})},send:($,Q,W,K)=>this.send($,Q,{from:B,...W?{replyTo:W}:{},...K?.notify?{notify:!0}:{}})}}async inbox(q={}){let X=(await this.waitOn("inbox",{key:"cli:terminal",wait_secs:q.waitSeconds??0,peek:!0}).catch((Y)=>{if(/isn't registered/.test(String(Y)))return{messages:[]};throw Y})).messages.map(l);if(X.length&&!q.peek)await this.call("delivered",{key:"cli:terminal",ids:X.map((Y)=>Y.id)});return X}async link(q={}){return await this.call("link",{new:Boolean(q.new)})}async changeTeam(q,z){try{return await this.call(q,z,Rq)}finally{this.close()}}async changeOntoTeam(q,z){try{await this.changeTeam(q,z)}catch(X){if(!/closed|ECONNRESET|EPIPE/.test(String(X)))throw X;if(await this.team())return;await this.changeTeam(q,z)}}async createTeam(q,z){await this.changeOntoTeam("create_team",{name:q,person:z})}async join(q,z){await this.changeOntoTeam("join",{ticket:q,person:z})}async leave(){return await this.changeTeam("leave",{force:!0})}async remove(q){return await this.call("remove",{who:q})}async setup(q,z={}){return this.passthrough(["setup",...q],z,await i(this.env))}passthrough(q,z={},X=this.env){this.close();let Y=P(this.engine,q,{stdio:["inherit","pipe","pipe"],encoding:"utf8",env:X});if(!z.quiet||Y.status!==0)process.stdout.write(T(Y.stdout??"")),process.stderr.write(T(Y.stderr??""));return Y.status??1}}function T(q){return q.replace(/not in a team yet:[^\n]*/g,"this computer isn't on a team yet: run `reason network setup`").replace(/`tincan (\w+)/g,"`reason network $1").replace(/\btincan (who|send|inbox|invite|join|team|link|setup|doctor|remove|leave|listen)\b/g,"reason network $1").replace(/(?<![\w./-])tincan(?![\w./-])/gi,"Reason Network")}import{existsSync as Jz,mkdirSync as Lz,readFileSync as bq,writeFileSync as Wz}from"fs";import{homedir as yq,hostname as Hz}from"os";import{dirname as Fz,join as Sq}from"path";var uq=(q)=>Sq(q,".reason","ask.json");function vq(q){try{let z=JSON.parse(bq(uq(q),"utf8"));if(typeof z.orgId!=="string"||typeof z.team!=="string")return null;let X=z.pendingRotation;return{orgId:z.orgId,team:z.team,...typeof z.checkedAt==="number"?{checkedAt:z.checkedAt}:{},...X&&typeof X.link==="string"&&typeof X.team==="string"&&typeof X.replaces==="string"?{pendingRotation:X}:{}}}catch{return null}}function n(q=yq()){let z=vq(q);return z?{orgId:z.orgId,team:z.team}:null}var qq=86400000,hq=300,R=(q)=>kq(q,".reason","ask-relay.json");function v(q){try{let z=JSON.parse(Eq(R(q),"utf8"));return{sessions:Array.isArray(z.sessions)?z.sessions.filter((X)=>typeof X?.name==="string"&&typeof X.agent==="string"&&typeof X.usedAt==="number"):[]}}catch{return{sessions:[]}}}function dq(q,z){try{if(!Nq(e(R(q))))gq(e(R(q)),{recursive:!0});wq(R(q),`${JSON.stringify(z)}
7
+ `,{mode:384})}catch{}}var D=(q,z)=>new Promise((X)=>{if(z.aborted)return X();let Y=setTimeout(Z,q);Y.unref?.();function Z(){clearTimeout(Y),z.removeEventListener("abort",Z),X()}z.addEventListener("abort",Z,{once:!0})});function zq(q){let z=q?.status;return typeof z==="number"?z:null}var Xq=60000;function lq(q){return{address:q.address.slice(0,300),state:q.state.slice(0,40),note:q.note.slice(0,500)}}function mq(q){let z=Number.isFinite(q.sentAt)&&Math.abs(q.sentAt)<8640000000000000?q.sentAt:Date.now();return{id:q.id.slice(0,100),from:q.from.slice(0,300),from_agent:q.fromAgent?.slice(0,100)??null,to:q.to.slice(0,300),reply_to:q.replyTo?.slice(0,100)??null,sent_at:z,body:q.body.length>Xq?`${q.body.slice(0,Xq)}
8
+ [cut: the answer was ${q.body.length} characters]`:q.body}}class Zq{network;api;home;signal;log;team;sessions=new Map;readers=new Set;constructor(q,z,X,Y,Z,B){this.network=q;this.api=z;this.home=X;this.signal=Y;this.log=Z;this.team=B}async run(){let q=Date.now()-qq;for(let X of v(this.home).sessions)if(X.usedAt>q)this.read(X);let z=0;while(!this.signal.aborted){let X=await this.network.team().catch(()=>null);if(!X){await D(60000,this.signal);continue}if(X.name!==this.team)return;let Y;try{let Z=await this.api.claimAgentNetworkRelayJob({machine:X.machine,person:X.person,team:X.name,version:g,wait_seconds:N},AbortSignal.any([this.signal,AbortSignal.timeout((N+20)*1000)]));if(z=0,Z.retry_after_seconds)await D(Z.retry_after_seconds*1000,this.signal);Y=Z.job}catch(Z){if(this.signal.aborted)return;let B=zq(Z);if(B===403||B===401){await D(900000,this.signal);continue}if(B===404||B===405){await D(120000,this.signal);continue}z+=1,await D(Math.min(60000,1000*2**Math.min(z,6)),this.signal);continue}if(Y)this.carry(Y)}}async carry(q){let z;try{z=q.kind==="who"?{who:await this.who(q)}:{sent:await this.send(q)}}catch(X){z={error:X instanceof Error?X.message:String(X)}}for(let X=1;;X+=1)try{if(await this.api.completeAgentNetworkRelayJob(q.id,z),q.kind==="send")this.log(`relayed a message to ${q.to} from ${"sent"in z?z.sent.from:q.from_name}`,"relayed");return}catch(Y){if(X>=4||this.signal.aborted){this.log(`couldn't report a relayed call: ${Y instanceof Error?Y.message:String(Y)}`);return}await D(X*1000,this.signal)}}async who(q){let z=q.all===!0,X=await this.network.snapshot({all:z});return{all:z,team:X.team,sessions:X.sessions.map((Y)=>({address:Y.address,person:Y.person,machine:Y.machine,agent:Y.agent,repo:Y.repo,branch:Y.branch,status:Y.status,since:Y.since,doing:Y.doing,worker:Y.worker,...Y.tier?{tier:Y.tier.slice(0,10)}:{}})),machines:X.machines.map((Y)=>({person:Y.person,machine:Y.machine,online:Y.online}))}}async send(q){let z={name:q.from_name,agent:q.from_agent},X=await this.session(z),Y=await X.send(q.to,q.body,q.reply_to,{notify:q.notify===!0});return this.remember(z),this.read(z),{ids:Y.ids,recipients:Y.recipients,from:X.address,deliveries:Y.deliveries.slice(0,500).map(lq)}}session(q){let z=`${q.agent}:${q.name}`,X=this.sessions.get(z);if(!X)X=this.network.session(q.name,{agent:q.agent}).then(async(Y)=>{return await Y.idle(`personal agent (${q.agent}), through Reason`).catch(()=>{}),Y}),X.catch(()=>this.sessions.delete(z)),this.sessions.set(z,X);return X}remember(q){let X=v(this.home).sessions.filter((Y)=>Y.name!==q.name||Y.agent!==q.agent);dq(this.home,{sessions:[...X,{...q,usedAt:Date.now()}].slice(-50)})}read(q){let z=`${q.agent}:${q.name}`;if(this.readers.has(z))return;this.readers.add(z),(async()=>{let X=0;try{while(!this.signal.aborted){let Y=v(this.home).sessions.find((Z)=>Z.name===q.name&&Z.agent===q.agent)?.usedAt??0;if(Date.now()-Y>qq)return;try{let Z=await this.session(q),B=await Z.next(hq);if(B.length===0)continue;await this.api.recordAgentNetworkRelayReplies(B.map(mq)).catch(($)=>{let Q=zq($);if(Q===null||Q>=500||Q===429||Q===401)throw $;this.log(`dropped ${B.length} answer(s) the server refused (HTTP ${Q})`)}),await Z.ack(B.map(($)=>$.id)),X=0}catch{if(this.signal.aborted)return;this.sessions.delete(z),X+=1,await D(Math.min(60000,1000*2**Math.min(X,6)),this.signal)}}}finally{this.readers.delete(z)}})()}}async function cq(q){await new Zq(q.network,q.api,q.home??Yq(),q.signal,q.log??(()=>{}),q.team).run()}async function pq(q,z=()=>{}){let X="";while(!q.aborted){try{let Y=n(),Z=Y?V.openInstalled():null;if(Y&&Z){let[{requireApiCredentials:B},{ReasonApi:$}]=await Promise.all([import("./api-credentials-axffq0pk.js"),import("./api-texm6ayv.js")]),Q=await B({});if(Q.credentialKind!=="api_key"&&Q.orgId.toLowerCase()===Y.orgId.toLowerCase())try{await cq({network:Z,api:new $(Q),team:Y.team,signal:q,log:z})}finally{Z.close()}}X=""}catch(Y){let Z=`agent network relay: ${Y instanceof Error?Y.message:String(Y)}`;if(Z!==X)z(Z);X=Z}await D(300000,q)}}var sq=600000,aq=3600000,iq=180000;async function Tz(q,z,X={}){let Y=-1/0,Z="",B=(L,$q)=>{let I=Date.now();if($q==="relayed"||I-Y<sq||L===Z&&I-Y<aq)return;Y=I,Z=L,z(L)},$=new AbortController,Q=()=>$.abort();q.once("end",Q),q.once("close",Q),q.once("error",Q),q.resume();let W=X.installedVersion??(()=>tq()),K=setInterval(()=>{W().then((L)=>{if(L!==null&&L!==g)$.abort()},()=>{})},X.checkMs??iq);K.unref?.();try{await(X.relay??pq)($.signal,B)}finally{clearInterval(K)}}async function tq(q={}){if(!(q.compiled??Bun.main.startsWith("/$bunfs/")))return null;let z=q.home??Yq(),X=q.env??process.env;if((q.platform??process.platform)==="darwin"){let{currentManagedRuntimeVersion:B,isManagedRuntimeVersionExecutable:$,legacyManagedRuntimePaths:Q,managedRuntimePaths:W}=await import("./managed-runtime-mg7kmckn.js");try{let K=W({platform:"darwin",home:z,environment:X});for(let L of[K,Q(K)])if(L&&$(L))return B(L)}catch{}return null}let{installationReceiptPath:Y,loadInstallationReceipt:Z}=await import("./install-receipt-3s9amwp3.js");return Z(Y(X,z))?.version??null}export{Tz as runDaemonRelay,pq as runBackgroundAskRelay,cq as runAskRelay,tq as installedCliVersion};
@@ -0,0 +1,2 @@
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-kt4831mq.js";import"./vm-hands-entry-lite-5xtkyx25.js";import"./vm-hands-entry-lite-463aheya.js";import"./vm-hands-entry-lite-taw01cp4.js";import"./vm-hands-entry-lite-c0m2jewa.js";import"./vm-hands-entry-lite-qm18wqgz.js";import"./vm-hands-entry-lite-c7krpmd8.js";import"./vm-hands-entry-lite-qbnz4h30.js";import"./vm-hands-entry-lite-22we2jrv.js";import"./vm-hands-entry-lite-gxjxx1r2.js";import"./vm-hands-entry-lite-j05685sg.js";import"./vm-hands-entry-lite-f4gvypnx.js";import"./vm-hands-entry-lite-wry37am5.js";import"./vm-hands-entry-lite-wej1p1ry.js";import"./vm-hands-entry-lite-r5y08n0q.js";import"./vm-hands-entry-lite-n867d88m.js";import"./vm-hands-entry-lite-gzxxsjmr.js";import"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-szfy3kx7.js";import"./vm-hands-entry-lite-07er2w8q.js";import"./vm-hands-entry-lite-9z6k7898.js";import"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-jn95s3j4.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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 +1,2 @@
1
1
  // @bun
2
- import{Ac as n,Bc as o,Cc as p,Dc as q,Ec as r,Fc as s,nc as a,oc as b,pc as c,qc as d,rc as e,sc as f,tc as g,uc as h,vc as i,wc as j,xc as k,yc as l,zc as m}from"./vm-hands-entry-lite-beannz0s.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{s as isCustomEndpointFailureMessage,q as isCustomEndpointDeviceFailureMessage,o as isCustomEndpointDeviceFailureCode,h as customEndpointRequestMatchesConfig,r as customEndpointFailureMessage,p as customEndpointDeviceFailureMessage,i as CustomEndpointDeviceRequestSchema,l as CustomEndpointDeviceReceiptSchema,j as CustomEndpointDeviceHeadersSchema,m as CustomEndpointDeviceCredentialSchema,k as CustomEndpointDeviceChunkSchema,f as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,g as CUSTOM_ENDPOINT_DEVICE_SAFE_HEADERS,c as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,d as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,e as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,n as CUSTOM_ENDPOINT_DEVICE_FAILURE_CODES,b as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,a as CUSTOM_ENDPOINT_DEVICE_CAPABILITY};
2
+ import{$c as a,ad as b,bd as c,cd as d,dd as e,ed as f,fd as g,gd as h,hd as i,id as j,jd as k,kd as l,ld as m,md as n,nd as o,od as p,pd as q,qd as r,rd as s}from"./vm-hands-entry-lite-r5y08n0q.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{s as isCustomEndpointFailureMessage,q as isCustomEndpointDeviceFailureMessage,o as isCustomEndpointDeviceFailureCode,h as customEndpointRequestMatchesConfig,r as customEndpointFailureMessage,p as customEndpointDeviceFailureMessage,i as CustomEndpointDeviceRequestSchema,l as CustomEndpointDeviceReceiptSchema,j as CustomEndpointDeviceHeadersSchema,m as CustomEndpointDeviceCredentialSchema,k as CustomEndpointDeviceChunkSchema,f as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,g as CUSTOM_ENDPOINT_DEVICE_SAFE_HEADERS,c as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,d as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,e as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,n as CUSTOM_ENDPOINT_DEVICE_FAILURE_CODES,b as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,a as CUSTOM_ENDPOINT_DEVICE_CAPABILITY};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ag as a,Bg as b,Cg as c,Dg as d,Eg as e}from"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{b as passwdAccount,e as desktopHome,d as desktopAccount,c as configureDesktopAccount,a as DESKTOP_USER_ENV};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$h as m,Ph as a,Qh as b,Rh as c,Sh as d,Th as e,Uh as f,Vh as g,Wh as h,Xh as i,Yh as j,Zh as k,_h as l,ai as n,bi as o,ci as p,di as q,ei as r,fi as s,gi as t,hi as u}from"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{j as parseDeviceWorkspace,g as isSessionWorktreePath,h as isDeviceWorkspacePath,i as deviceWorkspaceRootRelative,t as computeWorkerWorkspace,s as cloudSessionRootLayout,u as cloudSessionLayoutOfRoot,r as cloudSessionLayout,n as SIDECHAT_WORKSPACE_ID,f as SESSION_WORKTREE_ID,e as SESSION_WORKTREES,c as SESSION_WORKSPACE_LAYOUT,a as REASON_WORKSPACE_BASE,d as HANDS_WORKSPACE_LAYOUT_KEY,b as HANDS_WORKSPACE_BASE_KEY,q as CLOUD_SESSION_ROOT_SHELL_PATTERNS,p as CLOUD_SESSION_ROOT,m as CLOUD_SESSION_CONTROL_BASE,o as CLOUD_REPOSITORY_WORKSPACE_ID,l as CLOUD_PAYLOAD_UID,k as CLOUD_PAYLOAD_HOME};
2
+ import{$i as f,Wi as a,Xi as b,Yi as c,Zi as d,_i as e,aj as g,bj as h,cj as i,dj as j,ej as k,fj as l,gj as m,hj as n,ij as o,jj as p,kj as q,lj as r,mj as s,nj as t,oj as u}from"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{j as parseDeviceWorkspace,g as isSessionWorktreePath,h as isDeviceWorkspacePath,i as deviceWorkspaceRootRelative,t as computeWorkerWorkspace,s as cloudSessionRootLayout,u as cloudSessionLayoutOfRoot,r as cloudSessionLayout,n as SIDECHAT_WORKSPACE_ID,f as SESSION_WORKTREE_ID,e as SESSION_WORKTREES,c as SESSION_WORKSPACE_LAYOUT,a as REASON_WORKSPACE_BASE,d as HANDS_WORKSPACE_LAYOUT_KEY,b as HANDS_WORKSPACE_BASE_KEY,q as CLOUD_SESSION_ROOT_SHELL_PATTERNS,p as CLOUD_SESSION_ROOT,m as CLOUD_SESSION_CONTROL_BASE,o as CLOUD_REPOSITORY_WORKSPACE_ID,l as CLOUD_PAYLOAD_UID,k as CLOUD_PAYLOAD_HOME};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jc as a,Kc as b,Lc as c,Mc as d,Nc as e,Oc as f,Pc as g,Qc as h,Rc as i}from"./vm-hands-entry-lite-j05685sg.js";import"./vm-hands-entry-lite-f4gvypnx.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-h2xemq1f.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,5 +1,5 @@
1
1
  // @bun
2
- import{Q as iJ0}from"./vm-hands-entry-lite-dys7am1h.js";import{ri as NV0,si as rn,ti as EJ,vi as an,wi as X0}from"./vm-hands-entry-lite-nd1k2jz9.js";var on={};var $T;var WT=an(()=>{$T=Error("Cannot find module 'fsevents'");$T.code="MODULE_NOT_FOUND";throw $T});var f0=EJ((EU0,X_)=>{var __dirname="/Users/runner/work/monorepo/monorepo/production/node_modules/.bun/playwright-core@1.60.0/node_modules/playwright-core/lib",tn=Object.create,H5=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,Qj=Object.getOwnPropertyNames,en=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty,e=(Q,Y)=>function(){return Y||(0,Q[Qj(Q)[0]])((Y={exports:{}}).exports,Y),Y.exports},eQ=(Q,Y)=>{for(var X in Y)H5(Q,X,{get:Y[X],enumerable:!0})},Yj=(Q,Y,X,J)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(let G of Qj(Y))if(!Qi.call(Q,G)&&G!==X)H5(Q,G,{get:()=>Y[G],enumerable:!(J=sn(Y,G))||J.enumerable})}return Q},j1=(Q,Y,X)=>(X=Q!=null?tn(en(Q)):{},Yj(Y||!Q||!Q.__esModule?H5(X,"default",{value:Q,enumerable:!0}):X,Q)),Yi=(Q)=>Yj(H5({},"__esModule",{value:!0}),Q),Xi=e({"node_modules/colors/lib/styles.js"(Q,Y){var X={};Y.exports=X;var J={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(J).forEach(function(G){var Z=J[G],$=X[G]=[];$.open="\x1B["+Z[0]+"m",$.close="\x1B["+Z[1]+"m"})}}),Ji=e({"node_modules/colors/lib/system/has-flag.js"(Q,Y){Y.exports=function(X,J){J=J||process.argv;var G=J.indexOf("--"),Z=/^-{1,2}/.test(X)?"":"--",$=J.indexOf(Z+X);return $!==-1&&(G===-1?!0:$<G)}}}),Gi=e({"node_modules/colors/lib/system/supports-colors.js"(Q,Y){var X=X0("os"),J=Ji(),G=process.env,Z=void 0;if(J("no-color")||J("no-colors")||J("color=false"))Z=!1;else if(J("color")||J("colors")||J("color=true")||J("color=always"))Z=!0;if("FORCE_COLOR"in G)Z=G.FORCE_COLOR.length===0||parseInt(G.FORCE_COLOR,10)!==0;function $(H){if(H===0)return!1;return{level:H,hasBasic:!0,has256:H>=2,has16m:H>=3}}function W(H){if(Z===!1)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(H&&!H.isTTY&&Z!==!0)return 0;var B=Z?1:0;if(process.platform==="win32"){var V=X.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(V[0])>=10&&Number(V[2])>=10586)return Number(V[2])>=14931?3:2;return 1}if("CI"in G){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(M){return M in G})||G.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in G){var U=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(G.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM))return 1;if("COLORTERM"in G)return 1;if(G.TERM==="dumb")return B;return B}function K(H){var B=W(H);return $(B)}Y.exports={supportsColor:K,stdout:K(process.stdout),stderr:K(process.stderr)}}}),Zi=e({"node_modules/colors/lib/custom/trap.js"(Q,Y){Y.exports=function(J,G){var Z="";J=J||"Run the trap, drop the bass",J=J.split("");var $={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return J.forEach(function(W){W=W.toLowerCase();var K=$[W]||[" "],H=Math.floor(Math.random()*K.length);if(typeof $[W]<"u")Z+=$[W][H];else Z+=W}),Z}}}),$i=e({"node_modules/colors/lib/custom/zalgo.js"(Q,Y){Y.exports=function(J,G){J=J||" he is here ";var Z={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},$=[].concat(Z.up,Z.down,Z.mid);function W(B){var V=Math.floor(Math.random()*B);return V}function K(B){var V=!1;return $.filter(function(U){V=U===B}),V}function H(B,V){var U="",M,L;V=V||{},V.up=typeof V.up<"u"?V.up:!0,V.mid=typeof V.mid<"u"?V.mid:!0,V.down=typeof V.down<"u"?V.down:!0,V.size=typeof V.size<"u"?V.size:"maxi",B=B.split("");for(L in B){if(K(L))continue;switch(U=U+B[L],M={up:0,down:0,mid:0},V.size){case"mini":M.up=W(8),M.mid=W(2),M.down=W(8);break;case"maxi":M.up=W(16)+3,M.mid=W(4)+1,M.down=W(64)+3;break;default:M.up=W(8)+1,M.mid=W(6)/2,M.down=W(8)+1;break}var F=["up","mid","down"];for(var z in F){var N=F[z];for(var A=0;A<=M[N];A++)if(V[N])U=U+Z[N][W(Z[N].length)]}}return U}return H(J,G)}}}),Wi=e({"node_modules/colors/lib/maps/america.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){if(J===" ")return J;switch(G%3){case 0:return X.red(J);case 1:return X.white(J);case 2:return X.blue(J)}}}}}),Ki=e({"node_modules/colors/lib/maps/zebra.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){return G%2===0?J:X.inverse(J)}}}}),Hi=e({"node_modules/colors/lib/maps/rainbow.js"(Q,Y){Y.exports=function(X){var J=["red","yellow","green","blue","magenta"];return function(G,Z,$){if(G===" ")return G;else return X[J[Z++%J.length]](G)}}}}),Bi=e({"node_modules/colors/lib/maps/random.js"(Q,Y){Y.exports=function(X){var J=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(G,Z,$){return G===" "?G:X[J[Math.round(Math.random()*(J.length-2))]](G)}}}}),Vi=e({"node_modules/colors/lib/colors.js"(Q,Y){var X={};Y.exports=X,X.themes={};var J=X0("util"),G=X.styles=Xi(),Z=Object.defineProperties,$=new RegExp(/[\r\n]+/g);if(X.supportsColor=Gi().supportsColor,typeof X.enabled>"u")X.enabled=X.supportsColor()!==!1;X.enable=function(){X.enabled=!0},X.disable=function(){X.enabled=!1},X.stripColors=X.strip=function(N){return(""+N).replace(/\x1B\[\d+m/g,"")};var W=X.stylize=function(A,R){if(!X.enabled)return A+"";var q=G[R];if(!q&&R in X)return X[R](A);return q.open+A+q.close},K=/[|\\{}()[\]^$+*?.]/g,H=function(N){if(typeof N!=="string")throw TypeError("Expected a string");return N.replace(K,"\\$&")};function B(N){var A=function R(){return M.apply(R,arguments)};return A._styles=N,A.__proto__=U,A}var V=function(){var N={};return G.grey=G.gray,Object.keys(G).forEach(function(A){G[A].closeRe=new RegExp(H(G[A].close),"g"),N[A]={get:function(){return B(this._styles.concat(A))}}}),N}(),U=Z(function(){},V);function M(){var N=Array.prototype.slice.call(arguments),A=N.map(function(D){if(D!=null&&D.constructor===String)return D;else return J.inspect(D)}).join(" ");if(!X.enabled||!A)return A;var R=A.indexOf(`
2
+ import{Aa as iJ0}from"./vm-hands-entry-lite-d2hbz0r4.js";import{$j as an,Xj as NV0,Yj as rn,Zj as EJ,ak as X0}from"./vm-hands-entry-lite-h2xemq1f.js";var on={};var $T;var WT=an(()=>{$T=Error("Cannot find module 'fsevents'");$T.code="MODULE_NOT_FOUND";throw $T});var f0=EJ((EU0,X_)=>{var __dirname="/Users/runner/work/monorepo/monorepo/production/node_modules/.bun/playwright-core@1.60.0/node_modules/playwright-core/lib",tn=Object.create,H5=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,Qj=Object.getOwnPropertyNames,en=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty,e=(Q,Y)=>function(){return Y||(0,Q[Qj(Q)[0]])((Y={exports:{}}).exports,Y),Y.exports},eQ=(Q,Y)=>{for(var X in Y)H5(Q,X,{get:Y[X],enumerable:!0})},Yj=(Q,Y,X,J)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(let G of Qj(Y))if(!Qi.call(Q,G)&&G!==X)H5(Q,G,{get:()=>Y[G],enumerable:!(J=sn(Y,G))||J.enumerable})}return Q},j1=(Q,Y,X)=>(X=Q!=null?tn(en(Q)):{},Yj(Y||!Q||!Q.__esModule?H5(X,"default",{value:Q,enumerable:!0}):X,Q)),Yi=(Q)=>Yj(H5({},"__esModule",{value:!0}),Q),Xi=e({"node_modules/colors/lib/styles.js"(Q,Y){var X={};Y.exports=X;var J={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(J).forEach(function(G){var Z=J[G],$=X[G]=[];$.open="\x1B["+Z[0]+"m",$.close="\x1B["+Z[1]+"m"})}}),Ji=e({"node_modules/colors/lib/system/has-flag.js"(Q,Y){Y.exports=function(X,J){J=J||process.argv;var G=J.indexOf("--"),Z=/^-{1,2}/.test(X)?"":"--",$=J.indexOf(Z+X);return $!==-1&&(G===-1?!0:$<G)}}}),Gi=e({"node_modules/colors/lib/system/supports-colors.js"(Q,Y){var X=X0("os"),J=Ji(),G=process.env,Z=void 0;if(J("no-color")||J("no-colors")||J("color=false"))Z=!1;else if(J("color")||J("colors")||J("color=true")||J("color=always"))Z=!0;if("FORCE_COLOR"in G)Z=G.FORCE_COLOR.length===0||parseInt(G.FORCE_COLOR,10)!==0;function $(H){if(H===0)return!1;return{level:H,hasBasic:!0,has256:H>=2,has16m:H>=3}}function W(H){if(Z===!1)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(H&&!H.isTTY&&Z!==!0)return 0;var B=Z?1:0;if(process.platform==="win32"){var V=X.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(V[0])>=10&&Number(V[2])>=10586)return Number(V[2])>=14931?3:2;return 1}if("CI"in G){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(M){return M in G})||G.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in G){var U=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(G.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM))return 1;if("COLORTERM"in G)return 1;if(G.TERM==="dumb")return B;return B}function K(H){var B=W(H);return $(B)}Y.exports={supportsColor:K,stdout:K(process.stdout),stderr:K(process.stderr)}}}),Zi=e({"node_modules/colors/lib/custom/trap.js"(Q,Y){Y.exports=function(J,G){var Z="";J=J||"Run the trap, drop the bass",J=J.split("");var $={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return J.forEach(function(W){W=W.toLowerCase();var K=$[W]||[" "],H=Math.floor(Math.random()*K.length);if(typeof $[W]<"u")Z+=$[W][H];else Z+=W}),Z}}}),$i=e({"node_modules/colors/lib/custom/zalgo.js"(Q,Y){Y.exports=function(J,G){J=J||" he is here ";var Z={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},$=[].concat(Z.up,Z.down,Z.mid);function W(B){var V=Math.floor(Math.random()*B);return V}function K(B){var V=!1;return $.filter(function(U){V=U===B}),V}function H(B,V){var U="",M,L;V=V||{},V.up=typeof V.up<"u"?V.up:!0,V.mid=typeof V.mid<"u"?V.mid:!0,V.down=typeof V.down<"u"?V.down:!0,V.size=typeof V.size<"u"?V.size:"maxi",B=B.split("");for(L in B){if(K(L))continue;switch(U=U+B[L],M={up:0,down:0,mid:0},V.size){case"mini":M.up=W(8),M.mid=W(2),M.down=W(8);break;case"maxi":M.up=W(16)+3,M.mid=W(4)+1,M.down=W(64)+3;break;default:M.up=W(8)+1,M.mid=W(6)/2,M.down=W(8)+1;break}var F=["up","mid","down"];for(var z in F){var N=F[z];for(var A=0;A<=M[N];A++)if(V[N])U=U+Z[N][W(Z[N].length)]}}return U}return H(J,G)}}}),Wi=e({"node_modules/colors/lib/maps/america.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){if(J===" ")return J;switch(G%3){case 0:return X.red(J);case 1:return X.white(J);case 2:return X.blue(J)}}}}}),Ki=e({"node_modules/colors/lib/maps/zebra.js"(Q,Y){Y.exports=function(X){return function(J,G,Z){return G%2===0?J:X.inverse(J)}}}}),Hi=e({"node_modules/colors/lib/maps/rainbow.js"(Q,Y){Y.exports=function(X){var J=["red","yellow","green","blue","magenta"];return function(G,Z,$){if(G===" ")return G;else return X[J[Z++%J.length]](G)}}}}),Bi=e({"node_modules/colors/lib/maps/random.js"(Q,Y){Y.exports=function(X){var J=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(G,Z,$){return G===" "?G:X[J[Math.round(Math.random()*(J.length-2))]](G)}}}}),Vi=e({"node_modules/colors/lib/colors.js"(Q,Y){var X={};Y.exports=X,X.themes={};var J=X0("util"),G=X.styles=Xi(),Z=Object.defineProperties,$=new RegExp(/[\r\n]+/g);if(X.supportsColor=Gi().supportsColor,typeof X.enabled>"u")X.enabled=X.supportsColor()!==!1;X.enable=function(){X.enabled=!0},X.disable=function(){X.enabled=!1},X.stripColors=X.strip=function(N){return(""+N).replace(/\x1B\[\d+m/g,"")};var W=X.stylize=function(A,R){if(!X.enabled)return A+"";var q=G[R];if(!q&&R in X)return X[R](A);return q.open+A+q.close},K=/[|\\{}()[\]^$+*?.]/g,H=function(N){if(typeof N!=="string")throw TypeError("Expected a string");return N.replace(K,"\\$&")};function B(N){var A=function R(){return M.apply(R,arguments)};return A._styles=N,A.__proto__=U,A}var V=function(){var N={};return G.grey=G.gray,Object.keys(G).forEach(function(A){G[A].closeRe=new RegExp(H(G[A].close),"g"),N[A]={get:function(){return B(this._styles.concat(A))}}}),N}(),U=Z(function(){},V);function M(){var N=Array.prototype.slice.call(arguments),A=N.map(function(D){if(D!=null&&D.constructor===String)return D;else return J.inspect(D)}).join(" ");if(!X.enabled||!A)return A;var R=A.indexOf(`
3
3
  `)!=-1,q=this._styles,O=q.length;while(O--){var E=G[q[O]];if(A=E.open+A.replace(E.closeRe,E.open)+E.close,R)A=A.replace($,function(D){return E.close+D+E.open})}return A}X.setTheme=function(N){if(typeof N==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var A in N)(function(R){X[R]=function(q){if(typeof N[R]==="object"){var O=q;for(var E in N[R])O=X[N[R][E]](O);return O}return X[N[R]](q)}})(A)};function L(){var N={};return Object.keys(V).forEach(function(A){N[A]={get:function(){return B([A])}}}),N}var F=function(A,R){var q=R.split("");return q=q.map(A),q.join("")};X.trap=Zi(),X.zalgo=$i(),X.maps={},X.maps.america=Wi()(X),X.maps.zebra=Ki()(X),X.maps.rainbow=Hi()(X),X.maps.random=Bi()(X);for(z in X.maps)(function(N){X[N]=function(A){return F(X.maps[N],A)}})(z);var z;Z(X,L())}}),Ui=e({"node_modules/colors/safe.js"(Q,Y){var X=Vi();Y.exports=X}}),Mi=e({"node_modules/ms/index.js"(Q,Y){var X=1000,J=X*60,G=J*60,Z=G*24,$=Z*7,W=Z*365.25;Y.exports=function(U,M){M=M||{};var L=typeof U;if(L==="string"&&U.length>0)return K(U);else if(L==="number"&&isFinite(U))return M.long?B(U):H(U);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(U))};function K(U){if(U=String(U),U.length>100)return;var M=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(U);if(!M)return;var L=parseFloat(M[1]),F=(M[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return L*W;case"weeks":case"week":case"w":return L*$;case"days":case"day":case"d":return L*Z;case"hours":case"hour":case"hrs":case"hr":case"h":return L*G;case"minutes":case"minute":case"mins":case"min":case"m":return L*J;case"seconds":case"second":case"secs":case"sec":case"s":return L*X;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return L;default:return}}function H(U){var M=Math.abs(U);if(M>=Z)return Math.round(U/Z)+"d";if(M>=G)return Math.round(U/G)+"h";if(M>=J)return Math.round(U/J)+"m";if(M>=X)return Math.round(U/X)+"s";return U+"ms"}function B(U){var M=Math.abs(U);if(M>=Z)return V(U,M,Z,"day");if(M>=G)return V(U,M,G,"hour");if(M>=J)return V(U,M,J,"minute");if(M>=X)return V(U,M,X,"second");return U+" ms"}function V(U,M,L,F){var z=M>=L*1.5;return Math.round(U/L)+" "+F+(z?"s":"")}}}),Xj=e({"node_modules/debug/src/common.js"(Q,Y){function X(J){Z.debug=Z,Z.default=Z,Z.coerce=V,Z.disable=H,Z.enable=W,Z.enabled=B,Z.humanize=Mi(),Z.destroy=U,Object.keys(J).forEach((M)=>{Z[M]=J[M]}),Z.names=[],Z.skips=[],Z.formatters={};function G(M){let L=0;for(let F=0;F<M.length;F++)L=(L<<5)-L+M.charCodeAt(F),L|=0;return Z.colors[Math.abs(L)%Z.colors.length]}Z.selectColor=G;function Z(M){let L,F=null,z,N;function A(...R){if(!A.enabled)return;let q=A,O=Number(new Date),E=O-(L||O);if(q.diff=E,q.prev=L,q.curr=O,L=O,R[0]=Z.coerce(R[0]),typeof R[0]!=="string")R.unshift("%O");let D=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(I,P)=>{if(I==="%%")return"%";D++;let C=Z.formatters[P];if(typeof C==="function"){let b=R[D];I=C.call(q,b),R.splice(D,1),D--}return I}),Z.formatArgs.call(q,R),(q.log||Z.log).apply(q,R)}if(A.namespace=M,A.useColors=Z.useColors(),A.color=Z.selectColor(M),A.extend=$,A.destroy=Z.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(F!==null)return F;if(z!==Z.namespaces)z=Z.namespaces,N=Z.enabled(M);return N},set:(R)=>{F=R}}),typeof Z.init==="function")Z.init(A);return A}function $(M,L){let F=Z(this.namespace+(typeof L>"u"?":":L)+M);return F.log=this.log,F}function W(M){Z.save(M),Z.namespaces=M,Z.names=[],Z.skips=[];let L=(typeof M==="string"?M:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let F of L)if(F[0]==="-")Z.skips.push(F.slice(1));else Z.names.push(F)}function K(M,L){let F=0,z=0,N=-1,A=0;while(F<M.length)if(z<L.length&&(L[z]===M[F]||L[z]==="*"))if(L[z]==="*")N=z,A=F,z++;else F++,z++;else if(N!==-1)z=N+1,A++,F=A;else return!1;while(z<L.length&&L[z]==="*")z++;return z===L.length}function H(){let M=[...Z.names,...Z.skips.map((L)=>"-"+L)].join(",");return Z.enable(""),M}function B(M){for(let L of Z.skips)if(K(M,L))return!1;for(let L of Z.names)if(K(M,L))return!0;return!1}function V(M){if(M instanceof Error)return M.stack||M.message;return M}function U(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return Z.enable(Z.load()),Z}Y.exports=X}}),Li=e({"node_modules/debug/src/browser.js"(Q,Y){Q.formatArgs=J,Q.save=G,Q.load=Z,Q.useColors=X,Q.storage=$(),Q.destroy=(()=>{let K=!1;return()=>{if(!K)K=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})(),Q.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function X(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let K;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(K=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(K[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function J(K){if(K[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+K[0]+(this.useColors?"%c ":" ")+"+"+Y.exports.humanize(this.diff),!this.useColors)return;let H="color: "+this.color;K.splice(1,0,H,"color: inherit");let B=0,V=0;K[0].replace(/%[a-zA-Z%]/g,(U)=>{if(U==="%%")return;if(B++,U==="%c")V=B}),K.splice(V,0,H)}Q.log=console.debug||console.log||(()=>{});function G(K){try{if(K)Q.storage.setItem("debug",K);else Q.storage.removeItem("debug")}catch(H){}}function Z(){let K;try{K=Q.storage.getItem("debug")||Q.storage.getItem("DEBUG")}catch(H){}if(!K&&typeof process<"u"&&"env"in process)K=process.env.DEBUG;return K}function $(){try{return localStorage}catch(K){}}Y.exports=Xj()(Q);var{formatters:W}=Y.exports;W.j=function(K){try{return JSON.stringify(K)}catch(H){return"[UnexpectedJSONParseError]: "+H.message}}}}),Ai=e({"node_modules/has-flag/index.js"(Q,Y){Y.exports=(X,J=process.argv)=>{let G=X.startsWith("-")?"":X.length===1?"-":"--",Z=J.indexOf(G+X),$=J.indexOf("--");return Z!==-1&&($===-1||Z<$)}}}),Ni=e({"node_modules/supports-color/index.js"(Q,Y){var X=X0("os"),J=X0("tty"),G=Ai(),{env:Z}=process,$;if(G("no-color")||G("no-colors")||G("color=false")||G("color=never"))$=0;else if(G("color")||G("colors")||G("color=true")||G("color=always"))$=1;function W(){if("FORCE_COLOR"in Z){if(Z.FORCE_COLOR==="true")return 1;if(Z.FORCE_COLOR==="false")return 0;return Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}}function K(V){if(V===0)return!1;return{level:V,hasBasic:!0,has256:V>=2,has16m:V>=3}}function H(V,{streamIsTTY:U,sniffFlags:M=!0}={}){let L=W();if(L!==void 0)$=L;let F=M?$:L;if(F===0)return 0;if(M){if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2}if(V&&!U&&F===void 0)return 0;let z=F||0;if(Z.TERM==="dumb")return z;if(process.platform==="win32"){let N=X.release().split(".");if(Number(N[0])>=10&&Number(N[2])>=10586)return Number(N[2])>=14931?3:2;return 1}if("CI"in Z){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((N)=>(N in Z))||Z.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Z){let N=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return N>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Z.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM))return 1;if("COLORTERM"in Z)return 1;return z}function B(V,U={}){let M=H(V,{streamIsTTY:V&&V.isTTY,...U});return K(M)}Y.exports={supportsColor:B,stdout:B({isTTY:J.isatty(1)}),stderr:B({isTTY:J.isatty(2)})}}}),Fi=e({"node_modules/debug/src/node.js"(Q,Y){var X=X0("tty"),J=X0("util");Q.init=B,Q.log=W,Q.formatArgs=Z,Q.save=K,Q.load=H,Q.useColors=G,Q.destroy=J.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),Q.colors=[6,2,3,4,5,1];try{let U=Ni();if(U&&(U.stderr||U).level>=2)Q.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(U){}Q.inspectOpts=Object.keys(process.env).filter((U)=>{return/^debug_/i.test(U)}).reduce((U,M)=>{let L=M.substring(6).toLowerCase().replace(/_([a-z])/g,(z,N)=>{return N.toUpperCase()}),F=process.env[M];if(/^(yes|on|true|enabled)$/i.test(F))F=!0;else if(/^(no|off|false|disabled)$/i.test(F))F=!1;else if(F==="null")F=null;else F=Number(F);return U[L]=F,U},{});function G(){return"colors"in Q.inspectOpts?Boolean(Q.inspectOpts.colors):X.isatty(process.stderr.fd)}function Z(U){let{namespace:M,useColors:L}=this;if(L){let F=this.color,z="\x1B[3"+(F<8?F:"8;5;"+F),N=` ${z};1m${M} \x1B[0m`;U[0]=N+U[0].split(`
4
4
  `).join(`
5
5
  `+N),U.push(z+"m+"+Y.exports.humanize(this.diff)+"\x1B[0m")}else U[0]=$()+M+" "+U[0]}function $(){if(Q.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function W(...U){return process.stderr.write(J.formatWithOptions(Q.inspectOpts,...U)+`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$d as e,Xd as a,Yd as b,Zd as c,_d as d,ae as f,be as g,ce as h,de as i,ee as j,fe as k,ge as l,he as m,ie as n,je as o,ke as p,le as q,me as r}from"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{r as runInstallReceiptCli,q as recordInstallationReceipt,k as pathEntryAddedByInstaller,l as parseInstallationReceipt,m as loadInstallationReceipt,j as installerReasonAlias,h as installationReceiptPath,g as installationConfigHome,i as installationAliasMatchesTarget,n as hasInstallationDeviceConsent,o as authorizeInstallationForFutureDevice,p as authorizeDesktopInstallationForFutureDevice,a as INSTALLATION_RECEIPT_SCHEMA_VERSION,b as INSTALLATION_DEVICE_CONSENT_VERSION,f as INSTALLATION_BACKGROUND_MODES,e as FUTURE_DEVICE_CONSENT_SCOPE,c as DESKTOP_ACCOUNT_ACCESS_VERSION,d as DESKTOP_ACCOUNT_ACCESS_SCOPE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ad as h,Bd as i,Cd as j,Dd as k,Ed as l,td as a,ud as b,vd as c,wd as d,xd as e,yd as f,zd as g}from"./vm-hands-entry-lite-n867d88m.js";import"./vm-hands-entry-lite-gzxxsjmr.js";import"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-szfy3kx7.js";import"./vm-hands-entry-lite-07er2w8q.js";import"./vm-hands-entry-lite-9z6k7898.js";import"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-jn95s3j4.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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};
@@ -0,0 +1,2 @@
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}from"./vm-hands-entry-lite-c7krpmd8.js";import"./vm-hands-entry-lite-qbnz4h30.js";import"./vm-hands-entry-lite-22we2jrv.js";import"./vm-hands-entry-lite-gxjxx1r2.js";import"./vm-hands-entry-lite-j05685sg.js";import{Wc as b}from"./vm-hands-entry-lite-f4gvypnx.js";import"./vm-hands-entry-lite-wry37am5.js";import"./vm-hands-entry-lite-wej1p1ry.js";import"./vm-hands-entry-lite-r5y08n0q.js";import"./vm-hands-entry-lite-n867d88m.js";import"./vm-hands-entry-lite-gzxxsjmr.js";import"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-szfy3kx7.js";import"./vm-hands-entry-lite-07er2w8q.js";import"./vm-hands-entry-lite-9z6k7898.js";import"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-jn95s3j4.js";import{Wj as a}from"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{g as spawnCaptured,f as sandboxProfile,e as safeEnvironment,j as runTransferCapability,i as runFileCapability,s as rebindLocalHandsControl,b as isProtectedLocalPath,t as executeLocalOperation,l as enrolledWorkspaceRootFingerprint,p as enrolledRootPaths,o as enrolledHomeContainedRootFingerprints,m as enrolledAccountRootPath,n as enrolledAccountRootFingerprint,r as deliverLocalHandsEnvironment,h as defaultLocalCommandRunner,d as confinedExecutionShell,q as capabilityInventoryForRoots,c as SHORT_REQUEST_CAPABILITIES,a as LocalCapabilityError,k as LOCAL_CAPABILITY_REGISTRY};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pj as a,Qj as b,Rj as c,Sj as d,Tj as e,Uj as f,Vj as g}from"./vm-hands-entry-lite-jn95s3j4.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hj as a,Ij as b,Jj as c,Kj as d,Lj as e,Mj as f,Nj as g}from"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{c as requestMacScreenAccess,d as parseMacWindowBounds,a as parseMacScreenStatus,e as openMacWindowBounds,g as openMacInput,b as macScreenStatus,f as MacInputTranslator};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Tf as a,Uf as b,Vf as c,Wf as d,Xf as e,Yf as f,Zf as g,_f as h}from"./vm-hands-entry-lite-07er2w8q.js";import"./vm-hands-entry-lite-9z6k7898.js";import"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-jn95s3j4.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$f as a,ag as b,bg as c,cg as d,dg as e,eg as f,fg as g,gg as h,hg as i,ig as j}from"./vm-hands-entry-lite-9z6k7898.js";import"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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};
@@ -0,0 +1,2 @@
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-c0m2jewa.js";import"./vm-hands-entry-lite-wej1p1ry.js";import{Ih as a,Jh as b,Kh as c,Lh as d,Mh as e,Nh as f,Oh as g,Ph as h,Rh as i,Sh as j,Uh as k,Vh as l,Wh as m}from"./vm-hands-entry-lite-kxdw4myj.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-h2xemq1f.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 +1,2 @@
1
1
  // @bun
2
- import{$d as K,Ad as j,Bd as k,Cd as l,Dd as m,Ed as n,Fd as o,Gd as p,Hd as q,Id as r,Jd as s,Kd as t,Ld as u,Md as v,Nd as w,Od as x,Pd as y,Qd as z,Rd as A,Sd as B,Td as C,Ud as D,Vd as E,Wd as F,Xd as G,Yd as H,Zd as I,_d as J,ae as L,be as M,ce as N,de as O,ee as P,fe as Q,ge as R,he as S,ie as T,je as U,ke as V,le as W,me as X,ne as Y,oe as Z,pe as _,qe as $,rd as a,re as aa,sd as b,se as ba,td as c,te as ca,ud as d,ue as da,vd as e,ve as ea,wd as f,we as fa,xd as g,xe as ga,yd as h,ye as ha,zd as i,ze as ia}from"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{$ as parseLocalRuntimeRootsSyncResponse,X as parseLocalRuntimeRegistrationResponse,W as parseLocalRuntimeProofChallenge,fa as parseLocalRuntimeOperationHeartbeatResponse,ga as parseLocalRuntimeOperationEventsResponse,ha as parseLocalRuntimeOperationEnvironmentResponse,ia as parseLocalRuntimeOperationCompletionResponse,ea as parseLocalRuntimeOperationClaim,ca as parseLocalRuntimeLocalSubscriptionResponse,da as parseLocalRuntimeLifecycleResponse,aa as parseLocalRuntimeIdentityResponse,Z as parseLocalRuntimeHeartbeatResponse,_ as parseLocalRuntimeFirstHeartbeat,V as parseLocalRuntimeErrorEnvelope,Y as parseLocalRuntimeEnrollmentResponse,ba as parseLocalRuntimeDisconnectResponse,j as localRuntimeSessionRoutable,U as buildLocalRuntimeDeviceProofBytes,P as WORKER_STARTUP_TIMING_STAGES,K as WORKER_PREVIEW_CARRIED_JOBS,e as RELAY_HOST_ALIAS_VERSION,d as RELAY_HOST_ALIAS_HEADER,Q as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,k as LOCAL_RUNTIME_SESSION_VM_HANDS_REGISTER,h as LOCAL_RUNTIME_SESSION_PRE_AUTH_MAX_BYTES,g as LOCAL_RUNTIME_SESSION_PATH,m as LOCAL_RUNTIME_SESSION_CLOSE,l as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,i as LOCAL_RUNTIME_SESSION_AUTH_DEADLINE_MS,b as LOCAL_RUNTIME_ROUTE_PREFIX,f as LOCAL_RUNTIME_ROUTES,a as LOCAL_RUNTIME_PROTOCOL_VERSION,R as LOCAL_RUNTIME_LIFECYCLE_EVENTS,T as LOCAL_RUNTIME_LEGACY_DEVICE_PROOF_TAG,S as LOCAL_RUNTIME_DEVICE_PROOF_TAG,c as LOCAL_OPERATION_MAX_BYTES,M as JOBS_START_WAIT_KEY,L as JOBS_START_WAIT,H as HANDS_SESSION_GROUP_KEY,G as HANDS_SESSION_GROUP,J as HANDS_SESSION_CAP_NONE,I as HANDS_SESSION_CAP_KEY,s as HANDS_REBIND_KEY,t as HANDS_REBIND_CONTROL,r as HANDS_REBIND,D as HANDS_MODEL_JOBS_EGRESS_KEY,C as HANDS_MODEL_JOBS_EGRESS,z as HANDS_LARGE_ENVIRONMENT_KEY,y as HANDS_LARGE_ENVIRONMENT,F as HANDS_JOBS_USER_KEY,E as HANDS_JOBS_USER,x as HANDS_HEADLESS_BROWSER_KEY,w as HANDS_HEADLESS_BROWSER,o as HANDS_ENVIRONMENT_DELIVER_CONTROL,n as HANDS_ENVIRONMENT_DELIVERY,q as HANDS_ENVIRONMENT_AT_CLAIM_KEY,p as HANDS_ENVIRONMENT_AT_CLAIM,B as HANDS_CONFINEMENT_KEY,A as HANDS_CONFINEMENT,v as HANDS_CLOUD_ACCESS_KEY,u as HANDS_CLOUD_ACCESS,N as AUTOMATION_USER_CHROME,O as AUTOMATION_CLOUD_SESSIONS};
2
+ import{$e as E,Ae as d,Af as da,Be as e,Bf as ea,Ce as f,Cf as fa,De as g,Df as ga,Ee as h,Ef as ha,Fe as i,Ff as ia,Ge as j,He as k,Ie as l,Je as m,Ke as n,Le as o,Me as p,Ne as q,Oe as r,Pe as s,Qe as t,Re as u,Se as v,Te as w,Ue as x,Ve as y,We as z,Xe as A,Ye as B,Ze as C,_e as D,af as F,bf as G,cf as H,df as I,ef as J,ff as K,gf as L,hf as M,if as N,jf as O,kf as P,lf as Q,mf as R,nf as S,of as T,pf as U,qf as V,rf as W,sf as X,tf as Y,uf as Z,vf as _,wf as $,xe as a,xf as aa,ye as b,yf as ba,ze as c,zf as ca}from"./vm-hands-entry-lite-szfy3kx7.js";import"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{$ as parseLocalRuntimeRootsSyncResponse,X as parseLocalRuntimeRegistrationResponse,W as parseLocalRuntimeProofChallenge,fa as parseLocalRuntimeOperationHeartbeatResponse,ga as parseLocalRuntimeOperationEventsResponse,ha as parseLocalRuntimeOperationEnvironmentResponse,ia as parseLocalRuntimeOperationCompletionResponse,ea as parseLocalRuntimeOperationClaim,ca as parseLocalRuntimeLocalSubscriptionResponse,da as parseLocalRuntimeLifecycleResponse,aa as parseLocalRuntimeIdentityResponse,Z as parseLocalRuntimeHeartbeatResponse,_ as parseLocalRuntimeFirstHeartbeat,V as parseLocalRuntimeErrorEnvelope,Y as parseLocalRuntimeEnrollmentResponse,ba as parseLocalRuntimeDisconnectResponse,j as localRuntimeSessionRoutable,U as buildLocalRuntimeDeviceProofBytes,P as WORKER_STARTUP_TIMING_STAGES,K as WORKER_PREVIEW_CARRIED_JOBS,e as RELAY_HOST_ALIAS_VERSION,d as RELAY_HOST_ALIAS_HEADER,Q as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,k as LOCAL_RUNTIME_SESSION_VM_HANDS_REGISTER,h as LOCAL_RUNTIME_SESSION_PRE_AUTH_MAX_BYTES,g as LOCAL_RUNTIME_SESSION_PATH,m as LOCAL_RUNTIME_SESSION_CLOSE,l as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,i as LOCAL_RUNTIME_SESSION_AUTH_DEADLINE_MS,b as LOCAL_RUNTIME_ROUTE_PREFIX,f as LOCAL_RUNTIME_ROUTES,a as LOCAL_RUNTIME_PROTOCOL_VERSION,R as LOCAL_RUNTIME_LIFECYCLE_EVENTS,T as LOCAL_RUNTIME_LEGACY_DEVICE_PROOF_TAG,S as LOCAL_RUNTIME_DEVICE_PROOF_TAG,c as LOCAL_OPERATION_MAX_BYTES,M as JOBS_START_WAIT_KEY,L as JOBS_START_WAIT,H as HANDS_SESSION_GROUP_KEY,G as HANDS_SESSION_GROUP,J as HANDS_SESSION_CAP_NONE,I as HANDS_SESSION_CAP_KEY,s as HANDS_REBIND_KEY,t as HANDS_REBIND_CONTROL,r as HANDS_REBIND,D as HANDS_MODEL_JOBS_EGRESS_KEY,C as HANDS_MODEL_JOBS_EGRESS,z as HANDS_LARGE_ENVIRONMENT_KEY,y as HANDS_LARGE_ENVIRONMENT,F as HANDS_JOBS_USER_KEY,E as HANDS_JOBS_USER,x as HANDS_HEADLESS_BROWSER_KEY,w as HANDS_HEADLESS_BROWSER,o as HANDS_ENVIRONMENT_DELIVER_CONTROL,n as HANDS_ENVIRONMENT_DELIVERY,q as HANDS_ENVIRONMENT_AT_CLAIM_KEY,p as HANDS_ENVIRONMENT_AT_CLAIM,B as HANDS_CONFINEMENT_KEY,A as HANDS_CONFINEMENT,v as HANDS_CLOUD_ACCESS_KEY,u as HANDS_CLOUD_ACCESS,N as AUTOMATION_USER_CHROME,O as AUTOMATION_CLOUD_SESSIONS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Aa as a}from"./vm-hands-entry-lite-d2hbz0r4.js";import"./vm-hands-entry-lite-h2xemq1f.js";export default a();
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qi as a,ri as b,si as c,ti as d,ui as e,vi as f,wi as g,xi as h,yi as i,zi as j}from"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import"./vm-hands-entry-lite-ygx9kj92.js";import"./vm-hands-entry-lite-h2xemq1f.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 +1,2 @@
1
1
  // @bun
2
- import{$g as H,Ag as g,Bg as h,Cg as i,Dg as j,Eg as k,Fg as l,Gg as m,Hg as n,Ig as o,Jg as p,Kg as q,Lg as r,Mg as s,Ng as t,Og as u,Pg as v,Qg as w,Rg as x,Sg as y,Tg as z,Ug as A,Vg as B,Wg as C,Xg as D,Yg as E,Zg as F,_g as G,ah as I,bh as J,ch as K,dh as L,eh as M,fh as N,gh as O,hh as P,ih as Q,jh as R,kh as S,lh as T,mh as U,nh as V,oh as W,ph as X,qh as Y,rh as Z,ug as a,vg as b,wg as c,xg as d,yg as e,zg as f}from"./vm-hands-entry-lite-mybm2kyz.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{w as reasonHandsCloseReason,Y as parseReasonHandsSdkResponse,X as parseReasonHandsSdkRequest,J as parseReasonHandsResult,I as parseReasonHandsRequest,P as parseReasonHandsPtyReceipt,K as parseReasonHandsProgress,O as parseReasonHandsJobResult,N as parseReasonHandsJobRequest,M as parseReasonHandsClaimAck,L as parseReasonHandsClaim,Q as parseReasonHandsCancelRequest,R as parseReasonHandsCancelAck,F as isReasonHandsUuid,D as isReasonHandsRequestId,G as isReasonHandsPtyJobId,E as isReasonHandsGeneration,H as isReasonHandsArtifactSha256,Z as encodeReasonHandsSdkResponse,T as encodeReasonHandsResult,S as encodeReasonHandsRequest,U as encodeReasonHandsProgress,W as encodeReasonHandsClaimAck,V as encodeReasonHandsClaim,y as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,A as REASON_HANDS_SDK_MAX_QUERY_CHARS,z as REASON_HANDS_SDK_MAX_NAME_CHARS,n as REASON_HANDS_PTY_PROTOCOL_VERSION,q as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,p as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,o as REASON_HANDS_PTY_MAX_INPUT_BYTES,r as REASON_HANDS_PTY_MAX_DIMENSION,s as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,u as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,t as REASON_HANDS_PTY_ANCHOR_EXIT_MS,a as REASON_HANDS_PROTOCOL_VERSION,f as REASON_HANDS_OUTPUT_TRUNCATED_MARKER,d as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,e as REASON_HANDS_MAX_OUTPUT_CHARS,c as REASON_HANDS_MAX_INPUT_CHARS,b as REASON_HANDS_MAX_FRAME_BYTES,g as REASON_HANDS_MAX_ERROR_CHARS,h as REASON_HANDS_JOB_PROTOCOL_VERSION,l as REASON_HANDS_JOB_MAX_RECORDS,k as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,j as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,i as REASON_HANDS_JOB_MAX_INPUT_CHARS,B as REASON_HANDS_JOB_ERRORS,m as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,x as REASON_HANDS_ERROR_CODES,v as REASON_HANDS_CLOSE_CODES,C as HandsProtocolError};
2
+ import{$g as t,Ah as U,Bh as V,Ch as W,Dh as X,Eh as Y,Fh as Z,Ig as a,Jg as b,Kg as c,Lg as d,Mg as e,Ng as f,Og as g,Pg as h,Qg as i,Rg as j,Sg as k,Tg as l,Ug as m,Vg as n,Wg as o,Xg as p,Yg as q,Zg as r,_g as s,ah as u,bh as v,ch as w,dh as x,eh as y,fh as z,gh as A,hh as B,ih as C,jh as D,kh as E,lh as F,mh as G,nh as H,oh as I,ph as J,qh as K,rh as L,sh as M,th as N,uh as O,vh as P,wh as Q,xh as R,yh as S,zh as T}from"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{w as reasonHandsCloseReason,Y as parseReasonHandsSdkResponse,X as parseReasonHandsSdkRequest,J as parseReasonHandsResult,I as parseReasonHandsRequest,P as parseReasonHandsPtyReceipt,K as parseReasonHandsProgress,O as parseReasonHandsJobResult,N as parseReasonHandsJobRequest,M as parseReasonHandsClaimAck,L as parseReasonHandsClaim,Q as parseReasonHandsCancelRequest,R as parseReasonHandsCancelAck,F as isReasonHandsUuid,D as isReasonHandsRequestId,G as isReasonHandsPtyJobId,E as isReasonHandsGeneration,H as isReasonHandsArtifactSha256,Z as encodeReasonHandsSdkResponse,T as encodeReasonHandsResult,S as encodeReasonHandsRequest,U as encodeReasonHandsProgress,W as encodeReasonHandsClaimAck,V as encodeReasonHandsClaim,y as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,A as REASON_HANDS_SDK_MAX_QUERY_CHARS,z as REASON_HANDS_SDK_MAX_NAME_CHARS,n as REASON_HANDS_PTY_PROTOCOL_VERSION,q as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,p as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,o as REASON_HANDS_PTY_MAX_INPUT_BYTES,r as REASON_HANDS_PTY_MAX_DIMENSION,s as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,u as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,t as REASON_HANDS_PTY_ANCHOR_EXIT_MS,a as REASON_HANDS_PROTOCOL_VERSION,f as REASON_HANDS_OUTPUT_TRUNCATED_MARKER,d as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,e as REASON_HANDS_MAX_OUTPUT_CHARS,c as REASON_HANDS_MAX_INPUT_CHARS,b as REASON_HANDS_MAX_FRAME_BYTES,g as REASON_HANDS_MAX_ERROR_CHARS,h as REASON_HANDS_JOB_PROTOCOL_VERSION,l as REASON_HANDS_JOB_MAX_RECORDS,k as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,j as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,i as REASON_HANDS_JOB_MAX_INPUT_CHARS,B as REASON_HANDS_JOB_ERRORS,m as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,x as REASON_HANDS_ERROR_CODES,v as REASON_HANDS_CLOSE_CODES,C as HandsProtocolError};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fd as a,Gd as b,Hd as c,Id as d,Jd as e,Kd as f,Ld as g,Md as h,Nd as i,Od as j,Pd as k,Qd as l,Rd as m,Sd as n,Td as o,Ud as p,Vd as q,Wd as r}from"./vm-hands-entry-lite-gzxxsjmr.js";import"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-x4j4058x.js";import"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-h2xemq1f.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,5 +1,5 @@
1
1
  // @bun
2
- import{d as jq,e as Dq,f as Vq,g as kq,j as Hq,k as zq,p as Aq}from"./vm-hands-entry-lite-pm0j47qj.js";import"./vm-hands-entry-lite-tdgbgcer.js";import{y as Fq}from"./vm-hands-entry-lite-d9k3dzaq.js";import{A as Wq,K as bq}from"./vm-hands-entry-lite-95k4g3jj.js";import"./vm-hands-entry-lite-trcg4jv7.js";import"./vm-hands-entry-lite-3zxjyj62.js";import"./vm-hands-entry-lite-rr0hhz7g.js";import"./vm-hands-entry-lite-dyy62gt3.js";import"./vm-hands-entry-lite-wpx6sg6d.js";import"./vm-hands-entry-lite-nbtpm59m.js";import"./vm-hands-entry-lite-nvhzj5b0.js";import"./vm-hands-entry-lite-gcn3rmz6.js";import"./vm-hands-entry-lite-beannz0s.js";import{Gc as Kq}from"./vm-hands-entry-lite-0hv9ek0t.js";import"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-he2z2137.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-3ms5bb0b.js";import{sf as N}from"./vm-hands-entry-lite-c8hfat7y.js";import"./vm-hands-entry-lite-8jmwhybq.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import{hg as Qq,mg as Bq}from"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import{vh as z,wh as u,xh as s}from"./vm-hands-entry-lite-6qfax5p2.js";import{Kh as l}from"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import{ii as G}from"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import"./vm-hands-entry-lite-tj1y61bg.js";import{wi as $q}from"./vm-hands-entry-lite-nd1k2jz9.js";import{createHash as aq,randomBytes as nq}from"crypto";import{readFileSync as eq,realpathSync as Pq,renameSync as q3,unlinkSync as x3,writeFileSync as J3}from"fs";import{dirname as X3,join as yq}from"path";import{spawnSync as wq}from"child_process";import{accessSync as Lq,constants as fq,existsSync as L,mkdirSync as Sq,readFileSync as hq,renameSync as Cq,writeFileSync as gq}from"fs";import{homedir as mq}from"os";import{delimiter as pq,dirname as dq,join as T}from"path";import{existsSync as vq,readFileSync as Eq}from"fs";import{join as Mq}from"path";var _q=`---
2
+ import{a as jq,b as Dq,c as Vq,d as kq,g as Hq,h as zq,m as Aq}from"./vm-hands-entry-lite-kt4831mq.js";import"./vm-hands-entry-lite-5xtkyx25.js";import{y as Fq}from"./vm-hands-entry-lite-463aheya.js";import{A as Wq,K as bq}from"./vm-hands-entry-lite-taw01cp4.js";import"./vm-hands-entry-lite-c0m2jewa.js";import"./vm-hands-entry-lite-qm18wqgz.js";import"./vm-hands-entry-lite-c7krpmd8.js";import"./vm-hands-entry-lite-qbnz4h30.js";import"./vm-hands-entry-lite-22we2jrv.js";import"./vm-hands-entry-lite-gxjxx1r2.js";import"./vm-hands-entry-lite-j05685sg.js";import"./vm-hands-entry-lite-f4gvypnx.js";import"./vm-hands-entry-lite-wry37am5.js";import"./vm-hands-entry-lite-wej1p1ry.js";import"./vm-hands-entry-lite-r5y08n0q.js";import"./vm-hands-entry-lite-n867d88m.js";import"./vm-hands-entry-lite-gzxxsjmr.js";import{he as Kq}from"./vm-hands-entry-lite-bybpy28m.js";import"./vm-hands-entry-lite-szfy3kx7.js";import"./vm-hands-entry-lite-07er2w8q.js";import"./vm-hands-entry-lite-9z6k7898.js";import{qg as Qq,vg as Bq}from"./vm-hands-entry-lite-s98hjhz3.js";import"./vm-hands-entry-lite-3ew5ftk0.js";import"./vm-hands-entry-lite-v08mjs3f.js";import"./vm-hands-entry-lite-kxdw4myj.js";import{$h as u,Zh as z,ai as s}from"./vm-hands-entry-lite-5kgvss4p.js";import"./vm-hands-entry-lite-r6pap1kh.js";import"./vm-hands-entry-lite-pf1gagky.js";import"./vm-hands-entry-lite-x4j4058x.js";import{Ri as l}from"./vm-hands-entry-lite-1j9r1fca.js";import"./vm-hands-entry-lite-w88zkzhr.js";import{pj as N}from"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-ha1ej910.js";import{Oj as G}from"./vm-hands-entry-lite-kv0qat0x.js";import"./vm-hands-entry-lite-jn95s3j4.js";import"./vm-hands-entry-lite-ygx9kj92.js";import{ak as $q}from"./vm-hands-entry-lite-h2xemq1f.js";import{createHash as aq,randomBytes as nq}from"crypto";import{readFileSync as eq,realpathSync as Pq,renameSync as q3,unlinkSync as x3,writeFileSync as J3}from"fs";import{dirname as X3,join as yq}from"path";import{spawnSync as wq}from"child_process";import{accessSync as Lq,constants as fq,existsSync as L,mkdirSync as Sq,readFileSync as hq,renameSync as Cq,writeFileSync as gq}from"fs";import{homedir as mq}from"os";import{delimiter as pq,dirname as dq,join as T}from"path";import{existsSync as vq,readFileSync as Eq}from"fs";import{join as Mq}from"path";var _q=`---
3
3
  name: reason
4
4
  description: Integrate software with Reason's public REST API using a scoped API key. Use for API clients, CI, service integrations, or cloud coding-session automation.
5
5
  ---
@@ -79,7 +79,7 @@ This computer
79
79
  `),W.version)x.stdout.write(`Version: ${W.version}${W.version===N?"":` (${N} is installed; \`reason connect\` restarts it on that)`}
80
80
  `);if(x.stdout.write(`Folder: ${W.folder}
81
81
  `),x.stdout.write(`Sessions: ${W.sessions_running===null?"":`${W.sessions_running} running, `}${W.sessions_max===null?"every Session you start":W.sessions_max===1?"one at a time":`up to ${W.sessions_max} at once`}
82
- `),A){let Z=A,H=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Oq,reasonIdentity:Tq}=await import("./permissions-0ej6xgrj.js"),{macScreenStatus:Uq}=await import("./local-display-mac-gj72gkfb.js");return Rq(await Oq({identity:()=>Tq(),grants:Uq,worker:async()=>Z}))}))().catch(()=>null);if(H)x.stdout.write(`${H}
82
+ `),A){let Z=A,H=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Oq,reasonIdentity:Tq}=await import("./permissions-3kjdp3ge.js"),{macScreenStatus:Uq}=await import("./local-display-mac-neweyjpa.js");return Rq(await Oq({identity:()=>Tq(),grants:Uq,worker:async()=>Z}))}))().catch(()=>null);if(H)x.stdout.write(`${H}
83
83
  `);x.stdout.write(`Keep awake: ${A.keep_awake.enabled?"on":"off"}${A.keep_awake.holding?" (holding)":""}
84
84
  `)}if(W.service)x.stdout.write(`Logs: ${W.service.logs}
85
85
  `);for(let Z of W.workspaces??[]){let H=Z.state==="removed"?"removed from that workspace":Z.blocked?"offline (this computer is outside that workspace's allowed networks)":Z.device_id?Gq[Z.state]:"connecting";x.stdout.write(`Also in workspace ${Z.name??Z.organization_id}${Z.account?" (another Reason account's)":""}: ${H}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{pj as a,qj as b,rj as c,sj as d}from"./vm-hands-entry-lite-p8662x7z.js";import"./vm-hands-entry-lite-qhgfnhjt.js";import"./vm-hands-entry-lite-h2xemq1f.js";export{c as compareCliVersions,d as cliAndAgentVersion,b as CLI_VERSION_PATTERN,a as CLI_VERSION};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ze as Zq}from"./vm-hands-entry-lite-xhjbc3e4.js";import{af as Aq}from"./vm-hands-entry-lite-3ms5bb0b.js";import{Bf as H,Ef as L0,Hf as y0,If as T8,Jf as sq,Lf as $8,Of as iq,Qf as nq}from"./vm-hands-entry-lite-c9wp99nr.js";import{Zf as j0}from"./vm-hands-entry-lite-jfwz0br7.js";import{pg as U0}from"./vm-hands-entry-lite-33ttamma.js";import{Kh as d}from"./vm-hands-entry-lite-5b29hq7h.js";import{ji as W0}from"./vm-hands-entry-lite-6f5eypjm.js";import{qi as M}from"./vm-hands-entry-lite-tj1y61bg.js";import{execFile as tx,spawn as T0}from"child_process";import{randomBytes as ex}from"crypto";import{chmodSync as q1,existsSync as B0,lstatSync as x1,mkdirSync as X1,readFileSync as Q1,rmSync as P1,writeFileSync as o8}from"fs";import{connect as b1}from"net";import{join as _}from"path";var Uq="./desktop-wallpaper-0pjhgyfk.jpg";var Lq="./dock-browser-afp005mt.png";var yq="./dock-files-rywdm96b.png";var jq="./dock-terminal-s41cj1jp.png";var Tq=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
2
+ import{hg as j0}from"./vm-hands-entry-lite-9z6k7898.js";import{yg as U0}from"./vm-hands-entry-lite-s98hjhz3.js";import{Eg as Zq}from"./vm-hands-entry-lite-3ew5ftk0.js";import{Ki as Aq}from"./vm-hands-entry-lite-x4j4058x.js";import{Ri as d}from"./vm-hands-entry-lite-1j9r1fca.js";import{Bj as L0,Ej as y0,Fj as T8,Gj as sq,Ij as $8,Lj as iq,Nj as nq,yj as H}from"./vm-hands-entry-lite-ha1ej910.js";import{Pj as W0}from"./vm-hands-entry-lite-jn95s3j4.js";import{Wj as M}from"./vm-hands-entry-lite-ygx9kj92.js";import{execFile as tx,spawn as T0}from"child_process";import{randomBytes as ex}from"crypto";import{chmodSync as q1,existsSync as B0,lstatSync as x1,mkdirSync as X1,readFileSync as Q1,rmSync as P1,writeFileSync as o8}from"fs";import{connect as b1}from"net";import{join as _}from"path";var Uq="./desktop-wallpaper-0pjhgyfk.jpg";var Lq="./dock-browser-afp005mt.png";var yq="./dock-files-rywdm96b.png";var jq="./dock-terminal-s41cj1jp.png";var Tq=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
3
3
  # The native Blaxel image ships no feh, hsetroot or compositor, but it does ship
4
4
  # python3-gi and libX11. tint2 reads _XROOTPMAP_ID to draw its transparent panel.
5
5
  # Usage: DISPLAY=:99 python3 set-root-wallpaper.py IMAGE
@@ -178,4 +178,4 @@ Gtk.main()
178
178
  `).flatMap((Q)=>{let P=Q.indexOf("=");return P>0?[[Q.slice(0,P),Q.slice(P+1)]]:[]})))}catch{return{}}}var N0=new Set;async function C1(q,x,X){let Q=await R1(),P=/^:(\d+)(?:\.\d+)?$/.exec(Q.DISPLAY??"")?.[1];if(!P||`:${P}`===B8||Q.WAYLAND_DISPLAY||Q.XDG_SESSION_TYPE==="wayland")return null;let b={display:`:${P}`,xauthority:Q.XAUTHORITY??_(q,".Xauthority"),rfbSocket:_(x,`rfb-${P}.sock`)},J=`${b.display} ${b.xauthority}`;if(N0.has(J)||!await s({path:`/tmp/.X11-unix/X${P}`},!1))return null;let y={HOME:q,PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:b.display,XAUTHORITY:b.xauthority};if(await R0(X,b,x,`x11vnc-${P}.log`,y))return{...b,sound:null};return N0.add(J),process.stderr.write(`Reason worker: your screen ${b.display} could not be served; using the virtual desktop
179
179
  `),null}function S1(q,x){let X=`chromium --no-first-run --no-default-browser-check${process.geteuid?.()===0?" --no-sandbox":""} %U`,Q=[["terminal","xterm"],["files","pcmanfm"]].filter(([,b])=>!B0(`/usr/bin/${b}`)).map(([b])=>b),P=Rq({root:q,display:x,screen:t8,browserExec:X,absent:Q});for(let b of["","openbox","tint2","picom"])D8(_(q,b));for(let[b,J]of Object.entries(P.files))o8(_(q,b),J,{mode:384});for(let[b,J]of Object.entries(Dq))o8(_(q,`ara-${b}`),Q1(J),{mode:384});return{root:q,openboxConfig:_(q,"openbox","rc.xml"),start:P.start}}async function Z1(q,x){let X=[`ROOT=${JSON.stringify(q.root)}`,...q.start,"openbox --reconfigure >/dev/null 2>&1 || true"].join(`
180
180
  `);await new Promise((Q)=>{let P=T0("/bin/sh",["-c",X],{stdio:"ignore",env:{...x,PATH:"/usr/bin:/bin"}}),b=setTimeout(()=>{P.kill(),Q()},R8);P.once("error",()=>{clearTimeout(b),Q()}),P.once("exit",()=>{clearTimeout(b),Q()})})}async function oX(q,x={}){let X=x.now??Date.now,Q=y1(q.payload,X());if(q.signal.throwIfAborted(),!Q.video)throw new M("display_video_required","Reason desktops stream as video now; this request came without it.");let P=x.platform??process.platform;if(P!=="linux"&&P!=="darwin")throw new M("display_video_unsupported","This machine does not serve desktop video.");let b=Q.video,J=(x.video?.desktop??(P==="darwin"?async()=>oq:B1))();return await A1(q.signal,Q,x,X,(y)=>Q0(y,{request:b,desktop:J,...Q.viewer?{viewer:Q.viewer}:{},viewerSameNetwork:Q.viewer_same_network===!0},x.video),(y)=>T8({type:"error",code:y}))}function A1(q,x,X,Q,P,b){let J=Q();return new Promise((y,C)=>{let W=null,j=!1,R=!1,Z,B,Y,w=!1,N=null,D=(A)=>{if(R)return;if(N)A=N;R=!0,clearTimeout(Z),clearTimeout(B),q.removeEventListener("abort",F),Y?.close();try{W?.close(1000,"display_session_over")}catch{}if("error"in A){C(A.error);return}y({reason:A.reason,...Y?.summary(),duration_ms:Math.max(0,Q()-J)})},G=()=>D({error:new M("display_relay_unavailable","Reason could not reach the desktop relay.")}),F=()=>{let A=q.reason;D({error:A instanceof M?A:new M("cancelled","Reason closed the desktop session.")})},O=()=>{if(!N||!W)return;let A=N.error;try{W.send(b(A instanceof M?A.code:"display_unavailable"))}catch{}D(N)};if(Y=P({get done(){return R||N!==null},get open(){return j&&!R&&N===null},get bufferedAmount(){return W?.bufferedAmount??0},send(A){if(R||N||!j||!W)return;try{W.send(A)}catch{D({reason:"relay_closed"})}},end:(A)=>{if(R||N)return;if(!("error"in A)){D(A);return}if(N=A,w&&j)O()}}),R){Y.close();return}if(q.aborted){F();return}q.addEventListener("abort",F,{once:!0}),Z=setTimeout(()=>D({reason:"session_expired"}),Math.max(1,Date.parse(x.expires_at)-Q())),B=setTimeout(()=>D({reason:"viewer_absent"}),X.viewerWaitMs??N1);try{W=(X.connect??j0)(x.relay_url,(X.loadProxy??U0)()?.url)}catch{G();return}W.binaryType="arraybuffer",W.onopen=()=>{if(R||!W)return;j=!0,Y?.opened()},W.onmessage=(A)=>{if(R)return;let f=A.data,I=f instanceof ArrayBuffer?new Uint8Array(f):ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength):null;if(!I||I.byteLength===0)return;if(clearTimeout(B),w=!0,N){O();return}Y?.received(I)},W.onclose=()=>{if(R)return;if(!j){G();return}D({reason:"relay_closed"})},W.onerror=()=>{if(R||j)return;G()}})}
181
- export{_8 as Ae,f1 as Be,p1 as Ce,r as De,j8 as Ee,HX as Fe,J0 as Ge,Cq as He,zq as Ie,k as Je,UX as Ke,LX as Le,yX as Me,J1 as Ne,B8 as Oe,y1 as Pe,j1 as Qe,nX as Re,D8 as Se,B1 as Te,oX as Ue};
181
+ export{_8 as Gf,f1 as Hf,p1 as If,r as Jf,j8 as Kf,HX as Lf,J0 as Mf,Cq as Nf,zq as Of,k as Pf,UX as Qf,LX as Rf,yX as Sf,J1 as Tf,B8 as Uf,y1 as Vf,j1 as Wf,nX as Xf,D8 as Yf,B1 as Zf,oX as _f};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Th as X,Vh as Y,Xh as Z}from"./vm-hands-entry-lite-84d59wrf.js";import{execFileSync as z}from"child_process";import{existsSync as V,realpathSync as M}from"fs";import{userInfo as D}from"os";import{isAbsolute as $,join as C,normalize as F,parse as K}from"path";function Q(){let q=F(D().homedir);if(!$(q)||q===K(q).root)throw Error("Could not resolve the canonical macOS user home.");return q}function O(q,B,J=Q()){let L=Z(B);if(B.kind==="managed"&&B.base){let G=M(J);return{anchor:G,boundary:C(G,B.base),path:C(G,L)}}if(B.kind==="root"&&Y(B.path)){let G=M(J);return{anchor:G,boundary:C(G,X),path:C(G,L)}}return{anchor:q,boundary:q,path:C(q,L)}}function _(q=Q()){return C(q,".config")}function b(){if(process.platform!=="darwin")return null;try{let q=z("/usr/bin/getconf",["DARWIN_USER_DIR"],{encoding:"utf8",timeout:5000}).trim();return $(q)?M(q):null}catch{return null}}function g(q=Q()){let B=C(q,"Library","Application Support","Ara"),J=C(q,"Library","Application Support","Reason");return V(B)&&!V(J)?B:J}
3
- export{Q as Kh,O as Lh,_ as Mh,b as Nh,g as Oh};
2
+ import{_i as X,aj as Y,cj as Z}from"./vm-hands-entry-lite-w88zkzhr.js";import{execFileSync as z}from"child_process";import{existsSync as V,realpathSync as M}from"fs";import{userInfo as D}from"os";import{isAbsolute as $,join as C,normalize as F,parse as K}from"path";function Q(){let q=F(D().homedir);if(!$(q)||q===K(q).root)throw Error("Could not resolve the canonical macOS user home.");return q}function O(q,B,J=Q()){let L=Z(B);if(B.kind==="managed"&&B.base){let G=M(J);return{anchor:G,boundary:C(G,B.base),path:C(G,L)}}if(B.kind==="root"&&Y(B.path)){let G=M(J);return{anchor:G,boundary:C(G,X),path:C(G,L)}}return{anchor:q,boundary:q,path:C(q,L)}}function _(q=Q()){return C(q,".config")}function b(){if(process.platform!=="darwin")return null;try{let q=z("/usr/bin/getconf",["DARWIN_USER_DIR"],{encoding:"utf8",timeout:5000}).trim();return $(q)?M(q):null}catch{return null}}function g(q=Q()){let B=C(q,"Library","Application Support","Ara"),J=C(q,"Library","Application Support","Reason");return V(B)&&!V(J)?B:J}
3
+ export{Q as Ri,O as Si,_ as Ti,b as Ui,g as Vi};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Ac as R}from"./vm-hands-entry-lite-gxjxx1r2.js";import{Yc as D}from"./vm-hands-entry-lite-wej1p1ry.js";import{Wj as $}from"./vm-hands-entry-lite-ygx9kj92.js";import{spawn as i,spawnSync as n}from"child_process";import{existsSync as I,mkdtempSync as E,readFileSync as O,readdirSync as t,realpathSync as r,rmSync as y,statSync as o}from"fs";import{platform as b,tmpdir as h}from"os";import{dirname as N,join as Y}from"path";import{fileURLToPath as e,pathToFileURL as M}from"url";var jj=["bwrap","socat","rg"],qj=2000,_=20000,zj=3,S=4000,Gj=new Set([".git",".hg",".svn","node_modules"]),Hj=["runAsHostUid","sysrq-trigger"],Jj=Y(N(N(e(import.meta.url))),"packages/sandbox-runtime/src/index.ts"),l=!1;function Cj(){l=!0}async function g(){let q=l?Y(N(r(process.execPath)),"runtime","srt"):void 0;if(q&&process.platform==="linux"&&!I(Y(q,"vendor","seccomp",process.arch,"apply-seccomp")))throw Error("packaged_sandbox_runtime_vendor_missing");if(q){let H=O(Y(q,"sandbox-runtime.mjs"),"utf8");for(let W of Hj)if(!H.includes(W))throw Error(`packaged_sandbox_runtime_fork_missing:${W}`)}let G=(await import(q?M(Y(q,"sandbox-runtime.mjs")).href:M(Jj).href)).SandboxManager;if(!G||typeof G.initialize!=="function"||typeof G.wrapWithSandboxArgv!=="function")throw Error("sandbox-runtime does not expose the expected SandboxManager API.");return{SandboxManager:G}}function Qj(j={}){if((j.platformName??b())!=="linux")return!1;let z=j.fileExists??I,J=j.readFile??((G)=>O(G,"utf8"));for(let G of["/.dockerenv","/run/.containerenv"])try{if(z(G))return!0}catch{}try{return/docker|containerd|kubepods|lxc|libpod/.test(J("/proc/1/cgroup"))}catch{return!1}}function u(j){return["/bin/true","/usr/bin/true"].find((q)=>j(q))??null}function Vj(j,q){return j==="strict"?["--ro-bind","/","/","--unshare-pid","--unshare-user","--cap-drop","ALL","--proc","/proc","--",q]:["--ro-bind","/","/","--unshare-pid","--unshare-user","--bind","/proc","/proc","--",q]}function Wj(j,q){try{let z=n("bwrap",Vj(j,q),{stdio:"ignore",timeout:qj});return!z.error&&z.status===0}catch{return!1}}function Yj(j){let q=j.platformName??b();if(q!=="linux")return null;let z=j.hasExecutable??D;if(!jj.every((Q)=>z(Q)))return null;let J=j.fileExists??I,G=u(J);if(!G)return null;let H=B??(j.containerized??Qj({platformName:q})?"weak":"strict");return(j.probeNamespaces??((Q)=>Wj(Q,G)))(H)?H:null}var L=null,w=!1,k=null,T=null,f=null,B=null,U=null;function A(){throw F("sandbox_mode_conflict"),new $("sandbox_unavailable","Sandbox process policy conflicts with an existing probe or session. Restart the worker.")}function Mj(j){if(B!==null&&B!==j||w&&L!==null&&L!==j||U!==null&&U!==j)A();B=j}function F(j){k=j}function c(j){if(k)return!1;if(!w){if(L=Yj(j??{}),w=!0,L&&!j)d()}return L!==null}function Zj(){return c()?L:null}var X=null,C=0;function m(j){if(k)throw new $("sandbox_unavailable","Confined execution is unavailable in this worker process.");if(B&&j.sandboxMode&&B!==j.sandboxMode)A();let q=B??j.sandboxMode??Zj();if(!q)throw new $("sandbox_unavailable","Confined command execution is unavailable on this operating system.");if(U&&U!==q)A();return U=q,X??=(async()=>{let{SandboxManager:z}=await(j.loadSandboxRuntime??g)();return await z.initialize(Kj(q)),z})().catch((z)=>{throw X=null,F(`initialize_failed: ${String(z)}`),z instanceof $?z:new $("sandbox_unavailable","The confined execution sandbox failed to start.")}),X.then((z)=>{if(k)throw new $("sandbox_unavailable","Confined execution became unavailable during sandbox initialization.");return z})}async function $j(){let j=X;if(X=null,!j)return;try{await(await j).reset()}catch{}}async function d(j={}){if(k)return!1;if(j.loadSandboxRuntime)return P(j.loadSandboxRuntime);if(!c())return!1;return T??=P(g),T}async function P(j){try{let{SandboxManager:q}=await j(),z=q.checkDependencies().errors;if(z.length>0)return F(`dependencies_missing: ${z.join(", ")}`),!1;return!k}catch(q){return F(`load_failed: ${String(q)}`),!1}}async function _j(j={}){if(!j.loadSandboxRuntime&&!j.sandboxMode){if(!await d())return!1;return f??=x({}),f}return x(j)}async function x(j){let q;try{q=await m(j)}catch{return!1}let z=await Bj(q);if(!z)F("confined_command_failed");if(C===0)await $j();return z}async function Bj(j){let q=u(I);if(!q)return!1;let z=E(Y(h(),"reason-device-probe-"));try{let{argv:J}=await j.wrapWithSandboxArgv(s([q]),p(),{filesystem:a({root:z,allowWrite:!1,temporaryDirectory:z,protectedPaths:[]})},void 0,z),[G,...H]=J;if(!G)return!1;return await Lj(G,H,z)}catch{return!1}finally{try{j.cleanupAfterCommand()}catch{}y(z,{recursive:!0,force:!0})}}function Lj(j,q,z,J={}){return new Promise((G)=>{let H=!1,W,Q=(K)=>{if(H)return;H=!0,clearTimeout(W),G(K)},V;try{V=(J.spawnChild??i)(j,q,{cwd:z,env:{PATH:R,HOME:z,TMPDIR:z},stdio:"ignore"})}catch{Q(!1);return}V.once("error",()=>Q(!1));let Z=(K,v)=>Q(K===0&&v===null);if(V.once("exit",Z),V.once("close",Z),V.exitCode!==null||V.signalCode!==null)Z(V.exitCode,V.signalCode);if(H)return;W=setTimeout(()=>{Q(!1);try{V.kill("SIGKILL")}catch{}},Math.min(J.timeoutMs??_,_))})}function p(j=I){return["/bin/bash","/bin/sh"].find((q)=>j(q))??"/bin/sh"}function s(j){return j.map((q)=>`'${q.replaceAll("'","'\\''")}'`).join(" ")}function kj(j,q,z=(J)=>t(J,{withFileTypes:!0}).filter((G)=>G.isDirectory()||G.isFile()).map((G)=>G.name)){let J=[],G=[{path:j,depth:0}],H=0;while(G.length>0&&H<S){let W=G.pop(),Q;try{Q=z(W.path)}catch{continue}for(let V of Q){if(H+=1,H>S)break;let Z=Y(W.path,V);if(q(Z)){J.push(Z);continue}if(W.depth+1<zj&&!Gj.has(V))G.push({path:Z,depth:W.depth+1})}}return J}function a(j){let q=Y(j.root,".git"),z=[];try{if(o(q).isDirectory())z=[Y(q,"config"),Y(q,"hooks")]}catch{}return{denyRead:["/home","/root","/tmp","/tmp/.X11-unix",...j.protectedPaths],allowRead:[j.root,j.temporaryDirectory],allowWrite:[...j.allowWrite?[j.root]:[],j.temporaryDirectory],denyWrite:[...j.protectedPaths,...z]}}function Kj(j){return{network:{allowedDomains:[],deniedDomains:[]},filesystem:{denyRead:[],allowRead:[],allowWrite:[],denyWrite:[]},...j==="weak"?{enableWeakerNestedSandbox:!0}:{}}}function Sj(j){let q=j.createTemporaryDirectory??(()=>E(Y(h(),"reason-device-"))),z=j.removeTemporaryDirectory??((J)=>y(J,{recursive:!0,force:!0}));return async(J,G,H)=>{let W=await m(j),Q=q();C+=1;try{let V;try{V=await W.wrapWithSandboxArgv(s([J,...G]),j.shell??p(),{filesystem:a({root:H.root,allowWrite:H.allowWrite,temporaryDirectory:Q,protectedPaths:kj(H.root,j.isProtectedPath)})},H.signal,H.cwd)}catch(v){throw v instanceof $?v:new $("sandbox_unavailable","The confined execution sandbox could not wrap the command.")}let[Z,...K]=V.argv;if(!Z)throw new $("sandbox_unavailable","The confined execution sandbox produced no command.");return await j.spawnCaptured(Z,K,{cwd:H.cwd,timeoutMs:H.timeoutMs,signal:H.signal,env:j.scrubEnvironment(H.root,Q)})}finally{C-=1;try{W.cleanupAfterCommand()}catch{}z(Q)}}}
3
+ export{Cj as uc,Mj as vc,c as wc,_j as xc,p as yc,Sj as zc};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Kh as J}from"./vm-hands-entry-lite-5b29hq7h.js";import{readFileSync as L}from"fs";import{isAbsolute as M,normalize as Q}from"path";var W="REASON_WORKER_DESKTOP_USER",G=null;function X(q,B){for(let I of B.split(`
2
+ import{Ri as J}from"./vm-hands-entry-lite-1j9r1fca.js";import{readFileSync as L}from"fs";import{isAbsolute as M,normalize as Q}from"path";var W="REASON_WORKER_DESKTOP_USER",G=null;function X(q,B){for(let I of B.split(`
3
3
  `)){let j=I.split(":");if(j.length<7||Number(j[2])!==q||!/^\d+$/.test(j[2])||!/^\d+$/.test(j[3]))continue;let x=j[5];if(!/^[a-z_][a-z0-9_-]*$/i.test(j[0])||!M(x)||Q(x)!==x||x==="/")return null;return{username:j[0],uid:q,gid:Number(j[3]),home:x}}return null}function b(q={}){let B="value"in q?q.value:process.env[W];if(G=null,B===void 0||B==="")return null;let I=q.platform??process.platform,j="euid"in q?q.euid:process.geteuid?.(),x=/^[1-9]\d{0,9}$/.test(B)?Number(B):NaN,C=I==="linux"&&j===0&&Number.isSafeInteger(x)?X(x,(q.passwd??(()=>L("/etc/passwd","utf8")))()):null;if(!C||C.gid===0)throw Error("worker_desktop_user_invalid");return G=C,C}function k(){return G}function y(){return G?.home??J()}
4
- export{W as Ve,X as We,b as Xe,k as Ye,y as Ze};
4
+ export{W as Ag,X as Bg,b as Cg,k as Dg,y as Eg};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{D as T,F as U}from"./vm-hands-entry-lite-taw01cp4.js";import{Xc as V}from"./vm-hands-entry-lite-wry37am5.js";import{$h as Q,Zh as M}from"./vm-hands-entry-lite-5kgvss4p.js";import{ni as G}from"./vm-hands-entry-lite-r6pap1kh.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
+ export{W as v,X as w,$ as x,N as y,P as z};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{ni as m,oi as y}from"./vm-hands-entry-lite-r6pap1kh.js";import{basename as UJ}from"path";var f=["production","staging"],DJ="https://api.reasonmachines.com",EJ="https://staging-api.reasonmachines.com";var u={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},GJ=new Set(["ara-staging","reason-staging"]);function mJ(J={}){let Q=m(J.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(Q){if(f.includes(Q))return Q;throw Error(`Unknown Reason CLI channel: ${Q}`)}let V=UJ(J.executablePath??process.execPath).toLowerCase();return GJ.has(V)?"staging":"production"}function yJ(J,Q){return{...J,...y("REASON_CLI_CHANNEL",Q)}}function j(J){return J==="staging"?EJ:DJ}function sJ(J){return`${j(J)}/mcp/ara`}var s={production:["https://api.ara.so",u.production.api],staging:["https://api-staging.ara.so",u.staging.api]};function p(J){let Q;try{Q=new URL(J).origin}catch{return J}let V=f.find((Z)=>s[Z].includes(Q));return V?j(V):Q}function cJ(J,Q){return J===Q||p(J)===p(Q)}function lJ(J,Q){return f.some((V)=>s[V].includes(J)&&Q===j(V))}function iJ(J,Q){try{let V=new URL(Q);return!V.username&&!V.password&&(V.origin===j(J)||V.origin===u[J].api)}catch{return!1}}function rJ(J){try{let Q=new URL(J).hostname.replace(/^\[|\]$/g,"").toLowerCase();return Q==="localhost"||Q==="127.0.0.1"||Q==="::1"}catch{return!1}}import{randomBytes as VJ}from"crypto";import{chmodSync as ZJ,closeSync as a,constants as _J,linkSync as $J,lstatSync as k,mkdirSync as XJ,openSync as kJ,readdirSync as P,readFileSync as t,readlinkSync as R,renameSync as _,rmdirSync as KJ,symlinkSync as A,unlinkSync as U}from"fs";import{createRequire as CJ}from"module";import{constants as FJ}from"os";import{basename as O,join as K,sep as OJ}from"path";import{existsSync as I,lstatSync as l,readdirSync as PJ,readFileSync as HJ,readlinkSync as RJ,realpathSync as TJ}from"fs";import{join as L,sep as AJ}from"path";function i(J,...Q){let V=L(J,"ara"),Z=L(J,"reason");if(!r(V))return L(Z,...Q);if(!I(Z))return L(V,...Q);return I(L(V,...Q))&&!I(L(Z,...Q))?L(V,...Q):L(Z,...Q)}function r(J){try{let Q=l(J);if(!Q.isSymbolicLink())return Q.isDirectory();return RJ(J)!=="reason"&&I(J)}catch{return!1}}function o(J,Q=[]){if(!r(J))return!1;let V;try{V=[J,...PJ(J,{withFileTypes:!0}).filter((Z)=>Z.isDirectory()).map((Z)=>L(J,Z.name))]}catch{return!1}return V.some((Z)=>["connect","connect-once"].filter(($)=>!Q.includes(L(Z,$))).some(($)=>{let M=L(Z,$,"worker.json");try{l(M)}catch{return!1}try{let z=JSON.parse(HJ(M,"utf8"))?.stateDirectory;if(typeof z!=="string")return!0;let q=(X,B)=>X===B||X.startsWith(B+AJ);return q(z,J)||q(c(z),c(J))}catch{return!0}}))}function c(J){try{return TJ(J)}catch{return J}}var S=new Set(["credentials.json","local-device.json","local-device.revoked.json","local-device.auth-migration.json","local-device.json.registration-pending.json","local-daemon.json","local-daemon.json.workspaces.json","local-root-fingerprint-key.json","instances","workspaces"]),x=new Set(["local-device.proxy.json"]),bJ=new Set(["local-device.key","local-device.binding"]),n=new Map;function jJ(J,Q,V){let Z=K(J,"ara");if(/[/\\]\.reason-ssh[/\\][^/\\]+[/\\]installer-home[/\\]\.config$/.test(J))return{state:Y(Z)?.isDirectory()?"kept":"absent"};return zJ(Z,K(J,"reason"),{linkAlways:!0,kept:($)=>o($,V??[]),native:Q===void 0?LJ:()=>Q},V!==void 0)}function qQ(J,...Q){return jJ(J),i(J,...Q)}function BQ(J,Q=process.platform){let V=K(J,"Library","Logs");if(Q==="darwin")for(let Z of[""," Staging"," Development"])zJ(K(V,`Ara${Z}`),K(V,`Reason${Z}`),{linkAlways:!1,kept:()=>!1,native:LJ});return K(V,"Reason")}var MJ="config_rename_unavailable:busy";function zJ(J,Q,V,Z=!1){let $=Z?void 0:n.get(J);if($)return $;let M;try{M=IJ(J,Q,V)}catch(z){let q=`config_rename_unavailable:${G(z)??"failed"}`;try{return{state:Y(J)?.isDirectory()?"kept":"absent",problem:q}}catch{return{state:"kept",problem:q}}}if(!(M.state==="absent"&&V.linkAlways)&&M.problem!==MJ&&!(M.state==="kept"&&!M.problem))n.set(J,M);return M}function IJ(J,Q,V){vJ(Q,V.native);let Z=!1;for(let $=0;$<8;$+=1){let M=Y(J);if(M?.isSymbolicLink())return R(J)===O(Q)?{state:Z?"renamed":"linked"}:{state:"kept"};if(!M){if(v(Q))W(()=>U(Q),"ENOENT");if(!(Z||V.linkAlways)||!T(Q))return{state:"absent"};let X=F(Q,"link");A(O(Q),X);try{W(()=>_(X,J),"EISDIR","ENOTEMPTY","EEXIST","ENOTDIR")}finally{W(()=>U(X),"ENOENT")}continue}if(!M.isDirectory())return{state:"absent"};if(V.kept(J))return e(Q),{state:"kept"};let z=V.native();if(!z)return e(Q),{state:"kept",problem:"config_rename_unavailable:no_native"};let q=SJ(z,J);if(!q)return{state:"kept",problem:MJ};try{if(k(J).isSymbolicLink())continue;let X=NJ(z,J,Q);if(X)return{state:"kept",problem:X};Z=!0}finally{q()}}throw Object.assign(Error("legacy directory rename did not settle"),{code:"unsettled"})}function NJ(J,Q,V){let Z=Y(V);if(!Z||v(V)){if(!Z)A(O(V),V);try{J.exchange(Q,V)}catch(X){if(v(V))W(()=>U(V),"ENOENT");return`config_rename_unavailable:${G(X)??"exchange_failed"}`}return null}if(!Z.isDirectory())return"config_rename_unavailable:ENOTDIR";if(Z.dev!==k(Q).dev)return"config_rename_unavailable:EXDEV";let $=[F(V,"probe"),F(V,"probe")];try{A("a",$[0]),A("b",$[1]),J.exchange($[0],$[1])}catch(X){return`config_rename_unavailable:${G(X)??"exchange_failed"}`}finally{for(let X of $)W(()=>U(X),"ENOENT")}let M=wJ(V);for(let X of bJ){let B=Y(K(V,X)),w=Y(K(Q,X));if(B&&w&&B.ino!==w.ino)XJ(`${M}-replaced`,{mode:448,recursive:!0}),_(K(V,X),K(`${M}-replaced`,X))}let z={linked:new Map,unitsKept:new Set};qJ(Q,V,"",z);let q=F(V,"rename");A(O(V),q);try{J.exchange(Q,q)}catch(X){return W(()=>U(q),"ENOENT"),`config_rename_unavailable:${G(X)??"exchange_failed"}`}return BJ(q,V,z,M),null}function g(J){return J===""||!J.includes(OJ)}function qJ(J,Q,V,Z){let $=g(V)&&N(K(Q,V),K(J,V));if($)Z.unitsKept.add(V);for(let M of P(K(J,V))){if($&&(S.has(M)||x.has(M)))continue;let z=K(V,M),q=K(J,z),X=K(Q,z),B=Y(q);if(!B)continue;let w=Y(X);if(B.isDirectory()){if(!w)W(()=>XJ(X,{mode:B.mode&4095}),"EEXIST"),ZJ(X,B.mode&4095);if(T(X))qJ(J,Q,z,Z)}else if(!w){if(B.isSymbolicLink())W(()=>A(R(q),X),"EEXIST");else if(W(()=>$J(q,X),"EEXIST","ENOENT"))Z.linked.set(z,B.ino)}}}function vJ(J,Q){let V;try{if(!T(J))return;V=P(J)}catch{return}for(let Z of V){let $=/^\.(rename|link|probe|claim)-(\d+)-[0-9a-f]+$/.exec(Z);if(!$)continue;let M=K(J,Z),z=Y(M);if(!z)continue;if(!z.isDirectory()){if(!JJ(Number($[2])))W(()=>U(M),"ENOENT");continue}let q=Q(),X=null;if(q){try{X=q.lock(M)}catch{continue}if(!X)continue}else if(JJ(Number($[2])))continue;try{let B=F(J,"claim");if(W(()=>_(M,B),"ENOENT"))BJ(B,J,null,wJ(J))}finally{X?.()}}}function BJ(J,Q,V,Z){for(let[$,M]of V?.linked??[])if(!Y(K(J,$))&&Y(K(Q,$))?.ino===M)W(()=>U(K(Q,$)),"ENOENT");if(YJ(J,Q,"",V),W(()=>KJ(J),"ENOTEMPTY","EEXIST"))return;_(J,Z),ZJ(Z,448)}function YJ(J,Q,V,Z){let $=g(V)&&(Z?Z.unitsKept.has(V):N(K(Q,V),K(J,V)));for(let M of P(K(J,V))){let z=K(V,M),q=K(J,z),X=K(Q,z),B=k(q),w=Y(X);if(w&&B.ino===w.ino&&B.dev===w.dev){U(q);continue}if(B.isFile()&&w?.isFile()&&Z?.linked.get(z)===w.ino){_(q,X);continue}if($&&(S.has(M)||x.has(M)))continue;if(!w){if(B.isFile()){if(W(()=>$J(q,X),"EEXIST"))U(q)}else W(()=>_(q,X),"EEXIST","ENOTEMPTY");continue}if(B.isDirectory()&&w.isDirectory())YJ(J,Q,z,Z),W(()=>KJ(q),"ENOTEMPTY","EEXIST")}}function YQ(J){let Q=K(J,"ara"),V=K(J,"reason");if(!T(Q)||!T(V))return null;let Z=["",...P(Q,{withFileTypes:!0}).filter(($)=>$.isDirectory()&&!$.name.startsWith(".")).map(($)=>$.name)];for(let $ of Z){let M=K(Q,$),z=K(V,$);if(!N(M,z)||!N(z,M))continue;if([...S,...x].some((X)=>h(K(M,X),K(z,X))===!1))return $}return null}function WQ(J){let Q=K(J,"ara"),V=K(J,"reason");if(!T(Q)||!T(V))return null;let Z=($)=>{for(let M of P(K(Q,$))){let z=K($,M);if(g($)&&(M==="connect"||M==="connect-once"))continue;let q=k(K(Q,z)),X=Y(K(V,z));if(!X||q.ino===X.ino&&q.dev===X.dev)continue;if(q.isDirectory()&&X.isDirectory()&&!X.isSymbolicLink()){let B=Z(z);if(B!==null)return B}else if(q.isSymbolicLink()||X.isSymbolicLink()){if(!(q.isSymbolicLink()&&X.isSymbolicLink()&&R(K(Q,z))===R(K(V,z))))return z}else if(h(K(Q,z),K(V,z))!==!0)return z}return null};return Z("")}function h(J,Q){let V=Y(J),Z=Y(Q);if(!V&&!Z)return null;if(!V||!Z||V.isDirectory()!==Z.isDirectory())return!1;if(V.ino===Z.ino&&V.dev===Z.dev)return!0;if(V.isDirectory())return[...new Set([...P(J),...P(Q)])].every((M)=>h(K(J,M),K(Q,M))===!0);try{return t(J).equals(t(Q))}catch{return!1}}function N(J,Q){for(let V of S)if(WJ(K(J,V),K(Q,V)))return!0;return!1}function WJ(J,Q){let V=Y(J);if(!V)return!1;let Z=Y(Q);if(!Z)return!0;if(V.isDirectory()){if(!Z.isDirectory())return!0;return P(J).some(($)=>WJ(K(J,$),K(Q,$)))}if(V.isSymbolicLink())return!Z.isSymbolicLink()||R(J)!==R(Q);return V.ino!==Z.ino||V.dev!==Z.dev}function e(J){if(v(J))W(()=>U(J),"ENOENT")}function wJ(J){return K(J,`.pre-rename-${new Date().toISOString().replace(/[:.]/g,"-")}-${VJ(3).toString("hex")}`)}function v(J){try{return k(J).isSymbolicLink()&&R(J)===O(J)}catch{return!1}}function T(J){let Q=Y(J);return Q!==null&&Q.isDirectory()}function SJ(J,Q){for(let V=0;V<40;V+=1){let Z=J.lock(Q);if(Z)return Z;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,50)}return null}function F(J,Q){return K(J,`.${Q}-${process.pid}-${VJ(6).toString("hex")}`)}function JJ(J){if(J===process.pid)return!1;try{return process.kill(J,0),!0}catch(Q){return G(Q)==="EPERM"}}function Y(J){try{return k(J)}catch(Q){if(G(Q)==="ENOENT"||G(Q)==="ENOTDIR")return null;throw Q}}function W(J,...Q){try{return J(),!0}catch(V){if(Q.includes(G(V)??""))return!1;throw V}}function G(J){return J instanceof Error&&"code"in J&&typeof J.code==="string"?J.code:void 0}var C,uJ=2,fJ=4,xJ=2,gJ=2,QJ=-100;function LJ(){if(C!==void 0)return C;if(C=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let J;try{J=CJ(import.meta.url)("bun:ffi")}catch{return null}let Q=process.platform==="darwin",V=Q?"__error":"__errno_location",Z=Q?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`],{FFIType:$}=J;for(let M of Z)try{let z=Q?"renamex_np":"renameat2",X=J.dlopen(M,{flock:{args:[$.i32,$.i32],returns:$.i32},[V]:{args:[],returns:$.ptr},[z]:Q?{args:[$.ptr,$.ptr,$.u32],returns:$.i32}:{args:[$.i32,$.ptr,$.i32,$.ptr,$.u32],returns:$.i32}}).symbols,B=X[V]();if(B===null)continue;let w=(H)=>{let E=J.read.i32(B),D=Object.entries(FJ.errno).find(([,b])=>b===E)?.[0]??`errno_${E}`;return Object.assign(Error(`${H} failed: ${D}`),{code:D})},d=(H)=>Buffer.from(`${H}\x00`,"utf8");return C={exchange(H,E){let D=d(H),b=d(E);if((Q?X[z](J.ptr(D),J.ptr(b),xJ):X[z](QJ,J.ptr(D),QJ,J.ptr(b),gJ))!==0)throw w("exchange")},lock(H){let E=kJ(H,_J.O_RDONLY);if(X.flock(E,uJ|fJ)===0)return()=>a(E);let D=w("lock");if(a(E),D.code==="EWOULDBLOCK"||D.code==="EAGAIN")return null;throw D}},C}catch{}return null}
3
+ export{f as Yh,mJ as Zh,yJ as _h,j as $h,sJ as ai,p as bi,cJ as ci,lJ as di,iJ as ei,rJ as fi,r as gi,jJ as hi,qQ as ii,BQ as ji,YQ as ki,WQ as li,LJ as mi};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{uc as j,vc as q}from"./vm-hands-entry-lite-22we2jrv.js";function y(v=process.platform){if(j(),v==="linux")q("strict")}
3
+ export{y as r};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{pg as m}from"./vm-hands-entry-lite-33ttamma.js";import{yg as w}from"./vm-hands-entry-lite-mybm2kyz.js";import{Lh as h}from"./vm-hands-entry-lite-5b29hq7h.js";import{Yh as x}from"./vm-hands-entry-lite-84d59wrf.js";import{qi as Q}from"./vm-hands-entry-lite-tj1y61bg.js";import{existsSync as B,realpathSync as k,statSync as s}from"fs";import{platform as p}from"os";import{isAbsolute as y,sep as d}from"path";var r=43200000,A=w,l=4,u=/^[A-Za-z0-9._:-]{1,160}$/,a=1000;function v(z){return Boolean(z)&&typeof z==="object"&&!Array.isArray(z)}function q(z,H){if(typeof z!=="number"||!Number.isFinite(z)||z<=0)return H;return Math.min(a,Math.max(1,Math.floor(z)))}function n(z,H=Date.now()){let V=["relay_url","session_id","expires_at"],J=new Set([...V,"cols","rows","cwd","workspace"]);if(!v(z)||V.some((L)=>!(L in z))||Object.keys(z).some((L)=>!J.has(L)))throw new Q("invalid_pty_request","Reason terminal request is malformed.");let{relay_url:j,session_id:Y,expires_at:C}=z;if(typeof j!=="string")throw new Q("invalid_pty_request","Reason terminal relay URL is missing.");let D;try{D=new URL(j)}catch{throw new Q("invalid_pty_request","Reason terminal relay URL is invalid.")}if(D.protocol!=="wss:"&&D.protocol!=="ws:"||D.username||D.password)throw new Q("invalid_pty_request","Reason terminal relay URL is invalid.");if(typeof Y!=="string"||!u.test(Y))throw new Q("invalid_pty_request","Reason terminal session identity is invalid.");let R=typeof C==="string"?Date.parse(C):Number.NaN;if(!Number.isFinite(R)||R<=H)throw new Q("invalid_pty_request","Reason terminal session has already expired.");if(z.cwd!==void 0&&typeof z.cwd!=="string")throw new Q("invalid_pty_request","Reason terminal working directory is invalid.");let Z=z.workspace===void 0?void 0:x(z.workspace);if(Z===null||Z&&z.cwd!==void 0)throw new Q("invalid_pty_request","Reason terminal workspace is invalid.");return{relay_url:j,session_id:Y,expires_at:new Date(Math.min(R,H+r)).toISOString(),cols:q(z.cols,80),rows:q(z.rows,24),...z.cwd===void 0?{}:{cwd:z.cwd},...Z?{workspace:Z}:{}}}function o(z,H){return H===z||H.startsWith(z+d)}function U(z,H){if(H===void 0)return z;if(!y(H))throw new Q("pty_cwd_invalid","Reason terminal working directory must be absolute.");let V;try{V=k(H)}catch{throw new Q("pty_cwd_invalid","Reason terminal working directory does not exist.")}if(!o(z,V))throw new Q("pty_cwd_outside_root","Reason terminal working directory escapes the granted root.");if(!s(V).isDirectory())throw new Q("pty_cwd_invalid","Reason terminal working directory is not a directory.");return V}function t(z=process.env){let H=z.SHELL;if(H&&y(H)&&B(H))return H;for(let V of p()==="darwin"?["/bin/zsh","/bin/bash","/bin/sh"]:["/bin/bash","/bin/sh"])if(B(V))return V;return"/bin/sh"}function e(){let z=globalThis.Bun;if(!z)throw new Q("pty_unavailable","Reason terminals require the Bun runtime.");return z.spawn}function Dz(){return typeof globalThis.Bun<"u"}var zz=(z)=>{let H=e()({cmd:[z.shell,"-i","-l"],cwd:z.cwd,env:{...z.environment,TERM:"xterm-256color"},terminal:{cols:z.cols,rows:z.rows,data:(J,j)=>{z.onData(j)}}}),V=H.terminal;if(!V){try{H.kill()}catch{}throw new Q("pty_unavailable","Reason could not allocate a pseudo-terminal.")}return{write:(J)=>V.write(J),resize:(J,j)=>V.resize(J,j),kill:()=>{try{H.kill()}catch{}},exited:H.exited.then((J)=>typeof J==="number"?J:null,()=>null)}},Hz=(z,H)=>{return H===void 0?new WebSocket(z):new WebSocket(z,{proxy:H})},S=new Set;function Jz(z){if(S.size>=l||S.has(z))return null;S.add(z);let H=!1;return()=>{if(H)return;H=!0,S.delete(z)}}async function Kz(z,H={}){let V=H.now??Date.now,J=n(z.payload,V()),j=Jz(z.operationId);if(!j)throw new Q("pty_slot_busy","This Reason Device already runs the maximum number of terminals.");let Y=V(),C,D,R;try{let Z=J.workspace?h(z.root,J.workspace):void 0;C=Z?U(B(Z.boundary)?k(Z.boundary):Z.boundary,Z.path):U(z.root,J.cwd),D=H.environment??process.env,R=H.shellPath??t(D)}catch(Z){throw j(),Z}return await new Promise((Z,L)=>{let X=null,W=null,M=!1,f=!1,K=!1,T=null,_=0,b=0,O=[],P=0,g=null,$=(N)=>{if(K)return;if(K=!0,g)clearTimeout(g);z.signal.removeEventListener("abort",I);try{X?.kill()}catch{}try{W?.close(1000,"pty_session_over")}catch{}if(j(),N.kind==="rejected"){L(N.error);return}let G={reason:N.reason,exit_code:T,output_bytes:_,input_bytes:b,duration_ms:Math.max(0,V()-Y)};z.emitEvent("pty.stopped",{...G}).catch(()=>{return}),Z({...G})},I=()=>{let N=z.signal.reason;$({kind:"rejected",error:N instanceof Q?N:new Q("cancelled","Reason closed the terminal session.")})};if(z.signal.aborted){I();return}z.signal.addEventListener("abort",I,{once:!0}),g=setTimeout(()=>$({kind:"resolved",reason:"session_expired"}),Math.max(1,Date.parse(J.expires_at)-V()));let i=(N)=>{if(_+=N.byteLength,!M||!W){if(O.push(N),P+=N.byteLength,P>A)$({kind:"resolved",reason:"output_backpressure"});return}try{W.send(N)}catch{$({kind:"resolved",reason:"relay_closed"});return}if(W.bufferedAmount>A)$({kind:"resolved",reason:"output_backpressure"})};try{X=(H.spawnPty??zz)({shell:R,args:["-i","-l"],cwd:C,cols:J.cols,rows:J.rows,environment:D,onData:(N)=>{if(!K)i(N)}})}catch(N){$({kind:"rejected",error:N instanceof Q?N:new Q("pty_spawn_failed","Reason could not start the terminal shell.")});return}X.exited.then((N)=>{if(K)return;if(T=N,M&&W)try{W.send(JSON.stringify({t:"exit",code:N}))}catch{}$({kind:"resolved",reason:"shell_exited"})});let c=(H.loadProxy??m)()?.url;try{W=(H.connect??Hz)(J.relay_url,c)}catch{$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}W.binaryType="arraybuffer",W.onopen=()=>{if(K||!W)return;M=!0;try{W.send(JSON.stringify({t:"open",cols:J.cols,rows:J.rows}));for(let N of O.splice(0))W.send(N);P=0}catch{$({kind:"resolved",reason:"relay_closed"});return}f=!0,z.emitEvent("pty.ready",{session_id:J.session_id,cols:J.cols,rows:J.rows}).catch(()=>{return})},W.onmessage=(N)=>{if(K||!X)return;let G=N.data;if(typeof G==="string"){let F;try{F=JSON.parse(G)}catch{return}if(!v(F))return;if(F.t==="resize"){try{X.resize(q(F.cols,J.cols),q(F.rows,J.rows))}catch{}return}if(F.t==="close")$({kind:"resolved",reason:"client_closed"});return}let E=G instanceof ArrayBuffer?new Uint8Array(G):ArrayBuffer.isView(G)?new Uint8Array(G.buffer,G.byteOffset,G.byteLength):null;if(!E||E.byteLength===0)return;b+=E.byteLength;try{X.write(E)}catch{}},W.onclose=()=>{if(K)return;if(!f){$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}$({kind:"resolved",reason:"relay_closed"})},W.onerror=()=>{if(K||f)return;$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")})}})}
3
- export{r as Rf,A as Sf,l as Tf,n as Uf,U as Vf,t as Wf,Dz as Xf,zz as Yf,Hz as Zf,Kz as _f};
2
+ import{yg as m}from"./vm-hands-entry-lite-s98hjhz3.js";import{Mg as w}from"./vm-hands-entry-lite-v08mjs3f.js";import{Si as h}from"./vm-hands-entry-lite-1j9r1fca.js";import{dj as x}from"./vm-hands-entry-lite-w88zkzhr.js";import{Wj as Q}from"./vm-hands-entry-lite-ygx9kj92.js";import{existsSync as B,realpathSync as k,statSync as s}from"fs";import{platform as p}from"os";import{isAbsolute as y,sep as d}from"path";var r=43200000,A=w,l=4,u=/^[A-Za-z0-9._:-]{1,160}$/,a=1000;function v(z){return Boolean(z)&&typeof z==="object"&&!Array.isArray(z)}function q(z,H){if(typeof z!=="number"||!Number.isFinite(z)||z<=0)return H;return Math.min(a,Math.max(1,Math.floor(z)))}function n(z,H=Date.now()){let V=["relay_url","session_id","expires_at"],J=new Set([...V,"cols","rows","cwd","workspace"]);if(!v(z)||V.some((L)=>!(L in z))||Object.keys(z).some((L)=>!J.has(L)))throw new Q("invalid_pty_request","Reason terminal request is malformed.");let{relay_url:j,session_id:Y,expires_at:C}=z;if(typeof j!=="string")throw new Q("invalid_pty_request","Reason terminal relay URL is missing.");let D;try{D=new URL(j)}catch{throw new Q("invalid_pty_request","Reason terminal relay URL is invalid.")}if(D.protocol!=="wss:"&&D.protocol!=="ws:"||D.username||D.password)throw new Q("invalid_pty_request","Reason terminal relay URL is invalid.");if(typeof Y!=="string"||!u.test(Y))throw new Q("invalid_pty_request","Reason terminal session identity is invalid.");let R=typeof C==="string"?Date.parse(C):Number.NaN;if(!Number.isFinite(R)||R<=H)throw new Q("invalid_pty_request","Reason terminal session has already expired.");if(z.cwd!==void 0&&typeof z.cwd!=="string")throw new Q("invalid_pty_request","Reason terminal working directory is invalid.");let Z=z.workspace===void 0?void 0:x(z.workspace);if(Z===null||Z&&z.cwd!==void 0)throw new Q("invalid_pty_request","Reason terminal workspace is invalid.");return{relay_url:j,session_id:Y,expires_at:new Date(Math.min(R,H+r)).toISOString(),cols:q(z.cols,80),rows:q(z.rows,24),...z.cwd===void 0?{}:{cwd:z.cwd},...Z?{workspace:Z}:{}}}function o(z,H){return H===z||H.startsWith(z+d)}function U(z,H){if(H===void 0)return z;if(!y(H))throw new Q("pty_cwd_invalid","Reason terminal working directory must be absolute.");let V;try{V=k(H)}catch{throw new Q("pty_cwd_invalid","Reason terminal working directory does not exist.")}if(!o(z,V))throw new Q("pty_cwd_outside_root","Reason terminal working directory escapes the granted root.");if(!s(V).isDirectory())throw new Q("pty_cwd_invalid","Reason terminal working directory is not a directory.");return V}function t(z=process.env){let H=z.SHELL;if(H&&y(H)&&B(H))return H;for(let V of p()==="darwin"?["/bin/zsh","/bin/bash","/bin/sh"]:["/bin/bash","/bin/sh"])if(B(V))return V;return"/bin/sh"}function e(){let z=globalThis.Bun;if(!z)throw new Q("pty_unavailable","Reason terminals require the Bun runtime.");return z.spawn}function Dz(){return typeof globalThis.Bun<"u"}var zz=(z)=>{let H=e()({cmd:[z.shell,"-i","-l"],cwd:z.cwd,env:{...z.environment,TERM:"xterm-256color"},terminal:{cols:z.cols,rows:z.rows,data:(J,j)=>{z.onData(j)}}}),V=H.terminal;if(!V){try{H.kill()}catch{}throw new Q("pty_unavailable","Reason could not allocate a pseudo-terminal.")}return{write:(J)=>V.write(J),resize:(J,j)=>V.resize(J,j),kill:()=>{try{H.kill()}catch{}},exited:H.exited.then((J)=>typeof J==="number"?J:null,()=>null)}},Hz=(z,H)=>{return H===void 0?new WebSocket(z):new WebSocket(z,{proxy:H})},S=new Set;function Jz(z){if(S.size>=l||S.has(z))return null;S.add(z);let H=!1;return()=>{if(H)return;H=!0,S.delete(z)}}async function Kz(z,H={}){let V=H.now??Date.now,J=n(z.payload,V()),j=Jz(z.operationId);if(!j)throw new Q("pty_slot_busy","This Reason Device already runs the maximum number of terminals.");let Y=V(),C,D,R;try{let Z=J.workspace?h(z.root,J.workspace):void 0;C=Z?U(B(Z.boundary)?k(Z.boundary):Z.boundary,Z.path):U(z.root,J.cwd),D=H.environment??process.env,R=H.shellPath??t(D)}catch(Z){throw j(),Z}return await new Promise((Z,L)=>{let X=null,W=null,M=!1,f=!1,K=!1,T=null,_=0,b=0,O=[],P=0,g=null,$=(N)=>{if(K)return;if(K=!0,g)clearTimeout(g);z.signal.removeEventListener("abort",I);try{X?.kill()}catch{}try{W?.close(1000,"pty_session_over")}catch{}if(j(),N.kind==="rejected"){L(N.error);return}let G={reason:N.reason,exit_code:T,output_bytes:_,input_bytes:b,duration_ms:Math.max(0,V()-Y)};z.emitEvent("pty.stopped",{...G}).catch(()=>{return}),Z({...G})},I=()=>{let N=z.signal.reason;$({kind:"rejected",error:N instanceof Q?N:new Q("cancelled","Reason closed the terminal session.")})};if(z.signal.aborted){I();return}z.signal.addEventListener("abort",I,{once:!0}),g=setTimeout(()=>$({kind:"resolved",reason:"session_expired"}),Math.max(1,Date.parse(J.expires_at)-V()));let i=(N)=>{if(_+=N.byteLength,!M||!W){if(O.push(N),P+=N.byteLength,P>A)$({kind:"resolved",reason:"output_backpressure"});return}try{W.send(N)}catch{$({kind:"resolved",reason:"relay_closed"});return}if(W.bufferedAmount>A)$({kind:"resolved",reason:"output_backpressure"})};try{X=(H.spawnPty??zz)({shell:R,args:["-i","-l"],cwd:C,cols:J.cols,rows:J.rows,environment:D,onData:(N)=>{if(!K)i(N)}})}catch(N){$({kind:"rejected",error:N instanceof Q?N:new Q("pty_spawn_failed","Reason could not start the terminal shell.")});return}X.exited.then((N)=>{if(K)return;if(T=N,M&&W)try{W.send(JSON.stringify({t:"exit",code:N}))}catch{}$({kind:"resolved",reason:"shell_exited"})});let c=(H.loadProxy??m)()?.url;try{W=(H.connect??Hz)(J.relay_url,c)}catch{$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}W.binaryType="arraybuffer",W.onopen=()=>{if(K||!W)return;M=!0;try{W.send(JSON.stringify({t:"open",cols:J.cols,rows:J.rows}));for(let N of O.splice(0))W.send(N);P=0}catch{$({kind:"resolved",reason:"relay_closed"});return}f=!0,z.emitEvent("pty.ready",{session_id:J.session_id,cols:J.cols,rows:J.rows}).catch(()=>{return})},W.onmessage=(N)=>{if(K||!X)return;let G=N.data;if(typeof G==="string"){let F;try{F=JSON.parse(G)}catch{return}if(!v(F))return;if(F.t==="resize"){try{X.resize(q(F.cols,J.cols),q(F.rows,J.rows))}catch{}return}if(F.t==="close")$({kind:"resolved",reason:"client_closed"});return}let E=G instanceof ArrayBuffer?new Uint8Array(G):ArrayBuffer.isView(G)?new Uint8Array(G.buffer,G.byteOffset,G.byteLength):null;if(!E||E.byteLength===0)return;b+=E.byteLength;try{X.write(E)}catch{}},W.onclose=()=>{if(K)return;if(!f){$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}$({kind:"resolved",reason:"relay_closed"})},W.onerror=()=>{if(K||f)return;$({kind:"rejected",error:new Q("pty_relay_unavailable","Reason could not reach the terminal relay.")})}})}
3
+ export{r as $f,A as ag,l as bg,n as cg,U as dg,t as eg,Dz as fg,zz as gg,Hz as hg,Kz as ig};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Yh as A,Zh as w,_h as c,hi as x}from"./vm-hands-entry-lite-5kgvss4p.js";import{ni as l}from"./vm-hands-entry-lite-r6pap1kh.js";import{randomUUID as y}from"crypto";import{chmodSync as o,existsSync as u,mkdirSync as jJ,readlinkSync as YJ,readFileSync as GJ,renameSync as OJ,unlinkSync as VJ,writeFileSync as FJ}from"fs";import{homedir as m}from"os";import{basename as P,dirname as H,isAbsolute as d,join as I,normalize as p,relative as HJ,resolve as LJ}from"path";import{unlinkSync as WJ}from"fs";import{dirname as XJ,join as ZJ}from"path";function $J(J){return ZJ(XJ(J),"future-device-grant.json")}function s(J){try{WJ($J(J))}catch(Q){if(!(Q instanceof Error&&("code"in Q)&&Q.code==="ENOENT"))throw Q}}var N=3,NJ=1,TJ=2,K=1,n=1,a="Reason may read and write files and run commands in this signed-in OS account, subject to saved restrictions and operating system permissions.",b="Reason may later execute on this computer inside a Reason sandbox, limited to folders explicitly attached by the user.",zJ=[b,"Ara may later execute on this computer inside an Ara sandbox, limited to folders explicitly attached by the user."];function r(J){return typeof J==="string"&&zJ.includes(J)}var BJ=["future_device","updates_only","cli_only"];function v(J){return typeof J==="string"&&BJ.some((Q)=>Q===J)}function SJ(J=process.env,Q=m()){return J.XDG_CONFIG_HOME?.trim()||I(Q,".config")}function D(J=process.env,Q=m()){let U=w({env:J}),W=SJ(J,Q);return I(W,x(W).state==="kept"?"ara":"reason",...U==="staging"?["staging"]:[],"installation.json")}function Y(J){return typeof J==="string"&&J.trim().length>0}var _J=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function IJ(J){return typeof J==="string"&&_J.test(J)}function C(J){return Y(J)&&d(J)&&p(J)===J}function i(J){if(!J||typeof J!=="object"||Array.isArray(J))return!1;let Q=J;return C(Q.path)&&(Q.role==="launcher"&&(Q.kind==="file"||Q.kind==="symlink")||Q.role==="worker_root"&&Q.kind==="directory"||Q.role==="alias"&&Q.kind==="symlink"&&C(Q.target))}function h(J){return J.owned_paths?.every((Q)=>Q.role!=="alias"||J.installer==="shell"&&Q.path===I(J.install_dir,J.channel==="staging"?"reason-staging":"reason")&&Q.target===I(J.install_dir,J.channel==="staging"?"ara-staging":"ara")&&J.owned_paths?.some((U)=>U.role==="launcher"&&U.path===Q.target))??!1}function t(J,Q){try{return LJ(H(J),YJ(J))===Q}catch{return!1}}function vJ(J){let Q=P(J),U=Q==="ara"?"reason":Q==="ara-staging"?"reason-staging":null;if(!U)return J;let W=I(H(J),U);return t(W,J)?W:J}function M(J,Q){let U=HJ(J,Q);return U.length>0&&!U.startsWith("..")&&!d(U)}function e(J){if(J===null)return!0;if(!J||typeof J!=="object"||Array.isArray(J))return!1;let Q=J;return Q.kind==="shell_profile"&&Y(Q.location)&&Y(Q.value)&&(typeof Q.added_by_installer==="boolean"||typeof Q.added_by_ara==="boolean")&&(Q.added_by_installer===void 0||typeof Q.added_by_installer==="boolean")&&(Q.added_by_ara===void 0||typeof Q.added_by_ara==="boolean")}function q(J){return J.added_by_installer??J.added_by_ara??!1}function JJ(J,Q){if(Q===null)return J==="cli_only";if(!Q||typeof Q!=="object"||Array.isArray(Q))return!1;let U=Q;if(U.version!==K||!Y(U.recorded_at))return!1;if(J==="future_device")return U.decision==="authorized"&&r(U.scope);return U.scope===null&&U.decision===(J==="updates_only"?"ask":"disabled")}function AJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return null;let Q=J;if(Q.schema_version!==NJ||!A.includes(Q.channel)||Q.install_method!=="curl"||Q.installer!=="shell"||!Y(Q.installed_at)||!Y(Q.version)||!Y(Q.target)||!C(Q.install_dir)||!Array.isArray(Q.owned_paths)||!Q.owned_paths.every(i)||!Q.owned_paths.every((U)=>M(Q.install_dir,U.path))||!h(Q)||!e(Q.path_entry))return null;return{...Q,schema_version:N,installation_id:null,background_mode:"cli_only",device_consent:null}}function KJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return null;let Q=J;if(Q.schema_version!==TJ||!QJ(Q)||!v(Q.background_mode)||!JJ(Q.background_mode,Q.device_consent))return null;return{...Q,schema_version:N,installation_id:null}}function QJ(J){return A.includes(J.channel)&&(J.install_method==="curl"&&J.installer==="shell"||J.install_method==="desktop"&&J.installer==="desktop"&&Array.isArray(J.owned_paths)&&J.owned_paths.length===0&&J.path_entry===null)&&Y(J.installed_at)&&Y(J.version)&&Y(J.target)&&C(J.install_dir)&&Array.isArray(J.owned_paths)&&J.owned_paths.every(i)&&J.owned_paths.every((Q)=>M(J.install_dir,Q.path))&&h(J)&&e(J.path_entry)}function DJ(J){let Q=AJ(J);if(Q)return Q;let U=KJ(J);if(U)return U;if(!J||typeof J!=="object"||Array.isArray(J))return null;let W=J;if(W.schema_version!==N||!IJ(W.installation_id)||!QJ(W)||!v(W.background_mode)||!JJ(W.background_mode,W.device_consent)||W.desktop_account_access!==void 0&&(W.desktop_account_access===null||typeof W.desktop_account_access!=="object"||Array.isArray(W.desktop_account_access)||W.desktop_account_access.version!==n||W.desktop_account_access.scope!==a||!Y(W.desktop_account_access.recorded_at)||!Number.isFinite(Date.parse(W.desktop_account_access.recorded_at))))return null;return W}function E(J=D()){if(!u(J))return null;try{return DJ(JSON.parse(GJ(J,"utf8")))}catch{return null}}function f(J){return Boolean(J?.installation_id&&J.background_mode==="future_device"&&J.device_consent?.version===K&&J.device_consent.decision==="authorized"&&r(J.device_consent.scope))}function g(J,Q){let U=E(Q);if(!(f(U)&&f(J)&&U.installation_id===J.installation_id&&U.channel===J.channel))s(Q);jJ(H(Q),{recursive:!0,mode:448}),o(H(Q),448);let X=`${Q}.${process.pid}.${y()}.tmp`;try{FJ(X,`${JSON.stringify(J,null,2)}
3
+ `,{mode:384,flag:"wx"}),o(X,384),OJ(X,Q)}finally{if(u(X))VJ(X)}let j=H(Q),$=P(j)==="staging"?H(j):j;if(P($)==="reason")x(H($));return J}function RJ(J=D(),Q=new Date){let U=E(J);if(!U?.installation_id)throw Error("Reason installation ownership is missing; reinstall the current CLI before enabling Device execution");if(f(U))return U;let W={...U,background_mode:"future_device",device_consent:{version:K,decision:"authorized",scope:b,recorded_at:Q.toISOString()}};return delete W.desktop_account_access,g(W,J)}function hJ(J,Q=D(),U=new Date){if(!A.includes(J.channel))throw Error("invalid installation channel");if(!J.version.trim())throw Error("installation version is required");if(!J.target.trim())throw Error("installation target is required");let W=S(J.installDir,"install directory"),X=E(Q);if(X?.installation_id&&!J.accountAccess)return RJ(Q,U);return g({...X??{schema_version:N,channel:J.channel,install_method:"desktop",installer:"desktop",installed_at:U.toISOString(),version:J.version.trim(),target:J.target.trim(),install_dir:W,owned_paths:[],path_entry:null},schema_version:N,installation_id:X?.installation_id??y(),background_mode:"future_device",...J.accountAccess?{desktop_account_access:{version:n,scope:a,recorded_at:U.toISOString()}}:{},device_consent:{version:K,decision:"authorized",scope:b,recorded_at:U.toISOString()}},Q)}function qJ(J,Q){return J.kind===Q.kind&&J.location===Q.location&&J.value===Q.value}function S(J,Q){let U=p(J);if(!d(U))throw Error(`${Q} must be an absolute path`);return U}function CJ(J,Q=D(),U=new Date){if(!A.includes(J.channel))throw Error("invalid installation channel");if(!J.version.trim())throw Error("installation version is required");if(!J.target.trim())throw Error("installation target is required");let W=S(J.install_dir,"install directory"),X=E(Q),j=J.backgroundMode??"preserve",$=j==="preserve"?X?.background_mode??"cli_only":j,T=X?.channel===J.channel&&f(X)&&$==="future_device",z=j==="preserve"&&!X||X?.channel===J.channel&&(j==="preserve"||T),O={path:S(J.launcherPath,"launcher path"),kind:J.launcherKind,role:"launcher"};if(!M(W,O.path))throw Error("launcher path must be inside the install directory");let V=J.workerRoot?S(J.workerRoot,"worker root"):null;if(V&&!M(W,V))throw Error("worker root must be inside the install directory");let B=[];if(J.aliasPath){let F={path:S(J.aliasPath,"alias path"),kind:"symlink",role:"alias",target:O.path};if(!h({installer:J.installer,channel:J.channel,install_dir:W,owned_paths:[O,F]})||!t(F.path,F.target))throw Error("alias must be the channel's symlink to its canonical launcher");B.push(F)}let R=[...X?.channel===J.channel&&X.install_dir===W?X.owned_paths:[],O,...B,...V?[{path:V,kind:"directory",role:"worker_root"}]:[]],k=Array.from(new Map(R.map((F)=>[F.path,F])).values()),Z=J.pathEntry??null,L=Z?X?.path_entry&&qJ(Z,X.path_entry)?{...Z,added_by_installer:q(Z)||q(X.path_entry),added_by_ara:q(Z)||q(X.path_entry)}:Z:X?.path_entry??null,UJ={schema_version:N,installation_id:X?.installation_id??y(),channel:J.channel,install_method:"curl",installer:J.installer,installed_at:U.toISOString(),version:J.version.trim(),target:J.target.trim(),install_dir:W,owned_paths:k,path_entry:L,background_mode:$,device_consent:z?X?.device_consent??null:{version:K,decision:$==="future_device"?"authorized":$==="updates_only"?"ask":"disabled",scope:$==="future_device"?b:null,recorded_at:U.toISOString()},...T&&X.desktop_account_access?{desktop_account_access:X.desktop_account_access}:{}};return g(UJ,Q)}function _(J,Q){let U=J.indexOf(Q);if(U===-1)return;let W=J[U+1];if(!W||W.startsWith("--"))throw Error(`${Q} needs a value`);return W}function G(J,Q){let U=_(J,Q);if(!U)throw Error(`${Q} is required`);return U}function gJ(J,Q={}){let U=Q.io??{stdout:process.stdout,stderr:process.stderr};try{let W=new Set(["--channel","--installer","--version","--target","--install-dir","--launcher-path","--launcher-kind","--worker-root","--path-kind","--path-location","--path-value","--background-mode"]);for(let Z=0;Z<J.length;Z+=1){let L=J[Z];if(L==="--path-added")continue;if(!W.has(L))throw Error(`unknown option: ${L}`);if(Z+=1,Z>=J.length)throw Error(`${L} needs a value`)}let X=Q.env??process.env,j=G(J,"--channel"),$=w({env:X,executablePath:Q.executablePath});if(j!==$)throw Error(`installer channel ${j} does not match running ${$} CLI`);let T=G(J,"--installer");if(T!=="shell")throw Error("--installer must be shell");let z=G(J,"--launcher-kind");if(z!=="file"&&z!=="symlink")throw Error("--launcher-kind must be file or symlink");let O=_(J,"--path-kind"),V=null;if(O){if(O!=="shell_profile")throw Error("--path-kind must be shell_profile");V={kind:O,location:G(J,"--path-location"),value:G(J,"--path-value"),added_by_installer:J.includes("--path-added"),added_by_ara:J.includes("--path-added")}}else if(J.includes("--path-location")||J.includes("--path-value")||J.includes("--path-added"))throw Error("path entry flags require --path-kind");let B={channel:$,install_method:"curl",installer:T,version:G(J,"--version"),target:G(J,"--target"),install_dir:G(J,"--install-dir"),launcherPath:G(J,"--launcher-path"),launcherKind:z,..._(J,"--worker-root")?{workerRoot:_(J,"--worker-root")}:{},pathEntry:V,backgroundMode:(()=>{let Z=_(J,"--background-mode")??"preserve";if(Z!=="preserve"&&!v(Z))throw Error("--background-mode must be future_device, updates_only, cli_only, or preserve");return Z})()},R=l(X,"REASON_INSTALL_ALIAS_PATH");if(R)B.aliasPath=R;let k=D(c(X,$),Q.home??m());return(Q.writeReceipt??CJ)(B,k,Q.now?.()??new Date),0}catch(W){return U.stderr.write(`Reason installer receipt: ${W instanceof Error?W.message:String(W)}
4
+ `),1}}
5
+ export{N as Xd,K as Yd,n as Zd,a as _d,b as $d,BJ as ae,SJ as be,D as ce,t as de,vJ as ee,q as fe,DJ as ge,E as he,f as ie,RJ as je,hJ as ke,CJ as le,gJ as me};