@reason-machines/cli-linux-x64 0.2.525 → 0.2.527
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-rwy5ys03.js +2 -0
- package/bin/vm-hands/api-rjgpedvk.js +2 -0
- package/bin/vm-hands/connect-cli-p72wek72.js +2 -0
- package/bin/vm-hands/credentials-6mbx2mke.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-hzgdnyx2.js → custom-endpoint-device-6d759gkr.js} +1 -1
- package/bin/vm-hands/desktop-account-fpf13hm4.js +2 -0
- package/bin/vm-hands/desktop-wallpaper-fd8f2wb2.jpg +0 -0
- package/bin/vm-hands/device-workspace-rxqaw78v.js +2 -0
- package/bin/vm-hands/dock-browser-y53t41cx.png +0 -0
- package/bin/vm-hands/dock-files-cp52htdw.png +0 -0
- package/bin/vm-hands/dock-terminal-1es514yq.png +0 -0
- package/bin/vm-hands/hands-worker-source-hytk3v4n.js +2 -0
- package/bin/vm-hands/install-receipt-g15a9v84.js +2 -0
- package/bin/vm-hands/local-automation-pdhkw5de.js +2 -0
- package/bin/vm-hands/local-capabilities-pmks6jpv.js +2 -0
- package/bin/vm-hands/local-desktop-users-wkvb4dpg.js +2 -0
- package/bin/vm-hands/{local-display-mac-4654wqzs.js → local-display-mac-d1t1qve5.js} +1 -1
- package/bin/vm-hands/local-display-session-m8469h63.js +2 -0
- package/bin/vm-hands/local-display-video-6xq6fjtm.js +2 -0
- package/bin/vm-hands/local-managed-process-2tx1h7cb.js +2 -0
- package/bin/vm-hands/local-pty-session-p60ha91y.js +2 -0
- package/bin/vm-hands/managed-runtime-533929j6.js +2 -0
- package/bin/vm-hands/{network-contract-5wc6wbn2.js → network-contract-84vs9gfz.js} +1 -1
- package/bin/vm-hands/permissions-4myxznfs.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-zffy7kc8.js → reason-hands-protocol-t51p2jgn.js} +1 -1
- package/bin/vm-hands/serve-service-mjnye8vs.js +2 -0
- package/bin/vm-hands/{status-nvm1fe9h.js → status-m8cfgr58.js} +1 -1
- package/bin/vm-hands/version-gszhe6py.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-tash5m18.js → vm-hands-entry-lite-06e9xm3v.js} +22 -22
- package/bin/vm-hands/{vm-hands-entry-lite-9knf91et.js → vm-hands-entry-lite-2egd9wr5.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-3gbf905c.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-9x81cr3a.js → vm-hands-entry-lite-3thdz953.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-5wsygx6n.js → vm-hands-entry-lite-4pm82ns4.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-88yjxxvf.js → vm-hands-entry-lite-5n4ay2gs.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-sfmeafdm.js → vm-hands-entry-lite-5nhmye0y.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-70hq7mrs.js → vm-hands-entry-lite-72nj66ab.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-11dq75hb.js → vm-hands-entry-lite-7mntg1rq.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-60t7x9vw.js → vm-hands-entry-lite-8b6qfv1c.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-h0s6n13f.js → vm-hands-entry-lite-8n2hetqw.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-39qv4sqt.js → vm-hands-entry-lite-a0g6c3wr.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-f8ts9y2q.js → vm-hands-entry-lite-b48eyd09.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-4cdn822w.js → vm-hands-entry-lite-bjtcy8n6.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-a6w60nv9.js → vm-hands-entry-lite-c5pyaaax.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-x5048q8d.js → vm-hands-entry-lite-c6m5n5gh.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-n3274tws.js → vm-hands-entry-lite-dxaa88rs.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-89ahrw19.js → vm-hands-entry-lite-ep1bq0xq.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-haws181e.js → vm-hands-entry-lite-gmxfz6k2.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-j1hddtjs.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-x1vm200a.js → vm-hands-entry-lite-jvvk1gjx.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-krnvgf71.js → vm-hands-entry-lite-jzmrhjkz.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-c4959xva.js → vm-hands-entry-lite-k2kx2ex0.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-0zby1r00.js → vm-hands-entry-lite-kpahnwm7.js} +16 -16
- package/bin/vm-hands/{vm-hands-entry-lite-t82dzcxb.js → vm-hands-entry-lite-mc5y3xr9.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-vf02kfyy.js → vm-hands-entry-lite-mhw459y7.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-c0t5xpzh.js → vm-hands-entry-lite-mpy0j95a.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-wfc0agnt.js → vm-hands-entry-lite-msb3z9nq.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-r31yba20.js → vm-hands-entry-lite-pd34mbnm.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-1kt82jes.js → vm-hands-entry-lite-q13ekwev.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-nj4kjex8.js → vm-hands-entry-lite-q9spnspj.js} +28 -28
- package/bin/vm-hands/{vm-hands-entry-lite-dhb4fwrv.js → vm-hands-entry-lite-r2100wsz.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-5qanp33p.js → vm-hands-entry-lite-rxfxd2hs.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-mfvtp7py.js → vm-hands-entry-lite-x342zztg.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-td73npv3.js → vm-hands-entry-lite-y9jarm7q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-0tavq3p4.js → vm-hands-entry-lite-yfc1w62e.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bvqwsd3b.js → vm-hands-entry-lite-yfvz7s4m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-scvg31ds.js → vm-hands-entry-lite-ygymhgk8.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-kwmjn9y3.js → vm-hands-entry-lite-yj9hbtm1.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-ckezse0f.js → vm-hands-entry-lite-yptpy066.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-zea60aw2.js +150 -0
- package/bin/vm-hands/{vm-hands-entry-lite-hc11hecd.js → vm-hands-entry-lite-zwnevt4c.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-ftg1qx7c.js → vm-hands-executor-mx3j751y.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-agy05x0c.js → vm-hands-op-runner-bpv5sz6e.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-kbdb0rj5.js → vm-hands-runtime-z81qbpbr.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-afw3ezwg.js +2 -0
- package/bin/vm-hands/worker-sandbox-egdjwgcp.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-468skzhq.js +0 -2
- package/bin/vm-hands/api-credentials-9f82kd61.js +0 -2
- package/bin/vm-hands/connect-cli-4t15y12x.js +0 -2
- package/bin/vm-hands/credentials-md79hkqh.js +0 -2
- package/bin/vm-hands/desktop-account-gm7m5bwr.js +0 -2
- package/bin/vm-hands/desktop-wallpaper-0pjhgyfk.jpg +0 -0
- package/bin/vm-hands/device-workspace-qjyzphga.js +0 -2
- package/bin/vm-hands/dock-browser-afp005mt.png +0 -0
- package/bin/vm-hands/dock-files-rywdm96b.png +0 -0
- package/bin/vm-hands/dock-terminal-s41cj1jp.png +0 -0
- package/bin/vm-hands/hands-worker-source-hzkacxxz.js +0 -2
- package/bin/vm-hands/install-receipt-qtwtzafq.js +0 -2
- package/bin/vm-hands/local-automation-wjsbhagn.js +0 -2
- package/bin/vm-hands/local-capabilities-45tqt3q6.js +0 -2
- package/bin/vm-hands/local-desktop-users-qdpbfh6s.js +0 -2
- package/bin/vm-hands/local-display-session-efjd2gvs.js +0 -2
- package/bin/vm-hands/local-display-video-bdmm490z.js +0 -2
- package/bin/vm-hands/local-managed-process-z5jpvttg.js +0 -2
- package/bin/vm-hands/local-pty-session-s60ca00y.js +0 -2
- package/bin/vm-hands/managed-runtime-ze7n8w7x.js +0 -2
- package/bin/vm-hands/permissions-k1tnx28f.js +0 -2
- package/bin/vm-hands/serve-service-3kj6xp04.js +0 -2
- package/bin/vm-hands/version-qxsa289q.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-413em054.js +0 -150
- package/bin/vm-hands/vm-hands-entry-lite-9y3dvyfj.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-mcjca0ez.js +0 -3
- package/bin/vm-hands/worker-preview-readiness-8ftb3nbw.js +0 -2
- package/bin/vm-hands/worker-sandbox-k0vx97tx.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: 90281440 bytes
|
|
4
|
+
sha256: 76fec173b3245663c13c347c8e493f7561841ecd31d17c6975c8099c0322e0b4
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ui,es,ts,As}from"./vm-hands-entry-lite-rxfxd2hs.js";import"./vm-hands-entry-lite-2egd9wr5.js";import"./vm-hands-entry-lite-jzmrhjkz.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-q13ekwev.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ui as apiOriginFromEnvironment,ts as environmentApiKey,es as explicitApiOrigin,As as resolveApiCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{D,Ps,rs}from"./vm-hands-entry-lite-2egd9wr5.js";import"./vm-hands-entry-lite-jzmrhjkz.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-q13ekwev.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{it,Ss,Es,xs}from"./vm-hands-entry-lite-c6m5n5gh.js";import"./vm-hands-entry-lite-b48eyd09.js";import"./vm-hands-entry-lite-yfc1w62e.js";import"./vm-hands-entry-lite-rxfxd2hs.js";import"./vm-hands-entry-lite-2egd9wr5.js";import"./vm-hands-entry-lite-jzmrhjkz.js";import"./vm-hands-entry-lite-jvvk1gjx.js";import"./vm-hands-entry-lite-q9spnspj.js";import"./vm-hands-entry-lite-msb3z9nq.js";import"./vm-hands-entry-lite-r2100wsz.js";import"./vm-hands-entry-lite-kpahnwm7.js";import"./vm-hands-entry-lite-c5pyaaax.js";import"./vm-hands-entry-lite-06e9xm3v.js";import"./vm-hands-entry-lite-yj9hbtm1.js";import"./vm-hands-entry-lite-k2kx2ex0.js";import"./vm-hands-entry-lite-7mntg1rq.js";import"./vm-hands-entry-lite-zea60aw2.js";import"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-ygymhgk8.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";import"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-q13ekwev.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ss as computerDisconnected,it as connectionDirectory,Es as connectionReport,xs as restartConnection};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fe,un,Dt,dn}from"./vm-hands-entry-lite-jzmrhjkz.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{Fe as credentialsPath,dn as deleteCredentials,Dt as loadCredentials,un as saveCredentials};
|
package/bin/vm-hands/{custom-endpoint-device-hzgdnyx2.js → custom-endpoint-device-6d759gkr.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nt,Et,cr,on,xt,kt,
|
|
2
|
+
import{nt,Et,cr,on,xt,kt,Di,sn,Oi,Ni,Li}from"./vm-hands-entry-lite-x342zztg.js";export{nt as CUSTOM_ENDPOINT_DEVICE_CAPABILITY,Et as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,xt as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,on as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,kt as CUSTOM_ENDPOINT_DEVICE_MAX_PAYLOAD_BYTES,cr as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,Di as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,Ni as CustomEndpointDeviceCredentialSchema,Oi as CustomEndpointDeviceRequestSchema,sn as customEndpointRequestMatchesConfig,Li as isCustomEndpointDeviceFailureCode};
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ue,Ce,X,Ae,de,ir,et,Y,I,U,Qr,en,tn,or,rn}from"./vm-hands-entry-lite-a0g6c3wr.js";export{tn as CLOUD_REPOSITORY_WORKSPACE_ID,Qr as CLOUD_SESSION_CONTROL_BASE,or as CLOUD_SESSION_ROOT,Ce as HANDS_WORKSPACE_BASE_KEY,Ae as HANDS_WORKSPACE_LAYOUT_KEY,ue as REASON_WORKSPACE_BASE,X as SESSION_WORKSPACE_LAYOUT,de as SESSION_WORKTREES,ir as SESSION_WORKTREE_ID,en as SIDECHAT_WORKSPACE_ID,rn as cloudSessionLayoutOfRoot,I as deviceWorkspaceRootRelative,Y as isDeviceWorkspacePath,et as isSessionWorktreePath,U as parseDeviceWorkspace};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{O,T,cs,b,Cn}from"./vm-hands-entry-lite-06e9xm3v.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-a0g6c3wr.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{hs,Jr,ei,Xr,ti}from"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{hs as FUTURE_DEVICE_CONSENT_SCOPE,Jr as installationReceiptPath,Xr as installerReasonAlias,ei as installerReceiptLauncher,ti as loadInstallationReceipt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pn,Us,zs,qs,Ws,Rn}from"./vm-hands-entry-lite-7mntg1rq.js";import"./vm-hands-entry-lite-zea60aw2.js";import"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-ygymhgk8.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";import"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-q13ekwev.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,Wi,mn,is,os,ss,as,$s,Ms,Bs,Fs}from"./vm-hands-entry-lite-q9spnspj.js";import"./vm-hands-entry-lite-msb3z9nq.js";import"./vm-hands-entry-lite-r2100wsz.js";import"./vm-hands-entry-lite-kpahnwm7.js";import"./vm-hands-entry-lite-c5pyaaax.js";import"./vm-hands-entry-lite-06e9xm3v.js";import"./vm-hands-entry-lite-yj9hbtm1.js";import"./vm-hands-entry-lite-k2kx2ex0.js";import"./vm-hands-entry-lite-7mntg1rq.js";import"./vm-hands-entry-lite-zea60aw2.js";import"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-ygymhgk8.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";import"./vm-hands-entry-lite-3thdz953.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-q13ekwev.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{r as LocalCapabilityError,ns as SHORT_REQUEST_CAPABILITIES,$s as capabilityInventoryForRoots,Wi 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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pt,Sa,Ea,ji,Hi}from"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-q13ekwev.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Sa as forgetLocalDesktopUse,Hi as holdLocalDesktop,Pt as noteLocalDesktopUse,Ea as releaseLocalDesktop,ji as trackDesktopRun};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ge,pt,Fn,jn}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ge,pt,Fn,jn}from"./vm-hands-entry-lite-5nhmye0y.js";export{Ge as macScreenStatus,jn as openMacInput,Fn as openMacWindowBounds,pt as requestMacScreenAccess};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ft,Vs,G,qe,jt}from"./vm-hands-entry-lite-zea60aw2.js";import"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-q13ekwev.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{In,Dn,On,Nn,Rr}from"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{In as MAC_SCREEN,Dn as WINDOWS_SCREEN,On as createDisplayVideoLane,Rr as localDisplayVideoAvailable,Nn as simulatorVideoFfmpeg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{st,fr,js,Hs}from"./vm-hands-entry-lite-r2100wsz.js";import"./vm-hands-entry-lite-kpahnwm7.js";import"./vm-hands-entry-lite-c5pyaaax.js";import"./vm-hands-entry-lite-06e9xm3v.js";import"./vm-hands-entry-lite-yj9hbtm1.js";import"./vm-hands-entry-lite-k2kx2ex0.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";import"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-q13ekwev.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{Dr,Vt,Or,ds,Hn,Nr,Un}from"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zwnevt4c.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{Vt as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,Or as LOCAL_PTY_MAX_SESSIONS,Dr as LOCAL_PTY_MAX_SESSION_MS,Nr as defaultConnect,ds as defaultLoginShell,Hn as ptyRuntimeSupported,Un as runLocalPtySession};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rs,Ts,Is,Ds,Os,Ns,Ls}from"./vm-hands-entry-lite-jvvk1gjx.js";import"./vm-hands-entry-lite-k2kx2ex0.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-q13ekwev.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{rt,Re,ra,na,ia,ii,oa,nn,oi,vt,si,ai,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,
|
|
2
|
+
import{rt,Re,ra,na,ia,ii,oa,nn,oi,vt,si,ai,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Z,Te,q,Si,Ei,xi,Q,ki,Ci,Ai,Pi,Ri,St,Ti,sa,ar,Ii,aa,fs,ca,la,ua,da,pa,ha,fa,ma,ga,_a,ya,wa,ba,va}from"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";export{Ti as AUTOMATION_CLOUD_SESSIONS,St as AUTOMATION_USER_CHROME,gi as HANDS_CLOUD_ACCESS,_i as HANDS_CLOUD_ACCESS_KEY,pe as HANDS_CONFINEMENT,Z as HANDS_CONFINEMENT_KEY,li as HANDS_ENVIRONMENT_AT_CLAIM,ui as HANDS_ENVIRONMENT_AT_CLAIM_KEY,oi as HANDS_ENVIRONMENT_DELIVERY,vt as HANDS_ENVIRONMENT_DELIVER_CONTROL,yi as HANDS_HEADLESS_BROWSER,wi as HANDS_HEADLESS_BROWSER_KEY,Si as HANDS_JOBS_USER,Ei as HANDS_JOBS_USER_KEY,bi as HANDS_LARGE_ENVIRONMENT,vi as HANDS_LARGE_ENVIRONMENT_KEY,Te as HANDS_MODEL_JOBS_EGRESS,q as HANDS_MODEL_JOBS_EGRESS_KEY,hi as HANDS_REBIND,mi as HANDS_REBIND_CONTROL,fi as HANDS_REBIND_KEY,ki as HANDS_SESSION_CAP_KEY,Ci as HANDS_SESSION_CAP_NONE,xi as HANDS_SESSION_GROUP,Q as HANDS_SESSION_GROUP_KEY,di as HANDS_WORKSPACE_CHECK,pi as HANDS_WORKSPACE_CHECK_KEY,Pi as JOBS_START_WAIT,Ri as JOBS_START_WAIT_KEY,Re as LOCAL_OPERATION_MAX_BYTES,rt as LOCAL_RUNTIME_PROTOCOL_VERSION,ia as LOCAL_RUNTIME_ROUTES,nn as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,ii as LOCAL_RUNTIME_SESSION_PATH,ar as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,ra as RELAY_HOST_ALIAS_HEADER,na as RELAY_HOST_ALIAS_VERSION,ci as VM_HANDS_UNBIND_UNVERIFIED_EVENT,si as VM_HANDS_WORKSPACE_DEFERRED_KEY,ai as VM_HANDS_WORKSPACE_GRANT_CONTROL,Ai as WORKER_PREVIEW_CARRIED_JOBS,sa as WORKER_STARTUP_TIMING_STAGES,Ii as buildLocalRuntimeDeviceProofBytes,oa as localRuntimeSessionRoutable,fa as parseLocalRuntimeDisconnectResponse,la as parseLocalRuntimeEnrollmentResponse,aa as parseLocalRuntimeErrorEnvelope,da as parseLocalRuntimeFirstHeartbeat,ua as parseLocalRuntimeHeartbeatResponse,ha as parseLocalRuntimeIdentityResponse,ga as parseLocalRuntimeLifecycleResponse,ma as parseLocalRuntimeLocalSubscriptionResponse,_a as parseLocalRuntimeOperationClaim,va as parseLocalRuntimeOperationCompletionResponse,ba as parseLocalRuntimeOperationEnvironmentResponse,wa as parseLocalRuntimeOperationEventsResponse,ya as parseLocalRuntimeOperationHeartbeatResponse,fs as parseLocalRuntimeProofChallenge,ca as parseLocalRuntimeRegistrationResponse,pa as parseLocalRuntimeRootsSyncResponse};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ls,us,Ks,Js}from"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{Js as allowMacPermissions,Ks as permissionsSummary,us as readMacPermissions,ls as reasonIdentity};
|
package/bin/vm-hands/{reason-hands-protocol-zffy7kc8.js → reason-hands-protocol-t51p2jgn.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,Br,Fr,zn,ft,qn,jr,Je,Se,Wn,
|
|
2
|
+
import{P,Br,Fr,zn,ft,qn,jr,Je,Se,Wn,Xe,Yt,ne,Ye,Vn,Ee,Zt,Hr,Qt,Ur,Gn,ae,H,N,ce,zr,qr,Kn}from"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-a0g6c3wr.js";export{Ur as REASON_HANDS_CLOSE_CODES,Xe as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,jr as REASON_HANDS_JOB_MAX_INPUT_CHARS,Je as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,Se as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,Wn as REASON_HANDS_JOB_MAX_RECORDS,qn as REASON_HANDS_MAX_ERROR_CHARS,Br as REASON_HANDS_MAX_FRAME_BYTES,Fr as REASON_HANDS_MAX_INPUT_CHARS,ft as REASON_HANDS_MAX_OUTPUT_CHARS,zn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,P as REASON_HANDS_PROTOCOL_VERSION,Hr as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Qt as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,Zt as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,Ee as REASON_HANDS_PTY_MAX_DIMENSION,ne as REASON_HANDS_PTY_MAX_INPUT_BYTES,Ye as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Vn as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Yt as REASON_HANDS_PTY_PROTOCOL_VERSION,Gn as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,H as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,N as isReasonHandsUuid,zr as parseReasonHandsJobRequest,qr as parseReasonHandsJobResult,Kn as parseReasonHandsPtyReceipt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wr,xe,J,Jn,Xs,Oo,Ys,Ze,ps,Xn,Zs,Qs,Vr,ea,ta}from"./vm-hands-entry-lite-ygymhgk8.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gmxfz6k2.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-q13ekwev.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Wr as WORKER_SERVICE_ENV,J as WorkerServiceError,Oo 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-2egd9wr5.js";import"./vm-hands-entry-lite-a3p6xz53.js";import{_}from"./vm-hands-entry-lite-mc5y3xr9.js";import"./vm-hands-entry-lite-a0g6c3wr.js";import"./vm-hands-entry-lite-jzmrhjkz.js";import"./vm-hands-entry-lite-s85p7tqp.js";import"./vm-hands-entry-lite-j1hddtjs.js";import"./vm-hands-entry-lite-rxfxd2hs.js";import{Kt,ht}from"./vm-hands-entry-lite-zwnevt4c.js";import{w,M,pr,Be,it}from"./vm-hands-entry-lite-c6m5n5gh.js";import"./vm-hands-entry-lite-5n4ay2gs.js";import"./vm-hands-entry-lite-x342zztg.js";import"./vm-hands-entry-lite-q9spnspj.js";import"./vm-hands-entry-lite-kpahnwm7.js";import"./vm-hands-entry-lite-c5pyaaax.js";import"./vm-hands-entry-lite-msb3z9nq.js";import"./vm-hands-entry-lite-b48eyd09.js";import"./vm-hands-entry-lite-8b6qfv1c.js";import"./vm-hands-entry-lite-5nhmye0y.js";import"./vm-hands-entry-lite-mhw459y7.js";import"./vm-hands-entry-lite-ep1bq0xq.js";import"./vm-hands-entry-lite-yfvz7s4m.js";import"./vm-hands-entry-lite-jvvk1gjx.js";import"./vm-hands-entry-lite-dxaa88rs.js";import"./vm-hands-entry-lite-ygymhgk8.js";import"./vm-hands-entry-lite-mpy0j95a.js";import"./vm-hands-entry-lite-06e9xm3v.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-r2100wsz.js";import"./vm-hands-entry-lite-3thdz953.js";import"./vm-hands-entry-lite-4pm82ns4.js";import"./vm-hands-entry-lite-zea60aw2.js";import"./vm-hands-entry-lite-7mntg1rq.js";import"./vm-hands-entry-lite-yfc1w62e.js";import"./vm-hands-entry-lite-yj9hbtm1.js";import"./vm-hands-entry-lite-k2kx2ex0.js";import{a}from"./vm-hands-entry-lite-gmxfz6k2.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-bjtcy8n6.js";import"./vm-hands-entry-lite-q13ekwev.js";import{readFileSync as me,realpathSync as k,renameSync as ge,unlinkSync as fe,writeFileSync as he}from"fs";import{dirname as ye,join as I}from"path";function f(e){return`claude mcp add --transport http reason ${e}`}function h(e){return`codex mcp add reason --url ${e}
|
|
3
3
|
codex mcp login reason`}var F=f("https://mcp.reasonmachines.com/mcp"),z=h("https://mcp.reasonmachines.com/mcp"),B=`https://claude.ai/settings/connectors?add=custom&url=${encodeURIComponent("https://mcp.reasonmachines.com/mcp")}`,H=`https://cursor.com/install-mcp?name=reason&config=${encodeURIComponent(btoa(JSON.stringify({url:"https://mcp.reasonmachines.com/mcp"})))}`;var b="https://github.com/reason-machines/reason-plugins",X=`Connect a coding agent to Reason over MCP
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qr,en,tn,or}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Qr,en,tn,or}from"./vm-hands-entry-lite-a0g6c3wr.js";import{Io,Do,P,Br,Fr,zn,ft,qn,jr,Je,Se,Wn,Xe,ne,Ye,Ee,Zt,Hr,Ur,Gn}from"./vm-hands-entry-lite-mpy0j95a.js";import{lr}from"./vm-hands-entry-lite-s85p7tqp.js";import{Xt}from"./vm-hands-entry-lite-y9jarm7q.js";import{ve}from"./vm-hands-entry-lite-72nj66ab.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); } };
|
|
@@ -309,7 +309,7 @@ function fileOperation(request) {
|
|
|
309
309
|
});
|
|
310
310
|
return { promise, cancel() {} };
|
|
311
311
|
}
|
|
312
|
-
`;var s="a3e39eb55160acfc116fa9871ccc594c68be7a642d2331b24baa707c8f601ec0";import{createHash as
|
|
312
|
+
`;var s="a3e39eb55160acfc116fa9871ccc594c68be7a642d2331b24baa707c8f601ec0";import{createHash as I}from"crypto";var H=Object.freeze({"api.ara.so":"api.reasonmachines.com","api.reasonmachines.ai":"api.reasonmachines.com","api-staging.ara.so":"staging-api.reasonmachines.com","staging-api.reasonmachines.ai":"staging-api.reasonmachines.com"});var a=Object.freeze({trailingSlashPattern:/\/+$/.source,keyPrefix:"http.",keySuffix:"/.extraheader",valuePrefix:"Authorization: Bearer "});var l=Object.freeze({tokenEnv:"ARA_GIT_BROKER_TOKEN",reasonTokenEnv:"REASON_GIT_BROKER_TOKEN",urlEnv:"ARA_GIT_BROKER_URL",keyPrefix:"credential.",keySuffix:"/.helper",value:'!f(){ printf "username=%s\\npassword=%s\\n" "ara-run" "${REASON_GIT_BROKER_TOKEN:-$ARA_GIT_BROKER_TOKEN}"; };f'});var Lt=/^[A-Za-z_][A-Za-z0-9_]*$/;var h=new Set(["ARA_INFERENCE_TOKEN","AI_GATEWAY_API_KEY","CLOUD_AGENT_AI_GATEWAY_API_KEY","INFERENCE_V2_GATEWAY_API_KEY","VERCEL_AI_GATEWAY_API_KEY","INFERENCE_V2_CONCENTRATE_API_KEY","INFERENCE_V2_OPENAI_API_KEY","INFERENCE_V2_ANTHROPIC_API_KEY","INFERENCE_V2_FINGERPRINT_SECRET","OPENAI_API_KEY","OPENROUTER_API_KEY","ANTHROPIC_API_KEY","CODEX_ACCESS_TOKEN","GITHUB_COPILOT_API_KEY","AZURE_OPENAI_API_KEY","AZURE_OPENAI_CLIENT_SECRET"]),m=new Set(["ARA_OPERATOR_KEY","BL_API_KEY","BLAXEL_API_KEY","NSC_TOKEN","NSC_TOKEN_FILE","NAMESPACE_API_KEY","NAMESPACE_ACCESS_TOKEN","NAMESPACE_TOKEN","NAMESPACE_TOKEN_JSON","NAMESPACE_SANDBOX_TOKEN_JSON","ARA_LOCAL_QA_NAMESPACE_WORKLOAD_TOKEN_FILE","NAMESPACE_SANDBOX_USE_LOCAL_USER_TOKEN","COMPUTE_SERVICE_TOKEN"]),g=["INFISICAL_","NSC_"],_=new Set(["ARA_JOB_ENV","ARA_DELIVERY_BASE_SHA","WORK_ROOT","REPO_DIR","ARA_CONTROL_DIR","ARA_PRESERVE_WORKSPACE","ARA_PINNED_CHECKOUT_REUSE","FOLLOWUP_BRANCH","REPO_URL","TOKENLESS_URL","REPOSITORY_IDENTITY_URL","DEFAULT_BRANCH","BRANCH","BRANCH_GENERATED","BASE_REF","REPO_EMPTY","REPO_WRITABLE","ARA_DELIVERY_BASE_BRANCH","ARA_SERVER_GIT_PUBLICATION","ARA_EMPTY_REPOSITORY_COMMIT","REASON_MODEL","REASON_DELIVERY_BASE_BRANCH","REASON_DELIVERY_BASE_SHA","REASON_EMPTY_REPOSITORY_COMMIT","REASON_SCRATCH_SESSION_ID","REASON_SERVER_GIT_PUBLICATION","REASON_ALLOW_INSTALL_SCRIPTS","SCM_TOKEN","SCM_TOKEN_USER","REASON_OIDC_TOKEN_URL","REASON_OIDC_REQUEST_TOKEN","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","BASH_ENV","ENV","BASHOPTS","SHELLOPTS","PS4","IFS","CDPATH","GLOBIGNORE","PROMPT_COMMAND","PATH","HOME","TMPDIR","TMP","TEMP","XDG_CONFIG_HOME","GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_COMMON_DIR","GIT_NAMESPACE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM","GIT_SHALLOW_FILE","GIT_ALLOW_PROTOCOL","GIT_PROTOCOL_FROM_USER","GIT_REPLACE_REF_BASE","NODE_OPTIONS","NODE_PATH","NODE_REPL_EXTERNAL_MODULES","CLASSPATH","PYTHONPATH","PYTHONSTARTUP","PYTHONHOME","RUBYOPT","RUBYLIB","PERL5LIB","PERL5OPT","JAVA_TOOL_OPTIONS","_JAVA_OPTIONS","JDK_JAVA_OPTIONS","GEM_PATH","GEM_HOME","GIT_SSH","GIT_SSH_COMMAND","GIT_EXEC_PATH","GIT_TEMPLATE_DIR","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_PROXY_COMMAND","GIT_EXTERNAL_DIFF","GIT_PAGER","GIT_EDITOR","GIT_ASKPASS","SSH_ASKPASS","PAGER","EDITOR","TAR_OPTIONS","CURL_HOME","WGETRC","APT_CONFIG","PERLLIB","GIT_GRAFT_FILE","POSIXLY_CORRECT"]),y=["GIT_TRACE","CONTEXT_REPO_","ARA_CHECKPOINT_BOOTSTRAP_","_","ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","LD_","DYLD_","GIT_CONFIG","BASH_FUNC_"];var t="^(?!(?:"+[...h,...m,..._].join("|")+")$)(?!(?:"+[...g,...y].join("|")+"))"+Lt.source.slice(1),W=new RegExp(t);var v=["HOME","PWD","OLDPWD","TMPDIR","TMP","TEMP","SHELL","USER","LOGNAME","SCM_TOKEN","SCM_TOKEN_USER","GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","GITLAB_TOKEN"],E=["ARA_HANDS_","ARA_DEVICE_","ARA_GIT_BROKER_","REASON_HANDS_","REASON_DEVICE_","REASON_GIT_BROKER_","BUN_"],S="^(?!(?:"+v.join("|")+")$)(?!(?:"+E.join("|")+"))"+t.slice(1),w="ARA_DELIVERY_BASE_SHA|WORK_ROOT|FOLLOWUP_BRANCH|ARA_PRESERVE_WORKSPACE|ARA_PINNED_CHECKOUT_REUSE|CONTEXT_REPO_[A-Z0-9_]+|REPO_URL|TOKENLESS_URL|REPOSITORY_IDENTITY_URL|DEFAULT_BRANCH|BRANCH|BRANCH_GENERATED|BASE_REF|REPO_EMPTY|REPO_WRITABLE|ARA_DELIVERY_BASE_BRANCH|ARA_SERVER_GIT_PUBLICATION|ARA_EMPTY_REPOSITORY_COMMIT|REASON_MODEL|REASON_DELIVERY_BASE_BRANCH|REASON_DELIVERY_BASE_SHA|REASON_EMPTY_REPOSITORY_COMMIT|REASON_SCRATCH_SESSION_ID|REASON_SERVER_GIT_PUBLICATION|REASON_ALLOW_INSTALL_SCRIPTS",n="^(?:"+w+"|"+S.slice(1,-1)+")$",R=new RegExp(n);function Pr(u){return R.test(u)}var lt=Object.freeze({tokenPath:"/identity/token",awsPath:"/identity/aws",tokenPattern:/^[A-Za-z0-9_.~-]+$/.source}),V=Object.freeze({variables:256,valueBytes:130816,snapshotBytes:1048576}),Z=Object.freeze({valueChars:16384,snapshotBytes:65536});var c=["set -g history-limit 50000","set -g status off","set -g window-size smallest","set -gq fill-character ' '","set -g escape-time 10","set -g prefix None","set -g prefix2 None","set -g terminal-overrides ',*:smcup@:rmcup@'"];var O=2,T="ara-hands-worker.cjs",d=["/usr/local/go/bin","/opt/node/bin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin","/usr/local/cargo/bin"],A=d.join(":"),k=["/opt/homebrew/bin",...d].join(":"),N='(platform, linuxPath, macosPath) => platform === "darwin" ? macosPath : linuxPath';var C=String.raw`(function(anchor, pid, native) {
|
|
313
313
|
const token = native.identity(pid);
|
|
314
314
|
const session = native.session(pid);
|
|
315
315
|
if (!native.same(anchor)) throw new Error("pty_session_identity_lost");
|
|
@@ -317,7 +317,7 @@ function fileOperation(request) {
|
|
|
317
317
|
if (session.id !== anchor[5]) throw new Error("pty_member_session_changed");
|
|
318
318
|
if (!token) return { retry: true, token: null };
|
|
319
319
|
return { retry: false, token };
|
|
320
|
-
})`,
|
|
320
|
+
})`,x=String.raw`(function(native) {
|
|
321
321
|
let probe;
|
|
322
322
|
try {
|
|
323
323
|
try {
|
|
@@ -327,7 +327,7 @@ function fileOperation(request) {
|
|
|
327
327
|
native.signal(probe);
|
|
328
328
|
} finally { if (probe) native.release(probe); }
|
|
329
329
|
} catch (error) { native.close(); throw error; }
|
|
330
|
-
})`,
|
|
330
|
+
})`,D=String.raw`(function(bootstrap) {
|
|
331
331
|
const { dlopen, ptr } = require("bun:ffi");
|
|
332
332
|
const api = dlopen("libc.so.6", {
|
|
333
333
|
prctl: { args: ["i32", "u64", "u64", "u64", "u64"], returns: "i32" },
|
|
@@ -363,15 +363,15 @@ const DEVICE_CLOUD_ACCESS_POLICY = ${JSON.stringify(lt)};
|
|
|
363
363
|
const DEVICE_ENVIRONMENT_LIMITS = ${JSON.stringify(V)};
|
|
364
364
|
|
|
365
365
|
const VERSION = ${P};
|
|
366
|
-
const WORKER_VERSION = ${
|
|
366
|
+
const WORKER_VERSION = ${O};
|
|
367
367
|
const WORKER_ENTRYPOINT = ${JSON.stringify(T)};
|
|
368
368
|
const GUEST_MEMORY_UNAVAILABLE_REASONS = ${JSON.stringify(r)};
|
|
369
369
|
const sampleGuestMemory = ${o};
|
|
370
|
-
const inspectMacPtyMember = ${
|
|
371
|
-
const probeLinuxPtyLibrary = ${
|
|
372
|
-
const windowsPtyApi = ${
|
|
373
|
-
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(
|
|
374
|
-
const CLOSE_CODES = ${JSON.stringify(
|
|
370
|
+
const inspectMacPtyMember = ${C};
|
|
371
|
+
const probeLinuxPtyLibrary = ${x};
|
|
372
|
+
const windowsPtyApi = ${Xt};
|
|
373
|
+
const LINUX_PTY_EXEC_SOURCE = ${JSON.stringify(D)};
|
|
374
|
+
const CLOSE_CODES = ${JSON.stringify(Ur)};
|
|
375
375
|
const SHA256_RE = /^[0-9a-f]{64}$/;
|
|
376
376
|
const MAX_FRAME_BYTES = ${Br};
|
|
377
377
|
const MAX_INPUT_CHARS = ${Fr};
|
|
@@ -387,9 +387,9 @@ const MAX_JOB_OUTPUT_CHUNKS = ${Se};
|
|
|
387
387
|
const MAX_JOBS = ${Wn};
|
|
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 = ${Xe};
|
|
391
391
|
const MAX_PTY_INPUT_BYTES = ${ne};
|
|
392
|
-
const MAX_PTY_OUTPUT_BYTES = ${
|
|
392
|
+
const MAX_PTY_OUTPUT_BYTES = ${Ye};
|
|
393
393
|
const MAX_PTY_DIMENSION = ${Ee};
|
|
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;
|
|
@@ -492,9 +492,9 @@ function jobsUserPrefix(model) {
|
|
|
492
492
|
return user ? ["/usr/bin/setpriv", "--reuid=" + user.uid, "--regid=" + gid, "--clear-groups", "--no-new-privs", "--",
|
|
493
493
|
"/usr/bin/env", "HOME=" + user.home, "USER=" + user.username, "LOGNAME=" + user.username] : [];
|
|
494
494
|
}
|
|
495
|
-
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
496
|
-
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(
|
|
497
|
-
const selectCloudChildPath = ${
|
|
495
|
+
const FIXED_CLOUD_CHILD_PATH = ${JSON.stringify(A)};
|
|
496
|
+
const FIXED_MACOS_CLOUD_CHILD_PATH = ${JSON.stringify(k)};
|
|
497
|
+
const selectCloudChildPath = ${N};
|
|
498
498
|
const config = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
499
499
|
const FIXED_BASH = WINDOWS ? config.bashExecutable : "/bin/bash";
|
|
500
500
|
const allowedTools = config.allowedTools === undefined
|
|
@@ -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 > ${Zt}) 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 > ${Zt}) 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")), ${Hr});
|
|
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 = "${Io}";
|
|
3366
3366
|
function validPiToolConfinement(value) {
|
|
3367
3367
|
return hasOnlyKeys(value, ["template", "quoteDepth"]) && typeof value.template === "string"
|
|
3368
|
-
&& value.template.length <= ${
|
|
3368
|
+
&& value.template.length <= ${Do} && !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)
|
|
@@ -4176,5 +4176,5 @@ void startJobControl().then(() => {
|
|
|
4176
4176
|
try { loadJobs(); prepareRequestJournal(); } catch { process.exit(44); }
|
|
4177
4177
|
if (validPrivateJob) markReady(); else connect();
|
|
4178
4178
|
}, () => process.exit(45));
|
|
4179
|
-
`.trimStart();var b=
|
|
4180
|
-
export{Lt,Pr,lt,V,
|
|
4179
|
+
`.trimStart();var b=I("sha256").update(cs,"utf8").digest("hex"),Cn={42:"worker_config_invalid",43:"workspace_alias_failed",44:"job_journal_unavailable",45:"job_control_failed",46:"job_journal_owned"};
|
|
4180
|
+
export{Lt,Pr,lt,V,O,T,cs,b,Cn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R}from"./vm-hands-entry-lite-a3p6xz53.js";import{Fo}from"./vm-hands-entry-lite-t82dzcxb.js";import{Fe,un,It,dn}from"./vm-hands-entry-lite-krnvgf71.js";import{Qn}from"./vm-hands-entry-lite-9y3dvyfj.js";import{t,o,d,u,i,gs,W,g,s,n}from"./vm-hands-entry-lite-4cdn822w.js";var q=/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/;function v(e){let r=typeof e==="string"?q.exec(e):null;return r?{major:Number(r[1]),minor:Number(r[2])}:null}var j=25,x=1e5,L=/^[0-9a-f]{64}$/,N=i({day:t().regex(/^\d{4}-\d{2}-\d{2}$/),sent:o().int().min(0).max(x),received:o().int().min(0).max(x)}),Ue=i({machine:t().min(1).max(200),person:t().min(1).max(200),team:t().min(1).max(200),team_id:t().min(1).max(200).optional(),workspace:d().optional(),version:t().max(64).optional(),wait_seconds:o().int().min(0).max(j).optional(),message_counts:u(N).max(14).optional().catch(void 0),endpoint:t().regex(L).optional().catch(void 0)}),D=g("kind",[i({id:t(),kind:n("who"),all:d().optional()}),i({id:t(),kind:n("send"),to:t(),body:t(),from_name:t(),from_agent:t(),wake:d(),reply_to:t().max(100).optional(),notify:d().optional()})]),P=i({job:D.nullable(),retry_after_seconds:o().optional()}),H=i({address:t(),person:t(),machine:t(),agent:t(),repo:t().nullable(),branch:t().nullable(),status:t(),since:o().nullable(),doing:t().nullable(),worker:d(),tier:t().max(10).optional()}),F=i({person:t(),machine:t(),online:d()}),B=i({team:t().nullable(),sessions:u(H).max(2000),machines:u(F).max(500),all:d().optional()}),G=i({address:t().max(300),state:t().max(40),note:t().max(500)}),Oe=W([i({who:B}),i({sent:i({ids:u(t().max(100)).max(500),recipients:u(t().max(300)).max(500),from:t().max(300),deliveries:u(G).max(500).optional()})}),i({error:t().min(1).max(2000)})]),J=i({id:t().max(100),from:t().max(300),from_agent:t().max(100).nullable(),to:t().max(300),reply_to:t().max(100).nullable(),body:t().max(64000),sent_at:o()}),Me=i({messages:u(J).max(100),team:t().min(1).max(200).optional(),team_id:t().min(1).max(200).optional(),workspace:d().optional()});var C=["run","mcp:read","mcp:write","secrets:read","secrets:write","sessions:read","sessions:debug","devices:read","devices:write","devices:use","ssh:write","knowledge:read","memory:read","memory:write","skills:read","skills:write","repos:read","repos:write","reviews:read","reviews:write","deployment:read","analytics:read","org:read","org:write","attachments:read","attachments:write","guardrails:read","guardrails:write","network:read","network:write","automations:read","automations:write","agent_auth:read"];var Ve=C.filter((e)=>e!=="network:read"&&e!=="network:write");class b extends Error{oauthCode;constructor(e,r=null){super(e);this.oauthCode=r;this.name="LoginError"}}function K(e,r){let a=typeof e.error==="string"?e.error:null,l=typeof e.error_description==="string"?e.error_description:a?a:r;return new b(l,a)}async function Q(e,r,a,l){let c=await a(`${e}/mcp/oauth/token`,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded"},body:r,signal:l}),m=await c.json().catch(()=>({}));if(!c.ok)throw K(m,`OAuth token request failed (${c.status})`);return m}var V=1e4;async function Y(e,r={}){let a=r.fetchImpl??fetch,l=await Q(e.apiOrigin,new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken}),a,AbortSignal.timeout(V)).catch((m)=>{if(m instanceof Error&&m.name==="TimeoutError")throw new b("Reason did not answer the login refresh in time. Check the network and retry.");throw m});if(typeof l.access_token!=="string"||typeof l.refresh_token!=="string"||typeof l.expires_in!=="number")throw new b("Reason returned an incomplete refreshed login.");let c={...e,accessToken:l.access_token,refreshToken:l.refresh_token,expiresAt:new Date(Date.now()+l.expires_in*1000).toISOString(),scopes:typeof l.scope==="string"?l.scope.split(/\s+/).filter(Boolean):e.scopes};return un(c,r.path??Fe()),c}var w=new Map,X=2000,Z=100;function A(e,r){if(!r)return e;if(r.aborted)return Promise.reject(r.reason);return new Promise((a,l)=>{let c=()=>l(r.reason);r.addEventListener("abort",c,{once:!0}),e.then(a,l).finally(()=>r.removeEventListener("abort",c))})}async function ot(e={}){let r=e.path??Fe(),a=It(r);if(!a)return null;let l=e.apiOrigin??R(process.env,"REASON_API_URL")?.trim();if(l&&!Fo(a.apiOrigin,new URL(l).origin))return null;if(!(Date.parse(a.expiresAt)<=Date.now()+60000)&&(!e.forceRefresh||e.refused!==void 0&&a.accessToken!==e.refused))return a;let m=[r,a.apiOrigin,a.clientId,a.refreshToken].join("\x00"),p=w.get(m);if(p)return A(p,e.signal);let f;return f=Y(a,{fetchImpl:e.fetchImpl,path:r}).catch(async(y)=>{if(!(y instanceof b)||y.oauthCode!=="invalid_grant"&&y.oauthCode!=="invalid_client")throw y;let k=(_)=>_!==null&&(y.oauthCode==="invalid_client"?_.clientId!==a.clientId:_.refreshToken!==a.refreshToken),E=Date.now()+X;while(!k(It(r))&&Date.now()<E)await new Promise((_)=>setTimeout(_,Z));if(k(It(r)))return ot({fetchImpl:e.fetchImpl,path:r});return dn(r),null}).finally(()=>{if(w.get(m)===f)w.delete(m)}),w.set(m,f),A(f,e.signal)}var ee=i({label:t(),used_percent:o().min(0).max(100).nullable(),resets_at:t().nullable(),exhausted:d().nullable()}),ne=i({groups:u(i({selectable:d().optional(),accounts:u(i({source_id:t().min(1),model_ids:u(t().min(1)).optional()}))}))});function te(e){let r=ne.safeParse(e);if(!r.success)return;return r.data.groups.some((a)=>a.selectable!==!1&&a.accounts.some((l)=>l.model_ids===void 0||l.model_ids.length>0))}class I extends Error{status;code;suggestedModel;retryAfterMs;resolutionReason;refusal;constructor(e,r,a,l,c,m,p){super(a);this.status=e;this.code=r;this.suggestedModel=l;this.retryAfterMs=c;this.resolutionReason=m;this.refusal=p;this.name="ApiError"}static rateLimitDelayMs(e,r){if(!(e instanceof I)||e.status!==429)return null;return Math.min(60000,Math.max(r,e.retryAfterMs??0))}}var se=["minimal","low","medium","high","xhigh","max"],oe=i({id:t().min(1),kind:t(),name:t(),custom_name:t().nullish(),status:t(),online:d(),compatible:d().optional(),compatibility_reason:t().nullish(),folder_lane_of:t().nullish(),roots:u(i({id:t().min(1),label:t()}))}),re=i({devices:u(oe),end_cursor:t().nullish(),has_next_page:d().optional()}),ie=i({id:t().min(1),name:t()}),ae=i({items:u(ie)}),le=i({id:t().min(1),name:t(),main:d(),mine:d(),session_id:t().nullish(),appearance:i({color:t().nullish()}).nullish().catch(null)}),ce=i({items:u(le)}),de=i({skill_id:t().min(1),name:t(),description:t().nullish(),activation_keywords:u(t()).default([]),is_enabled:d().default(!0)}),me=i({items:u(de).default([])}),ue=i({id:t().min(1),kind:t(),enabled:d(),schedule:i({expression:t().nullish(),every_seconds:o().nullish(),next_run_at:t().nullish()}).nullish(),github:i({event:t().nullish(),action:t().nullish(),repo:t().nullish()}).nullish(),last_fired_at:t().nullish()}),U=i({id:t().min(1),name:t().nullish(),instructions:t().nullish(),enabled:d(),triggers:u(ue).default([])}),ge=i({items:u(U).default([]),end_cursor:t().nullish(),has_next_page:d().optional()}),he=i({id:t().min(1),slug:t().nullish(),name:t(),description:t().nullish(),transport:t().nullish(),url:t().nullish(),enabled:d()}),pe=i({items:u(he).default([])}),fe=i({status:t(),summary:t().nullish(),category:t().nullish(),outcome:t().nullish(),message_count:o().nullish(),pr_url:t().nullish(),cost_usd:o().nullish(),generated_at:t().nullish()}),T=i({tags:u(t()).default([])}),ye=s(["linux","macos"]),O=i({id:t().min(1),name:t().min(1),platform:ye.nullable(),workers:i({total:o().int(),online:o().int(),busy:o().int(),idle:o().int()}),sessions:i({queued:o().int(),running:o().int()})}),_e=i({machines:u(O)}),Re=i({machine:O}),be=i({deleted:n(!0),revoked_workers:o().int(),revoked_tokens:o().int()}),we=i({token:i({id:t().min(1),machine_id:t().min(1),token_prefix:t()}),secret:t().startsWith("rmt_")}),M=gs({machine_id:t().min(1),machine_name:t().min(1)}),Se=M.extend({organization_id:t().min(1)}),an=i({id:t().min(1),name:t().min(1),state:s(["waiting","placed"]),queue_position:o().int().nullable()});var ln=W([i({kind:n("cloud")}),i({kind:s(["mac","headless"]),device_id:t().min(1),root_id:t().min(1)})]);function h(e,r,a){let l=e.safeParse(r);if(!l.success)throw new I(502,a,"Reason returned an unexpected response.");return l.data}var ke=i({error:i({type:t(),message:t()})});function S(e,r,a){let l=ke.safeParse(r),c=typeof r.error==="string"?r.error:l.success?l.data.error.type:`http_${e}`,m=typeof r.detail==="string"?r.detail:typeof r.message==="string"?r.message:l.success?l.data.error.message:`Reason request failed (${e}${typeof r.error==="string"?` ${r.error}`:""})`,p=c==="github_connection_required"&&typeof r.connect_url==="string"&&/^https?:\/\//.test(r.connect_url)?` Connect it at ${r.connect_url}`:"",f=a===null||a.trim()===""?NaN:Number(a);return new I(e,c,`${m}${p}`,typeof r.suggested_model==="string"?r.suggested_model:void 0,Number.isFinite(f)&&f>=0?f*1000:void 0,typeof r.resolution_reason==="string"?r.resolution_reason:void 0,typeof r.code==="string"?{code:r.code,...typeof r.billing_path==="string"&&/^\/(?![/\\])/.test(r.billing_path)?{billingPath:r.billing_path}:{}}:void 0)}async function Ps(e){let r=await(e.fetchImpl??fetch)(`${e.apiOrigin}/v3/machines/enrollment-tickets`,{method:"POST",headers:{authorization:`Bearer ${e.token}`,accept:"application/json","content-type":"application/json"},body:JSON.stringify(e.body),signal:AbortSignal.timeout(30000),redirect:"error"}),a=await r.json().catch(()=>({}));if(!r.ok)throw S(r.status,a,r.headers.get("retry-after"));return h(Se,a,"invalid_machine_ticket")}var ve=i({items:u(i({name:t()}))}),xe=i({name:t(),scope:t(),result:s(["created","updated"]).optional(),warning:i({message:t()}).optional()});class rs{options;credentials;constructor(e,r={}){this.options=r;this.credentials=e}trackEvent(e,r={}){}async request(e,r={}){let{status:a,headers:l,json:c}=await this.exchange(e,r);if(a<200||a>299)throw S(a,c,l.get("retry-after"));return c}async exchange(e,r={},a=!1){let l=this.options.fetchImpl??fetch;if(!a&&r.retryUnauthorized!==!1)await this.renewBeforeExpiry(l,r.signal);let c=await l(`${this.credentials.apiOrigin}/v3${e}`,{method:r.method??"GET",headers:{authorization:`Bearer ${this.credentials.accessToken}`,accept:"application/json","user-agent":Qn,"x-reason-agent":"Reason CLI","x-client-surface":this.options.clientSurface??"direct_cli",...r.raw?{"content-type":r.raw.contentType}:r.body===void 0?{}:{"content-type":"application/json"},...r.headers,...r.ifNoneMatch?{"if-none-match":r.ifNoneMatch}:{}},body:r.raw?r.raw.bytes:r.body===void 0?void 0:JSON.stringify(r.body),signal:r.signal,redirect:r.ifNoneMatch?"manual":"error"}),m=await c.json().catch(()=>({}));if(c.status===401&&!a&&r.retryUnauthorized!==!1&&this.credentials.credentialKind!=="api_key"){let p=await ot({fetchImpl:l,path:this.options.credentialsPath,forceRefresh:!0,refused:this.credentials.accessToken,signal:r.signal});if(p)return this.credentials=p,this.exchange(e,r,!0)}return{status:c.status,headers:c.headers,json:m}}async renewBeforeExpiry(e,r){let a=this.credentials;if(a.credentialKind==="api_key"||!(Date.parse(a.expiresAt)<=Date.now()+60000))return;let l=await ot({fetchImpl:e,path:this.options.credentialsPath,signal:r}).catch(()=>null);if(l&&l.apiOrigin===a.apiOrigin&&l.orgId===a.orgId&&l.clientId===a.clientId)this.credentials=l}createHeadlessDeviceEnrollmentTicket(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollment-tickets`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}async enrollHeadlessDevice(e){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollments`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}catch(r){if(r instanceof I&&(r.status===404||r.status===405||r.status===403&&r.code==="endpoint_not_available"))return null;throw r}}addDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}removeDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots/${encodeURIComponent(r)}`,{method:"DELETE",signal:AbortSignal.timeout(30000)})}machinePath(e,r=""){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/machines`;return e===void 0?a:`${a}/${encodeURIComponent(e)}${r}`}async listMachines(){return h(_e,await this.request(this.machinePath()),"invalid_machine_list").machines}async createMachine(e){let r=await this.request(this.machinePath(),{method:"POST",body:{name:e.name,...e.platform?{platform:e.platform}:{}}});return h(Re,r,"invalid_machine").machine}async deleteMachine(e){let r=await this.request(this.machinePath(e),{method:"DELETE"});return h(be,r,"invalid_machine_deletion")}async listSecretNames(e){let r=await this.request(`${this.secretsPath()}?scope=${e}`);return h(ve,r,"invalid_secret_list").items.map((a)=>a.name)}async setSecret(e){let r=await this.request(this.secretsPath(),{method:"POST",body:e});return h(xe,r,"invalid_secret_write")}secretsPath(){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/secrets`}async createMachineToken(e){let r=await this.request(this.machinePath(e,"/tokens"),{method:"POST",body:{}});return h(we,r,"invalid_machine_token")}async createMachineEnrollmentTicket(e,r){let a=await this.request(this.machinePath(e,"/enrollment-tickets"),{method:"POST",body:r,signal:AbortSignal.timeout(30000),retryUnauthorized:!1});return h(M,a,"invalid_machine_ticket")}self(e){return this.request("/self",{signal:e})}submitFeedback(e){return this.request("/feedback",{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}agentNetwork(e=AbortSignal.timeout(30000)){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{signal:e})}startAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}rotateAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"PUT",body:e,signal:AbortSignal.timeout(30000)})}async claimAgentNetworkRelayJob(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/claim`,{method:"POST",body:e,signal:r});return h(P,a,"invalid_agent_network_job")}async completeAgentNetworkRelayJob(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/jobs/${encodeURIComponent(e)}`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}async recordAgentNetworkRelayReplies(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/replies`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}async workspaceMembers(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/members/users`,{signal:AbortSignal.timeout(30000)})).items??[]).flatMap((r)=>typeof r.email==="string"?[{email:r.email,role:typeof r.role==="string"?r.role:"member"}]:[])}claimExistingCliPairing(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/onboarding/import/pairing/claim-existing`,{method:"POST",body:{pairing_code:e}})}async claudeCodeSignIn(e){return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials`,{retryUnauthorized:!1,signal:e?AbortSignal.any([e,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000)})).claude_code_sign_in===!0}connectAnthropicProvider(e,r,a={}){let l=e.kind==="setup_token"?{setup_token:e.token}:{access_token:e.credential.access,refresh_token:e.credential.refresh,expires_at:new Date(e.credential.expires).toISOString()};return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials/anthropic`,{method:"POST",retryUnauthorized:a.retryUnauthorized,signal:a.signal,body:{...l,...r?{account_key:r}:{}}})}async listRepositories(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/repositories`)).items??[]).flatMap((r)=>{let a=typeof r.full_name==="string"?r.full_name:typeof r.repo_full_name==="string"?r.repo_full_name:null;if(!a)return[];return[{repo_id:typeof r.repo_id==="string"?r.repo_id:void 0,full_name:a,provider:r.provider==="gitlab"?"gitlab":"github",default_branch:typeof r.default_branch==="string"?r.default_branch:null,private:typeof r.private==="boolean"?r.private:void 0}]})}async listProjects(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/projects`),r=ae.safeParse(e);if(!r.success)throw new I(502,"invalid_project_list","Reason returned an unexpected project list.");return r.data.items}async listReasons(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons`);return h(ce,e,"invalid_reason_list").items}async openReasonConversation(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons/${encodeURIComponent(e)}/conversation`,{method:"POST"});return h(i({session_id:t().min(1)}),r,"invalid_reason_conversation").session_id}async listSkills(){try{let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills`);return h(me,e,"invalid_skill_list").items}catch(e){if(e instanceof I&&(e.status===403||e.status===404))return[];throw e}}async listDevices(){let e=[],r=null;for(let a=0;a<50;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices${r?`?after=${encodeURIComponent(r)}`:""}`),c=re.safeParse(l);if(!c.success)throw new I(502,"invalid_device_list","Reason returned an unexpected machine list.");if(e.push(...c.data.devices),r=c.data.has_next_page?c.data.end_cursor??null:null,!r)break}return e}async listModels(){try{let r=((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`)).models??[]).filter((c)=>c.hidden!==!0),a=r.filter((c)=>c.available!==!1).map(({reasoning_efforts:c,hidden:m,available:p,...f})=>({...f,...Array.isArray(c)?{reasoning_efforts:se.filter((y)=>c.includes(y))}:{}})),l=new Set(a.map((c)=>c.detail));return{models:a.length>1&&l.size===1?a.map(({detail:c,...m})=>m):a,runnable:a.length>0||r.length===0}}catch(e){if(e instanceof I&&(e.status===403||e.status===404))return{models:[],runnable:!0};throw e}}async getAgentVersion(e){try{let r=await this.request("/deployment",{signal:e,retryUnauthorized:!1});return v(r.reason_version)?r.reason_version:null}catch{return null}}async getUsageQuota(){try{let e=ee.safeParse(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/usage/quota`));if(!e.success)return null;let r;try{r=te(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`))}catch{}return{...e.data,own_inference:r}}catch(e){if(e instanceof I&&(e.status===403||e.status===404))return null;throw e}}async listSessionFields(e){let r=new URLSearchParams({first:String(Math.min(Math.max(e.first,1),200)),status:e.status??"active"});if(e.origin)r.set("origin",e.origin);r.set("fields",e.fields.join(","));let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${r.toString()}`,{status:l,headers:c,json:m}=await this.exchange(a,e.etag?{ifNoneMatch:e.etag}:{});if(l===304)return null;if(l<200||l>299)throw S(l,m,c.get("retry-after"));return{items:Array.isArray(m.items)?m.items:[],etag:c.get("etag")}}async listSessions(e=50,r,a={}){let l=new URLSearchParams({first:String(Math.min(Math.max(e,1),200)),status:a.status??"active"});if(r)l.set("project_id",r);if(a.origin)l.set("origin",a.origin);return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${l.toString()}`)).items??[]}getSession(e,r){let a=r?.fields.length?`?fields=${encodeURIComponent(r.fields.join(","))}`:"";return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${a}`)}async prestartSession(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/prestart`,{method:"POST",body:{client_session_id:e}});return r?.status==="starting"||r?.status==="ready"}async createSession(e){let r=e.mode==="ephemeral"||e.workspaceOwnership==="externally-managed";if(e.attachments?.length)await this.requireSessionAttachments();if(r||e.runtimeProfile){let c=await this.request("/deployment");if(r&&(!Array.isArray(c.session_modes)||!c.session_modes.includes(e.mode??"standard")||!Array.isArray(c.workspace_ownerships)||!c.workspace_ownerships.includes(e.workspaceOwnership??"managed")))throw Error("Deployment does not support the requested Session policy; refusing to create a Session.");if(e.runtimeProfile&&(!Array.isArray(c.experimental_runtime_profiles)||!c.experimental_runtime_profiles.includes(e.runtimeProfile)))throw Error("Deployment does not support the requested runtime profile; refusing to create a Session.")}let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions`,{method:"POST",body:{prompt:e.prompt,...e.attachments?.length?{attachments:e.attachments}:{},...e.mode?{mode:e.mode}:{},...e.workspaceOwnership?{workspace_ownership:e.workspaceOwnership}:{},...e.target?{target:e.target}:{},...e.repo?{repo:e.repo}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.reasoningEffort?{reasoning_effort:e.reasoningEffort}:{},...e.runtimeProfile?{experimental_runtime_profile:e.runtimeProfile}:{},...e.ref?{ref:e.ref}:{},...e.branch?{branch:e.branch}:{},...e.completionMode?{completion_mode:e.completionMode}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.clientSessionId?{client_session_id:e.clientSessionId}:{},...e.longRunning?{long_running:{enabled:!0}}:{},...e.spendLimitRcu?{spend_limit_rcu:e.spendLimitRcu}:{},idempotency_key:`cli-${crypto.randomUUID()}`}}),l=await this.getSession(a.session_id);if(r){let c=l.session_policy,m=["memoryRead","memoryWrite","skills","inheritedInstructions","integrations","secretInjection"];if(!c||c.version!==1||c.mode!==(e.mode??"standard")||c.workspaceOwnership!==(e.workspaceOwnership??"managed")||!c.components||m.some((p)=>c.components[p]!==!0))throw await this.cancelSession(a.session_id),Error("Server did not attest the requested Session policy; cancellation requested.")}if(e.runtimeProfile&&l.experimental_runtime_profile!==e.runtimeProfile)throw await this.cancelSession(a.session_id),Error("Server did not attest the requested runtime profile; cancellation requested.");return l}async getEvents(e,r=-1,a={}){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/events?after_seq=${r}&limit=500${a.waitMs?`&wait_ms=${a.waitMs}`:""}`,a.signal?{signal:a.signal}:{})}catch(l){if(!(l instanceof I)||l.status!==403&&l.status!==404)throw l;return{session:await this.getSession(e),items:[],next_seq:r}}}async getMessages(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages?first=500${r===void 0?"":`&after_seq=${r}`}`)}async getAttachments(e,r){try{return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/attachments${r?`?view=${r}`:""}`)).items??[]}catch(a){if(a instanceof I&&(a.status===403||a.status===404))return[];throw a}}async requireSessionAttachments(){let e=await this.request("/deployment",{headers:{"cache-control":"no-cache"}});if(e.session_attachments!==!0){let r=typeof e.reason_version==="string"&&/^\d+\.\d+(?:\.\d+)?$/.test(e.reason_version)?`Agent ${e.reason_version}`:null,a=typeof e.commit_sha==="string"&&/^[a-f0-9]{40,64}$/i.test(e.commit_sha)?`server ${e.commit_sha.slice(0,12)}`:null,l=[r,a].filter(Boolean).join(", ");throw Error(`This server does not support Session image attachments: ${new URL(this.credentials.apiOrigin).host}${l?` (${l})`:""}. The API server needs an attachment-capable deployment; updating the Agent version alone is not enough. Your image was not sent; retry after the server update.`)}}async sendMessage(e,r,a={}){if(a.attachments?.length)await this.requireSessionAttachments();return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:{message:r,...a.attachments?.length?{attachments:a.attachments}:{},...a.model?{model:a.model}:{},...a.reasoningEffort?{reasoning_effort:a.reasoningEffort}:{},...a.target?{target:a.target}:{},...a.delivery?{delivery:a.delivery}:{}}})}async steerQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/steer`,{method:"POST",body:{}})}async withdrawQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/queued`,{method:"DELETE"})}async getConversation(e){let r=[],a=null;for(let l=0;l<50;l+=1){let c=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/conversation${a?`?after=${encodeURIComponent(a)}`:""}`);if(r.push(...c.items??[]),!c.has_next_page||!c.end_cursor)break;a=c.end_cursor}return r}createSharedLink(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/shared-links`,{method:"POST",body:{url:r.url,...r.label?{label:r.label}:{},...r.expiresInSeconds!==void 0?{expires_in_seconds:r.expiresInSeconds}:{}}})}sessionAction(e,r,a={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/${r}`,{method:"POST",body:a})}renameSession(e,r){return this.sessionAction(e,"rename",{title:r||null})}moveSessionToProject(e,r){return this.sessionAction(e,"project",{project_id:r})}compactSession(e){return this.sessionAction(e,"compact")}retrySession(e){return this.sessionAction(e,"retry")}rewindSession(e,r){return this.sessionAction(e,"rewind",{message_id:r.messageId,content:r.content,request_id:r.requestId})}forkSession(e,r){return this.sessionAction(e,"fork",{...r.message?{message:r.message}:{},client_session_id:r.clientSessionId})}cancelSession(e,r={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/cancel`,{method:"POST",body:r.mode==="hard"?{mode:"hard"}:{}})}sessionPath(e,r=""){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${r}`}async archiveSession(e){await this.request(this.sessionPath(e,"/archive"),{method:"POST",body:{}})}async unarchiveSession(e){await this.request(this.sessionPath(e,"/unarchive"),{method:"POST",body:{}})}async deleteSession(e){await this.request(this.sessionPath(e),{method:"DELETE"})}async listSessionTags(e){return h(T,await this.request(this.sessionPath(e,"/tags")),"invalid_session_tags").tags}async appendSessionTags(e,r){let a=await this.request(this.sessionPath(e,"/tags"),{method:"POST",body:{tags:r}});return h(T,a,"invalid_session_tags").tags}async sessionInsight(e,r=!1){let a=await this.request(this.sessionPath(e,r?"/insights/generate":"/insights"),r?{method:"POST",body:{}}:{});return h(fe,a,"invalid_session_insight")}async listAutomations(){let e=[],r=null;for(let a=0;a<20;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations?first=100${r?`&after=${encodeURIComponent(r)}`:""}`),c=h(ge,l,"invalid_automation_list");if(e.push(...c.items),r=c.has_next_page?c.end_cursor??null:null,!r)break}return e}async createScheduledAutomation(e,r){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations`,l=h(U,await this.request(a,{method:"POST",body:{name:e.name,instructions:e.instructions,...e.repo?{repo:e.repo.full_name,provider:e.repo.provider}:{}}}),"invalid_automation");try{await this.request(`${a}/${encodeURIComponent(l.id)}/triggers`,{method:"POST",body:r})}catch(c){throw await this.deleteAutomation(l.id).catch(()=>{return}),c}return l}async setAutomationEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"PATCH",body:{enabled:r}})}async deleteAutomation(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"DELETE"})}async transcribe(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/transcribe`,{method:"POST",raw:{bytes:e,contentType:r}});return h(i({transcript:t()}),a,"invalid_transcript").transcript}async listMcpServers(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/mcp-servers`);return h(pe,e,"invalid_mcp_server_list").items}async setSkillEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills/${encodeURIComponent(e)}`,{method:"PUT",body:{is_enabled:r}})}}
|
|
3
|
-
export{ot,
|
|
2
|
+
import{R}from"./vm-hands-entry-lite-a3p6xz53.js";import{Fo}from"./vm-hands-entry-lite-mc5y3xr9.js";import{Fe,un,Dt,dn}from"./vm-hands-entry-lite-jzmrhjkz.js";import{Qn}from"./vm-hands-entry-lite-j1hddtjs.js";import{t,o,d,u,i,gs,W,g,s,n}from"./vm-hands-entry-lite-bjtcy8n6.js";var E=/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/;function v(e){let r=typeof e==="string"?E.exec(e):null;return r?{major:Number(r[1]),minor:Number(r[2])}:null}var z=25,x=1e5,j=/^[0-9a-f]{64}$/,L=i({day:t().regex(/^\d{4}-\d{2}-\d{2}$/),sent:o().int().min(0).max(x),received:o().int().min(0).max(x)}),Ue=i({machine:t().min(1).max(200),person:t().min(1).max(200),team:t().min(1).max(200),team_id:t().min(1).max(200).optional(),workspace:d().optional(),version:t().max(64).optional(),wait_seconds:o().int().min(0).max(z).optional(),message_counts:u(L).max(14).optional().catch(void 0),endpoint:t().regex(j).optional().catch(void 0)}),N=g("kind",[i({id:t(),kind:n("who"),all:d().optional()}),i({id:t(),kind:n("send"),to:t(),body:t(),from_name:t(),from_agent:t(),wake:d(),reply_to:t().max(100).optional(),notify:d().optional()})]),P=i({job:N.nullable(),retry_after_seconds:o().optional()}),H=i({address:t(),person:t(),machine:t(),agent:t(),repo:t().nullable(),branch:t().nullable(),status:t(),since:o().nullable(),doing:t().nullable(),worker:d(),tier:t().max(10).optional()}),F=i({person:t(),machine:t(),online:d()}),B=i({team:t().nullable(),sessions:u(H).max(2000),machines:u(F).max(500),all:d().optional()}),G=i({address:t().max(300),state:t().max(40),note:t().max(500)}),Oe=W([i({who:B}),i({sent:i({ids:u(t().max(100)).max(500),recipients:u(t().max(300)).max(500),from:t().max(300),deliveries:u(G).max(500).optional()})}),i({error:t().min(1).max(2000)})]),J=i({id:t().max(100),from:t().max(300),from_agent:t().max(100).nullable(),to:t().max(300),reply_to:t().max(100).nullable(),body:t().max(64000),sent_at:o()}),Me=i({messages:u(J).max(100),team:t().min(1).max(200).optional(),team_id:t().min(1).max(200).optional(),workspace:d().optional()});var I=["run","mcp:read","mcp:write","secrets:read","secrets:write","sessions:read","sessions:debug","devices:read","devices:write","devices:use","ssh:write","knowledge:read","memory:read","memory:write","skills:read","skills:write","repos:read","repos:write","reviews:read","reviews:write","deployment:read","analytics:read","org:read","org:write","attachments:read","attachments:write","guardrails:read","guardrails:write","network:read","network:write","automations:read","automations:write","agent_auth:read"];var Ve=I.filter((e)=>e!=="network:read"&&e!=="network:write");class b extends Error{oauthCode;constructor(e,r=null){super(e);this.oauthCode=r;this.name="LoginError"}}function K(e,r){let a=typeof e.error==="string"?e.error:null,l=typeof e.error_description==="string"?e.error_description:a?a:r;return new b(l,a)}async function Q(e,r,a,l){let c=await a(`${e}/mcp/oauth/token`,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded"},body:r,signal:l}),m=await c.json().catch(()=>({}));if(!c.ok)throw K(m,`OAuth token request failed (${c.status})`);return m}var V=1e4;async function Y(e,r={}){let a=r.fetchImpl??fetch,l=await Q(e.apiOrigin,new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken}),a,AbortSignal.timeout(V)).catch((m)=>{if(m instanceof Error&&m.name==="TimeoutError")throw new b("Reason did not answer the login refresh in time. Check the network and retry.");throw m});if(typeof l.access_token!=="string"||typeof l.refresh_token!=="string"||typeof l.expires_in!=="number")throw new b("Reason returned an incomplete refreshed login.");let c={...e,accessToken:l.access_token,refreshToken:l.refresh_token,expiresAt:new Date(Date.now()+l.expires_in*1000).toISOString(),scopes:typeof l.scope==="string"?l.scope.split(/\s+/).filter(Boolean):e.scopes};return un(c,r.path??Fe()),c}var w=new Map,X=2000,Z=100;function C(e,r){if(!r)return e;if(r.aborted)return Promise.reject(r.reason);return new Promise((a,l)=>{let c=()=>l(r.reason);r.addEventListener("abort",c,{once:!0}),e.then(a,l).finally(()=>r.removeEventListener("abort",c))})}async function ot(e={}){let r=e.path??Fe(),a=Dt(r);if(!a)return null;let l=e.apiOrigin??R(process.env,"REASON_API_URL")?.trim();if(l&&!Fo(a.apiOrigin,new URL(l).origin))return null;if(!(Date.parse(a.expiresAt)<=Date.now()+60000)&&(!e.forceRefresh||e.refused!==void 0&&a.accessToken!==e.refused))return a;let m=[r,a.apiOrigin,a.clientId,a.refreshToken].join("\x00"),p=w.get(m);if(p)return C(p,e.signal);let f;return f=Y(a,{fetchImpl:e.fetchImpl,path:r}).catch(async(y)=>{if(!(y instanceof b)||y.oauthCode!=="invalid_grant"&&y.oauthCode!=="invalid_client")throw y;let k=(_)=>_!==null&&(y.oauthCode==="invalid_client"?_.clientId!==a.clientId:_.refreshToken!==a.refreshToken),M=Date.now()+X;while(!k(Dt(r))&&Date.now()<M)await new Promise((_)=>setTimeout(_,Z));if(k(Dt(r)))return ot({fetchImpl:e.fetchImpl,path:r});return dn(r),null}).finally(()=>{if(w.get(m)===f)w.delete(m)}),w.set(m,f),C(f,e.signal)}var ee=i({label:t(),used_percent:o().min(0).max(100).nullable(),resets_at:t().nullable(),exhausted:d().nullable()}),ne=i({groups:u(i({selectable:d().optional(),accounts:u(i({source_id:t().min(1),model_ids:u(t().min(1)).optional()}))}))});function te(e){let r=ne.safeParse(e);if(!r.success)return;return r.data.groups.some((a)=>a.selectable!==!1&&a.accounts.some((l)=>l.model_ids===void 0||l.model_ids.length>0))}class D extends Error{status;code;suggestedModel;retryAfterMs;resolutionReason;refusal;constructor(e,r,a,l,c,m,p){super(a);this.status=e;this.code=r;this.suggestedModel=l;this.retryAfterMs=c;this.resolutionReason=m;this.refusal=p;this.name="ApiError"}static rateLimitDelayMs(e,r){if(!(e instanceof D)||e.status!==429)return null;return Math.min(60000,Math.max(r,e.retryAfterMs??0))}}var se=["minimal","low","medium","high","xhigh","max"],oe=i({id:t().min(1),kind:t(),name:t(),custom_name:t().nullish(),status:t(),online:d(),compatible:d().optional(),compatibility_reason:t().nullish(),folder_lane_of:t().nullish(),roots:u(i({id:t().min(1),label:t()}))}),re=i({devices:u(oe),end_cursor:t().nullish(),has_next_page:d().optional()}),ie=i({id:t().min(1),name:t()}),ae=i({items:u(ie)}),le=i({id:t().min(1),name:t(),main:d(),mine:d(),session_id:t().nullish(),appearance:i({color:t().nullish()}).nullish().catch(null)}),ce=i({items:u(le)}),de=i({skill_id:t().min(1),name:t(),description:t().nullish(),activation_keywords:u(t()).default([]),is_enabled:d().default(!0)}),me=i({items:u(de).default([])}),ue=i({id:t().min(1),kind:t(),enabled:d(),schedule:i({expression:t().nullish(),every_seconds:o().nullish(),next_run_at:t().nullish()}).nullish(),github:i({event:t().nullish(),action:t().nullish(),repo:t().nullish()}).nullish(),last_fired_at:t().nullish()}),T=i({id:t().min(1),name:t().nullish(),instructions:t().nullish(),enabled:d(),triggers:u(ue).default([])}),ge=i({items:u(T).default([]),end_cursor:t().nullish(),has_next_page:d().optional()}),he=i({id:t().min(1),slug:t().nullish(),name:t(),description:t().nullish(),transport:t().nullish(),url:t().nullish(),enabled:d()}),pe=i({items:u(he).default([])}),fe=i({status:t(),summary:t().nullish(),category:t().nullish(),outcome:t().nullish(),message_count:o().nullish(),pr_url:t().nullish(),cost_usd:o().nullish(),generated_at:t().nullish()}),A=i({tags:u(t()).default([])}),ye=s(["linux","macos"]),U=i({id:t().min(1),name:t().min(1),platform:ye.nullable(),workers:i({total:o().int(),online:o().int(),busy:o().int(),idle:o().int()}),sessions:i({queued:o().int(),running:o().int()})}),_e=i({machines:u(U)}),Re=i({machine:U}),be=i({deleted:n(!0),revoked_workers:o().int(),revoked_tokens:o().int()}),we=i({token:i({id:t().min(1),machine_id:t().min(1),token_prefix:t()}),secret:t().startsWith("rmt_")}),O=gs({machine_id:t().min(1),machine_name:t().min(1)}),Se=O.extend({organization_id:t().min(1)}),an=i({id:t().min(1),name:t().min(1),state:s(["waiting","placed"]),queue_position:o().int().nullable()});var ln=W([i({kind:n("cloud")}),i({kind:s(["mac","headless"]),device_id:t().min(1),root_id:t().min(1)})]);function h(e,r,a){let l=e.safeParse(r);if(!l.success)throw new D(502,a,"Reason returned an unexpected response.");return l.data}var ke=i({error:i({type:t(),message:t()})});function S(e,r,a){let l=ke.safeParse(r),c=typeof r.error==="string"?r.error:l.success?l.data.error.type:`http_${e}`,m=typeof r.detail==="string"?r.detail:typeof r.message==="string"?r.message:l.success?l.data.error.message:`Reason request failed (${e}${typeof r.error==="string"?` ${r.error}`:""})`,p=c==="github_connection_required"&&typeof r.connect_url==="string"&&/^https?:\/\//.test(r.connect_url)?` Connect it at ${r.connect_url}`:"",f=a===null||a.trim()===""?NaN:Number(a);return new D(e,c,`${m}${p}`,typeof r.suggested_model==="string"?r.suggested_model:void 0,Number.isFinite(f)&&f>=0?f*1000:void 0,typeof r.resolution_reason==="string"?r.resolution_reason:void 0,typeof r.code==="string"?{code:r.code,...typeof r.billing_path==="string"&&/^\/(?![/\\])/.test(r.billing_path)?{billingPath:r.billing_path}:{}}:void 0)}async function Ps(e){let r=await(e.fetchImpl??fetch)(`${e.apiOrigin}/v3/machines/enrollment-tickets`,{method:"POST",headers:{authorization:`Bearer ${e.token}`,accept:"application/json","content-type":"application/json"},body:JSON.stringify(e.body),signal:AbortSignal.timeout(30000),redirect:"error"}),a=await r.json().catch(()=>({}));if(!r.ok)throw S(r.status,a,r.headers.get("retry-after"));return h(Se,a,"invalid_machine_ticket")}var ve=i({items:u(i({name:t()}))}),xe=i({name:t(),scope:t(),result:s(["created","updated"]).optional(),warning:i({message:t()}).optional()});class rs{options;credentials;constructor(e,r={}){this.options=r;this.credentials=e}trackEvent(e,r={}){}async request(e,r={}){let{status:a,headers:l,json:c}=await this.exchange(e,r);if(a<200||a>299)throw S(a,c,l.get("retry-after"));return c}async exchange(e,r={},a=!1){let l=this.options.fetchImpl??fetch;if(!a&&r.retryUnauthorized!==!1)await this.renewBeforeExpiry(l,r.signal);let c=await l(`${this.credentials.apiOrigin}/v3${e}`,{method:r.method??"GET",headers:{authorization:`Bearer ${this.credentials.accessToken}`,accept:"application/json","user-agent":Qn,"x-reason-agent":"Reason CLI","x-client-surface":this.options.clientSurface??"direct_cli",...r.raw?{"content-type":r.raw.contentType}:r.body===void 0?{}:{"content-type":"application/json"},...r.headers,...r.ifNoneMatch?{"if-none-match":r.ifNoneMatch}:{}},body:r.raw?r.raw.bytes:r.body===void 0?void 0:JSON.stringify(r.body),signal:r.signal,redirect:r.ifNoneMatch?"manual":"error"}),m=await c.json().catch(()=>({}));if(c.status===401&&!a&&r.retryUnauthorized!==!1&&this.credentials.credentialKind!=="api_key"){let p=await ot({fetchImpl:l,path:this.options.credentialsPath,forceRefresh:!0,refused:this.credentials.accessToken,signal:r.signal});if(p)return this.credentials=p,this.exchange(e,r,!0)}return{status:c.status,headers:c.headers,json:m}}async renewBeforeExpiry(e,r){let a=this.credentials;if(a.credentialKind==="api_key"||!(Date.parse(a.expiresAt)<=Date.now()+60000))return;let l=await ot({fetchImpl:e,path:this.options.credentialsPath,signal:r}).catch(()=>null);if(l&&l.apiOrigin===a.apiOrigin&&l.orgId===a.orgId&&l.clientId===a.clientId)this.credentials=l}createHeadlessDeviceEnrollmentTicket(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollment-tickets`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}async enrollHeadlessDevice(e){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollments`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}catch(r){if(r instanceof D&&(r.status===404||r.status===405||r.status===403&&r.code==="endpoint_not_available"))return null;throw r}}addDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}removeDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots/${encodeURIComponent(r)}`,{method:"DELETE",signal:AbortSignal.timeout(30000)})}machinePath(e,r=""){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/machines`;return e===void 0?a:`${a}/${encodeURIComponent(e)}${r}`}async listMachines(){return h(_e,await this.request(this.machinePath()),"invalid_machine_list").machines}async createMachine(e){let r=await this.request(this.machinePath(),{method:"POST",body:{name:e.name,...e.platform?{platform:e.platform}:{}}});return h(Re,r,"invalid_machine").machine}async deleteMachine(e){let r=await this.request(this.machinePath(e),{method:"DELETE"});return h(be,r,"invalid_machine_deletion")}async listSecretNames(e){let r=await this.request(`${this.secretsPath()}?scope=${e}`);return h(ve,r,"invalid_secret_list").items.map((a)=>a.name)}async setSecret(e){let r=await this.request(this.secretsPath(),{method:"POST",body:e});return h(xe,r,"invalid_secret_write")}secretsPath(){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/secrets`}async createMachineToken(e){let r=await this.request(this.machinePath(e,"/tokens"),{method:"POST",body:{}});return h(we,r,"invalid_machine_token")}async createMachineEnrollmentTicket(e,r){let a=await this.request(this.machinePath(e,"/enrollment-tickets"),{method:"POST",body:r,signal:AbortSignal.timeout(30000),retryUnauthorized:!1});return h(O,a,"invalid_machine_ticket")}self(e){return this.request("/self",{signal:e})}submitFeedback(e){return this.request("/feedback",{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}agentNetwork(e=AbortSignal.timeout(30000)){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{signal:e})}startAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}rotateAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"PUT",body:e,signal:AbortSignal.timeout(30000)})}async claimAgentNetworkRelayJob(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/claim`,{method:"POST",body:e,signal:r});return h(P,a,"invalid_agent_network_job")}async completeAgentNetworkRelayJob(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/jobs/${encodeURIComponent(e)}`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}async recordAgentNetworkRelayReplies(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/replies`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}async workspaceMembers(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/members/users`,{signal:AbortSignal.timeout(30000)})).items??[]).flatMap((r)=>typeof r.email==="string"?[{email:r.email,role:typeof r.role==="string"?r.role:"member"}]:[])}claimExistingCliPairing(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/onboarding/import/pairing/claim-existing`,{method:"POST",body:{pairing_code:e}})}async claudeCodeSignIn(e){return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials`,{retryUnauthorized:!1,signal:e?AbortSignal.any([e,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000)})).claude_code_sign_in===!0}connectAnthropicProvider(e,r,a={}){let l=e.kind==="setup_token"?{setup_token:e.token}:{access_token:e.credential.access,refresh_token:e.credential.refresh,expires_at:new Date(e.credential.expires).toISOString()};return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials/anthropic`,{method:"POST",retryUnauthorized:a.retryUnauthorized,signal:a.signal,body:{...l,...r?{account_key:r}:{}}})}async listRepositories(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/repositories`)).items??[]).flatMap((r)=>{let a=typeof r.full_name==="string"?r.full_name:typeof r.repo_full_name==="string"?r.repo_full_name:null;if(!a)return[];return[{repo_id:typeof r.repo_id==="string"?r.repo_id:void 0,full_name:a,provider:r.provider==="gitlab"?"gitlab":"github",default_branch:typeof r.default_branch==="string"?r.default_branch:null,private:typeof r.private==="boolean"?r.private:void 0}]})}async listProjects(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/projects`),r=ae.safeParse(e);if(!r.success)throw new D(502,"invalid_project_list","Reason returned an unexpected project list.");return r.data.items}async listReasons(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons`);return h(ce,e,"invalid_reason_list").items}async openReasonConversation(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons/${encodeURIComponent(e)}/conversation`,{method:"POST"});return h(i({session_id:t().min(1)}),r,"invalid_reason_conversation").session_id}async listSkills(){try{let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills`);return h(me,e,"invalid_skill_list").items}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return[];throw e}}async listDevices(){let e=[],r=null;for(let a=0;a<50;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices${r?`?after=${encodeURIComponent(r)}`:""}`),c=re.safeParse(l);if(!c.success)throw new D(502,"invalid_device_list","Reason returned an unexpected machine list.");if(e.push(...c.data.devices),r=c.data.has_next_page?c.data.end_cursor??null:null,!r)break}return e}async listModels(){try{let r=((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`)).models??[]).filter((c)=>c.hidden!==!0),a=r.filter((c)=>c.available!==!1).map(({reasoning_efforts:c,hidden:m,available:p,...f})=>({...f,...Array.isArray(c)?{reasoning_efforts:se.filter((y)=>c.includes(y))}:{}})),l=new Set(a.map((c)=>c.detail));return{models:a.length>1&&l.size===1?a.map(({detail:c,...m})=>m):a,runnable:a.length>0||r.length===0}}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return{models:[],runnable:!0};throw e}}async getAgentVersion(e){try{let r=await this.request("/deployment",{signal:e,retryUnauthorized:!1});return v(r.reason_version)?r.reason_version:null}catch{return null}}async getUsageQuota(){try{let e=ee.safeParse(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/usage/quota`));if(!e.success)return null;let r;try{r=te(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`))}catch{}return{...e.data,own_inference:r}}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return null;throw e}}async listSessionFields(e){let r=new URLSearchParams({first:String(Math.min(Math.max(e.first,1),200)),status:e.status??"active"});if(e.origin)r.set("origin",e.origin);r.set("fields",e.fields.join(","));let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${r.toString()}`,{status:l,headers:c,json:m}=await this.exchange(a,e.etag?{ifNoneMatch:e.etag}:{});if(l===304)return null;if(l<200||l>299)throw S(l,m,c.get("retry-after"));return{items:Array.isArray(m.items)?m.items:[],etag:c.get("etag")}}async listSessions(e=50,r,a={}){let l=new URLSearchParams({first:String(Math.min(Math.max(e,1),200)),status:a.status??"active"});if(r)l.set("project_id",r);if(a.origin)l.set("origin",a.origin);return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${l.toString()}`)).items??[]}getSession(e,r){let a=r?.fields.length?`?fields=${encodeURIComponent(r.fields.join(","))}`:"";return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${a}`)}async prestartSession(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/prestart`,{method:"POST",body:{client_session_id:e}});return r?.status==="starting"||r?.status==="ready"}async createSession(e){let r=e.mode==="ephemeral"||e.workspaceOwnership==="externally-managed";if(e.attachments?.length)await this.requireSessionAttachments();if(r||e.runtimeProfile){let c=await this.request("/deployment");if(r&&(!Array.isArray(c.session_modes)||!c.session_modes.includes(e.mode??"standard")||!Array.isArray(c.workspace_ownerships)||!c.workspace_ownerships.includes(e.workspaceOwnership??"managed")))throw Error("Deployment does not support the requested Session policy; refusing to create a Session.");if(e.runtimeProfile&&(!Array.isArray(c.experimental_runtime_profiles)||!c.experimental_runtime_profiles.includes(e.runtimeProfile)))throw Error("Deployment does not support the requested runtime profile; refusing to create a Session.")}let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions`,{method:"POST",body:{prompt:e.prompt,...e.attachments?.length?{attachments:e.attachments}:{},...e.mode?{mode:e.mode}:{},...e.workspaceOwnership?{workspace_ownership:e.workspaceOwnership}:{},...e.target?{target:e.target}:{},...e.repo?{repo:e.repo}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.reasoningEffort?{reasoning_effort:e.reasoningEffort}:{},...e.runtimeProfile?{experimental_runtime_profile:e.runtimeProfile}:{},...e.ref?{ref:e.ref}:{},...e.branch?{branch:e.branch}:{},...e.completionMode?{completion_mode:e.completionMode}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.clientSessionId?{client_session_id:e.clientSessionId}:{},...e.longRunning?{long_running:{enabled:!0}}:{},...e.spendLimitRcu?{spend_limit_rcu:e.spendLimitRcu}:{},idempotency_key:`cli-${crypto.randomUUID()}`}}),l=await this.getSession(a.session_id);if(r){let c=l.session_policy,m=["memoryRead","memoryWrite","skills","inheritedInstructions","integrations","secretInjection"];if(!c||c.version!==1||c.mode!==(e.mode??"standard")||c.workspaceOwnership!==(e.workspaceOwnership??"managed")||!c.components||m.some((p)=>c.components[p]!==!0))throw await this.cancelSession(a.session_id),Error("Server did not attest the requested Session policy; cancellation requested.")}if(e.runtimeProfile&&l.experimental_runtime_profile!==e.runtimeProfile)throw await this.cancelSession(a.session_id),Error("Server did not attest the requested runtime profile; cancellation requested.");return l}async getEvents(e,r=-1,a={}){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/events?after_seq=${r}&limit=500${a.waitMs?`&wait_ms=${a.waitMs}`:""}`,a.signal?{signal:a.signal}:{})}catch(l){if(!(l instanceof D)||l.status!==403&&l.status!==404)throw l;return{session:await this.getSession(e),items:[],next_seq:r}}}async getMessages(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages?first=500${r===void 0?"":`&after_seq=${r}`}`)}async getAttachments(e,r){try{return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/attachments${r?`?view=${r}`:""}`)).items??[]}catch(a){if(a instanceof D&&(a.status===403||a.status===404))return[];throw a}}async requireSessionAttachments(){let e=await this.request("/deployment",{headers:{"cache-control":"no-cache"}});if(e.session_attachments!==!0){let r=typeof e.reason_version==="string"&&/^\d+\.\d+(?:\.\d+)?$/.test(e.reason_version)?`Agent ${e.reason_version}`:null,a=typeof e.commit_sha==="string"&&/^[a-f0-9]{40,64}$/i.test(e.commit_sha)?`server ${e.commit_sha.slice(0,12)}`:null,l=[r,a].filter(Boolean).join(", ");throw Error(`This server does not support Session image attachments: ${new URL(this.credentials.apiOrigin).host}${l?` (${l})`:""}. The API server needs an attachment-capable deployment; updating the Agent version alone is not enough. Your image was not sent; retry after the server update.`)}}async sendMessage(e,r,a={}){if(a.attachments?.length)await this.requireSessionAttachments();return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:{message:r,...a.attachments?.length?{attachments:a.attachments}:{},...a.model?{model:a.model}:{},...a.reasoningEffort?{reasoning_effort:a.reasoningEffort}:{},...a.target?{target:a.target}:{},...a.delivery?{delivery:a.delivery}:{}}})}async steerQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/steer`,{method:"POST",body:{}})}async withdrawQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/queued`,{method:"DELETE"})}async getConversation(e){let r=[],a=null;for(let l=0;l<50;l+=1){let c=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/conversation${a?`?after=${encodeURIComponent(a)}`:""}`);if(r.push(...c.items??[]),!c.has_next_page||!c.end_cursor)break;a=c.end_cursor}return r}createSharedLink(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/shared-links`,{method:"POST",body:{url:r.url,...r.label?{label:r.label}:{},...r.expiresInSeconds!==void 0?{expires_in_seconds:r.expiresInSeconds}:{}}})}sessionAction(e,r,a={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/${r}`,{method:"POST",body:a})}renameSession(e,r){return this.sessionAction(e,"rename",{title:r||null})}moveSessionToProject(e,r){return this.sessionAction(e,"project",{project_id:r})}compactSession(e){return this.sessionAction(e,"compact")}retrySession(e){return this.sessionAction(e,"retry")}rewindSession(e,r){return this.sessionAction(e,"rewind",{message_id:r.messageId,content:r.content,request_id:r.requestId})}forkSession(e,r){return this.sessionAction(e,"fork",{...r.message?{message:r.message}:{},client_session_id:r.clientSessionId})}cancelSession(e,r={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/cancel`,{method:"POST",body:r.mode==="hard"?{mode:"hard"}:{}})}sessionPath(e,r=""){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${r}`}async archiveSession(e){await this.request(this.sessionPath(e,"/archive"),{method:"POST",body:{}})}async unarchiveSession(e){await this.request(this.sessionPath(e,"/unarchive"),{method:"POST",body:{}})}async deleteSession(e){await this.request(this.sessionPath(e),{method:"DELETE"})}async listSessionTags(e){return h(A,await this.request(this.sessionPath(e,"/tags")),"invalid_session_tags").tags}async appendSessionTags(e,r){let a=await this.request(this.sessionPath(e,"/tags"),{method:"POST",body:{tags:r}});return h(A,a,"invalid_session_tags").tags}async sessionInsight(e,r=!1){let a=await this.request(this.sessionPath(e,r?"/insights/generate":"/insights"),r?{method:"POST",body:{}}:{});return h(fe,a,"invalid_session_insight")}async listAutomations(){let e=[],r=null;for(let a=0;a<20;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations?first=100${r?`&after=${encodeURIComponent(r)}`:""}`),c=h(ge,l,"invalid_automation_list");if(e.push(...c.items),r=c.has_next_page?c.end_cursor??null:null,!r)break}return e}async createScheduledAutomation(e,r){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations`,l=h(T,await this.request(a,{method:"POST",body:{name:e.name,instructions:e.instructions,...e.repo?{repo:e.repo.full_name,provider:e.repo.provider}:{}}}),"invalid_automation");try{await this.request(`${a}/${encodeURIComponent(l.id)}/triggers`,{method:"POST",body:r})}catch(c){throw await this.deleteAutomation(l.id).catch(()=>{return}),c}return l}async setAutomationEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"PATCH",body:{enabled:r}})}async deleteAutomation(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"DELETE"})}async transcribe(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/transcribe`,{method:"POST",raw:{bytes:e,contentType:r}});return h(i({transcript:t()}),a,"invalid_transcript").transcript}async listMcpServers(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/mcp-servers`);return h(pe,e,"invalid_mcp_server_list").items}async setSkillEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills/${encodeURIComponent(e)}`,{method:"PUT",body:{is_enabled:r}})}}
|
|
3
|
+
export{ot,D,Ps,rs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-
|
|
3
|
-
`).flatMap((n)=>{let s=/^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(n);return s&&Number(s[2])===e?[{pid:Number(s[1]),command:s[3]}]:[]})}async function Ea(){let e=u;if(!e)return{released:"unused",stopped:0};let o=S(e.root);g(p(o,String(process.pid)),{force:!0}),u=null;let n=!1;for(let t of D(o)){let c=Number(t);if(Number.isSafeInteger(c)&&c>0&&m(c))n=!0;else g(p(o,t),{force:!0})}if(n)return{released:"shared",stopped:0};let s=E().filter((t)=>t.pid!==process.pid&&(t.command.includes(`${e.root}${y}`)||t.command.includes(`${e.automation}${y}`)||t.command.includes(e.extensionDir))),l=(t,c)=>{try{process.kill(t,c)}catch{}};for(let t of s)l(t.pid,"SIGTERM");for(let t=Date.now()+P;Date.now()<t&&s.some((c)=>m(c.pid));)await new Promise((c)=>setTimeout(c,100));for(let t of s)if(m(t.pid))l(t.pid,"SIGKILL");return{released:"stopped",stopped:s.length}}var M=20000,N=30000,O=100,a=new Map,i=null,b=0,f=[];function ji(e){a.set(e,(a.get(e)??0)+1);let o=!1;return()=>{if(o)return;o=!0;let n=(a.get(e)??1)-1;if(n>0){a.set(e,n);return}if(a.delete(e),i?.run===e)i.idleUntil=0}}function T(){return new r("automation_desktop_busy","Another Session, or another agent of this Session, is using this worker's desktop. Retry after it finishes.")}function U(e,o){return i!==null&&i.run!==e&&(i.calls>0||o<i.idleUntil)}async function
|
|
4
|
-
export{Pt,Sa,Ea,ji,
|
|
2
|
+
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-q13ekwev.js";import{execFileSync as h}from"child_process";import{mkdirSync as k,readdirSync as D,readFileSync as w,rmSync as g,statSync as x,writeFileSync as L}from"fs";import{join as p,sep as y}from"path";import{setTimeout as _}from"timers/promises";var P=3000,u=null;function S(e){return p(e,"users")}function Pt(e){if(u?.root===e.root)return;let o=S(e.root);k(o,{recursive:!0,mode:448}),L(p(o,String(process.pid)),"",{mode:384}),u=e}function Sa(){if(!u)return;g(p(S(u.root),String(process.pid)),{force:!0}),u=null}function m(e){try{return process.kill(e,0),!0}catch(o){return o instanceof Error&&"code"in o&&o.code==="EPERM"}}function E(){let e=process.getuid?.();if(process.platform==="linux")return D("/proc").flatMap((n)=>{if(!/^\d+$/.test(n))return[];try{if(x(`/proc/${n}`).uid!==e)return[];let s=w(`/proc/${n}/cmdline`).toString("utf8").split("\x00").join(" ").trim();return s?[{pid:Number(n),command:s}]:[]}catch{return[]}});if(process.platform==="win32")return h(C("powershell.exe"),["-NoLogo","-NoProfile","-NonInteractive","-Command",'Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.CommandLine)" }'],{encoding:"utf8",maxBuffer:16777216,windowsHide:!0}).split(/\r?\n/).flatMap((s)=>{let l=/^(\d+) (.+)$/.exec(s.trim());return l?[{pid:Number(l[1]),command:l[2]}]:[]});return h("/bin/ps",["-axww","-o","pid=,uid=,command="],{encoding:"utf8",maxBuffer:16777216}).split(`
|
|
3
|
+
`).flatMap((n)=>{let s=/^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(n);return s&&Number(s[2])===e?[{pid:Number(s[1]),command:s[3]}]:[]})}async function Ea(){let e=u;if(!e)return{released:"unused",stopped:0};let o=S(e.root);g(p(o,String(process.pid)),{force:!0}),u=null;let n=!1;for(let t of D(o)){let c=Number(t);if(Number.isSafeInteger(c)&&c>0&&m(c))n=!0;else g(p(o,t),{force:!0})}if(n)return{released:"shared",stopped:0};let s=E().filter((t)=>t.pid!==process.pid&&(t.command.includes(`${e.root}${y}`)||t.command.includes(`${e.automation}${y}`)||t.command.includes(e.extensionDir))),l=(t,c)=>{try{process.kill(t,c)}catch{}};for(let t of s)l(t.pid,"SIGTERM");for(let t=Date.now()+P;Date.now()<t&&s.some((c)=>m(c.pid));)await new Promise((c)=>setTimeout(c,100));for(let t of s)if(m(t.pid))l(t.pid,"SIGKILL");return{released:"stopped",stopped:s.length}}var M=20000,N=30000,O=100,a=new Map,i=null,b=0,f=[];function ji(e){a.set(e,(a.get(e)??0)+1);let o=!1;return()=>{if(o)return;o=!0;let n=(a.get(e)??1)-1;if(n>0){a.set(e,n);return}if(a.delete(e),i?.run===e)i.idleUntil=0}}function T(){return new r("automation_desktop_busy","Another Session, or another agent of this Session, is using this worker's desktop. Retry after it finishes.")}function U(e,o){return i!==null&&i.run!==e&&(i.calls>0||o<i.idleUntil)}async function Hi(e,o,n=Date.now,s="run"){let l=Symbol(e);f.push(l);try{let d=n()+N;for(;;){if(b===0&&!U(e,n())&&(i?.run===e||f[0]===l))break;if(n()>=d)throw T();await _(O,void 0,{signal:o}).catch(()=>o.throwIfAborted())}}finally{f.splice(f.indexOf(l),1)}if(s==="call"&&!(i?.run===e&&(i.calls>0||n()<i.idleUntil))){b+=1;let d=!1;return()=>{if(d)return;d=!0,b-=1}}if(i?.run!==e)i={run:e,calls:0,idleUntil:0};let t=i;t.calls+=1;let c=!1;return()=>{if(c)return;c=!0,t.calls-=1,t.idleUntil=n()+M}}
|
|
4
|
+
export{Pt,Sa,Ea,ji,Hi};
|