@reason-machines/cli-linux-x64 0.2.561 → 0.2.565

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 (129) hide show
  1. package/bin/reason +2 -2
  2. package/bin/vm-hands/agent-network-mnv1fm1c.js +2 -0
  3. package/bin/vm-hands/api-credentials-082cnpn9.js +2 -0
  4. package/bin/vm-hands/api-sq672f51.js +2 -0
  5. package/bin/vm-hands/{ask-relay-xx0rzpch.js → ask-relay-v5btnjvb.js} +2 -2
  6. package/bin/vm-hands/connect-cli-rxb3qtra.js +2 -0
  7. package/bin/vm-hands/credentials-sk4sag42.js +2 -0
  8. package/bin/vm-hands/custom-endpoint-device-3jscber1.js +2 -0
  9. package/bin/vm-hands/desktop-account-xma0330a.js +2 -0
  10. package/bin/vm-hands/desktop-components-099xyxmz.js +2 -0
  11. package/bin/vm-hands/desktop-delegate-tch2qzx0.js +2 -0
  12. package/bin/vm-hands/device-workspace-4bj43nxq.js +2 -0
  13. package/bin/vm-hands/{fsevents-vxv56sp5.js → fsevents-ezcg3e40.js} +1 -1
  14. package/bin/vm-hands/hands-worker-source-8pe7yv0m.js +2 -0
  15. package/bin/vm-hands/{index-03p9c17x.js → index-w92ys6ra.js} +16 -16
  16. package/bin/vm-hands/install-receipt-68xxg7hn.js +2 -0
  17. package/bin/vm-hands/local-automation-7pjd5nc1.js +2 -0
  18. package/bin/vm-hands/local-capabilities-ha0ey4zh.js +2 -0
  19. package/bin/vm-hands/local-desktop-users-jpf0resr.js +2 -0
  20. package/bin/vm-hands/local-display-mac-h5yz0ydd.js +2 -0
  21. package/bin/vm-hands/local-display-session-0mkswxgk.js +2 -0
  22. package/bin/vm-hands/local-display-video-c3fk87c5.js +2 -0
  23. package/bin/vm-hands/local-managed-process-ahr2jync.js +2 -0
  24. package/bin/vm-hands/local-pty-session-tqn2xmph.js +2 -0
  25. package/bin/vm-hands/managed-runtime-shzb3tr3.js +2 -0
  26. package/bin/vm-hands/network-auto-update-3m94436w.js +3 -0
  27. package/bin/vm-hands/network-contract-nkwcf4r9.js +2 -0
  28. package/bin/vm-hands/{network-sign-in-61gmpmaa.js → network-sign-in-xm79s170.js} +2 -2
  29. package/bin/vm-hands/package-9w0mmxb5.js +2 -0
  30. package/bin/vm-hands/permissions-scffy1px.js +2 -0
  31. package/bin/vm-hands/reason-hands-protocol-pck5har9.js +2 -0
  32. package/bin/vm-hands/serve-service-grp91ybk.js +2 -0
  33. package/bin/vm-hands/{status-khqk4cjw.js → status-89999mdn.js} +7 -7
  34. package/bin/vm-hands/version-wyshazh7.js +2 -0
  35. package/bin/vm-hands/{vm-hands-entry-lite-zawytz09.js → vm-hands-entry-lite-12ck5swp.js} +2 -2
  36. package/bin/vm-hands/{vm-hands-entry-lite-j10cw3d9.js → vm-hands-entry-lite-13nx02p7.js} +7 -7
  37. package/bin/vm-hands/{vm-hands-entry-lite-vdv4nm5f.js → vm-hands-entry-lite-1b21avcs.js} +2 -2
  38. package/bin/vm-hands/vm-hands-entry-lite-1eyg750p.js +48 -0
  39. package/bin/vm-hands/{vm-hands-entry-lite-2dak7e1h.js → vm-hands-entry-lite-1xhpn3hw.js} +3 -5
  40. package/bin/vm-hands/{vm-hands-entry-lite-ms99mzp0.js → vm-hands-entry-lite-284z7ct8.js} +3 -3
  41. package/bin/vm-hands/{vm-hands-entry-lite-a7bf7xr7.js → vm-hands-entry-lite-2qfmabqn.js} +3 -3
  42. package/bin/vm-hands/{vm-hands-entry-lite-q9s1e2y1.js → vm-hands-entry-lite-33at6g06.js} +2 -2
  43. package/bin/vm-hands/{vm-hands-entry-lite-jgk5z8zc.js → vm-hands-entry-lite-34b4tws6.js} +6 -6
  44. package/bin/vm-hands/{vm-hands-entry-lite-e3fn8ys2.js → vm-hands-entry-lite-3gc2bn5a.js} +2 -2
  45. package/bin/vm-hands/{vm-hands-entry-lite-hxfxs7r9.js → vm-hands-entry-lite-3q2ng4e9.js} +2 -2
  46. package/bin/vm-hands/vm-hands-entry-lite-432khjd5.js +150 -0
  47. package/bin/vm-hands/vm-hands-entry-lite-6vnjgy77.js +81 -0
  48. package/bin/vm-hands/{vm-hands-entry-lite-ht6hzkgj.js → vm-hands-entry-lite-7r27208j.js} +2 -2
  49. package/bin/vm-hands/{vm-hands-entry-lite-hs6sdn60.js → vm-hands-entry-lite-88dxn9b5.js} +2 -2
  50. package/bin/vm-hands/vm-hands-entry-lite-997y1m1r.js +3 -0
  51. package/bin/vm-hands/{vm-hands-entry-lite-zh6ncdjn.js → vm-hands-entry-lite-a3gq377t.js} +2 -2
  52. package/bin/vm-hands/{vm-hands-entry-lite-m1we91g4.js → vm-hands-entry-lite-af45ma9p.js} +10 -10
  53. package/bin/vm-hands/{vm-hands-entry-lite-0wb1n769.js → vm-hands-entry-lite-b1vanmtv.js} +5 -5
  54. package/bin/vm-hands/{vm-hands-entry-lite-5y4phfv1.js → vm-hands-entry-lite-bsk184m7.js} +3 -3
  55. package/bin/vm-hands/{vm-hands-entry-lite-q9djb28r.js → vm-hands-entry-lite-cc8hwgxc.js} +3 -3
  56. package/bin/vm-hands/vm-hands-entry-lite-chq0qx9f.js +12 -0
  57. package/bin/vm-hands/{vm-hands-entry-lite-84mc1f7h.js → vm-hands-entry-lite-cmmb9k3g.js} +2 -2
  58. package/bin/vm-hands/{vm-hands-entry-lite-gxpw14jv.js → vm-hands-entry-lite-dy204qh4.js} +7 -7
  59. package/bin/vm-hands/{vm-hands-entry-lite-ptycjmkc.js → vm-hands-entry-lite-fccn6s4j.js} +2 -2
  60. package/bin/vm-hands/{vm-hands-entry-lite-qf990rxw.js → vm-hands-entry-lite-fn2805g8.js} +2 -2
  61. package/bin/vm-hands/{vm-hands-entry-lite-71ebge0c.js → vm-hands-entry-lite-fxptf351.js} +5 -5
  62. package/bin/vm-hands/{vm-hands-entry-lite-vkhacd00.js → vm-hands-entry-lite-gcqqnnze.js} +19 -19
  63. package/bin/vm-hands/{vm-hands-entry-lite-57ajjwmh.js → vm-hands-entry-lite-gxf2r5en.js} +1 -1
  64. package/bin/vm-hands/{vm-hands-entry-lite-hjjbjpd7.js → vm-hands-entry-lite-jj7873n8.js} +3 -3
  65. package/bin/vm-hands/{vm-hands-entry-lite-9g52kxyj.js → vm-hands-entry-lite-kbnxk71q.js} +2 -2
  66. package/bin/vm-hands/vm-hands-entry-lite-ncyrz48z.js +4 -0
  67. package/bin/vm-hands/{vm-hands-entry-lite-y3nz20wb.js → vm-hands-entry-lite-ngn4tafr.js} +105 -105
  68. package/bin/vm-hands/{vm-hands-entry-lite-52qz0n30.js → vm-hands-entry-lite-ngry8nkq.js} +4 -4
  69. package/bin/vm-hands/{vm-hands-entry-lite-8xv6c0rm.js → vm-hands-entry-lite-pg7nnyc6.js} +2 -2
  70. package/bin/vm-hands/{vm-hands-entry-lite-h7nk2848.js → vm-hands-entry-lite-pt19vacn.js} +42 -42
  71. package/bin/vm-hands/{vm-hands-entry-lite-tcmye5ny.js → vm-hands-entry-lite-q62g6sx0.js} +2 -2
  72. package/bin/vm-hands/{vm-hands-entry-lite-v4hr9x9h.js → vm-hands-entry-lite-qjrgvdbj.js} +34 -34
  73. package/bin/vm-hands/{vm-hands-entry-lite-bj3w2ven.js → vm-hands-entry-lite-rqfhfp09.js} +2 -2
  74. package/bin/vm-hands/{vm-hands-entry-lite-krpqqx12.js → vm-hands-entry-lite-rxydyqke.js} +2 -2
  75. package/bin/vm-hands/{vm-hands-entry-lite-weqam12f.js → vm-hands-entry-lite-s93f3pbv.js} +3 -3
  76. package/bin/vm-hands/{vm-hands-entry-lite-z0ht62s4.js → vm-hands-entry-lite-sh4mqy93.js} +3 -3
  77. package/bin/vm-hands/{vm-hands-entry-lite-xvccy3z4.js → vm-hands-entry-lite-sz7z1qby.js} +2 -2
  78. package/bin/vm-hands/{vm-hands-entry-lite-wcgm41jq.js → vm-hands-entry-lite-t43bz0ey.js} +7 -7
  79. package/bin/vm-hands/{vm-hands-entry-lite-6jxshhps.js → vm-hands-entry-lite-t86kt9jz.js} +6 -6
  80. package/bin/vm-hands/{vm-hands-entry-lite-7pfhwxn5.js → vm-hands-entry-lite-tnj3483k.js} +1 -1
  81. package/bin/vm-hands/vm-hands-entry-lite-wnqqjsew.js +3 -0
  82. package/bin/vm-hands/{vm-hands-entry-lite-pxtycfdv.js → vm-hands-entry-lite-xfak34av.js} +4 -4
  83. package/bin/vm-hands/{vm-hands-entry-lite-sy7dcccg.js → vm-hands-entry-lite-y0jtj8zz.js} +1 -1
  84. package/bin/vm-hands/{vm-hands-entry-lite-yvws5zpx.js → vm-hands-entry-lite-yg4dk99m.js} +1 -1
  85. package/bin/vm-hands/{vm-hands-entry-lite-2rgf8866.js → vm-hands-entry-lite-z65xva21.js} +2 -2
  86. package/bin/vm-hands/{vm-hands-entry-lite-jpvmkce5.js → vm-hands-entry-lite-zp7chzcc.js} +1 -1
  87. package/bin/vm-hands/{vm-hands-entry-lite-k5ytpgzz.js → vm-hands-entry-lite-zpvr7wc6.js} +19 -19
  88. package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
  89. package/bin/vm-hands/vm-hands-executor-kyb5t371.js +12 -0
  90. package/bin/vm-hands/vm-hands-op-runner-gkt79hcp.js +2 -0
  91. package/bin/vm-hands/{vm-hands-runtime-1qxf96z7.js → vm-hands-runtime-tdr6j55n.js} +3 -3
  92. package/bin/vm-hands/worker-preview-readiness-h96yr4wf.js +2 -0
  93. package/bin/vm-hands/worker-sandbox-6kkhvryn.js +2 -0
  94. package/package.json +1 -1
  95. package/bin/vm-hands/agent-network-kk36zca7.js +0 -2
  96. package/bin/vm-hands/api-credentials-mtfdk175.js +0 -2
  97. package/bin/vm-hands/api-w6w7vfp3.js +0 -2
  98. package/bin/vm-hands/connect-cli-dmwph620.js +0 -2
  99. package/bin/vm-hands/credentials-s7ps7y6s.js +0 -2
  100. package/bin/vm-hands/custom-endpoint-device-3xnrp33e.js +0 -2
  101. package/bin/vm-hands/desktop-account-eg8thn79.js +0 -2
  102. package/bin/vm-hands/device-workspace-h5rsecq8.js +0 -2
  103. package/bin/vm-hands/hands-worker-source-vk664w8p.js +0 -2
  104. package/bin/vm-hands/install-receipt-j04hdw1k.js +0 -2
  105. package/bin/vm-hands/local-automation-vvt9d9xb.js +0 -2
  106. package/bin/vm-hands/local-capabilities-pwv76ns5.js +0 -2
  107. package/bin/vm-hands/local-desktop-users-sq4trh07.js +0 -2
  108. package/bin/vm-hands/local-display-mac-yxcxvg2z.js +0 -2
  109. package/bin/vm-hands/local-display-session-axh9mfdk.js +0 -2
  110. package/bin/vm-hands/local-display-video-pxhztqk7.js +0 -2
  111. package/bin/vm-hands/local-managed-process-4mgqn7tg.js +0 -2
  112. package/bin/vm-hands/local-pty-session-edd8ttf9.js +0 -2
  113. package/bin/vm-hands/managed-runtime-pcagtyfz.js +0 -2
  114. package/bin/vm-hands/network-auto-update-wkzb91qz.js +0 -3
  115. package/bin/vm-hands/network-contract-8mxtma3w.js +0 -2
  116. package/bin/vm-hands/package-vwvzjtn0.js +0 -2
  117. package/bin/vm-hands/permissions-348prrcx.js +0 -2
  118. package/bin/vm-hands/reason-hands-protocol-1nkpw1v3.js +0 -2
  119. package/bin/vm-hands/serve-service-3dkyznay.js +0 -2
  120. package/bin/vm-hands/version-c1hen0wn.js +0 -2
  121. package/bin/vm-hands/vm-hands-entry-lite-9yfmkd1f.js +0 -3
  122. package/bin/vm-hands/vm-hands-entry-lite-ab1pq3xg.js +0 -3
  123. package/bin/vm-hands/vm-hands-entry-lite-hn9pq7zj.js +0 -127
  124. package/bin/vm-hands/vm-hands-entry-lite-nn6zcvmp.js +0 -3
  125. package/bin/vm-hands/vm-hands-entry-lite-z213y4pj.js +0 -150
  126. package/bin/vm-hands/vm-hands-executor-csdtg7kj.js +0 -12
  127. package/bin/vm-hands/vm-hands-op-runner-z7tsd84c.js +0 -2
  128. package/bin/vm-hands/worker-preview-readiness-06tygyjs.js +0 -2
  129. package/bin/vm-hands/worker-sandbox-e1cpkzfz.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{t,o,n,we,$e,c,i}from"./vm-hands-entry-lite-k5ytpgzz.js";var rr="inference.custom.v1",Dr=32768,Bn=67108864,qi=16384,Or=4194304,h=204800,Nr=2*Or+65536,na=600000,E=["content-type","anthropic-version","user-agent"],m=c(["openai-completions","openai-responses","anthropic-messages"]),f=new Set(E),C=$e(t(),t().max(2048)).refine((e)=>Object.keys(e).every((s)=>f.has(s))&&Object.values(e).every((s)=>!/[\r\n\0]/.test(s)),"Only non-secret custom endpoint request headers are permitted");function u(e){try{let s=new URL(e);return["http:","https:"].includes(s.protocol)&&!s.username&&!s.password&&!s.search&&!s.hash?s:null}catch{return null}}function Wi(e,s){let r=u(e.baseUrl),d=u(s.baseUrl),a=u(e.url);if(!r||!d||!a||e.method!=="POST"||s.execution!=="device")return!1;let l=(p)=>p.origin+p.pathname.replace(/\/+$/,"");if(l(r)!==l(d)||a.origin!==r.origin)return!1;let _=s.api==="openai-completions"?"/chat/completions":s.api==="openai-responses"?"/responses":"/v1/messages";return a.pathname===r.pathname.replace(/\/+$/,"")+_}var ia=n({baseUrl:t().max(2048),url:t().max(4096),method:i("POST"),body:t().refine((e)=>new TextEncoder().encode(e).byteLength<=Or).optional(),headers:C,credentialOrganizationId:t().uuid(),accountKey:t().min(1).max(256).optional()}).strict().refine((e)=>m.options.some((s)=>Wi(e,{baseUrl:e.baseUrl,api:s,execution:"device"})),"Invalid custom endpoint inference URL"),D=n({status:o().int().min(200).max(599),statusText:t().max(256).refine((e)=>!/[\r\n\0]/.test(e)),headers:$e(t(),t().max(4096)).refine((e)=>Object.keys(e).every((s)=>["content-type","retry-after","x-request-id","request-id"].includes(s))&&Object.values(e).every((s)=>!/[\r\n\0]/.test(s)))}).strict(),y=we([n({eof:i(!0)}).strict(),n({eof:i(!1),data:t().max(Math.ceil(Dr/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((e)=>e.length>0&&e.length*3/4-(e.endsWith("==")?2:e.endsWith("=")?1:0)<=Dr)}).strict()]),x=n({bytes:o().int().min(0).max(Bn),chunks:o().int().min(0).max(qi)}).strict(),oa=n({apiKey:t().min(1).max(16384).refine((e)=>!/[\r\n\0]/.test(e)),api:m}).strict(),S=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed","custom_endpoint_request_too_large","custom_endpoint_device_update_required"];function Lr(e){return typeof e==="string"&&S.includes(e)}var O="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",T={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${O}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",custom_endpoint_request_too_large:`This conversation is too long for your computer to send to your model server: the request is over ${Or/1024/1024} MB, the most it relays. Start a new session to continue, or choose another model.`,custom_endpoint_device_update_required:`Reason on your computer is too old to send this conversation to your model server: it relays requests of at most ${h/1024} KB. Update Reason on that computer (reason update), then send your message again.`,401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."};var I=new Set(Object.values(T));export{rr,Dr,Bn,qi,Or,Nr,na,Wi,ia,oa,Lr};
2
+ import{t,o,n,we,$e,c,i}from"./vm-hands-entry-lite-zpvr7wc6.js";var rr="inference.custom.v1",Br=32768,Hn=67108864,Gi=16384,Fr=4194304,h=204800,jr=2*Fr+65536,da=600000,E=["content-type","anthropic-version","user-agent"],m=c(["openai-completions","openai-responses","anthropic-messages"]),f=new Set(E),C=$e(t(),t().max(2048)).refine((e)=>Object.keys(e).every((s)=>f.has(s))&&Object.values(e).every((s)=>!/[\r\n\0]/.test(s)),"Only non-secret custom endpoint request headers are permitted");function u(e){try{let s=new URL(e);return["http:","https:"].includes(s.protocol)&&!s.username&&!s.password&&!s.search&&!s.hash?s:null}catch{return null}}function Ki(e,s){let r=u(e.baseUrl),d=u(s.baseUrl),a=u(e.url);if(!r||!d||!a||e.method!=="POST"||s.execution!=="device")return!1;let l=(p)=>p.origin+p.pathname.replace(/\/+$/,"");if(l(r)!==l(d)||a.origin!==r.origin)return!1;let _=s.api==="openai-completions"?"/chat/completions":s.api==="openai-responses"?"/responses":"/v1/messages";return a.pathname===r.pathname.replace(/\/+$/,"")+_}var pa=n({baseUrl:t().max(2048),url:t().max(4096),method:i("POST"),body:t().refine((e)=>new TextEncoder().encode(e).byteLength<=Fr).optional(),headers:C,credentialOrganizationId:t().uuid(),accountKey:t().min(1).max(256).optional()}).strict().refine((e)=>m.options.some((s)=>Ki(e,{baseUrl:e.baseUrl,api:s,execution:"device"})),"Invalid custom endpoint inference URL"),D=n({status:o().int().min(200).max(599),statusText:t().max(256).refine((e)=>!/[\r\n\0]/.test(e)),headers:$e(t(),t().max(4096)).refine((e)=>Object.keys(e).every((s)=>["content-type","retry-after","x-request-id","request-id"].includes(s))&&Object.values(e).every((s)=>!/[\r\n\0]/.test(s)))}).strict(),y=we([n({eof:i(!0)}).strict(),n({eof:i(!1),data:t().max(Math.ceil(Br/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((e)=>e.length>0&&e.length*3/4-(e.endsWith("==")?2:e.endsWith("=")?1:0)<=Br)}).strict()]),x=n({bytes:o().int().min(0).max(Hn),chunks:o().int().min(0).max(Gi)}).strict(),ha=n({apiKey:t().min(1).max(16384).refine((e)=>!/[\r\n\0]/.test(e)),api:m}).strict(),S=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed","custom_endpoint_request_too_large","custom_endpoint_device_update_required"];function Hr(e){return typeof e==="string"&&S.includes(e)}var O="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",T={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${O}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",custom_endpoint_request_too_large:`This conversation is too long for your computer to send to your model server: the request is over ${Fr/1024/1024} MB, the most it relays. Start a new session to continue, or choose another model.`,custom_endpoint_device_update_required:`Reason on your computer is too old to send this conversation to your model server: it relays requests of at most ${h/1024} KB. Update Reason on that computer (reason update), then send your message again.`,401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."};var I=new Set(Object.values(T));export{rr,Br,Hn,Gi,Fr,jr,da,Ki,pa,ha,Hr};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{w}from"./vm-hands-entry-lite-q9s1e2y1.js";import{existsSync as T,mkdirSync as k,readFileSync as d,rmSync as y,writeFileSync as b}from"fs";import{homedir as l,hostname as M}from"os";import{dirname as N,join as h}from"path";function f(t){let e=t.trim().slice(t.trim().indexOf("#")+1),o=["rn1-","tincan1"].find((a)=>e.startsWith(a));if(!o)return null;let n=Buffer.from(e.slice(o.length),"base64url"),r=32,i=(a)=>(r+=a,r<=n.length),m=()=>{let a=n[r];if(a===void 0||!i(1))return!1;if(a!==255)return i(a);let s=n[r];return s!==void 0&&i(1)&&i(s)};if(n.length<32||!m()||!m()||!m())return null;let u=n[r];if(u===void 0||!i(1))return null;for(let a=0;a<u;a+=1){let s=n[r];if(!i(1)||!i(s===4?4:s===6?16:Number.NaN)||!i(2))return null}let g=[];for(;r+32<=n.length;r+=32)g.push(n.subarray(r,r+32).toString("hex"));return{team:n.subarray(0,16).toString("hex"),name:n.subarray(33,33+n[32]).toString("utf8"),secret:n.subarray(16,32).toString("hex"),machines:g}}var p=(t)=>h(t,".reason","ask.json");function A(t){try{let e=JSON.parse(d(p(t),"utf8"));if(typeof e.orgId!=="string"||typeof e.team!=="string")return null;let o=e.pendingRotation;return{orgId:e.orgId,team:e.team,...typeof e.checkedAt==="number"?{checkedAt:e.checkedAt}:{},...o&&typeof o.link==="string"&&typeof o.team==="string"&&typeof o.replaces==="string"?{pendingRotation:o}:{}}}catch{return null}}var c=(t)=>{let e=w();return h(t,".reason",e==="production"?"network-team.json":`network-team.${e}.json`)};function ma(t=l()){return c(t).replace(/\.json$/,"-login.json")}function ga(t=l()){try{let e=JSON.parse(d(c(t),"utf8"));return typeof e.team==="string"?{team:e.team,setupDone:e.setupDone===!0,registered:typeof e.registered==="string"?e.registered:null,account:typeof e.account==="string"?e.account:null}:null}catch{return null}}function _a(t,e=l()){k(N(c(e)),{recursive:!0}),b(c(e),`${JSON.stringify(t)}
3
- `,{mode:384}),y(p(e),{force:!0})}function Ur(t=l()){let e=A(t);return e?{orgId:e.orgId,team:e.team}:null}function zr(t){let e=f(t);return e&&e.machines.length>0?{teamId:e.team,teamName:e.name,secret:e.secret}:null}
4
- export{ma,ga,_a,Ur,zr};
2
+ import{w}from"./vm-hands-entry-lite-33at6g06.js";import{existsSync as T,mkdirSync as k,readFileSync as d,rmSync as y,writeFileSync as b}from"fs";import{homedir as l,hostname as M}from"os";import{dirname as N,join as h}from"path";function f(t){let e=t.trim().slice(t.trim().indexOf("#")+1),o=["rn1-","tincan1"].find((a)=>e.startsWith(a));if(!o)return null;let n=Buffer.from(e.slice(o.length),"base64url"),r=32,i=(a)=>(r+=a,r<=n.length),m=()=>{let a=n[r];if(a===void 0||!i(1))return!1;if(a!==255)return i(a);let s=n[r];return s!==void 0&&i(1)&&i(s)};if(n.length<32||!m()||!m()||!m())return null;let u=n[r];if(u===void 0||!i(1))return null;for(let a=0;a<u;a+=1){let s=n[r];if(!i(1)||!i(s===4?4:s===6?16:Number.NaN)||!i(2))return null}let g=[];for(;r+32<=n.length;r+=32)g.push(n.subarray(r,r+32).toString("hex"));return{team:n.subarray(0,16).toString("hex"),name:n.subarray(33,33+n[32]).toString("utf8"),secret:n.subarray(16,32).toString("hex"),machines:g}}var p=(t)=>h(t,".reason","ask.json");function A(t){try{let e=JSON.parse(d(p(t),"utf8"));if(typeof e.orgId!=="string"||typeof e.team!=="string")return null;let o=e.pendingRotation;return{orgId:e.orgId,team:e.team,...typeof e.checkedAt==="number"?{checkedAt:e.checkedAt}:{},...o&&typeof o.link==="string"&&typeof o.team==="string"&&typeof o.replaces==="string"?{pendingRotation:o}:{}}}catch{return null}}var c=(t)=>{let e=w();return h(t,".reason",e==="production"?"network-team.json":`network-team.${e}.json`)};function Ea(t=l()){return c(t).replace(/\.json$/,"-login.json")}function ka(t=l()){try{let e=JSON.parse(d(c(t),"utf8"));return typeof e.team==="string"?{team:e.team,setupDone:e.setupDone===!0,registered:typeof e.registered==="string"?e.registered:null,account:typeof e.account==="string"?e.account:null}:null}catch{return null}}function xa(t,e=l()){k(N(c(e)),{recursive:!0}),b(c(e),`${JSON.stringify(t)}
3
+ `,{mode:384}),y(p(e),{force:!0})}function Kr(t=l()){let e=A(t);return e?{orgId:e.orgId,team:e.team}:null}function Jr(t){let e=f(t);return e&&e.machines.length>0?{teamId:e.team,teamName:e.name,secret:e.secret}:null}
4
+ export{Ea,ka,xa,Kr,Jr};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var st=".reason/workspace",Et="workspace_base",Oe="sessions",kt="workspace_layout",Ge=".reason/workspace/sessions",Cr=/^[0-9a-f]{8}$/;function Zt(t){if(!Ne(t))return!1;let e=".reason/workspace/sessions/";if(!t.startsWith(e))return!1;let n=t.slice(e.length).split("/");return n.length===2&&Cr.test(n[0])}var i=4096,S="workspaces/pi";function Ne(t){if(typeof t!=="string"||!t||t.length>i)return!1;if(t.startsWith("/")||t.includes("\x00")||t.includes("\\"))return!1;return t.split("/").every((e)=>e!==""&&e!=="."&&e!=="..")}function X(t){if(t.kind==="root"){if(t.path===void 0)return".";if(!Ne(t.path))throw Error("invalid_device_workspace_identity");return t.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(t.workspaceId)||t.workspaceId==="."||t.workspaceId==="..")throw Error("invalid_device_workspace_identity");let e=t.layout==="sessions"?"sessions":S;return`${t.base?`${t.base}/`:""}${e}/${t.workspaceId}/repo`}function te(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t;if(e.kind==="root"&&Object.keys(e).length===1)return{kind:"root"};if(e.kind==="root"&&Object.keys(e).length===2&&Ne(e.path))return{kind:"root",path:e.path};if(e.kind!=="managed"||typeof e.workspaceId!=="string"||Object.keys(e).length!==2+(e.base===void 0?0:1)+(e.layout===void 0?0:1)||e.base!==void 0&&e.base!==".reason/workspace"||e.layout!==void 0&&e.layout!=="sessions")return null;let n={kind:"managed",workspaceId:e.workspaceId,...e.base===".reason/workspace"?{base:".reason/workspace"}:{},...e.layout==="sessions"?{layout:"sessions"}:{}};try{return X(n),n}catch{return null}}var c="/home/runner";var Fi="/run/reason/sessions",O=/^(?:\/[A-Za-z0-9._-]+)+$/,ji=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,Hi=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function a(t){return ji.exec(t)?.[1]??Hi.exec(t)?.[1]??t}var Nn=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/;function _(t,e=c,n="sessions"){if(!O.test(e)||e.split("/").some((s)=>s==="."||s===".."))throw Error("invalid_cloud_payload_home");let r=`${e}/${X({kind:"managed",workspaceId:t,base:".reason/workspace",...n?{layout:n}:{}})}`,o=`${Fi}/${a(t)}`;return{home:e,root:r.slice(0,-5),checkout:r,control:o,jobEnv:`${o}/job.env`,cloudAccess:`${o}/cloud-access`,logs:`${o}/logs`,pin:`${o}/ws`}}function E(t){return Nn.exec(t.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function Ui(t){let e=Nn.exec(t.replace(/\/+$/,""));if(!e)return null;try{let n=_(e[3],e[1],E(t));return n.root===t.replace(/\/+$/,"")?n:null}catch{return null}}
3
- export{st,Et,Oe,kt,Ge,Cr,Zt,Ne,X,te,Fi,ji,Hi,Nn,Ui};
2
+ var at=".reason/workspace",kt="workspace_base",Oe="sessions",xt="workspace_layout",Ke=".reason/workspace/sessions",Dr=/^[0-9a-f]{8}$/;function Zt(t){if(!Ne(t))return!1;let e=".reason/workspace/sessions/";if(!t.startsWith(e))return!1;let n=t.slice(e.length).split("/");return n.length===2&&Dr.test(n[0])}var i=4096,S="workspaces/pi";function Ne(t){if(typeof t!=="string"||!t||t.length>i)return!1;if(t.startsWith("/")||t.includes("\x00")||t.includes("\\"))return!1;return t.split("/").every((e)=>e!==""&&e!=="."&&e!=="..")}function X(t){if(t.kind==="root"){if(t.path===void 0)return".";if(!Ne(t.path))throw Error("invalid_device_workspace_identity");return t.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(t.workspaceId)||t.workspaceId==="."||t.workspaceId==="..")throw Error("invalid_device_workspace_identity");let e=t.layout==="sessions"?"sessions":S;return`${t.base?`${t.base}/`:""}${e}/${t.workspaceId}/repo`}function te(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t;if(e.kind==="root"&&Object.keys(e).length===1)return{kind:"root"};if(e.kind==="root"&&Object.keys(e).length===2&&Ne(e.path))return{kind:"root",path:e.path};if(e.kind!=="managed"||typeof e.workspaceId!=="string"||Object.keys(e).length!==2+(e.base===void 0?0:1)+(e.layout===void 0?0:1)||e.base!==void 0&&e.base!==".reason/workspace"||e.layout!==void 0&&e.layout!=="sessions")return null;let n={kind:"managed",workspaceId:e.workspaceId,...e.base===".reason/workspace"?{base:".reason/workspace"}:{},...e.layout==="sessions"?{layout:"sessions"}:{}};try{return X(n),n}catch{return null}}var c="/home/runner";var Ui="/run/reason/sessions",O=/^(?:\/[A-Za-z0-9._-]+)+$/,zi=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,qi=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function a(t){return zi.exec(t)?.[1]??qi.exec(t)?.[1]??t}var Mn=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/;function _(t,e=c,n="sessions"){if(!O.test(e)||e.split("/").some((s)=>s==="."||s===".."))throw Error("invalid_cloud_payload_home");let r=`${e}/${X({kind:"managed",workspaceId:t,base:".reason/workspace",...n?{layout:n}:{}})}`,o=`${Ui}/${a(t)}`;return{home:e,root:r.slice(0,-5),checkout:r,control:o,jobEnv:`${o}/job.env`,cloudAccess:`${o}/cloud-access`,logs:`${o}/logs`,pin:`${o}/ws`}}function E(t){return Mn.exec(t.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function Wi(t){let e=Mn.exec(t.replace(/\/+$/,""));if(!e)return null;try{let n=_(e[3],e[1],E(t));return n.root===t.replace(/\/+$/,"")?n:null}catch{return null}}
3
+ export{at,kt,Oe,xt,Ke,Dr,Zt,Ne,X,te,Ui,zi,qi,Mn,Wi};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{mkdirSync as R,readdirSync as A,readFileSync as k,realpathSync as x}from"fs";import{userInfo as E}from"os";var zn="--vm-hands-op-runner-kind=person",qn="--vm-hands-op-runner-kind=surface",Wr="--vm-hands-surface-uid=",Vr="--vm-hands-surface-dir=",C="/sys/fs/cgroup/reason-person/desktop",Gr=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function D(t){let a=new Set([t]),l=[];try{l=A("/proc")}catch{}for(let n of l){if(!/^\d+$/.test(n))continue;try{let o=k(`/proc/${n}/stat`,"utf8");if(Number(o.slice(o.lastIndexOf(")")+2).split(" ")[3])===t)a.add(Number(n))}catch{}}for(let n of a)try{process.kill(n,"SIGKILL")}catch{}}var H=(t)=>{let a=globalThis.Bun;if(!a)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=a.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(c,d)=>t.onData(d)}}),n=l.terminal,o=()=>{D(l.pid);try{n?.close()}catch{}};if(!n)throw o(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(c)=>n.write(c),resize:(c,d)=>n.resize(c,d),kill:o,exited:l.exited.then((c)=>typeof c==="number"?c:null,()=>null)}};function O(){let t=(()=>{try{return E().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...t?{USER:t,LOGNAME:t}:{}}}async function L(t){let[{localAutomationAvailable:a},{localDisplayReady:l},{localDisplayVideoAvailable:n},{probeWorkerPreview:o},m]=await Promise.all([import("./local-automation-7pjd5nc1.js"),import("./local-display-session-0mkswxgk.js"),import("./local-display-video-c3fk87c5.js"),import("./worker-preview-readiness-h96yr4wf.js"),import("fs")]),c=AbortSignal.timeout(15000),d=null;try{m.mkdirSync(t,{recursive:!0,mode:448}),d=m.mkdtempSync(`${t}/probe-`);let[w,u,v]=await Promise.all([Promise.resolve().then(()=>a()).catch(()=>!1),l().catch(()=>!1),o(d,c).catch(()=>!1)]);return{t:"readiness",display_video:u&&await n().catch(()=>!1),lanes:{"automation.call.v1":w,"display.stream.v1":u,"preview.serve.v1":v,"tunnel.open":v,"tunnel.close":v}}}finally{if(d)m.rmSync(d,{recursive:!0,force:!0})}}function N(t){let a="";try{a=k("/proc/self/cgroup","utf8").split(`
3
+ `).find((o)=>o.startsWith("0::"))?.slice(3)??""}catch{return null}if(!/^\/reason-person\/vm-hands\/[A-Za-z0-9._-]+$/.test(a))return null;if(!t)return null;let l=[t.xvnc,t.xvfb,t.openbox,t.x11vnc,t.pulseaudio,t.browser,"/usr/bin/dbus-daemon","/bin/dbus-daemon"].flatMap((o)=>{try{return o?[x(o)]:[]}catch{return[]}}),n={join:`/sys/fs/cgroup${a}/desktop`,keep:C,programs:[...new Set(l)]};for(let o of[n.join,n.keep])try{R(o,{mode:493})}catch(m){if(m.code!=="EEXIST")return null}return n}async function hl(){let[{executeLocalOperation:t,spawnCaptured:a},{runLocalPtySession:l},{configureDesktopAccount:n,desktopAccount:o},{configureWorkerSandbox:m},{configureDesktopPlacement:c},{readDesktopComponents:d}]=await Promise.all([import("./local-capabilities-ha0ey4zh.js"),import("./local-pty-session-tqn2xmph.js"),import("./desktop-account-xma0330a.js"),import("./worker-sandbox-6kkhvryn.js"),import("./desktop-delegate-tch2qzx0.js"),import("./desktop-components-099xyxmz.js")]);m();let w=process.argv.includes(zn),u=process.argv.includes(qn),v=(i,e,p)=>a(i,e[0]==="-lic"?["-lc",...e.slice(1)]:e,p),y=(process.geteuid?.()??0)!==0;if(u){y=!1;let i=process.argv.find((e)=>e.startsWith(Wr))?.slice(Wr.length);if((process.geteuid?.()??-1)===0&&i)try{y=n({value:i})!==null&&o()!==null}catch{y=!1}}let S=new Map,_=new Map,f=(i)=>{try{process.send?.(i)}catch{}};if(u&&y){let i=o()?.home,e=i?N(d({home:i})):null;c(e&&{...e,log:(p,g)=>f({t:"log",event:p,fields:g})})}if(process.on("message",(i)=>{let e=i;if(e?.t==="cancel"){S.get(e.id)?.abort();return}if(e?.t==="control"){let s=_.get(e.id);if(u&&s&&e.control&&typeof e.control.kind==="string")import("./local-managed-process-ahr2jync.js").then(({controlManagedDeviceProcess:h})=>h(s,{kind:e.control.kind,payload:e.control.payload??{}})).catch(()=>!1);return}if(e?.t==="retire"){if(u&&typeof e.operation_id==="string"&&typeof e.status==="string")import("./local-managed-process-ahr2jync.js").then(({retireManagedDeviceProcess:s})=>s(e.operation_id,e.status)).catch(()=>!1);return}if(e?.t!=="op")return;if(!y){f({t:"done",id:e.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let p=e.claim.capability;if(p==="pty.start"&&!w){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}if(Gr.has(p)!==u){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let g=new AbortController;S.set(e.id,g),_.set(e.id,e.claim);let b=p==="pty.start"?{runPtySession:(s)=>l(s,{spawnPty:H,environment:O(),loadProxy:()=>null})}:{worker:e.worker,...p==="exec.full"?{spawnFullControl:v}:{}};t(e.state,e.claim,{...b,signal:g.signal,emit:(s)=>{let{deliverySignal:h,...P}=s;f({t:"event",id:e.id,event:P})}}).then((s)=>f({t:"done",id:e.id,completion:s}),(s)=>f({t:"done",id:e.id,completion:{status:"failed",error_code:s&&typeof s==="object"&&"code"in s&&typeof s.code==="string"?s.code:"vm_hands_op_failed"}})).finally(()=>{S.delete(e.id),_.delete(e.id)})}),process.on("disconnect",()=>process.exit(0)),u){let i=process.argv.find((p)=>p.startsWith(Vr))?.slice(Vr.length),e={t:"readiness",display_video:!1,lanes:{}};f(y&&i?await L(i).catch(()=>e):e)}await new Promise(()=>{})}
4
+ export{zn,qn,Wr,Vr,Gr,hl};