@reason-machines/cli-linux-x64 0.2.555 → 0.2.557
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 +2 -2
- package/bin/vm-hands/{api-credentials-arrtadfe.js → api-credentials-f3hvjncg.js} +1 -1
- package/bin/vm-hands/{api-453kzgb3.js → api-xvhh6n2b.js} +1 -1
- package/bin/vm-hands/{connect-cli-33btt5ny.js → connect-cli-agf4y140.js} +1 -1
- package/bin/vm-hands/{local-automation-5qwy01c7.js → local-automation-q0dbp6q2.js} +1 -1
- package/bin/vm-hands/{local-capabilities-mf5cm434.js → local-capabilities-wdha8a04.js} +1 -1
- package/bin/vm-hands/{local-display-session-7gvdydea.js → local-display-session-7n4g1866.js} +1 -1
- package/bin/vm-hands/local-display-video-c08akxwr.js +2 -0
- package/bin/vm-hands/{local-managed-process-d02r1axd.js → local-managed-process-40g4wzkg.js} +1 -1
- package/bin/vm-hands/{managed-runtime-dyea269c.js → managed-runtime-crmcwpw6.js} +1 -1
- package/bin/vm-hands/{permissions-4nhqq4q8.js → permissions-0ya3qw1x.js} +1 -1
- package/bin/vm-hands/{serve-service-5288h5s3.js → serve-service-f6dwvwm1.js} +1 -1
- package/bin/vm-hands/{status-zqw8s5y5.js → status-wnqhh5vr.js} +1 -1
- package/bin/vm-hands/version-n4b5pe8a.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2tbf0swk.js → vm-hands-entry-lite-06vs300m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-atv6x5d3.js → vm-hands-entry-lite-2m6hc16j.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-pb02nft0.js → vm-hands-entry-lite-67q3xtm2.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-7fzhm38p.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-mh46pt40.js → vm-hands-entry-lite-7ytgtvky.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-3apb2pjh.js → vm-hands-entry-lite-9b43kj6c.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-t87sehfe.js → vm-hands-entry-lite-c9ypwj11.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-f6b0cmq6.js → vm-hands-entry-lite-cdze3zys.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-b2szp9p8.js → vm-hands-entry-lite-cmavt1tn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-99wrj4vv.js → vm-hands-entry-lite-d0q28cs9.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-r2qrpjfq.js → vm-hands-entry-lite-fc8fzdzt.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bs7jaz1j.js → vm-hands-entry-lite-fhswgtda.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-mj7yar3a.js → vm-hands-entry-lite-g3msnkny.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-fde30yd5.js → vm-hands-entry-lite-kcv3tfbj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-b23s6pvp.js → vm-hands-entry-lite-w7m07rae.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-t46k8t4n.js → vm-hands-entry-lite-xwntsnkp.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-ycprx6c1.js → vm-hands-executor-8pc898gy.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-f9m5nsa4.js → vm-hands-op-runner-kekfsnka.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-a07nhqmd.js → vm-hands-runtime-f6c95bfc.js} +3 -3
- package/package.json +1 -1
- package/bin/vm-hands/local-display-video-vg02ywcz.js +0 -2
- package/bin/vm-hands/version-4nn7abs3.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-c4zazjyw.js +0 -2
package/bin/reason
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/reason
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 90310112 bytes
|
|
4
|
+
sha256: 6a351b22e3bd133c6496a198966b689fa65243b7e5cd30560c69a4acf1d7ad9c
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{zi,es,ts,As}from"./vm-hands-entry-lite-
|
|
2
|
+
import{zi,es,ts,As}from"./vm-hands-entry-lite-w7m07rae.js";import"./vm-hands-entry-lite-xwntsnkp.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{D,Ps,rs}from"./vm-hands-entry-lite-
|
|
2
|
+
import{D,Ps,rs}from"./vm-hands-entry-lite-xwntsnkp.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{it,Ss,Es,xs}from"./vm-hands-entry-lite-
|
|
2
|
+
import{it,Ss,Es,xs}from"./vm-hands-entry-lite-cmavt1tn.js";import"./vm-hands-entry-lite-ravxhygk.js";import"./vm-hands-entry-lite-q2h781jg.js";import"./vm-hands-entry-lite-w7m07rae.js";import"./vm-hands-entry-lite-xwntsnkp.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-fhswgtda.js";import"./vm-hands-entry-lite-67q3xtm2.js";import"./vm-hands-entry-lite-ak0hd94p.js";import"./vm-hands-entry-lite-9b43kj6c.js";import"./vm-hands-entry-lite-d0q28cs9.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-c9ypwj11.js";import"./vm-hands-entry-lite-fc8fzdzt.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-7ytgtvky.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-g3msnkny.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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{Pn,Us,zs,qs,Ws,Rn}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Pn,Us,zs,qs,Ws,Rn}from"./vm-hands-entry-lite-c9ypwj11.js";import"./vm-hands-entry-lite-fc8fzdzt.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-7ytgtvky.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-g3msnkny.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ns,Vi,mn,is,os,ss,as,$s,Ms,Bs,Fs}from"./vm-hands-entry-lite-
|
|
2
|
+
import{ns,Vi,mn,is,os,ss,as,$s,Ms,Bs,Fs}from"./vm-hands-entry-lite-67q3xtm2.js";import"./vm-hands-entry-lite-ak0hd94p.js";import"./vm-hands-entry-lite-9b43kj6c.js";import"./vm-hands-entry-lite-d0q28cs9.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-c9ypwj11.js";import"./vm-hands-entry-lite-fc8fzdzt.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-7ytgtvky.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-g3msnkny.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
package/bin/vm-hands/{local-display-session-7gvdydea.js → local-display-session-7n4g1866.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ft,Vs,G,qe,jt}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ft,Vs,G,qe,jt}from"./vm-hands-entry-lite-fc8fzdzt.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-7ytgtvky.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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-7ytgtvky.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
package/bin/vm-hands/{local-managed-process-d02r1axd.js → local-managed-process-40g4wzkg.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{st,fr,js,Hs}from"./vm-hands-entry-lite-
|
|
2
|
+
import{st,fr,js,Hs}from"./vm-hands-entry-lite-9b43kj6c.js";import"./vm-hands-entry-lite-d0q28cs9.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};
|
|
@@ -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-fhswgtda.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{us,ds,Ks,Js}from"./vm-hands-entry-lite-
|
|
2
|
+
import{us,ds,Ks,Js}from"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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};
|
|
@@ -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-g3msnkny.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-7fzhm38p.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-xwntsnkp.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-7fzhm38p.js";import"./vm-hands-entry-lite-w7m07rae.js";import{zt,dt}from"./vm-hands-entry-lite-dgfx0rbn.js";import{w,B,pr,Be,it}from"./vm-hands-entry-lite-cmavt1tn.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-67q3xtm2.js";import"./vm-hands-entry-lite-d0q28cs9.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-7ytgtvky.js";import"./vm-hands-entry-lite-2v4zh9ze.js";import"./vm-hands-entry-lite-06vs300m.js";import"./vm-hands-entry-lite-2m6hc16j.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-fhswgtda.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-g3msnkny.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-9b43kj6c.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-0wsr8edk.js";import"./vm-hands-entry-lite-fc8fzdzt.js";import"./vm-hands-entry-lite-c9ypwj11.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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qe}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Qe}from"./vm-hands-entry-lite-7fzhm38p.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{Ye,ft}from"./vm-hands-entry-lite-2v4zh9ze.js";import{Qe}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ye,ft}from"./vm-hands-entry-lite-2v4zh9ze.js";import{Qe}from"./vm-hands-entry-lite-7fzhm38p.js";import{$o,le,Kr,gt,Mo}from"./vm-hands-entry-lite-06vs300m.js";import{E}from"./vm-hands-entry-lite-46pwqvpf.js";import{a,nr}from"./vm-hands-entry-lite-8dfw96ym.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 qr=(e,t)=>{if(l)S(l);let s=O(e,$o);try{_(s,v.X_OK)}catch{return()=>{}}let n;try{n=A(s,["--app",e,"--name",C(e,".app"),"--permission",t==="screen"?"screen_recording":"accessibility"],{detached:!0,stdio:"ignore"})}catch{return()=>{}}return n.on("error",()=>{if(l===n)l=null}),n.once("exit",()=>{if(l===n)l=null}),n.unref(),l=n,()=>S(n)};import{chmodSync as ne,existsSync as se,mkdirSync as re,readFileSync as D,realpathSync as ie,renameSync as oe,statSync as j,writeFileSync as ae}from"fs";import{dirname as de,isAbsolute as G,join as N,resolve as T,sep as b}from"path";function F(e=a()){return N(nr(e),"reason","protected-path-grants.json")}var f=null;function L(e){let t=JSON.parse(e);if(!Array.isArray(t?.grants))return[];return t.grants.flatMap((s)=>{let n=s;return n&&typeof n.path==="string"&&G(n.path)&&(n.kind==="file"||n.kind==="folder")&&typeof n.grantedAt==="number"?[{path:n.path,kind:n.kind,grantedAt:n.grantedAt}]:[]})}function y(e=F()){try{let{mtimeMs:t}=j(e);if(f&&f.file===e&&f.mtimeMs===t)return f.grants;let s=L(D(e,"utf8"));return f={file:e,mtimeMs:t,grants:s},s}catch{return[]}}function W(e,t){return e.kind==="file"?t===e.path:t===e.path||t.startsWith(`${e.path}${b}`)}function U(e,t){let s=T(e);return y(t).some((n)=>W(n,s))}function So(e,t){return E(e)&&!U(e,t)}function Eo(e,t,s){let n=t?"file-read* file-write*":"file-read*";return y(s).filter((r)=>r.path===e||r.path.startsWith(`${e}${b}`)).map((r)=>`(allow ${n} (${r.kind==="file"?"literal":"subpath"} ${JSON.stringify(r.path)}))`)}var P="x-apple.systempreferences:com.apple.preference.security",J="curl -fsSL https://reasonmachines.com/install.sh | bash",q=180000,B=2000;var k={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${P}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${P}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${P}?Privacy_AllFiles`}};function R(e){return e.executable}function K(e,t){if(e==="computer_use_identity_missing")return`Reason's background identity is not installed (${e}); reinstall Reason: ${J}`;if(e==="computer_use_identity_outdated")return`Reason's background identity is outdated (${Kr(t)??"unknown"}; this CLI is ${Qe}) (${e}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${e}); run the installed \`reason\``}function us(e=a()){let t=gt(e);if(t.length>0)return{state:"ready",path:w(w(w(t[0]))),prefix:t};let s=Mo(t,e)??"computer_use_identity_unavailable";return{state:s,path:le(e),detail:K(s,e)}}function V(){return{identity:()=>us(),grants:(e)=>Ye(e),request:(e,t)=>ft(e,t),worker:async()=>(await import("./status-wnqhh5vr.js")).connectionMacState(),open:(e)=>{H("/usr/bin/open",e,{stdio:"ignore",timeout:1e4})},tile:qr,restartConnection:async()=>(await import("./connect-cli-agf4y140.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 ds(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 Ks(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 Js(e,t){let s=t.host??V(),{io:n}=t,r=await ds(s),i=r.permissions.filter((o)=>e.includes(o.id)&&o.state!=="granted");if(i.length===0)return n.stdout.write(`Reason permissions: ${e.map((o)=>k[o].label).join(", ")} already allowed.
|
|
3
3
|
`),0;let c=!1,u=!1,d=s.identity();for(let o of i){let{label:p,pane:h}=k[o.id];if(o.id!=="disk"){if(d.state!=="ready"){if(!c)n.stderr.write(`Reason permissions: ${d.detail}
|
|
4
4
|
`);c=!0;continue}let g=o.id;await s.request(d.prefix,g),s.open([h]);let I=s.tile(d.path,g);if(n.stdout.write(`Allow Reason in System Settings > Privacy & Security > ${p}.
|
|
5
5
|
`),!t.wait)continue;if(n.stdout.write(`Waiting for it (Ctrl-C to stop)\u2026
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nt,Et,cr,on,xt,kt,Di,sn,Oi,Ni,Li}from"./vm-hands-entry-lite-fxzadxz4.js";import{Pe,sr,ni,wt,Go,oe,Ko,Jo,tt,Re,nn,oi,vt,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Z,Te,q,Si,Ei,xi,ki,Ci,Ai,Pi,Ri,St,Ti}from"./vm-hands-entry-lite-07apxfh8.js";import{ue,X,I,N}from"./vm-hands-entry-lite-48rphbjm.js";import{P,Vt}from"./vm-hands-entry-lite-n7bd44rm.js";import{mr,eo,to,at,ro,no,io,oo,so,ao,yr,wr,br,wn,bn,vr,lo,vn,Sr,me,ge,Ot,Er,kr,Nt}from"./vm-hands-entry-lite-
|
|
2
|
+
import{nt,Et,cr,on,xt,kt,Di,sn,Oi,Ni,Li}from"./vm-hands-entry-lite-fxzadxz4.js";import{Pe,sr,ni,wt,Go,oe,Ko,Jo,tt,Re,nn,oi,vt,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Z,Te,q,Si,Ei,xi,ki,Ci,Ai,Pi,Ri,St,Ti}from"./vm-hands-entry-lite-07apxfh8.js";import{ue,X,I,N}from"./vm-hands-entry-lite-48rphbjm.js";import{P,Vt}from"./vm-hands-entry-lite-n7bd44rm.js";import{mr,eo,to,at,ro,no,io,oo,so,ao,yr,wr,br,wn,bn,vr,lo,vn,Sr,me,ge,Ot,Er,kr,Nt}from"./vm-hands-entry-lite-d0q28cs9.js";import{O,T,b}from"./vm-hands-entry-lite-1yv5qqew.js";import{Xi,Yi,_n,Zi,yn,Qi,st,fr}from"./vm-hands-entry-lite-9b43kj6c.js";import{K}from"./vm-hands-entry-lite-wghmyfba.js";import{Ue}from"./vm-hands-entry-lite-gje7xvy9.js";import{j}from"./vm-hands-entry-lite-dgfx0rbn.js";import{hr,gn,Ji}from"./vm-hands-entry-lite-ak0hd94p.js";import{xo,ko,ht,Co,Ao,Po,Ro,To,Io,Do}from"./vm-hands-entry-lite-2v4zh9ze.js";import{Rr,Ht,Tr,Tn,In}from"./vm-hands-entry-lite-0wsr8edk.js";import{Ft,qe,jt}from"./vm-hands-entry-lite-fc8fzdzt.js";import{Un,x,vo}from"./vm-hands-entry-lite-7ytgtvky.js";import{So,Eo}from"./vm-hands-entry-lite-2m6hc16j.js";import{Bt,Pn,Rn}from"./vm-hands-entry-lite-c9ypwj11.js";import{ye,ho,fo}from"./vm-hands-entry-lite-bpamn7ny.js";import{be}from"./vm-hands-entry-lite-yretc2th.js";import{Mt}from"./vm-hands-entry-lite-yptpy066.js";import{Ee,Xt,Yt,Zt,E}from"./vm-hands-entry-lite-46pwqvpf.js";import{a,ie}from"./vm-hands-entry-lite-8dfw96ym.js";import{t,k,o,d,u,n,W,g,ee,s,i,Zo}from"./vm-hands-entry-lite-wzv13c8k.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{fe,Ne,Le,$e,ln}from"./vm-hands-entry-lite-tyem93c1.js";import{Me}from"./vm-hands-entry-lite-3gbf905c.js";import{request as Fl}from"http";import{request as Ul}from"https";import{lookup as Hl}from"dns/promises";import{isIP as jl}from"net";async function ql(e){let l=new URL(e.url);return await new Promise((c,p)=>{let m=(l.protocol==="https:"?Ul:Fl)(l,{method:"POST",headers:{...e.headers,"accept-encoding":"identity"},signal:e.signal,timeout:Di},(f)=>c({response:f,close:()=>{f.destroy(),m.destroy(),f.socket?.destroy()}}));m.once("error",p),m.once("timeout",()=>m.destroy(Object.assign(Error("custom_endpoint_timeout"),{code:"ETIMEDOUT"}))),m.end(e.body)})}var es=new Set(["ENOTFOUND","EAI_AGAIN","EAI_NONAME","EAI_NODATA","EAI_FAIL","DNSException"]),Wl=new Set(["ECONNREFUSED","ETIMEDOUT","ECONNRESET","EHOSTUNREACH","ENETUNREACH","EHOSTDOWN","ENETDOWN","EPIPE","ECONNABORTED","EADDRNOTAVAIL","ConnectionRefused","ConnectionClosed","ConnectionTimedOut","Timeout"]);function ts(e,l=0){if(!e||typeof e!=="object"||l>3)return null;let c=e.code;if(typeof c==="string"){if(es.has(c))return"custom_endpoint_host_not_found";if(Wl.has(c))return"custom_endpoint_connection_failed";if(/^(?:ERR_TLS_|ERR_SSL_|CERT_|UNABLE_TO_(?:GET|VERIFY|DECRYPT)|DEPTH_ZERO_SELF_SIGNED|SELF_SIGNED_CERT|HOSTNAME_MISMATCH|EPROTO$)/.test(c))return"custom_endpoint_tls_failed"}for(let p of[...e instanceof AggregateError?e.errors:[],e.cause]){let m=ts(p,l+1);if(m)return m}return null}async function Vl(e,l){let c=ts(e),p=new URL(l).hostname.replace(/^\[|\]$/g,"");if(c!==null&&c!=="custom_endpoint_connection_failed"||jl(p)!==0)return c;let m;return await Promise.race([Hl(p).then(()=>!0,(h)=>!es.has(String(h?.code))),new Promise((h)=>{m=setTimeout(()=>h(!0),5000)})]).finally(()=>clearTimeout(m))?c:"custom_endpoint_host_not_found"}function zl(e){for(let l=42;;l++){if(l===127)l=256;let c=String.fromCodePoint(l);if(!e.includes(c))return c}}function Gl(e,l){let c=Buffer.from(e),p=Buffer.from(l),m=new Uint32Array(c.length);for(let h=1,y=0;h<c.length;h++){while(y&&c[h]!==c[y])y=m[y-1];if(c[h]===c[y])y++;m[h]=y}let f=0;return(h,y=!1)=>{let S=Buffer.allocUnsafe(h.length*p.length+f),w=0;for(let _ of h){while(f&&c[f]!==_){let v=m[f-1];w+=c.copy(S,w,0,f-v),f=v}if(c[f]===_){if(f++,f===c.length)w+=p.copy(S,w),f=0}else S[w++]=_}if(y)w+=c.copy(S,w,0,f),f=0;return S.subarray(0,w)}}async function rs(e){e.signal.throwIfAborted();let l=Oi.safeParse(e.payload);if(!l.success)throw new r("custom_endpoint_invalid_request","Invalid local model request.");let c=l.data,p=Ni.parse(await e.credential(e.signal));if(!sn(c,{baseUrl:c.baseUrl,api:p.api,execution:"device"}))throw new r("custom_endpoint_invalid_request","The request does not match the configured API.");e.signal.throwIfAborted();let m,f,h=0,y=0,S=0,w=zl(p.apiKey),_=Gl(p.apiKey,w),v=async(C,A)=>{e.signal.throwIfAborted(),await new Promise((F,L)=>{let M=()=>{e.signal.removeEventListener("abort",M),L(e.signal.reason)};if(e.signal.addEventListener("abort",M,{once:!0}),e.signal.aborted){M();return}Promise.resolve().then(()=>(e.signal.throwIfAborted(),e.emit(C,A))).then(()=>{e.signal.removeEventListener("abort",M),F()},(B)=>{e.signal.removeEventListener("abort",M),L(B)})})},R=async(C)=>{if(h+=C.length,h>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");for(let A=0;A<C.length;A+=Et){if(S>=on)throw new r("custom_endpoint_response_too_large","Local model response exceeds the chunk limit.");await v(`custom_endpoint.chunk.${S++}`,{eof:!1,data:C.subarray(A,A+Et).toString("base64")})}};try{let C=await ql({url:c.url,body:c.body,signal:e.signal,headers:{...c.headers,...p.api==="anthropic-messages"?{"x-api-key":p.apiKey}:{authorization:`Bearer ${p.apiKey}`}}});m=C.response,f=C.close;let A=m.statusCode??500;if(A>=300&&A<400)throw new r("custom_endpoint_redirect_refused","Local model redirects are not followed.");if(m.headers["content-encoding"]&&m.headers["content-encoding"]!=="identity")throw new r("custom_endpoint_encoding_unsupported","The local server must honor identity encoding.");let F={};for(let L of["content-type","retry-after","x-request-id","request-id"]){let M=m.headers[L];if(typeof M==="string")F[L]=M.replaceAll(p.apiKey,w).slice(0,4096)}await v("custom_endpoint.headers",{status:A,statusText:(m.statusMessage??"").replaceAll(p.apiKey,w).slice(0,256),headers:F});for await(let L of m){e.signal.throwIfAborted();let M=Buffer.isBuffer(L)?L:Buffer.from(L);if(y+=M.length,y>cr)throw new r("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");await R(_(M))}return await R(_(Buffer.alloc(0),!0)),await v(`custom_endpoint.chunk.${S}`,{eof:!0}),{bytes:h,chunks:S}}catch(C){if(e.signal.throwIfAborted(),C instanceof r)throw C;throw new r((m?null:await Vl(C,c.url))??"custom_endpoint_request_failed","The local model server could not complete the request.")}finally{f?.()}}import{join as ls}from"path";function Yl(e,l){return e===ls(l,".ara","workspace")||e===ls(l,".reason","workspace")}function cs(e,l){let c=e.filter((p)=>Yl(p.path,l));return c.length===1?c[0].path:null}var Kl=/^[a-f0-9]{64}$/;var cn=32,Xl=/^\/[^\x00-\x1f\x7f\\]*$/;function Or(e){if(typeof e!=="string"||e.length>4096||!Xl.test(e))return!1;if(e==="/")return!0;return e.split("/").slice(1).every((l)=>l!==""&&l!=="."&&l!=="..")}function Ir(e,l){let c=l==="win32"?/^([A-Za-z]):[\\/]*(.*)$/.exec(e):null;if(!c)return e;let p=c[2].split(/[\\/]+/).filter(Boolean).join("/");return`/${c[1].toUpperCase()}:${p?`/${p}`:""}`}function un(e){if(!e||typeof e!=="object"||Array.isArray(e))return;let l=e;if(!Or(l.home)||!Array.isArray(l.roots)||l.roots.length>cn)return;let c=[];for(let p of l.roots){if(!p||typeof p!=="object"||Array.isArray(p))return;let{path_fingerprint:m,path:f}=p;if(typeof m!=="string"||!Kl.test(m)||!Or(f))return;c.push({path_fingerprint:m,path:f})}return{home:l.home,roots:c}}function Jl(e){let l=/^Reason contributor (rc_[0-9a-f]{32})$/.exec(e.name)?.[1];return e.email.toLowerCase()==="343777287+reason-contributors@users.noreply.github.com"&&l?l:void 0}function Zl(e){return Jl(e)??e.email.toLowerCase()}function dn(e){let l=/^Co-authored-by:\s*([^<>\r\n]+) <([^<>\s]+)>$/i.exec(e.trim());return l?Zl({name:l[1],email:l[2]}):e.trim().toLowerCase()}var zt=(e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[a-z]/gi,(l)=>`[${l.toLowerCase()}${l.toUpperCase()}]`),Ql=[...Ee.map((e)=>`/(${e.map(zt).join("/")})(/|$)`),...Xt.map((e)=>`/(${e.map(zt).join("/")})(/|$)`),...[...Yt].map((e)=>`/(${zt(e)})$`),`/${zt(".env.")}[^/]*$`,...Zt.map((e)=>`/[^/]*${zt(e)}$`)],us=`function localGithubSandboxProfile(root, temporary) {
|
|
3
3
|
return ['(version 1)','(deny default)','(import "system.sb")','(allow process-exec process-fork)',
|
|
4
4
|
'(allow file-read* (subpath "/bin") (subpath "/sbin") (subpath "/usr/bin") (subpath "/usr/sbin") (subpath "/usr/libexec") (subpath "/usr/share") (subpath "/private/var/select") (literal "/private/var/db/xcode_select_link"))',
|
|
5
5
|
'(allow file-read-metadata (path-ancestors "/opt/homebrew/bin") (path-ancestors "/usr/local/bin") (path-ancestors "/Library/Developer/CommandLineTools"))',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{S,Qt,Vn,Ye,Gn,Kn}from"./vm-hands-entry-lite-2v4zh9ze.js";import{Zn}from"./vm-hands-entry-lite-
|
|
2
|
+
import{S,Qt,Vn,Ye,Gn,Kn}from"./vm-hands-entry-lite-2v4zh9ze.js";import{Zn}from"./vm-hands-entry-lite-06vs300m.js";import{zn}from"./vm-hands-entry-lite-wghmyfba.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as ys,spawn as We}from"child_process";import{existsSync as ws}from"fs";import{connect as xs}from"net";function pn(){let e=new Set,t=null,n=(s)=>({holder:t?.viewer??null,you:t===s,same_user:Boolean(t?.viewer&&s.viewer&&t.viewer.user_id===s.viewer.user_id)}),o=()=>{for(let s of e)s.notify(n(s))};return{join(s){return e.add(s),s.notify(n(s)),()=>{if(!e.delete(s))return;if(t!==s)return;t=null,o()}},claim(s){if(t===s||!e.has(s))return;t=s,o()}}}var ut=pn();import{createHash as vt}from"crypto";import{once as vn}from"events";import{createWriteStream as Sn,existsSync as mr,mkdirSync as gr,mkdtempSync as hr,readFileSync as le,readdirSync as br,renameSync as yr,realpathSync as En,rmSync as Dn,statSync as Ne,writeFileSync as wr}from"fs";import{delimiter as _r,dirname as St,join as b}from"path";import{finished as In}from"stream/promises";var Je="omljlfpmafedpplnpkkahegadhkimdje",wo="https://chromewebstore.google.com/detail/reason/omljlfpmafedpplnpkkahegadhkimdje";var O={ocu:{repository:"https://github.com/iFurySt/open-codex-computer-use.git",revision:"386a260d1ab8b690adbbb27f7471595cf0c2b752",version:"0.3.5"},obu:{repository:"https://github.com/iFurySt/open-browser-use.git",revision:"ac015846df75928fbcf0f3a0f3ba3a210ce1a507",version:"0.1.42"}},F={version:"155.0.8059.84",macArm64Sha256:"13b9e98ce56f5ce18e100a009f455c9285f399e7c9dc8a76fdf2f3a9755bb5f2",linux64Sha256:"cf0f049892dea22e6a6db26d47ed0d7776b7158edcbec4634086633df8bafcbc",win64Sha256:"507f2a031441d10c62b5e3d4e863f09ac1198a571c1419976cbd8387f639afde"};var J={ocu:{url:`https://registry.npmjs.org/open-computer-use/-/open-computer-use-${O.ocu.version}.tgz`,sha256:"7c16a87c8cd357787b02c0ebd040dd5f93880c1fb51c1901caa2e0c05d063130",size_bytes:5844280},obu:{url:`https://registry.npmjs.org/open-browser-use/-/open-browser-use-${O.obu.version}.tgz`,sha256:"9386d8ce0a147b3f55e1807b68edf736836378807541c457c9b5f6ca2cabaa4e",size_bytes:21372018},extension:{url:`https://github.com/iFurySt/open-browser-use/releases/download/v${O.obu.version}/open-browser-use-chrome-extension-${O.obu.version}.zip`,sha256:"c9c07bec1175e12ea6985b0e7784a5ef01fd03f014b958224a1e17dcd838a241",size_bytes:31070}},U="pnbmoicbkopffjjgfgfglopechaiemkp";import{spawn as Me}from"child_process";import{createRequire as fn}from"module";import{join as mn}from"path";var gn=30000,hn=1048576;function Te(){return process.env.SystemRoot??"C:\\Windows"}function bn(){return mn(Te(),"System32","WindowsPowerShell","v1.0","powershell.exe")}var yn=String.raw`
|
|
3
3
|
$ErrorActionPreference = "Stop"
|
|
4
4
|
Add-Type -TypeDefinition @"
|
|
5
5
|
using System;
|
|
@@ -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-1yv5qqew.js";import{je,gr,_r,Sn,En,ct}from"./vm-hands-entry-lite-
|
|
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-d0q28cs9.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
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,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Je,wo,U,Xe,Jt,zr,x}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Je,wo,U,Xe,Jt,zr,x}from"./vm-hands-entry-lite-7ytgtvky.js";import{K}from"./vm-hands-entry-lite-wghmyfba.js";import{ft}from"./vm-hands-entry-lite-2v4zh9ze.js";import{gt}from"./vm-hands-entry-lite-06vs300m.js";import{qr}from"./vm-hands-entry-lite-2m6hc16j.js";import{Pt,Hi}from"./vm-hands-entry-lite-qd46yhvz.js";import{G,qe}from"./vm-hands-entry-lite-fc8fzdzt.js";import{xe,Jn}from"./vm-hands-entry-lite-g3msnkny.js";import{St}from"./vm-hands-entry-lite-07apxfh8.js";import{a}from"./vm-hands-entry-lite-8dfw96ym.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-tyem93c1.js";import{spawn as v,spawnSync as st}from"child_process";import{createHash as it,randomUUID as ge}from"crypto";import{closeSync as at,copyFileSync as ae,existsSync as D,fstatSync as ct,mkdirSync as ce,openSync as lt,readdirSync as L,readFileSync as X,readlinkSync as ut,renameSync as he,rmSync as dt,statSync as pt,writeFileSync as mt}from"fs";import{connect as ht}from"net";import{tmpdir as B,userInfo as _e}from"os";import{basename as le,delimiter as _t,dirname as q,join as f}from"path";var z=`import { spawn, execFileSync } from "node:child_process";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { readFileSync, readlinkSync, lstatSync, realpathSync, statSync, mkdtempSync, mkdirSync, chmodSync, writeFileSync, readdirSync, rmSync, openSync, readSync, closeSync, renameSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{readdirSync as b,readFileSync as P}from"fs";import{userInfo as k}from"os";var ur="--vm-hands-op-runner-kind=person",dr="--vm-hands-op-runner-kind=surface",Rt="--vm-hands-surface-uid=",Tt="--vm-hands-surface-dir=",It=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function R(t){let c=new Set([t]),l=[];try{l=b("/proc")}catch{}for(let o of l){if(!/^\d+$/.test(o))continue;try{let d=P(`/proc/${o}/stat`,"utf8");if(Number(d.slice(d.lastIndexOf(")")+2).split(" ")[3])===t)c.add(Number(o))}catch{}}for(let o of c)try{process.kill(o,"SIGKILL")}catch{}}var A=(t)=>{let c=globalThis.Bun;if(!c)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=c.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(i,s)=>t.onData(s)}}),o=l.terminal,d=()=>{R(l.pid);try{o?.close()}catch{}};if(!o)throw d(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(i)=>o.write(i),resize:(i,s)=>o.resize(i,s),kill:d,exited:l.exited.then((i)=>typeof i==="number"?i:null,()=>null)}};function x(){let t=(()=>{try{return k().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...t?{USER:t,LOGNAME:t}:{}}}async function E(t){let[{localAutomationAvailable:c},{localDisplayReady:l},{localDisplayVideoAvailable:o},{probeWorkerPreview:d},y]=await Promise.all([import("./local-automation-
|
|
2
|
+
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{readdirSync as b,readFileSync as P}from"fs";import{userInfo as k}from"os";var ur="--vm-hands-op-runner-kind=person",dr="--vm-hands-op-runner-kind=surface",Rt="--vm-hands-surface-uid=",Tt="--vm-hands-surface-dir=",It=new Set(["automation.call.v1","display.stream.v1","preview.serve.v1"]);function R(t){let c=new Set([t]),l=[];try{l=b("/proc")}catch{}for(let o of l){if(!/^\d+$/.test(o))continue;try{let d=P(`/proc/${o}/stat`,"utf8");if(Number(d.slice(d.lastIndexOf(")")+2).split(" ")[3])===t)c.add(Number(o))}catch{}}for(let o of c)try{process.kill(o,"SIGKILL")}catch{}}var A=(t)=>{let c=globalThis.Bun;if(!c)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");let l=c.spawn({cmd:[t.shell,...t.args],cwd:t.cwd,env:{...t.environment,TERM:"xterm-256color"},terminal:{cols:t.cols,rows:t.rows,data:(i,s)=>t.onData(s)}}),o=l.terminal,d=()=>{R(l.pid);try{o?.close()}catch{}};if(!o)throw d(),new r("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(i)=>o.write(i),resize:(i,s)=>o.resize(i,s),kill:d,exited:l.exited.then((i)=>typeof i==="number"?i:null,()=>null)}};function x(){let t=(()=>{try{return k().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...t?{USER:t,LOGNAME:t}:{}}}async function E(t){let[{localAutomationAvailable:c},{localDisplayReady:l},{localDisplayVideoAvailable:o},{probeWorkerPreview:d},y]=await Promise.all([import("./local-automation-q0dbp6q2.js"),import("./local-display-session-7n4g1866.js"),import("./local-display-video-c08akxwr.js"),import("./worker-preview-readiness-gy36ejp9.js"),import("fs")]),i=AbortSignal.timeout(15000),s=null;try{y.mkdirSync(t,{recursive:!0,mode:448}),s=y.mkdtempSync(`${t}/probe-`);let[g,p,m]=await Promise.all([Promise.resolve().then(()=>c()).catch(()=>!1),l().catch(()=>!1),d(s,i).catch(()=>!1)]);return{t:"readiness",display_video:p&&await o().catch(()=>!1),lanes:{"automation.call.v1":g,"display.stream.v1":p,"preview.serve.v1":m,"tunnel.open":m,"tunnel.close":m}}}finally{if(s)y.rmSync(s,{recursive:!0,force:!0})}}async function vs(){let[{executeLocalOperation:t,spawnCaptured:c},{runLocalPtySession:l},{configureDesktopAccount:o,desktopAccount:d},{configureWorkerSandbox:y}]=await Promise.all([import("./local-capabilities-wdha8a04.js"),import("./local-pty-session-njd0tprg.js"),import("./desktop-account-t0afsge2.js"),import("./worker-sandbox-f1tfb3y0.js")]);y();let i=process.argv.includes(ur),s=process.argv.includes(dr),g=(a,e,u)=>c(a,e[0]==="-lic"?["-lc",...e.slice(1)]:e,u),p=(process.geteuid?.()??0)!==0;if(s){p=!1;let a=process.argv.find((e)=>e.startsWith(Rt))?.slice(Rt.length);if((process.geteuid?.()??-1)===0&&a)try{p=o({value:a})!==null&&d()!==null}catch{p=!1}}let m=new Map,v=new Map,f=(a)=>{try{process.send?.(a)}catch{}};if(process.on("message",(a)=>{let e=a;if(e?.t==="cancel"){m.get(e.id)?.abort();return}if(e?.t==="control"){let n=v.get(e.id);if(s&&n&&e.control&&typeof e.control.kind==="string")import("./local-managed-process-40g4wzkg.js").then(({controlManagedDeviceProcess:_})=>_(n,{kind:e.control.kind,payload:e.control.payload??{}})).catch(()=>!1);return}if(e?.t==="retire"){if(s&&typeof e.operation_id==="string"&&typeof e.status==="string")import("./local-managed-process-40g4wzkg.js").then(({retireManagedDeviceProcess:n})=>n(e.operation_id,e.status)).catch(()=>!1);return}if(e?.t!=="op")return;if(!p){f({t:"done",id:e.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let u=e.claim.capability;if(u==="pty.start"&&!i){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}if(It.has(u)!==s){f({t:"done",id:e.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let w=new AbortController;m.set(e.id,w),v.set(e.id,e.claim);let S=u==="pty.start"?{runPtySession:(n)=>l(n,{spawnPty:A,environment:x(),loadProxy:()=>null})}:{worker:e.worker,...u==="exec.full"?{spawnFullControl:g}:{}};t(e.state,e.claim,{...S,signal:w.signal,emit:(n)=>{let{deliverySignal:_,...h}=n;f({t:"event",id:e.id,event:h})}}).then((n)=>f({t:"done",id:e.id,completion:n}),(n)=>f({t:"done",id:e.id,completion:{status:"failed",error_code:n&&typeof n==="object"&&"code"in n&&typeof n.code==="string"?n.code:"vm_hands_op_failed"}})).finally(()=>{m.delete(e.id),v.delete(e.id)})}),process.on("disconnect",()=>process.exit(0)),s){let a=process.argv.find((u)=>u.startsWith(Tt))?.slice(Tt.length),e={t:"readiness",display_video:!1,lanes:{}};f(p&&a?await E(a).catch(()=>e):e)}await new Promise(()=>{})}
|
|
3
3
|
export{ur,dr,Rt,Tt,It,vs};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_,Ho,ke}from"./vm-hands-entry-lite-4anjdcth.js";import{l,Ut,We,Dr,zt,Nr,dt}from"./vm-hands-entry-lite-dgfx0rbn.js";import{bt,ar}from"./vm-hands-entry-lite-07apxfh8.js";import{fn}from"./vm-hands-entry-lite-
|
|
2
|
+
import{_,Ho,ke}from"./vm-hands-entry-lite-4anjdcth.js";import{l,Ut,We,Dr,zt,Nr,dt}from"./vm-hands-entry-lite-dgfx0rbn.js";import{bt,ar}from"./vm-hands-entry-lite-07apxfh8.js";import{fn}from"./vm-hands-entry-lite-67q3xtm2.js";import{F,m,te,He}from"./vm-hands-entry-lite-d0q28cs9.js";import{U}from"./vm-hands-entry-lite-7ytgtvky.js";import{Bo}from"./vm-hands-entry-lite-06vs300m.js";import{xe,Ze,Xn,Vr}from"./vm-hands-entry-lite-g3msnkny.js";import{f,v,h}from"./vm-hands-entry-lite-h1qjggz0.js";import{a}from"./vm-hands-entry-lite-8dfw96ym.js";import{Xo,an,y,t,k,At,o,d,Ie,u,n,c,g,_s,s,i,cn}from"./vm-hands-entry-lite-wzv13c8k.js";import{closeSync as qh,existsSync as zh,mkdirSync as Kh,openSync as Vh,readdirSync as Jh,realpathSync as pe,rmSync as Gh}from"fs";import{dirname as Xh,join as J,resolve as Zh}from"path";import{createHash as It}from"crypto";import{platform as Ot}from"os";import{join as Dt}from"path";var Mt=g("store",[c({version:i(1),store:i("keychain")}),c({version:i(1),store:i("file"),api_key:t().min(1).max(4096)})]),Ne=(e)=>Dt(e,"api-key.json");function $e(e){let r=It("sha256").update(`reason-connect-api-key
|
|
3
3
|
${e}`).digest("hex");return new We(Ut(),Ot(),r)}function we(e,r=$e(e)){if(!f(Ne(e)))return null;let p=Mt.parse(JSON.parse(h(Ne(e))));if(p.store==="file")return p.api_key;try{let b=r.loadBinding();return b?new TextDecoder().decode(b):null}catch(b){if(!(b instanceof l))throw b;throw Error("worker_api_key_unreadable")}}import{readdirSync as Zt,renameSync as Go,rmSync as Yo}from"fs";import{join as ee}from"path";import{createHash as Wt}from"crypto";import{platform as Nt}from"os";import{join as W}from"path";function w(e){return{state:W(m(e),"device.json"),control:W(m(e),"control.json"),lock:W(m(e),"lifecycle.lock"),socket:W(m(e),"control.sock"),daemon:W(m(e),"daemon.json"),releaseCheck:W(m(e),"release-check.json"),updateDeferral:W(m(e),"update-deferral.json"),firstHeartbeat:W(m(e),"first-heartbeat.json")}}var uo=n({version:i(1),device_id:t().min(1).max(160),offer:Ie().optional(),enrollment_ms:o().int().nonnegative().max(ar).optional()});function z(e,r=!1){v(m(e),r);let p=["local-device.key","local-device.binding","device.json"].filter((b)=>{let R=W(m(e),b);if(!f(R))return!1;return h(R),!0});return e.lifetime==="persistent"&&p.join()==="device.json"?Ht(e):new Dr(m(e))}function Ht(e){return new We(Ut(),Nt(),$t(e))}function $t(e){let r=jt(e);return Wt("sha256").update(`reason-worker
|
|
4
4
|
${r?.directory??m(e)}`).digest("hex")}var Bt="keychain-scope.json";var Ft=c({version:i(1),directory:t().min(1),devicePublicKey:t().min(1)});function jt(e){let r=W(m(e),Bt);if(!f(r))return null;let p=Ft.safeParse(JSON.parse(h(r))),b=w(e).state;if(!p.success||!f(b))return null;return JSON.parse(h(b))?.devicePublicKey===p.data.devicePublicKey?p.data:null}function B(e){if(!f(m(e)))return null;let r=Nr(w(e).state,{proofStore:z(e),repair:!1}),p=r!==null&&Ho(e.apiOrigin,r.apiOrigin),b=p?[te(e),te({...e,apiOrigin:r.apiOrigin})]:[te(e)];if(r&&(!b.includes(r.worker?.configDigest??"")||r.worker.lifetime!==e.lifetime||r.apiOrigin!==e.apiOrigin&&!p||r.roots.length>32||r.roots[0]?.path!==e.workspaceRoot||r.handsSlots!==e.slots))throw Error("worker_config_binding_mismatch");return r}var qt=c({version:i(1),drained:d(),revoked:d()});function N(e){let r=w(e).control;return f(r)?qt.parse(JSON.parse(h(r))):{version:1,drained:!1,revoked:!1}}var Vt=c({read:d(),write:d(),execute:d(),discover_environment:d(),expose_mcp:i(!1)}),Jt=c({version:i(1),organization_id:t().min(1).max(160),enrollment_ticket:t().min(1).max(4096),code_verifier:t().regex(/^[A-Za-z0-9._~-]{43,128}$/),root_fingerprint_key:t().regex(/^[a-f0-9]{64}$/),root:c({path_fingerprint:t().regex(/^[a-f0-9]{64}$/),permissions:Vt,execution_mode:s(["confined","host"]).default("confined")}),folders:u(c({path_fingerprint:t().regex(/^[a-f0-9]{64}$/)})).min(1).max(31).optional()}),Ro=n({device_id:t().min(1).max(160),organization_id:t().min(1).max(160),auth_scheme:i("p256"),protocol_version:i(2),roots:u(n({id:t().min(1),label:t(),path_fingerprint:t()})).min(1).max(32),headless:n({lifecycle:s(["persistent","ephemeral"]),expires_at:y.datetime({offset:!0})}),first_heartbeat:Ie().optional()});var qo=c({version:i(1),install_id:k(),fingerprint_key:t().regex(/^[a-f0-9]{64}$/)}),zo=n({enrollment_ticket:t().min(1).max(4096),expires_at:y.datetime({offset:!0}),device_kind:i("headless"),lifecycle:s(["persistent","ephemeral"]),device_expires_at:y.datetime({offset:!0})});var Ko=n({credentialKind:s(["oauth","api_key"]).optional(),apiOrigin:At(),clientId:t(),accessToken:t().min(1).max(32768),refreshToken:t().max(32768),expiresAt:y.datetime({offset:!0}),scopes:u(t().max(128)).max(128),orgId:t().min(1).max(160)});var qe=8;var Qt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,_e=(e)=>ee(m(e),"workspaces"),er="account.json",tr=(e)=>f(ee(e,er));function Se(e){let r;try{r=Zt(_e(e))}catch{return[]}return r.filter((p)=>Qt.test(p)).sort().map((p)=>{let b=ee(_e(e),p),R=ee(b,"worker.json"),S=null;try{let P=F.safeParse(JSON.parse(h(R)));if(P.success&&P.data.stateDirectory===b)S=P.data}catch{}return{organizationId:p,directory:b,configPath:R,config:S,account:tr(b)}})}var rr=(e)=>ee(_e(e),"listed.json");function nr(e){try{let r=JSON.parse(h(rr(e))),p=r.names&&typeof r.names==="object"&&!Array.isArray(r.names)?Object.fromEntries(Object.entries(r.names).filter((R)=>typeof R[1]==="string")):{},b=r.refused&&typeof r.refused==="object"?r.refused:null;return{listed:r.listed===!0,reason:r.reason==="sign_in"?"sign_in":null,blocked:Array.isArray(r.blocked)?r.blocked.filter((R)=>typeof R==="string"):[],names:p,...b&&typeof b.device==="string"&&typeof b.roots==="string"&&typeof b.at==="number"&&Number.isFinite(b.at)&&typeof b.count==="number"&&Number.isInteger(b.count)&&b.count>=1?{refused:{device:b.device,roots:b.roots,at:b.at,count:b.count}}:{}}}catch{return null}}function ze(e,r){let p=Se(e),b=p.filter((C)=>C.account),R=p.filter((C)=>!C.account),S=nr(e),P=S&&!S.listed?S.reason:null,E=P||R.length===0&&S&&!S.listed?[]:R;if(b.length===0&&E.length===0&&(P||S&&!S.listed))return{workspaces:null,off:P};return{off:P,workspaces:[...b,...E].map(({organizationId:C,config:D,account:I})=>{let A=!1,M=null,T=!1,he=null;try{A=D?N(D).revoked:!1,M=D&&!A?B(D):null;let Le=D?dt(w(D).daemon):null;T=r&&!!M&&Le?.state==="connected",he=T?zt(Le,M):null}catch{}return{...he?{permission_recovery:he}:{},organization_id:C,device_id:M?.deviceId??null,name:S?.names?.[C]??null,root:M?.roots[0]?{id:M.roots[0].id,permissions:M.roots[0].permissions}:null,state:A?"removed":T?"connected":"not_running",blocked:!I&&!A&&!T&&(S?.blocked.includes(C)??!1),...I?{account:!0}:{}}})}}import{readFileSync as ir}from"fs";function pr(e){try{let r=JSON.parse(ir(`${e}.keep-awake.json`,"utf8"));return r!==null&&typeof r==="object"&&"version"in r&&r.version===1&&"enabled"in r&&r.enabled===!0?"battery_and_ac":void 0}catch(r){return r.code==="ENOENT"?"battery_and_ac":void 0}}import{chmodSync as qi,lstatSync as Xe,mkdtempSync as zi,realpathSync as sr,rmdirSync as Ki,rmSync as Vi,unlinkSync as Ji}from"fs";import{createConnection as cr,createServer as Yi}from"net";import{basename as Je,dirname as Ge,join as ne}from"path";var lr=s(["status","drain","resume","stop","reload_roots"]),dr=c({version:i(1),instanceId:t(),deviceId:t(),phase:s(["starting","running","reconnecting","stopping"]),drained:d(),activeClaims:o().int().nonnegative(),activeSessions:o().int().nonnegative().optional(),executionEligible:d(),supportedOperations:u(s(bt)).max(bt.length).optional(),capabilityReadiness:_s(s(bt),d()).optional(),lastHeartbeat:t().nullable(),expiresAt:t()}),ra=c({nonce:t(),action:lr}),ur=n({nonce:k()}),fr=c({version:i(1),nonce:k(),socketPath:t().max(100)});function mr(e){return ne(w(e).lock,"control.json")}function Qe(e){return v(w(e).lock),ur.parse(JSON.parse(h(ne(w(e).lock,"owner.json"))))}function Ye(e){if(!f(e))return!1;let r=Xe(e);if(!r.isSocket()||r.uid!==process.getuid?.()||(r.mode&63)!==0)throw Error("worker_control_socket_not_private");return!0}function et(e,r){let p=mr(e);if(!f(p)){let S=w(e).socket;if(!f(S)||!Xe(S).isSocket())return null;return Ye(S)?S:null}let b=fr.parse(JSON.parse(h(p)));if(b.nonce!==r)throw Error("worker_instance_changed");if(process.platform==="win32"){if(!hr.test(b.socketPath))throw Error("worker_control_endpoint_invalid");return b.socketPath}let R=Ge(b.socketPath);if(Ge(R)!==sr("/tmp")||!/^(?:reason|ara)-worker-[A-Za-z0-9]{6}$/.test(Je(R))||Je(b.socketPath)!=="control.sock"||Buffer.byteLength(b.socketPath)>100)throw Error("worker_control_endpoint_invalid");if(!f(R))return null;return v(R),Ye(b.socketPath)?b.socketPath:null}var hr=/^\\\\\.\\pipe\\reason-worker-[0-9a-f-]{36}$/;function gr(e,r){try{let p=JSON.parse(h(ne(w(e).lock,"owner.json"))),b=p&&typeof p==="object"?p[r]:void 0;return typeof b==="string"?b:null}catch{return null}}function tt(e){return gr(e,"runtime_version")}function rt(e,r){if(r)return r.message==="worker_control_timeout"?"socket_timeout":"bad_reply";try{if(!f(ne(w(e).lock,"owner.json")))return"no_lock";return et(e,Qe(e).nonce)?"socket_refused":"no_socket"}catch{return"bad_reply"}}var na=c({instance:t().nullable(),since:o().int().nonnegative()});async function G(e,r){let p=w(e);if(!f(ne(p.lock,"owner.json")))return null;let b=Qe(e),R=et(e,b.nonce);if(!R)return null;return new Promise((S,P)=>{let E=cr(R),C="",D=!1,I=(A,M)=>{if(D)return;if(D=!0,E.destroy(),M)P(M);else S(A)};E.setTimeout(2000,()=>E.destroy(Error("worker_control_timeout"))),E.on("connect",()=>E.write(JSON.stringify({nonce:b.nonce,action:r})+`
|
|
5
5
|
`)),E.on("data",(A)=>{if(C+=A.toString(),Buffer.byteLength(C)>16384)E.destroy(Error("worker_control_oversize"))}),E.on("error",(A)=>{if("code"in A&&["ECONNREFUSED","ENOENT"].includes(String(A.code)))I(null);else I(null,A.message==="worker_control_timeout"?A:Error("worker_control_unavailable"))}),E.on("end",()=>{try{let A=dr.parse(JSON.parse(C));if(A.instanceId!==b.nonce)throw Error("worker_instance_changed");I(A)}catch{I(null,Error("worker_control_invalid_response"))}}),E.once("close",()=>I(null,Error("worker_control_unavailable")))})}import{realpathSync as br}from"fs";import{constants as Re}from"fs";import{open as wr}from"fs/promises";var da={platform:process.platform,home:a,async openFile(e){let r=await wr(e,Re.O_RDONLY|Re.O_NOFOLLOW|Re.O_NONBLOCK);return{isFile:async()=>(await r.stat()).isFile(),close:()=>r.close()}}};var za=Bo(br(process.execPath));var hs=Buffer.from([0,255,3,4]);import{execFile as on}from"child_process";import{promisify as sn}from"util";var Pr=/#w=(\d{1,5})&h=(\d{1,5})$/;function at(e){return typeof e==="number"&&Number.isInteger(e)&&e>0&&e<=32768?e:void 0}function st(e){let r=Pr.exec(e);if(!r)return;let p=at(Number(r[1])),b=at(Number(r[2]));return p&&b?{width:p,height:b}:void 0}var ct="[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",Cr=new RegExp(`^/media/pr-screenshots/(${ct})/(${ct})/([a-z0-9][a-z0-9._-]*)\\.(png|jpe?g|gif|webp|webm|mp4)$`,"i");var Ar=new Set(["png","jpg","jpeg","gif","webp"]),xr=new Set(["webm","mp4"]);function Ir(e){if(!e)return null;try{return new URL(e).origin}catch{return null}}function Or(e){let r=st(e);return Boolean(r&&e===`#w=${r.width}&h=${r.height}`)}function lt(e,r){let p;try{p=new URL(e)}catch{return null}let b=Ir(r),R=p.hostname==="ara.so"||p.hostname.endsWith(".ara.so")||p.hostname==="reasonmachines.ai"||p.hostname.endsWith(".reasonmachines.ai")||p.hostname==="reasonmachines.com"||p.hostname.endsWith(".reasonmachines.com");if(p.protocol!=="https:"||!R&&p.origin!==b||p.username||p.password||p.port||p.search||p.hash&&!Or(p.hash))return null;let S=Cr.exec(p.pathname);if(!S)return null;let P=S[1]?.toLowerCase(),E=S[2]?.toLowerCase(),C=S[3]?.toLowerCase(),D=S[4]?.toLowerCase();if(!P||!E||!C||!D)return null;let I=Ar.has(D)?"image":xr.has(D)?"video":null;if(!I)return null;let A=/^(before|after)[\s:_-]+/.exec(C),M=p.pathname.replace(/^\/media\//,"");return{url:p.toString(),storagePath:M,runId:P,artifactId:E,fileName:`${C}.${D}`,kind:I,phase:A?.[1]==="before"||A?.[1]==="after"?A[1]:null}}var Mr=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,ut=(e)=>Boolean(e&&typeof e==="object"&&!Array.isArray(e)),K=()=>{throw Error("cloud_browser_media_request_invalid")};function Pe(e){if(!ut(e)||Object.keys(e).some((S)=>!["runId","configuredMediaOrigin","media"].includes(S))||typeof e.runId!=="string"||!Mr.test(e.runId)||typeof e.configuredMediaOrigin!=="string"||e.configuredMediaOrigin.length>2048||!Array.isArray(e.media)||e.media.length<1||e.media.length>8)return K();let r;try{r=new URL(e.configuredMediaOrigin)}catch{return K()}if(r.protocol!=="https:"||r.username||r.password||r.port||!He(r.origin,{mode:"public_web"}).allowed)return K();let p=e.runId.toLowerCase(),b=new Set,R=e.media.map((S)=>{if(!ut(S)||Object.keys(S).some((E)=>!["url","sourceUrl","kind"].includes(E))||typeof S.url!=="string"||S.url.length>2048||typeof S.sourceUrl!=="string"||S.sourceUrl.length>8192||!["image","video"].includes(String(S.kind)))return K();let P=lt(S.url,r.origin);if(!P||new URL(P.url).origin!==r.origin||P.runId!==p||P.kind!==S.kind||P.url!==S.url||b.has(S.url))return K();if(b.add(S.url),S.sourceUrl!==S.url){let E;try{E=new URL(S.sourceUrl)}catch{return K()}let C=/^\/(?:[a-f0-9]{40}|[a-f0-9]{64})\/([a-f0-9]+)$/.exec(E.pathname)?.[1];if(S.kind!=="image"||E.origin!=="https://camo.githubusercontent.com"||E.username||E.password||E.search||E.hash||!C||C.length%2!==0||Buffer.from(C,"hex").toString("utf8")!==S.url)return K()}return{url:S.url,sourceUrl:S.sourceUrl,kind:S.kind}});return{runId:e.runId,configuredMediaOrigin:r.origin,media:R}}var x=t().uuid(),X=t().regex(/^[a-f0-9]{64}$/),V=y.datetime({precision:3}),Ce=t().regex(/^[a-zA-Z0-9_-]{1,160}$/),pt=t().max(2048).regex(/^https:\/\/github\.com\/[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/).refine((e)=>![".",".."].includes(e.split("/")[4])),H=n({kind:i("primary_mac"),version:i(1),organizationId:Ce,userId:Ce,sessionId:Ce,runId:x,deviceId:x,rootId:x,rootRevision:t().min(1).max(64),binding:s(["workspace_source","mcp_control"]),targetRevision:o().int().nonnegative(),generation:x,profile:t().regex(/^(Default|Profile [0-9]+)$/),extensionInstanceId:t().min(1).max(1024)}).strict().refine((e)=>e.binding!=="workspace_source"||e.targetRevision===0),Tr=cn().transform((e,r)=>{try{return fn(e)}catch{return r.addIssue({code:"custom",message:"proof_visual_contract_invalid"}),Xo}}),ue=n({version:i(1),owner:H,contextId:x,preparedAt:V,expiresAt:V,prUrl:pt,headSha:t().regex(/^[a-f0-9]{40}$/),skillDigest:X,evidenceKind:s(["image","video"]),visualPlan:Tr.optional(),uploadOrigin:t().url().refine((e)=>{let r=new URL(e);return r.protocol==="https:"&&r.origin===e&&!r.username&&!r.password}).optional()}).strict().refine((e)=>Date.parse(e.expiresAt)>Date.parse(e.preparedAt)&&Date.parse(e.expiresAt)-Date.parse(e.preparedAt)<=300000),Lr=n({version:i(1),producer:i("primary_mac"),context:ue,captureId:x,operationId:x,attemptId:x,tabId:o().int().positive(),startedAt:V,finishedAt:V,sha256:X,media:g("contentType",[n({contentType:i("image/png"),sizeBytes:o().int().min(24).max(8388608),width:o().int().min(1).max(4096),height:o().int().min(1).max(4096)}).strict(),n({contentType:i("video/webm"),sizeBytes:o().int().min(128).max(10485760),durationSeconds:o().min(0.05).max(15),frameCount:o().int().min(1).max(450),receivedFrameCount:o().int().min(1).max(2000)}).strict()])}).strict().superRefine((e,r)=>{let p=Date.parse(e.startedAt),b=Date.parse(e.finishedAt);if(p<Date.parse(e.context.preparedAt)||b<p||b>Date.parse(e.context.expiresAt)||b-p>30000||e.media.contentType==="video/webm"&&(e.media.receivedFrameCount<e.media.frameCount||Math.abs((b-p)/1000-e.media.durationSeconds)>0.1))r.addIssue({code:"custom",message:"mac_pr_proof_capture_chronology_invalid"})}),yc=g("action",[n({action:i("screenshot"),context_id:x,tab_id:o().int().positive()}).strict(),n({action:i("start_video"),context_id:x,tab_id:o().int().positive(),seconds:o().int().min(1).max(15)}).strict(),n({action:i("stop_video"),recording_operation_id:x}).strict()]),fe=n({login:t().regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,37}[a-zA-Z0-9])?$/),id:t().regex(/^[1-9][0-9]{0,19}$/).nullable()}).strict(),ce=t().regex(/^[1-9][0-9]{0,19}$/),le=n({version:i(1),owner:H,expectedActorId:ce.nullable(),repositoryId:ce,repositoryFullName:t().max(200).regex(/^[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+$/).refine((e)=>![".",".."].includes(e.split("/")[1]))}).strict(),Wr=["browser_unavailable","github_page_unavailable","identity_check_failed","operation_incomplete","attachment_unavailable"],Hr=g("status",[le.extend({status:i("ready"),observedActor:fe,checkedAt:V}),le.extend({status:i("not_ready"),reason:s(["authentication_required","identity_mismatch","authority_lost","unavailable"]),cause:s(Wr).optional()})]).refine((e)=>e.status!=="ready"||e.expectedActorId===null||e.observedActor.id===e.expectedActorId),Y=n({version:i(1),owner:H,expectedActorId:ce.nullable(),authenticatedActor:fe,attemptId:x,captureId:x,prUrl:pt,repositoryId:ce,headSha:t().regex(/^[a-f0-9]{40}$/),sha256:X,sizeBytes:o().int().min(128).max(10485760),contentType:i("video/webm")}).strict(),ht=t().regex(/^https:\/\/github\.com\/user-attachments\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),$r=g("status",[Y.extend({status:i("not_attempted"),reason:s(["authentication_required","attachment_unavailable","identity_mismatch","capture_invalid","authority_lost"])}),Y.extend({status:i("uncertain"),reason:i("upload_outcome_unknown")}),Y.extend({status:i("uploaded"),observedActor:fe,nativeUrl:ht,uploadedAt:V})]).refine((e)=>(e.expectedActorId===null||e.authenticatedActor.id===e.expectedActorId)&&(e.status!=="uploaded"||e.observedActor.id===e.authenticatedActor.id&&e.observedActor.login===e.authenticatedActor.login)),de=Y.extend({nativeUrl:ht,observedActor:fe,bodySha256:X}),Br=g("status",[de.extend({status:i("incomplete"),reason:s(["authentication_required","identity_mismatch","playback_unverified","authority_lost"])}),de.extend({status:i("verified"),sourceSha256:X,width:o().int().min(1).max(4096),height:o().int().min(1).max(4096),durationSeconds:o().positive().max(30),advancedSeconds:o().min(0.05).max(10),advancedFrames:o().int().positive(),playbackRestored:i(!0),verifiedAt:V})]).refine((e)=>(e.expectedActorId===null||e.authenticatedActor.id===e.expectedActorId)&&e.observedActor.id===e.authenticatedActor.id&&e.observedActor.login===e.authenticatedActor.login&&(e.status!=="verified"||e.sourceSha256===e.sha256)),Ur=cn().transform((e,r)=>{try{let p=Pe(e);if(p.media.some((b)=>b.kind!=="image"))throw Error();return p}catch{return r.addIssue({code:"custom",message:"proof_media_request_invalid"}),Xo}}),Fr=g("action",[n({action:i("auth_check"),input:le}).strict(),n({action:i("prepare"),context:ue}).strict(),n({action:i("capture_png"),owner:H,contextId:x,tabId:o().int().positive()}).strict(),n({action:i("start_video"),owner:H,contextId:x,tabId:o().int().positive(),seconds:o().int().min(1).max(15)}).strict(),n({action:i("inspect_capture"),owner:H,captureId:x}).strict(),n({action:i("publish_video"),input:Y}).strict(),n({action:i("verify_png_media"),owner:H,media:Ur}).strict().refine((e)=>e.media.runId===e.owner.runId),n({action:i("verify_saved_media"),input:de}).strict(),n({action:i("publish_png"),owner:H,attemptId:x,captureId:x,sha256:X,sizeBytes:o().int().min(24).max(8388608),storagePath:t().max(512),uploadUrl:t().url().max(8192)}).strict()]);var jr=n({requestId:x,command:Fr}).strict();var qr={type:"object",required:["action"],properties:{action:{type:"string",enum:["screenshot","start_video","stop_video"]},context_id:{type:"string",format:"uuid"},tab_id:{type:"integer",minimum:1},seconds:{type:"integer",minimum:1,maximum:15},recording_operation_id:{type:"string",format:"uuid"}},additionalProperties:!1},ft={type:"string",format:"uuid",description:"capture_context_id from tools.pr.prepareProof."},mt={type:"integer",minimum:1,description:"An already-owned tab's id."},_c={...qr,oneOf:[{type:"object",required:["action","context_id","tab_id"],additionalProperties:!1,properties:{action:{type:"string",const:"screenshot"},context_id:ft,tab_id:mt}},{type:"object",required:["action","context_id","tab_id","seconds"],additionalProperties:!1,properties:{action:{type:"string",const:"start_video"},context_id:ft,tab_id:mt,seconds:{type:"integer",minimum:1,maximum:15}}},{type:"object",required:["action","recording_operation_id"],additionalProperties:!1,properties:{action:{type:"string",const:"stop_video"},recording_operation_id:{type:"string",format:"uuid",description:"The recording_operation_id start_video returned."}}}]};var Rc=n({operationId:t().uuid(),attemptId:t().uuid(),contextId:t().uuid(),tabId:o().int().positive()}).strict();var zr=String.raw`async (media) => {
|