@reason-machines/cli-linux-x64 0.2.415 → 0.2.419
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.txt +7 -8
- package/bin/reason +2 -2
- package/bin/runtime/srt/sandbox-runtime.mjs +52 -52
- package/bin/vm-hands/api-credentials-s4897qxy.js +2 -0
- package/bin/vm-hands/api-m73x3da5.js +2 -0
- package/bin/vm-hands/ask-relay-4kwcx2b7.js +8 -0
- package/bin/vm-hands/connect-cli-34b18gjs.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-j012b4bd.js +2 -0
- package/bin/vm-hands/desktop-account-0q0arpzk.js +2 -0
- package/bin/vm-hands/device-workspace-3jxhs54b.js +2 -0
- package/bin/vm-hands/hands-worker-source-y64axsw3.js +2 -0
- package/bin/vm-hands/index-194s4vz0.js +12818 -0
- package/bin/vm-hands/install-receipt-1g68b446.js +2 -0
- package/bin/vm-hands/local-automation-k2w46hn2.js +2 -0
- package/bin/vm-hands/local-capabilities-tdzbqmrb.js +2 -0
- package/bin/vm-hands/local-desktop-users-6thzvydd.js +2 -0
- package/bin/vm-hands/local-display-mac-59ma7sxa.js +2 -0
- package/bin/vm-hands/local-display-session-4833qq7h.js +2 -0
- package/bin/vm-hands/local-display-video-c1143mz6.js +2 -0
- package/bin/vm-hands/local-managed-process-mr0zpk7c.js +2 -0
- package/bin/vm-hands/local-pty-session-bwarwpsd.js +2 -0
- package/bin/vm-hands/managed-runtime-vz1wqwwg.js +2 -0
- package/bin/vm-hands/network-contract-gprc37sw.js +2 -0
- package/bin/vm-hands/package-ej9snd47.js +2 -0
- package/bin/vm-hands/permissions-7sfghef4.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-jsrkawe2.js +2 -0
- package/bin/vm-hands/serve-service-kngyzh74.js +2 -0
- package/bin/vm-hands/status-jz29fb95.js +96 -0
- package/bin/vm-hands/version-g29vt13t.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-0h4qmgm2.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-0k13wmzm.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-1exfjv79.js +52 -0
- package/bin/vm-hands/vm-hands-entry-lite-26q3hbdc.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-28s7v15d.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-2m5dwrdf.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-37hvds7z.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-3rqdzqhk.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-4gh5kfr4.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-t7an5zg2.js → vm-hands-entry-lite-4k4h9rcq.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-6nwbqg37.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-m11j0f9q.js → vm-hands-entry-lite-6y6pz2yw.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-714wspqb.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-7zk0r3p9.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-9qep7pka.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-bdhjpv7g.js → vm-hands-entry-lite-agsp101y.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-am6kj1n1.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-as1tkffn.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-bxt4n1nj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-c2g3wmkp.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-d2w8tghq.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-d98m00b8.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-daxcxjze.js +344 -0
- package/bin/vm-hands/vm-hands-entry-lite-dcnyve97.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-e1b89x66.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-ej5ffjck.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-ejkba2nk.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-f3wh0dza.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-f5xb489y.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-feybcq63.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-fpp2bs9y.js +452 -0
- package/bin/vm-hands/{vm-hands-entry-lite-qxchbbew.js → vm-hands-entry-lite-fzkfajew.js} +9 -5
- package/bin/vm-hands/vm-hands-entry-lite-gt497d5x.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-gxper06w.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-j2ng164q.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-jp9q2vsx.js +127 -0
- package/bin/vm-hands/vm-hands-entry-lite-magmzx9c.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-ntx8fdyq.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-pfzczmaa.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-pkc4ry5x.js +539 -0
- package/bin/vm-hands/vm-hands-entry-lite-pp7jfqzr.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-q8wkrzer.js +66 -0
- package/bin/vm-hands/vm-hands-entry-lite-s823n1q9.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-s9xf5z69.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-tchc7z17.js +128 -0
- package/bin/vm-hands/vm-hands-entry-lite-tytfs183.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-v4jtxgaj.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-vgpt2n1v.js +11 -0
- package/bin/vm-hands/{vm-hands-entry-lite-9c95p6n9.js → vm-hands-entry-lite-vsa7t6m9.js} +54 -54
- package/bin/vm-hands/vm-hands-entry-lite-xp3qzxk5.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -3
- package/bin/vm-hands/vm-hands-executor-epyhpjv3.js +11 -0
- package/bin/vm-hands/vm-hands-op-runner-fn1qph82.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-8vt9etvv.js +4 -0
- package/bin/vm-hands/worker-preview-readiness-yfjgban2.js +2 -0
- package/bin/vm-hands/worker-sandbox-z0t69av8.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-cjv8m2zy.js +0 -2
- package/bin/vm-hands/api-credentials-m5akr9fv.js +0 -2
- package/bin/vm-hands/connect-cli-d60gmgnx.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-dkqb4rqy.js +0 -2
- package/bin/vm-hands/desktop-account-5v7x0ajx.js +0 -2
- package/bin/vm-hands/device-workspace-p9q9dckg.js +0 -2
- package/bin/vm-hands/fsevents-ekt70rcc.js +0 -2
- package/bin/vm-hands/hands-worker-source-cgrpm21b.js +0 -2
- package/bin/vm-hands/index-k8kcz8a3.js +0 -12818
- package/bin/vm-hands/install-receipt-7vt2y2vh.js +0 -2
- package/bin/vm-hands/local-automation-4htjhv65.js +0 -2
- package/bin/vm-hands/local-capabilities-c04tbapa.js +0 -2
- package/bin/vm-hands/local-desktop-users-q886k0mm.js +0 -2
- package/bin/vm-hands/local-display-mac-w85956f1.js +0 -2
- package/bin/vm-hands/local-display-session-pkz7a5q9.js +0 -2
- package/bin/vm-hands/local-pty-session-5f50sqq0.js +0 -2
- package/bin/vm-hands/managed-runtime-ppypxbh9.js +0 -2
- package/bin/vm-hands/network-contract-9x9kc5vv.js +0 -2
- package/bin/vm-hands/package-78fkast4.js +0 -2
- package/bin/vm-hands/permissions-xt02c6dh.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-2tnghj3b.js +0 -2
- package/bin/vm-hands/serve-service-wanptaqv.js +0 -2
- package/bin/vm-hands/status-gt7c4ke0.js +0 -10
- package/bin/vm-hands/version-bq5j7cqg.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-09m2cdkw.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-0xrsph3r.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1cwqa4jr.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1rrb66r9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1rtkf2xm.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-22kfyvnk.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-2hvbgp1n.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-2wgdvb15.js +0 -14
- package/bin/vm-hands/vm-hands-entry-lite-2wvsyggd.js +0 -540
- package/bin/vm-hands/vm-hands-entry-lite-463m6ejk.js +0 -458
- package/bin/vm-hands/vm-hands-entry-lite-6aeea05q.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-88swf2qr.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-89z488gz.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-8ns59paz.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-8t9xssf9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-907pa7f9.js +0 -65
- package/bin/vm-hands/vm-hands-entry-lite-9ay6f56v.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ab2m9erf.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-b885gwfh.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-cc2tgsqp.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-ckv17tn8.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-eqgj4acy.js +0 -112
- package/bin/vm-hands/vm-hands-entry-lite-ewwx4fr3.js +0 -250
- package/bin/vm-hands/vm-hands-entry-lite-f5e3dbgk.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-grtycq6y.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-gvwdy3rf.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-hj8n59y9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-k278g9kj.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-kq0qmsw8.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-pgb514h0.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-pmcz7j7t.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-q0k6kx6d.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-qq9w7wq6.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-qy9xg6em.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-qysyf65v.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-rwxbhwky.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-txn44020.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-vrqzr15t.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-zg36myyf.js +0 -5
- package/bin/vm-hands/vm-hands-executor-7k9z9988.js +0 -11
- package/bin/vm-hands/vm-hands-op-runner-n8p81rwm.js +0 -2
- package/bin/vm-hands/vm-hands-runtime-bqsz7h0h.js +0 -4
- package/bin/vm-hands/worker-sandbox-smqj3mbe.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Nr,Pn,Lr,Tn}from"./vm-hands-entry-lite-qysyf65v.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";export{Nr as installationReceiptPath,Lr as installerReasonAlias,Pn as installerReceiptLauncher,Tn as loadInstallationReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{mn,ss,as,cs,ls,gn}from"./vm-hands-entry-lite-qxchbbew.js";import"./vm-hands-entry-lite-ewwx4fr3.js";import"./vm-hands-entry-lite-1rtkf2xm.js";import"./vm-hands-entry-lite-q0k6kx6d.js";import"./vm-hands-entry-lite-bdhjpv7g.js";import"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-f5e3dbgk.js";import"./vm-hands-entry-lite-cc2tgsqp.js";import"./vm-hands-entry-lite-qysyf65v.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-2wgdvb15.js";import"./vm-hands-entry-lite-eqgj4acy.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-k278g9kj.js";import"./vm-hands-entry-lite-gvwdy3rf.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";export{as as ensureLocalBrowser,mn as localAutomationAvailable,cs as localBrowserProfile,ss as localUserChromeHost,ls as runAutomationCallLocally,gn as runLocalAutomation};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xo,vi,en,ko,Co,es,ts,Ao,Po,rs,ns,is,os}from"./vm-hands-entry-lite-2wvsyggd.js";import"./vm-hands-entry-lite-463m6ejk.js";import"./vm-hands-entry-lite-9c95p6n9.js";import"./vm-hands-entry-lite-b885gwfh.js";import"./vm-hands-entry-lite-88swf2qr.js";import"./vm-hands-entry-lite-09m2cdkw.js";import"./vm-hands-entry-lite-ab2m9erf.js";import"./vm-hands-entry-lite-qxchbbew.js";import"./vm-hands-entry-lite-ewwx4fr3.js";import"./vm-hands-entry-lite-1rtkf2xm.js";import"./vm-hands-entry-lite-q0k6kx6d.js";import"./vm-hands-entry-lite-bdhjpv7g.js";import"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-f5e3dbgk.js";import"./vm-hands-entry-lite-cc2tgsqp.js";import"./vm-hands-entry-lite-qysyf65v.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-2wgdvb15.js";import"./vm-hands-entry-lite-eqgj4acy.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-k278g9kj.js";import"./vm-hands-entry-lite-gvwdy3rf.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";export{r as LocalCapabilityError,xo as SHORT_REQUEST_CAPABILITIES,rs as capabilityInventoryForRoots,vi as confinedExecutionShell,ko as defaultLocalCommandRunner,ns as deliverLocalHandsEnvironment,Po as enrolledRootPaths,os as executeLocalOperation,ts as grantLocalHandsWorkspaceControl,es as openHandsWorkspaceGrant,is as rebindLocalHandsControl,Co as runFileCapability,Ao as runTransferCapability,en as spawnCaptured};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{gt,Us,Hs,gi,_i}from"./vm-hands-entry-lite-gvwdy3rf.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";export{Us as forgetLocalDesktopUse,_i as holdLocalDesktop,gt as noteLocalDesktopUse,Hs as releaseLocalDesktop,gi as trackDesktopRun};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{At,us,V,Be,Pt}from"./vm-hands-entry-lite-ewwx4fr3.js";import"./vm-hands-entry-lite-1rtkf2xm.js";import"./vm-hands-entry-lite-q0k6kx6d.js";import"./vm-hands-entry-lite-bdhjpv7g.js";import"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-f5e3dbgk.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-2wgdvb15.js";import"./vm-hands-entry-lite-eqgj4acy.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-gvwdy3rf.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";export{Be as ensureLinuxDesktop,At as localDisplayAvailable,us as localDisplayReady,V as privateDirectory,Pt as runLocalDisplayStream};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{wr,Tt,br,Ro,_n,vr,yn}from"./vm-hands-entry-lite-1rtkf2xm.js";import"./vm-hands-entry-lite-q0k6kx6d.js";import"./vm-hands-entry-lite-bdhjpv7g.js";import"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";export{Tt as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,br as LOCAL_PTY_MAX_SESSIONS,wr as LOCAL_PTY_MAX_SESSION_MS,vr as defaultConnect,Ro as defaultLoginShell,_n as ptyRuntimeSupported,yn as runLocalPtySession};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Go,Ko,Jo,Zo,Xo,Yo,Qo}from"./vm-hands-entry-lite-kq0qmsw8.js";import"./vm-hands-entry-lite-09m2cdkw.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";export{Xo as acquireManagedRuntimeDirectoryLock,Jo as currentManagedRuntimeVersion,Qo as flushManagedRuntimeLifecycleEvents,Zo as isManagedRuntimeVersionExecutable,Ko as legacyManagedRuntimePaths,Go as managedRuntimePaths,Yo as recordManagedRuntimeLifecycle};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ge,Ce,vs,Ss,Es,Bn,xs,Vr,Fn,dt,Ae,pt,jn,Un,Hn,qn,zn,Wn,Vn,Gn,Kn,Jn,Zn,Xn,Yn,Qn,ei,ti,pe,X,Pe,q,ri,ni,ii,Y,oi,si,ai,ci,li,ht,ui,ks,Gt,di,Cs,No,As,Ps,Ts,Rs,Os,Is,Ds,Ns,Ls,Ms,$s,Bs,Fs,js}from"./vm-hands-entry-lite-k278g9kj.js";export{ui as AUTOMATION_CLOUD_SESSIONS,ht as AUTOMATION_USER_CHROME,Zn as HANDS_CLOUD_ACCESS,Xn as HANDS_CLOUD_ACCESS_KEY,pe as HANDS_CONFINEMENT,X as HANDS_CONFINEMENT_KEY,Un as HANDS_ENVIRONMENT_AT_CLAIM,Hn as HANDS_ENVIRONMENT_AT_CLAIM_KEY,Fn as HANDS_ENVIRONMENT_DELIVERY,dt as HANDS_ENVIRONMENT_DELIVER_CONTROL,Yn as HANDS_HEADLESS_BROWSER,Qn as HANDS_HEADLESS_BROWSER_KEY,ri as HANDS_JOBS_USER,ni as HANDS_JOBS_USER_KEY,ei as HANDS_LARGE_ENVIRONMENT,ti as HANDS_LARGE_ENVIRONMENT_KEY,Pe as HANDS_MODEL_JOBS_EGRESS,q as HANDS_MODEL_JOBS_EGRESS_KEY,Wn as HANDS_REBIND,Jn as HANDS_REBIND_CONTROL,Kn as HANDS_REBIND_KEY,oi as HANDS_SESSION_CAP_KEY,si as HANDS_SESSION_CAP_NONE,ii as HANDS_SESSION_GROUP,Y as HANDS_SESSION_GROUP_KEY,qn as HANDS_WORKSPACE_CHECK,zn as HANDS_WORKSPACE_CHECK_KEY,Vn as HANDS_WORKSPACE_GRANT,Gn as HANDS_WORKSPACE_GRANT_KEY,ci as JOBS_START_WAIT,li as JOBS_START_WAIT_KEY,Ce as LOCAL_OPERATION_MAX_BYTES,Ge as LOCAL_RUNTIME_PROTOCOL_VERSION,Es as LOCAL_RUNTIME_ROUTES,Vr as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,Bn as LOCAL_RUNTIME_SESSION_PATH,Gt as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,vs as RELAY_HOST_ALIAS_HEADER,Ss as RELAY_HOST_ALIAS_VERSION,jn as VM_HANDS_UNBIND_UNVERIFIED_EVENT,Ae as VM_HANDS_WORKSPACE_DEFERRED_KEY,pt as VM_HANDS_WORKSPACE_GRANT_CONTROL,ai as WORKER_PREVIEW_CARRIED_JOBS,ks as WORKER_STARTUP_TIMING_STAGES,di as buildLocalRuntimeDeviceProofBytes,xs as localRuntimeSessionRoutable,Ds as parseLocalRuntimeDisconnectResponse,Ps as parseLocalRuntimeEnrollmentResponse,Cs as parseLocalRuntimeErrorEnvelope,Rs as parseLocalRuntimeFirstHeartbeat,Ts as parseLocalRuntimeHeartbeatResponse,Is as parseLocalRuntimeIdentityResponse,Ls as parseLocalRuntimeLifecycleResponse,Ns as parseLocalRuntimeLocalSubscriptionResponse,Ms as parseLocalRuntimeOperationClaim,js as parseLocalRuntimeOperationCompletionResponse,Fs as parseLocalRuntimeOperationEnvironmentResponse,Bs as parseLocalRuntimeOperationEventsResponse,$s as parseLocalRuntimeOperationHeartbeatResponse,No as parseLocalRuntimeProofChallenge,As as parseLocalRuntimeRegistrationResponse,Os as parseLocalRuntimeRootsSyncResponse};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Io,Do,ys,bs}from"./vm-hands-entry-lite-2wgdvb15.js";import"./vm-hands-entry-lite-eqgj4acy.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";export{bs as allowMacPermissions,ys as permissionsSummary,Do as readMacPermissions,Io as reasonIdentity};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{k,kr,Cr,wn,tt,bn,Ar,je,ye,vn,Ue,Nt,te,He,Sn,we,Lt,Pr,Mt,Tr,En,ae,U,N,ce,Rr,Or,xn}from"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-8t9xssf9.js";export{Tr as REASON_HANDS_CLOSE_CODES,Ue as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,Ar as REASON_HANDS_JOB_MAX_INPUT_CHARS,je as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,ye as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,vn as REASON_HANDS_JOB_MAX_RECORDS,bn as REASON_HANDS_MAX_ERROR_CHARS,kr as REASON_HANDS_MAX_FRAME_BYTES,Cr as REASON_HANDS_MAX_INPUT_CHARS,tt as REASON_HANDS_MAX_OUTPUT_CHARS,wn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,k as REASON_HANDS_PROTOCOL_VERSION,Pr as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Mt as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,Lt as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,we as REASON_HANDS_PTY_MAX_DIMENSION,te as REASON_HANDS_PTY_MAX_INPUT_BYTES,He as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Sn as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Nt as REASON_HANDS_PTY_PROTOCOL_VERSION,En as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,U as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,N as isReasonHandsUuid,Rr as parseReasonHandsJobRequest,Or as parseReasonHandsJobResult,xn as parseReasonHandsPtyReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ir,be,K,Cn,ps,Wi,hs,qe,Oo,An,fs,ms,Dr,gs,_s}from"./vm-hands-entry-lite-cc2tgsqp.js";import"./vm-hands-entry-lite-qysyf65v.js";import"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-t7an5zg2.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-89z488gz.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-9ay6f56v.js";import"./vm-hands-entry-lite-m11j0f9q.js";export{Ir as WORKER_SERVICE_ENV,K as WorkerServiceError,Wi as connectServiceLabel,be as defaultWorkerServiceHost,ms as installWorkerService,qe as installedWorkerService,hs as isConnectServiceLabel,_s as removeWorkerService,Dr as restartWorkerService,gs as retargetWorkerServiceLogs,Oo as retireLegacyWorkerService,fs as workerServiceDefinitionCurrent,Cn as workerServiceLauncher,An as workerServiceProcessRunning,ps as workerServiceRetargetPending};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./vm-hands-entry-lite-zg36myyf.js";import"./vm-hands-entry-lite-t7an5zg2.js";import{g}from"./vm-hands-entry-lite-ckv17tn8.js";import"./vm-hands-entry-lite-8t9xssf9.js";import"./vm-hands-entry-lite-m11j0f9q.js";import"./vm-hands-entry-lite-1cwqa4jr.js";import{Ot,et}from"./vm-hands-entry-lite-q0k6kx6d.js";import{w,M,Xt,De,Ke}from"./vm-hands-entry-lite-grtycq6y.js";import"./vm-hands-entry-lite-k278g9kj.js";import"./vm-hands-entry-lite-2wvsyggd.js";import"./vm-hands-entry-lite-463m6ejk.js";import"./vm-hands-entry-lite-rwxbhwky.js";import"./vm-hands-entry-lite-88swf2qr.js";import"./vm-hands-entry-lite-b885gwfh.js";import"./vm-hands-entry-lite-vrqzr15t.js";import"./vm-hands-entry-lite-ewwx4fr3.js";import"./vm-hands-entry-lite-eqgj4acy.js";import"./vm-hands-entry-lite-2hvbgp1n.js";import"./vm-hands-entry-lite-2wgdvb15.js";import"./vm-hands-entry-lite-f5e3dbgk.js";import"./vm-hands-entry-lite-kq0qmsw8.js";import"./vm-hands-entry-lite-qysyf65v.js";import"./vm-hands-entry-lite-cc2tgsqp.js";import"./vm-hands-entry-lite-ab2m9erf.js";import"./vm-hands-entry-lite-22kfyvnk.js";import"./vm-hands-entry-lite-9c95p6n9.js";import"./vm-hands-entry-lite-bdhjpv7g.js";import"./vm-hands-entry-lite-gvwdy3rf.js";import"./vm-hands-entry-lite-1rtkf2xm.js";import"./vm-hands-entry-lite-qxchbbew.js";import"./vm-hands-entry-lite-09m2cdkw.js";import{a}from"./vm-hands-entry-lite-89z488gz.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-907pa7f9.js";import"./vm-hands-entry-lite-9ay6f56v.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 h(e){return`claude mcp add --transport http reason ${e}`}function C(e){return`codex mcp add reason --url ${e}
|
|
3
|
-
codex mcp login reason`}var F=h("https://mcp.reasonmachines.com/mcp"),z=C("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
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
reason mcp Show how to connect Claude Code, Codex, or another MCP client
|
|
7
|
-
reason mcp uninstall Remove only this machine's registrations of the earlier, retired server
|
|
8
|
-
|
|
9
|
-
Plugins for Claude Code and Codex: ${b}
|
|
10
|
-
`;var P=s(["granted","not_granted","unknown"]),y=i({status:P,checkedAt:o().finite(),executablePath:t().min(1)});var Oe=i({version:n(1),key:t(),at:o(),self:i({principal_type:t(),user_id:t().optional(),user_name:t().nullish(),email:t().nullish(),org_id:t(),organization_name:t().nullish(),organization_slug:t().nullish(),mcp_connections:u(i({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})});var x=30000;function L(e,c=Date.now(),R=null){let r=et(e),d=(()=>{if(r?.state!=="connected"&&r?.state!=="starting")return!1;try{return process.kill(r.pid,0),!0}catch{return!1}})(),S=d&&r?.state==="connected",p=(f)=>S&&c-f>=0&&c-f<x,l=y.safeParse(r?.fullDiskAccess),m=Ot(r,R,c);return{...m?{permission_recovery:m}:{},full_disk_access:l.success&&p(l.data.checkedAt)?l.data.status:"unknown",keep_awake:{enabled:Xt(e)==="battery_and_ac",holding:r?.idleSleepHold===!0&&p(Date.parse(r.lastHeartbeatAt??""))},executable:d&&l.success?l.data.executablePath:null}}function Ne(e=g()){if(process.platform!=="darwin")return null;let c=De(I(Ke(k(a()),e),"worker.json"));return c?L(w(c).daemon,Date.now(),M(c)):null}export{Ne as connectionMacState};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I}from"./vm-hands-entry-lite-9ay6f56v.js";import{randomUUID as m}from"crypto";import{closeSync as k,constants as c,fstatSync as u,lstatSync as s,mkdirSync as l,openSync as E,readFileSync as S,realpathSync as a,renameSync as g,unlinkSync as p,writeFileSync as v}from"fs";import{dirname as w,resolve as _}from"path";var d=65536;function f(r){try{return s(r),!0}catch(o){if(o instanceof Error&&"code"in o&&o.code==="ENOENT")return!1;throw o}}function b(r,o=!1){if(!f(r)){if(!o)throw Error("worker_state_missing");y(r),l(r,{mode:448})}let e=s(r);if(!e.isDirectory()||e.isSymbolicLink()||!I(e)||a(r)!==_(r))throw Error("worker_state_directory_not_private_or_canonical")}function y(r){let o=w(r);if(!f(o))y(o),l(o,{mode:448});if(a(o)!==_(o))throw Error("worker_parent_not_canonical")}function h(r,o=d){let e=E(r,c.O_RDONLY|c.O_NOFOLLOW);try{let n=u(e);if(!n.isFile()||n.nlink!==1||!I(n)||n.size>o)throw Error("worker_file_not_private");return S(e,"utf8")}finally{k(e)}}function Bi(r,o,e=d){let n=JSON.stringify(o);if(n===void 0)throw Error("worker_file_invalid");let t=n+`
|
|
3
|
-
`;if(Buffer.byteLength(t,"utf8")>e)throw Error("worker_file_too_large");if(b(w(r)),f(r))h(r,e);let i=`${r}.${m()}`;try{v(i,t,{mode:384,flag:"wx"}),g(i,r)}finally{if(f(i))p(i)}}
|
|
4
|
-
export{f,b,h,Bi};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var l=Object.create;var{getPrototypeOf:m,defineProperty:h,getOwnPropertyNames:n}=Object;var k=Object.prototype.hasOwnProperty;function o(a){return this[a]}var p,q,mi=(a,b,c)=>{var d=a!=null&&typeof a==="object";if(d){var i=b?p??=new WeakMap:q??=new WeakMap,j=i.get(a);if(j)return j}c=a!=null?l(m(a)):{};let f=b||!a||!a.__esModule||!k.call(a,"default")?h(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let g of n(a))if(!k.call(f,g))h(f,g,{get:o.bind(a,g),enumerable:!0})}if(d)i.set(a,f);return f};var he=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var r=(a)=>a;function s(a,b){this[a]=r.bind(null,b)}var Bo=(a,b)=>{for(var c in b)h(a,c,{get:b[c],enumerable:!0,configurable:!0,set:s.bind(b,c)})};var Fo=(a,b,c)=>()=>{if(a)try{b=a(a=0)}catch(d){c=[d]}if(c)throw c[0];return b};var e=import.meta.require;
|
|
3
|
-
export{mi,he,Bo,Fo,e};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{_t,R}from"./vm-hands-entry-lite-zg36myyf.js";import{C}from"./vm-hands-entry-lite-t7an5zg2.js";import{g,$t}from"./vm-hands-entry-lite-ckv17tn8.js";import{_e}from"./vm-hands-entry-lite-pmcz7j7t.js";function yi(e,i){let r=C(e,"REASON_API_URL")?.trim();if(!r)return $t(i);let t=new URL(r);if(t.protocol!=="https:"&&!(t.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(t.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return t.origin}function l(e){return C(e,"REASON_API_URL")?.trim()?yi(e,"production"):void 0}function vo(e){return C(e,"REASON_API_KEY")?.trim()||void 0}async function So(e,i){let r=e.env??process.env,t=vo(r);if(!t)return(e.getCredentials??_t)({apiOrigin:l(r),signal:i});let a=yi(r,e.channel??g({env:r})),o=await(e.fetchImpl??fetch)(a+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+t,accept:"application/json"},signal:i}),p=await o.json().catch(()=>({})),n=_e(p)?p:{};if(!o.ok){let s=typeof n.detail==="string"?n.detail:typeof n.message==="string"?n.message:"API key authentication failed ("+o.status+")";throw new R(o.status,typeof n.error==="string"?n.error:"api_key_auth_failed",s)}if(typeof n.org_id!=="string"||!n.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let c=Array.isArray(n.scopes)?n.scopes.filter((s)=>typeof s==="string"):[];return{credentialKind:"api_key",apiOrigin:a,accessToken:t,orgId:n.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:c}}async function Wo(e){let i=await So(e),r=l(e.env??process.env);if(!i)throw Error(r?`Not signed in to ${r}. Set REASON_API_KEY, or run \`reason login --api-url ${r}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return i}
|
|
3
|
-
export{yi,vo,So,Wo};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var i="libara_device_keychain.dylib",e="libreason_device_keychain.dylib";class rt extends Error{code;constructor(n,t){super(t);this.code=n;this.name="ManagedRuntimeError"}}import{existsSync as s}from"fs";import{join as a}from"path";function Vi(n){let t=a(n,e);return s(t)?t:a(n,i)}
|
|
3
|
-
export{rt,Vi};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{H}from"./vm-hands-entry-lite-8t9xssf9.js";import{tt}from"./vm-hands-entry-lite-22kfyvnk.js";import{Dt}from"./vm-hands-entry-lite-bdhjpv7g.js";import{j}from"./vm-hands-entry-lite-q0k6kx6d.js";import{ne}from"./vm-hands-entry-lite-89z488gz.js";import{Ie}from"./vm-hands-entry-lite-8ns59paz.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{existsSync as D,realpathSync as q,statSync as K}from"fs";import{platform as h}from"os";import{isAbsolute as z,sep as G}from"path";import{existsSync as X}from"fs";import{createRequire as Y}from"module";var k=Ie(Dt)(()=>Y(import.meta.url)("bun:ffi"),X);function E(){return process.platform==="win32"&&typeof globalThis.Bun<"u"&&k.available()}function C(e=process.env){return k.defaultShell(e)}function M(e){return k.shellArgs(e)}function N(e){let n=k.spawn({...e,env:e.environment});return n.exited.then(()=>n.close()),{write:(o)=>n.write(o),resize:(o,t)=>n.resize(o,t),kill:()=>n.close(),exited:n.exited}}var wr=43200000,Tt=tt,br=4,Q=/^[A-Za-z0-9._:-]{1,160}$/,V=1000;function I(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function P(e,n){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)return n;return Math.min(V,Math.max(1,Math.floor(e)))}function Z(e,n=Date.now()){let o=["relay_url","session_id","expires_at"],t=new Set([...o,"cols","rows","cwd","workspace"]);if(!I(e)||o.some((b)=>!(b in e))||Object.keys(e).some((b)=>!t.has(b)))throw new r("invalid_pty_request","Reason terminal request is malformed.");let{relay_url:c,session_id:m,expires_at:g}=e;if(typeof c!=="string")throw new r("invalid_pty_request","Reason terminal relay URL is missing.");let d;try{d=new URL(c)}catch{throw new r("invalid_pty_request","Reason terminal relay URL is invalid.")}if(d.protocol!=="wss:"&&d.protocol!=="ws:"||d.username||d.password)throw new r("invalid_pty_request","Reason terminal relay URL is invalid.");if(typeof m!=="string"||!Q.test(m))throw new r("invalid_pty_request","Reason terminal session identity is invalid.");let p=typeof g==="string"?Date.parse(g):Number.NaN;if(!Number.isFinite(p)||p<=n)throw new r("invalid_pty_request","Reason terminal session has already expired.");if(e.cwd!==void 0&&typeof e.cwd!=="string")throw new r("invalid_pty_request","Reason terminal working directory is invalid.");let a=e.workspace===void 0?void 0:H(e.workspace);if(a===null||a&&e.cwd!==void 0)throw new r("invalid_pty_request","Reason terminal workspace is invalid.");return{relay_url:c,session_id:m,expires_at:new Date(Math.min(p,n+wr)).toISOString(),cols:P(e.cols,80),rows:P(e.rows,24),...e.cwd===void 0?{}:{cwd:e.cwd},...a?{workspace:a}:{}}}function ee(e,n){if(h()==="win32")[e,n]=[e.toLowerCase(),n.toLowerCase()];return n===e||n.startsWith(e+G)}function W(e,n){if(n===void 0)return e;if(!z(n))throw new r("pty_cwd_invalid","Reason terminal working directory must be absolute.");let o;try{o=q(n)}catch{throw new r("pty_cwd_invalid","Reason terminal working directory does not exist.")}if(!ee(e,o))throw new r("pty_cwd_outside_root","Reason terminal working directory escapes the granted root.");if(!K(o).isDirectory())throw new r("pty_cwd_invalid","Reason terminal working directory is not a directory.");return o}function Ro(e=process.env){if(h()==="win32")return C(e);let n=e.SHELL;if(n&&z(n)&&D(n))return n;for(let o of h()==="darwin"?["/bin/zsh","/bin/bash","/bin/sh"]:["/bin/bash","/bin/sh"])if(D(o))return o;return"/bin/sh"}function re(){let e=globalThis.Bun;if(!e)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");return e.spawn}function _n(){if(h()==="win32")return E();return typeof globalThis.Bun<"u"}var te=(e)=>{if(h()==="win32")try{return N({...e,file:e.shell,args:M(e.shell),environment:{...e.environment,TERM:"xterm-256color"}})}catch{throw new r("pty_unavailable","Reason could not allocate a pseudo-terminal.")}let n=re()({cmd:[e.shell,"-i","-l"],cwd:e.cwd,env:{...e.environment,TERM:"xterm-256color"},terminal:{cols:e.cols,rows:e.rows,data:(t,c)=>{e.onData(c)}}}),o=n.terminal;if(!o){try{n.kill()}catch{}throw new r("pty_unavailable","Reason could not allocate a pseudo-terminal.")}return{write:(t)=>o.write(t),resize:(t,c)=>o.resize(t,c),kill:()=>{try{n.kill()}catch{}},exited:n.exited.then((t)=>typeof t==="number"?t:null,()=>null)}},vr=(e,n)=>n===void 0?new WebSocket(e):new WebSocket(e,{proxy:n}),v=new Set;function oe(e){if(v.size>=br||v.has(e))return null;v.add(e);let n=!1;return()=>{if(n)return;n=!0,v.delete(e)}}async function yn(e,n={}){let o=n.now??Date.now,t=Z(e.payload,o()),c=oe(e.operationId);if(!c)throw new r("pty_slot_busy","This Reason Device already runs the maximum number of terminals.");let m=o(),g,d,p;try{let a=t.workspace?ne(e.root,t.workspace):void 0;g=a?W(D(a.boundary)?q(a.boundary):a.boundary,a.path):W(e.root,t.cwd),d=n.environment??process.env,p=n.shellPath??Ro(d)}catch(a){throw c(),a}return await new Promise((a,b)=>{let w=null,i=null,S=!1,x=!1,y=!1,T=null,U=0,B=0,O=[],R=0,A=null,l=(s)=>{if(y)return;if(y=!0,A)clearTimeout(A);e.signal.removeEventListener("abort",L);try{w?.kill()}catch{}try{i?.close(1000,"pty_session_over")}catch{}if(c(),s.kind==="rejected"){b(s.error);return}let u={reason:s.reason,exit_code:T,output_bytes:U,input_bytes:B,duration_ms:Math.max(0,o()-m)};e.emitEvent("pty.stopped",{...u}).catch(()=>{return}),a({...u})},L=()=>{let s=e.signal.reason;l({kind:"rejected",error:s instanceof r?s:new r("cancelled","Reason closed the terminal session.")})};if(e.signal.aborted){L();return}e.signal.addEventListener("abort",L,{once:!0}),A=setTimeout(()=>l({kind:"resolved",reason:"session_expired"}),Math.max(1,Date.parse(t.expires_at)-o()));let F=(s)=>{if(U+=s.byteLength,!S||!i){if(O.push(s),R+=s.byteLength,R>Tt)l({kind:"resolved",reason:"output_backpressure"});return}try{i.send(s)}catch{l({kind:"resolved",reason:"relay_closed"});return}if(i.bufferedAmount>Tt)l({kind:"resolved",reason:"output_backpressure"})};try{w=(n.spawnPty??te)({shell:p,args:["-i","-l"],cwd:g,cols:t.cols,rows:t.rows,environment:d,onData:(s)=>{if(!y)F(s)}})}catch(s){l({kind:"rejected",error:s instanceof r?s:new r("pty_spawn_failed","Reason could not start the terminal shell.")});return}w.exited.then((s)=>{if(y)return;if(T=s,S&&i)try{i.send(JSON.stringify({t:"exit",code:s}))}catch{}l({kind:"resolved",reason:"shell_exited"})});let J=(n.loadProxy??j)()?.url;try{i=(n.connect??vr)(t.relay_url,J)}catch{l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}i.binaryType="arraybuffer",i.onopen=()=>{if(y||!i)return;S=!0;try{i.send(JSON.stringify({t:"open",cols:t.cols,rows:t.rows}));for(let s of O.splice(0))i.send(s);R=0}catch{l({kind:"resolved",reason:"relay_closed"});return}x=!0,e.emitEvent("pty.ready",{session_id:t.session_id,cols:t.cols,rows:t.rows}).catch(()=>{return})},i.onmessage=(s)=>{if(y||!w)return;let u=s.data;if(typeof u==="string"){let f;try{f=JSON.parse(u)}catch{return}if(!I(f))return;if(f.t==="resize"){try{w.resize(P(f.cols,t.cols),P(f.rows,t.rows))}catch{}return}if(f.t==="close")l({kind:"resolved",reason:"client_closed"});return}let _=u instanceof ArrayBuffer?new Uint8Array(u):ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):null;if(!_||_.byteLength===0)return;B+=_.byteLength;try{w.write(_)}catch{}},i.onclose=()=>{if(y)return;if(!x){l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}l({kind:"resolved",reason:"relay_closed"})},i.onerror=()=>{if(y||x)return;l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")})}})}
|
|
3
|
-
export{wr,Tt,br,Ro,_n,vr,yn};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{H}from"./vm-hands-entry-lite-8t9xssf9.js";var Hi=32;var qi="__ARA_PI_TOOL_CONFINED_SCRIPT_5f0c9e2a__",zi=262144;var k=2,kr=33554432,Cr=200000,wn=4000000,tt=240000;var bn=2000;var Ar=16384,je=32768,ye=128,vn=64,Ue=2097152,Nt=1,te=16384,He=32768,Sn=8388608,we=1000,Lt=2500,Pr=2000,Mt=Lt+Pr,R=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/,y=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Tr={text_only:4430,invalid_json:4431,invalid_cancel_request:4432,invalid_sdk_response:4433,claim_required:4434,invalid_claim:4435,executor_mismatch:4436,stale_generation:4437,fence_conflict:4438,frame_too_large:4439,result_too_large:4440,progress_too_large:4441,terminal_cleanup_started:4442,job_journal_unavailable:4443},I=new Map(Object.entries(Tr).map(([t,n])=>[n,t]));var h=["cancelled","command_failed","duplicate_request_id","duplicate_result_evicted","invalid_repl_response","invalid_request","process_group_cleanup_unconfirmed","repl_failed","result_too_large","repl_response_too_large","repl_transport_failed","request_ledger_full","request_journal_unavailable","request_outcome_uncertain","maintenance_held","request_not_found","resume_digest_mismatch","spawn_failed","stale_generation","timeout"],E=new Set(h),En=16384;var S=["maintenance_held","invalid_job_request","jobs_disabled","job_not_found","job_conflict","job_capacity","job_journal_unavailable","job_not_running","job_lease_expired","job_input_sequence","job_input_backpressure","stale_generation","pty_unsupported","job_mode_mismatch"];class o extends Error{code;constructor(t){super(t);this.name="HandsProtocolError",this.code=t}}function m(t){return new TextEncoder().encode(t).byteLength}function a(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function s(t,n){let e=new Set(n);return Object.keys(t).every((i)=>e.has(i))}function ae(t){return typeof t==="string"&&R.test(t)}function U(t){return Number.isSafeInteger(t)&&Number(t)>=1}function N(t){return typeof t==="string"&&y.test(t)}function ce(t){return typeof t==="string"&&t.startsWith("pty-")&&N(t.slice(4))}function p(t){return[t.cols,t.rows].every((n)=>Number.isSafeInteger(n)&&Number(n)>=1&&Number(n)<=we)}function _(t){if(typeof t!=="string"||t.length>Math.ceil(te/3)*4||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return-1;let n=t.endsWith("==")?2:t.endsWith("=")?1:0;if(n&&"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[t.length-n-1])&(n===2?15:3))return-1;let i=t.length/4*3-n;return i<=te?i:-1}function l(t){if(m(t)>kr)throw new o("frame_too_large");try{return JSON.parse(t)}catch{throw new o("invalid_json")}}function Rr(t){let n=l(t);if(!a(n)||!s(n,["type","version","generation","id","jobId","action","input"])||n.type!=="job"||n.version!==k||!U(n.generation)||!ae(n.id)||!ae(n.jobId)||!a(n.input))throw new o("invalid_job_request");let e=n.input,i=Number.isSafeInteger(e.leaseExpiresAtMs)&&Number(e.leaseExpiresAtMs)>0,d=Number.isSafeInteger(e.sequence)&&Number(e.sequence)>=1;if(!(n.action==="start"?e.mode==="pty"?s(e,["mode","cols","rows","leaseExpiresAtMs"])&&ce(n.jobId)&&p(e)&&i:s(e,["script","leaseExpiresAtMs"])&&typeof e.script==="string"&&e.script.length<=Cr&&i:n.action==="inspect"?s(e,["after"])&&Number.isSafeInteger(e.after)&&Number(e.after)>=0:n.action==="input"?"dataBase64"in e?s(e,["sequence","dataBase64"])&&ce(n.jobId)&&d&&_(e.dataBase64)>0:s(e,["sequence","data","eof"])&&d&&typeof e.data==="string"&&e.data.length<=Ar&&typeof e.eof==="boolean":n.action==="resize"?s(e,["sequence","cols","rows"])&&ce(n.jobId)&&d&&p(e):n.action==="renew"?s(e,["leaseExpiresAtMs"])&&i:n.action==="cancel"&&s(e,[])))throw new o("invalid_job_request");return n}function Or(t){let n=l(t);if(!a(n)||!s(n,["type","version","generation","id","ok","job","error"])||n.type!=="job_result"||n.version!==k||!U(n.generation)||!ae(n.id))throw new o("invalid_job_result");if(n.ok===!1&&n.job===void 0&&typeof n.error==="string"&&S.some((r)=>r===n.error))return n;let e=n.job;if(n.ok!==!0||n.error!==void 0||!a(e)||!s(e,["jobId","state","startedAtMs","finishedAtMs","leaseExpiresAtMs","exitCode","inputSequence","output","firstCursor","nextCursor","truncated","process","environmentRevision","environmentSnapshotId","pty"])||!ae(e.jobId)||!["starting","running","exited","cancelled","expired","uncertain"].includes(String(e.state))||!Number.isSafeInteger(e.startedAtMs)||Number(e.startedAtMs)<1||!Number.isSafeInteger(e.leaseExpiresAtMs)||Number(e.leaseExpiresAtMs)<1||e.finishedAtMs!==null&&(!Number.isSafeInteger(e.finishedAtMs)||Number(e.finishedAtMs)<Number(e.startedAtMs))||e.exitCode!==null&&(!Number.isSafeInteger(e.exitCode)||Number(e.exitCode)<0||Number(e.exitCode)>255)||!Number.isSafeInteger(e.inputSequence)||Number(e.inputSequence)<0||!Number.isSafeInteger(e.firstCursor)||Number(e.firstCursor)<1||!Number.isSafeInteger(e.nextCursor)||Number(e.nextCursor)<Number(e.firstCursor)-1||typeof e.truncated!=="boolean"||!Array.isArray(e.output)||e.output.length>ye)throw new o("invalid_job_result");if(e.environmentRevision===void 0!==(e.environmentSnapshotId===void 0)||e.environmentRevision!==void 0&&(!Number.isSafeInteger(e.environmentRevision)||Number(e.environmentRevision)<1||!N(e.environmentSnapshotId)))throw new o("invalid_job_result");let i=Number(e.firstCursor)-1,d=0;for(let r of e.output){if(!a(r)||!s(r,["cursor","stream","text"])||!Number.isSafeInteger(r.cursor)||Number(r.cursor)<=i||Number(r.cursor)>Number(e.nextCursor)||!["stdout","stderr"].includes(String(r.stream))||typeof r.text!=="string")throw new o("invalid_job_result");d+=r.text.length,i=Number(r.cursor)}if(d>je)throw new o("invalid_job_result");let c=e.state==="starting"||e.state==="running";if(c&&(e.finishedAtMs!==null||e.exitCode!==null)||!c&&e.finishedAtMs===null||e.state==="uncertain"&&e.exitCode!==null||e.state==="exited"&&e.exitCode===null||e.state==="cancelled"&&e.exitCode!==130||e.state==="expired"&&e.exitCode!==124)throw new o("invalid_job_result");if(e.process!==void 0){let r=e.process;if(!a(r)||!s(r,["pid","processGroupId","executorLaunchId"])||!Number.isSafeInteger(r.pid)||Number(r.pid)<1||r.processGroupId!==r.pid||!N(r.executorLaunchId)||!["starting","running"].includes(String(e.state)))throw new o("invalid_job_result")}if(e.pty!==void 0){let r=e.pty;if(!a(r)||!s(r,["version","cols","rows","output","cleanup"])||r.version!==Nt||!ce(e.jobId)||!p(r)||e.output.length!==0||!Array.isArray(r.output)||r.output.length>ye||(c?r.cleanup!=="pending":e.state==="uncertain"?r.cleanup!=="unconfirmed":r.cleanup!=="confirmed")||e.state==="running"&&(e.process===void 0||e.environmentRevision===void 0))throw new o("invalid_job_result");let g=Number(e.firstCursor)-1,b=0;for(let u of r.output){if(!a(u)||!s(u,["cursor","dataBase64"])||!Number.isSafeInteger(u.cursor)||Number(u.cursor)<=g||Number(u.cursor)>Number(e.nextCursor))throw new o("invalid_job_result");let f=_(u.dataBase64);if(f<=0||(b+=f)>He)throw new o("invalid_job_result");g=Number(u.cursor)}}return n}function xn(t){if(m(t)>Ue)throw new o("frame_too_large");let n=l(t);if(!a(n)||!s(n,["version","sessionId","operationId","runId","deviceId","rootId","workspace","binding","targetRevision","rootGrantRevision","generation","fenceId","executorLaunchId","job"])||n.version!==Nt||![n.sessionId,n.operationId,n.runId].every(ae)||![n.deviceId,n.rootId,n.fenceId,n.executorLaunchId].every(N)||!U(n.generation)||!Number.isSafeInteger(n.rootGrantRevision)||Number(n.rootGrantRevision)<1||!["workspace_source","mcp_control"].includes(String(n.binding))||!Number.isSafeInteger(n.targetRevision)||Number(n.targetRevision)<0||n.binding==="workspace_source"&&n.targetRevision!==0||!a(n.workspace))throw new o("invalid_pty_receipt");if(!H(n.workspace))throw new o("invalid_pty_receipt");let e=Or(JSON.stringify({type:"job_result",version:k,generation:n.generation,id:n.operationId,ok:!0,job:n.job}));if(!e.ok||!e.job.pty||e.job.pty.output.length!==0||e.job.process&&e.job.process.executorLaunchId!==n.executorLaunchId)throw new o("invalid_pty_receipt");return n}export{Hi,qi,zi,k,kr,Cr,wn,tt,bn,Ar,je,ye,vn,Ue,Nt,te,He,Sn,we,Lt,Pr,Mt,Tr,En,ae,U,N,ce,Rr,Or,xn};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ct}from"./vm-hands-entry-lite-rwxbhwky.js";import{a}from"./vm-hands-entry-lite-89z488gz.js";import{randomUUID as L}from"crypto";import{spawnSync as b}from"child_process";import{chmodSync as ee,cpSync as te,existsSync as x,lstatSync as A,mkdirSync as Y,readdirSync as ne,readFileSync as w,readlinkSync as re,realpathSync as T,renameSync as E,rmdirSync as ie,rmSync as g,symlinkSync as M,writeFileSync as oe}from"fs";import{dirname as I,join as u,relative as se,resolve as ce}from"path";var Ln="so.ara.cli",k=[Ln,"com.reasonmachines.cli"],F="5LJFSBRY2F";function jr(e){return`(${e.map((t)=>`identifier "${t}"`).join(" or ")}) and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists and certificate leaf[subject.OU] = "${F}"`}var G="ReasonBackgroundIdentity",so="Contents/Helpers/ReasonPermissionTile",ae="so.ara.cli.permission-tile",Ne=jr([ae,"com.reasonmachines.cli.permission-tile"]),v="AraBackgroundIdentity",ue="Reason",Ce=jr(k),de=`anchor apple generic and (${k.map((e)=>`identifier "${e}"`).join(" or ")}) and certificate leaf[subject.OU] = "${F}"`;class h extends Error{code;constructor(e,t){super(t);this.code=e;this.name="MacOSBackgroundIdentityError"}}var R="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function le(e=a()){return u(e,"Library","Application Support","Reason","Background","Reason.app")}function O(e=a()){return u(e,"Library","Application Support","Ara","Background","Ara.app")}function fe(e){try{return A(e).isFile()}catch{return!1}}function D(e){return[G,v].map((t)=>u(e,"Contents","MacOS",t)).find(fe)??null}function d(e){try{if(!A(e).isDirectory())return!1;let t=w(u(e,"Contents","Info.plist"),"utf8");return k.some((n)=>t.includes(`<string>${n}</string>`))&&(t.includes(`<string>${ue}</string>`)||t.includes("<string>Ara</string>"))&&D(e)!==null}catch{return!1}}function Ur(e=a()){let t=le(e);if(!d(t))return null;try{let n=w(u(t,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(n)?.[1]??null}catch{return null}}function pe(e,t=a()){let n=Ur(t);return n===null||j(N(n.split(".")),N(e.split(/[.-]/).slice(0,3)))}var ge=1e4;function K(e,t){return b(e,[...t],{stdio:"ignore",timeout:ge}).status??1}var W=new Set;function H(e){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let t=(n)=>{try{return T(n)}catch{return ce(n)}};if(e!==void 0&&t(e)!==t(a()))return;throw Error("A test tried to change this computer's real Reason background identity; pass a temporary home. Refused by scripts/test-env.ts.")}var V=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.(?:ara|reason)(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,J=new Set(["ara","ara.exe","reason","reason.exe"]);function N(e){return e.map((t)=>Number(t))}function j(e,t){for(let n=0;n<3;n+=1)if(e[n]!==t[n])return e[n]<t[n];return!1}var ye=[0,2,161];function me(e){if(e===null)return!0;let t=ye,n=null;try{n=T(process.execPath)}catch{}return e.some((r)=>{let i=V.exec(r);if(i){let f=i[1]===void 0?i.slice(4,7):i.slice(1,4);return j(N(f),t)}let o=r.slice(r.lastIndexOf("/")+1);return J.has(o)&&r!==n&&r!==process.execPath})}function Ee(){let e=b("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(e.status!==0)return null;let t=[];for(let n of e.stdout.split(`
|
|
3
|
-
`)){let r=/^\s*(\d+)\s+(\S.*)$/.exec(n);if(!r||Number(r[1])===process.pid)continue;let i=r[2].trimEnd(),o=i.slice(i.lastIndexOf("/")+1);if(!V.test(i)&&J.has(o)){let c=b("/usr/sbin/lsof",["-a","-p",r[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
|
|
4
|
-
`).find((l)=>l.startsWith("n/"));if(c)i=c.slice(1)}t.push(i)}return t}function _e(e){if(H(e.home),!d(e.sourceApp))throw new h("identity_invalid","The packaged Reason background identity is missing or invalid.");let t=e.command??K,n=le(e.home),r=I(n);Y(r,{recursive:!0,mode:448}),ee(r,448);let i=T(e.sourceApp),o=null;try{o=T(n)}catch{}if(i!==o){let f=`${process.pid}.${L()}`,c=u(r,`.Reason.app.${f}.tmp`),l=u(r,`.Reason.app.${f}.old`),y=!1;try{if(te(i,c,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!d(c))throw new h("identity_invalid","The copied Reason background identity is invalid.");let _=e.releaseSigned?["--test-requirement",`=${de}`]:[];if(t("/usr/bin/codesign",["--verify","--strict",..._,c])!==0)throw new h("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let S=!1;for(let p=0;p<4;p+=1){let m=!1;try{E(n,l),m=!0,y=!0}catch(s){if(s.code!=="ENOENT")throw s}if(p===0)e.beforePublish?.();try{E(c,n),S=!0}catch(s){let Z=s.code;if(!["EEXIST","ENOTEMPTY"].includes(Z??""))throw s;if(m)g(l,{recursive:!0,force:!0}),y=!1;if(p===3)throw s;continue}if(m)g(l,{recursive:!0,force:!0}),y=!1;break}if(!S)throw Error("Could not publish Reason's background identity.")}catch(_){if(y&&!x(n)&&x(l))E(l,n);throw _}finally{g(c,{recursive:!0,force:!0}),g(l,{recursive:!0,force:!0})}}return z(n,e,{verified:i!==o}),n}function X(e){return u(I(e),".Reason.app.registered")}function q(e){try{let t=A(e);return t.isDirectory()?`${t.ino}:${t.birthtimeMs}`:null}catch{return null}}function C(e){let t=q(e);try{return t!==null&&w(X(e),"utf8")===t}catch{return!1}}function Q(e){if(d(e))return"bundle";try{if(A(u(e,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return A(u(e,"Contents","MacOS",v)).isSymbolicLink()?"retired":null}catch{return null}}function z(e,t,n={}){let r=t.command??K;if(!n.verified&&r("/usr/bin/codesign",["--verify","--strict",e])!==0)throw new h("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if(r(R,["-f",e])!==0)throw new h("identity_register_failed","Could not register Reason's macOS background identity.");let i=q(e);try{if(i)oe(X(e),i,{mode:384})}catch{}try{Se(e,t.home,r,t.runningExecutables??Ee)}catch(o){let f=o.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${f})
|
|
5
|
-
`)}}function Se(e,t,n,r){let i=D(e);if(!i)return;let o=O(t),f=I(o),c=(s)=>u(s,"Contents","MacOS",v),l=se(I(c(o)),i),y=`${process.pid}.${L()}`,_=Q(o);if(_===null)return;let S=_==="bundle";if(S)n(R,["-u",o]);let p=u(f,`.Ara.app.${y}.old`);if(!W.has(o)&&!me(r())){if(!S)n(R,["-u",o]);try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}g(p,{recursive:!0,force:!0}),Ie(f);return}if(!S){if(re(c(o))===l)return;let s=`${c(o)}.${y}`;M(l,s);try{E(s,c(o))}finally{g(s,{force:!0})}return}let m=u(f,`.Ara.app.${y}.shim`);Y(I(c(m)),{recursive:!0}),M(l,c(m));try{try{E(o,p)}catch(s){if(s.code==="ENOENT")return;throw s}try{E(m,o)}catch(s){if(x(o))return;throw E(p,o),s}}finally{g(m,{recursive:!0,force:!0}),g(p,{recursive:!0,force:!0})}}function Ie(e){try{if(ne(e).some((n)=>n!==".DS_Store"))return;g(u(e,".DS_Store"),{force:!0}),ie(e)}catch{}}var B=new Map;function Mn(e=a()){let t=B.get(e);if(t)return t;if(process.platform!=="darwin")return[];let n=U(e);if(n===null&&x(I(le(e))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),n=U(e);if(n===null)return[];return B.set(e,n),n}function U(e){let t=le(e),n=O(e);if(!d(t)||!C(t))try{he({home:e,skipWhenSettled:!0})}catch{}let r=d(t)&&(C(t)||!d(n))?t:d(n)?n:null,i=r?D(r):null;if(!i)return null;if(r===n)W.add(n);let o=b(i,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return o.status===0&&o.stdout===`spawn
|
|
6
|
-
`?[i,"--spawn"]:[]}var P=new Map;function at(e=a()){let t=Mn(e),n=t[0];if(!n)return[];let r=P.get(n);if(r===void 0){let i=b(n,["--can-spawn-computer-use"],{env:{},timeout:2000,encoding:"utf8"});r=i.status===0&&i.stdout===`spawn
|
|
7
|
-
`,P.set(n,r)}return r?t:[]}function ao(e=at(),t=a()){if(e.length>0)return null;if(Ur(t)===null)return"computer_use_identity_missing";return pe(ct,t)?"computer_use_identity_outdated":"computer_use_identity_unavailable"}function he(e={}){H(e.home);let t=le(e.home);if(e.skipWhenSettled&&d(t)&&C(t)&&Q(O(e.home))===null)return!0;if(!d(t)){let n=O(e.home);if(!d(n))return!1;try{return _e({...e,sourceApp:n}),!0}catch(r){if(!d(t))throw r}}return z(t,e),!0}var Ut="REASON_WORKER_IDENTITY_APP";function co(e,t=process.env,n=a()){let r=t[Ut];return r&&r===le(n)?r:e}function lo(e,t){if(process.platform!=="darwin")return null;let n=le(e),r=u(n,"Contents","MacOS",G),i=b(r,["--can-run-worker",t],{env:{},timeout:2000,encoding:"utf8"});return i.status===0&&i.stdout===`run-worker
|
|
8
|
-
`?{app:n,executable:r}:null}
|
|
9
|
-
export{Ln,jr,so,le,Ur,Mn,at,ao,Ut,co,lo};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ze,st}from"./vm-hands-entry-lite-eqgj4acy.js";import{ct}from"./vm-hands-entry-lite-rwxbhwky.js";import{so,le,Ur,at,ao}from"./vm-hands-entry-lite-2hvbgp1n.js";import{E}from"./vm-hands-entry-lite-pgb514h0.js";import{a,qt}from"./vm-hands-entry-lite-89z488gz.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 Br=(e,t)=>{if(l)S(l);let s=O(e,so);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(qt(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 Zi(e,t){return E(e)&&!U(e,t)}function Xi(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 (${Ur(t)??"unknown"}; this CLI is ${ct}) (${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 Io(e=a()){let t=at(e);if(t.length>0)return{state:"ready",path:w(w(w(t[0]))),prefix:t};let s=ao(t,e)??"computer_use_identity_unavailable";return{state:s,path:le(e),detail:K(s,e)}}function V(){return{identity:()=>Io(),grants:(e)=>ze(e),request:(e,t)=>st(e,t),worker:async()=>(await import("./status-gt7c4ke0.js")).connectionMacState(),open:(e)=>{H("/usr/bin/open",e,{stdio:"ignore",timeout:1e4})},tile:Br,restartConnection:async()=>(await import("./connect-cli-d60gmgnx.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 Do(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 ys(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 bs(e,t){let s=t.host??V(),{io:n}=t,r=await Do(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
|
-
`),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
|
-
`);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
|
-
`),!t.wait)continue;if(n.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
|
|
6
|
-
`),await x(async()=>(await s.grants(d.prefix))?.[g]===!0,s).finally(I))n.stdout.write(`${p}: granted.
|
|
7
|
-
`),u=!0;else n.stderr.write(`${p} is not allowed yet; turn on Reason there, then run \`reason permissions\`.
|
|
8
|
-
`),c=!0;continue}let m=R(await s.worker()??{executable:null});if(!m){n.stderr.write(`Reason permissions: ${r.worker_detail} Then run \`reason permissions allow disk\`.
|
|
9
|
-
`),c=!0;continue}if(s.open([h]),s.open(["-R",m]),n.stdout.write(`Full Disk Access: click + and choose ${m} (shown in Finder), or drag it into the list.
|
|
10
|
-
`),!t.wait)continue;if(n.stdout.write(`Waiting for the worker to report it (Ctrl-C to stop)\u2026
|
|
11
|
-
`),await x(async()=>(await s.worker())?.full_disk_access==="granted",s))n.stdout.write(`Full Disk Access: granted.
|
|
12
|
-
`);else n.stderr.write("Full Disk Access is not reported yet. If you allowed it, `reason connect` restarts the worker with it.\n"),c=!0}if(u)try{if(await s.restartConnection())n.stdout.write(`This computer's Reason connection restarted to use them.
|
|
13
|
-
`)}catch(o){n.stderr.write(`This computer's Reason connection uses them after it restarts (\`reason connect\`): ${o instanceof Error?o.message:String(o)}
|
|
14
|
-
`)}return c?1:0}export{Zi,Xi,Br,Io,Do,ys,bs};
|