@reason-machines/cli-linux-x64 0.2.553 → 0.2.555
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reason +1 -1
- package/bin/vm-hands/api-453kzgb3.js +2 -0
- package/bin/vm-hands/api-credentials-arrtadfe.js +2 -0
- package/bin/vm-hands/connect-cli-33btt5ny.js +2 -0
- package/bin/vm-hands/{desktop-account-d7x4xn27.js → desktop-account-t0afsge2.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-wc8a2nhs.js → hands-worker-source-qj7s9dk5.js} +1 -1
- package/bin/vm-hands/local-automation-5qwy01c7.js +2 -0
- package/bin/vm-hands/local-capabilities-mf5cm434.js +2 -0
- package/bin/vm-hands/{local-desktop-users-tjcpyakd.js → local-desktop-users-5scb9930.js} +1 -1
- package/bin/vm-hands/local-display-mac-pft73te9.js +2 -0
- package/bin/vm-hands/local-display-session-7gvdydea.js +2 -0
- package/bin/vm-hands/local-display-video-vg02ywcz.js +2 -0
- package/bin/vm-hands/local-managed-process-d02r1axd.js +2 -0
- package/bin/vm-hands/local-pty-session-njd0tprg.js +2 -0
- package/bin/vm-hands/{managed-runtime-9p83xxgg.js → managed-runtime-dyea269c.js} +1 -1
- package/bin/vm-hands/permissions-4nhqq4q8.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-g54rtrhd.js +2 -0
- package/bin/vm-hands/{serve-service-83tm7ky3.js → serve-service-5288h5s3.js} +1 -1
- package/bin/vm-hands/{status-mtmtkbbp.js → status-zqw8s5y5.js} +2 -2
- package/bin/vm-hands/version-4nn7abs3.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-645wzfhr.js → vm-hands-entry-lite-0wsr8edk.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-kmtz5h74.js → vm-hands-entry-lite-1yv5qqew.js} +22 -22
- package/bin/vm-hands/{vm-hands-entry-lite-8s4namcq.js → vm-hands-entry-lite-2tbf0swk.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k9vk84wa.js → vm-hands-entry-lite-2v4zh9ze.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-qdrmhn3f.js → vm-hands-entry-lite-3apb2pjh.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-72nj66ab.js → vm-hands-entry-lite-46pwqvpf.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hq76nmrc.js → vm-hands-entry-lite-99wrj4vv.js} +15 -15
- package/bin/vm-hands/{vm-hands-entry-lite-9azmqs47.js → vm-hands-entry-lite-ak0hd94p.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-6pqfr3w2.js → vm-hands-entry-lite-atv6x5d3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-e16bhf16.js → vm-hands-entry-lite-b23s6pvp.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-x3ym5t8r.js → vm-hands-entry-lite-b2szp9p8.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-2hfrcr50.js → vm-hands-entry-lite-bpamn7ny.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-0yvkh3bg.js → vm-hands-entry-lite-bs7jaz1j.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-c4zazjyw.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-w29d7ey0.js → vm-hands-entry-lite-dgfx0rbn.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-whfrwyxm.js → vm-hands-entry-lite-f6b0cmq6.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-gezw3967.js → vm-hands-entry-lite-fde30yd5.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5tnma5qb.js → vm-hands-entry-lite-gje7xvy9.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hfx1q0b0.js → vm-hands-entry-lite-h1qjggz0.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-y9jarm7q.js → vm-hands-entry-lite-h2rq71rj.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ycddfgr4.js → vm-hands-entry-lite-mh46pt40.js} +8 -8
- package/bin/vm-hands/{vm-hands-entry-lite-55ja13pk.js → vm-hands-entry-lite-mj7yar3a.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-sb7b4z8t.js → vm-hands-entry-lite-n7bd44rm.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-3dccjjq2.js → vm-hands-entry-lite-pb02nft0.js} +24 -24
- package/bin/vm-hands/{vm-hands-entry-lite-13s0mfpr.js → vm-hands-entry-lite-q2h781jg.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-xe0benev.js → vm-hands-entry-lite-qd46yhvz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-8hwmhvyx.js → vm-hands-entry-lite-r2qrpjfq.js} +16 -16
- package/bin/vm-hands/{vm-hands-entry-lite-y5hv1gjv.js → vm-hands-entry-lite-ravxhygk.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-t46k8t4n.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zrkw5syq.js → vm-hands-entry-lite-t87sehfe.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-xrqztkhv.js → vm-hands-entry-lite-wghmyfba.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-n5vw984z.js → vm-hands-executor-ycprx6c1.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-91w40a0z.js → vm-hands-op-runner-f9m5nsa4.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-08q76986.js → vm-hands-runtime-a07nhqmd.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-gy36ejp9.js +2 -0
- package/bin/vm-hands/worker-sandbox-f1tfb3y0.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-18f1batz.js +0 -2
- package/bin/vm-hands/api-credentials-6jgf7w9q.js +0 -2
- package/bin/vm-hands/connect-cli-xgbm9xfg.js +0 -2
- package/bin/vm-hands/local-automation-gc28rhzv.js +0 -2
- package/bin/vm-hands/local-capabilities-aa7m3ac6.js +0 -2
- package/bin/vm-hands/local-display-mac-gtp439kc.js +0 -2
- package/bin/vm-hands/local-display-session-wkhda8j7.js +0 -2
- package/bin/vm-hands/local-display-video-14fj7scm.js +0 -2
- package/bin/vm-hands/local-managed-process-hq1x6wqt.js +0 -2
- package/bin/vm-hands/local-pty-session-yr22ryvy.js +0 -2
- package/bin/vm-hands/permissions-5dhys0br.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-k12sw3vm.js +0 -2
- package/bin/vm-hands/version-8z8e46x9.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-r7tb2z3z.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-vn7ag8c7.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-84stxabw.js +0 -2
- package/bin/vm-hands/worker-sandbox-563c5g2f.js +0 -2
- /package/bin/vm-hands/{vm-hands-entry-lite-b6gsggvp.js → vm-hands-entry-lite-tyem93c1.js} +0 -0
package/bin/reason
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{D,Ps,rs}from"./vm-hands-entry-lite-t46k8t4n.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{D as ApiError,rs as ReasonApi,Ps as createMachineEnrollmentTicketWithToken};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zi,es,ts,As}from"./vm-hands-entry-lite-b23s6pvp.js";import"./vm-hands-entry-lite-t46k8t4n.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{zi as apiOriginFromEnvironment,ts as environmentApiKey,es as explicitApiOrigin,As as resolveApiCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{it,Ss,Es,xs}from"./vm-hands-entry-lite-b2szp9p8.js";import"./vm-hands-entry-lite-ravxhygk.js";import"./vm-hands-entry-lite-q2h781jg.js";import"./vm-hands-entry-lite-b23s6pvp.js";import"./vm-hands-entry-lite-t46k8t4n.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-bs7jaz1j.js";import"./vm-hands-entry-lite-pb02nft0.js";import"./vm-hands-entry-lite-ak0hd94p.js";import"./vm-hands-entry-lite-3apb2pjh.js";import"./vm-hands-entry-lite-99wrj4vv.js";import"./vm-hands-entry-lite-gje7xvy9.js";import"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-bpamn7ny.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-t87sehfe.js";import"./vm-hands-entry-lite-r2qrpjfq.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-mj7yar3a.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ss as computerDisconnected,it as connectionDirectory,Es as connectionReport,xs as restartConnection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Gs,K,
|
|
2
|
+
import{Gs,K,zn}from"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Gs as configureDesktopAccount,K as desktopAccount,zn as desktopHome};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{O,T,cs,b,Cn}from"./vm-hands-entry-lite-
|
|
2
|
+
import{O,T,cs,b,Cn}from"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{b as REASON_HANDS_WORKER_ARTIFACT_SHA256,T as REASON_HANDS_WORKER_ENTRYPOINT,cs as REASON_HANDS_WORKER_SOURCE,Cn as REASON_HANDS_WORKER_STARTUP_REFUSALS,O as REASON_HANDS_WORKER_VERSION};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pn,Us,zs,qs,Ws,Rn}from"./vm-hands-entry-lite-t87sehfe.js";import"./vm-hands-entry-lite-r2qrpjfq.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-mj7yar3a.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{zs as ensureLocalBrowser,Pn as localAutomationAvailable,qs as localBrowserProfile,Us as localUserChromeHost,Ws as runAutomationCallLocally,Rn as runLocalAutomation};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ns,Vi,mn,is,os,ss,as,$s,Ms,Bs,Fs}from"./vm-hands-entry-lite-pb02nft0.js";import"./vm-hands-entry-lite-ak0hd94p.js";import"./vm-hands-entry-lite-3apb2pjh.js";import"./vm-hands-entry-lite-99wrj4vv.js";import"./vm-hands-entry-lite-gje7xvy9.js";import"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-bpamn7ny.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-t87sehfe.js";import"./vm-hands-entry-lite-r2qrpjfq.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-mj7yar3a.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-qd46yhvz.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{r as LocalCapabilityError,ns as SHORT_REQUEST_CAPABILITIES,$s as capabilityInventoryForRoots,Vi as confinedExecutionShell,is as defaultLocalCommandRunner,Ms as deliverLocalHandsEnvironment,as as enrolledRootPaths,Fs as executeLocalOperation,Bs as rebindLocalHandsControl,os as runFileCapability,ss as runTransferCapability,mn as spawnCaptured};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pt,Sa,Ea,ji,Hi}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Pt,Sa,Ea,ji,Hi}from"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Sa as forgetLocalDesktopUse,Hi as holdLocalDesktop,Pt as noteLocalDesktopUse,Ea as releaseLocalDesktop,ji as trackDesktopRun};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ft,Vs,G,qe,jt}from"./vm-hands-entry-lite-r2qrpjfq.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{qe as ensureLinuxDesktop,Ft as localDisplayAvailable,Vs as localDisplayReady,G as privateDirectory,jt as runLocalDisplayStream};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fn,jn,Hn,Un,Ur}from"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Fn as MAC_SCREEN,jn as WINDOWS_SCREEN,Hn as createDisplayVideoLane,Ur as localDisplayVideoAvailable,Un as simulatorVideoFfmpeg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{st,fr,js,Hs}from"./vm-hands-entry-lite-3apb2pjh.js";import"./vm-hands-entry-lite-99wrj4vv.js";import"./vm-hands-entry-lite-gje7xvy9.js";import"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-bpamn7ny.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{st as ManagedProcessStoppedError,js as controlManagedDeviceProcess,Hs as retireManagedDeviceProcess,fr as runManagedDeviceProcess};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rr,Ht,Tr,ls,Tn,Ir,In}from"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Ht as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,Tr as LOCAL_PTY_MAX_SESSIONS,Rr as LOCAL_PTY_MAX_SESSION_MS,Ir as defaultConnect,ls as defaultLoginShell,Tn as ptyRuntimeSupported,In as runLocalPtySession};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rs,Ts,Is,Ds,Os,Ns,Ls}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Rs,Ts,Is,Ds,Os,Ns,Ls}from"./vm-hands-entry-lite-bs7jaz1j.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Os as acquireManagedRuntimeDirectoryLock,Is as currentManagedRuntimeVersion,Ls as flushManagedRuntimeLifecycleEvents,Ds as isManagedRuntimeVersionExecutable,Ts as legacyManagedRuntimePaths,Rs as managedRuntimePaths,Ns as recordManagedRuntimeLifecycle};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{us,ds,Ks,Js}from"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Js as allowMacPermissions,Ks as permissionsSummary,ds as readMacPermissions,us as reasonIdentity};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{P,Lr,$r,Dn,pt,On,Mr,Ve,ve,Nn,Ge,Vt,ne,Ke,Ln,Se,Gt,Br,Kt,Fr,$n,ae,H,L,ce,jr,Hr,Mn}from"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Fr as REASON_HANDS_CLOSE_CODES,Ge as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,Mr as REASON_HANDS_JOB_MAX_INPUT_CHARS,Ve as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,ve as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,Nn as REASON_HANDS_JOB_MAX_RECORDS,On as REASON_HANDS_MAX_ERROR_CHARS,Lr as REASON_HANDS_MAX_FRAME_BYTES,$r as REASON_HANDS_MAX_INPUT_CHARS,pt as REASON_HANDS_MAX_OUTPUT_CHARS,Dn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,P as REASON_HANDS_PROTOCOL_VERSION,Br as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Kt as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,Gt as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,Se as REASON_HANDS_PTY_MAX_DIMENSION,ne as REASON_HANDS_PTY_MAX_INPUT_BYTES,Ke as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Ln as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Vt as REASON_HANDS_PTY_PROTOCOL_VERSION,$n as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,H as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,L as isReasonHandsUuid,jr as parseReasonHandsJobRequest,Hr as parseReasonHandsJobResult,Mn as parseReasonHandsPtyReceipt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Wr,xe,J,Jn,Xs,No,Ys,Ze,ps,Xn,Zs,Qs,Vr,ea,ta}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Wr,xe,J,Jn,Xs,No,Ys,Ze,ps,Xn,Zs,Qs,Vr,ea,ta}from"./vm-hands-entry-lite-mj7yar3a.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-tyem93c1.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Wr as WORKER_SERVICE_ENV,J as WorkerServiceError,No as connectServiceLabel,xe as defaultWorkerServiceHost,Qs as installWorkerService,Ze as installedWorkerService,Ys as isConnectServiceLabel,ta as removeWorkerService,Vr as restartWorkerService,ea as retargetWorkerServiceLogs,ps as retireLegacyWorkerService,Zs as workerServiceDefinitionCurrent,Jn as workerServiceLauncher,Xn as workerServiceProcessRunning,Xs as workerServiceRetargetPending};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./vm-hands-entry-lite-
|
|
2
|
+
import"./vm-hands-entry-lite-t46k8t4n.js";import"./vm-hands-entry-lite-a3p6xz53.js";import{_}from"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-s85p7tqp.js";import"./vm-hands-entry-lite-c4zazjyw.js";import"./vm-hands-entry-lite-b23s6pvp.js";import{zt,dt}from"./vm-hands-entry-lite-dgfx0rbn.js";import{w,B,pr,Be,it}from"./vm-hands-entry-lite-b2szp9p8.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-pb02nft0.js";import"./vm-hands-entry-lite-99wrj4vv.js";import"./vm-hands-entry-lite-gje7xvy9.js";import"./vm-hands-entry-lite-ak0hd94p.js";import"./vm-hands-entry-lite-ravxhygk.js";import"./vm-hands-entry-lite-mh46pt40.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-2tbf0swk.js";import"./vm-hands-entry-lite-atv6x5d3.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-bs7jaz1j.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-mj7yar3a.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-h2rq71rj.js";import"./vm-hands-entry-lite-3apb2pjh.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-r2qrpjfq.js";import"./vm-hands-entry-lite-t87sehfe.js";import"./vm-hands-entry-lite-q2h781jg.js";import"./vm-hands-entry-lite-bpamn7ny.js";import"./vm-hands-entry-lite-h1qjggz0.js";import{a}from"./vm-hands-entry-lite-8dfw96ym.js";import{t,o,u,n,s,i}from"./vm-hands-entry-lite-wzv13c8k.js";import"./vm-hands-entry-lite-tyem93c1.js";import{readFileSync as me,realpathSync as k,renameSync as fe,unlinkSync as ge,writeFileSync as he}from"fs";import{dirname as ye,join as A}from"path";function g(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 j=g("https://mcp.reasonmachines.com/mcp"),F=h("https://mcp.reasonmachines.com/mcp"),z=`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 M="https://github.com/reason-machines/reason-plugins",X=`Connect a coding agent to Reason over MCP
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
@@ -7,4 +7,4 @@ Usage:
|
|
|
7
7
|
reason mcp uninstall Remove only this machine's registrations of the earlier, retired server
|
|
8
8
|
|
|
9
9
|
Plugins for Claude Code and Codex: ${M}
|
|
10
|
-
`;var P=s(["granted","not_granted","unknown"]),C=n({status:P,checkedAt:o().finite(),executablePath:t().min(1)});var Oe=n({version:i(1),key:t(),at:o(),self:n({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(n({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})});var I=30000;function x(e,c=Date.now(),y=null){let r=
|
|
10
|
+
`;var P=s(["granted","not_granted","unknown"]),C=n({status:P,checkedAt:o().finite(),executablePath:t().min(1)});var Oe=n({version:i(1),key:t(),at:o(),self:n({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(n({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})});var I=30000;function x(e,c=Date.now(),y=null){let r=dt(e),d=(()=>{if(r?.state!=="connected"&&r?.state!=="starting")return!1;try{return process.kill(r.pid,0),!0}catch{return!1}})(),R=d&&r?.state==="connected",p=(f)=>R&&c-f>=0&&c-f<I,l=C.safeParse(r?.fullDiskAccess),m=zt(r,y,c);return{...m?{permission_recovery:m}:{},full_disk_access:l.success&&p(l.data.checkedAt)?l.data.status:"unknown",keep_awake:{enabled:pr(e)==="battery_and_ac",holding:r?.idleSleepHold===!0&&p(Date.parse(r.lastHeartbeatAt??""))},executable:d&&l.success?l.data.executablePath:null}}function De(e=_()){if(process.platform!=="darwin")return null;let c=Be(A(it(k(a()),e),"worker.json"));return c?x(w(c).daemon,Date.now(),B(c)):null}export{De as connectionMacState};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{N}from"./vm-hands-entry-lite-48rphbjm.js";import{
|
|
3
|
-
export{
|
|
2
|
+
import{N}from"./vm-hands-entry-lite-48rphbjm.js";import{pt}from"./vm-hands-entry-lite-n7bd44rm.js";import{Wt}from"./vm-hands-entry-lite-h2rq71rj.js";import{j}from"./vm-hands-entry-lite-dgfx0rbn.js";import{ie}from"./vm-hands-entry-lite-8dfw96ym.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{Me}from"./vm-hands-entry-lite-3gbf905c.js";import{existsSync as D,realpathSync as z,statSync as K}from"fs";import{platform as h}from"os";import{isAbsolute as I,sep as G}from"path";import{existsSync as X}from"fs";import{createRequire as Y}from"module";var k=Me(Wt)(()=>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 W(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 Rr=43200000,Ht=pt,Tr=4,Q=/^[A-Za-z0-9._:-]{1,160}$/,V=1000;function F(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(!F(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:N(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+Rr)).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 q(e,n){if(n===void 0)return e;if(!I(n))throw new r("pty_cwd_invalid","Reason terminal working directory must be absolute.");let o;try{o=z(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 ls(e=process.env){if(h()==="win32")return C(e);let n=e.SHELL;if(n&&I(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 ne(){let e=globalThis.Bun;if(!e)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");return e.spawn}function Tn(){if(h()==="win32")return E();return typeof globalThis.Bun<"u"}var re=(e)=>{if(h()==="win32")try{return W({...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=ne()({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)}},Ir=(e,n)=>n===void 0?new WebSocket(e):new WebSocket(e,{proxy:n}),v=new Set;function te(e){if(v.size>=Tr||v.has(e))return null;v.add(e);let n=!1;return()=>{if(n)return;n=!0,v.delete(e)}}async function In(e,n={}){let o=n.now??Date.now,t=Z(e.payload,o()),c=te(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?ie(e.root,t.workspace):void 0;g=a?q(D(a.boundary)?z(a.boundary):a.boundary,a.path):q(e.root,t.cwd),d=n.environment??process.env,p=n.shellPath??ls(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 H=(s)=>{if(U+=s.byteLength,!S||!i){if(O.push(s),R+=s.byteLength,R>Ht)l({kind:"resolved",reason:"output_backpressure"});return}try{i.send(s)}catch{l({kind:"resolved",reason:"relay_closed"});return}if(i.bufferedAmount>Ht)l({kind:"resolved",reason:"output_backpressure"})};try{w=(n.spawnPty??re)({shell:p,args:["-i","-l"],cwd:g,cols:t.cols,rows:t.rows,environment:d,onData:(s)=>{if(!y)H(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??Ir)(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(!F(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{Rr,Ht,Tr,ls,Tn,Ir,In};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qr,en,tn,or}from"./vm-hands-entry-lite-48rphbjm.js";import{
|
|
2
|
+
import{Qr,en,tn,or}from"./vm-hands-entry-lite-48rphbjm.js";import{_o,yo,P,Lr,$r,Dn,pt,On,Mr,Ve,ve,Nn,Ge,ne,Ke,Se,Gt,Br,Fr,$n}from"./vm-hands-entry-lite-n7bd44rm.js";import{lr}from"./vm-hands-entry-lite-s85p7tqp.js";import{Wt}from"./vm-hands-entry-lite-h2rq71rj.js";import{Ee}from"./vm-hands-entry-lite-46pwqvpf.js";var r=["cgroup_membership_read_failed","cgroup_v2_membership_absent","cgroup_scope_invalid","cgroup_root_unavailable","cgroup_directory_unavailable","cgroup_limit_read_failed","cgroup_events_read_failed","cgroup_current_read_failed","cgroup_stat_read_failed","boot_id_read_failed","boot_id_invalid","guest_meminfo_read_failed","guest_vmstat_read_failed","memory_counter_invalid","memory_field_missing","memory_capacity_invalid"];var o=String.raw`(function(fs, path) {
|
|
3
3
|
const fail = (message, reasonCode) => { throw Object.assign(Error(message), {reasonCode}); };
|
|
4
4
|
const read = (p, reasonCode, trim=true) => { try { const text=fs.readFileSync(p, "utf8"); return trim?text.trim():text; }
|
|
5
5
|
catch { fail("memory_read", reasonCode); } };
|
|
@@ -369,28 +369,28 @@ const GUEST_MEMORY_UNAVAILABLE_REASONS = ${JSON.stringify(r)};
|
|
|
369
369
|
const sampleGuestMemory = ${o};
|
|
370
370
|
const inspectMacPtyMember = ${C};
|
|
371
371
|
const probeLinuxPtyLibrary = ${x};
|
|
372
|
-
const windowsPtyApi = ${
|
|
372
|
+
const windowsPtyApi = ${Wt};
|
|
373
373
|
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(D)};
|
|
374
|
-
const CLOSE_CODES = ${JSON.stringify(
|
|
374
|
+
const CLOSE_CODES = ${JSON.stringify(Fr)};
|
|
375
375
|
const SHA256_RE = /^[0-9a-f]{64}$/;
|
|
376
|
-
const MAX_FRAME_BYTES = ${
|
|
377
|
-
const MAX_INPUT_CHARS = ${
|
|
378
|
-
const MAX_STRUCTURED_INPUT_CHARS = ${
|
|
379
|
-
const MAX_OUTPUT_CHARS = ${
|
|
380
|
-
const WORKSPACE_BEFORE_MAX_OUTPUT_CHARS = ${
|
|
381
|
-
const MAX_ERROR_CHARS = ${
|
|
376
|
+
const MAX_FRAME_BYTES = ${Lr};
|
|
377
|
+
const MAX_INPUT_CHARS = ${$r};
|
|
378
|
+
const MAX_STRUCTURED_INPUT_CHARS = ${Dn};
|
|
379
|
+
const MAX_OUTPUT_CHARS = ${pt};
|
|
380
|
+
const WORKSPACE_BEFORE_MAX_OUTPUT_CHARS = ${$n};
|
|
381
|
+
const MAX_ERROR_CHARS = ${On};
|
|
382
382
|
const MAX_LEDGER_IDS = 16384;
|
|
383
383
|
const MAX_CACHED_RESULTS = 256;
|
|
384
|
-
const MAX_JOB_INPUT_CHARS = ${
|
|
385
|
-
const MAX_JOB_OUTPUT_CHARS = ${
|
|
386
|
-
const MAX_JOB_OUTPUT_CHUNKS = ${
|
|
387
|
-
const MAX_JOBS = ${
|
|
384
|
+
const MAX_JOB_INPUT_CHARS = ${Mr};
|
|
385
|
+
const MAX_JOB_OUTPUT_CHARS = ${Ve};
|
|
386
|
+
const MAX_JOB_OUTPUT_CHUNKS = ${ve};
|
|
387
|
+
const MAX_JOBS = ${Nn};
|
|
388
388
|
const MAX_JOB_RECORD_BYTES = 262144;
|
|
389
389
|
const MAX_JOB_JOURNAL_BYTES = MAX_JOBS * MAX_JOB_RECORD_BYTES;
|
|
390
|
-
const MAX_JOB_CONTROL_FRAME_BYTES = ${
|
|
390
|
+
const MAX_JOB_CONTROL_FRAME_BYTES = ${Ge};
|
|
391
391
|
const MAX_PTY_INPUT_BYTES = ${ne};
|
|
392
|
-
const MAX_PTY_OUTPUT_BYTES = ${
|
|
393
|
-
const MAX_PTY_DIMENSION = ${
|
|
392
|
+
const MAX_PTY_OUTPUT_BYTES = ${Ke};
|
|
393
|
+
const MAX_PTY_DIMENSION = ${Se};
|
|
394
394
|
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/;
|
|
395
395
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
396
396
|
const WINDOWS = process.platform === "win32";
|
|
@@ -1027,7 +1027,7 @@ function initializeJobs() {
|
|
|
1027
1027
|
// (shared/local-protected-paths.ts) that the file tools and every confinement
|
|
1028
1028
|
// refuse. A home-folder worker keeps it in ~/.config/reason, so its Session may
|
|
1029
1029
|
// work in the home folder itself, as a Mac's home grant does.
|
|
1030
|
-
const PROTECTED_STATE_DIRECTORIES = ${JSON.stringify(
|
|
1030
|
+
const PROTECTED_STATE_DIRECTORIES = ${JSON.stringify(Ee)};
|
|
1031
1031
|
function stateOverlapsWorkspace(state, root) {
|
|
1032
1032
|
if (pathWithin(root, state)) return true;
|
|
1033
1033
|
if (!pathWithin(state, root)) return false;
|
|
@@ -2347,7 +2347,7 @@ function windowsPtyOperation(request, managed) {
|
|
|
2347
2347
|
try {
|
|
2348
2348
|
if (pty.activeProcesses() > 0) pty.terminate();
|
|
2349
2349
|
for (const startedAt = Date.now(); pty.activeProcesses() > 0;) {
|
|
2350
|
-
if (Date.now() - startedAt > ${
|
|
2350
|
+
if (Date.now() - startedAt > ${Gt}) throw new Error("pty_cleanup_timeout");
|
|
2351
2351
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
2352
2352
|
}
|
|
2353
2353
|
pty.close();
|
|
@@ -2795,7 +2795,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2795
2795
|
const { members, empty } = native.session(anchor, device);
|
|
2796
2796
|
try {
|
|
2797
2797
|
if (empty && exitCode !== null && subreaper) break;
|
|
2798
|
-
if (Date.now() - startedAt > ${
|
|
2798
|
+
if (Date.now() - startedAt > ${Gt}) throw new Error("pty_cleanup_timeout");
|
|
2799
2799
|
for (const token of members) {
|
|
2800
2800
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
2801
2801
|
const id = native.identityKey(token);
|
|
@@ -2811,7 +2811,7 @@ function ptyOperation(request, managed, program = TERMINAL_SHELL) {
|
|
|
2811
2811
|
controlReleased = true;
|
|
2812
2812
|
let exitTimer;
|
|
2813
2813
|
try { await Promise.race([child.exited, new Promise((_, reject) => {
|
|
2814
|
-
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${
|
|
2814
|
+
exitTimer = setTimeout(() => reject(new Error("pty_anchor_exit_unconfirmed")), ${Br});
|
|
2815
2815
|
})]); } finally { clearTimeout(exitTimer); }
|
|
2816
2816
|
if (timedOut) finish("timeout", 124);
|
|
2817
2817
|
else if (cancelled) finish("cancelled", 130);
|
|
@@ -3362,10 +3362,10 @@ const PI_EXIT_STDIO_GRACE_MS = 100;
|
|
|
3362
3362
|
// the token once under quoteDepth layers of single quoting, so the confined
|
|
3363
3363
|
// script is byte-identical to what the Brain's confineBashPayload gives the
|
|
3364
3364
|
// bash tool: srt/bwrap, the payload uid, the network allowlist and allowWrite.
|
|
3365
|
-
const PI_TOOL_CONFINEMENT_TOKEN = "${
|
|
3365
|
+
const PI_TOOL_CONFINEMENT_TOKEN = "${_o}";
|
|
3366
3366
|
function validPiToolConfinement(value) {
|
|
3367
3367
|
return hasOnlyKeys(value, ["template", "quoteDepth"]) && typeof value.template === "string"
|
|
3368
|
-
&& value.template.length <= ${
|
|
3368
|
+
&& value.template.length <= ${yo} && !value.template.includes("\0")
|
|
3369
3369
|
&& value.template.split(PI_TOOL_CONFINEMENT_TOKEN).length === 2 && [1, 2, 3].includes(value.quoteDepth);
|
|
3370
3370
|
}
|
|
3371
3371
|
// The script T when this command is exactly this policy's confineBashPayload(T)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qe}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Qe}from"./vm-hands-entry-lite-c4zazjyw.js";import{a}from"./vm-hands-entry-lite-8dfw96ym.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 Yn="so.ara.cli",k=[Yn,"com.reasonmachines.cli"],F="5LJFSBRY2F";function Gr(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",$o="Contents/Helpers/ReasonPermissionTile",ae="so.ara.cli.permission-tile",Ne=Gr([ae,"com.reasonmachines.cli.permission-tile"]),v="AraBackgroundIdentity",ue="Reason",Ce=Gr(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 Kr(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=Kr(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
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
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
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 Zn(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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as se,spawn as E}from"child_process";var
|
|
2
|
+
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as se,spawn as E}from"child_process";var xo="h264_ws_v1",ko="video",ht=["smooth","sharp","data_saver","balanced"];var Co="video_presets";var M=8388608,S=65536,Ao="control",Po="v1",X=200;function qn(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t,n=(i)=>typeof i==="string"&&i.length>0&&i.length<=X;if(Object.keys(e).length!==2||!n(e.user_id)||!n(e.name))return null;return{user_id:e.user_id,name:e.name}}var Ro="windows",To="v1",Io="look",Do="v1",J=["reason","grok"];function Wn(t){return typeof t==="string"&&J.includes(t)?t:null}var D=200,Z=(t)=>typeof t==="string"&&ht.includes(t);function Oo(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t;if(Object.keys(e).length!==2||e.format!=="h264_ws_v1"||!Z(e.preset))return null;return{format:"h264_ws_v1",preset:e.preset}}var o={hello:1,frame:2,stats:3,pong:4,serverClipboard:5,error:6,audioHello:7,audio:8,control:9,windows:10,pointer:16,key:17,config:18,ping:19,clientClipboard:20,keyframeRequest:21,ack:22,audioEnable:23,resize:24};class l extends Error{constructor(t){super(t);this.name="DisplayVideoProtocolError"}}var Q=new TextEncoder,ee=new TextDecoder("utf-8",{fatal:!0});function p(t,e){if(e.byteLength+1>M)throw new l("message_too_large");let n=new Uint8Array(5+e.byteLength),i=new DataView(n.buffer);return i.setUint32(0,e.byteLength+1),i.setUint8(4,t),n.set(e,5),n}function w(t){let e=Q.encode(t);if(e.byteLength>S)throw new l("text_too_large");return e}function _(t,e){if(!Number.isInteger(t)||t<0||t>65535)throw new l(`invalid_${e}`);return t}function te(t){if(!Number.isFinite(t))throw new l("invalid_window");return Math.max(-2147483648,Math.min(2147483647,Math.round(t)))}function Qt(t){switch(t.type){case"hello":{let e=w(t.codec),n=new Uint8Array(6+e.byteLength),i=new DataView(n.buffer);return i.setUint16(0,_(t.width,"width")),i.setUint16(2,_(t.height,"height")),i.setUint8(4,Math.max(1,Math.min(240,Math.round(t.fps)))),i.setUint8(5,ht.indexOf(t.preset)),n.set(e,6),p(o.hello,n)}case"frame":{let e=new Uint8Array(13+t.data.byteLength),n=new DataView(e.buffer);return n.setUint8(0,t.key?1:0),n.setUint32(1,t.seq>>>0),n.setBigUint64(5,BigInt(Math.max(0,Math.floor(t.captureMicros)))),e.set(t.data,13),p(o.frame,e)}case"stats":return p(o.stats,w(JSON.stringify(t.stats)));case"pong":case"ping":{let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t.token),p(t.type==="ping"?o.ping:o.pong,e)}case"serverClipboard":return p(o.serverClipboard,w(t.text));case"clientClipboard":return p(o.clientClipboard,w(t.text));case"error":return p(o.error,w(t.code));case"pointer":{let e=new Uint8Array(5),n=new DataView(e.buffer);return n.setUint16(0,_(t.x,"x")),n.setUint16(2,_(t.y,"y")),n.setUint8(4,t.buttons&255),p(o.pointer,e)}case"key":{let e=new Uint8Array(5),n=new DataView(e.buffer);return n.setUint8(0,t.down?1:0),n.setUint32(1,t.keysym>>>0),p(o.key,e)}case"config":return p(o.config,Uint8Array.of(ht.indexOf(t.preset)));case"keyframeRequest":return p(o.keyframeRequest,new Uint8Array(0));case"audioHello":{let e=w(t.codec),n=new Uint8Array(5+e.byteLength),i=new DataView(n.buffer);return i.setUint32(0,t.sampleRate>>>0),i.setUint8(4,t.channels&255),n.set(e,5),p(o.audioHello,n)}case"audio":{let e=new Uint8Array(8+t.data.byteLength);return new DataView(e.buffer).setBigUint64(0,BigInt(Math.max(0,Math.floor(t.captureMicros)))),e.set(t.data,8),p(o.audio,e)}case"control":return p(o.control,w(JSON.stringify(t.control)));case"windows":{let e=t.bounds.slice(0,D),n=new Uint8Array(e.length*16),i=new DataView(n.buffer);return e.forEach((s,a)=>{[s.x,s.y,s.width,s.height].forEach((c,d)=>i.setInt32(a*16+d*4,te(c)))}),p(o.windows,n)}case"audioEnable":return p(o.audioEnable,Uint8Array.of(t.on?1:0));case"resize":{let e=new Uint8Array(4),n=new DataView(e.buffer);return n.setUint16(0,_(t.width,"width")),n.setUint16(2,_(t.height,"height")),p(o.resize,e)}case"ack":{let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t.seq>>>0),p(o.ack,e)}}}function L(t){let e=ht[t];if(!e)throw new l("invalid_preset");return e}function y(t,e){if(t.byteLength!==e)throw new l("invalid_length")}function x(t){if(t.byteLength>S)throw new l("text_too_large");try{return ee.decode(t)}catch{throw new l("invalid_text")}}function ne(t){let e;try{e=JSON.parse(x(t))}catch{throw new l("invalid_stats")}let n=e;if(!n||typeof n!=="object"||["fps","kbps","dropped","restarts","queued_bytes"].some((s)=>typeof n[s]!=="number"||!Number.isFinite(n[s])))throw new l("invalid_stats");return{fps:n.fps,kbps:n.kbps,dropped:n.dropped,restarts:n.restarts,queued_bytes:n.queued_bytes}}function re(t){let e;try{e=JSON.parse(x(t))}catch{throw new l("invalid_control")}let n=e;if(!n||typeof n!=="object"||typeof n.you!=="boolean"||typeof n.same_user!=="boolean")throw new l("invalid_control");let i=n.holder===null?null:qn(n.holder);if(i===null&&n.holder!==null)throw new l("invalid_control");return{holder:i,you:n.you,same_user:n.same_user}}function ie(t,e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(t){case o.hello:if(e.byteLength<6)throw new l("invalid_length");return{type:"hello",width:n.getUint16(0),height:n.getUint16(2),fps:n.getUint8(4),preset:L(n.getUint8(5)),codec:x(e.subarray(6))};case o.frame:if(e.byteLength<14)throw new l("invalid_length");if(n.getUint8(0)>1)throw new l("invalid_frame_flags");return{type:"frame",key:n.getUint8(0)===1,seq:n.getUint32(1),captureMicros:Number(n.getBigUint64(5)),data:e.subarray(13)};case o.stats:return{type:"stats",stats:ne(e)};case o.ping:case o.pong:return y(e,8),{type:t===o.ping?"ping":"pong",token:n.getFloat64(0)};case o.serverClipboard:return{type:"serverClipboard",text:x(e)};case o.clientClipboard:return{type:"clientClipboard",text:x(e)};case o.error:return{type:"error",code:x(e)};case o.pointer:return y(e,5),{type:"pointer",x:n.getUint16(0),y:n.getUint16(2),buttons:n.getUint8(4)};case o.key:if(y(e,5),n.getUint8(0)>1)throw new l("invalid_key_flags");return{type:"key",down:n.getUint8(0)===1,keysym:n.getUint32(1)};case o.config:return y(e,1),{type:"config",preset:L(n.getUint8(0))};case o.keyframeRequest:return y(e,0),{type:"keyframeRequest"};case o.audioHello:if(e.byteLength<5)throw new l("invalid_length");return{type:"audioHello",sampleRate:n.getUint32(0),channels:n.getUint8(4),codec:x(e.subarray(5))};case o.audio:if(e.byteLength<9)throw new l("invalid_length");return{type:"audio",captureMicros:Number(n.getBigUint64(0)),data:e.subarray(8)};case o.audioEnable:if(y(e,1),n.getUint8(0)>1)throw new l("invalid_audio_flags");return{type:"audioEnable",on:n.getUint8(0)===1};case o.resize:return y(e,4),{type:"resize",width:n.getUint16(0),height:n.getUint16(2)};case o.control:return{type:"control",control:re(e)};case o.windows:{if(e.byteLength%16!==0||e.byteLength>D*16)throw new l("invalid_length");let i=[];for(let s=0;s<e.byteLength;s+=16)i.push({x:n.getInt32(s),y:n.getInt32(s+4),width:n.getInt32(s+8),height:n.getInt32(s+12)});return{type:"windows",bounds:i}}case o.ack:return y(e,4),{type:"ack",seq:n.getUint32(0)};default:return null}}class Vn{buffer=new Uint8Array(0);push(t){let e=new Uint8Array(this.buffer.byteLength+t.byteLength);e.set(this.buffer),e.set(t,this.buffer.byteLength);let n=[],i=0;while(e.byteLength-i>=4){let s=new DataView(e.buffer,e.byteOffset+i,4).getUint32(0);if(s<1||s>M)throw new l("invalid_message_length");if(e.byteLength-i-4<s)break;let a=e[i+4],c=e.slice(i+5,i+4+s),d=ie(a,c);if(d)n.push(d);i+=4+s}return this.buffer=e.slice(i),n}}var j="/usr/bin/osascript",oe=5000,ae=1048576,ce=String.raw`
|
|
3
3
|
ObjC.import("CoreGraphics");
|
|
4
4
|
ObjC.import("ApplicationServices");
|
|
5
5
|
ObjC.import("AppKit");
|
|
@@ -70,7 +70,7 @@ function run(argv) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
`;function q(t){let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!=="object")return null;let n=e,i=(c)=>typeof c==="number"&&Number.isFinite(c)?Math.min(65535,Math.round(c)):0;if(typeof n.screen!=="boolean"||typeof n.accessibility!=="boolean")return null;let s=i(n.width),a=i(n.height);return s>0&&a>0?{screen:n.screen,accessibility:n.accessibility,width:s,height:a}:null}function v(t,...e){let[n,...i]=[...t,j,"-l","JavaScript","-e",ce,...e];return[n,i]}function H(t,...e){return new Promise((n)=>{se(...v(t,...e),{env:{},timeout:oe,killSignal:"SIGKILL",maxBuffer:65536,encoding:"utf8"},(i,s)=>n(i?null:q(s.split(`
|
|
73
|
-
`)[0]??"")))})}function
|
|
73
|
+
`)[0]??"")))})}function Ye(t=[]){return H(t,"probe")}function ft(t,e){return H(t,"request",...e?[e]:[])}var N=2,ue=8,le=String.raw`
|
|
74
74
|
ObjC.import("CoreGraphics");
|
|
75
75
|
ObjC.import("Foundation");
|
|
76
76
|
ObjC.bindFunction("getppid", ["int", []]);
|
|
@@ -101,12 +101,12 @@ function run() {
|
|
|
101
101
|
$.NSThread.sleepForTimeInterval(wait);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`;function de(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e))return null;let n=[];for(let i of e.slice(0,D)){if(!Array.isArray(i)||i.length!==4||!i.every((u)=>typeof u==="number"&&Number.isFinite(u)))return null;let[s,a,c,d]=i.map(Math.round);if(c>0&&d>0)n.push({x:s,y:a,width:c,height:d})}return n}function
|
|
104
|
+
`;function de(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e))return null;let n=[];for(let i of e.slice(0,D)){if(!Array.isArray(i)||i.length!==4||!i.every((u)=>typeof u==="number"&&Number.isFinite(u)))return null;let[s,a,c,d]=i.map(Math.round);if(c>0&&d>0)n.push({x:s,y:a,width:c,height:d})}return n}function Gn(t){let e=Date.now(),n=0,i=!1,s=(u,b={})=>{try{process.stderr.write(`${JSON.stringify({event:"display.windows_helper",state:u,...b})}
|
|
105
105
|
`)}catch{}},a=(u,b={})=>{if(i)return;i=!0,s(u,{updates:n,duration_ms:Date.now()-e,...b})},c=E(j,["-l","JavaScript","-e",le],{env:{},stdio:["ignore","pipe","ignore"]});s("started");let d="";return c.stdout.on("data",(u)=>{if(i)return;d+=u.toString("utf8");for(let b=d.indexOf(`
|
|
106
106
|
`);b>=0;b=d.indexOf(`
|
|
107
|
-
`)){let m=de(d.slice(0,b));if(d=d.slice(b+1),m)n++,t(m)}if(d.length>65536)d=""}),c.once("error",(u)=>a("failed",{code:u.code??"spawn_failed"})),c.once("exit",(u,b)=>a("failed",{code:"exited",exit_code:u,signal:b})),{close(){a("stopped"),c.kill("SIGKILL")}}}var T=5,R=[{bit:1,button:0,down:1,up:2,drag:6},{bit:4,button:1,down:3,up:4,drag:7},{bit:2,button:2,down:25,up:26,drag:27}],fe=[[8,1,0],[16,-1,0],[32,0,1],[64,0,-1]],P=50,pe=500,V=4,I=131072,W=262144,O=524288,F=1048576,B=new Map([[65505,[56,I]],[65506,[60,I]],[65507,[59,W]],[65508,[62,W]],[65511,[58,O]],[65512,[61,O]],[65513,[58,O]],[65514,[61,O]],[65027,[61,O]],[65515,[55,F]],[65516,[54,F]]]),be=new Map([[65288,51],[65289,48],[65056,48],[65293,36],[65307,53],[65535,117],[65509,57],[65360,115],[65361,123],[65362,126],[65363,124],[65364,125],[65365,116],[65366,121],[65367,119],[65379,114],[65386,114],[65291,71],[65408,49],[65421,76],[65429,115],[65430,123],[65431,126],[65432,124],[65433,125],[65434,116],[65435,121],[65436,119],[65437,71],[65438,114],[65439,117],[65450,67],[65451,69],[65452,65],[65453,78],[65454,65],[65455,75],[65469,81],...[82,83,84,85,86,87,88,89,91,92].map((t,e)=>[65456+e,t]),...[122,120,99,118,96,97,98,100,101,109,103,111,105,107,113,106,64,79,80,90].map((t,e)=>[65470+e,t])]),G="asdfhgzxcv\x00bqweryt123465=97-80]ou[ip\x00lj'k;\\,/nm.\x00 `",Y='~!@#$%^&*()_+{}|:"<>?',he="`1234567890-=[]\\;',./",k=new Map;for(let t=0;t<G.length;t++){let e=G[t];if(e==="\x00")continue;if(k.set(e.charCodeAt(0),[t,!1]),e>="a"&&e<="z")k.set(e.toUpperCase().charCodeAt(0),[t,!0])}for(let t=0;t<Y.length;t++)k.set(Y.charCodeAt(t),[k.get(he.charCodeAt(t))[0],!0]);class K{now;x=-1;y=-1;mask=0;clicks=0;lastDown=null;held=new Set;constructor(t=()=>performance.now()){this.now=t}flags(){let t=0;for(let e of this.held)t|=B.get(e)[1];return t}mouse(t,e){return`m ${t} ${this.x} ${this.y} ${e} ${t===T?0:this.clicks} ${this.flags()}`}pointer(t,e,n){let i=[];if(t!==this.x||e!==this.y){this.x=t,this.y=e;let s=R.find((a)=>this.mask&a.bit);i.push(s?this.mouse(s.drag,s.button):this.mouse(T,0))}for(let s of R){let a=(this.mask&s.bit)!==0,c=(n&s.bit)!==0;if(!a&&c){let d=this.now(),u=this.lastDown;this.clicks=u&&u.button===s.button&&d-u.at<=pe&&Math.abs(t-u.x)<=V&&Math.abs(e-u.y)<=V?this.clicks+1:1,this.lastDown={button:s.button,at:d,x:t,y:e},i.push(this.mouse(s.down,s.button))}else if(a&&!c)i.push(this.mouse(s.up,s.button))}for(let[s,a,c]of fe)if(!(this.mask&s)&&n&s)i.push(`w ${a*P} ${c*P} ${this.flags()}`);return this.mask=n,i}key(t,e){let n=t?1:0,i=B.get(e);if(i){if(t)this.held.add(e);else this.held.delete(e);return[`k ${i[0]} ${n} ${this.flags()}`]}let s=be.get(e);if(s!==void 0)return[`k ${s} ${n} ${this.flags()}`];let a=e<256?e:(e&4278190080)===16777216?e&16777215:0,c=k.get(a);if(c)return[`k ${c[0]} ${n} ${this.flags()|(c[1]?I:0)}`];if(a<160||a>65535||a>=55296&&a<57344)return[];return[`u ${n} ${a} ${this.flags()}`]}}function
|
|
107
|
+
`)){let m=de(d.slice(0,b));if(d=d.slice(b+1),m)n++,t(m)}if(d.length>65536)d=""}),c.once("error",(u)=>a("failed",{code:u.code??"spawn_failed"})),c.once("exit",(u,b)=>a("failed",{code:"exited",exit_code:u,signal:b})),{close(){a("stopped"),c.kill("SIGKILL")}}}var T=5,R=[{bit:1,button:0,down:1,up:2,drag:6},{bit:4,button:1,down:3,up:4,drag:7},{bit:2,button:2,down:25,up:26,drag:27}],fe=[[8,1,0],[16,-1,0],[32,0,1],[64,0,-1]],P=50,pe=500,V=4,I=131072,W=262144,O=524288,F=1048576,B=new Map([[65505,[56,I]],[65506,[60,I]],[65507,[59,W]],[65508,[62,W]],[65511,[58,O]],[65512,[61,O]],[65513,[58,O]],[65514,[61,O]],[65027,[61,O]],[65515,[55,F]],[65516,[54,F]]]),be=new Map([[65288,51],[65289,48],[65056,48],[65293,36],[65307,53],[65535,117],[65509,57],[65360,115],[65361,123],[65362,126],[65363,124],[65364,125],[65365,116],[65366,121],[65367,119],[65379,114],[65386,114],[65291,71],[65408,49],[65421,76],[65429,115],[65430,123],[65431,126],[65432,124],[65433,125],[65434,116],[65435,121],[65436,119],[65437,71],[65438,114],[65439,117],[65450,67],[65451,69],[65452,65],[65453,78],[65454,65],[65455,75],[65469,81],...[82,83,84,85,86,87,88,89,91,92].map((t,e)=>[65456+e,t]),...[122,120,99,118,96,97,98,100,101,109,103,111,105,107,113,106,64,79,80,90].map((t,e)=>[65470+e,t])]),G="asdfhgzxcv\x00bqweryt123465=97-80]ou[ip\x00lj'k;\\,/nm.\x00 `",Y='~!@#$%^&*()_+{}|:"<>?',he="`1234567890-=[]\\;',./",k=new Map;for(let t=0;t<G.length;t++){let e=G[t];if(e==="\x00")continue;if(k.set(e.charCodeAt(0),[t,!1]),e>="a"&&e<="z")k.set(e.toUpperCase().charCodeAt(0),[t,!0])}for(let t=0;t<Y.length;t++)k.set(Y.charCodeAt(t),[k.get(he.charCodeAt(t))[0],!0]);class K{now;x=-1;y=-1;mask=0;clicks=0;lastDown=null;held=new Set;constructor(t=()=>performance.now()){this.now=t}flags(){let t=0;for(let e of this.held)t|=B.get(e)[1];return t}mouse(t,e){return`m ${t} ${this.x} ${this.y} ${e} ${t===T?0:this.clicks} ${this.flags()}`}pointer(t,e,n){let i=[];if(t!==this.x||e!==this.y){this.x=t,this.y=e;let s=R.find((a)=>this.mask&a.bit);i.push(s?this.mouse(s.drag,s.button):this.mouse(T,0))}for(let s of R){let a=(this.mask&s.bit)!==0,c=(n&s.bit)!==0;if(!a&&c){let d=this.now(),u=this.lastDown;this.clicks=u&&u.button===s.button&&d-u.at<=pe&&Math.abs(t-u.x)<=V&&Math.abs(e-u.y)<=V?this.clicks+1:1,this.lastDown={button:s.button,at:d,x:t,y:e},i.push(this.mouse(s.down,s.button))}else if(a&&!c)i.push(this.mouse(s.up,s.button))}for(let[s,a,c]of fe)if(!(this.mask&s)&&n&s)i.push(`w ${a*P} ${c*P} ${this.flags()}`);return this.mask=n,i}key(t,e){let n=t?1:0,i=B.get(e);if(i){if(t)this.held.add(e);else this.held.delete(e);return[`k ${i[0]} ${n} ${this.flags()}`]}let s=be.get(e);if(s!==void 0)return[`k ${s} ${n} ${this.flags()}`];let a=e<256?e:(e&4278190080)===16777216?e&16777215:0,c=k.get(a);if(c)return[`k ${c[0]} ${n} ${this.flags()|(c[1]?I:0)}`];if(a<160||a>65535||a>=55296&&a<57344)return[];return[`u ${n} ${a} ${this.flags()}`]}}function Kn(t,e=[]){let n=E(...v(e),{env:{},stdio:["pipe","pipe","ignore"]}),i=new K,s="",a=!1,c=null,d=()=>{n.kill("SIGKILL"),c?.kill("SIGKILL")},u=(f)=>{if(a)return;a=!0,d(),t.end(f)},b=(f)=>u({error:new r("display_unavailable",f)}),m=(f)=>{if(a||f.length===0)return;if(n.stdin.write(f.map((g)=>`${g}
|
|
108
108
|
`).join("")),n.stdin.writableLength>ae)u({reason:"input_backpressure"})},z=()=>{c=E(...v(e,"clipboard"),{env:{},stdio:["ignore","pipe","ignore"]});let f="";c.stdout?.on("data",(g)=>{if(a)return;f+=g.toString("ascii");for(let h=f.indexOf(`
|
|
109
109
|
`);h>=0;h=f.indexOf(`
|
|
110
110
|
`)){let U=f.slice(0,h);if(f=f.slice(h+1),!U.startsWith("c "))continue;let A=U.slice(2);if(A.length>Math.ceil(S/3)*4||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(A)){u({reason:"display_protocol"});return}let C=Buffer.from(A,"base64");if(C.byteLength<=S)t.clipboard(C.toString("utf8"));if(a)return}if(f.length>Math.ceil(S/3)*4+2)u({reason:"display_protocol"})}),c.once("error",()=>b("Reason could not watch this Mac's desktop clipboard.")),c.once("exit",()=>{if(!a)b("Reason could not watch this Mac's desktop clipboard.")})};return n.stdout.on("data",(f)=>{if(a||s===null)return;s+=f.toString("utf8");let g=s.indexOf(`
|
|
111
111
|
`);if(g<0){if(s.length>4096)u({reason:"display_protocol"});return}let h=q(s.slice(0,g));if(s=null,!h)u({reason:"display_protocol"});else if(!h.screen||!h.accessibility)b(e.length>0?"Reason's background worker needs Screen Recording and Accessibility on this Mac (its own Reason entry in System Settings > Privacy & Security, not the Reason app's): run `reason permissions allow` on this Mac.":"Allow Screen Recording and Accessibility for this Mac's Reason worker, then restart it.");else z(),t.ready({width:h.width,height:h.height})}),n.stdin.on("error",()=>{return}),n.once("error",()=>b("Reason could not start this Mac's desktop input.")),n.once("exit",()=>{if(s!==null)b("Reason could not start this Mac's desktop input.");else u({reason:"display_closed"})}),{pointer:(f,g,h)=>m(i.pointer(f,g,h)),key:(f,g)=>m(i.key(f,g)),clipboard:(f)=>m([`c ${Buffer.from(f,"utf8").toString("base64")}`]),close(){a=!0,d()}}}
|
|
112
|
-
export{
|
|
112
|
+
export{xo,ko,ht,Co,S,Ao,Po,qn,Ro,To,Io,Do,Wn,Oo,Qt,Vn,Ye,ft,Gn,Kn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{N}from"./vm-hands-entry-lite-48rphbjm.js";import{O,T,b}from"./vm-hands-entry-lite-
|
|
3
|
-
`)}).finally(()=>{if(c.get(w.port)===L)c.delete(w.port)})},dispose(){for(let _ of c.values())_.abort();c.clear()}}}class st 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",H=new Map;function be(e){let c=H.get(e.operation_id);if(c){if(c.claim!==e)throw C("process_authority_lost");return c}if(H.size>=fe)throw C("process_journal_capacity");let _={claim:e,executing:!1,cancelRequested:!1,phase:"pending"};return H.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)),C=(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(
|
|
2
|
+
import{N}from"./vm-hands-entry-lite-48rphbjm.js";import{O,T,b}from"./vm-hands-entry-lite-1yv5qqew.js";import{je,gr,_r,Sn,En,ct}from"./vm-hands-entry-lite-99wrj4vv.js";import{Or}from"./vm-hands-entry-lite-dgfx0rbn.js";import{p,ut,An,_e,we}from"./vm-hands-entry-lite-bpamn7ny.js";import{v,h}from"./vm-hands-entry-lite-h1qjggz0.js";import{a,nr,Wo}from"./vm-hands-entry-lite-8dfw96ym.js";import{an,y,t,k,o,d,ms,Ie,Bi,u,n,W,g,ee,s,i,cn}from"./vm-hands-entry-lite-wzv13c8k.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{se,A}from"./vm-hands-entry-lite-tyem93c1.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=n({action:i("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),n({...K,action:i("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(),n({...K,action:i("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=n({version:i(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(n({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=n({operation_constraints:ee(t(),Ie())}),Ye=n({ready:i(!0),version:i(1),execution_mode:s(["host","confined"]),max_timeout_ms:o().int().min(1000).optional()});var De=n({version:i(1),process_id:t().uuid(),state:s(["queued","cancelled_before_start","not_started"]),exit_code:ms(),output:u(Bi()).length(0),first_cursor:i(0),next_cursor:i(0),truncated:i(!1),cancellation_requested:i(!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(),Ce=n({...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:i("lost").optional().describe("Historical receipt only; the current Brain cannot control this older-generation process."),recovery:n({cause:i("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(i("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(Ce),Qe=W([J,De.refine((e)=>e.state==="cancelled_before_start")]),X=n({version:i(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=n({process_terminal_observation:X}).strict();var Xi="preview.serve.v1",Yi=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})?$/,Ae=n({version:i(_n),allowed_domains:u(t().max(260).regex(yn)).max(1024)}).strict(),ke=cn((e)=>N(e)!==null,"invalid workspace"),Oe=n({version:i(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:ke,egress:Ae.optional()}).strict(),Qi=Oe.extend({expires_at:y.datetime()}).strict();var Me=4,Te=5000;function Y(e,c,_){let l=null;try{l=ut(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),I;try{I=ut(_)}catch{return l("binding_invalid")}let{binding:w,deviceRelayUrl:z}=I,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 R=x instanceof Error?x.message:"preview_failed";if(R!=="preview_not_authorized")process.stderr.write(`${JSON.stringify({event:"worker_preview.open_failed",job_id:w.jobId,port:w.port,reason_code:R})}
|
|
3
|
+
`)}).finally(()=>{if(c.get(w.port)===L)c.delete(w.port)})},dispose(){for(let _ of c.values())_.abort();c.clear()}}}class st 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",H=new Map;function be(e){let c=H.get(e.operation_id);if(c){if(c.claim!==e)throw C("process_authority_lost");return c}if(H.size>=fe)throw C("process_journal_capacity");let _={claim:e,executing:!1,cancelRequested:!1,phase:"pending"};return H.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)),C=(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(Or({},e)),l=qe(nr(e),_),[I,...w]=l.split(Je);return{directory:j(c,l,"processes"),previous:[j(_,"processes"),...I==="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=Wo();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 C("process_authority_lost");let c=be(e.claim);if(c.executing)throw C("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,folders:[e.root,e.cwd]});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 I=me(l.journalDirectory),w=e.claim.capability===he,z=()=>B.set(e.claim.operation_id,{path:l.journalDirectory,ino:I.ino,dev:I.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:O,protocolVersion:2,workerArtifactSha256:b,workerEntrypoint:T,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 R=!1,F=new Promise((m,S)=>{x.once("exit",(f)=>{R=!0,m(f)}),x.once("error",(f)=>{R=!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},V=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 C(S.error);return S.job},U=!1,q=!1,te,re=()=>{U=!0,ct(x,"SIGTERM")};e.signal.addEventListener("abort",re,{once:!0});let M,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;M=J.parse(f),await e.emit(M),oe=Date.now()};try{let m=Math.min(Date.now()+1e4,e.expiresAtMs);while(!Z(P.readyPath)){if(R)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 C("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 C();if(e.signal.throwIfAborted(),c.cancelRequested)return pe(e.claim.operation_id);let f;try{q=!0,f=await V("start")}catch(D){if(!(D instanceof r)||D.code!=="hands_job_result_unknown")throw D;f=await V("inspect")}if(c.phase="running",c.cancel=async()=>{await V("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"&&!R?await V("probe"):null});if(c.cancelRequested)await c.cancel(),f=await V("inspect");for(;;){if(!["starting","running"].includes(f.state))c.phase="settling",c.cancel=void 0;if(!M||M.state!==f.state||M.next_cursor!==f.nextCursor&&Date.now()-oe>=5000)await ve(f);if(!["starting","running"].includes(f.state))break;if(e.signal.aborted||R)throw C();await ue(1000);try{f=await V("inspect"),te=void 0}catch(D){if(!(D instanceof r)||D.code!=="hands_job_result_unknown"||e.signal.aborted||R||Date.now()-(te??=Date.now())>120000)throw D}}if(!M||M.state==="uncertain")throw C();return M}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),!R&&!U)ct(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{ct(x,"SIGKILL")}catch{}try{await F}finally{if(R)l.disposeSocket()}throw C("process_cleanup_unconfirmed")}try{if((U||e.signal.aborted)&&S.code===0&&q){v(E);let f=JSON.parse(h(P.directTerminalReceiptPath)),D=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&&D.success&&D.data.process_id===e.claim.operation_id){if(w)z();throw new st(D.data)}}}catch(f){if(f instanceof st)throw f}finally{if(R)l.disposeSocket()}if(S.code!==0&&!U&&q)throw C("process_cleanup_unconfirmed");if(!U&&S.code===0&&(M&&["exited","cancelled","expired"].includes(M.state)||!q&&c.cancelRequested)||w&&S.code===0&&!q)z()}}async function js(e,c){if(c.kind===ce&&e.capability===he){let I=H.get(e.operation_id);if(I?.claim===e&&I.tunnels)I.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 _=H.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 Hs(e,c){H.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{Xi,Yi,_n,Zi,yn,Qi,st,fr,js,Hs};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{resolve as s,sep as i}from"path";var
|
|
3
|
-
export{
|
|
2
|
+
import{resolve as s,sep as i}from"path";var Ee=[[".ssh"],[".gnupg"],[".aws"],[".azure"],[".kube"],[".docker"],[".infisical"],[".password-store"],[".terraform.d"],[".config","ara"],[".config","reason"],[".config","gh"],[".config","gcloud"],[".config","infisical"],[".config","op"],[".config","1password"],[".config","pass"],[".local","share","keyrings"],["library","keychains"],["library","application support","so.ara.desktop"],["appdata","roaming","github cli"],["appdata","roaming","gcloud"],["appdata","roaming","microsoft","credentials"],["appdata","local","microsoft","credentials"],["appdata","roaming","microsoft","protect"],["appdata","roaming","1password"],["appdata","local","1password"],["appdata","roaming","microsoft","windows","start menu","programs","startup"],["documents","windowspowershell"],["documents","powershell"],["appdata","local","reason"]],Xt=[[".codex","config.toml"],[".cursor","mcp.json"],[".claude","settings.json"],[".claude","settings.local.json"],[".cargo","credentials"],[".cargo","credentials.toml"],[".gem","credentials"],[".config","git","config"],[".config","git","credentials"],[".config","pip","pip.conf"]],Yt=new Set([".bash_login",".bash_profile",".bashrc",".bunfig.toml",".claude.json",".env",".envrc",".git-credentials",".gitconfig",".mcp.json",".netrc",".npmrc",".profile",".pypirc",".terraformrc",".yarnrc",".yarnrc.yml",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","auth.json","credentials.json","credentials.tfrc.json","local-daemon.json","local-device.json","mcp.json"]),Zt=[".key",".p12",".pfx",".pem"];function t(n,a){if(n.length<a.length)return!1;for(let r=0;r<=n.length-a.length;r+=1)if(a.every((o,e)=>n[r+e]===o))return!0;return!1}function E(n){let a=s(n).split(i).filter(Boolean).map((o)=>o.toLowerCase());if(Ee.some((o)=>t(a,o)))return!0;if(Xt.some((o)=>t(a,o)))return!0;let r=a.at(-1)??"";return Yt.has(r)||r.startsWith(".env.")||Zt.some((o)=>r.endsWith(o))}
|
|
3
|
+
export{Ee,Xt,Yt,Zt,E};
|