@reason-machines/cli-linux-arm64-musl 0.2.343 → 0.2.345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ara +1 -1
- package/bin/vm-hands/api-credentials-d34gw13p.js +2 -0
- package/bin/vm-hands/api-t5zxz49k.js +2 -0
- package/bin/vm-hands/{ask-relay-d96qx4ez.js → ask-relay-bczg32b2.js} +2 -2
- package/bin/vm-hands/connect-cli-789rv77k.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-whc0qjdv.js → custom-endpoint-device-syw4d5k4.js} +1 -1
- package/bin/vm-hands/desktop-account-pm3zxjjt.js +2 -0
- package/bin/vm-hands/{device-workspace-1abchg0z.js → device-workspace-s49yhsk7.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-9mq68whc.js → hands-worker-source-0ca76sbd.js} +1 -1
- package/bin/vm-hands/{index-5a4yhzf8.js → index-t1h1wd8g.js} +1 -1
- package/bin/vm-hands/local-automation-ms5cgtgc.js +2 -0
- package/bin/vm-hands/local-capabilities-jfmzy2qt.js +2 -0
- package/bin/vm-hands/local-desktop-users-zxw8xxw9.js +2 -0
- package/bin/vm-hands/local-display-mac-jdgx19jw.js +2 -0
- package/bin/vm-hands/local-display-session-v8g6x39d.js +2 -0
- package/bin/vm-hands/local-pty-session-frp7k8fz.js +2 -0
- package/bin/vm-hands/{network-contract-7y9z06qs.js → network-contract-8d4bpy3e.js} +1 -1
- package/bin/vm-hands/package-vj1s3sye.js +2 -0
- package/bin/vm-hands/permissions-9vwmb8cz.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-mm6kwqk8.js → reason-hands-protocol-k12eme4q.js} +1 -1
- package/bin/vm-hands/{status-2mbhthe2.js → status-jfa65qn3.js} +2 -2
- package/bin/vm-hands/version-mzcyw4fg.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-0zr461f9.js → vm-hands-entry-lite-0jar357h.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-pn6vyghh.js → vm-hands-entry-lite-0wyjnvjz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-va7g1e1f.js → vm-hands-entry-lite-1jhry648.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ckehp0dy.js → vm-hands-entry-lite-1w8tvrpq.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-70d6f5r9.js → vm-hands-entry-lite-1xjtcxpn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-3s5fdvat.js → vm-hands-entry-lite-289bc9v7.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-3c4qwk4d.js → vm-hands-entry-lite-2e50z7hj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-6z2g0td2.js → vm-hands-entry-lite-2xh7sjs0.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-36xzwsxn.js +42 -0
- package/bin/vm-hands/{vm-hands-entry-lite-p7x3vnz5.js → vm-hands-entry-lite-7ba3nhgv.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-jjq3xq9z.js → vm-hands-entry-lite-8dvf3de9.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-p9eyqdq7.js → vm-hands-entry-lite-9dx3at21.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-8zencenv.js → vm-hands-entry-lite-ac6zyrj1.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-q1ekx7k0.js → vm-hands-entry-lite-b38m8a8m.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-60t59y3n.js → vm-hands-entry-lite-b8y45rcs.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ypcqvygf.js → vm-hands-entry-lite-gt5pkv4h.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-dqqjy7kj.js → vm-hands-entry-lite-hywf6580.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-xv868vfm.js → vm-hands-entry-lite-jy102628.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-3gf1yegq.js → vm-hands-entry-lite-k2cvr710.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bfh3cnh2.js → vm-hands-entry-lite-k2e3q5qj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2mhzfg6b.js → vm-hands-entry-lite-knfh7w3j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-vn0r1e8c.js → vm-hands-entry-lite-kt418g2w.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tt4zgt64.js → vm-hands-entry-lite-m16qf0yy.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-45cnnd8e.js → vm-hands-entry-lite-mhsv58hw.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2c8m8m7v.js → vm-hands-entry-lite-pa111vpq.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5qe562gn.js → vm-hands-entry-lite-pnkfgnqz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-21sg3fyz.js → vm-hands-entry-lite-tfpebnar.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-qezqtm4g.js → vm-hands-entry-lite-x6jqyxkx.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-y16b538h.js +529 -0
- package/bin/vm-hands/{vm-hands-entry-lite-xazz63m6.js → vm-hands-entry-lite-y4mtveeb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-bs1mbk81.js → vm-hands-entry-lite-yeahy7rk.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-wqn9mnsj.js → vm-hands-executor-tyxvq0j1.js} +1 -1
- package/bin/vm-hands/vm-hands-op-runner-k79jadt5.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-bwvpt55d.js → vm-hands-runtime-dq1t8vee.js} +3 -3
- package/bin/vm-hands/worker-sandbox-1kpm6af4.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-7wdzy9by.js +0 -2
- package/bin/vm-hands/api-jq1fd10n.js +0 -2
- package/bin/vm-hands/connect-cli-cp0zh5f8.js +0 -2
- package/bin/vm-hands/desktop-account-j9pxgjn0.js +0 -2
- package/bin/vm-hands/local-automation-v0r1k6v9.js +0 -2
- package/bin/vm-hands/local-capabilities-9y6jj12c.js +0 -2
- package/bin/vm-hands/local-desktop-users-gxkmx7rv.js +0 -2
- package/bin/vm-hands/local-display-mac-6ktqrbas.js +0 -2
- package/bin/vm-hands/local-display-session-ab79qr64.js +0 -2
- package/bin/vm-hands/local-pty-session-3592ene9.js +0 -2
- package/bin/vm-hands/package-ffnz28tt.js +0 -2
- package/bin/vm-hands/permissions-ddm9as7j.js +0 -2
- package/bin/vm-hands/version-xdgmrx9d.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-1sq7jgg0.js +0 -529
- package/bin/vm-hands/vm-hands-entry-lite-bbc5r4y1.js +0 -42
- package/bin/vm-hands/vm-hands-op-runner-8nw0g7v3.js +0 -2
- package/bin/vm-hands/worker-sandbox-4mraqzsg.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{r as
|
|
2
|
+
import{tg as m}from"./vm-hands-entry-lite-kt418g2w.js";import{Cg as w}from"./vm-hands-entry-lite-knfh7w3j.js";import{Ph as h}from"./vm-hands-entry-lite-9dx3at21.js";import{ai as x}from"./vm-hands-entry-lite-289bc9v7.js";import{ui as Q}from"./vm-hands-entry-lite-gt5pkv4h.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 Vf,A as Wf,l as Xf,n as Yf,U as Zf,t as _f,Dz as $f,zz as ag,Hz as bg,Kz as cg};
|