@reason-machines/cli-linux-arm64-musl 0.2.371 → 0.2.373
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-af9g18n7.js +2 -0
- package/bin/vm-hands/api-credentials-65mrr3tn.js +2 -0
- package/bin/vm-hands/{ask-relay-dq0v3bmt.js → ask-relay-8z5hmrxz.js} +3 -3
- package/bin/vm-hands/connect-cli-nnhwmhv1.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-wmcf39x6.js → custom-endpoint-device-zhpake9f.js} +1 -1
- package/bin/vm-hands/desktop-account-5zvgspyw.js +2 -0
- package/bin/vm-hands/{device-workspace-05nkwrpp.js → device-workspace-vbcry9d6.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-5wv1djgv.js → hands-worker-source-h0b1j53p.js} +1 -1
- package/bin/vm-hands/{index-kf4q2kw5.js → index-bbk6a9sk.js} +1 -1
- package/bin/vm-hands/{install-receipt-vaytv1sf.js → install-receipt-7x81ek76.js} +1 -1
- package/bin/vm-hands/local-automation-wvtn0q4x.js +2 -0
- package/bin/vm-hands/local-capabilities-bnhpw82g.js +2 -0
- package/bin/vm-hands/local-desktop-users-0hadyvx1.js +2 -0
- package/bin/vm-hands/local-display-mac-v1pc7177.js +2 -0
- package/bin/vm-hands/local-display-session-n7ep9gbv.js +2 -0
- package/bin/vm-hands/local-pty-session-hs7rq03x.js +2 -0
- package/bin/vm-hands/{managed-runtime-dz0rtyvr.js → managed-runtime-qwrw5tyb.js} +1 -1
- package/bin/vm-hands/network-contract-zqvt1v0t.js +2 -0
- package/bin/vm-hands/package-3cd7cfyv.js +2 -0
- package/bin/vm-hands/permissions-xv54fbmk.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-dase3v7x.js → reason-hands-protocol-8fxjynte.js} +1 -1
- package/bin/vm-hands/{serve-service-47q4bmhj.js → serve-service-hw16p091.js} +1 -1
- package/bin/vm-hands/{status-czgrayjt.js → status-n6bv9tmq.js} +2 -2
- package/bin/vm-hands/version-jc5w4cnv.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2c88t2at.js → vm-hands-entry-lite-00qsbphw.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-w4swepp1.js → vm-hands-entry-lite-1085xsma.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-gbzvzfe6.js → vm-hands-entry-lite-2c1pz48d.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-gteq5e1n.js → vm-hands-entry-lite-3fdaf4hf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-sfsgeynk.js → vm-hands-entry-lite-3hbe4em3.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-nhfd61cx.js → vm-hands-entry-lite-45j8qwsf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-rjwk6sfj.js → vm-hands-entry-lite-4m40gwkf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-gzyps3ev.js → vm-hands-entry-lite-5kgvss4p.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-e8skq97c.js → vm-hands-entry-lite-7shpbsw8.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-db4z7ekz.js → vm-hands-entry-lite-9cgm6g8t.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-dq1fdx0j.js → vm-hands-entry-lite-anmv8hp7.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ngytzkx1.js → vm-hands-entry-lite-bvbfcp1k.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-9fr904x2.js → vm-hands-entry-lite-c01eyep6.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-b775ysr4.js → vm-hands-entry-lite-dcynw6t2.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-vygp7vq8.js → vm-hands-entry-lite-dgxxsdwb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5mz0m0k0.js → vm-hands-entry-lite-fysena9h.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-7fx4xtf6.js → vm-hands-entry-lite-g036gtem.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-e9gq8n0f.js → vm-hands-entry-lite-g9sz0618.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-ha8fgq32.js +540 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zmf1terc.js → vm-hands-entry-lite-hc3p6r9p.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-y3wncwjd.js → vm-hands-entry-lite-j2q1k9vb.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-d7y6aah1.js → vm-hands-entry-lite-jb2sr2r7.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k7twc1ch.js → vm-hands-entry-lite-jpq28ncg.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-khjrcwrj.js +5 -0
- package/bin/vm-hands/{vm-hands-entry-lite-g576hpce.js → vm-hands-entry-lite-kxdw4myj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-kc07ptqt.js → vm-hands-entry-lite-m8jcht6h.js} +77 -77
- package/bin/vm-hands/{vm-hands-entry-lite-ymwv38dd.js → vm-hands-entry-lite-m9awmyqz.js} +23 -23
- package/bin/vm-hands/{vm-hands-entry-lite-8sddhaka.js → vm-hands-entry-lite-mh0xecf3.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bt6esncn.js → vm-hands-entry-lite-nhtb458c.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-8emxhcny.js → vm-hands-entry-lite-pt4r24ky.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5zmn6a7p.js → vm-hands-entry-lite-r6pap1kh.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-zyc3qkej.js → vm-hands-entry-lite-s6twc8n9.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-mcv6pse6.js → vm-hands-entry-lite-sb9a1jcn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5n6agg8d.js → vm-hands-entry-lite-t535zmjz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-cxgbb2yr.js → vm-hands-entry-lite-z4hpfwbj.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-dm52srp5.js → vm-hands-entry-lite-za55dtte.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-x9pmwqjd.js → vm-hands-entry-lite-ze9msfq1.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-2fyemnas.js → vm-hands-entry-lite-zfwg7ehq.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-y9wkxydj.js → vm-hands-entry-lite-zh8p7ndn.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-676cpsf2.js → vm-hands-executor-z89arnng.js} +2 -2
- package/bin/vm-hands/vm-hands-op-runner-2c9g8djj.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-d2jafcp6.js → vm-hands-runtime-qc1205w5.js} +3 -3
- package/bin/vm-hands/worker-sandbox-wpzkvwer.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-ke2v1y5k.js +0 -2
- package/bin/vm-hands/api-ewpnfn05.js +0 -2
- package/bin/vm-hands/connect-cli-atmwwkqh.js +0 -2
- package/bin/vm-hands/desktop-account-cppm1dhr.js +0 -2
- package/bin/vm-hands/local-automation-yrra6zkg.js +0 -2
- package/bin/vm-hands/local-capabilities-ykbksvha.js +0 -2
- package/bin/vm-hands/local-desktop-users-ejwwkfer.js +0 -2
- package/bin/vm-hands/local-display-mac-x0eq4rzq.js +0 -2
- package/bin/vm-hands/local-display-session-xkbc5knp.js +0 -2
- package/bin/vm-hands/local-pty-session-pzg7bk32.js +0 -2
- package/bin/vm-hands/network-contract-zez17y8t.js +0 -2
- package/bin/vm-hands/package-gxv23nam.js +0 -2
- package/bin/vm-hands/permissions-jmcvwvgd.js +0 -2
- package/bin/vm-hands/version-42fp9wnk.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-8cmyg5e4.js +0 -540
- package/bin/vm-hands/vm-hands-entry-lite-pt633d84.js +0 -5
- package/bin/vm-hands/vm-hands-op-runner-4j51v1n0.js +0 -2
- package/bin/vm-hands/worker-sandbox-e4kvy715.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{s as Mq}from"./vm-hands-entry-lite-
|
|
2
|
+
import{s as Mq}from"./vm-hands-entry-lite-3fdaf4hf.js";import{Lb as Uq,pc as Fq,rb as Lq,tc as Tq}from"./vm-hands-entry-lite-m9awmyqz.js";import"./vm-hands-entry-lite-sb9a1jcn.js";import"./vm-hands-entry-lite-anmv8hp7.js";import"./vm-hands-entry-lite-zfwg7ehq.js";import"./vm-hands-entry-lite-dgxxsdwb.js";import"./vm-hands-entry-lite-zh8p7ndn.js";import"./vm-hands-entry-lite-za55dtte.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-4m40gwkf.js";import"./vm-hands-entry-lite-c01eyep6.js";import"./vm-hands-entry-lite-9cgm6g8t.js";import"./vm-hands-entry-lite-2c1pz48d.js";import"./vm-hands-entry-lite-hc3p6r9p.js";import"./vm-hands-entry-lite-bvbfcp1k.js";import"./vm-hands-entry-lite-j2q1k9vb.js";import"./vm-hands-entry-lite-g036gtem.js";import{spawn as Iq}from"child_process";import{chmodSync as vq,chownSync as Oq,existsSync as l,lstatSync as o,mkdirSync as e,mkdtempSync as bq,readdirSync as s,readFileSync as A,realpathSync as hq,rmdirSync as r,rmSync as xq,writeFileSync as E}from"fs";import{join as U}from"path";var wq="/sys/fs/cgroup/reason-payload",_="vm-hands",Vq="/run/ara-srt/fallbacks.jsonl",y="/reason-person",qq=5000,_q=1e4,zq="__VM_HANDS_PROOF_DIR__",Hq="__VM_HANDS_PROBE_NONCE__";class T extends Error{code;constructor(q,z){super(z);this.code=q}}function gq(q,z){if(!/^[0-9a-f-]{36}$/i.test(z))throw new T("vm_hands_bind_invalid","bad bind id");return U(q,_,`b-${z.toLowerCase()}`)}var kq=5000,Rq=(q)=>`'${q.replaceAll("'","'\\''")}'`;function iq(q){let z=q.cgroup??wq,J=q.init.layout.payload_uid,X=q.log??(()=>{}),G=new Map,W=new Map,B=0,P=()=>{try{let Z=A("/run/ara-srt/starts.jsonl","utf8"),Q=Z.slice(B>Z.length?0:B).split(`
|
|
3
3
|
`).filter(Boolean);B=Z.length;let Y=Q.map((L)=>{try{return Number(JSON.parse(L).elapsed_ms)||0}catch{return 0}});if(Y.length)X("vm_hands.srt_server_starts",{count:Y.length,elapsed_ms:Y.slice(0,8)})}catch{}},D=null,H=!1,O=q.srtCgroup??"/sys/fs/cgroup/reason-srt",C=()=>{D??=Gq()},b=0,h=()=>{try{let Z=A(Vq,"utf8"),Q=Z.slice(b>Z.length?0:b);b=Z.length;let Y=Q.split(`
|
|
4
|
-
`).filter(Boolean).slice(0,1000);if(!Y.length)return null;let L={},F=0;for(let M of Y)try{let R=JSON.parse(M),K=typeof R.code==="string"&&/^[a-z_]{1,40}$/.test(R.code)?R.code:"other";if(L[K]=(L[K]??0)+1,typeof R.elapsed_ms==="number")F=Math.max(F,R.elapsed_ms)}catch{L.unparsed=(L.unparsed??0)+1}return X("vm_hands.srt_fallbacks",{count:Y.length,codes:L,max_elapsed_ms:F}),{count:Y.length,codes:L,max_elapsed_ms:F}}catch{return null}},f=!1,m=(Z,Q,Y)=>{if(f)throw Error("vm_hands_pool_held");return Nq(Z,Q,Y)},d=(Z)=>(Q,Y,L)=>Iq("/bin/sh",["-c",`echo $$ > ${Rq(U(Z,"cgroup.procs"))} || exit 125; exec "$@"`,"vm-hands-join",Q,...Y],L),Nq=d(U(z,_)),u=U(z,_,"probe"),S=(Z)=>gq(z,Z),Aq=(Z)=>{let Q=S(Z);try{e(Q,{mode:493})}catch(Y){if(!(Y&&typeof Y==="object"&&("code"in Y)&&Y.code==="EEXIST"))throw new T("vm_hands_bind_failed","bind cgroup")}return Q},Pq=(Z)=>{try{r(S(Z))}catch{}},x=q.prespawn?Uq({spawnProcess:m,...q.relayDependencies?.sourceEntrypoint?{sourceEntrypoint:q.relayDependencies.sourceEntrypoint}:{},log:(Z,Q)=>X(Z,Q??{})}):null;x?.arm();let i=x?setInterval(()=>{x.arm()},kq):null;i?.unref?.();async function c(Z){let Q=G.get(Z);if(G.delete(Z),!Q)return;Q.abort.abort(),await Q.done}return{bindCgroup:S,async startExecutor(Z){if(C(),W.set(Z.bindId,Gq()),H=!0,!Z.claim)throw new T("vm_hands_bind_invalid","an executor needs the claim it serves");await c(Z.bindId);let{claim:Q,bindId:Y}=Z,L=Aq(Y),F=Q.owner;if(!F||typeof F.device_id!=="string"||typeof Q.root_id!=="string")throw new T("vm_hands_bind_invalid","claim without its owner Device or root");let M=new AbortController,R,K,j=new Promise(($,w)=>{R=$,K=w}),I,N=new Promise(($)=>{I=$}),V=Tq({headless:!0,hostExecution:!0,runtimeDirectory:q.runtimeDirectory,deviceIdentity:{deviceId:F.device_id,rootId:Q.root_id,apiOrigin:q.apiOrigin},claimOwner:Q.owner,root:q.root,runId:Q.run_id,operationId:Q.operation_id,attemptId:Q.attempt_id,payload:Object.fromEntries(Object.entries(Q.payload).filter(([$])=>!$.startsWith("vm_hands_"))),signal:M.signal,emitEvent:async($,w)=>{if($==="hands.ready"){R(w);return}if($==="hands.started"||$==="hands.stopped"||$==="hands.failed")return;await q.forward(Y,$,w)}},{...q.relayDependencies,spawnWorker:($)=>d(L)($.command,$.args,$.options),...x?{takePrespawnedWorker:($)=>{let w=x.take($);if(!w?.pid)return w;try{return E(U(L,"cgroup.procs"),String(w.pid)),w}catch{try{w.kill("SIGKILL")}catch{}return null}},adoptSpawnedWorker:x.adopt}:{}}).then(()=>{I("executor_stopped")},($)=>{let w=$&&typeof $==="object"&&"code"in $?String($.code):"executor_failed";K(new T(w,$ instanceof Error?$.message:String($))),I(w)}).finally(()=>K(new T("vm_hands_executor_exited","executor ended before it was ready")));G.set(Y,{abort:M,done:V,exited:N,operationId:Q.operation_id,runId:Q.run_id,expiresAtMs:Date.parse(String(Q.payload.expires_at??""))||0});let g=await j,a=g.executor_launch_id;if(typeof a!=="string")throw new T("vm_hands_bind_failed","executor ready without a launch id");return{launchId:a,readyData:g,applied:{hands_confinement:typeof Q.payload.hands_confinement==="string"?Q.payload.hands_confinement:null,browser_egress:Q.payload.browser_egress??null}}},takeSrtFallbacks:h,executorExited(Z){return G.get(Z)?.exited??new Promise(()=>{})},freezeBind(Z){let Q=S(Z);if(l(U(Q,"cgroup.freeze")))E(U(Q,"cgroup.freeze"),"1")},async killAndVerifyPayload(Z){let Q=new Set(Z?.keep??[]);if(Q.size||Z?.own)return Cq(Z?.bindId??null,Q,Z?.own===!0);f=!0;let Y=Yq();try{await Bq();let L=Promise.all([...G.keys()].map((K)=>c(K).catch(()=>{return})));P();let F=Date.now()+qq;await p(z,F,"payload"),await L;let M=(H||q.srtWarmLate?.()===!0)&&l(U(O,"cgroup.events"));if(M)await p(O,F,"srt");let R=Zq(J).filter((K)=>!v(K,y));if(D!==null){let K=Xq(D).filter((j)=>j!==process.pid&&!v(j,y));if(K.length)throw X("vm_hands.kill_strays",{strays:K.slice(0,16).map((j)=>{let I="?",N="?";try{I=A(`/proc/${j}/comm`,"utf8").trim().slice(0,32)}catch{}try{N=(A(`/proc/${j}/cgroup`,"utf8").split(`
|
|
4
|
+
`).filter(Boolean).slice(0,1000);if(!Y.length)return null;let L={},F=0;for(let M of Y)try{let R=JSON.parse(M),K=typeof R.code==="string"&&/^[a-z_]{1,40}$/.test(R.code)?R.code:"other";if(L[K]=(L[K]??0)+1,typeof R.elapsed_ms==="number")F=Math.max(F,R.elapsed_ms)}catch{L.unparsed=(L.unparsed??0)+1}return X("vm_hands.srt_fallbacks",{count:Y.length,codes:L,max_elapsed_ms:F}),{count:Y.length,codes:L,max_elapsed_ms:F}}catch{return null}},f=!1,m=(Z,Q,Y)=>{if(f)throw Error("vm_hands_pool_held");return Nq(Z,Q,Y)},d=(Z)=>(Q,Y,L)=>Iq("/bin/sh",["-c",`echo $$ > ${Rq(U(Z,"cgroup.procs"))} || exit 125; exec "$@"`,"vm-hands-join",Q,...Y],L),Nq=d(U(z,_)),u=U(z,_,"probe"),S=(Z)=>gq(z,Z),Aq=(Z)=>{let Q=S(Z);try{e(Q,{mode:493})}catch(Y){if(!(Y&&typeof Y==="object"&&("code"in Y)&&Y.code==="EEXIST"))throw new T("vm_hands_bind_failed","bind cgroup")}return Q},Pq=(Z)=>{try{r(S(Z))}catch{}},x=q.prespawn?Uq({spawnProcess:m,...q.relayDependencies?.sourceEntrypoint?{sourceEntrypoint:q.relayDependencies.sourceEntrypoint}:{},log:(Z,Q)=>X(Z,Q??{})}):null;x?.arm();let i=x?setInterval(()=>{x.arm()},kq):null;i?.unref?.();async function c(Z){let Q=G.get(Z);if(G.delete(Z),!Q)return;Q.abort.abort(),await Q.done}return{bindCgroup:S,async startExecutor(Z){if(C(),W.set(Z.bindId,Gq()),H=!0,!Z.claim)throw new T("vm_hands_bind_invalid","an executor needs the claim it serves");await c(Z.bindId);let{claim:Q,bindId:Y}=Z,L=Aq(Y),F=Q.owner;if(!F||typeof F.device_id!=="string"||typeof Q.root_id!=="string")throw new T("vm_hands_bind_invalid","claim without its owner Device or root");let M=new AbortController,R,K,j=new Promise(($,w)=>{R=$,K=w}),I,N=new Promise(($)=>{I=$}),V=Tq({headless:!0,hostExecution:!0,runtimeDirectory:q.runtimeDirectory,deviceIdentity:{deviceId:F.device_id,rootId:Q.root_id,apiOrigin:q.apiOrigin},claimOwner:Q.owner,root:q.root,runId:Q.run_id,operationId:Q.operation_id,attemptId:Q.attempt_id,payload:Object.fromEntries(Object.entries(Q.payload).filter(([$])=>!$.startsWith("vm_hands_"))),signal:M.signal,...Z.workspaceGrant?{workspaceGrant:Z.workspaceGrant}:{},emitEvent:async($,w)=>{if($==="hands.ready"){R(w);return}if($==="hands.started"||$==="hands.stopped"||$==="hands.failed")return;await q.forward(Y,$,w)}},{...q.relayDependencies,spawnWorker:($)=>d(L)($.command,$.args,$.options),...x?{takePrespawnedWorker:($)=>{let w=x.take($);if(!w?.pid)return w;try{return E(U(L,"cgroup.procs"),String(w.pid)),w}catch{try{w.kill("SIGKILL")}catch{}return null}},adoptSpawnedWorker:x.adopt}:{}}).then(()=>{I("executor_stopped")},($)=>{let w=$&&typeof $==="object"&&"code"in $?String($.code):"executor_failed";K(new T(w,$ instanceof Error?$.message:String($))),I(w)}).finally(()=>K(new T("vm_hands_executor_exited","executor ended before it was ready")));G.set(Y,{abort:M,done:V,exited:N,operationId:Q.operation_id,runId:Q.run_id,expiresAtMs:Date.parse(String(Q.payload.expires_at??""))||0});let g=await j,a=g.executor_launch_id;if(typeof a!=="string")throw new T("vm_hands_bind_failed","executor ready without a launch id");return{launchId:a,readyData:g,applied:{hands_confinement:typeof Q.payload.hands_confinement==="string"?Q.payload.hands_confinement:null,browser_egress:Q.payload.browser_egress??null}}},takeSrtFallbacks:h,executorExited(Z){return G.get(Z)?.exited??new Promise(()=>{})},freezeBind(Z){let Q=S(Z);if(l(U(Q,"cgroup.freeze")))E(U(Q,"cgroup.freeze"),"1")},async killAndVerifyPayload(Z){let Q=new Set(Z?.keep??[]);if(Q.size||Z?.own)return Cq(Z?.bindId??null,Q,Z?.own===!0);f=!0;let Y=Yq();try{await Bq();let L=Promise.all([...G.keys()].map((K)=>c(K).catch(()=>{return})));P();let F=Date.now()+qq;await p(z,F,"payload"),await L;let M=(H||q.srtWarmLate?.()===!0)&&l(U(O,"cgroup.events"));if(M)await p(O,F,"srt");let R=Zq(J).filter((K)=>!v(K,y));if(D!==null){let K=Xq(D).filter((j)=>j!==process.pid&&!v(j,y));if(K.length)throw X("vm_hands.kill_strays",{strays:K.slice(0,16).map((j)=>{let I="?",N="?";try{I=A(`/proc/${j}/comm`,"utf8").trim().slice(0,32)}catch{}try{N=(A(`/proc/${j}/cgroup`,"utf8").split(`
|
|
5
5
|
`).find((V)=>V.startsWith("0::"))??"").slice(3,80)}catch{}return{pid:j,comm:I,cgroup:N}})}),new T("vm_hands_kill_unverified",`${K.length} process(es) the run started survived it`);D=null}if(H=!1,M)q.onSrtReset?.();if(R.length)throw X("vm_hands.kill_survivors",{pids:R.slice(0,16)}),new T("vm_hands_kill_unverified",`${R.length} payload-uid process(es) outside the payload cgroup`);W.clear();for(let K of Qq())try{r(U(z,_,K))}catch{}}finally{f=!1,Y()}if(x)setTimeout(()=>{if(!G.size)x.arm()},100).unref?.()},async killProbe(){let Z=Date.now()+qq;if(l(U(u,"cgroup.events"))){await p(u,Z,"probe");try{r(u)}catch{}}let Q=$q(process.pid);if(Q===null)throw new T("vm_hands_kill_unverified","agent start time unreadable");await yq(z,Q,Z);let Y=(F)=>{let M=$q(F);return M!==null&&M<=Q},L=Zq(J).filter((F)=>Y(F)&&!v(F,y));if(L.length)throw X("vm_hands.kill_survivors",{pids:L.slice(0,16),at:"attest"}),new T("vm_hands_kill_unverified",`${L.length} payload-uid process(es) from before this agent`);if(D!==null){let F=[z,U(z,_)].map((K)=>K.replace(/^\/sys\/fs\/cgroup/,"")),M=O.replace(/^\/sys\/fs\/cgroup/,""),R=Xq(D).filter((K)=>K!==process.pid&&!v(K,y)&&!v(K,"/reason-vm-hands")&&!v(K,M)&&!F.some((j)=>Wq(K,j)));if(R.length)throw X("vm_hands.kill_strays",{strays:R.slice(0,16).map((K)=>({pid:K})),at:"attest"}),new T("vm_hands_kill_unverified",`${R.length} process(es) the probe started survived it`);D=null}},async runProbe({nonce:Z,script:Q}){if(C(),!Q.includes(zq))throw new T("vm_hands_probe_failed","probe names no proof directory");let Y=q.proofParent??"/tmp/reason-vm-hands-proof";e(Y,{mode:457,recursive:!0});let L=o(Y);if(L.isSymbolicLink()||!L.isDirectory()||L.uid!==(process.getuid?.()??-1)||(L.mode&4095)!==457)throw new T("vm_hands_probe_failed","proof parent is not root's 0711 directory");let F=bq(U(Y,"p-")),M=!1;try{if(!/^[A-Za-z0-9/._-]+$/.test(F)||!/^[A-Za-z0-9_-]{1,128}$/.test(Z))throw new T("vm_hands_probe_failed","proof directory path or nonce");Oq(F,J,J),vq(F,448);let R=o(F).ino;try{e(u,{mode:493})}catch(N){if(!(N&&typeof N==="object"&&("code"in N)&&N.code==="EEXIST"))throw new T("vm_hands_probe_failed","probe cgroup")}let K=d(u)("/bin/bash",["-c",Q.replaceAll(zq,F).replaceAll(Hq,Z)],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:["ignore","pipe","ignore"]}),j="";K.stdout?.on("data",(N)=>{if(j.length<16384)j+=N.toString("utf8").slice(0,16384-j.length)});let I=await new Promise((N)=>{let V=setTimeout(()=>{M=!0,K.kill("SIGKILL"),N(124)},_q);K.once("error",()=>{clearTimeout(V),N(127)}),K.once("close",(g)=>{clearTimeout(V),N(g??1)})});return X("vm_hands.probe",{nonce_len:Z.length,exit_code:I}),{exitCode:I,markers:j,proofDirInode:R}}finally{if(!M)xq(F,{recursive:!0,force:!0})}},restatLayout(){let{session_root:Z,alias:Q}=q.init.layout,Y="invalid";try{Fq(Z),Y="0:0:755"}catch{}let L=!1,F=-1;try{let M=o(Q);F=M.uid,L=Y==="0:0:755"&&Q===U(Z,"repo")&&!M.isSymbolicLink()&&M.isDirectory()&&hq(Q)===Q&&M.uid===J}catch{}return{root_mode:Y,alias_ok:L,owner_uid:F}},installEnvironment(Z,Q){let Y=G.get(Z);if(!Y)throw new T("environment_unavailable","no executor owns an environment");return Lq({root:q.root,operationId:Y.operationId,payload:Q}).installed_revision},async stop(){if(i)clearInterval(i);x?.close(),await Promise.all([...G.keys()].map((Z)=>c(Z)))}};function Qq(){try{return s(U(z,_),{withFileTypes:!0}).filter((Z)=>Z.isDirectory()&&/^b-[0-9a-f-]{36}$/.test(Z.name)).map((Z)=>Z.name)}catch{return[]}}async function Cq(Z,Q,Y=!1){let L=new Set([...Q].map((M)=>M.toLowerCase())),F=Yq();try{await Bq();let M=Date.now()+qq,R=new Set(Qq().filter(($)=>!L.has($.slice(2))).map(($)=>$.slice(2)));if(Z)R.add(Z.toLowerCase());let K=null;for(let $ of R){let w=c($).catch(()=>{return}),n=W.get($);if(n!==void 0)K=K===null?n:Math.min(K,n);if(l(U(S($),"cgroup.events")))await p(S($),M,"bind");await w}let j=[...L].map(($)=>S($).replace(/^\/sys\/fs\/cgroup/,"")),I=[z,U(z,_)].map(($)=>$.replace(/^\/sys\/fs\/cgroup/,"")),N=O.replace(/^\/sys\/fs\/cgroup/,""),V=($)=>v($,y)||j.some((w)=>v($,w)),g=Y?[]:Zq(J).filter(($)=>!V($));if(g.length)throw X("vm_hands.kill_survivors",{pids:g.slice(0,16),beside:L.size}),new T("vm_hands_kill_unverified",`${g.length} payload-uid process(es) outside a live bind`);let a=($)=>!V($)&&!v($,"/reason-vm-hands")&&!v($,N)&&!I.some((w)=>Wq($,w));if(K!==null){let $=Xq(K).filter((w)=>w!==process.pid&&a(w));if($.length)throw X("vm_hands.kill_strays",{strays:$.slice(0,16).map((w)=>({pid:w})),beside:L.size}),new T("vm_hands_kill_unverified",`${$.length} process(es) the run started survived it`)}for(let $ of R)W.delete($),Pq($)}finally{F()}}}function $q(q,z="/proc"){try{let J=A(U(z,String(q),"stat"),"utf8"),X=Number(J.slice(J.lastIndexOf(")")+2).split(" ")[19]);return Number.isFinite(X)?X:null}catch{return null}}function Sq(q,z="/proc"){try{let J=A(U(z,String(q),"stat"),"utf8"),X=Number(J.slice(J.lastIndexOf(")")+2).split(" ")[1]);return Number.isFinite(X)?X:null}catch{return null}}async function yq(q,z,J){try{E(U(q,"cgroup.freeze"),"1")}catch(X){throw new T("vm_hands_kill_unverified",`payload cgroup.freeze: ${X instanceof Error?X.message:String(X)}`)}try{for(;;){let X=Dq(q).filter((W)=>fq(W,q)),G=new Set(X.filter((W)=>{let B=$q(W);return B!==null&&B<=z}));for(let W=!0;W;){W=!1;for(let B of X){if(G.has(B))continue;let P=Sq(B);if(P!==null&&G.has(P))G.add(B),W=!0}}if(G.size===0)return;if(Date.now()>J)throw new T("vm_hands_kill_unverified",`${G.size} previous-boot process(es) survived`);for(let W of G)try{process.kill(W,"SIGKILL")}catch{}await new Promise((W)=>setTimeout(W,10))}}finally{try{E(U(q,"cgroup.freeze"),"0")}catch{}}}function Wq(q,z,J="/proc"){try{return A(U(J,String(q),"cgroup"),"utf8").split(`
|
|
6
6
|
`).find((G)=>G.startsWith("0::"))?.slice(3)===z}catch{return!1}}function v(q,z,J="/proc"){try{let G=A(U(J,String(q),"cgroup"),"utf8").split(`
|
|
7
7
|
`).find((W)=>W.startsWith("0::"))?.slice(3)??"";return G===z||G.startsWith(`${z}/`)}catch{return!1}}var Eq=100;function Gq(){try{return Math.floor(Number(A("/proc/uptime","utf8").split(" ")[0])*Eq)}catch{return 0}}async function p(q,z,J){try{E(U(q,"cgroup.freeze"),"1")}catch(X){throw new T("vm_hands_kill_unverified",`${J} cgroup.freeze: ${X instanceof Error?X.message:String(X)}`)}while(!/^populated 0$/m.test(A(U(q,"cgroup.events"),"utf8"))){if(Date.now()>z)throw new T("vm_hands_kill_unverified",`${J} cgroup still populated (left frozen)`);for(let X of Dq(q)){if(!fq(X,q))continue;try{process.kill(X,"SIGKILL")}catch{}}await new Promise((X)=>setTimeout(X,10))}try{E(U(q,"cgroup.freeze"),"0")}catch(X){throw new T("vm_hands_kill_unverified",`${J} cgroup thaw: ${X instanceof Error?X.message:String(X)}`)}}function fq(q,z){let J=z.replace(/^\/sys\/fs\/cgroup/,"")||"/",X="";try{X=A(`/proc/${q}/cgroup`,"utf8").split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xa as k,ya as m,za as l}from"./vm-hands-entry-lite-
|
|
3
|
-
`,{mode:420}),Q("srt_base_keyed",{})}catch{Q("srt_base_keyed_skipped",{reason:"error"})}}function R(Q,j){let J=(F)=>{return j("srt_warm_skipped",{reason:F}),Promise.resolve()};if(typeof Q.srt_base_settings!=="string")return J("no_settings");let Z=Buffer.from(Q.srt_base_settings,"base64");if(Z.length===0||Z.length>qj||Z.toString("base64")!==Q.srt_base_settings)return J("settings_invalid");try{let F=w(S);if(!F.isDirectory()||F.uid!==0||(F.mode&18)!==0)return J("cgroup_unsafe");for(let[H,g]of[[p,!1],["/usr/local/bin",!0]]){let Y=w(H);if((g?!Y.isDirectory():!Y.isFile())||Y.uid!==0||(Y.mode&18)!==0)return J("srt_exec_unsafe")}}catch{return J("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return J("not_root");let X=performance.now(),z=t("sha256").update(Z).digest("hex"),W=`${P}/srt-base-settings.json`;try{d(W,Z,{mode:384,flag:"w"})}catch{return J("settings_write")}let L=a("/bin/sh",["-c",`echo $$ > ${S}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",p,"--settings",W,"--idle-ms",String(Jj),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((F)=>{L.once("error",()=>{j("srt_warm_failed",{reason:"spawn"}),F()}),L.once("close",(H)=>{j(H===0?"srt_warm_done":"srt_warm_failed",{exit_code:H,warm_ms:Math.round(performance.now()-X),settings_sha256:z}),F()})})}var u=3000;function Lj(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let j=Q,J=j.layout,Z=j.device_key,X=j.credential;return typeof j.workspace_id==="string"&&Number.isSafeInteger(j.instance_generation)&&typeof j.api_origin==="string"&&jj.test(j.api_origin)&&typeof j.manifest_digest==="string"&&!!X&&typeof X.key_id==="string"&&Number.isSafeInteger(X.expires_at_ms)&&typeof X.signature==="string"&&!!J&&typeof J.session_root==="string"&&typeof J.alias==="string"&&Number.isSafeInteger(J.payload_uid)&&typeof J.kind==="string"&&!!Z&&typeof Z.pkcs8==="string"&&typeof Z.spki==="string"?j:null}function y(Q){s(Q,{recursive:!0,mode:448});let j=e(Q);if(!j.isDirectory()||(j.mode&63)!==0||j.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${Q}`)}async function Zj(Q){let[{CLI_VERSION:j},J,Z,X]=await Promise.all([import("./version-
|
|
4
|
-
`)){let J=j.split(":");if(J.length>=4&&Number(J[2])===Q&&/^\d+$/.test(J[3]??"")&&Number(J[3])>0)return Number(J[3])}throw Error("vm_hands_payload_account_unavailable")}function Fj(Q,j){let J=j.owner;if(!J||typeof J.organization_id!=="string"||typeof J.device_id!=="string"||typeof j.root_id!=="string")return null;return{version:4,apiOrigin:Q.api_origin,orgId:J.organization_id,deviceId:J.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:j.root_id,label:"workspace",path:T,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}async function Mj(Q,j){y(P),y(O),Qj(j);let J=R(Q,j),Z=!1,X=async()=>{if(!await Promise.race([J.then(()=>!0),new Promise(($)=>setTimeout(()=>$(!1),u).unref?.())]))Z=!0,j("srt_warm_late",{wait_ms:u})},[{configureDesktopAccount:z},{configureWorkerSandbox:W}]=await Promise.all([import("./desktop-account-
|
|
2
|
+
import{xa as k,ya as m,za as l}from"./vm-hands-entry-lite-khjrcwrj.js";import{ve as v}from"./vm-hands-entry-lite-zfwg7ehq.js";import"./vm-hands-entry-lite-hc3p6r9p.js";import{hk as G}from"./vm-hands-entry-lite-g036gtem.js";import{spawn as a}from"child_process";import{createHash as t}from"crypto";import{lstatSync as w,mkdirSync as s,readFileSync as i,statSync as e,writeFileSync as d}from"fs";var P="/run/reason-vm-hands",O="/run/reason-vm-hands/env",T="/home/runner/.reason/workspace",jj=/^https:\/\/[a-z0-9.-]+(?::\d{1,5})?$/,S="/sys/fs/cgroup/reason-srt",p="/usr/local/bin/ara-srt-exec",qj=65536,Jj=21600000;function Qj(Q,j="/run/ara-srt"){try{if((process.getuid?.()??-1)!==0)return;s(j,{recursive:!0,mode:448});let J=w(j);if(!J.isDirectory()||J.uid!==0||(J.mode&63)!==0){Q("srt_base_keyed_skipped",{reason:"socket_dir_unsafe"});return}d(`${j}/base-keyed`,`1
|
|
3
|
+
`,{mode:420}),Q("srt_base_keyed",{})}catch{Q("srt_base_keyed_skipped",{reason:"error"})}}function R(Q,j){let J=(F)=>{return j("srt_warm_skipped",{reason:F}),Promise.resolve()};if(typeof Q.srt_base_settings!=="string")return J("no_settings");let Z=Buffer.from(Q.srt_base_settings,"base64");if(Z.length===0||Z.length>qj||Z.toString("base64")!==Q.srt_base_settings)return J("settings_invalid");try{let F=w(S);if(!F.isDirectory()||F.uid!==0||(F.mode&18)!==0)return J("cgroup_unsafe");for(let[H,g]of[[p,!1],["/usr/local/bin",!0]]){let Y=w(H);if((g?!Y.isDirectory():!Y.isFile())||Y.uid!==0||(Y.mode&18)!==0)return J("srt_exec_unsafe")}}catch{return J("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return J("not_root");let X=performance.now(),z=t("sha256").update(Z).digest("hex"),W=`${P}/srt-base-settings.json`;try{d(W,Z,{mode:384,flag:"w"})}catch{return J("settings_write")}let L=a("/bin/sh",["-c",`echo $$ > ${S}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",p,"--settings",W,"--idle-ms",String(Jj),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((F)=>{L.once("error",()=>{j("srt_warm_failed",{reason:"spawn"}),F()}),L.once("close",(H)=>{j(H===0?"srt_warm_done":"srt_warm_failed",{exit_code:H,warm_ms:Math.round(performance.now()-X),settings_sha256:z}),F()})})}var u=3000;function Lj(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let j=Q,J=j.layout,Z=j.device_key,X=j.credential;return typeof j.workspace_id==="string"&&Number.isSafeInteger(j.instance_generation)&&typeof j.api_origin==="string"&&jj.test(j.api_origin)&&typeof j.manifest_digest==="string"&&!!X&&typeof X.key_id==="string"&&Number.isSafeInteger(X.expires_at_ms)&&typeof X.signature==="string"&&!!J&&typeof J.session_root==="string"&&typeof J.alias==="string"&&Number.isSafeInteger(J.payload_uid)&&typeof J.kind==="string"&&!!Z&&typeof Z.pkcs8==="string"&&typeof Z.spki==="string"?j:null}function y(Q){s(Q,{recursive:!0,mode:448});let j=e(Q);if(!j.isDirectory()||(j.mode&63)!==0||j.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${Q}`)}async function Zj(Q){let[{CLI_VERSION:j},J,Z,X]=await Promise.all([import("./version-jc5w4cnv.js"),import("./hands-worker-source-h0b1j53p.js"),import("./network-contract-zqvt1v0t.js"),import("./device-workspace-vbcry9d6.js")]),{REASON_HANDS_PROTOCOL_VERSION:z}=await import("./reason-hands-protocol-8fxjynte.js");return{reason_runtime_version:j,bridge_version:j,protocol_version:v,execution_eligible:!0,instance_generation:Q.instance_generation,capabilities:{supported_operations:["hands.connect"],hands_worker_artifact_sha256:J.REASON_HANDS_WORKER_ARTIFACT_SHA256,hands_worker_entrypoint:J.REASON_HANDS_WORKER_ENTRYPOINT,hands_slots:1,max_payload_bytes:Z.LOCAL_OPERATION_MAX_BYTES,max_result_bytes:Z.LOCAL_OPERATION_MAX_BYTES,operation_constraints:{"hands.connect":{ready:!0,execution_mode:"host",transport:"wss_relay",worker:"ara_hands",slots:1,session_group:Z.HANDS_SESSION_GROUP,worker_version:J.REASON_HANDS_WORKER_VERSION,protocol_version:z,worker_artifact_sha256:J.REASON_HANDS_WORKER_ARTIFACT_SHA256,worker_entrypoint:J.REASON_HANDS_WORKER_ENTRYPOINT,policy_mode:"full_access",policy_version:1,workspace_base:X.REASON_WORKSPACE_BASE,workspace_layout:X.SESSION_WORKSPACE_LAYOUT,browser_state:"optional_headless",desktop:!1,max_session_ms:43200000,environment_delivery:Z.HANDS_ENVIRONMENT_DELIVERY,[Z.HANDS_ENVIRONMENT_AT_CLAIM_KEY]:Z.HANDS_ENVIRONMENT_AT_CLAIM,[Z.HANDS_CLOUD_ACCESS_KEY]:Z.HANDS_CLOUD_ACCESS,[Z.HANDS_LARGE_ENVIRONMENT_KEY]:Z.HANDS_LARGE_ENVIRONMENT,[Z.HANDS_CONFINEMENT_KEY]:Z.HANDS_CONFINEMENT,[Z.HANDS_JOBS_USER_KEY]:Z.HANDS_JOBS_USER,vm_hands:"v1"}}}}}var V=["fs.read","fs.write","fs.export","fs.import","exec.run","exec.full","process.list","ports.list","pty.start","jobs.control","automation.call.v1"],$j=new Set(["pty.start","jobs.control"]);function Xj(Q,j){let J=j([{id:"vm-hands",label:"workspace",path:T,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}],{worker:{executionMode:"unsandboxed",readiness:Object.fromEntries(V.map((z)=>[z,!0]))}}),Z=Q.capabilities,X={...Z.operation_constraints};for(let z of V)X[z]={...J.operation_constraints?.[z]??{},ready:!0,execution_mode:J.operation_constraints?.[z]?.execution_mode??"host"};return{...Q,capabilities:{...Z,supported_operations:["hands.connect",...V],operation_constraints:X}}}function zj(Q){for(let j of i("/etc/passwd","utf8").split(`
|
|
4
|
+
`)){let J=j.split(":");if(J.length>=4&&Number(J[2])===Q&&/^\d+$/.test(J[3]??"")&&Number(J[3])>0)return Number(J[3])}throw Error("vm_hands_payload_account_unavailable")}function Fj(Q,j){let J=j.owner;if(!J||typeof J.organization_id!=="string"||typeof J.device_id!=="string"||typeof j.root_id!=="string")return null;return{version:4,apiOrigin:Q.api_origin,orgId:J.organization_id,deviceId:J.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:j.root_id,label:"workspace",path:T,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}async function Mj(Q,j){y(P),y(O),Qj(j);let J=R(Q,j),Z=!1,X=async()=>{if(!await Promise.race([J.then(()=>!0),new Promise(($)=>setTimeout(()=>$(!1),u).unref?.())]))Z=!0,j("srt_warm_late",{wait_ms:u})},[{configureDesktopAccount:z},{configureWorkerSandbox:W}]=await Promise.all([import("./desktop-account-5zvgspyw.js"),import("./worker-sandbox-wpzkvwer.js")]);W();try{z({value:String(Q.layout.payload_uid)})}catch{j("payload_account_unavailable"),await new Promise(()=>{setInterval(()=>{return},1073741824)})}let L=new AbortController;for(let q of["SIGTERM","SIGINT"])process.on(q,()=>L.abort());let F=new Map,H,g=new Promise((q)=>{H=q}),Y=g.then(()=>import("./vm-hands-executor-z89arnng.js")).then(({createVmHandsExecutor:q})=>{let $=q({init:Q,root:T,runtimeDirectory:P,apiOrigin:Q.api_origin,prespawn:!0,onSrtReset:()=>{Z=!1,J=R(Q,j)},srtWarmLate:()=>Z,forward:(B,K,N)=>F.get(B)?.(K,N)??Promise.reject(Error("vm_hands_not_bound")),log:(B,K)=>j(B,K)});return j("executor_loaded"),$}),A=(q)=>async(...$)=>(await Y)[q](...$),C=null;Y.then((q)=>{C=($)=>q.executorExited($)});let M={startExecutor:async(...q)=>{return await X(),A("startExecutor")(...q)},killAndVerifyPayload:A("killAndVerifyPayload"),killProbe:A("killProbe"),runProbe:async(...q)=>{return await X(),A("runProbe")(...q)},restatLayout:()=>{throw Error("replaced below")},installEnvironment:()=>{throw Error("replaced below")},executorExited:(q)=>C?C(q):new Promise(()=>{}),takeSrtFallbacks:()=>null};Y.then((q)=>{M.restatLayout=()=>q.restatLayout(),M.installEnvironment=($,B)=>q.installEnvironment($,B),M.freezeBind=($)=>q.freezeBind($),M.takeSrtFallbacks=()=>q.takeSrtFallbacks?.()??null});let c=await k(Q),o=new m(Q,c,M,{envRoot:O}),h=Zj(Q),b=null,n=Promise.all([h,import("./local-capabilities-bnhpw82g.js")]).then(([q,$])=>{b=Xj(q,$.capabilityInventoryForRoots),j("device_ops_loaded")}).catch((q)=>j("device_ops_unavailable",{error:q instanceof Error?q.name:"error"})),f=g.then(()=>import("./vm-hands-executor-z89arnng.js")).then(({createVmHandsOpRunners:q,vmHandsBindCgroup:$,VM_HANDS_PAYLOAD_CGROUP:B})=>q({payloadUid:Q.layout.payload_uid,payloadGid:zj(Q.layout.payload_uid),bindCgroup:(K)=>$(B,K),log:(K,N)=>j(K,N)})).catch(()=>null);f.then((q)=>q?.warm("person")),j("agent_ready"),await l({apiOrigin:Q.api_origin,agent:o,signal:L.signal,heartbeat:async()=>b??await h,executeOp:async({kind:q,claim:$,bindId:B,signal:K,emit:N})=>{let x=Fj(Q,$);if(!x)return{status:"failed",error_code:"vm_hands_bind_invalid"};let E={executionMode:"unsandboxed",runtimeDirectory:P,readiness:Object.fromEntries(V.map((U)=>[U,!0]))},_=(U)=>{let D=typeof U.kind==="string"?U.kind:"";if(D)N({kind:D,...U.data&&typeof U.data==="object"?{data:U.data}:{}})};if($.capability==="exec.full"&&q!=="person")return{status:"failed",error_code:"capability_not_granted"};if($.capability==="automation.call.v1"&&q!=="model")return{status:"failed",error_code:"capability_not_granted"};let r=$.capability==="pty.start"&&q==="person"&&!$.authority;if($j.has(String($.capability))&&!r){let{executeLocalOperation:U}=await import("./local-capabilities-bnhpw82g.js");return U(x,$,{worker:E,signal:K,emit:(D)=>_(D)})}let I=await f;if(!I)return{status:"failed",error_code:"vm_hands_payload_account_unavailable"};return I.run(q,{id:String($.attempt_id),claim:$,state:x,worker:E},_,K,B)},readyData:({launchId:q})=>({executor_launch_id:q}),log:(q,$)=>{if(q==="vm_hands.registered"||q==="vm_hands.reconnected")H();j(q,$)},onTurn:(q,$)=>{if($)F.set(q,$);else F.delete(q)}}),await(await Y).stop(),(await f)?.stop()}export{R as startBaseSrtServer,Mj as runVmHands,Lj as parseVmHandsInit,Zj as heartbeatBody,Qj as enableBaseKeyedSrt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{r as a}from"./vm-hands-entry-lite-jb2sr2r7.js";import"./vm-hands-entry-lite-dcynw6t2.js";import"./vm-hands-entry-lite-sb9a1jcn.js";import"./vm-hands-entry-lite-hh24bq0d.js";import"./vm-hands-entry-lite-4m40gwkf.js";import"./vm-hands-entry-lite-j2q1k9vb.js";import"./vm-hands-entry-lite-g036gtem.js";export{a as configureWorkerSandbox};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{v as a,w as b,x as c,y as d,z as e}from"./vm-hands-entry-lite-bt6esncn.js";import"./vm-hands-entry-lite-8sddhaka.js";import"./vm-hands-entry-lite-sfsgeynk.js";import"./vm-hands-entry-lite-g9rvf5qk.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{d as resolveApiCredentials,e as requireApiCredentials,b as explicitApiOrigin,c as environmentApiKey,a as apiOriginFromEnvironment};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{F as a,G as b,H as c,I as d,J as e,K as f}from"./vm-hands-entry-lite-8sddhaka.js";import"./vm-hands-entry-lite-sfsgeynk.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{d as sessionPlace,c as sessionMachine,e as createMachineEnrollmentTicketWithToken,f as ReasonApi,b as REASONING_EFFORTS,a as ApiError};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{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-kc07ptqt.js";import"./vm-hands-entry-lite-d7y6aah1.js";import"./vm-hands-entry-lite-bt6esncn.js";import"./vm-hands-entry-lite-8sddhaka.js";import"./vm-hands-entry-lite-k7twc1ch.js";import"./vm-hands-entry-lite-sfsgeynk.js";import"./vm-hands-entry-lite-8cmyg5e4.js";import"./vm-hands-entry-lite-ymwv38dd.js";import"./vm-hands-entry-lite-b775ysr4.js";import"./vm-hands-entry-lite-mcv6pse6.js";import"./vm-hands-entry-lite-dq1fdx0j.js";import"./vm-hands-entry-lite-g9rvf5qk.js";import"./vm-hands-entry-lite-hh24bq0d.js";import"./vm-hands-entry-lite-2c88t2at.js";import"./vm-hands-entry-lite-e9gq8n0f.js";import"./vm-hands-entry-lite-8emxhcny.js";import"./vm-hands-entry-lite-w4swepp1.js";import"./vm-hands-entry-lite-2fyemnas.js";import"./vm-hands-entry-lite-5n6agg8d.js";import"./vm-hands-entry-lite-x9pmwqjd.js";import"./vm-hands-entry-lite-vygp7vq8.js";import"./vm-hands-entry-lite-y9wkxydj.js";import"./vm-hands-entry-lite-dm52srp5.js";import"./vm-hands-entry-lite-g576hpce.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-zyc3qkej.js";import"./vm-hands-entry-lite-rjwk6sfj.js";import"./vm-hands-entry-lite-cxgbb2yr.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-5mz0m0k0.js";import"./vm-hands-entry-lite-gbzvzfe6.js";import"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-ngytzkx1.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{g as runDisconnectCli,f as runConnectCli,m as restartConnectionWhenIdle,l as restartConnection,h as logoutConnection,k as connectionUsesUserChrome,i as connectionReport,j as connectionForBrowserExtension,c as connectionDirectory,d as computerDisconnected,e as addConnectionFolder,b as DISCONNECT_HELP,a as CONNECT_HELP};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ag as c,Bg as d,Cg as e,yg as a,zg as b}from"./vm-hands-entry-lite-y9wkxydj.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{b as passwdAccount,e as desktopHome,d as desktopAccount,c as configureDesktopAccount,a as DESKTOP_USER_ENV};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ad as j,Bd as k,Cd as l,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}from"./vm-hands-entry-lite-e9gq8n0f.js";import"./vm-hands-entry-lite-8emxhcny.js";import"./vm-hands-entry-lite-w4swepp1.js";import"./vm-hands-entry-lite-2fyemnas.js";import"./vm-hands-entry-lite-5n6agg8d.js";import"./vm-hands-entry-lite-x9pmwqjd.js";import"./vm-hands-entry-lite-vygp7vq8.js";import"./vm-hands-entry-lite-y9wkxydj.js";import"./vm-hands-entry-lite-dm52srp5.js";import"./vm-hands-entry-lite-g576hpce.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-zyc3qkej.js";import"./vm-hands-entry-lite-rjwk6sfj.js";import"./vm-hands-entry-lite-cxgbb2yr.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-5mz0m0k0.js";import"./vm-hands-entry-lite-gbzvzfe6.js";import"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-ngytzkx1.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{d as runRelayed,e as runMacComputerUse,l as runLocalAutomation,k as runAutomationCallLocally,b as parseAutomationPayload,g as localUserChromeProfiles,h as localUserChromeInstance,f as localUserChromeHost,j as localBrowserProfile,c as localAutomationAvailable,i as ensureLocalBrowser,a as AUTOMATION_CHUNK_BYTES};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$a as m,Ra as c,Sa as d,Ta as e,Ua as f,Va as g,Wa as h,Xa as i,Ya as j,Za as k,_a as l,ab as n,bb as o,cb as p,db as q,eb as r,fb as s,gb as t}from"./vm-hands-entry-lite-8cmyg5e4.js";import"./vm-hands-entry-lite-ymwv38dd.js";import"./vm-hands-entry-lite-b775ysr4.js";import"./vm-hands-entry-lite-mcv6pse6.js";import"./vm-hands-entry-lite-dq1fdx0j.js";import"./vm-hands-entry-lite-g9rvf5qk.js";import"./vm-hands-entry-lite-hh24bq0d.js";import"./vm-hands-entry-lite-2c88t2at.js";import"./vm-hands-entry-lite-e9gq8n0f.js";import"./vm-hands-entry-lite-8emxhcny.js";import"./vm-hands-entry-lite-w4swepp1.js";import"./vm-hands-entry-lite-2fyemnas.js";import"./vm-hands-entry-lite-5n6agg8d.js";import"./vm-hands-entry-lite-x9pmwqjd.js";import"./vm-hands-entry-lite-vygp7vq8.js";import"./vm-hands-entry-lite-y9wkxydj.js";import"./vm-hands-entry-lite-dm52srp5.js";import"./vm-hands-entry-lite-g576hpce.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-zyc3qkej.js";import{Ei as b}from"./vm-hands-entry-lite-rjwk6sfj.js";import"./vm-hands-entry-lite-cxgbb2yr.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-5mz0m0k0.js";import"./vm-hands-entry-lite-gbzvzfe6.js";import"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-ngytzkx1.js";import{$j as a}from"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Uj as a,Vj as b,Wj as c,Xj as d,Yj as e,Zj as f,_j as g}from"./vm-hands-entry-lite-ngytzkx1.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{f as trackDesktopRun,c as releaseLocalDesktop,a as noteLocalDesktopUse,g as holdLocalDesktop,b as forgetLocalDesktopUse,e as DESKTOP_WAIT_MS,d as DESKTOP_IDLE_MS};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Mj as a,Nj as b,Oj as c,Pj as d,Qj as e,Rj as f,Sj as g}from"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{c as requestMacScreenAccess,d as parseMacWindowBounds,a as parseMacScreenStatus,e as openMacWindowBounds,g as openMacInput,b as macScreenStatus,f as MacInputTranslator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Rf as a,Sf as b,Tf as c,Uf as d,Vf as e,Wf as f,Xf as g,Yf as h}from"./vm-hands-entry-lite-5n6agg8d.js";import"./vm-hands-entry-lite-x9pmwqjd.js";import"./vm-hands-entry-lite-vygp7vq8.js";import"./vm-hands-entry-lite-y9wkxydj.js";import"./vm-hands-entry-lite-dm52srp5.js";import"./vm-hands-entry-lite-g576hpce.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-zyc3qkej.js";import"./vm-hands-entry-lite-rjwk6sfj.js";import"./vm-hands-entry-lite-cxgbb2yr.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-5mz0m0k0.js";import"./vm-hands-entry-lite-gbzvzfe6.js";import"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-ngytzkx1.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{h as runLocalDisplayStream,f as privateDirectory,c as parseDisplayStreamPayload,e as localDisplayReady,d as localDisplayAvailable,g as ensureLinuxDesktop,a as LOCAL_DISPLAY_MAX_SESSION_MS,b as LINUX_WORKER_DISPLAY};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$f as c,Zf as a,_f as b,ag as d,bg as e,cg as f,dg as g,eg as h,fg as i,gg as j}from"./vm-hands-entry-lite-x9pmwqjd.js";import"./vm-hands-entry-lite-vygp7vq8.js";import"./vm-hands-entry-lite-dm52srp5.js";import"./vm-hands-entry-lite-g576hpce.js";import"./vm-hands-entry-lite-gzyps3ev.js";import"./vm-hands-entry-lite-5zmn6a7p.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.js";export{j as runLocalPtySession,e as resolvePtyWorkingDirectory,g as ptyRuntimeSupported,d as parsePtyStartPayload,h as defaultSpawnPty,f as defaultLoginShell,i as defaultConnect,a as LOCAL_PTY_MAX_SESSION_MS,c as LOCAL_PTY_MAX_SESSIONS,b as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$e as G,Ae as f,Af as fa,Be as g,Bf as ga,Ce as h,Cf as ha,De as i,Df as ia,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,Ne as s,Oe as t,Pe as u,Qe as v,Re as w,Se as x,Te as y,Ue as z,Ve as A,We as B,Xe as C,Ye as D,Ze as E,_e as F,af as H,bf as I,cf as J,df as K,ef as L,ff as M,gf as N,hf as O,if as P,jf as Q,kf as R,lf as S,mf as T,nf as U,of as V,pf as W,qf as X,rf as Y,sf as Z,tf as _,uf as $,ve as a,vf as aa,we as b,wf as ba,xe as c,xf as ca,ye as d,yf as da,ze as e,zf as ea}from"./vm-hands-entry-lite-2fyemnas.js";import"./vm-hands-entry-lite-zmf1terc.js";import"./vm-hands-entry-lite-7fx4xtf6.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};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-zyc3qkej.js";import"./vm-hands-entry-lite-rjwk6sfj.js";import"./vm-hands-entry-lite-cxgbb2yr.js";import"./vm-hands-entry-lite-9fr904x2.js";import"./vm-hands-entry-lite-db4z7ekz.js";import"./vm-hands-entry-lite-5mz0m0k0.js";import"./vm-hands-entry-lite-gbzvzfe6.js";import"./vm-hands-entry-lite-e8skq97c.js";import"./vm-hands-entry-lite-y3wncwjd.js";import"./vm-hands-entry-lite-7fx4xtf6.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};
|