@reason-machines/cli-linux-x64 0.2.514 → 0.2.515

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 (38) hide show
  1. package/bin/reason +1 -1
  2. package/bin/vm-hands/{api-9zdt08zj.js → api-9dk733cx.js} +1 -1
  3. package/bin/vm-hands/{api-credentials-0t9g59jn.js → api-credentials-1c17zgyk.js} +1 -1
  4. package/bin/vm-hands/{connect-cli-59hd6te5.js → connect-cli-g3yvh9jm.js} +1 -1
  5. package/bin/vm-hands/{local-automation-e5q1edkc.js → local-automation-4sh2a2gr.js} +1 -1
  6. package/bin/vm-hands/{local-capabilities-vy25qdaa.js → local-capabilities-4zkn2481.js} +1 -1
  7. package/bin/vm-hands/{local-display-session-tmq34qkj.js → local-display-session-41ea79t8.js} +1 -1
  8. package/bin/vm-hands/local-display-video-d2yz8vjt.js +2 -0
  9. package/bin/vm-hands/{local-managed-process-xyd0v82z.js → local-managed-process-jfycgrby.js} +1 -1
  10. package/bin/vm-hands/{managed-runtime-1znjxjh6.js → managed-runtime-ah95z06j.js} +1 -1
  11. package/bin/vm-hands/{permissions-8vrt1fn6.js → permissions-98n5hyzx.js} +1 -1
  12. package/bin/vm-hands/{serve-service-gr998xez.js → serve-service-64ckvvta.js} +1 -1
  13. package/bin/vm-hands/{status-txachfgt.js → status-m84f91g9.js} +1 -1
  14. package/bin/vm-hands/version-8z0jpxx0.js +2 -0
  15. package/bin/vm-hands/vm-hands-entry-lite-0049w7cr.js +2 -0
  16. package/bin/vm-hands/{vm-hands-entry-lite-8avxkcq6.js → vm-hands-entry-lite-0v0hyszp.js} +1 -1
  17. package/bin/vm-hands/{vm-hands-entry-lite-ns038y54.js → vm-hands-entry-lite-2yhty3wm.js} +1 -1
  18. package/bin/vm-hands/{vm-hands-entry-lite-vkh2ym8j.js → vm-hands-entry-lite-330bwmbp.js} +1 -1
  19. package/bin/vm-hands/{vm-hands-entry-lite-7c376ed5.js → vm-hands-entry-lite-370kvrw6.js} +1 -1
  20. package/bin/vm-hands/{vm-hands-entry-lite-vkes58t1.js → vm-hands-entry-lite-3ahrje3p.js} +1 -1
  21. package/bin/vm-hands/{vm-hands-entry-lite-kzyjyq34.js → vm-hands-entry-lite-3vk1frbk.js} +1 -1
  22. package/bin/vm-hands/{vm-hands-entry-lite-2tj8k3zw.js → vm-hands-entry-lite-5ced49bh.js} +1 -1
  23. package/bin/vm-hands/{vm-hands-entry-lite-qevgjf1b.js → vm-hands-entry-lite-6asg5xb7.js} +1 -1
  24. package/bin/vm-hands/{vm-hands-entry-lite-yyk7ge0e.js → vm-hands-entry-lite-6sxdh430.js} +1 -1
  25. package/bin/vm-hands/{vm-hands-entry-lite-frqx145j.js → vm-hands-entry-lite-cw50k5tb.js} +1 -1
  26. package/bin/vm-hands/{vm-hands-entry-lite-6gax6pr9.js → vm-hands-entry-lite-en4nbg71.js} +1 -1
  27. package/bin/vm-hands/{vm-hands-entry-lite-56dqar5x.js → vm-hands-entry-lite-f2gdcz7w.js} +1 -1
  28. package/bin/vm-hands/{vm-hands-entry-lite-d9sbxxqn.js → vm-hands-entry-lite-htmzt3t4.js} +1 -1
  29. package/bin/vm-hands/{vm-hands-entry-lite-ga61bq1j.js → vm-hands-entry-lite-jhcbsyey.js} +1 -1
  30. package/bin/vm-hands/{vm-hands-entry-lite-f50sx1nt.js → vm-hands-entry-lite-mykzyw4w.js} +1 -1
  31. package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
  32. package/bin/vm-hands/{vm-hands-executor-a7pmtx73.js → vm-hands-executor-6sny1jq1.js} +1 -1
  33. package/bin/vm-hands/{vm-hands-op-runner-1a67df81.js → vm-hands-op-runner-5r1x52zk.js} +1 -1
  34. package/bin/vm-hands/{vm-hands-runtime-1rq87k4n.js → vm-hands-runtime-07ys7ccn.js} +3 -3
  35. package/package.json +1 -1
  36. package/bin/vm-hands/local-display-video-nasefpwg.js +0 -2
  37. package/bin/vm-hands/version-019jz75z.js +0 -2
  38. package/bin/vm-hands/vm-hands-entry-lite-z4x5sddh.js +0 -2
package/bin/reason CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/reason
3
3
  size: 90371552 bytes
4
- sha256: 5c9f8be04516d709ddd0455fba3904c93521ee30e8ca2defd1bd3ccfd23620dd
4
+ sha256: 7a714a28947a0a23ff0c0f166d59b915413872d0e7659fa8d4dc70d2450e2435
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{I,ks,Qo}from"./vm-hands-entry-lite-yyk7ge0e.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{I as ApiError,Qo as ReasonApi,ks as createMachineEnrollmentTicketWithToken};
2
+ import{I,ks,Qo}from"./vm-hands-entry-lite-6sxdh430.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{I as ApiError,Qo as ReasonApi,ks as createMachineEnrollmentTicketWithToken};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ui,Xo,Yo,xs}from"./vm-hands-entry-lite-56dqar5x.js";import"./vm-hands-entry-lite-yyk7ge0e.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ui as apiOriginFromEnvironment,Yo as environmentApiKey,Xo as explicitApiOrigin,xs as resolveApiCredentials};
2
+ import{Ui,Xo,Yo,xs}from"./vm-hands-entry-lite-f2gdcz7w.js";import"./vm-hands-entry-lite-6sxdh430.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ui as apiOriginFromEnvironment,Yo as environmentApiKey,Xo as explicitApiOrigin,xs as resolveApiCredentials};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{it,ys,bs,vs}from"./vm-hands-entry-lite-2tj8k3zw.js";import"./vm-hands-entry-lite-60pnam39.js";import"./vm-hands-entry-lite-7p4qsm5s.js";import"./vm-hands-entry-lite-56dqar5x.js";import"./vm-hands-entry-lite-yyk7ge0e.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-6gax6pr9.js";import"./vm-hands-entry-lite-ns038y54.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-8avxkcq6.js";import"./vm-hands-entry-lite-ga61bq1j.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-vkes58t1.js";import"./vm-hands-entry-lite-frqx145j.js";import"./vm-hands-entry-lite-qevgjf1b.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-7c376ed5.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{ys as computerDisconnected,it as connectionDirectory,bs as connectionReport,vs as restartConnection};
2
+ import{it,ys,bs,vs}from"./vm-hands-entry-lite-5ced49bh.js";import"./vm-hands-entry-lite-60pnam39.js";import"./vm-hands-entry-lite-7p4qsm5s.js";import"./vm-hands-entry-lite-f2gdcz7w.js";import"./vm-hands-entry-lite-6sxdh430.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-en4nbg71.js";import"./vm-hands-entry-lite-2yhty3wm.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-0v0hyszp.js";import"./vm-hands-entry-lite-jhcbsyey.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-3ahrje3p.js";import"./vm-hands-entry-lite-cw50k5tb.js";import"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-370kvrw6.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{ys as computerDisconnected,it as connectionDirectory,bs as connectionReport,vs as restartConnection};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Pn,Fs,js,Us,Hs,Tn}from"./vm-hands-entry-lite-vkes58t1.js";import"./vm-hands-entry-lite-frqx145j.js";import"./vm-hands-entry-lite-qevgjf1b.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-7c376ed5.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{js as ensureLocalBrowser,Pn as localAutomationAvailable,Us as localBrowserProfile,Fs as localUserChromeHost,Hs as runAutomationCallLocally,Tn as runLocalAutomation};
2
+ import{Pn,Fs,js,Us,Hs,Tn}from"./vm-hands-entry-lite-3ahrje3p.js";import"./vm-hands-entry-lite-cw50k5tb.js";import"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-370kvrw6.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{js as ensureLocalBrowser,Pn as localAutomationAvailable,Us as localBrowserProfile,Fs as localUserChromeHost,Hs as runAutomationCallLocally,Tn as runLocalAutomation};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{es,qi,mn,ts,rs,ns,is,Ds,Ns,Ls,Ms}from"./vm-hands-entry-lite-ns038y54.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-8avxkcq6.js";import"./vm-hands-entry-lite-ga61bq1j.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-vkes58t1.js";import"./vm-hands-entry-lite-frqx145j.js";import"./vm-hands-entry-lite-qevgjf1b.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-7c376ed5.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{r as LocalCapabilityError,es as SHORT_REQUEST_CAPABILITIES,Ds as capabilityInventoryForRoots,qi as confinedExecutionShell,ts as defaultLocalCommandRunner,Ns as deliverLocalHandsEnvironment,is as enrolledRootPaths,Ms as executeLocalOperation,Ls as rebindLocalHandsControl,rs as runFileCapability,ns as runTransferCapability,mn as spawnCaptured};
2
+ import{es,qi,mn,ts,rs,ns,is,Ds,Ns,Ls,Ms}from"./vm-hands-entry-lite-2yhty3wm.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-0v0hyszp.js";import"./vm-hands-entry-lite-jhcbsyey.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-3ahrje3p.js";import"./vm-hands-entry-lite-cw50k5tb.js";import"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-370kvrw6.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{r as LocalCapabilityError,es as SHORT_REQUEST_CAPABILITIES,Ds as capabilityInventoryForRoots,qi as confinedExecutionShell,ts as defaultLocalCommandRunner,Ns as deliverLocalHandsEnvironment,is as enrolledRootPaths,Ms as executeLocalOperation,Ls as rebindLocalHandsControl,rs as runFileCapability,ns as runTransferCapability,mn as spawnCaptured};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ft,zs,G,qe,jt}from"./vm-hands-entry-lite-frqx145j.js";import"./vm-hands-entry-lite-qevgjf1b.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{qe as ensureLinuxDesktop,Ft as localDisplayAvailable,zs as localDisplayReady,G as privateDirectory,jt as runLocalDisplayStream};
2
+ import{Ft,zs,G,qe,jt}from"./vm-hands-entry-lite-cw50k5tb.js";import"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{qe as ensureLinuxDesktop,Ft as localDisplayAvailable,zs as localDisplayReady,G as privateDirectory,jt as runLocalDisplayStream};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{On,In,Dn,Nn,Tr}from"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";export{On as MAC_SCREEN,In as WINDOWS_SCREEN,Dn as createDisplayVideoLane,Tr as localDisplayVideoAvailable,Nn as simulatorVideoFfmpeg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ot,fr,$s,Bs}from"./vm-hands-entry-lite-8avxkcq6.js";import"./vm-hands-entry-lite-ga61bq1j.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{ot as ManagedProcessStoppedError,$s as controlManagedDeviceProcess,Bs as retireManagedDeviceProcess,fr as runManagedDeviceProcess};
2
+ import{ot,fr,$s,Bs}from"./vm-hands-entry-lite-0v0hyszp.js";import"./vm-hands-entry-lite-jhcbsyey.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-3p7zk3yt.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{ot as ManagedProcessStoppedError,$s as controlManagedDeviceProcess,Bs as retireManagedDeviceProcess,fr as runManagedDeviceProcess};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Cs,As,Ps,Ts,Rs,Os,Is}from"./vm-hands-entry-lite-6gax6pr9.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Rs as acquireManagedRuntimeDirectoryLock,Ps as currentManagedRuntimeVersion,Is as flushManagedRuntimeLifecycleEvents,Ts as isManagedRuntimeVersionExecutable,As as legacyManagedRuntimePaths,Cs as managedRuntimePaths,Os as recordManagedRuntimeLifecycle};
2
+ import{Cs,As,Ps,Ts,Rs,Os,Is}from"./vm-hands-entry-lite-en4nbg71.js";import"./vm-hands-entry-lite-ymqb2927.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Rs as acquireManagedRuntimeDirectoryLock,Ps as currentManagedRuntimeVersion,Is as flushManagedRuntimeLifecycleEvents,Ts as isManagedRuntimeVersionExecutable,As as legacyManagedRuntimePaths,Cs as managedRuntimePaths,Os as recordManagedRuntimeLifecycle};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ss,as,Ws,Vs}from"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";export{Vs as allowMacPermissions,Ws as permissionsSummary,as as readMacPermissions,ss as reasonIdentity};
2
+ import{ss,as,Ws,Vs}from"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";export{Vs as allowMacPermissions,Ws as permissionsSummary,as as readMacPermissions,ss as reasonIdentity};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Wr,xe,J,Kn,Gs,Ro,Ks,Ye,ls,Jn,Js,Zs,Vr,Xs,Ys}from"./vm-hands-entry-lite-7c376ed5.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Wr as WORKER_SERVICE_ENV,J as WorkerServiceError,Ro as connectServiceLabel,xe as defaultWorkerServiceHost,Zs as installWorkerService,Ye as installedWorkerService,Ks as isConnectServiceLabel,Ys as removeWorkerService,Vr as restartWorkerService,Xs as retargetWorkerServiceLogs,ls as retireLegacyWorkerService,Js as workerServiceDefinitionCurrent,Kn as workerServiceLauncher,Jn as workerServiceProcessRunning,Gs as workerServiceRetargetPending};
2
+ import{Wr,xe,J,Kn,Gs,Ro,Ks,Ye,ls,Jn,Js,Zs,Vr,Xs,Ys}from"./vm-hands-entry-lite-370kvrw6.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-0sh835na.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-qz74j563.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Wr as WORKER_SERVICE_ENV,J as WorkerServiceError,Ro as connectServiceLabel,xe as defaultWorkerServiceHost,Zs as installWorkerService,Ye as installedWorkerService,Ks as isConnectServiceLabel,Ys as removeWorkerService,Vr as restartWorkerService,Xs as retargetWorkerServiceLogs,ls as retireLegacyWorkerService,Js as workerServiceDefinitionCurrent,Kn as workerServiceLauncher,Jn as workerServiceProcessRunning,Gs as workerServiceRetargetPending};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./vm-hands-entry-lite-yyk7ge0e.js";import"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-s85p7tqp.js";import"./vm-hands-entry-lite-z4x5sddh.js";import"./vm-hands-entry-lite-56dqar5x.js";import{Kt,pt}from"./vm-hands-entry-lite-3p7zk3yt.js";import{w,M,pr,Be,it}from"./vm-hands-entry-lite-2tj8k3zw.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-ns038y54.js";import"./vm-hands-entry-lite-ga61bq1j.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-60pnam39.js";import"./vm-hands-entry-lite-qevgjf1b.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-d9sbxxqn.js";import"./vm-hands-entry-lite-kzyjyq34.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-6gax6pr9.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-7c376ed5.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-8avxkcq6.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-frqx145j.js";import"./vm-hands-entry-lite-vkes58t1.js";import"./vm-hands-entry-lite-7p4qsm5s.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-qzcac2mf.js";import"./vm-hands-entry-lite-qz74j563.js";import{readFileSync as me,realpathSync as k,renameSync as ge,unlinkSync as fe,writeFileSync as he}from"fs";import{dirname as ye,join as I}from"path";function f(e){return`claude mcp add --transport http reason ${e}`}function h(e){return`codex mcp add reason --url ${e}
2
+ import"./vm-hands-entry-lite-6sxdh430.js";import"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-wp0d65yx.js";import"./vm-hands-entry-lite-39qv4sqt.js";import"./vm-hands-entry-lite-pwmvq53c.js";import"./vm-hands-entry-lite-s85p7tqp.js";import"./vm-hands-entry-lite-0049w7cr.js";import"./vm-hands-entry-lite-f2gdcz7w.js";import{Kt,pt}from"./vm-hands-entry-lite-3p7zk3yt.js";import{w,M,pr,Be,it}from"./vm-hands-entry-lite-5ced49bh.js";import"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import"./vm-hands-entry-lite-2yhty3wm.js";import"./vm-hands-entry-lite-jhcbsyey.js";import"./vm-hands-entry-lite-dcrz19xf.js";import"./vm-hands-entry-lite-5np5k3wb.js";import"./vm-hands-entry-lite-60pnam39.js";import"./vm-hands-entry-lite-6asg5xb7.js";import"./vm-hands-entry-lite-k1wghndy.js";import"./vm-hands-entry-lite-htmzt3t4.js";import"./vm-hands-entry-lite-3vk1frbk.js";import"./vm-hands-entry-lite-wx1fmrbs.js";import"./vm-hands-entry-lite-en4nbg71.js";import"./vm-hands-entry-lite-vs47bs09.js";import"./vm-hands-entry-lite-370kvrw6.js";import"./vm-hands-entry-lite-1ek3r3w9.js";import"./vm-hands-entry-lite-1zd088yv.js";import"./vm-hands-entry-lite-td73npv3.js";import"./vm-hands-entry-lite-0v0hyszp.js";import"./vm-hands-entry-lite-024t90qh.js";import"./vm-hands-entry-lite-m7pkmatv.js";import"./vm-hands-entry-lite-cw50k5tb.js";import"./vm-hands-entry-lite-3ahrje3p.js";import"./vm-hands-entry-lite-7p4qsm5s.js";import"./vm-hands-entry-lite-psjcmgj8.js";import"./vm-hands-entry-lite-ymqb2927.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-qzcac2mf.js";import"./vm-hands-entry-lite-qz74j563.js";import{readFileSync as me,realpathSync as k,renameSync as ge,unlinkSync as fe,writeFileSync as he}from"fs";import{dirname as ye,join as I}from"path";function f(e){return`claude mcp add --transport http reason ${e}`}function h(e){return`codex mcp add reason --url ${e}
3
3
  codex mcp login reason`}var F=f("https://mcp.reasonmachines.com/mcp"),z=h("https://mcp.reasonmachines.com/mcp"),B=`https://claude.ai/settings/connectors?add=custom&url=${encodeURIComponent("https://mcp.reasonmachines.com/mcp")}`,H=`https://cursor.com/install-mcp?name=reason&config=${encodeURIComponent(btoa(JSON.stringify({url:"https://mcp.reasonmachines.com/mcp"})))}`;var b="https://github.com/reason-machines/reason-plugins",X=`Connect a coding agent to Reason over MCP
4
4
 
5
5
  Usage:
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Qe,Yn}from"./vm-hands-entry-lite-0049w7cr.js";export{Yn as CLI_USER_AGENT,Qe as CLI_VERSION};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{tr}from"./vm-hands-entry-lite-mykzyw4w.js";var Qe=tr.version,Yn=`reason-cli/${Qe}`;export{Qe,Yn};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{H}from"./vm-hands-entry-lite-39qv4sqt.js";import{D,R,b}from"./vm-hands-entry-lite-1zd088yv.js";import{je,gr,_r,Sn,En,at}from"./vm-hands-entry-lite-ga61bq1j.js";import{Mr}from"./vm-hands-entry-lite-3p7zk3yt.js";import{p,lt,An,_e,we}from"./vm-hands-entry-lite-psjcmgj8.js";import{v,h}from"./vm-hands-entry-lite-ymqb2927.js";import{a,nr,Uo}from"./vm-hands-entry-lite-0sh835na.js";import{an,y,t,k,o,d,ps,Oe,$i,u,i,W,g,ee,s,n,cn}from"./vm-hands-entry-lite-qzcac2mf.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{se,A}from"./vm-hands-entry-lite-qz74j563.js";import{randomUUID as Q}from"crypto";import{spawn as Le}from"child_process";import{existsSync as Z,lstatSync as me,mkdirSync as We,readFileSync as Ne,realpathSync as G,rmSync as Ve,writeFileSync as He}from"fs";import{dirname as Ue,join as j,relative as qe,sep as Je}from"path";var Se=["process.run.v1","process.full.v1"],xe=600000,Pe=1800000,Ee=20000,ne="process.cancel.v1",ie=i({action:n("start"),request_id:t().uuid(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),cwd:t().min(1).max(4096).refine((e)=>!e.includes("\x00")&&!e.startsWith("/")&&!e.split(/[\\/]/).includes("..")).describe("Path relative to the granted device root; omit to use that root. Must not start with /, contain a .. path segment, or contain a NUL character.").optional(),mode:s(["host","confined"]).default("host"),timeout_ms:o().int().min(1000).max(Pe).default(xe).describe("Absolute process budget including queue and startup time. Defaults to ten minutes; longer explicit requests require the selected root's advertised max_timeout_ms. Retrying never renews the deadline.")}).strict(),K={device_id:t().uuid(),root_id:t().uuid()},Re=g("action",[ie.extend(K),i({...K,action:n("inspect"),process_id:t().uuid(),after:o().int().min(0).default(0),wait_ms:o().int().min(0).max(Ee).default(0).describe("Wait for new output or a state change, bounded by this call's wait budget. Expiring this wait does not cancel the process or extend its deadline.")}).strict(),i({...K,action:n("cancel"),process_id:t().uuid()}).strict()]),Fe=an(Re,{io:"input"}),Ke=ie.extend({process_brain_fence:t().uuid(),process_expires_at:y.datetime()}).strict(),J=i({version:n(1),process_id:t().uuid(),state:s(["starting","running","exited","cancelled","expired","uncertain"]),exit_code:o().int().nullable(),first_cursor:o().int().min(0),next_cursor:o().int().min(0),truncated:d(),observed_at:y.datetime(),output:u(i({cursor:o().int().min(1),stream:s(["stdout","stderr"]),text:t().max(32768)}).strict()).max(128)}).strict().refine((e)=>{if(Buffer.byteLength(JSON.stringify(e))>1e5||e.next_cursor<e.first_cursor-1)return!1;if((e.state==="starting"||e.state==="running"||e.state==="uncertain")&&e.exit_code!==null)return!1;if(e.state==="exited"&&(e.exit_code===null||e.exit_code<0||e.exit_code>255))return!1;if(e.state==="cancelled"&&e.exit_code!==130||e.state==="expired"&&e.exit_code!==124)return!1;let _=e.first_cursor-1;for(let l of e.output){if(l.cursor<=_||l.cursor>e.next_cursor)return!1;_=l.cursor}return!0});function ae(e){return Se.includes(e)}var Xe=i({operation_constraints:ee(t(),Oe())}),Ye=i({ready:n(!0),version:n(1),execution_mode:s(["host","confined"]),max_timeout_ms:o().int().min(1000).optional()});var Ie=i({version:n(1),process_id:t().uuid(),state:s(["queued","cancelled_before_start","not_started"]),exit_code:ps(),output:u($i()).length(0),first_cursor:n(0),next_cursor:n(0),truncated:n(!1),cancellation_requested:n(!1),reason_code:s(["cancelled_before_start","process_journal_capacity","path_not_found","process_timeout_unsupported"]).optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it.")}).strict(),De=i({...J.shape,state:s(["queued","starting","running","exited","cancelled","expired","uncertain","cancelled_before_start","not_started"]),observed_at:y.datetime().optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it."),cancellation_requested:d(),reason_code:t().nullable().optional(),execution_authority:n("lost").optional().describe("Historical receipt only; the current Brain cannot control this older-generation process."),recovery:i({cause:n("brain_generation_changed"),terminal_confirmed:d(),next_step:s(["inspect_until_terminal","reconcile_effects_before_new_intent"])}).strict().optional().describe("Historical process recovery only. An unconfirmed outcome forbids replay. A confirmed terminal observation proves the old process stopped, not that its command had no effects. Reconcile the result; only restart still-needed, safely repeatable work with a new request_id and current authority. Respect user cancellation."),last_observed_state:J.shape.state.or(n("cancelled_before_start")).nullable().optional().describe("Last saved observation before authority was lost; a running observation does not establish current child liveness.")}).strict(),$e=an(De),Qe=W([J,Ie.refine((e)=>e.state==="cancelled_before_start")]),X=i({version:n(1),process_id:t().uuid(),state:s(["exited","cancelled","expired"]),exit_code:o().int().min(0).max(255),observed_at:y.datetime()}).strict().refine((e)=>(e.state!=="cancelled"||e.exit_code===130)&&(e.state!=="expired"||e.exit_code===124)),Ze=i({process_terminal_observation:X}).strict();var Ki="preview.serve.v1",Ji=43200000;var ce="preview.open.v1",de=1,_n="gid_proxy_v1",Zi="egress",yn=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[1-9][0-9]{0,4})?$/,Ce=i({version:n(_n),allowed_domains:u(t().max(260).regex(yn)).max(1024)}).strict(),Ae=cn((e)=>H(e)!==null,"invalid workspace"),ke=i({version:n(1),request_id:k(),session_id:k(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),port:o().int().min(1024).max(65535),workspace:Ae,egress:Ce.optional()}).strict(),Xi=ke.extend({expires_at:y.datetime()}).strict();var Me=4,Te=5000;function Y(e,c,_){let l=null;try{l=lt(e)}catch{}An({deviceRelayUrl:l?.deviceRelayUrl??"",binding:l?.binding??null,jobId:c,port:l?.binding.port??0,reason:l?_:"binding_invalid"})}function le(e){let c=new Map;return{open(_){let l=(x)=>Y(_,e.claim.operation_id,x),C;try{C=lt(_)}catch{return l("binding_invalid")}let{binding:w,deviceRelayUrl:z}=C,E=e.claim.owner;if(!E||w.organizationId!==E.organization_id||w.userId!==E.user_id||w.deviceId!==E.device_id||w.rootId!==e.claim.root_id||w.jobId!==e.claim.operation_id||w.fenceId!==e.claim.operation_id||w.generation!==de||w.expiresAtMs>Math.min(Date.now()+p.lifetimeMs+Te,e.expiresAtMs))return l("binding_mismatch");if(w.expiresAtMs<=Date.now())return l("binding_expired");if(c.get(w.port)?.abort(),c.delete(w.port),c.size>=Me)return l("preview_capacity");let L=new AbortController;c.set(w.port,L);let P=we({binding:w,deniedPorts:e.deniedPorts,readCurrentJob:async()=>{if(L.signal.aborted)return null;let x=await e.inspect();return x?{binding:w,executorLaunchId:e.executorLaunchId,job:x}:null}});_e({binding:w,deviceRelayUrl:z,port:P,signal:L.signal}).then((x)=>x.closed,(x)=>{let I=x instanceof Error?x.message:"preview_failed";if(I!=="preview_not_authorized")process.stderr.write(`${JSON.stringify({event:"worker_preview.open_failed",job_id:w.jobId,port:w.port,reason_code:I})}
2
+ import{H}from"./vm-hands-entry-lite-39qv4sqt.js";import{D,R,b}from"./vm-hands-entry-lite-1zd088yv.js";import{je,gr,_r,Sn,En,at}from"./vm-hands-entry-lite-jhcbsyey.js";import{Mr}from"./vm-hands-entry-lite-3p7zk3yt.js";import{p,lt,An,_e,we}from"./vm-hands-entry-lite-psjcmgj8.js";import{v,h}from"./vm-hands-entry-lite-ymqb2927.js";import{a,nr,Uo}from"./vm-hands-entry-lite-0sh835na.js";import{an,y,t,k,o,d,ps,Oe,$i,u,i,W,g,ee,s,n,cn}from"./vm-hands-entry-lite-qzcac2mf.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{se,A}from"./vm-hands-entry-lite-qz74j563.js";import{randomUUID as Q}from"crypto";import{spawn as Le}from"child_process";import{existsSync as Z,lstatSync as me,mkdirSync as We,readFileSync as Ne,realpathSync as G,rmSync as Ve,writeFileSync as He}from"fs";import{dirname as Ue,join as j,relative as qe,sep as Je}from"path";var Se=["process.run.v1","process.full.v1"],xe=600000,Pe=1800000,Ee=20000,ne="process.cancel.v1",ie=i({action:n("start"),request_id:t().uuid(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),cwd:t().min(1).max(4096).refine((e)=>!e.includes("\x00")&&!e.startsWith("/")&&!e.split(/[\\/]/).includes("..")).describe("Path relative to the granted device root; omit to use that root. Must not start with /, contain a .. path segment, or contain a NUL character.").optional(),mode:s(["host","confined"]).default("host"),timeout_ms:o().int().min(1000).max(Pe).default(xe).describe("Absolute process budget including queue and startup time. Defaults to ten minutes; longer explicit requests require the selected root's advertised max_timeout_ms. Retrying never renews the deadline.")}).strict(),K={device_id:t().uuid(),root_id:t().uuid()},Re=g("action",[ie.extend(K),i({...K,action:n("inspect"),process_id:t().uuid(),after:o().int().min(0).default(0),wait_ms:o().int().min(0).max(Ee).default(0).describe("Wait for new output or a state change, bounded by this call's wait budget. Expiring this wait does not cancel the process or extend its deadline.")}).strict(),i({...K,action:n("cancel"),process_id:t().uuid()}).strict()]),Fe=an(Re,{io:"input"}),Ke=ie.extend({process_brain_fence:t().uuid(),process_expires_at:y.datetime()}).strict(),J=i({version:n(1),process_id:t().uuid(),state:s(["starting","running","exited","cancelled","expired","uncertain"]),exit_code:o().int().nullable(),first_cursor:o().int().min(0),next_cursor:o().int().min(0),truncated:d(),observed_at:y.datetime(),output:u(i({cursor:o().int().min(1),stream:s(["stdout","stderr"]),text:t().max(32768)}).strict()).max(128)}).strict().refine((e)=>{if(Buffer.byteLength(JSON.stringify(e))>1e5||e.next_cursor<e.first_cursor-1)return!1;if((e.state==="starting"||e.state==="running"||e.state==="uncertain")&&e.exit_code!==null)return!1;if(e.state==="exited"&&(e.exit_code===null||e.exit_code<0||e.exit_code>255))return!1;if(e.state==="cancelled"&&e.exit_code!==130||e.state==="expired"&&e.exit_code!==124)return!1;let _=e.first_cursor-1;for(let l of e.output){if(l.cursor<=_||l.cursor>e.next_cursor)return!1;_=l.cursor}return!0});function ae(e){return Se.includes(e)}var Xe=i({operation_constraints:ee(t(),Oe())}),Ye=i({ready:n(!0),version:n(1),execution_mode:s(["host","confined"]),max_timeout_ms:o().int().min(1000).optional()});var Ie=i({version:n(1),process_id:t().uuid(),state:s(["queued","cancelled_before_start","not_started"]),exit_code:ps(),output:u($i()).length(0),first_cursor:n(0),next_cursor:n(0),truncated:n(!1),cancellation_requested:n(!1),reason_code:s(["cancelled_before_start","process_journal_capacity","path_not_found","process_timeout_unsupported"]).optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it.")}).strict(),De=i({...J.shape,state:s(["queued","starting","running","exited","cancelled","expired","uncertain","cancelled_before_start","not_started"]),observed_at:y.datetime().optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it."),cancellation_requested:d(),reason_code:t().nullable().optional(),execution_authority:n("lost").optional().describe("Historical receipt only; the current Brain cannot control this older-generation process."),recovery:i({cause:n("brain_generation_changed"),terminal_confirmed:d(),next_step:s(["inspect_until_terminal","reconcile_effects_before_new_intent"])}).strict().optional().describe("Historical process recovery only. An unconfirmed outcome forbids replay. A confirmed terminal observation proves the old process stopped, not that its command had no effects. Reconcile the result; only restart still-needed, safely repeatable work with a new request_id and current authority. Respect user cancellation."),last_observed_state:J.shape.state.or(n("cancelled_before_start")).nullable().optional().describe("Last saved observation before authority was lost; a running observation does not establish current child liveness.")}).strict(),$e=an(De),Qe=W([J,Ie.refine((e)=>e.state==="cancelled_before_start")]),X=i({version:n(1),process_id:t().uuid(),state:s(["exited","cancelled","expired"]),exit_code:o().int().min(0).max(255),observed_at:y.datetime()}).strict().refine((e)=>(e.state!=="cancelled"||e.exit_code===130)&&(e.state!=="expired"||e.exit_code===124)),Ze=i({process_terminal_observation:X}).strict();var Ki="preview.serve.v1",Ji=43200000;var ce="preview.open.v1",de=1,_n="gid_proxy_v1",Zi="egress",yn=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[1-9][0-9]{0,4})?$/,Ce=i({version:n(_n),allowed_domains:u(t().max(260).regex(yn)).max(1024)}).strict(),Ae=cn((e)=>H(e)!==null,"invalid workspace"),ke=i({version:n(1),request_id:k(),session_id:k(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),port:o().int().min(1024).max(65535),workspace:Ae,egress:Ce.optional()}).strict(),Xi=ke.extend({expires_at:y.datetime()}).strict();var Me=4,Te=5000;function Y(e,c,_){let l=null;try{l=lt(e)}catch{}An({deviceRelayUrl:l?.deviceRelayUrl??"",binding:l?.binding??null,jobId:c,port:l?.binding.port??0,reason:l?_:"binding_invalid"})}function le(e){let c=new Map;return{open(_){let l=(x)=>Y(_,e.claim.operation_id,x),C;try{C=lt(_)}catch{return l("binding_invalid")}let{binding:w,deviceRelayUrl:z}=C,E=e.claim.owner;if(!E||w.organizationId!==E.organization_id||w.userId!==E.user_id||w.deviceId!==E.device_id||w.rootId!==e.claim.root_id||w.jobId!==e.claim.operation_id||w.fenceId!==e.claim.operation_id||w.generation!==de||w.expiresAtMs>Math.min(Date.now()+p.lifetimeMs+Te,e.expiresAtMs))return l("binding_mismatch");if(w.expiresAtMs<=Date.now())return l("binding_expired");if(c.get(w.port)?.abort(),c.delete(w.port),c.size>=Me)return l("preview_capacity");let L=new AbortController;c.set(w.port,L);let P=we({binding:w,deniedPorts:e.deniedPorts,readCurrentJob:async()=>{if(L.signal.aborted)return null;let x=await e.inspect();return x?{binding:w,executorLaunchId:e.executorLaunchId,job:x}:null}});_e({binding:w,deviceRelayUrl:z,port:P,signal:L.signal}).then((x)=>x.closed,(x)=>{let I=x instanceof Error?x.message:"preview_failed";if(I!=="preview_not_authorized")process.stderr.write(`${JSON.stringify({event:"worker_preview.open_failed",job_id:w.jobId,port:w.port,reason_code:I})}
3
3
  `)}).finally(()=>{if(c.get(w.port)===L)c.delete(w.port)})},dispose(){for(let _ of c.values())_.abort();c.clear()}}}class ot extends r{observation;constructor(e){super("process_authority_lost","Process authority was lost; the owned process group has stopped.");this.observation=e}}var fe=256,B=new Map,he="preview.serve.v1",V=new Map;function be(e){let c=V.get(e.operation_id);if(c){if(c.claim!==e)throw M("process_authority_lost");return c}if(V.size>=fe)throw M("process_journal_capacity");let _={claim:e,executing:!1,cancelRequested:!1,phase:"pending"};return V.set(e.operation_id,_),_}function pe(e){return{version:1,process_id:e,state:"cancelled_before_start",exit_code:null,output:[],first_cursor:0,next_cursor:0,truncated:!1,cancellation_requested:!1,reason_code:"cancelled_before_start"}}var ue=(e)=>new Promise((c)=>setTimeout(c,e)),M=(e="process_outcome_uncertain")=>new r(e,"The managed process outcome could not be confirmed; inspect its saved receipt before starting another intent.");function ze(e=a(),c=Ge()){let _=Ue(Mr({},e)),l=qe(nr(e),_),[C,...w]=l.split(Je);return{directory:j(c,l,"processes"),previous:[j(_,"processes"),...C==="reason"?[j(c,"ara",...w,"processes")]:[]]}}function Ge(){if(process.platform!=="darwin")throw new r("process_unavailable","Managed Mac process execution is unavailable.");let e=Uo();if(!e)throw new r("process_unavailable","The private per-user process directory is unavailable.");return e}async function fr(e){if(!e.claim.owner||e.signal.aborted||e.expiresAtMs<=Date.now())throw M("process_authority_lost");let c=be(e.claim);if(c.executing)throw M("process_busy");if(c.executing=!0,c.cancelRequested)return c.phase="settling",pe(e.claim.operation_id);c.phase="starting";let _=e.journals??ze();We(_.directory,{recursive:!0,mode:448});let l=gr({runtimeDirectory:G(_.directory),previousRuntimeDirectories:(_.previous??[]).filter((m)=>Z(m)).map((m)=>G(m)),root:e.root,runId:JSON.stringify([e.claim.owner,e.claim.run_id,e.claim.root_id,e.claim.operation_id]),maxScopes:fe});try{for(let m of[e.root,e.cwd])if(!je(G(m),l.journalDirectory))throw new r("process_journal_inside_workspace","The selected root contains the private process journal. Select an existing narrower granted workspace root outside the journal; no command was dispatched.")}catch(m){throw l.disposeSocket(),m}let C=me(l.journalDirectory),w=e.claim.capability===he,z=()=>B.set(e.claim.operation_id,{path:l.journalDirectory,ino:C.ino,dev:C.dev,anyCompletion:w}),E=l.launchDirectory,L=j(E,"config.json"),P={url:"",transport:"local_job_ipc",directShell:{mode:e.mode,executable:e.shell,jobId:e.claim.operation_id},workerVersion:D,protocolVersion:2,workerArtifactSha256:b,workerEntrypoint:R,targetGeneration:1,fenceId:Q(),...process.platform==="win32"?{bashExecutable:se()}:{},workRoot:e.root,workspaceAliasPath:e.root,repoPath:e.cwd,jobEnvPath:j(E,"unused.env"),replSocketPath:j(E,"unused.sock"),readyPath:j(E,"ready.json"),directTerminalReceiptPath:j(E,"terminal.json"),launchId:Q(),expiresAtMs:e.expiresAtMs+5000,bashTimeoutMs:60000,replTimeoutMs:1000,allowedTools:["bash"],managedJobs:{journalDirectory:l.journalDirectory,scopeId:l.scopeId},jobControlSocketPath:l.socketPath,...e.prefix?{bashCommandPrefix:e.prefix}:{},...e.jobsUser?{jobsUser:e.jobsUser}:{}},x;try{He(L,JSON.stringify(P),{mode:384});let m=Sn({configPath:L,root:e.cwd,grantedRoot:e.root,workRoot:e.root,temporaryDirectory:E});x=e.spawnWorker?.(L,P)??Le(m.command,m.args,{...m.options,env:e.environment,stdio:[En,"ignore","ignore"]})}catch(m){throw l.disposeSocket(),m}let I=!1,F=new Promise((m,S)=>{x.once("exit",(f)=>{I=!0,m(f)}),x.once("error",(f)=>{I=!0,S(f)})});F.catch(()=>{});let ge={root:e.root,runId:e.claim.run_id,scopeId:l.scopeId,socketPath:l.socketPath,generation:1,fenceId:P.fenceId,executorLaunchId:P.launchId,expiresAtMs:P.expiresAtMs},N=async(m)=>{let S=await _r(ge,{type:"job",version:2,generation:1,id:Q(),jobId:e.claim.operation_id,...m==="start"?{action:m,input:{script:e.command,leaseExpiresAtMs:e.expiresAtMs}}:m==="inspect"?{action:m,input:{after:0}}:m==="probe"?{action:"inspect",input:{after:Number.MAX_SAFE_INTEGER}}:{action:m,input:{}}},new AbortController().signal);if(!S.ok)throw M(S.error);return S.job},U=!1,q=!1,te,re=()=>{U=!0,at(x,"SIGTERM")};e.signal.addEventListener("abort",re,{once:!0});let T,oe=0,ve=async(m)=>{let S=[...m.output],f={version:1,process_id:e.claim.operation_id,state:m.state,exit_code:m.exitCode,first_cursor:m.firstCursor,next_cursor:m.nextCursor,truncated:m.truncated,output:S,observed_at:new Date().toISOString()};while(Buffer.byteLength(JSON.stringify(f))>90000&&S.length)S.shift(),f.truncated=!0,f.first_cursor=S[0]?.cursor??f.next_cursor+1;T=J.parse(f),await e.emit(T),oe=Date.now()};try{let m=Math.min(Date.now()+1e4,e.expiresAtMs);while(!Z(P.readyPath)){if(I)throw new r("process_start_failed","The managed process supervisor exited before accepting a command; no command was dispatched.");if(e.signal.aborted||Date.now()>=m)throw M("process_start_unconfirmed");await ue(25)}let S=JSON.parse(Ne(P.readyPath,"utf8"));if(S.launchId!==P.launchId||S.fenceId!==P.fenceId||S.workerArtifactSha256!==b)throw M();if(e.signal.throwIfAborted(),c.cancelRequested)return pe(e.claim.operation_id);let f;try{q=!0,f=await N("start")}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown")throw O;f=await N("inspect")}if(c.phase="running",c.cancel=async()=>{await N("cancel")},w&&e.preview)c.tunnels=le({claim:e.claim,executorLaunchId:P.launchId,expiresAtMs:e.expiresAtMs,deniedPorts:e.preview.deniedPorts,inspect:async()=>c.phase==="running"&&!I?await N("probe"):null});if(c.cancelRequested)await c.cancel(),f=await N("inspect");for(;;){if(!["starting","running"].includes(f.state))c.phase="settling",c.cancel=void 0;if(!T||T.state!==f.state||T.next_cursor!==f.nextCursor&&Date.now()-oe>=5000)await ve(f);if(!["starting","running"].includes(f.state))break;if(e.signal.aborted||I)throw M();await ue(1000);try{f=await N("inspect"),te=void 0}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown"||e.signal.aborted||I||Date.now()-(te??=Date.now())>120000)throw O}}if(!T||T.state==="uncertain")throw M();return T}finally{if(c.phase="settling",c.cancel=void 0,c.tunnels?.dispose(),c.tunnels=void 0,await c.cancelInFlight?.catch(()=>{}),e.signal.removeEventListener("abort",re),!I&&!U)at(x,"SIGTERM");let m,S=await Promise.race([F.then((f)=>({code:f})),new Promise((f)=>{m=setTimeout(()=>f(null),6000)})]).finally(()=>{clearTimeout(m)});if(!S){try{at(x,"SIGKILL")}catch{}try{await F}finally{if(I)l.disposeSocket()}throw M("process_cleanup_unconfirmed")}try{if((U||e.signal.aborted)&&S.code===0&&q){v(E);let f=JSON.parse(h(P.directTerminalReceiptPath)),O=X.safeParse(f.observation);if(Object.keys(f).length===4&&f.launch_id===P.launchId&&f.fence_id===P.fenceId&&f.scope_id===l.scopeId&&O.success&&O.data.process_id===e.claim.operation_id){if(w)z();throw new ot(O.data)}}}catch(f){if(f instanceof ot)throw f}finally{if(I)l.disposeSocket()}if(S.code!==0&&!U&&q)throw M("process_cleanup_unconfirmed");if(!U&&S.code===0&&(T&&["exited","cancelled","expired"].includes(T.state)||!q&&c.cancelRequested)||w&&S.code===0&&!q)z()}}async function $s(e,c){if(c.kind===ce&&e.capability===he){let C=V.get(e.operation_id);if(C?.claim===e&&C.tunnels)C.tunnels.open(c.payload);else Y(c.payload,e.operation_id,"server_not_running");return!0}if(c.kind!==ne||!ae(e.capability)||!e.owner||c.payload.process_id!==e.operation_id)return!1;let _=V.get(e.operation_id);if(_&&_.claim!==e)return!1;let l=be(e);if(l.cancelRequested=!0,l.phase==="running"&&l.cancel)l.cancelInFlight??=l.cancel(),await l.cancelInFlight;return!0}function Bs(e,c){V.delete(e);let _=B.get(e);if(!_||c!=="succeeded"&&!_.anyCompletion)return B.delete(e),!1;try{let l=me(_.path);if(!l.isDirectory()||l.isSymbolicLink()||l.ino!==_.ino||l.dev!==_.dev||!A(l)||G(_.path)!==_.path||Z(j(_.path,"owner.lock")))return!1;return Ve(_.path,{recursive:!0}),B.delete(e),!0}catch{return!1}}
4
4
  export{Ki,Ji,_n,Zi,yn,Xi,ot,fr,$s,Bs};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{nt,St,cr,on,Et,xt,Oi,sn,Ii,Di,Ni}from"./vm-hands-entry-lite-64b6nx6h.js";import{Pe,sr,ri,yt,zo,oe,qo,Wo,tt,Te,nn,ii,bt,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,pe,Y,Re,q,vi,Si,Ei,xi,ki,Ci,Ai,Pi,vt,Ti}from"./vm-hands-entry-lite-vwxg4fhe.js";import{ue,Z,O}from"./vm-hands-entry-lite-39qv4sqt.js";import{P,Xt}from"./vm-hands-entry-lite-1ek3r3w9.js";import{mr,Yi,Qi,st,eo,to,ro,no,io,oo,yr,wr,br,wn,bn,vr,ao,vn,Sr,me,ge,Dt,Er,kr,Nt}from"./vm-hands-entry-lite-ga61bq1j.js";import{D,R,b}from"./vm-hands-entry-lite-1zd088yv.js";import{Ki,Ji,_n,Zi,yn,Xi,ot,fr}from"./vm-hands-entry-lite-8avxkcq6.js";import{K}from"./vm-hands-entry-lite-wx1fmrbs.js";import{He}from"./vm-hands-entry-lite-dcrz19xf.js";import{j}from"./vm-hands-entry-lite-3p7zk3yt.js";import{hr,gn,Gi}from"./vm-hands-entry-lite-5np5k3wb.js";import{wo,bo,ut,vo,So,Eo,xo,ko}from"./vm-hands-entry-lite-k1wghndy.js";import{Ir,Vt,Dr,jn,Un}from"./vm-hands-entry-lite-m7pkmatv.js";import{Ft,qe,jt}from"./vm-hands-entry-lite-frqx145j.js";import{Nn,x,go}from"./vm-hands-entry-lite-qevgjf1b.js";import{_o,yo}from"./vm-hands-entry-lite-kzyjyq34.js";import{Bt,Pn,Tn}from"./vm-hands-entry-lite-vkes58t1.js";import{ye,uo,po}from"./vm-hands-entry-lite-psjcmgj8.js";import{be}from"./vm-hands-entry-lite-yretc2th.js";import{$t}from"./vm-hands-entry-lite-ckezse0f.js";import{ve,Ht,zt,qt,E}from"./vm-hands-entry-lite-70hq7mrs.js";import{a,ie}from"./vm-hands-entry-lite-0sh835na.js";import{t,k,o,d,u,i,W,g,ee,s,n,Ko}from"./vm-hands-entry-lite-qzcac2mf.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{fe,Ne,Le,Me,ln}from"./vm-hands-entry-lite-qz74j563.js";import{$e}from"./vm-hands-entry-lite-mcjca0ez.js";import{request as Nl}from"http";import{request as Ml}from"https";import{lookup as $l}from"dns/promises";import{isIP as Bl}from"net";async function Fl(e){let l=new URL(e.url);return await new Promise((c,p)=>{let m=(l.protocol==="https:"?Ml:Nl)(l,{method:"POST",headers:{...e.headers,"accept-encoding":"identity"},signal:e.signal,timeout:Oi},(f)=>c({response:f,close:()=>{f.destroy(),m.destroy(),f.socket?.destroy()}}));m.once("error",p),m.once("timeout",()=>m.destroy(Object.assign(Error("custom_endpoint_timeout"),{code:"ETIMEDOUT"}))),m.end(e.body)})}var Wi=new Set(["ENOTFOUND","EAI_AGAIN","EAI_NONAME","EAI_NODATA","EAI_FAIL","DNSException"]),Ul=new Set(["ECONNREFUSED","ETIMEDOUT","ECONNRESET","EHOSTUNREACH","ENETUNREACH","EHOSTDOWN","ENETDOWN","EPIPE","ECONNABORTED","EADDRNOTAVAIL","ConnectionRefused","ConnectionClosed","ConnectionTimedOut","Timeout"]);function Vi(e,l=0){if(!e||typeof e!=="object"||l>3)return null;let c=e.code;if(typeof c==="string"){if(Wi.has(c))return"custom_endpoint_host_not_found";if(Ul.has(c))return"custom_endpoint_connection_failed";if(/^(?:ERR_TLS_|ERR_SSL_|CERT_|UNABLE_TO_(?:GET|VERIFY|DECRYPT)|DEPTH_ZERO_SELF_SIGNED|SELF_SIGNED_CERT|HOSTNAME_MISMATCH|EPROTO$)/.test(c))return"custom_endpoint_tls_failed"}for(let p of[...e instanceof AggregateError?e.errors:[],e.cause]){let m=Vi(p,l+1);if(m)return m}return null}async function Hl(e,l){let c=Vi(e),p=new URL(l).hostname.replace(/^\[|\]$/g,"");if(c!==null&&c!=="custom_endpoint_connection_failed"||Bl(p)!==0)return c;let m;return await Promise.race([$l(p).then(()=>!0,(h)=>!Wi.has(String(h?.code))),new Promise((h)=>{m=setTimeout(()=>h(!0),5000)})]).finally(()=>clearTimeout(m))?c:"custom_endpoint_host_not_found"}function jl(e){for(let l=42;;l++){if(l===127)l=256;let c=String.fromCodePoint(l);if(!e.includes(c))return c}}function ql(e,l){let c=Buffer.from(e),p=Buffer.from(l),m=new Uint32Array(c.length);for(let h=1,y=0;h<c.length;h++){while(y&&c[h]!==c[y])y=m[y-1];if(c[h]===c[y])y++;m[h]=y}let f=0;return(h,y=!1)=>{let S=Buffer.allocUnsafe(h.length*p.length+f),w=0;for(let _ of h){while(f&&c[f]!==_){let v=m[f-1];w+=c.copy(S,w,0,f-v),f=v}if(c[f]===_){if(f++,f===c.length)w+=p.copy(S,w),f=0}else S[w++]=_}if(y)w+=c.copy(S,w,0,f),f=0;return S.subarray(0,w)}}async function zi(e){e.signal.throwIfAborted();let l=Ii.safeParse(e.payload);if(!l.success)throw new r("custom_endpoint_invalid_request","Invalid local model request.");let c=l.data,p=Di.parse(await e.credential(e.signal));if(!sn(c,{baseUrl:c.baseUrl,api:p.api,execution:"device"}))throw new r("custom_endpoint_invalid_request","The request does not match the configured API.");e.signal.throwIfAborted();let m,f,h=0,y=0,S=0,w=jl(p.apiKey),_=ql(p.apiKey,w),v=async(I,A)=>{e.signal.throwIfAborted(),await new Promise((M,N)=>{let L=()=>{e.signal.removeEventListener("abort",L),N(e.signal.reason)};if(e.signal.addEventListener("abort",L,{once:!0}),e.signal.aborted){L();return}Promise.resolve().then(()=>(e.signal.throwIfAborted(),e.emit(I,A))).then(()=>{e.signal.removeEventListener("abort",L),M()},(B)=>{e.signal.removeEventListener("abort",L),N(B)})})},C=async(I)=>{if(h+=I.length,h>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");for(let A=0;A<I.length;A+=St){if(S>=on)throw new r("custom_endpoint_response_too_large","Local model response exceeds the chunk limit.");await v(`custom_endpoint.chunk.${S++}`,{eof:!1,data:I.subarray(A,A+St).toString("base64")})}};try{let I=await Fl({url:c.url,body:c.body,signal:e.signal,headers:{...c.headers,...p.api==="anthropic-messages"?{"x-api-key":p.apiKey}:{authorization:`Bearer ${p.apiKey}`}}});m=I.response,f=I.close;let A=m.statusCode??500;if(A>=300&&A<400)throw new r("custom_endpoint_redirect_refused","Local model redirects are not followed.");if(m.headers["content-encoding"]&&m.headers["content-encoding"]!=="identity")throw new r("custom_endpoint_encoding_unsupported","The local server must honor identity encoding.");let M={};for(let N of["content-type","retry-after","x-request-id","request-id"]){let L=m.headers[N];if(typeof L==="string")M[N]=L.replaceAll(p.apiKey,w).slice(0,4096)}await v("custom_endpoint.headers",{status:A,statusText:(m.statusMessage??"").replaceAll(p.apiKey,w).slice(0,256),headers:M});for await(let N of m){e.signal.throwIfAborted();let L=Buffer.isBuffer(N)?N:Buffer.from(N);if(y+=L.length,y>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");await C(_(L))}return await C(_(Buffer.alloc(0),!0)),await v(`custom_endpoint.chunk.${S}`,{eof:!0}),{bytes:h,chunks:S}}catch(I){if(e.signal.throwIfAborted(),I instanceof r)throw I;throw new r((m?null:await Hl(I,c.url))??"custom_endpoint_request_failed","The local model server could not complete the request.")}finally{f?.()}}import{join as os}from"path";function Wl(e,l){return e===os(l,".ara","workspace")||e===os(l,".reason","workspace")}function ss(e,l){let c=e.filter((p)=>Wl(p.path,l));return c.length===1?c[0].path:null}var Vl=/^[a-f0-9]{64}$/;var an=32,zl=/^\/[^\x00-\x1f\x7f\\]*$/;function Cr(e){if(typeof e!=="string"||e.length>4096||!zl.test(e))return!1;if(e==="/")return!0;return e.split("/").slice(1).every((l)=>l!==""&&l!=="."&&l!=="..")}function Pr(e,l){let c=l==="win32"?/^([A-Za-z]):[\\/]*(.*)$/.exec(e):null;if(!c)return e;let p=c[2].split(/[\\/]+/).filter(Boolean).join("/");return`/${c[1].toUpperCase()}:${p?`/${p}`:""}`}function cn(e){if(!e||typeof e!=="object"||Array.isArray(e))return;let l=e;if(!Cr(l.home)||!Array.isArray(l.roots)||l.roots.length>an)return;let c=[];for(let p of l.roots){if(!p||typeof p!=="object"||Array.isArray(p))return;let{path_fingerprint:m,path:f}=p;if(typeof m!=="string"||!Vl.test(m)||!Cr(f))return;c.push({path_fingerprint:m,path:f})}return{home:l.home,roots:c}}function Gl(e){let l=/^Reason contributor (rc_[0-9a-f]{32})$/.exec(e.name)?.[1];return e.email.toLowerCase()==="343777287+reason-contributors@users.noreply.github.com"&&l?l:void 0}function Yl(e){return Gl(e)??e.email.toLowerCase()}function un(e){let l=/^Co-authored-by:\s*([^<>\r\n]+) <([^<>\s]+)>$/i.exec(e.trim());return l?Yl({name:l[1],email:l[2]}):e.trim().toLowerCase()}var Gt=(e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[a-z]/gi,(l)=>`[${l.toLowerCase()}${l.toUpperCase()}]`),Kl=[...ve.map((e)=>`/(${e.map(Gt).join("/")})(/|$)`),...Ht.map((e)=>`/(${e.map(Gt).join("/")})(/|$)`),...[...zt].map((e)=>`/(${Gt(e)})$`),`/${Gt(".env.")}[^/]*$`,...qt.map((e)=>`/[^/]*${Gt(e)}$`)],as=`function localGithubSandboxProfile(root, temporary) {
2
+ import{nt,St,cr,on,Et,xt,Oi,sn,Ii,Di,Ni}from"./vm-hands-entry-lite-64b6nx6h.js";import{Pe,sr,ri,yt,zo,oe,qo,Wo,tt,Te,nn,ii,bt,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,pe,Y,Re,q,vi,Si,Ei,xi,ki,Ci,Ai,Pi,vt,Ti}from"./vm-hands-entry-lite-vwxg4fhe.js";import{ue,Z,O}from"./vm-hands-entry-lite-39qv4sqt.js";import{P,Xt}from"./vm-hands-entry-lite-1ek3r3w9.js";import{mr,Yi,Qi,st,eo,to,ro,no,io,oo,yr,wr,br,wn,bn,vr,ao,vn,Sr,me,ge,Dt,Er,kr,Nt}from"./vm-hands-entry-lite-jhcbsyey.js";import{D,R,b}from"./vm-hands-entry-lite-1zd088yv.js";import{Ki,Ji,_n,Zi,yn,Xi,ot,fr}from"./vm-hands-entry-lite-0v0hyszp.js";import{K}from"./vm-hands-entry-lite-wx1fmrbs.js";import{He}from"./vm-hands-entry-lite-dcrz19xf.js";import{j}from"./vm-hands-entry-lite-3p7zk3yt.js";import{hr,gn,Gi}from"./vm-hands-entry-lite-5np5k3wb.js";import{wo,bo,ut,vo,So,Eo,xo,ko}from"./vm-hands-entry-lite-k1wghndy.js";import{Ir,Vt,Dr,jn,Un}from"./vm-hands-entry-lite-m7pkmatv.js";import{Ft,qe,jt}from"./vm-hands-entry-lite-cw50k5tb.js";import{Nn,x,go}from"./vm-hands-entry-lite-6asg5xb7.js";import{_o,yo}from"./vm-hands-entry-lite-3vk1frbk.js";import{Bt,Pn,Tn}from"./vm-hands-entry-lite-3ahrje3p.js";import{ye,uo,po}from"./vm-hands-entry-lite-psjcmgj8.js";import{be}from"./vm-hands-entry-lite-yretc2th.js";import{$t}from"./vm-hands-entry-lite-ckezse0f.js";import{ve,Ht,zt,qt,E}from"./vm-hands-entry-lite-70hq7mrs.js";import{a,ie}from"./vm-hands-entry-lite-0sh835na.js";import{t,k,o,d,u,i,W,g,ee,s,n,Ko}from"./vm-hands-entry-lite-qzcac2mf.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{fe,Ne,Le,Me,ln}from"./vm-hands-entry-lite-qz74j563.js";import{$e}from"./vm-hands-entry-lite-mcjca0ez.js";import{request as Nl}from"http";import{request as Ml}from"https";import{lookup as $l}from"dns/promises";import{isIP as Bl}from"net";async function Fl(e){let l=new URL(e.url);return await new Promise((c,p)=>{let m=(l.protocol==="https:"?Ml:Nl)(l,{method:"POST",headers:{...e.headers,"accept-encoding":"identity"},signal:e.signal,timeout:Oi},(f)=>c({response:f,close:()=>{f.destroy(),m.destroy(),f.socket?.destroy()}}));m.once("error",p),m.once("timeout",()=>m.destroy(Object.assign(Error("custom_endpoint_timeout"),{code:"ETIMEDOUT"}))),m.end(e.body)})}var Wi=new Set(["ENOTFOUND","EAI_AGAIN","EAI_NONAME","EAI_NODATA","EAI_FAIL","DNSException"]),Ul=new Set(["ECONNREFUSED","ETIMEDOUT","ECONNRESET","EHOSTUNREACH","ENETUNREACH","EHOSTDOWN","ENETDOWN","EPIPE","ECONNABORTED","EADDRNOTAVAIL","ConnectionRefused","ConnectionClosed","ConnectionTimedOut","Timeout"]);function Vi(e,l=0){if(!e||typeof e!=="object"||l>3)return null;let c=e.code;if(typeof c==="string"){if(Wi.has(c))return"custom_endpoint_host_not_found";if(Ul.has(c))return"custom_endpoint_connection_failed";if(/^(?:ERR_TLS_|ERR_SSL_|CERT_|UNABLE_TO_(?:GET|VERIFY|DECRYPT)|DEPTH_ZERO_SELF_SIGNED|SELF_SIGNED_CERT|HOSTNAME_MISMATCH|EPROTO$)/.test(c))return"custom_endpoint_tls_failed"}for(let p of[...e instanceof AggregateError?e.errors:[],e.cause]){let m=Vi(p,l+1);if(m)return m}return null}async function Hl(e,l){let c=Vi(e),p=new URL(l).hostname.replace(/^\[|\]$/g,"");if(c!==null&&c!=="custom_endpoint_connection_failed"||Bl(p)!==0)return c;let m;return await Promise.race([$l(p).then(()=>!0,(h)=>!Wi.has(String(h?.code))),new Promise((h)=>{m=setTimeout(()=>h(!0),5000)})]).finally(()=>clearTimeout(m))?c:"custom_endpoint_host_not_found"}function jl(e){for(let l=42;;l++){if(l===127)l=256;let c=String.fromCodePoint(l);if(!e.includes(c))return c}}function ql(e,l){let c=Buffer.from(e),p=Buffer.from(l),m=new Uint32Array(c.length);for(let h=1,y=0;h<c.length;h++){while(y&&c[h]!==c[y])y=m[y-1];if(c[h]===c[y])y++;m[h]=y}let f=0;return(h,y=!1)=>{let S=Buffer.allocUnsafe(h.length*p.length+f),w=0;for(let _ of h){while(f&&c[f]!==_){let v=m[f-1];w+=c.copy(S,w,0,f-v),f=v}if(c[f]===_){if(f++,f===c.length)w+=p.copy(S,w),f=0}else S[w++]=_}if(y)w+=c.copy(S,w,0,f),f=0;return S.subarray(0,w)}}async function zi(e){e.signal.throwIfAborted();let l=Ii.safeParse(e.payload);if(!l.success)throw new r("custom_endpoint_invalid_request","Invalid local model request.");let c=l.data,p=Di.parse(await e.credential(e.signal));if(!sn(c,{baseUrl:c.baseUrl,api:p.api,execution:"device"}))throw new r("custom_endpoint_invalid_request","The request does not match the configured API.");e.signal.throwIfAborted();let m,f,h=0,y=0,S=0,w=jl(p.apiKey),_=ql(p.apiKey,w),v=async(I,A)=>{e.signal.throwIfAborted(),await new Promise((M,N)=>{let L=()=>{e.signal.removeEventListener("abort",L),N(e.signal.reason)};if(e.signal.addEventListener("abort",L,{once:!0}),e.signal.aborted){L();return}Promise.resolve().then(()=>(e.signal.throwIfAborted(),e.emit(I,A))).then(()=>{e.signal.removeEventListener("abort",L),M()},(B)=>{e.signal.removeEventListener("abort",L),N(B)})})},C=async(I)=>{if(h+=I.length,h>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");for(let A=0;A<I.length;A+=St){if(S>=on)throw new r("custom_endpoint_response_too_large","Local model response exceeds the chunk limit.");await v(`custom_endpoint.chunk.${S++}`,{eof:!1,data:I.subarray(A,A+St).toString("base64")})}};try{let I=await Fl({url:c.url,body:c.body,signal:e.signal,headers:{...c.headers,...p.api==="anthropic-messages"?{"x-api-key":p.apiKey}:{authorization:`Bearer ${p.apiKey}`}}});m=I.response,f=I.close;let A=m.statusCode??500;if(A>=300&&A<400)throw new r("custom_endpoint_redirect_refused","Local model redirects are not followed.");if(m.headers["content-encoding"]&&m.headers["content-encoding"]!=="identity")throw new r("custom_endpoint_encoding_unsupported","The local server must honor identity encoding.");let M={};for(let N of["content-type","retry-after","x-request-id","request-id"]){let L=m.headers[N];if(typeof L==="string")M[N]=L.replaceAll(p.apiKey,w).slice(0,4096)}await v("custom_endpoint.headers",{status:A,statusText:(m.statusMessage??"").replaceAll(p.apiKey,w).slice(0,256),headers:M});for await(let N of m){e.signal.throwIfAborted();let L=Buffer.isBuffer(N)?N:Buffer.from(N);if(y+=L.length,y>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");await C(_(L))}return await C(_(Buffer.alloc(0),!0)),await v(`custom_endpoint.chunk.${S}`,{eof:!0}),{bytes:h,chunks:S}}catch(I){if(e.signal.throwIfAborted(),I instanceof r)throw I;throw new r((m?null:await Hl(I,c.url))??"custom_endpoint_request_failed","The local model server could not complete the request.")}finally{f?.()}}import{join as os}from"path";function Wl(e,l){return e===os(l,".ara","workspace")||e===os(l,".reason","workspace")}function ss(e,l){let c=e.filter((p)=>Wl(p.path,l));return c.length===1?c[0].path:null}var Vl=/^[a-f0-9]{64}$/;var an=32,zl=/^\/[^\x00-\x1f\x7f\\]*$/;function Cr(e){if(typeof e!=="string"||e.length>4096||!zl.test(e))return!1;if(e==="/")return!0;return e.split("/").slice(1).every((l)=>l!==""&&l!=="."&&l!=="..")}function Pr(e,l){let c=l==="win32"?/^([A-Za-z]):[\\/]*(.*)$/.exec(e):null;if(!c)return e;let p=c[2].split(/[\\/]+/).filter(Boolean).join("/");return`/${c[1].toUpperCase()}:${p?`/${p}`:""}`}function cn(e){if(!e||typeof e!=="object"||Array.isArray(e))return;let l=e;if(!Cr(l.home)||!Array.isArray(l.roots)||l.roots.length>an)return;let c=[];for(let p of l.roots){if(!p||typeof p!=="object"||Array.isArray(p))return;let{path_fingerprint:m,path:f}=p;if(typeof m!=="string"||!Vl.test(m)||!Cr(f))return;c.push({path_fingerprint:m,path:f})}return{home:l.home,roots:c}}function Gl(e){let l=/^Reason contributor (rc_[0-9a-f]{32})$/.exec(e.name)?.[1];return e.email.toLowerCase()==="343777287+reason-contributors@users.noreply.github.com"&&l?l:void 0}function Yl(e){return Gl(e)??e.email.toLowerCase()}function un(e){let l=/^Co-authored-by:\s*([^<>\r\n]+) <([^<>\s]+)>$/i.exec(e.trim());return l?Yl({name:l[1],email:l[2]}):e.trim().toLowerCase()}var Gt=(e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[a-z]/gi,(l)=>`[${l.toLowerCase()}${l.toUpperCase()}]`),Kl=[...ve.map((e)=>`/(${e.map(Gt).join("/")})(/|$)`),...Ht.map((e)=>`/(${e.map(Gt).join("/")})(/|$)`),...[...zt].map((e)=>`/(${Gt(e)})$`),`/${Gt(".env.")}[^/]*$`,...qt.map((e)=>`/[^/]*${Gt(e)}$`)],as=`function localGithubSandboxProfile(root, temporary) {
3
3
  return ['(version 1)','(deny default)','(import "system.sb")','(allow process-exec process-fork)',
4
4
  '(allow file-read* (subpath "/bin") (subpath "/sbin") (subpath "/usr/bin") (subpath "/usr/sbin") (subpath "/usr/libexec") (subpath "/usr/share") (subpath "/private/var/select") (literal "/private/var/db/xcode_select_link"))',
5
5
  '(allow file-read-metadata (path-ancestors "/opt/homebrew/bin") (path-ancestors "/usr/local/bin") (path-ancestors "/Library/Developer/CommandLineTools"))',
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{readdirSync as b,readFileSync as P}from"fs";import{userInfo as k}from"os";var ur="--vm-hands-op-runner-kind=person",dr="--vm-hands-op-runner-kind=surface",Pt="--vm-hands-surface-uid=",Tt="--vm-hands-surface-dir=",Rt=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function R(t){let c=new Set([t]),l=[];try{l=b("/proc")}catch{}for(let o of l){if(!/^\d+$/.test(o))continue;try{let d=P(`/proc/${o}/stat`,"utf8");if(Number(d.slice(d.lastIndexOf(")")+2).split(" ")[3])===t)c.add(Number(o))}catch{}}for(let o of c)try{process.kill(o,"SIGKILL")}catch{}}var A=(t)=>{let c=globalThis.Bun;if(!c)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=c.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(i,s)=>t.onData(s)}}),o=l.terminal,d=()=>{R(l.pid);try{o?.close()}catch{}};if(!o)throw d(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(i)=>o.write(i),resize:(i,s)=>o.resize(i,s),kill:d,exited:l.exited.then((i)=>typeof i==="number"?i:null,()=>null)}};function x(){let t=(()=>{try{return k().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 E(t){let[{localAutomationAvailable:c},{localDisplayReady:l},{localDisplayVideoAvailable:o},{probeWorkerPreview:d},y]=await Promise.all([import("./local-automation-e5q1edkc.js"),import("./local-display-session-tmq34qkj.js"),import("./local-display-video-nasefpwg.js"),import("./worker-preview-readiness-6kk98y4k.js"),import("fs")]),i=AbortSignal.timeout(15000),s=null;try{y.mkdirSync(t,{recursive:!0,mode:448}),s=y.mkdtempSync(`${t}/probe-`);let[g,p,m]=await Promise.all([Promise.resolve().then(()=>c()).catch(()=>!1),l().catch(()=>!1),d(s,i).catch(()=>!1)]);return{t:"readiness",display_video:p&&await o().catch(()=>!1),lanes:{"automation.call.v1":g,"display.stream.v1":p,"preview.serve.v1":m,"tunnel.open":m,"tunnel.close":m}}}finally{if(s)y.rmSync(s,{recursive:!0,force:!0})}}async function _s(){let[{executeLocalOperation:t,spawnCaptured:c},{runLocalPtySession:l},{configureDesktopAccount:o,desktopAccount:d},{configureWorkerSandbox:y}]=await Promise.all([import("./local-capabilities-vy25qdaa.js"),import("./local-pty-session-q06ff8yk.js"),import("./desktop-account-j6fjngt1.js"),import("./worker-sandbox-j6cmex8e.js")]);y();let i=process.argv.includes(ur),s=process.argv.includes(dr),g=(a,e,u)=>c(a,e[0]==="-lic"?["-lc",...e.slice(1)]:e,u),p=(process.geteuid?.()??0)!==0;if(s){p=!1;let a=process.argv.find((e)=>e.startsWith(Pt))?.slice(Pt.length);if((process.geteuid?.()??-1)===0&&a)try{p=o({value:a})!==null&&d()!==null}catch{p=!1}}let m=new Map,v=new Map,f=(a)=>{try{process.send?.(a)}catch{}};if(process.on("message",(a)=>{let e=a;if(e?.t==="cancel"){m.get(e.id)?.abort();return}if(e?.t==="control"){let n=v.get(e.id);if(s&&n&&e.control&&typeof e.control.kind==="string")import("./local-managed-process-xyd0v82z.js").then(({controlManagedDeviceProcess:_})=>_(n,{kind:e.control.kind,payload:e.control.payload??{}})).catch(()=>!1);return}if(e?.t==="retire"){if(s&&typeof e.operation_id==="string"&&typeof e.status==="string")import("./local-managed-process-xyd0v82z.js").then(({retireManagedDeviceProcess:n})=>n(e.operation_id,e.status)).catch(()=>!1);return}if(e?.t!=="op")return;if(!p){f({t:"done",id:e.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let u=e.claim.capability;if(u==="pty.start"&&!i){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}if(Rt.has(u)!==s){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let w=new AbortController;m.set(e.id,w),v.set(e.id,e.claim);let S=u==="pty.start"?{runPtySession:(n)=>l(n,{spawnPty:A,environment:x(),loadProxy:()=>null})}:{worker:e.worker,...u==="exec.full"?{spawnFullControl:g}:{}};t(e.state,e.claim,{...S,signal:w.signal,emit:(n)=>{let{deliverySignal:_,...h}=n;f({t:"event",id:e.id,event:h})}}).then((n)=>f({t:"done",id:e.id,completion:n}),(n)=>f({t:"done",id:e.id,completion:{status:"failed",error_code:n&&typeof n==="object"&&"code"in n&&typeof n.code==="string"?n.code:"vm_hands_op_failed"}})).finally(()=>{m.delete(e.id),v.delete(e.id)})}),process.on("disconnect",()=>process.exit(0)),s){let a=process.argv.find((u)=>u.startsWith(Tt))?.slice(Tt.length),e={t:"readiness",display_video:!1,lanes:{}};f(p&&a?await E(a).catch(()=>e):e)}await new Promise(()=>{})}
2
+ import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{readdirSync as b,readFileSync as P}from"fs";import{userInfo as k}from"os";var ur="--vm-hands-op-runner-kind=person",dr="--vm-hands-op-runner-kind=surface",Pt="--vm-hands-surface-uid=",Tt="--vm-hands-surface-dir=",Rt=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function R(t){let c=new Set([t]),l=[];try{l=b("/proc")}catch{}for(let o of l){if(!/^\d+$/.test(o))continue;try{let d=P(`/proc/${o}/stat`,"utf8");if(Number(d.slice(d.lastIndexOf(")")+2).split(" ")[3])===t)c.add(Number(o))}catch{}}for(let o of c)try{process.kill(o,"SIGKILL")}catch{}}var A=(t)=>{let c=globalThis.Bun;if(!c)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=c.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(i,s)=>t.onData(s)}}),o=l.terminal,d=()=>{R(l.pid);try{o?.close()}catch{}};if(!o)throw d(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(i)=>o.write(i),resize:(i,s)=>o.resize(i,s),kill:d,exited:l.exited.then((i)=>typeof i==="number"?i:null,()=>null)}};function x(){let t=(()=>{try{return k().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 E(t){let[{localAutomationAvailable:c},{localDisplayReady:l},{localDisplayVideoAvailable:o},{probeWorkerPreview:d},y]=await Promise.all([import("./local-automation-4sh2a2gr.js"),import("./local-display-session-41ea79t8.js"),import("./local-display-video-d2yz8vjt.js"),import("./worker-preview-readiness-6kk98y4k.js"),import("fs")]),i=AbortSignal.timeout(15000),s=null;try{y.mkdirSync(t,{recursive:!0,mode:448}),s=y.mkdtempSync(`${t}/probe-`);let[g,p,m]=await Promise.all([Promise.resolve().then(()=>c()).catch(()=>!1),l().catch(()=>!1),d(s,i).catch(()=>!1)]);return{t:"readiness",display_video:p&&await o().catch(()=>!1),lanes:{"automation.call.v1":g,"display.stream.v1":p,"preview.serve.v1":m,"tunnel.open":m,"tunnel.close":m}}}finally{if(s)y.rmSync(s,{recursive:!0,force:!0})}}async function _s(){let[{executeLocalOperation:t,spawnCaptured:c},{runLocalPtySession:l},{configureDesktopAccount:o,desktopAccount:d},{configureWorkerSandbox:y}]=await Promise.all([import("./local-capabilities-4zkn2481.js"),import("./local-pty-session-q06ff8yk.js"),import("./desktop-account-j6fjngt1.js"),import("./worker-sandbox-j6cmex8e.js")]);y();let i=process.argv.includes(ur),s=process.argv.includes(dr),g=(a,e,u)=>c(a,e[0]==="-lic"?["-lc",...e.slice(1)]:e,u),p=(process.geteuid?.()??0)!==0;if(s){p=!1;let a=process.argv.find((e)=>e.startsWith(Pt))?.slice(Pt.length);if((process.geteuid?.()??-1)===0&&a)try{p=o({value:a})!==null&&d()!==null}catch{p=!1}}let m=new Map,v=new Map,f=(a)=>{try{process.send?.(a)}catch{}};if(process.on("message",(a)=>{let e=a;if(e?.t==="cancel"){m.get(e.id)?.abort();return}if(e?.t==="control"){let n=v.get(e.id);if(s&&n&&e.control&&typeof e.control.kind==="string")import("./local-managed-process-jfycgrby.js").then(({controlManagedDeviceProcess:_})=>_(n,{kind:e.control.kind,payload:e.control.payload??{}})).catch(()=>!1);return}if(e?.t==="retire"){if(s&&typeof e.operation_id==="string"&&typeof e.status==="string")import("./local-managed-process-jfycgrby.js").then(({retireManagedDeviceProcess:n})=>n(e.operation_id,e.status)).catch(()=>!1);return}if(e?.t!=="op")return;if(!p){f({t:"done",id:e.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let u=e.claim.capability;if(u==="pty.start"&&!i){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}if(Rt.has(u)!==s){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let w=new AbortController;m.set(e.id,w),v.set(e.id,e.claim);let S=u==="pty.start"?{runPtySession:(n)=>l(n,{spawnPty:A,environment:x(),loadProxy:()=>null})}:{worker:e.worker,...u==="exec.full"?{spawnFullControl:g}:{}};t(e.state,e.claim,{...S,signal:w.signal,emit:(n)=>{let{deliverySignal:_,...h}=n;f({t:"event",id:e.id,event:h})}}).then((n)=>f({t:"done",id:e.id,completion:n}),(n)=>f({t:"done",id:e.id,completion:{status:"failed",error_code:n&&typeof n==="object"&&"code"in n&&typeof n.code==="string"?n.code:"vm_hands_op_failed"}})).finally(()=>{m.delete(e.id),v.delete(e.id)})}),process.on("disconnect",()=>process.exit(0)),s){let a=process.argv.find((u)=>u.startsWith(Tt))?.slice(Tt.length),e={t:"readiness",display_video:!1,lanes:{}};f(p&&a?await E(a).catch(()=>e):e)}await new Promise(()=>{})}
3
3
  export{ur,dr,Pt,Tt,Rt,_s};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-wp0d65yx.js";import{Jr,Qn,Zr,ei}from"./vm-hands-entry-lite-vs47bs09.js";import{Zn,er,Lo}from"./vm-hands-entry-lite-d9sbxxqn.js";import{C}from"./vm-hands-entry-lite-qz74j563.js";import{spawnSync as y}from"child_process";import{createHash as ke,randomUUID as Se}from"crypto";import{chmodSync as we,existsSync as P,mkdirSync as $e,readdirSync as Ve,readFileSync as p,renameSync as ye,rmSync as u,statSync as ve,writeFileSync as be}from"fs";import{dirname as We,isAbsolute as q,join as g}from"path";import{spawnSync as de}from"child_process";import{readFileSync as me}from"fs";import{userInfo as D}from"os";import{join as fe}from"path";var ge="REASON_SCHEDULED_TASK";function H(r){return fe(r,"AppData","Local","Reason","Tasks")}function S(r){if(/[\0-\x1f\x7f"%]/.test(r))throw Error(`A background task cannot use a value with a double quote, percent sign or control character: ${r}`);return`'${r.replace(/['\u2018\u2019\u201a\u201b]/g,"$&$&")}'`}function M(r){if(!/^[A-Za-z0-9._-]+$/.test(r))throw Error(`Invalid Windows Scheduled Task name: ${r}`);return`$env:${ge}=${S(r)};`}function K(r){let e=Object.entries(r.environment).map(([t,i])=>{if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw Error(`Invalid Windows Scheduled Task environment name: ${t}`);return`$env:${t}=${S(i)};`}),n=`$global:LASTEXITCODE=1; & ${[r.program,...r.args].map(S).join(" ")} 2>&1 | ForEach-Object { Add-Content -LiteralPath ${S(r.log)} -Value $_.ToString() -Encoding UTF8 }; $c=$LASTEXITCODE;`;return[M(r.name),...e,"$ErrorActionPreference='Continue';",r.keepAlive?`do { ${n} if ($c) { Start-Sleep -Seconds 10 } } while ($c)`:`${n} exit $c`].join(" ")}function A(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function pe(){let r=process.env.USERDOMAIN?.trim();return r?`${r}\\${D().username}`:D().username}function U(r){let e=A(r.user??pe()),n=r.schedule==="logon",t=r.schedule==="logon"?`<LogonTrigger><Enabled>true</Enabled><UserId>${e}</UserId></LogonTrigger>`:`<TimeTrigger><Repetition><Interval>PT${r.schedule.everyMinutes}M</Interval><StopAtDurationEnd>false</StopAtDurationEnd></Repetition><StartBoundary>2026-01-01T00:00:00</StartBoundary><Enabled>true</Enabled></TimeTrigger>`,i=`-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -Command "${r.script}"`;return`<?xml version="1.0" encoding="UTF-16"?>
2
+ import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-wp0d65yx.js";import{Jr,Qn,Zr,ei}from"./vm-hands-entry-lite-vs47bs09.js";import{Zn,er,Lo}from"./vm-hands-entry-lite-htmzt3t4.js";import{C}from"./vm-hands-entry-lite-qz74j563.js";import{spawnSync as y}from"child_process";import{createHash as ke,randomUUID as Se}from"crypto";import{chmodSync as we,existsSync as P,mkdirSync as $e,readdirSync as Ve,readFileSync as p,renameSync as ye,rmSync as u,statSync as ve,writeFileSync as be}from"fs";import{dirname as We,isAbsolute as q,join as g}from"path";import{spawnSync as de}from"child_process";import{readFileSync as me}from"fs";import{userInfo as D}from"os";import{join as fe}from"path";var ge="REASON_SCHEDULED_TASK";function H(r){return fe(r,"AppData","Local","Reason","Tasks")}function S(r){if(/[\0-\x1f\x7f"%]/.test(r))throw Error(`A background task cannot use a value with a double quote, percent sign or control character: ${r}`);return`'${r.replace(/['\u2018\u2019\u201a\u201b]/g,"$&$&")}'`}function M(r){if(!/^[A-Za-z0-9._-]+$/.test(r))throw Error(`Invalid Windows Scheduled Task name: ${r}`);return`$env:${ge}=${S(r)};`}function K(r){let e=Object.entries(r.environment).map(([t,i])=>{if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw Error(`Invalid Windows Scheduled Task environment name: ${t}`);return`$env:${t}=${S(i)};`}),n=`$global:LASTEXITCODE=1; & ${[r.program,...r.args].map(S).join(" ")} 2>&1 | ForEach-Object { Add-Content -LiteralPath ${S(r.log)} -Value $_.ToString() -Encoding UTF8 }; $c=$LASTEXITCODE;`;return[M(r.name),...e,"$ErrorActionPreference='Continue';",r.keepAlive?`do { ${n} if ($c) { Start-Sleep -Seconds 10 } } while ($c)`:`${n} exit $c`].join(" ")}function A(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function pe(){let r=process.env.USERDOMAIN?.trim();return r?`${r}\\${D().username}`:D().username}function U(r){let e=A(r.user??pe()),n=r.schedule==="logon",t=r.schedule==="logon"?`<LogonTrigger><Enabled>true</Enabled><UserId>${e}</UserId></LogonTrigger>`:`<TimeTrigger><Repetition><Interval>PT${r.schedule.everyMinutes}M</Interval><StopAtDurationEnd>false</StopAtDurationEnd></Repetition><StartBoundary>2026-01-01T00:00:00</StartBoundary><Enabled>true</Enabled></TimeTrigger>`,i=`-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -Command "${r.script}"`;return`<?xml version="1.0" encoding="UTF-16"?>
3
3
  <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
4
4
  <RegistrationInfo>
5
5
  <Description>${A(r.description)}</Description>
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{We,fo,F,Ve,Ut,Rr,x}from"./vm-hands-entry-lite-qevgjf1b.js";import{K}from"./vm-hands-entry-lite-wx1fmrbs.js";import{dt}from"./vm-hands-entry-lite-k1wghndy.js";import{mt}from"./vm-hands-entry-lite-d9sbxxqn.js";import{Or}from"./vm-hands-entry-lite-kzyjyq34.js";import{At,ji}from"./vm-hands-entry-lite-024t90qh.js";import{G,qe}from"./vm-hands-entry-lite-frqx145j.js";import{xe,Kn}from"./vm-hands-entry-lite-7c376ed5.js";import{vt}from"./vm-hands-entry-lite-vwxg4fhe.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-qz74j563.js";import{spawn as R,spawnSync as st}from"child_process";import{createHash as it,randomUUID as ge}from"crypto";import{closeSync as at,copyFileSync as ae,existsSync as M,fstatSync as ct,mkdirSync as ce,openSync as lt,readdirSync as U,readFileSync as X,readlinkSync as ut,renameSync as he,rmSync as pt,statSync as ft,writeFileSync as gt}from"fs";import{connect as ht}from"net";import{tmpdir as L,userInfo as we}from"os";import{basename as le,delimiter as wt,dirname as B,join as f}from"path";var z=`import { spawn, execFileSync } from "node:child_process";
2
+ import{We,fo,F,Ve,Ut,Rr,x}from"./vm-hands-entry-lite-6asg5xb7.js";import{K}from"./vm-hands-entry-lite-wx1fmrbs.js";import{dt}from"./vm-hands-entry-lite-k1wghndy.js";import{mt}from"./vm-hands-entry-lite-htmzt3t4.js";import{Or}from"./vm-hands-entry-lite-3vk1frbk.js";import{At,ji}from"./vm-hands-entry-lite-024t90qh.js";import{G,qe}from"./vm-hands-entry-lite-cw50k5tb.js";import{xe,Kn}from"./vm-hands-entry-lite-370kvrw6.js";import{vt}from"./vm-hands-entry-lite-vwxg4fhe.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-qz74j563.js";import{spawn as R,spawnSync as st}from"child_process";import{createHash as it,randomUUID as ge}from"crypto";import{closeSync as at,copyFileSync as ae,existsSync as M,fstatSync as ct,mkdirSync as ce,openSync as lt,readdirSync as U,readFileSync as X,readlinkSync as ut,renameSync as he,rmSync as pt,statSync as ft,writeFileSync as gt}from"fs";import{connect as ht}from"net";import{tmpdir as L,userInfo as we}from"os";import{basename as le,delimiter as wt,dirname as B,join as f}from"path";var z=`import { spawn, execFileSync } from "node:child_process";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import { readFileSync, readlinkSync, lstatSync, realpathSync, statSync, mkdtempSync, mkdirSync, chmodSync, writeFileSync, readdirSync, rmSync, openSync, readSync, closeSync, renameSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ge,dt}from"./vm-hands-entry-lite-k1wghndy.js";import{Qe}from"./vm-hands-entry-lite-z4x5sddh.js";import{Io,le,Kr,mt,Do}from"./vm-hands-entry-lite-d9sbxxqn.js";import{E}from"./vm-hands-entry-lite-70hq7mrs.js";import{a,nr}from"./vm-hands-entry-lite-0sh835na.js";import{spawnSync as H}from"child_process";import{dirname as w}from"path";import{spawn as A}from"child_process";import{accessSync as _,constants as v}from"fs";import{basename as C,join as O}from"path";var l=null;function S(e){if(l===e)l=null;if(e.exitCode===null&&e.signalCode===null)e.kill("SIGTERM")}var Or=(e,t)=>{if(l)S(l);let s=O(e,Io);try{_(s,v.X_OK)}catch{return()=>{}}let n;try{n=A(s,["--app",e,"--name",C(e,".app"),"--permission",t==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return n.on("error",()=>{if(l===n)l=null}),n.once("exit",()=>{if(l===n)l=null}),n.unref(),l=n,()=>S(n)};import{chmodSync as ne,existsSync as se,mkdirSync as re,readFileSync as D,realpathSync as ie,renameSync as oe,statSync as j,writeFileSync as ae}from"fs";import{dirname as de,isAbsolute as G,join as N,resolve as T,sep as b}from"path";function F(e=a()){return N(nr(e),"reason","protected-path-grants.json")}var f=null;function L(e){let t=JSON.parse(e);if(!Array.isArray(t?.grants))return[];return t.grants.flatMap((s)=>{let n=s;return n&&typeof n.path==="string"&&G(n.path)&&(n.kind==="file"||n.kind==="folder")&&typeof n.grantedAt==="number"?[{path:n.path,kind:n.kind,grantedAt:n.grantedAt}]:[]})}function y(e=F()){try{let{mtimeMs:t}=j(e);if(f&&f.file===e&&f.mtimeMs===t)return f.grants;let s=L(D(e,"utf8"));return f={file:e,mtimeMs:t,grants:s},s}catch{return[]}}function W(e,t){return e.kind==="file"?t===e.path:t===e.path||t.startsWith(`${e.path}${b}`)}function U(e,t){let s=T(e);return y(t).some((n)=>W(n,s))}function _o(e,t){return E(e)&&!U(e,t)}function yo(e,t,s){let n=t?"file-read* file-write*":"file-read*";return y(s).filter((r)=>r.path===e||r.path.startsWith(`${e}${b}`)).map((r)=>`(allow ${n} (${r.kind==="file"?"literal":"subpath"} ${JSON.stringify(r.path)}))`)}var P="x-apple.systempreferences:com.apple.preference.security",J="curl -fsSL https://reasonmachines.com/install.sh | bash",q=180000,B=2000;var k={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${P}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${P}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${P}?Privacy_AllFiles`}};function R(e){return e.executable}function K(e,t){if(e==="computer_use_identity_missing")return`Reason's background identity is not installed (${e}); reinstall Reason: ${J}`;if(e==="computer_use_identity_outdated")return`Reason's background identity is outdated (${Kr(t)??"unknown"}; this CLI is ${Qe}) (${e}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${e}); run the installed \`reason\``}function ss(e=a()){let t=mt(e);if(t.length>0)return{state:"ready",path:w(w(w(t[0]))),prefix:t};let s=Do(t,e)??"computer_use_identity_unavailable";return{state:s,path:le(e),detail:K(s,e)}}function V(){return{identity:()=>ss(),grants:(e)=>Ge(e),request:(e,t)=>dt(e,t),worker:async()=>(await import("./status-txachfgt.js")).connectionMacState(),open:(e)=>{H("/usr/bin/open",e,{stdio:"ignore",timeout:1e4})},tile:Or,restartConnection:async()=>(await import("./connect-cli-59hd6te5.js")).restartConnection(),sleep:(e)=>new Promise((t)=>setTimeout(t,e)),now:()=>Date.now()}}function M(e,t,s){if(e.state!=="ready"||!t)return"unknown";return t[s]?"granted":"missing"}async function as(e){let t=e.identity(),s=t.state==="ready"?await e.grants(t.prefix):null,n=await e.worker(),r=n?R(n):null,i=!r||n?.full_disk_access==="unknown"?"unknown":n?.full_disk_access==="granted"?"granted":"missing",c=(u,d,o)=>{let{label:p,purpose:h,level:m}=k[u];return{id:u,label:p,purpose:h,level:m,state:d,holder:o}};return{identity:{state:t.state,path:t.path,detail:t.state==="ready"?null:t.detail},worker_detail:r?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[c("screen",M(t,s,"screen"),t.path),c("accessibility",M(t,s,"accessibility"),t.path),c("disk",i,r)]}}function Ws(e){let t=e.identity.state==="ready"?null:e.identity.state,s=e.permissions.filter((i)=>i.state==="granted").length,n=[...t?[t]:[],...e.permissions.filter((i)=>i.state!=="granted"&&!(t&&i.id!=="disk")).map((i)=>`${i.label} ${i.state}`)],r=!t&&e.permissions.some((i)=>i.state==="missing");return`Permissions: ${s} of ${e.permissions.length}${n.length>0?` (${n.join(", ")})`:""}`+(r?" \u2014 reason permissions allow":n.length>0?" \u2014 reason permissions":"")}async function x(e,t){let s=t.now()+q;for(;;){if(await e())return!0;if(t.now()>=s)return!1;await t.sleep(B)}}async function Vs(e,t){let s=t.host??V(),{io:n}=t,r=await as(s),i=r.permissions.filter((o)=>e.includes(o.id)&&o.state!=="granted");if(i.length===0)return n.stdout.write(`Reason permissions: ${e.map((o)=>k[o].label).join(", ")} already allowed.
2
+ import{Ge,dt}from"./vm-hands-entry-lite-k1wghndy.js";import{Qe}from"./vm-hands-entry-lite-0049w7cr.js";import{Io,le,Kr,mt,Do}from"./vm-hands-entry-lite-htmzt3t4.js";import{E}from"./vm-hands-entry-lite-70hq7mrs.js";import{a,nr}from"./vm-hands-entry-lite-0sh835na.js";import{spawnSync as H}from"child_process";import{dirname as w}from"path";import{spawn as A}from"child_process";import{accessSync as _,constants as v}from"fs";import{basename as C,join as O}from"path";var l=null;function S(e){if(l===e)l=null;if(e.exitCode===null&&e.signalCode===null)e.kill("SIGTERM")}var Or=(e,t)=>{if(l)S(l);let s=O(e,Io);try{_(s,v.X_OK)}catch{return()=>{}}let n;try{n=A(s,["--app",e,"--name",C(e,".app"),"--permission",t==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return n.on("error",()=>{if(l===n)l=null}),n.once("exit",()=>{if(l===n)l=null}),n.unref(),l=n,()=>S(n)};import{chmodSync as ne,existsSync as se,mkdirSync as re,readFileSync as D,realpathSync as ie,renameSync as oe,statSync as j,writeFileSync as ae}from"fs";import{dirname as de,isAbsolute as G,join as N,resolve as T,sep as b}from"path";function F(e=a()){return N(nr(e),"reason","protected-path-grants.json")}var f=null;function L(e){let t=JSON.parse(e);if(!Array.isArray(t?.grants))return[];return t.grants.flatMap((s)=>{let n=s;return n&&typeof n.path==="string"&&G(n.path)&&(n.kind==="file"||n.kind==="folder")&&typeof n.grantedAt==="number"?[{path:n.path,kind:n.kind,grantedAt:n.grantedAt}]:[]})}function y(e=F()){try{let{mtimeMs:t}=j(e);if(f&&f.file===e&&f.mtimeMs===t)return f.grants;let s=L(D(e,"utf8"));return f={file:e,mtimeMs:t,grants:s},s}catch{return[]}}function W(e,t){return e.kind==="file"?t===e.path:t===e.path||t.startsWith(`${e.path}${b}`)}function U(e,t){let s=T(e);return y(t).some((n)=>W(n,s))}function _o(e,t){return E(e)&&!U(e,t)}function yo(e,t,s){let n=t?"file-read* file-write*":"file-read*";return y(s).filter((r)=>r.path===e||r.path.startsWith(`${e}${b}`)).map((r)=>`(allow ${n} (${r.kind==="file"?"literal":"subpath"} ${JSON.stringify(r.path)}))`)}var P="x-apple.systempreferences:com.apple.preference.security",J="curl -fsSL https://reasonmachines.com/install.sh | bash",q=180000,B=2000;var k={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${P}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${P}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${P}?Privacy_AllFiles`}};function R(e){return e.executable}function K(e,t){if(e==="computer_use_identity_missing")return`Reason's background identity is not installed (${e}); reinstall Reason: ${J}`;if(e==="computer_use_identity_outdated")return`Reason's background identity is outdated (${Kr(t)??"unknown"}; this CLI is ${Qe}) (${e}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${e}); run the installed \`reason\``}function ss(e=a()){let t=mt(e);if(t.length>0)return{state:"ready",path:w(w(w(t[0]))),prefix:t};let s=Do(t,e)??"computer_use_identity_unavailable";return{state:s,path:le(e),detail:K(s,e)}}function V(){return{identity:()=>ss(),grants:(e)=>Ge(e),request:(e,t)=>dt(e,t),worker:async()=>(await import("./status-m84f91g9.js")).connectionMacState(),open:(e)=>{H("/usr/bin/open",e,{stdio:"ignore",timeout:1e4})},tile:Or,restartConnection:async()=>(await import("./connect-cli-g3yvh9jm.js")).restartConnection(),sleep:(e)=>new Promise((t)=>setTimeout(t,e)),now:()=>Date.now()}}function M(e,t,s){if(e.state!=="ready"||!t)return"unknown";return t[s]?"granted":"missing"}async function as(e){let t=e.identity(),s=t.state==="ready"?await e.grants(t.prefix):null,n=await e.worker(),r=n?R(n):null,i=!r||n?.full_disk_access==="unknown"?"unknown":n?.full_disk_access==="granted"?"granted":"missing",c=(u,d,o)=>{let{label:p,purpose:h,level:m}=k[u];return{id:u,label:p,purpose:h,level:m,state:d,holder:o}};return{identity:{state:t.state,path:t.path,detail:t.state==="ready"?null:t.detail},worker_detail:r?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[c("screen",M(t,s,"screen"),t.path),c("accessibility",M(t,s,"accessibility"),t.path),c("disk",i,r)]}}function Ws(e){let t=e.identity.state==="ready"?null:e.identity.state,s=e.permissions.filter((i)=>i.state==="granted").length,n=[...t?[t]:[],...e.permissions.filter((i)=>i.state!=="granted"&&!(t&&i.id!=="disk")).map((i)=>`${i.label} ${i.state}`)],r=!t&&e.permissions.some((i)=>i.state==="missing");return`Permissions: ${s} of ${e.permissions.length}${n.length>0?` (${n.join(", ")})`:""}`+(r?" \u2014 reason permissions allow":n.length>0?" \u2014 reason permissions":"")}async function x(e,t){let s=t.now()+q;for(;;){if(await e())return!0;if(t.now()>=s)return!1;await t.sleep(B)}}async function Vs(e,t){let s=t.host??V(),{io:n}=t,r=await as(s),i=r.permissions.filter((o)=>e.includes(o.id)&&o.state!=="granted");if(i.length===0)return n.stdout.write(`Reason permissions: ${e.map((o)=>k[o].label).join(", ")} already allowed.
3
3
  `),0;let c=!1,u=!1,d=s.identity();for(let o of i){let{label:p,pane:h}=k[o.id];if(o.id!=="disk"){if(d.state!=="ready"){if(!c)n.stderr.write(`Reason permissions: ${d.detail}
4
4
  `);c=!0;continue}let g=o.id;await s.request(d.prefix,g),s.open([h]);let I=s.tile(d.path,g);if(n.stdout.write(`Allow Reason in System Settings > Privacy & Security > ${p}.
5
5
  `),!t.wait)continue;if(n.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_,$o,ke}from"./vm-hands-entry-lite-wp0d65yx.js";import{l,Gt,Ke,Lr,Kt,$r,pt}from"./vm-hands-entry-lite-3p7zk3yt.js";import{wt,ar}from"./vm-hands-entry-lite-vwxg4fhe.js";import{fn}from"./vm-hands-entry-lite-ns038y54.js";import{B,m,te,Ue}from"./vm-hands-entry-lite-ga61bq1j.js";import{F}from"./vm-hands-entry-lite-qevgjf1b.js";import{No}from"./vm-hands-entry-lite-d9sbxxqn.js";import{xe,Ye,Jn,Vr}from"./vm-hands-entry-lite-7c376ed5.js";import{f,v,h}from"./vm-hands-entry-lite-ymqb2927.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{Vo,an,y,t,k,Ct,o,d,Oe,u,i,c,g,fs,s,n,cn}from"./vm-hands-entry-lite-qzcac2mf.js";import{closeSync as Uh,existsSync as Fh,mkdirSync as jh,openSync as qh,readdirSync as zh,realpathSync as pe,rmSync as Kh}from"fs";import{dirname as Jh,join as J,resolve as Gh}from"path";import{createHash as It}from"crypto";import{platform as Ot}from"os";import{join as Tt}from"path";var Mt=g("store",[c({version:n(1),store:n("keychain")}),c({version:n(1),store:n("file"),api_key:t().min(1).max(4096)})]),We=(e)=>Tt(e,"api-key.json");function Ne(e){let r=It("sha256").update(`reason-connect-api-key
2
+ import{_,$o,ke}from"./vm-hands-entry-lite-wp0d65yx.js";import{l,Gt,Ke,Lr,Kt,$r,pt}from"./vm-hands-entry-lite-3p7zk3yt.js";import{wt,ar}from"./vm-hands-entry-lite-vwxg4fhe.js";import{fn}from"./vm-hands-entry-lite-2yhty3wm.js";import{B,m,te,Ue}from"./vm-hands-entry-lite-jhcbsyey.js";import{F}from"./vm-hands-entry-lite-6asg5xb7.js";import{No}from"./vm-hands-entry-lite-htmzt3t4.js";import{xe,Ye,Jn,Vr}from"./vm-hands-entry-lite-370kvrw6.js";import{f,v,h}from"./vm-hands-entry-lite-ymqb2927.js";import{a}from"./vm-hands-entry-lite-0sh835na.js";import{Vo,an,y,t,k,Ct,o,d,Oe,u,i,c,g,fs,s,n,cn}from"./vm-hands-entry-lite-qzcac2mf.js";import{closeSync as Uh,existsSync as Fh,mkdirSync as jh,openSync as qh,readdirSync as zh,realpathSync as pe,rmSync as Kh}from"fs";import{dirname as Jh,join as J,resolve as Gh}from"path";import{createHash as It}from"crypto";import{platform as Ot}from"os";import{join as Tt}from"path";var Mt=g("store",[c({version:n(1),store:n("keychain")}),c({version:n(1),store:n("file"),api_key:t().min(1).max(4096)})]),We=(e)=>Tt(e,"api-key.json");function Ne(e){let r=It("sha256").update(`reason-connect-api-key
3
3
  ${e}`).digest("hex");return new Ke(Gt(),Ot(),r)}function we(e,r=Ne(e)){if(!f(We(e)))return null;let p=Mt.parse(JSON.parse(h(We(e))));if(p.store==="file")return p.api_key;try{let b=r.loadBinding();return b?new TextDecoder().decode(b):null}catch(b){if(!(b instanceof l))throw b;throw Error("worker_api_key_unreadable")}}import{readdirSync as Zt,renameSync as Go,rmSync as Yo}from"fs";import{join as ee}from"path";import{createHash as Wt}from"crypto";import{platform as Nt}from"os";import{join as N}from"path";function w(e){return{state:N(m(e),"device.json"),control:N(m(e),"control.json"),lock:N(m(e),"lifecycle.lock"),socket:N(m(e),"control.sock"),daemon:N(m(e),"daemon.json"),releaseCheck:N(m(e),"release-check.json"),updateDeferral:N(m(e),"update-deferral.json"),firstHeartbeat:N(m(e),"first-heartbeat.json")}}var lo=i({version:n(1),device_id:t().min(1).max(160),offer:Oe().optional(),enrollment_ms:o().int().nonnegative().max(ar).optional()});function z(e,r=!1){v(m(e),r);let p=["local-device.key","local-device.binding","device.json"].filter((b)=>{let R=N(m(e),b);if(!f(R))return!1;return h(R),!0});return e.lifetime==="persistent"&&p.join()==="device.json"?Ht(e):new Lr(m(e))}function Ht(e){return new Ke(Gt(),Nt(),$t(e))}function $t(e){let r=Ft(e);return Wt("sha256").update(`reason-worker
4
4
  ${r?.directory??m(e)}`).digest("hex")}var Bt="keychain-scope.json";var Ut=c({version:n(1),directory:t().min(1),devicePublicKey:t().min(1)});function Ft(e){let r=N(m(e),Bt);if(!f(r))return null;let p=Ut.safeParse(JSON.parse(h(r))),b=w(e).state;if(!p.success||!f(b))return null;return JSON.parse(h(b))?.devicePublicKey===p.data.devicePublicKey?p.data:null}function M(e){if(!f(m(e)))return null;let r=$r(w(e).state,{proofStore:z(e),repair:!1}),p=r!==null&&$o(e.apiOrigin,r.apiOrigin),b=p?[te(e),te({...e,apiOrigin:r.apiOrigin})]:[te(e)];if(r&&(!b.includes(r.worker?.configDigest??"")||r.worker.lifetime!==e.lifetime||r.apiOrigin!==e.apiOrigin&&!p||r.roots.length>32||r.roots[0]?.path!==e.workspaceRoot||r.handsSlots!==e.slots))throw Error("worker_config_binding_mismatch");return r}var jt=c({version:n(1),drained:d(),revoked:d()});function H(e){let r=w(e).control;return f(r)?jt.parse(JSON.parse(h(r))):{version:1,drained:!1,revoked:!1}}var zt=c({read:d(),write:d(),execute:d(),discover_environment:d(),expose_mcp:n(!1)}),Vt=c({version:n(1),organization_id:t().min(1).max(160),enrollment_ticket:t().min(1).max(4096),code_verifier:t().regex(/^[A-Za-z0-9._~-]{43,128}$/),root_fingerprint_key:t().regex(/^[a-f0-9]{64}$/),root:c({path_fingerprint:t().regex(/^[a-f0-9]{64}$/),permissions:zt,execution_mode:s(["confined","host"]).default("confined")}),folders:u(c({path_fingerprint:t().regex(/^[a-f0-9]{64}$/)})).min(1).max(31).optional()}),So=i({device_id:t().min(1).max(160),organization_id:t().min(1).max(160),auth_scheme:n("p256"),protocol_version:n(2),roots:u(i({id:t().min(1),label:t(),path_fingerprint:t()})).min(1).max(32),headless:i({lifecycle:s(["persistent","ephemeral"]),expires_at:y.datetime({offset:!0})}),first_heartbeat:Oe().optional()});var jo=c({version:n(1),install_id:k(),fingerprint_key:t().regex(/^[a-f0-9]{64}$/)}),qo=i({enrollment_ticket:t().min(1).max(4096),expires_at:y.datetime({offset:!0}),device_kind:n("headless"),lifecycle:s(["persistent","ephemeral"]),device_expires_at:y.datetime({offset:!0})});var zo=i({credentialKind:s(["oauth","api_key"]).optional(),apiOrigin:Ct(),clientId:t(),accessToken:t().min(1).max(32768),refreshToken:t().max(32768),expiresAt:y.datetime({offset:!0}),scopes:u(t().max(128)).max(128),orgId:t().min(1).max(160)});var je=8;var Qt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,_e=(e)=>ee(m(e),"workspaces"),er="account.json",tr=(e)=>f(ee(e,er));function Se(e){let r;try{r=Zt(_e(e))}catch{return[]}return r.filter((p)=>Qt.test(p)).sort().map((p)=>{let b=ee(_e(e),p),R=ee(b,"worker.json"),S=null;try{let P=B.safeParse(JSON.parse(h(R)));if(P.success&&P.data.stateDirectory===b)S=P.data}catch{}return{organizationId:p,directory:b,configPath:R,config:S,account:tr(b)}})}var rr=(e)=>ee(_e(e),"listed.json");function nr(e){try{let r=JSON.parse(h(rr(e))),p=r.names&&typeof r.names==="object"&&!Array.isArray(r.names)?Object.fromEntries(Object.entries(r.names).filter((R)=>typeof R[1]==="string")):{},b=r.refused&&typeof r.refused==="object"?r.refused:null;return{listed:r.listed===!0,reason:r.reason==="sign_in"?"sign_in":null,blocked:Array.isArray(r.blocked)?r.blocked.filter((R)=>typeof R==="string"):[],names:p,...b&&typeof b.device==="string"&&typeof b.roots==="string"&&typeof b.at==="number"&&Number.isFinite(b.at)&&typeof b.count==="number"&&Number.isInteger(b.count)&&b.count>=1?{refused:{device:b.device,roots:b.roots,at:b.at,count:b.count}}:{}}}catch{return null}}function qe(e,r){let p=Se(e),b=p.filter((C)=>C.account),R=p.filter((C)=>!C.account),S=nr(e),P=S&&!S.listed?S.reason:null,E=P||R.length===0&&S&&!S.listed?[]:R;if(b.length===0&&E.length===0&&(P||S&&!S.listed))return{workspaces:null,off:P};return{off:P,workspaces:[...b,...E].map(({organizationId:C,config:T,account:I})=>{let A=!1,D=null,L=!1,he=null;try{A=T?H(T).revoked:!1,D=T&&!A?M(T):null;let Le=T?pt(w(T).daemon):null;L=r&&!!D&&Le?.state==="connected",he=L?Kt(Le,D):null}catch{}return{...he?{permission_recovery:he}:{},organization_id:C,device_id:D?.deviceId??null,name:S?.names?.[C]??null,root:D?.roots[0]?{id:D.roots[0].id,permissions:D.roots[0].permissions}:null,state:A?"removed":L?"connected":"not_running",blocked:!I&&!A&&!L&&(S?.blocked.includes(C)??!1),...I?{account:!0}:{}}})}}import{readFileSync as ir}from"fs";function pr(e){try{let r=JSON.parse(ir(`${e}.keep-awake.json`,"utf8"));return r!==null&&typeof r==="object"&&"version"in r&&r.version===1&&"enabled"in r&&r.enabled===!0?"battery_and_ac":void 0}catch(r){return r.code==="ENOENT"?"battery_and_ac":void 0}}import{chmodSync as ji,lstatSync as Ze,mkdtempSync as qi,realpathSync as sr,rmdirSync as zi,rmSync as Ki,unlinkSync as Vi}from"fs";import{createConnection as cr,createServer as Gi}from"net";import{basename as Je,dirname as Ge,join as ne}from"path";var lr=s(["status","drain","resume","stop","reload_roots"]),dr=c({version:n(1),instanceId:t(),deviceId:t(),phase:s(["starting","running","reconnecting","stopping"]),drained:d(),activeClaims:o().int().nonnegative(),activeSessions:o().int().nonnegative().optional(),executionEligible:d(),supportedOperations:u(s(wt)).max(wt.length).optional(),capabilityReadiness:fs(s(wt),d()).optional(),lastHeartbeat:t().nullable(),expiresAt:t()}),ta=c({nonce:t(),action:lr}),ur=i({nonce:k()}),fr=c({version:n(1),nonce:k(),socketPath:t().max(100)});function mr(e){return ne(w(e).lock,"control.json")}function Qe(e){return v(w(e).lock),ur.parse(JSON.parse(h(ne(w(e).lock,"owner.json"))))}function Xe(e){if(!f(e))return!1;let r=Ze(e);if(!r.isSocket()||r.uid!==process.getuid?.()||(r.mode&63)!==0)throw Error("worker_control_socket_not_private");return!0}function et(e,r){let p=mr(e);if(!f(p)){let S=w(e).socket;if(!f(S)||!Ze(S).isSocket())return null;return Xe(S)?S:null}let b=fr.parse(JSON.parse(h(p)));if(b.nonce!==r)throw Error("worker_instance_changed");if(process.platform==="win32"){if(!hr.test(b.socketPath))throw Error("worker_control_endpoint_invalid");return b.socketPath}let R=Ge(b.socketPath);if(Ge(R)!==sr("/tmp")||!/^(?:reason|ara)-worker-[A-Za-z0-9]{6}$/.test(Je(R))||Je(b.socketPath)!=="control.sock"||Buffer.byteLength(b.socketPath)>100)throw Error("worker_control_endpoint_invalid");if(!f(R))return null;return v(R),Xe(b.socketPath)?b.socketPath:null}var hr=/^\\\\\.\\pipe\\reason-worker-[0-9a-f-]{36}$/;function gr(e,r){try{let p=JSON.parse(h(ne(w(e).lock,"owner.json"))),b=p&&typeof p==="object"?p[r]:void 0;return typeof b==="string"?b:null}catch{return null}}function tt(e){return gr(e,"runtime_version")}function rt(e,r){if(r)return r.message==="worker_control_timeout"?"socket_timeout":"bad_reply";try{if(!f(ne(w(e).lock,"owner.json")))return"no_lock";return et(e,Qe(e).nonce)?"socket_refused":"no_socket"}catch{return"bad_reply"}}var ra=c({instance:t().nullable(),since:o().int().nonnegative()});async function G(e,r){let p=w(e);if(!f(ne(p.lock,"owner.json")))return null;let b=Qe(e),R=et(e,b.nonce);if(!R)return null;return new Promise((S,P)=>{let E=cr(R),C="",T=!1,I=(A,D)=>{if(T)return;if(T=!0,E.destroy(),D)P(D);else S(A)};E.setTimeout(2000,()=>E.destroy(Error("worker_control_timeout"))),E.on("connect",()=>E.write(JSON.stringify({nonce:b.nonce,action:r})+`
5
5
  `)),E.on("data",(A)=>{if(C+=A.toString(),Buffer.byteLength(C)>16384)E.destroy(Error("worker_control_oversize"))}),E.on("error",(A)=>{if("code"in A&&["ECONNREFUSED","ENOENT"].includes(String(A.code)))I(null);else I(null,A.message==="worker_control_timeout"?A:Error("worker_control_unavailable"))}),E.on("end",()=>{try{let A=dr.parse(JSON.parse(C));if(A.instanceId!==b.nonce)throw Error("worker_instance_changed");I(A)}catch{I(null,Error("worker_control_invalid_response"))}}),E.once("close",()=>I(null,Error("worker_control_unavailable")))})}import{realpathSync as br}from"fs";import{constants as Re}from"fs";import{open as wr}from"fs/promises";var la={platform:process.platform,home:a,async openFile(e){let r=await wr(e,Re.O_RDONLY|Re.O_NOFOLLOW|Re.O_NONBLOCK);return{isFile:async()=>(await r.stat()).isFile(),close:()=>r.close()}}};var qa=No(br(process.execPath));var gs=Buffer.from([0,255,3,4]);import{execFile as nn}from"child_process";import{promisify as on}from"util";var Er=/#w=(\d{1,5})&h=(\d{1,5})$/;function at(e){return typeof e==="number"&&Number.isInteger(e)&&e>0&&e<=32768?e:void 0}function st(e){let r=Er.exec(e);if(!r)return;let p=at(Number(r[1])),b=at(Number(r[2]));return p&&b?{width:p,height:b}:void 0}var ct="[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",Pr=new RegExp(`^/media/pr-screenshots/(${ct})/(${ct})/([a-z0-9][a-z0-9._-]*)\\.(png|jpe?g|gif|webp|webm|mp4)$`,"i");var Cr=new Set(["png","jpg","jpeg","gif","webp"]),Ar=new Set(["webm","mp4"]);function xr(e){if(!e)return null;try{return new URL(e).origin}catch{return null}}function Ir(e){let r=st(e);return Boolean(r&&e===`#w=${r.width}&h=${r.height}`)}function lt(e,r){let p;try{p=new URL(e)}catch{return null}let b=xr(r),R=p.hostname==="ara.so"||p.hostname.endsWith(".ara.so")||p.hostname==="reasonmachines.ai"||p.hostname.endsWith(".reasonmachines.ai")||p.hostname==="reasonmachines.com"||p.hostname.endsWith(".reasonmachines.com");if(p.protocol!=="https:"||!R&&p.origin!==b||p.username||p.password||p.port||p.search||p.hash&&!Ir(p.hash))return null;let S=Pr.exec(p.pathname);if(!S)return null;let P=S[1]?.toLowerCase(),E=S[2]?.toLowerCase(),C=S[3]?.toLowerCase(),T=S[4]?.toLowerCase();if(!P||!E||!C||!T)return null;let I=Cr.has(T)?"image":Ar.has(T)?"video":null;if(!I)return null;let A=/^(before|after)[\s:_-]+/.exec(C),D=p.pathname.replace(/^\/media\//,"");return{url:p.toString(),storagePath:D,runId:P,artifactId:E,fileName:`${C}.${T}`,kind:I,phase:A?.[1]==="before"||A?.[1]==="after"?A[1]:null}}var Or=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,dt=(e)=>Boolean(e&&typeof e==="object"&&!Array.isArray(e)),K=()=>{throw Error("cloud_browser_media_request_invalid")};function Pe(e){if(!dt(e)||Object.keys(e).some((S)=>!["runId","configuredMediaOrigin","media"].includes(S))||typeof e.runId!=="string"||!Or.test(e.runId)||typeof e.configuredMediaOrigin!=="string"||e.configuredMediaOrigin.length>2048||!Array.isArray(e.media)||e.media.length<1||e.media.length>8)return K();let r;try{r=new URL(e.configuredMediaOrigin)}catch{return K()}if(r.protocol!=="https:"||r.username||r.password||r.port||!Ue(r.origin,{mode:"public_web"}).allowed)return K();let p=e.runId.toLowerCase(),b=new Set,R=e.media.map((S)=>{if(!dt(S)||Object.keys(S).some((E)=>!["url","sourceUrl","kind"].includes(E))||typeof S.url!=="string"||S.url.length>2048||typeof S.sourceUrl!=="string"||S.sourceUrl.length>8192||!["image","video"].includes(String(S.kind)))return K();let P=lt(S.url,r.origin);if(!P||new URL(P.url).origin!==r.origin||P.runId!==p||P.kind!==S.kind||P.url!==S.url||b.has(S.url))return K();if(b.add(S.url),S.sourceUrl!==S.url){let E;try{E=new URL(S.sourceUrl)}catch{return K()}let C=/^\/(?:[a-f0-9]{40}|[a-f0-9]{64})\/([a-f0-9]+)$/.exec(E.pathname)?.[1];if(S.kind!=="image"||E.origin!=="https://camo.githubusercontent.com"||E.username||E.password||E.search||E.hash||!C||C.length%2!==0||Buffer.from(C,"hex").toString("utf8")!==S.url)return K()}return{url:S.url,sourceUrl:S.sourceUrl,kind:S.kind}});return{runId:e.runId,configuredMediaOrigin:r.origin,media:R}}var x=t().uuid(),X=t().regex(/^[a-f0-9]{64}$/),V=y.datetime({precision:3}),Ce=t().regex(/^[a-zA-Z0-9_-]{1,160}$/),mt=t().max(2048).regex(/^https:\/\/github\.com\/[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/).refine((e)=>![".",".."].includes(e.split("/")[4])),U=i({kind:n("primary_mac"),version:n(1),organizationId:Ce,userId:Ce,sessionId:Ce,runId:x,deviceId:x,rootId:x,rootRevision:t().min(1).max(64),binding:s(["workspace_source","mcp_control"]),targetRevision:o().int().nonnegative(),generation:x,profile:t().regex(/^(Default|Profile [0-9]+)$/),extensionInstanceId:t().min(1).max(1024)}).strict().refine((e)=>e.binding!=="workspace_source"||e.targetRevision===0),Tr=cn().transform((e,r)=>{try{return fn(e)}catch{return r.addIssue({code:"custom",message:"proof_visual_contract_invalid"}),Vo}}),ue=i({version:n(1),owner:U,contextId:x,preparedAt:V,expiresAt:V,prUrl:mt,headSha:t().regex(/^[a-f0-9]{40}$/),skillDigest:X,evidenceKind:s(["image","video"]),visualPlan:Tr.optional(),uploadOrigin:t().url().refine((e)=>{let r=new URL(e);return r.protocol==="https:"&&r.origin===e&&!r.username&&!r.password}).optional()}).strict().refine((e)=>Date.parse(e.expiresAt)>Date.parse(e.preparedAt)&&Date.parse(e.expiresAt)-Date.parse(e.preparedAt)<=300000),Mr=i({version:n(1),producer:n("primary_mac"),context:ue,captureId:x,operationId:x,attemptId:x,tabId:o().int().positive(),startedAt:V,finishedAt:V,sha256:X,media:g("contentType",[i({contentType:n("image/png"),sizeBytes:o().int().min(24).max(8388608),width:o().int().min(1).max(4096),height:o().int().min(1).max(4096)}).strict(),i({contentType:n("video/webm"),sizeBytes:o().int().min(128).max(10485760),durationSeconds:o().min(0.05).max(15),frameCount:o().int().min(1).max(450),receivedFrameCount:o().int().min(1).max(2000)}).strict()])}).strict().superRefine((e,r)=>{let p=Date.parse(e.startedAt),b=Date.parse(e.finishedAt);if(p<Date.parse(e.context.preparedAt)||b<p||b>Date.parse(e.context.expiresAt)||b-p>30000||e.media.contentType==="video/webm"&&(e.media.receivedFrameCount<e.media.frameCount||Math.abs((b-p)/1000-e.media.durationSeconds)>0.1))r.addIssue({code:"custom",message:"mac_pr_proof_capture_chronology_invalid"})}),yc=g("action",[i({action:n("screenshot"),context_id:x,tab_id:o().int().positive()}).strict(),i({action:n("start_video"),context_id:x,tab_id:o().int().positive(),seconds:o().int().min(1).max(15)}).strict(),i({action:n("stop_video"),recording_operation_id:x}).strict()]),fe=i({login:t().regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,37}[a-zA-Z0-9])?$/),id:t().regex(/^[1-9][0-9]{0,19}$/).nullable()}).strict(),ce=t().regex(/^[1-9][0-9]{0,19}$/),le=i({version:n(1),owner:U,expectedActorId:ce.nullable(),repositoryId:ce,repositoryFullName:t().max(200).regex(/^[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+$/).refine((e)=>![".",".."].includes(e.split("/")[1]))}).strict(),Dr=["browser_unavailable","github_page_unavailable","identity_check_failed","operation_incomplete","attachment_unavailable"],Wr=g("status",[le.extend({status:n("ready"),observedActor:fe,checkedAt:V}),le.extend({status:n("not_ready"),reason:s(["authentication_required","identity_mismatch","authority_lost","unavailable"]),cause:s(Dr).optional()})]).refine((e)=>e.status!=="ready"||e.expectedActorId===null||e.observedActor.id===e.expectedActorId),Y=i({version:n(1),owner:U,expectedActorId:ce.nullable(),authenticatedActor:fe,attemptId:x,captureId:x,prUrl:mt,repositoryId:ce,headSha:t().regex(/^[a-f0-9]{40}$/),sha256:X,sizeBytes:o().int().min(128).max(10485760),contentType:n("video/webm")}).strict(),ht=t().regex(/^https:\/\/github\.com\/user-attachments\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),Nr=g("status",[Y.extend({status:n("not_attempted"),reason:s(["authentication_required","attachment_unavailable","identity_mismatch","capture_invalid","authority_lost"])}),Y.extend({status:n("uncertain"),reason:n("upload_outcome_unknown")}),Y.extend({status:n("uploaded"),observedActor:fe,nativeUrl:ht,uploadedAt:V})]).refine((e)=>(e.expectedActorId===null||e.authenticatedActor.id===e.expectedActorId)&&(e.status!=="uploaded"||e.observedActor.id===e.authenticatedActor.id&&e.observedActor.login===e.authenticatedActor.login)),de=Y.extend({nativeUrl:ht,observedActor:fe,bodySha256:X}),Hr=g("status",[de.extend({status:n("incomplete"),reason:s(["authentication_required","identity_mismatch","playback_unverified","authority_lost"])}),de.extend({status:n("verified"),sourceSha256:X,width:o().int().min(1).max(4096),height:o().int().min(1).max(4096),durationSeconds:o().positive().max(30),advancedSeconds:o().min(0.05).max(10),advancedFrames:o().int().positive(),playbackRestored:n(!0),verifiedAt:V})]).refine((e)=>(e.expectedActorId===null||e.authenticatedActor.id===e.expectedActorId)&&e.observedActor.id===e.authenticatedActor.id&&e.observedActor.login===e.authenticatedActor.login&&(e.status!=="verified"||e.sourceSha256===e.sha256)),Br=cn().transform((e,r)=>{try{let p=Pe(e);if(p.media.some((b)=>b.kind!=="image"))throw Error();return p}catch{return r.addIssue({code:"custom",message:"proof_media_request_invalid"}),Vo}}),Ur=g("action",[i({action:n("auth_check"),input:le}).strict(),i({action:n("prepare"),context:ue}).strict(),i({action:n("capture_png"),owner:U,contextId:x,tabId:o().int().positive()}).strict(),i({action:n("start_video"),owner:U,contextId:x,tabId:o().int().positive(),seconds:o().int().min(1).max(15)}).strict(),i({action:n("inspect_capture"),owner:U,captureId:x}).strict(),i({action:n("publish_video"),input:Y}).strict(),i({action:n("verify_png_media"),owner:U,media:Br}).strict().refine((e)=>e.media.runId===e.owner.runId),i({action:n("verify_saved_media"),input:de}).strict(),i({action:n("publish_png"),owner:U,attemptId:x,captureId:x,sha256:X,sizeBytes:o().int().min(24).max(8388608),storagePath:t().max(512),uploadUrl:t().url().max(8192)}).strict()]);var Fr=i({requestId:x,command:Ur}).strict();var jr={type:"object",required:["action"],properties:{action:{type:"string",enum:["screenshot","start_video","stop_video"]},context_id:{type:"string",format:"uuid"},tab_id:{type:"integer",minimum:1},seconds:{type:"integer",minimum:1,maximum:15},recording_operation_id:{type:"string",format:"uuid"}},additionalProperties:!1},ut={type:"string",format:"uuid",description:"capture_context_id from tools.pr.prepareProof."},ft={type:"integer",minimum:1,description:"An already-owned tab's id."},_c={...jr,oneOf:[{type:"object",required:["action","context_id","tab_id"],additionalProperties:!1,properties:{action:{type:"string",const:"screenshot"},context_id:ut,tab_id:ft}},{type:"object",required:["action","context_id","tab_id","seconds"],additionalProperties:!1,properties:{action:{type:"string",const:"start_video"},context_id:ut,tab_id:ft,seconds:{type:"integer",minimum:1,maximum:15}}},{type:"object",required:["action","recording_operation_id"],additionalProperties:!1,properties:{action:{type:"string",const:"stop_video"},recording_operation_id:{type:"string",format:"uuid",description:"The recording_operation_id start_video returned."}}}]};var Rc=i({operationId:t().uuid(),attemptId:t().uuid(),contextId:t().uuid(),tabId:o().int().positive()}).strict();var qr=String.raw`async (media) => {
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{S,Wt,$n,Ge,Bn,Fn}from"./vm-hands-entry-lite-k1wghndy.js";import{Xn}from"./vm-hands-entry-lite-d9sbxxqn.js";import{Ln}from"./vm-hands-entry-lite-wx1fmrbs.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ys,spawn as qe}from"child_process";import{existsSync as ws}from"fs";import{connect as xs}from"net";function pn(){let e=new Set,t=null,n=(s)=>({holder:t?.viewer??null,you:t===s,same_user:Boolean(t?.viewer&&s.viewer&&t.viewer.user_id===s.viewer.user_id)}),o=()=>{for(let s of e)s.notify(n(s))};return{join(s){return e.add(s),s.notify(n(s)),()=>{if(!e.delete(s))return;if(t!==s)return;t=null,o()}},claim(s){if(t===s||!e.has(s))return;t=s,o()}}}var ut=pn();import{createHash as St}from"crypto";import{once as Sn}from"events";import{createWriteStream as vn,existsSync as mr,mkdirSync as gr,mkdtempSync as hr,readFileSync as le,readdirSync as br,renameSync as yr,realpathSync as En,rmSync as Pn,statSync as Ne,writeFileSync as wr}from"fs";import{delimiter as _r,dirname as vt,join as b}from"path";import{finished as Cn}from"stream/promises";var We="omljlfpmafedpplnpkkahegadhkimdje",fo="https://chromewebstore.google.com/detail/reason/omljlfpmafedpplnpkkahegadhkimdje";var O={ocu:{repository:"https://github.com/iFurySt/open-codex-computer-use.git",revision:"386a260d1ab8b690adbbb27f7471595cf0c2b752",version:"0.3.5"},obu:{repository:"https://github.com/iFurySt/open-browser-use.git",revision:"ac015846df75928fbcf0f3a0f3ba3a210ce1a507",version:"0.1.42"}},H={version:"155.0.8059.84",macArm64Sha256:"13b9e98ce56f5ce18e100a009f455c9285f399e7c9dc8a76fdf2f3a9755bb5f2",linux64Sha256:"cf0f049892dea22e6a6db26d47ed0d7776b7158edcbec4634086633df8bafcbc",win64Sha256:"507f2a031441d10c62b5e3d4e863f09ac1198a571c1419976cbd8387f639afde"};var J={ocu:{url:`https://registry.npmjs.org/open-computer-use/-/open-computer-use-${O.ocu.version}.tgz`,sha256:"7c16a87c8cd357787b02c0ebd040dd5f93880c1fb51c1901caa2e0c05d063130",size_bytes:5844280},obu:{url:`https://registry.npmjs.org/open-browser-use/-/open-browser-use-${O.obu.version}.tgz`,sha256:"9386d8ce0a147b3f55e1807b68edf736836378807541c457c9b5f6ca2cabaa4e",size_bytes:21372018},extension:{url:`https://github.com/iFurySt/open-browser-use/releases/download/v${O.obu.version}/open-browser-use-chrome-extension-${O.obu.version}.zip`,sha256:"c9c07bec1175e12ea6985b0e7784a5ef01fd03f014b958224a1e17dcd838a241",size_bytes:31070}},F="pnbmoicbkopffjjgfgfglopechaiemkp";import{spawn as Me}from"child_process";import{createRequire as fn}from"module";import{join as mn}from"path";var gn=30000,hn=1048576;function Te(){return process.env.SystemRoot??"C:\\Windows"}function bn(){return mn(Te(),"System32","WindowsPowerShell","v1.0","powershell.exe")}var yn=String.raw`
2
+ import{S,Wt,$n,Ge,Bn,Fn}from"./vm-hands-entry-lite-k1wghndy.js";import{Xn}from"./vm-hands-entry-lite-htmzt3t4.js";import{Ln}from"./vm-hands-entry-lite-wx1fmrbs.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ys,spawn as qe}from"child_process";import{existsSync as ws}from"fs";import{connect as xs}from"net";function pn(){let e=new Set,t=null,n=(s)=>({holder:t?.viewer??null,you:t===s,same_user:Boolean(t?.viewer&&s.viewer&&t.viewer.user_id===s.viewer.user_id)}),o=()=>{for(let s of e)s.notify(n(s))};return{join(s){return e.add(s),s.notify(n(s)),()=>{if(!e.delete(s))return;if(t!==s)return;t=null,o()}},claim(s){if(t===s||!e.has(s))return;t=s,o()}}}var ut=pn();import{createHash as St}from"crypto";import{once as Sn}from"events";import{createWriteStream as vn,existsSync as mr,mkdirSync as gr,mkdtempSync as hr,readFileSync as le,readdirSync as br,renameSync as yr,realpathSync as En,rmSync as Pn,statSync as Ne,writeFileSync as wr}from"fs";import{delimiter as _r,dirname as vt,join as b}from"path";import{finished as Cn}from"stream/promises";var We="omljlfpmafedpplnpkkahegadhkimdje",fo="https://chromewebstore.google.com/detail/reason/omljlfpmafedpplnpkkahegadhkimdje";var O={ocu:{repository:"https://github.com/iFurySt/open-codex-computer-use.git",revision:"386a260d1ab8b690adbbb27f7471595cf0c2b752",version:"0.3.5"},obu:{repository:"https://github.com/iFurySt/open-browser-use.git",revision:"ac015846df75928fbcf0f3a0f3ba3a210ce1a507",version:"0.1.42"}},H={version:"155.0.8059.84",macArm64Sha256:"13b9e98ce56f5ce18e100a009f455c9285f399e7c9dc8a76fdf2f3a9755bb5f2",linux64Sha256:"cf0f049892dea22e6a6db26d47ed0d7776b7158edcbec4634086633df8bafcbc",win64Sha256:"507f2a031441d10c62b5e3d4e863f09ac1198a571c1419976cbd8387f639afde"};var J={ocu:{url:`https://registry.npmjs.org/open-computer-use/-/open-computer-use-${O.ocu.version}.tgz`,sha256:"7c16a87c8cd357787b02c0ebd040dd5f93880c1fb51c1901caa2e0c05d063130",size_bytes:5844280},obu:{url:`https://registry.npmjs.org/open-browser-use/-/open-browser-use-${O.obu.version}.tgz`,sha256:"9386d8ce0a147b3f55e1807b68edf736836378807541c457c9b5f6ca2cabaa4e",size_bytes:21372018},extension:{url:`https://github.com/iFurySt/open-browser-use/releases/download/v${O.obu.version}/open-browser-use-chrome-extension-${O.obu.version}.zip`,sha256:"c9c07bec1175e12ea6985b0e7784a5ef01fd03f014b958224a1e17dcd838a241",size_bytes:31070}},F="pnbmoicbkopffjjgfgfglopechaiemkp";import{spawn as Me}from"child_process";import{createRequire as fn}from"module";import{join as mn}from"path";var gn=30000,hn=1048576;function Te(){return process.env.SystemRoot??"C:\\Windows"}function bn(){return mn(Te(),"System32","WindowsPowerShell","v1.0","powershell.exe")}var yn=String.raw`
3
3
  $ErrorActionPreference = "Stop"
4
4
  Add-Type -TypeDefinition @"
5
5
  using System;