@reason-machines/cli-linux-x64 0.2.503 → 0.2.505
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.txt +7 -8
- package/bin/reason +2 -2
- package/bin/runtime/srt/sandbox-runtime.mjs +52 -52
- package/bin/vm-hands/api-credentials-23k36ayh.js +2 -0
- package/bin/vm-hands/api-jd29p2kc.js +2 -0
- package/bin/vm-hands/ask-relay-zpp0rkhg.js +4 -0
- package/bin/vm-hands/connect-cli-xyxgcg6z.js +2 -0
- package/bin/vm-hands/credentials-byna24dv.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-p2agcsk0.js +2 -0
- package/bin/vm-hands/desktop-account-z16mmkxg.js +2 -0
- package/bin/vm-hands/device-workspace-y0tk3ne8.js +2 -0
- package/bin/vm-hands/hands-worker-source-0qa16xzj.js +2 -0
- package/bin/vm-hands/index-h6xkz48h.js +12818 -0
- package/bin/vm-hands/install-receipt-nnragt7p.js +2 -0
- package/bin/vm-hands/local-automation-xbpca0f3.js +2 -0
- package/bin/vm-hands/local-capabilities-30m8pzpv.js +2 -0
- package/bin/vm-hands/local-desktop-users-gxfywsan.js +2 -0
- package/bin/vm-hands/local-display-mac-n236gkpe.js +2 -0
- package/bin/vm-hands/local-display-session-ddafdm8k.js +2 -0
- package/bin/vm-hands/local-display-video-gha54xwa.js +2 -0
- package/bin/vm-hands/local-managed-process-0zwxyqxd.js +2 -0
- package/bin/vm-hands/local-pty-session-w1yrmjm0.js +2 -0
- package/bin/vm-hands/managed-runtime-8y90twae.js +2 -0
- package/bin/vm-hands/network-contract-v0fkg94d.js +2 -0
- package/bin/vm-hands/network-sign-in-3dkdkh3a.js +34 -0
- package/bin/vm-hands/package-z2dk6xva.js +2 -0
- package/bin/vm-hands/permissions-ga1ax8wd.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-vzgxd159.js +2 -0
- package/bin/vm-hands/serve-service-42nqanvr.js +2 -0
- package/bin/vm-hands/status-m0g7k47a.js +96 -0
- package/bin/vm-hands/version-ye6800p2.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-00y3kn86.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-0572m6cr.js +344 -0
- package/bin/vm-hands/vm-hands-entry-lite-07q2xvk1.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-0a4cy8gw.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-1nj03gbj.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-26xb026c.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-33h8294z.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-3882raa5.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-3rg3znp8.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-4swa18qz.js +10 -0
- package/bin/vm-hands/vm-hands-entry-lite-56v9haps.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-6x5pj2y0.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-fcvf8md1.js → vm-hands-entry-lite-8p8hz0j1.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-8twscwtw.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-8xe0wzp9.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-ah2ep922.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-b0p8f295.js +52 -0
- package/bin/vm-hands/{vm-hands-entry-lite-3gztfxwt.js → vm-hands-entry-lite-b7wy89y0.js} +54 -54
- package/bin/vm-hands/vm-hands-entry-lite-c5gt0086.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-wrvz9jxy.js → vm-hands-entry-lite-c8bf82tx.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-dgmap6z4.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-dhqmbqsh.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-e1xjfj57.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-e4hwb89r.js +66 -0
- package/bin/vm-hands/vm-hands-entry-lite-g6r5xrk0.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-ghhpgt3v.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-h5smacqn.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-jd31as70.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-k9n1pk42.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-kqbats5n.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-p9fwt68c.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-pkk555dx.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-pmw3ycgc.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-q9g11dbj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-r374pchj.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-r665z809.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-rck5h8fr.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-rj8yq6gp.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-w0hqa0d3.js → vm-hands-entry-lite-s8ty42st.js} +9 -5
- package/bin/vm-hands/vm-hands-entry-lite-s8zfzv0k.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-tafgty5k.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-tbdcmq09.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-td309c1y.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-v0bp1v66.js +128 -0
- package/bin/vm-hands/vm-hands-entry-lite-v0k8b768.js +452 -0
- package/bin/vm-hands/vm-hands-entry-lite-v4r1fggm.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-vqr3zrqr.js +539 -0
- package/bin/vm-hands/vm-hands-entry-lite-wbfmc0xn.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-x3pbyg92.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-rfz60hb3.js → vm-hands-entry-lite-xd2dn3n8.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-yqn8h1p0.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-zj3hb5jk.js +127 -0
- package/bin/vm-hands/vm-hands-entry-lite-zz8tr0bm.js +12 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -3
- package/bin/vm-hands/vm-hands-executor-6tncheya.js +12 -0
- package/bin/vm-hands/vm-hands-op-runner-s1ghsym7.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-k6egwk2t.js +4 -0
- package/bin/vm-hands/worker-preview-readiness-wh0yg1dz.js +2 -0
- package/bin/vm-hands/worker-sandbox-s054x4zw.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-3khds2ds.js +0 -2
- package/bin/vm-hands/api-credentials-qm62bpjs.js +0 -2
- package/bin/vm-hands/connect-cli-aqjq32ax.js +0 -2
- package/bin/vm-hands/credentials-drj5ktpt.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-389h3q6n.js +0 -2
- package/bin/vm-hands/desktop-account-tjf36aya.js +0 -2
- package/bin/vm-hands/device-workspace-pt07525s.js +0 -2
- package/bin/vm-hands/fsevents-s0cwdhcq.js +0 -2
- package/bin/vm-hands/hands-worker-source-wrj180b5.js +0 -2
- package/bin/vm-hands/index-w9sxzata.js +0 -12818
- package/bin/vm-hands/install-receipt-9bv4vth9.js +0 -2
- package/bin/vm-hands/local-automation-0h4gspef.js +0 -2
- package/bin/vm-hands/local-capabilities-bq62be6s.js +0 -2
- package/bin/vm-hands/local-desktop-users-tqagws7p.js +0 -2
- package/bin/vm-hands/local-display-mac-w792g9g3.js +0 -2
- package/bin/vm-hands/local-display-session-jdapy5nj.js +0 -2
- package/bin/vm-hands/local-display-video-zaahvqys.js +0 -2
- package/bin/vm-hands/local-managed-process-8xfcpy62.js +0 -2
- package/bin/vm-hands/local-pty-session-rdv5wv5g.js +0 -2
- package/bin/vm-hands/managed-runtime-b2c3ybmw.js +0 -2
- package/bin/vm-hands/network-contract-h6s7ptm5.js +0 -2
- package/bin/vm-hands/package-yy8qcwwn.js +0 -2
- package/bin/vm-hands/permissions-bkncrfej.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-vw2dbdse.js +0 -2
- package/bin/vm-hands/serve-service-zq91vepg.js +0 -2
- package/bin/vm-hands/status-zqgrfjee.js +0 -10
- package/bin/vm-hands/version-p5nf1t3k.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-13rapgf5.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1e1cmyyr.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-1g1v87ky.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-2dx4pnz7.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-2jadtgms.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-2k2b78mv.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-38g65s5x.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-3y7jrsta.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-5fqjftez.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-61yxnt1v.js +0 -128
- package/bin/vm-hands/vm-hands-entry-lite-64z2tjpg.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-6x1an7es.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-7777m86y.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-87vmbt38.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-88x7p823.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-8e388a7s.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-8qhz89mt.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-9wa2y4x0.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-a1xa7s06.js +0 -65
- package/bin/vm-hands/vm-hands-entry-lite-asvarhpz.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-azpzxdzz.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-dw558ggz.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-e4c6z5t3.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-f62fvme8.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-f69t48dj.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-gc7550c0.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-hhhc7xx3.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-krm8w7wp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-mcjca0ez.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-n11hd729.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-n4xgpgkw.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-np07qyeq.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-nqdstx24.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-p7cqhtyg.js +0 -126
- package/bin/vm-hands/vm-hands-entry-lite-psywfz8m.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-qy9xg6em.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-r602gdfm.js +0 -14
- package/bin/vm-hands/vm-hands-entry-lite-swrymqj9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-tebh7dcm.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-txd50spx.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-w0pegc58.js +0 -112
- package/bin/vm-hands/vm-hands-entry-lite-yas2db7h.js +0 -452
- package/bin/vm-hands/vm-hands-entry-lite-yretc2th.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-zce4hftk.js +0 -3
- package/bin/vm-hands/vm-hands-executor-seqvbxb7.js +0 -12
- package/bin/vm-hands/vm-hands-op-runner-mh0haxhr.js +0 -2
- package/bin/vm-hands/vm-hands-runtime-hg3yrdp9.js +0 -4
- package/bin/vm-hands/worker-preview-readiness-m2dn9mmn.js +0 -2
- package/bin/vm-hands/worker-sandbox-k4cfh0ya.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Kr,ei,Jr,ti}from"./vm-hands-entry-lite-e4c6z5t3.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Kr as installationReceiptPath,Jr as installerReasonAlias,ei as installerReceiptLauncher,ti as loadInstallationReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tn,Is,Ds,Ns,Ls,Rn}from"./vm-hands-entry-lite-w0hqa0d3.js";import"./vm-hands-entry-lite-61yxnt1v.js";import"./vm-hands-entry-lite-p7cqhtyg.js";import"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-13rapgf5.js";import"./vm-hands-entry-lite-gc7550c0.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-asvarhpz.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-e4c6z5t3.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-9wa2y4x0.js";import"./vm-hands-entry-lite-1g1v87ky.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{Ds as ensureLocalBrowser,Tn as localAutomationAvailable,Ns as localBrowserProfile,Is as localUserChromeHost,Ls as runAutomationCallLocally,Rn as runLocalAutomation};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ko,Ui,pn,Jo,Zo,Xo,Yo,Cs,As,Ps,Ts}from"./vm-hands-entry-lite-8e388a7s.js";import"./vm-hands-entry-lite-6x1an7es.js";import"./vm-hands-entry-lite-1e1cmyyr.js";import"./vm-hands-entry-lite-yas2db7h.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-3gztfxwt.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-64z2tjpg.js";import"./vm-hands-entry-lite-w0hqa0d3.js";import"./vm-hands-entry-lite-61yxnt1v.js";import"./vm-hands-entry-lite-p7cqhtyg.js";import"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-13rapgf5.js";import"./vm-hands-entry-lite-gc7550c0.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-asvarhpz.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-e4c6z5t3.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-9wa2y4x0.js";import"./vm-hands-entry-lite-1g1v87ky.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{r as LocalCapabilityError,Ko as SHORT_REQUEST_CAPABILITIES,Cs as capabilityInventoryForRoots,Ui as confinedExecutionShell,Jo as defaultLocalCommandRunner,As as deliverLocalHandsEnvironment,Yo as enrolledRootPaths,Ts as executeLocalOperation,Ps as rebindLocalHandsControl,Zo as runFileCapability,Xo as runTransferCapability,pn as spawnCaptured};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xt,pa,ha,Mi,$i}from"./vm-hands-entry-lite-1g1v87ky.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{pa as forgetLocalDesktopUse,$i as holdLocalDesktop,xt as noteLocalDesktopUse,ha as releaseLocalDesktop,Mi as trackDesktopRun};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$t,Ms,G,qe,Bt}from"./vm-hands-entry-lite-61yxnt1v.js";import"./vm-hands-entry-lite-p7cqhtyg.js";import"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-13rapgf5.js";import"./vm-hands-entry-lite-gc7550c0.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-1g1v87ky.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{qe as ensureLinuxDesktop,$t as localDisplayAvailable,Ms as localDisplayReady,G as privateDirectory,Bt as runLocalDisplayStream};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{In,Dn,Nn,Ln,Pr}from"./vm-hands-entry-lite-p7cqhtyg.js";import"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{In as MAC_SCREEN,Dn as WINDOWS_SCREEN,Nn as createDisplayVideoLane,Pr as localDisplayVideoAvailable,Ln as simulatorVideoFfmpeg};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{it,dr,Rs,Os}from"./vm-hands-entry-lite-1e1cmyyr.js";import"./vm-hands-entry-lite-yas2db7h.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-3gztfxwt.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-gc7550c0.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-9wa2y4x0.js";import"./vm-hands-entry-lite-1g1v87ky.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{it as ManagedProcessStoppedError,Rs as controlManagedDeviceProcess,Os as retireManagedDeviceProcess,dr as runManagedDeviceProcess};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Or,qt,Ir,rs,jn,Dr,Un}from"./vm-hands-entry-lite-13rapgf5.js";import"./vm-hands-entry-lite-gc7550c0.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{qt as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,Ir as LOCAL_PTY_MAX_SESSIONS,Or as LOCAL_PTY_MAX_SESSION_MS,Dr as defaultConnect,rs as defaultLoginShell,jn as ptyRuntimeSupported,Un as runLocalPtySession};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ys,bs,vs,Ss,Es,xs,ks}from"./vm-hands-entry-lite-5fqjftez.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{Es as acquireManagedRuntimeDirectoryLock,vs as currentManagedRuntimeVersion,ks as flushManagedRuntimeLifecycleEvents,Ss as isManagedRuntimeVersionExecutable,bs as legacyManagedRuntimePaths,ys as managedRuntimePaths,xs as recordManagedRuntimeLifecycle};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rt,Te,Vs,Gs,Ks,ii,Js,rn,oi,bt,si,ai,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Y,Re,q,Si,Ei,xi,Q,ki,Ci,Ai,Pi,Ti,vt,Ri,Zs,or,Oi,Xs,is,Ys,Qs,ea,ta,ra,na,ia,oa,sa,aa,ca,la,ua,da}from"./vm-hands-entry-lite-9wa2y4x0.js";export{Ri as AUTOMATION_CLOUD_SESSIONS,vt as AUTOMATION_USER_CHROME,gi as HANDS_CLOUD_ACCESS,_i as HANDS_CLOUD_ACCESS_KEY,pe as HANDS_CONFINEMENT,Y as HANDS_CONFINEMENT_KEY,li as HANDS_ENVIRONMENT_AT_CLAIM,ui as HANDS_ENVIRONMENT_AT_CLAIM_KEY,oi as HANDS_ENVIRONMENT_DELIVERY,bt 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,Re 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,Ti as JOBS_START_WAIT_KEY,Te as LOCAL_OPERATION_MAX_BYTES,rt as LOCAL_RUNTIME_PROTOCOL_VERSION,Ks as LOCAL_RUNTIME_ROUTES,rn as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,ii as LOCAL_RUNTIME_SESSION_PATH,or as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,Vs as RELAY_HOST_ALIAS_HEADER,Gs 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,Zs as WORKER_STARTUP_TIMING_STAGES,Oi as buildLocalRuntimeDeviceProofBytes,Js as localRuntimeSessionRoutable,ia as parseLocalRuntimeDisconnectResponse,Qs as parseLocalRuntimeEnrollmentResponse,Xs as parseLocalRuntimeErrorEnvelope,ta as parseLocalRuntimeFirstHeartbeat,ea as parseLocalRuntimeHeartbeatResponse,na as parseLocalRuntimeIdentityResponse,sa as parseLocalRuntimeLifecycleResponse,oa as parseLocalRuntimeLocalSubscriptionResponse,aa as parseLocalRuntimeOperationClaim,da as parseLocalRuntimeOperationCompletionResponse,ua as parseLocalRuntimeOperationEnvironmentResponse,la as parseLocalRuntimeOperationEventsResponse,ca as parseLocalRuntimeOperationHeartbeatResponse,is as parseLocalRuntimeProofChallenge,Ys as parseLocalRuntimeRegistrationResponse,ra as parseLocalRuntimeRootsSyncResponse};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{es,ts,$s,Bs}from"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Bs as allowMacPermissions,$s as permissionsSummary,ts as readMacPermissions,es as reasonIdentity};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{P,$r,Br,Hn,ht,zn,Fr,Je,Se,qn,Ze,Jt,ne,Xe,Wn,Ee,Zt,jr,Xt,Ur,Vn,ae,U,N,ce,Hr,zr,Gn}from"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Ur as REASON_HANDS_CLOSE_CODES,Ze as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,Fr as REASON_HANDS_JOB_MAX_INPUT_CHARS,Je as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,Se as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,qn as REASON_HANDS_JOB_MAX_RECORDS,zn as REASON_HANDS_MAX_ERROR_CHARS,$r as REASON_HANDS_MAX_FRAME_BYTES,Br as REASON_HANDS_MAX_INPUT_CHARS,ht as REASON_HANDS_MAX_OUTPUT_CHARS,Hn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,P as REASON_HANDS_PROTOCOL_VERSION,jr as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Xt 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,Xe as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Wn as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Jt as REASON_HANDS_PTY_PROTOCOL_VERSION,Vn as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,U as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,N as isReasonHandsUuid,Hr as parseReasonHandsJobRequest,zr as parseReasonHandsJobResult,Gn as parseReasonHandsPtyReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qr,xe,J,Jn,js,Ao,Us,Ye,ns,Zn,Hs,zs,Wr,qs,Ws}from"./vm-hands-entry-lite-asvarhpz.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-e4c6z5t3.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{qr as WORKER_SERVICE_ENV,J as WorkerServiceError,Ao as connectServiceLabel,xe as defaultWorkerServiceHost,zs as installWorkerService,Ye as installedWorkerService,Us as isConnectServiceLabel,Ws as removeWorkerService,Wr as restartWorkerService,qs as retargetWorkerServiceLogs,ns as retireLegacyWorkerService,Hs as workerServiceDefinitionCurrent,Jn as workerServiceLauncher,Zn as workerServiceProcessRunning,js as workerServiceRetargetPending};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./vm-hands-entry-lite-zce4hftk.js";import"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-rfz60hb3.js";import"./vm-hands-entry-lite-2k2b78mv.js";import"./vm-hands-entry-lite-88x7p823.js";import{Vt,pt}from"./vm-hands-entry-lite-gc7550c0.js";import{w,M,lr,Be,nt}from"./vm-hands-entry-lite-n11hd729.js";import"./vm-hands-entry-lite-9wa2y4x0.js";import"./vm-hands-entry-lite-8e388a7s.js";import"./vm-hands-entry-lite-yas2db7h.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-6x1an7es.js";import"./vm-hands-entry-lite-krm8w7wp.js";import"./vm-hands-entry-lite-p7cqhtyg.js";import"./vm-hands-entry-lite-w0pegc58.js";import"./vm-hands-entry-lite-hhhc7xx3.js";import"./vm-hands-entry-lite-r602gdfm.js";import"./vm-hands-entry-lite-8qhz89mt.js";import"./vm-hands-entry-lite-5fqjftez.js";import"./vm-hands-entry-lite-e4c6z5t3.js";import"./vm-hands-entry-lite-asvarhpz.js";import"./vm-hands-entry-lite-64z2tjpg.js";import"./vm-hands-entry-lite-dw558ggz.js";import"./vm-hands-entry-lite-3gztfxwt.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-1e1cmyyr.js";import"./vm-hands-entry-lite-1g1v87ky.js";import"./vm-hands-entry-lite-13rapgf5.js";import"./vm-hands-entry-lite-61yxnt1v.js";import"./vm-hands-entry-lite-w0hqa0d3.js";import"./vm-hands-entry-lite-n4xgpgkw.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import{a}from"./vm-hands-entry-lite-swrymqj9.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-a1xa7s06.js";import"./vm-hands-entry-lite-87vmbt38.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
|
-
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
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
reason mcp Show how to connect Claude Code, Codex, or another MCP client
|
|
7
|
-
reason mcp uninstall Remove only this machine's registrations of the earlier, retired server
|
|
8
|
-
|
|
9
|
-
Plugins for Claude Code and Codex: ${b}
|
|
10
|
-
`;var P=s(["granted","not_granted","unknown"]),C=i({status:P,checkedAt:o().finite(),executablePath:t().min(1)});var Oe=i({version:n(1),key:t(),at:o(),self:i({principal_type:t(),user_id:t().optional(),user_name:t().nullish(),email:t().nullish(),org_id:t(),organization_name:t().nullish(),organization_slug:t().nullish(),mcp_connections:u(i({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})});var x=30000;function L(e,c=Date.now(),y=null){let r=pt(e),d=(()=>{if(r?.state!=="connected"&&r?.state!=="starting")return!1;try{return process.kill(r.pid,0),!0}catch{return!1}})(),R=d&&r?.state==="connected",p=(g)=>R&&c-g>=0&&c-g<x,l=C.safeParse(r?.fullDiskAccess),m=Vt(r,y,c);return{...m?{permission_recovery:m}:{},full_disk_access:l.success&&p(l.data.checkedAt)?l.data.status:"unknown",keep_awake:{enabled:lr(e)==="battery_and_ac",holding:r?.idleSleepHold===!0&&p(Date.parse(r.lastHeartbeatAt??""))},executable:d&&l.success?l.data.executablePath:null}}function De(e=_()){if(process.platform!=="darwin")return null;let c=Be(I(nt(k(a()),e),"worker.json"));return c?L(w(c).daemon,Date.now(),M(c)):null}export{De as connectionMacState};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{H}from"./vm-hands-entry-lite-38g65s5x.js";import{ht}from"./vm-hands-entry-lite-dw558ggz.js";import{Kt}from"./vm-hands-entry-lite-wrvz9jxy.js";import{j}from"./vm-hands-entry-lite-gc7550c0.js";import{ie}from"./vm-hands-entry-lite-swrymqj9.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{$e}from"./vm-hands-entry-lite-mcjca0ez.js";import{existsSync as D,realpathSync as q,statSync as K}from"fs";import{platform as h}from"os";import{isAbsolute as z,sep as G}from"path";import{existsSync as X}from"fs";import{createRequire as Y}from"module";var k=$e(Kt)(()=>Y(import.meta.url)("bun:ffi"),X);function E(){return process.platform==="win32"&&typeof globalThis.Bun<"u"&&k.available()}function C(e=process.env){return k.defaultShell(e)}function M(e){return k.shellArgs(e)}function N(e){let n=k.spawn({...e,env:e.environment});return n.exited.then(()=>n.close()),{write:(o)=>n.write(o),resize:(o,t)=>n.resize(o,t),kill:()=>n.close(),exited:n.exited}}var Or=43200000,qt=ht,Ir=4,Q=/^[A-Za-z0-9._:-]{1,160}$/,V=1000;function I(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function P(e,n){if(typeof e!=="number"||!Number.isFinite(e)||e<=0)return n;return Math.min(V,Math.max(1,Math.floor(e)))}function Z(e,n=Date.now()){let o=["relay_url","session_id","expires_at"],t=new Set([...o,"cols","rows","cwd","workspace"]);if(!I(e)||o.some((b)=>!(b in e))||Object.keys(e).some((b)=>!t.has(b)))throw new r("invalid_pty_request","Reason terminal request is malformed.");let{relay_url:c,session_id:m,expires_at:g}=e;if(typeof c!=="string")throw new r("invalid_pty_request","Reason terminal relay URL is missing.");let d;try{d=new URL(c)}catch{throw new r("invalid_pty_request","Reason terminal relay URL is invalid.")}if(d.protocol!=="wss:"&&d.protocol!=="ws:"||d.username||d.password)throw new r("invalid_pty_request","Reason terminal relay URL is invalid.");if(typeof m!=="string"||!Q.test(m))throw new r("invalid_pty_request","Reason terminal session identity is invalid.");let p=typeof g==="string"?Date.parse(g):Number.NaN;if(!Number.isFinite(p)||p<=n)throw new r("invalid_pty_request","Reason terminal session has already expired.");if(e.cwd!==void 0&&typeof e.cwd!=="string")throw new r("invalid_pty_request","Reason terminal working directory is invalid.");let a=e.workspace===void 0?void 0:H(e.workspace);if(a===null||a&&e.cwd!==void 0)throw new r("invalid_pty_request","Reason terminal workspace is invalid.");return{relay_url:c,session_id:m,expires_at:new Date(Math.min(p,n+Or)).toISOString(),cols:P(e.cols,80),rows:P(e.rows,24),...e.cwd===void 0?{}:{cwd:e.cwd},...a?{workspace:a}:{}}}function ee(e,n){if(h()==="win32")[e,n]=[e.toLowerCase(),n.toLowerCase()];return n===e||n.startsWith(e+G)}function W(e,n){if(n===void 0)return e;if(!z(n))throw new r("pty_cwd_invalid","Reason terminal working directory must be absolute.");let o;try{o=q(n)}catch{throw new r("pty_cwd_invalid","Reason terminal working directory does not exist.")}if(!ee(e,o))throw new r("pty_cwd_outside_root","Reason terminal working directory escapes the granted root.");if(!K(o).isDirectory())throw new r("pty_cwd_invalid","Reason terminal working directory is not a directory.");return o}function rs(e=process.env){if(h()==="win32")return C(e);let n=e.SHELL;if(n&&z(n)&&D(n))return n;for(let o of h()==="darwin"?["/bin/zsh","/bin/bash","/bin/sh"]:["/bin/bash","/bin/sh"])if(D(o))return o;return"/bin/sh"}function ne(){let e=globalThis.Bun;if(!e)throw new r("pty_unavailable","Reason terminals require the Bun runtime.");return e.spawn}function jn(){if(h()==="win32")return E();return typeof globalThis.Bun<"u"}var re=(e)=>{if(h()==="win32")try{return N({...e,file:e.shell,args:M(e.shell),environment:{...e.environment,TERM:"xterm-256color"}})}catch{throw new r("pty_unavailable","Reason could not allocate a pseudo-terminal.")}let n=ne()({cmd:[e.shell,"-i","-l"],cwd:e.cwd,env:{...e.environment,TERM:"xterm-256color"},terminal:{cols:e.cols,rows:e.rows,data:(t,c)=>{e.onData(c)}}}),o=n.terminal;if(!o){try{n.kill()}catch{}throw new r("pty_unavailable","Reason could not allocate a pseudo-terminal.")}return{write:(t)=>o.write(t),resize:(t,c)=>o.resize(t,c),kill:()=>{try{n.kill()}catch{}},exited:n.exited.then((t)=>typeof t==="number"?t:null,()=>null)}},Dr=(e,n)=>n===void 0?new WebSocket(e):new WebSocket(e,{proxy:n}),v=new Set;function te(e){if(v.size>=Ir||v.has(e))return null;v.add(e);let n=!1;return()=>{if(n)return;n=!0,v.delete(e)}}async function Un(e,n={}){let o=n.now??Date.now,t=Z(e.payload,o()),c=te(e.operationId);if(!c)throw new r("pty_slot_busy","This Reason Device already runs the maximum number of terminals.");let m=o(),g,d,p;try{let a=t.workspace?ie(e.root,t.workspace):void 0;g=a?W(D(a.boundary)?q(a.boundary):a.boundary,a.path):W(e.root,t.cwd),d=n.environment??process.env,p=n.shellPath??rs(d)}catch(a){throw c(),a}return await new Promise((a,b)=>{let w=null,i=null,S=!1,x=!1,y=!1,T=null,U=0,B=0,O=[],R=0,A=null,l=(s)=>{if(y)return;if(y=!0,A)clearTimeout(A);e.signal.removeEventListener("abort",L);try{w?.kill()}catch{}try{i?.close(1000,"pty_session_over")}catch{}if(c(),s.kind==="rejected"){b(s.error);return}let u={reason:s.reason,exit_code:T,output_bytes:U,input_bytes:B,duration_ms:Math.max(0,o()-m)};e.emitEvent("pty.stopped",{...u}).catch(()=>{return}),a({...u})},L=()=>{let s=e.signal.reason;l({kind:"rejected",error:s instanceof r?s:new r("cancelled","Reason closed the terminal session.")})};if(e.signal.aborted){L();return}e.signal.addEventListener("abort",L,{once:!0}),A=setTimeout(()=>l({kind:"resolved",reason:"session_expired"}),Math.max(1,Date.parse(t.expires_at)-o()));let F=(s)=>{if(U+=s.byteLength,!S||!i){if(O.push(s),R+=s.byteLength,R>qt)l({kind:"resolved",reason:"output_backpressure"});return}try{i.send(s)}catch{l({kind:"resolved",reason:"relay_closed"});return}if(i.bufferedAmount>qt)l({kind:"resolved",reason:"output_backpressure"})};try{w=(n.spawnPty??re)({shell:p,args:["-i","-l"],cwd:g,cols:t.cols,rows:t.rows,environment:d,onData:(s)=>{if(!y)F(s)}})}catch(s){l({kind:"rejected",error:s instanceof r?s:new r("pty_spawn_failed","Reason could not start the terminal shell.")});return}w.exited.then((s)=>{if(y)return;if(T=s,S&&i)try{i.send(JSON.stringify({t:"exit",code:s}))}catch{}l({kind:"resolved",reason:"shell_exited"})});let J=(n.loadProxy??j)()?.url;try{i=(n.connect??Dr)(t.relay_url,J)}catch{l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}i.binaryType="arraybuffer",i.onopen=()=>{if(y||!i)return;S=!0;try{i.send(JSON.stringify({t:"open",cols:t.cols,rows:t.rows}));for(let s of O.splice(0))i.send(s);R=0}catch{l({kind:"resolved",reason:"relay_closed"});return}x=!0,e.emitEvent("pty.ready",{session_id:t.session_id,cols:t.cols,rows:t.rows}).catch(()=>{return})},i.onmessage=(s)=>{if(y||!w)return;let u=s.data;if(typeof u==="string"){let f;try{f=JSON.parse(u)}catch{return}if(!I(f))return;if(f.t==="resize"){try{w.resize(P(f.cols,t.cols),P(f.rows,t.rows))}catch{}return}if(f.t==="close")l({kind:"resolved",reason:"client_closed"});return}let _=u instanceof ArrayBuffer?new Uint8Array(u):ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):null;if(!_||_.byteLength===0)return;B+=_.byteLength;try{w.write(_)}catch{}},i.onclose=()=>{if(y)return;if(!x){l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")});return}l({kind:"resolved",reason:"relay_closed"})},i.onerror=()=>{if(y||x)return;l({kind:"rejected",error:new r("pty_relay_unavailable","Reason could not reach the terminal relay.")})}})}
|
|
3
|
-
export{Or,qt,Ir,rs,jn,Dr,Un};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{H}from"./vm-hands-entry-lite-38g65s5x.js";import{D,R,b}from"./vm-hands-entry-lite-3gztfxwt.js";import{je,hr,fr,wn,bn,st}from"./vm-hands-entry-lite-yas2db7h.js";import{Lr}from"./vm-hands-entry-lite-gc7550c0.js";import{p,ct,xn,_e,we}from"./vm-hands-entry-lite-psywfz8m.js";import{v,h}from"./vm-hands-entry-lite-f69t48dj.js";import{a,tr,Mo}from"./vm-hands-entry-lite-swrymqj9.js";import{nn,y,t,k,o,d,os,Oe,Ni,u,i,W,g,ee,s,n,on}from"./vm-hands-entry-lite-a1xa7s06.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{se,A}from"./vm-hands-entry-lite-87vmbt38.js";import{randomUUID as Q}from"crypto";import{spawn as Le}from"child_process";import{existsSync as Z,lstatSync as me,mkdirSync as We,readFileSync as Ne,realpathSync as G,rmSync as Ve,writeFileSync as He}from"fs";import{dirname as Ue,join as j,relative as qe,sep as Je}from"path";var Se=["process.run.v1","process.full.v1"],xe=600000,Pe=1800000,Ee=20000,ne="process.cancel.v1",ie=i({action:n("start"),request_id:t().uuid(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),cwd:t().min(1).max(4096).refine((e)=>!e.includes("\x00")&&!e.startsWith("/")&&!e.split(/[\\/]/).includes("..")).describe("Path relative to the granted device root; omit to use that root. Must not start with /, contain a .. path segment, or contain a NUL character.").optional(),mode:s(["host","confined"]).default("host"),timeout_ms:o().int().min(1000).max(Pe).default(xe).describe("Absolute process budget including queue and startup time. Defaults to ten minutes; longer explicit requests require the selected root's advertised max_timeout_ms. Retrying never renews the deadline.")}).strict(),K={device_id:t().uuid(),root_id:t().uuid()},Re=g("action",[ie.extend(K),i({...K,action:n("inspect"),process_id:t().uuid(),after:o().int().min(0).default(0),wait_ms:o().int().min(0).max(Ee).default(0).describe("Wait for new output or a state change, bounded by this call's wait budget. Expiring this wait does not cancel the process or extend its deadline.")}).strict(),i({...K,action:n("cancel"),process_id:t().uuid()}).strict()]),Fe=nn(Re,{io:"input"}),Ke=ie.extend({process_brain_fence:t().uuid(),process_expires_at:y.datetime()}).strict(),J=i({version:n(1),process_id:t().uuid(),state:s(["starting","running","exited","cancelled","expired","uncertain"]),exit_code:o().int().nullable(),first_cursor:o().int().min(0),next_cursor:o().int().min(0),truncated:d(),observed_at:y.datetime(),output:u(i({cursor:o().int().min(1),stream:s(["stdout","stderr"]),text:t().max(32768)}).strict()).max(128)}).strict().refine((e)=>{if(Buffer.byteLength(JSON.stringify(e))>1e5||e.next_cursor<e.first_cursor-1)return!1;if((e.state==="starting"||e.state==="running"||e.state==="uncertain")&&e.exit_code!==null)return!1;if(e.state==="exited"&&(e.exit_code===null||e.exit_code<0||e.exit_code>255))return!1;if(e.state==="cancelled"&&e.exit_code!==130||e.state==="expired"&&e.exit_code!==124)return!1;let _=e.first_cursor-1;for(let l of e.output){if(l.cursor<=_||l.cursor>e.next_cursor)return!1;_=l.cursor}return!0});function ae(e){return Se.includes(e)}var Xe=i({operation_constraints:ee(t(),Oe())}),Ye=i({ready:n(!0),version:n(1),execution_mode:s(["host","confined"]),max_timeout_ms:o().int().min(1000).optional()});var Ie=i({version:n(1),process_id:t().uuid(),state:s(["queued","cancelled_before_start","not_started"]),exit_code:os(),output:u(Ni()).length(0),first_cursor:n(0),next_cursor:n(0),truncated:n(!1),cancellation_requested:n(!1),reason_code:s(["cancelled_before_start","process_journal_capacity","path_not_found","process_timeout_unsupported"]).optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it.")}).strict(),De=i({...J.shape,state:s(["queued","starting","running","exited","cancelled","expired","uncertain","cancelled_before_start","not_started"]),observed_at:y.datetime().optional(),expires_at:y.datetime().optional().describe("Accepted absolute process deadline. Reading, waiting and retrying do not extend it."),cancellation_requested:d(),reason_code:t().nullable().optional(),execution_authority:n("lost").optional().describe("Historical receipt only; the current Brain cannot control this older-generation process."),recovery:i({cause:n("brain_generation_changed"),terminal_confirmed:d(),next_step:s(["inspect_until_terminal","reconcile_effects_before_new_intent"])}).strict().optional().describe("Historical process recovery only. An unconfirmed outcome forbids replay. A confirmed terminal observation proves the old process stopped, not that its command had no effects. Reconcile the result; only restart still-needed, safely repeatable work with a new request_id and current authority. Respect user cancellation."),last_observed_state:J.shape.state.or(n("cancelled_before_start")).nullable().optional().describe("Last saved observation before authority was lost; a running observation does not establish current child liveness.")}).strict(),$e=nn(De),Qe=W([J,Ie.refine((e)=>e.state==="cancelled_before_start")]),X=i({version:n(1),process_id:t().uuid(),state:s(["exited","cancelled","expired"]),exit_code:o().int().min(0).max(255),observed_at:y.datetime()}).strict().refine((e)=>(e.state!=="cancelled"||e.exit_code===130)&&(e.state!=="expired"||e.exit_code===124)),Ze=i({process_terminal_observation:X}).strict();var Wi="preview.serve.v1",Vi=43200000;var ce="preview.open.v1",de=1,fn="gid_proxy_v1",Gi="egress",mn=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[1-9][0-9]{0,4})?$/,Ce=i({version:n(fn),allowed_domains:u(t().max(260).regex(mn)).max(1024)}).strict(),Ae=on((e)=>H(e)!==null,"invalid workspace"),ke=i({version:n(1),request_id:k(),session_id:k(),command:t().min(1).max(16000).refine((e)=>!e.includes("\x00")),port:o().int().min(1024).max(65535),workspace:Ae,egress:Ce.optional()}).strict(),Ki=ke.extend({expires_at:y.datetime()}).strict();var Me=4,Te=5000;function Y(e,c,_){let l=null;try{l=ct(e)}catch{}xn({deviceRelayUrl:l?.deviceRelayUrl??"",binding:l?.binding??null,jobId:c,port:l?.binding.port??0,reason:l?_:"binding_invalid"})}function le(e){let c=new Map;return{open(_){let l=(x)=>Y(_,e.claim.operation_id,x),C;try{C=ct(_)}catch{return l("binding_invalid")}let{binding:w,deviceRelayUrl:z}=C,E=e.claim.owner;if(!E||w.organizationId!==E.organization_id||w.userId!==E.user_id||w.deviceId!==E.device_id||w.rootId!==e.claim.root_id||w.jobId!==e.claim.operation_id||w.fenceId!==e.claim.operation_id||w.generation!==de||w.expiresAtMs>Math.min(Date.now()+p.lifetimeMs+Te,e.expiresAtMs))return l("binding_mismatch");if(w.expiresAtMs<=Date.now())return l("binding_expired");if(c.get(w.port)?.abort(),c.delete(w.port),c.size>=Me)return l("preview_capacity");let L=new AbortController;c.set(w.port,L);let P=we({binding:w,deniedPorts:e.deniedPorts,readCurrentJob:async()=>{if(L.signal.aborted)return null;let x=await e.inspect();return x?{binding:w,executorLaunchId:e.executorLaunchId,job:x}:null}});_e({binding:w,deviceRelayUrl:z,port:P,signal:L.signal}).then((x)=>x.closed,(x)=>{let I=x instanceof Error?x.message:"preview_failed";if(I!=="preview_not_authorized")process.stderr.write(`${JSON.stringify({event:"worker_preview.open_failed",job_id:w.jobId,port:w.port,reason_code:I})}
|
|
3
|
-
`)}).finally(()=>{if(c.get(w.port)===L)c.delete(w.port)})},dispose(){for(let _ of c.values())_.abort();c.clear()}}}class it extends r{observation;constructor(e){super("process_authority_lost","Process authority was lost; the owned process group has stopped.");this.observation=e}}var fe=256,B=new Map,he="preview.serve.v1",V=new Map;function be(e){let c=V.get(e.operation_id);if(c){if(c.claim!==e)throw M("process_authority_lost");return c}if(V.size>=fe)throw M("process_journal_capacity");let _={claim:e,executing:!1,cancelRequested:!1,phase:"pending"};return V.set(e.operation_id,_),_}function pe(e){return{version:1,process_id:e,state:"cancelled_before_start",exit_code:null,output:[],first_cursor:0,next_cursor:0,truncated:!1,cancellation_requested:!1,reason_code:"cancelled_before_start"}}var ue=(e)=>new Promise((c)=>setTimeout(c,e)),M=(e="process_outcome_uncertain")=>new r(e,"The managed process outcome could not be confirmed; inspect its saved receipt before starting another intent.");function ze(e=a(),c=Ge()){let _=Ue(Lr({},e)),l=qe(tr(e),_),[C,...w]=l.split(Je);return{directory:j(c,l,"processes"),previous:[j(_,"processes"),...C==="reason"?[j(c,"ara",...w,"processes")]:[]]}}function Ge(){if(process.platform!=="darwin")throw new r("process_unavailable","Managed Mac process execution is unavailable.");let e=Mo();if(!e)throw new r("process_unavailable","The private per-user process directory is unavailable.");return e}async function dr(e){if(!e.claim.owner||e.signal.aborted||e.expiresAtMs<=Date.now())throw M("process_authority_lost");let c=be(e.claim);if(c.executing)throw M("process_busy");if(c.executing=!0,c.cancelRequested)return c.phase="settling",pe(e.claim.operation_id);c.phase="starting";let _=e.journals??ze();We(_.directory,{recursive:!0,mode:448});let l=hr({runtimeDirectory:G(_.directory),previousRuntimeDirectories:(_.previous??[]).filter((m)=>Z(m)).map((m)=>G(m)),root:e.root,runId:JSON.stringify([e.claim.owner,e.claim.run_id,e.claim.root_id,e.claim.operation_id]),maxScopes:fe});try{for(let m of[e.root,e.cwd])if(!je(G(m),l.journalDirectory))throw new r("process_journal_inside_workspace","The selected root contains the private process journal. Select an existing narrower granted workspace root outside the journal; no command was dispatched.")}catch(m){throw l.disposeSocket(),m}let C=me(l.journalDirectory),w=e.claim.capability===he,z=()=>B.set(e.claim.operation_id,{path:l.journalDirectory,ino:C.ino,dev:C.dev,anyCompletion:w}),E=l.launchDirectory,L=j(E,"config.json"),P={url:"",transport:"local_job_ipc",directShell:{mode:e.mode,executable:e.shell,jobId:e.claim.operation_id},workerVersion:D,protocolVersion:2,workerArtifactSha256:b,workerEntrypoint:R,targetGeneration:1,fenceId:Q(),...process.platform==="win32"?{bashExecutable:se()}:{},workRoot:e.root,workspaceAliasPath:e.root,repoPath:e.cwd,jobEnvPath:j(E,"unused.env"),replSocketPath:j(E,"unused.sock"),readyPath:j(E,"ready.json"),directTerminalReceiptPath:j(E,"terminal.json"),launchId:Q(),expiresAtMs:e.expiresAtMs+5000,bashTimeoutMs:60000,replTimeoutMs:1000,allowedTools:["bash"],managedJobs:{journalDirectory:l.journalDirectory,scopeId:l.scopeId},jobControlSocketPath:l.socketPath,...e.prefix?{bashCommandPrefix:e.prefix}:{},...e.jobsUser?{jobsUser:e.jobsUser}:{}},x;try{He(L,JSON.stringify(P),{mode:384});let m=wn({configPath:L,root:e.cwd,grantedRoot:e.root,workRoot:e.root,temporaryDirectory:E});x=e.spawnWorker?.(L,P)??Le(m.command,m.args,{...m.options,env:e.environment,stdio:[bn,"ignore","ignore"]})}catch(m){throw l.disposeSocket(),m}let I=!1,F=new Promise((m,S)=>{x.once("exit",(f)=>{I=!0,m(f)}),x.once("error",(f)=>{I=!0,S(f)})});F.catch(()=>{});let ge={root:e.root,runId:e.claim.run_id,scopeId:l.scopeId,socketPath:l.socketPath,generation:1,fenceId:P.fenceId,executorLaunchId:P.launchId,expiresAtMs:P.expiresAtMs},N=async(m)=>{let S=await fr(ge,{type:"job",version:2,generation:1,id:Q(),jobId:e.claim.operation_id,...m==="start"?{action:m,input:{script:e.command,leaseExpiresAtMs:e.expiresAtMs}}:m==="inspect"?{action:m,input:{after:0}}:m==="probe"?{action:"inspect",input:{after:Number.MAX_SAFE_INTEGER}}:{action:m,input:{}}},new AbortController().signal);if(!S.ok)throw M(S.error);return S.job},U=!1,q=!1,te,re=()=>{U=!0,st(x,"SIGTERM")};e.signal.addEventListener("abort",re,{once:!0});let T,oe=0,ve=async(m)=>{let S=[...m.output],f={version:1,process_id:e.claim.operation_id,state:m.state,exit_code:m.exitCode,first_cursor:m.firstCursor,next_cursor:m.nextCursor,truncated:m.truncated,output:S,observed_at:new Date().toISOString()};while(Buffer.byteLength(JSON.stringify(f))>90000&&S.length)S.shift(),f.truncated=!0,f.first_cursor=S[0]?.cursor??f.next_cursor+1;T=J.parse(f),await e.emit(T),oe=Date.now()};try{let m=Math.min(Date.now()+1e4,e.expiresAtMs);while(!Z(P.readyPath)){if(I)throw new r("process_start_failed","The managed process supervisor exited before accepting a command; no command was dispatched.");if(e.signal.aborted||Date.now()>=m)throw M("process_start_unconfirmed");await ue(25)}let S=JSON.parse(Ne(P.readyPath,"utf8"));if(S.launchId!==P.launchId||S.fenceId!==P.fenceId||S.workerArtifactSha256!==b)throw M();if(e.signal.throwIfAborted(),c.cancelRequested)return pe(e.claim.operation_id);let f;try{q=!0,f=await N("start")}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown")throw O;f=await N("inspect")}if(c.phase="running",c.cancel=async()=>{await N("cancel")},w&&e.preview)c.tunnels=le({claim:e.claim,executorLaunchId:P.launchId,expiresAtMs:e.expiresAtMs,deniedPorts:e.preview.deniedPorts,inspect:async()=>c.phase==="running"&&!I?await N("probe"):null});if(c.cancelRequested)await c.cancel(),f=await N("inspect");for(;;){if(!["starting","running"].includes(f.state))c.phase="settling",c.cancel=void 0;if(!T||T.state!==f.state||T.next_cursor!==f.nextCursor&&Date.now()-oe>=5000)await ve(f);if(!["starting","running"].includes(f.state))break;if(e.signal.aborted||I)throw M();await ue(1000);try{f=await N("inspect"),te=void 0}catch(O){if(!(O instanceof r)||O.code!=="hands_job_result_unknown"||e.signal.aborted||I||Date.now()-(te??=Date.now())>120000)throw O}}if(!T||T.state==="uncertain")throw M();return T}finally{if(c.phase="settling",c.cancel=void 0,c.tunnels?.dispose(),c.tunnels=void 0,await c.cancelInFlight?.catch(()=>{}),e.signal.removeEventListener("abort",re),!I&&!U)st(x,"SIGTERM");let m,S=await Promise.race([F.then((f)=>({code:f})),new Promise((f)=>{m=setTimeout(()=>f(null),6000)})]).finally(()=>{clearTimeout(m)});if(!S){try{st(x,"SIGKILL")}catch{}try{await F}finally{if(I)l.disposeSocket()}throw M("process_cleanup_unconfirmed")}try{if((U||e.signal.aborted)&&S.code===0&&q){v(E);let f=JSON.parse(h(P.directTerminalReceiptPath)),O=X.safeParse(f.observation);if(Object.keys(f).length===4&&f.launch_id===P.launchId&&f.fence_id===P.fenceId&&f.scope_id===l.scopeId&&O.success&&O.data.process_id===e.claim.operation_id){if(w)z();throw new it(O.data)}}}catch(f){if(f instanceof it)throw f}finally{if(I)l.disposeSocket()}if(S.code!==0&&!U&&q)throw M("process_cleanup_unconfirmed");if(!U&&S.code===0&&(T&&["exited","cancelled","expired"].includes(T.state)||!q&&c.cancelRequested)||w&&S.code===0&&!q)z()}}async function Rs(e,c){if(c.kind===ce&&e.capability===he){let C=V.get(e.operation_id);if(C?.claim===e&&C.tunnels)C.tunnels.open(c.payload);else Y(c.payload,e.operation_id,"server_not_running");return!0}if(c.kind!==ne||!ae(e.capability)||!e.owner||c.payload.process_id!==e.operation_id)return!1;let _=V.get(e.operation_id);if(_&&_.claim!==e)return!1;let l=be(e);if(l.cancelRequested=!0,l.phase==="running"&&l.cancel)l.cancelInFlight??=l.cancel(),await l.cancelInFlight;return!0}function Os(e,c){V.delete(e);let _=B.get(e);if(!_||c!=="succeeded"&&!_.anyCompletion)return B.delete(e),!1;try{let l=me(_.path);if(!l.isDirectory()||l.isSymbolicLink()||l.ino!==_.ino||l.dev!==_.dev||!A(l)||G(_.path)!==_.path||Z(j(_.path,"owner.lock")))return!1;return Ve(_.path,{recursive:!0}),B.delete(e),!0}catch{return!1}}
|
|
4
|
-
export{Wi,Vi,fn,Gi,mn,Ki,it,dr,Rs,Os};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{C}from"./vm-hands-entry-lite-87vmbt38.js";import{execFileSync as b}from"child_process";import{mkdirSync as y,readdirSync as h,readFileSync as D,rmSync as f,statSync as k,writeFileSync as w}from"fs";import{join as p,sep as S}from"path";import{setTimeout as x}from"timers/promises";var L=3000,u=null;function g(e){return p(e,"users")}function xt(e){if(u?.root===e.root)return;let t=g(e.root);y(t,{recursive:!0,mode:448}),w(p(t,String(process.pid)),"",{mode:384}),u=e}function pa(){if(!u)return;f(p(g(u.root),String(process.pid)),{force:!0}),u=null}function m(e){try{return process.kill(e,0),!0}catch(t){return t instanceof Error&&"code"in t&&t.code==="EPERM"}}function _(){let e=process.getuid?.();if(process.platform==="linux")return h("/proc").flatMap((n)=>{if(!/^\d+$/.test(n))return[];try{if(k(`/proc/${n}`).uid!==e)return[];let s=D(`/proc/${n}/cmdline`).toString("utf8").split("\x00").join(" ").trim();return s?[{pid:Number(n),command:s}]:[]}catch{return[]}});if(process.platform==="win32")return b(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 c=/^(\d+) (.+)$/.exec(s.trim());return c?[{pid:Number(c[1]),command:c[2]}]:[]});return b("/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 ha(){let e=u;if(!e)return{released:"unused",stopped:0};let t=g(e.root);f(p(t,String(process.pid)),{force:!0}),u=null;let n=!1;for(let o of h(t)){let i=Number(o);if(Number.isSafeInteger(i)&&i>0&&m(i))n=!0;else f(p(t,o),{force:!0})}if(n)return{released:"shared",stopped:0};let s=_().filter((o)=>o.pid!==process.pid&&(o.command.includes(`${e.root}${S}`)||o.command.includes(`${e.automation}${S}`)||o.command.includes(e.extensionDir))),c=(o,i)=>{try{process.kill(o,i)}catch{}};for(let o of s)c(o.pid,"SIGTERM");for(let o=Date.now()+L;Date.now()<o&&s.some((i)=>m(i.pid));)await new Promise((i)=>setTimeout(i,100));for(let o of s)if(m(o.pid))c(o.pid,"SIGKILL");return{released:"stopped",stopped:s.length}}var P=20000,E=30000,M=100,a=new Map,l=null,d=[];function Mi(e){a.set(e,(a.get(e)??0)+1);let t=!1;return()=>{if(t)return;t=!0;let n=(a.get(e)??1)-1;if(n>0){a.set(e,n);return}if(a.delete(e),l?.run===e)l.idleUntil=0}}function N(){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 O(e,t){return l!==null&&l.run!==e&&(l.calls>0||t<l.idleUntil)}async function $i(e,t,n=Date.now){let s=Symbol(e);d.push(s);try{let i=n()+E;for(;;){if(!O(e,n())&&(l?.run===e||d[0]===s))break;if(n()>=i)throw N();await x(M,void 0,{signal:t}).catch(()=>t.throwIfAborted())}}finally{d.splice(d.indexOf(s),1)}if(l?.run!==e)l={run:e,calls:0,idleUntil:0};let c=l;c.calls+=1;let o=!1;return()=>{if(o)return;o=!0,c.calls-=1,c.idleUntil=n()+P}}
|
|
4
|
-
export{xt,pa,ha,Mi,$i};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var l=Object.create;var{getPrototypeOf:m,defineProperty:h,getOwnPropertyNames:n}=Object;var k=Object.prototype.hasOwnProperty;function o(a){return this[a]}var p,q,Li=(a,b,c)=>{var d=a!=null&&typeof a==="object";if(d){var i=b?p??=new WeakMap:q??=new WeakMap,j=i.get(a);if(j)return j}c=a!=null?l(m(a)):{};let f=b||!a||!a.__esModule||!k.call(a,"default")?h(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let g of n(a))if(!k.call(f,g))h(f,g,{get:o.bind(a,g),enumerable:!0})}if(d)i.set(a,f);return f};var he=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var r=(a)=>a;function s(a,b){this[a]=r.bind(null,b)}var cs=(a,b)=>{for(var c in b)h(a,c,{get:b[c],enumerable:!0,configurable:!0,set:s.bind(b,c)})};var ls=(a,b,c)=>()=>{if(a)try{b=a(a=0)}catch(d){c=[d]}if(c)throw c[0];return b};var e=import.meta.require;
|
|
3
|
-
export{Li,he,cs,ls,e};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{he}from"./vm-hands-entry-lite-2dx4pnz7.js";var un=he(function(t,e){e.exports={name:"playwright-core",version:"1.60.0",description:"A high-level API to automate web browsers",repository:{type:"git",url:"git+https://github.com/microsoft/playwright.git"},homepage:"https://playwright.dev",engines:{node:">=18"},author:{name:"Microsoft Corporation"},license:"Apache-2.0",exports:{".":{types:"./index.d.ts",import:"./index.mjs",require:"./index.js",default:"./index.js"},"./package.json":"./package.json","./lib/bootstrap":"./lib/bootstrap.js","./lib/coreBundle":"./lib/coreBundle.js","./lib/utilsBundle":"./lib/utilsBundle.js","./lib/tools/cli-client/program":"./lib/tools/cli-client/program.js"},bin:{"playwright-core":"cli.js"},types:"types/types.d.ts"}});
|
|
3
|
-
export{un};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var ue=".reason/workspace",Ce="workspace_base",Z="sessions",Ae="workspace_layout",de=".reason/workspace/sessions",rr=/^[0-9a-f]{8}$/;function et(t){if(!X(t))return!1;let e=".reason/workspace/sessions/";if(!t.startsWith(e))return!1;let n=t.slice(e.length).split("/");return n.length===2&&rr.test(n[0])}var i=4096,S="workspaces/pi";function X(t){if(typeof t!=="string"||!t||t.length>i)return!1;if(t.startsWith("/")||t.includes("\x00")||t.includes("\\"))return!1;return t.split("/").every((e)=>e!==""&&e!=="."&&e!=="..")}function O(t){if(t.kind==="root"){if(t.path===void 0)return".";if(!X(t.path))throw Error("invalid_device_workspace_identity");return t.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(t.workspaceId)||t.workspaceId==="."||t.workspaceId==="..")throw Error("invalid_device_workspace_identity");let e=t.layout==="sessions"?"sessions":S;return`${t.base?`${t.base}/`:""}${e}/${t.workspaceId}/repo`}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return null;let e=t;if(e.kind==="root"&&Object.keys(e).length===1)return{kind:"root"};if(e.kind==="root"&&Object.keys(e).length===2&&X(e.path))return{kind:"root",path:e.path};if(e.kind!=="managed"||typeof e.workspaceId!=="string"||Object.keys(e).length!==2+(e.base===void 0?0:1)+(e.layout===void 0?0:1)||e.base!==void 0&&e.base!==".reason/workspace"||e.layout!==void 0&&e.layout!=="sessions")return null;let n={kind:"managed",workspaceId:e.workspaceId,...e.base===".reason/workspace"?{base:".reason/workspace"}:{},...e.layout==="sessions"?{layout:"sessions"}:{}};try{return O(n),n}catch{return null}}var c="/home/runner";var Yr="/run/reason/sessions",a=/^(?:\/[A-Za-z0-9._-]+)+$/,Qr=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,en=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function _(t){return Qr.exec(t)?.[1]??en.exec(t)?.[1]??t}var nr=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/;function E(t,e=c,n="sessions"){if(!a.test(e)||e.split("/").some((s)=>s==="."||s===".."))throw Error("invalid_cloud_payload_home");let r=`${e}/${O({kind:"managed",workspaceId:t,base:".reason/workspace",...n?{layout:n}:{}})}`,o=`${Yr}/${_(t)}`;return{home:e,root:r.slice(0,-5),checkout:r,control:o,jobEnv:`${o}/job.env`,cloudAccess:`${o}/cloud-access`,logs:`${o}/logs`,pin:`${o}/ws`}}function A(t){return nr.exec(t.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function tn(t){let e=nr.exec(t.replace(/\/+$/,""));if(!e)return null;try{let n=E(e[3],e[1],A(t));return n.root===t.replace(/\/+$/,"")?n:null}catch{return null}}
|
|
3
|
-
export{ue,Ce,Z,Ae,de,rr,et,X,O,H,Yr,Qr,en,nr,tn};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var Qt={name:"github-native-engineer-device-worker-production",version:"0.2.503",private:!0,type:"module",engines:{node:">=22",bun:">=1.3.0"},workspaces:["../../packages/runtime-distribution"],dependencies:{"@agentclientprotocol/sdk":"1.9.0","@anthropic-ai/sandbox-runtime":"^0.0.80","@earendil-works/pi-tui":"1.0.0","@reason/runtime-distribution":"workspace:*",diff:"8.0.4","open-browser-use-sdk":"0.1.42","playwright-core":"1.60.0",toml:"4.2.0",zod:"^4.4.3"},overrides:{"@hono/node-server":"^1.19.15","@earendil-works/pi-agent-core":"1.0.0","@earendil-works/pi-ai":"1.0.0","@earendil-works/pi-coding-agent":"1.0.0","@earendil-works/chord":"1.0.0","@earendil-works/pi-codemode":"1.0.0","@earendil-works/pi-mcp":"1.0.0","@earendil-works/pi-telemetry":"1.0.0","@earendil-works/pi-tui":"1.0.0","brace-expansion":"2.1.7",axios:"^1.20.0","basic-ftp":"^6.2.1","@grpc/grpc-js":"^1.14.5",browserslist:"^4.28.8","engine.io":"^6.6.7","fast-uri":"^3.1.8",hono:"^4.13.7","ip-address":"^10.7.1",nanoid:"^3.3.18",dompurify:"^3.4.17",postcss:"^8.5.23",qs:"^6.16.0","shell-quote":"^1.11.0","socket.io-parser":"^4.2.7",tmp:"^0.2.7",toml:"^4.2.0",undici:"^8.10.2",ws:"^8.21.0","js-yaml":"^4.3.2","@modelcontextprotocol/sdk":"^1.31.0","proxy-addr":"^2.0.8","source-map-js":"^1.2.2"}};
|
|
3
|
-
export{Qt};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{Vr}from"./vm-hands-entry-lite-hhhc7xx3.js";import{ft}from"./vm-hands-entry-lite-7777m86y.js";import{a}from"./vm-hands-entry-lite-swrymqj9.js";import{A}from"./vm-hands-entry-lite-87vmbt38.js";import{randomUUID as f}from"crypto";import{chmodSync as U,closeSync as h,constants as g,existsSync as me,fstatSync as F,lstatSync as R,mkdirSync as B,openSync as G,readFileSync as Y,readdirSync as z,readlinkSync as J,realpathSync as P,renameSync as _,rmSync as p,statSync as K,symlinkSync as _t,unlinkSync as M,writeFileSync as L}from"fs";import{basename as vt,dirname as S,isAbsolute as fe,join as c,relative as ge,resolve as b,sep as _e}from"path";import{createRequire as H}from"module";var q=1,j=1,ye=128,ve=65536;var he=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;var D=/^[a-z0-9_.-]{1,80}$/,be=64,Ee="so.ara.device-broker",Me=[Ee,"com.reasonmachines.device-broker"],Pt=Vr(Me);var we=["service.install_started","service.install_completed","service.install_failed","service.launcher_adopted","service.launcher_conflict","service.started","service.reconnecting","service.reconnected","service.idle_sleep_held","service.idle_sleep_released","service.idle_sleep_failed","service.start_failed","service.stopped","service.exit_failed","service.singleton_rejected","credential.migration_started","credential.migration_completed","credential.migration_failed","credential.store_started","credential.store_completed","credential.store_failed","credential.delete_started","credential.delete_completed","credential.delete_failed","update.check_started","update.not_available","update.download_started","update.downloaded","update.verified","update.activated","update.rollback","update.failed","executor.update.check_started","executor.update.not_available","executor.update.download_started","executor.update.downloaded","executor.update.verified","executor.update.activated","executor.update.rollback","executor.update.failed","identity.refresh_completed","identity.refresh_failed","update.device_moved","update.components_installed","update.deferred","update.deferral_expired","worker.previous_exit","worker.capabilities_withheld","identity.computer_use_unavailable"];function W(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function X(e,t,n=[]){let r=new Set([...t,...n]);return t.every((i)=>(i in e))&&Object.keys(e).every((i)=>r.has(i))}function E(e){return typeof e==="string"&&he.test(e)}function Z(e){return typeof e==="string"&&!Number.isNaN(Date.parse(e))&&new Date(e).toISOString()===e}function k(e){B(e,{recursive:!0,mode:448}),U(e,448)}function Re(e,t){k(S(e));let n=`${e}.${process.pid}.${f()}.tmp`;try{L(n,t,{mode:384,flag:"wx"}),U(n,384),_(n,e)}finally{if(me(n))M(n)}}function ys(e={}){if((e.platform??process.platform)!=="darwin")throw new ft("unsupported_platform","The managed Reason runtime is currently available only on macOS.");let n=e.environment??process.env,r=T(n,"REASON_CLI_CHANNEL")==="staging",i=r?T(n,"REASON_MANAGED_RUNTIME_ROOT")?.trim():void 0,o=e.root!==void 0||Boolean(i&&fe(i))?null:c(e.home??a(),"Library","Application Support"),d=e.root??(o?c(o,r?"Reason Staging":"Reason","CLI"):i);return{executableName:"reason",root:d,...o?{legacyRoot:c(o,"Ara",...r?["staging","runtime"]:["runtime"])}:{},versions:c(d,"versions"),current:c(d,"current"),previous:c(d,"previous"),brokerLock:c(d,"broker.lock"),transitionLock:c(d,"transition.lock"),lifecycleEvents:c(d,"lifecycle-events")}}function bs(e){let t=e.legacyRoot;if(!t)return null;return{root:t,versions:c(t,"versions"),current:c(t,"current"),previous:c(t,"previous"),brokerLock:c(t,"broker.lock"),transitionLock:c(t,"transition.lock"),lifecycleEvents:c(t,"lifecycle-events")}}function pe(e,t){let n;try{if(!R(e).isSymbolicLink())return null;n=J(e)}catch{return null}let r=n.match(/^versions\/(\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)\/(ara|Reason|reason)$/);return r&&(r[2]==="ara"||r[2]===t)?r[1]:null}function vs(e){return pe(e.current,e.executableName)}function O(e,t,n){let i=ge(t,e).split(_e);return i.length===2&&E(i[0])&&(i[1]==="ara"||n!==void 0&&i[1]===n)?i[0]:null}function Le(e,t){try{return R(t).isSymbolicLink()&&b(S(t),J(t))===b(e.current)}catch{return!1}}function Ss(e,t=process.execPath){try{return O(P(t),P(e.versions),e.executableName)!==null}catch{let n=b(t);return n===b(e.current)||Le(e,n)||O(n,b(e.versions),e.executableName)!==null}}function Ae(e){return W(e)&&X(e,["schema_version","pid","nonce","started_at","runtime_version"])&&e.schema_version===q&&typeof e.pid==="number"&&Number.isSafeInteger(e.pid)&&e.pid>0&&typeof e.nonce==="string"&&/^[0-9a-f-]{36}$/.test(e.nonce)&&Z(e.started_at)&&E(e.runtime_version)}function Q(e,t){try{let n=R(e);if(!n.isDirectory()||!A(n))return null;let r=G(c(e,t),g.O_RDONLY|g.O_NOFOLLOW|g.O_NONBLOCK);try{let i=F(r);if(!i.isFile()||i.nlink!==1||!A(i)||i.size>4096)return null;return Y(r,"utf8")}finally{h(r)}}catch{return null}}function N(e){try{let t=JSON.parse(Q(e,"owner.json")??"null");return Ae(t)?t:null}catch{return null}}function ee(e){try{return process.kill(e,0),!0}catch(t){return!(t instanceof Error&&("code"in t)&&t.code==="ESRCH")}}var C="lease",Ne=2,Se=4,y;function ke(){if(y!==void 0)return y;if(y=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let e;try{e=H(import.meta.url)("bun:ffi")}catch{return null}let t=process.platform==="darwin"?"__error":"__errno_location",n=process.platform==="darwin"?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`];for(let r of n)try{let i=e.dlopen(r,{flock:{args:[e.FFIType.i32,e.FFIType.i32],returns:e.FFIType.i32},[t]:{args:[],returns:e.FFIType.ptr}}),s=i.symbols[t]();if(s===null)continue;return y={flock:(o,d)=>i.symbols.flock(o,d),errno:()=>e.read.i32(s),wouldBlock:process.platform==="darwin"?35:11},y}catch{}return null}var v,Ie=3221225472,Te=4,xe=128,Pe=32;function De(e){if(v===void 0){v=null;try{let s=H(import.meta.url)("bun:ffi"),{FFIType:o}=s;v={kernel:s.dlopen("kernel32.dll",{CreateFileW:{args:[o.ptr,o.u32,o.u32,o.ptr,o.u32,o.u32,o.ptr],returns:o.i64_fast},CloseHandle:{args:[o.i64_fast],returns:o.i32},GetLastError:{args:[],returns:o.u32}}).symbols,ptr:(l)=>s.ptr(l)}}catch{return null}}if(!v)return null;let{kernel:t,ptr:n}=v,r=Buffer.from(`${e}\x00`,"utf16le"),i=t.CreateFileW(n(r),Ie,0,null,Te,xe,null);if(Number(i)===-1)return t.GetLastError()===Pe?"busy":null;return{release:()=>{t.CloseHandle(i)}}}function Oe(e){if(process.platform==="win32")return De(`${e}.lease`);let t=ke();if(!t)return null;let n=G(`${e}.lease`,g.O_RDWR|g.O_CREAT|g.O_NOFOLLOW,384);try{let r=F(n);if(!r.isFile()||r.nlink!==1||!A(r))return h(n),"busy";if(t.flock(n,Ne|Se)===0)return{release:()=>h(n)};let i=t.errno();return h(n),i===t.wouldBlock?"busy":null}catch(r){throw h(n),r}}function Es(e){k(S(e.path));let t=Oe(e.path);if(t==="busy")return{acquired:!1,owner:N(e.path),recoveredStaleOwner:!1};let n=t!==null;try{let r=Ce(e,t);if(r.acquired)n=!1;return r}finally{if(n)t.release()}}function Ce(e,t){let n=e.alive??ee,r=!1;for(let i=0;i<4;i+=1){let s={schema_version:q,pid:e.pid??process.pid,nonce:e.nonce?.()??f(),started_at:(e.now?.()??new Date).toISOString(),runtime_version:e.runtimeVersion},o=`${e.path}.init-${process.pid}-${f()}`,d=!1;try{if(B(o,{mode:448}),L(c(o,"owner.json"),`${JSON.stringify(s)}
|
|
3
|
-
`,{mode:384,flag:"wx"}),t!==null)L(c(o,C),`flock
|
|
4
|
-
`,{mode:384,flag:"wx"});e.beforePublish?.();try{throw R(e.path),Object.assign(Error("Managed runtime lock exists."),{code:"EEXIST"})}catch(m){if(m.code!=="ENOENT")throw m}_(o,e.path),d=!0;let l=!1;return{acquired:!0,owner:s,recoveredStaleOwner:r,release(){if(l)return;if(l=!0,N(e.path)?.nonce===s.nonce)p(e.path,{recursive:!0,force:!0});t?.release()}}}catch(l){let m=l.code;if(!["EEXIST","ENOTEMPTY"].includes(m??""))throw l;let u=N(e.path),re=(e.now?.()??new Date).getTime(),ie=u&&e.staleAfterMs!==void 0?re-Date.parse(u.started_at)<e.staleAfterMs:!1,ae=u!==null&&!(t!==null&&Q(e.path,C)!==null)&&n(u.pid);if(!u||ae||ie)return{acquired:!1,owner:u,recoveredStaleOwner:!1};let I=`${e.path}.stale-${process.pid}-${f()}`;try{_(e.path,I),p(I,{recursive:!0,force:!0}),r=!0}catch(x){let oe=x.code;if(!["ENOENT","EEXIST"].includes(oe??""))throw x}}finally{if(!d)p(o,{recursive:!0,force:!0})}}throw new ft("lock_unavailable","Could not acquire the managed Reason runtime lock.")}function te(e){return W(e)&&X(e,["schema_version","event_id","occurred_at","event","runtime_version"],["from_version","to_version","reason_code","duration_ms","attempt_count","retry_in_ms","capabilities"])&&e.schema_version===j&&typeof e.event_id==="string"&&/^[0-9a-f-]{36}$/.test(e.event_id)&&Z(e.occurred_at)&&typeof e.event==="string"&&we.includes(e.event)&&E(e.runtime_version)&&(e.from_version===void 0||E(e.from_version))&&(e.to_version===void 0||E(e.to_version))&&(e.reason_code===void 0||typeof e.reason_code==="string"&&D.test(e.reason_code))&&(e.duration_ms===void 0||typeof e.duration_ms==="number"&&Number.isSafeInteger(e.duration_ms)&&e.duration_ms>=0&&e.duration_ms<=86400000)&&(e.attempt_count===void 0||typeof e.attempt_count==="number"&&Number.isSafeInteger(e.attempt_count)&&e.attempt_count>=1&&e.attempt_count<=1e5)&&(e.retry_in_ms===void 0||typeof e.retry_in_ms==="number"&&Number.isSafeInteger(e.retry_in_ms)&&e.retry_in_ms>=0&&e.retry_in_ms<=30000)&&(e.capabilities===void 0||Array.isArray(e.capabilities)&&e.capabilities.length<=be&&e.capabilities.every((t)=>typeof t==="string"&&D.test(t)))}var Ve=/^(\d{22}-[0-9a-f-]{36}\.json)$/,Ue=/^(\d{22}-[0-9a-f-]{36}\.json)\.sending-(\d+)-[0-9a-f-]{36}$/,Fe=300000,w=0n;function Be(e){let t=BigInt(new Date(e.occurred_at).getTime())*1000000n;return w=t>w?t:w+1n,`${String(w).padStart(22,"0")}-${e.event_id}.json`}function ne(e){try{return z(e.lifecycleEvents).filter((t)=>Ve.test(t)).sort()}catch{return[]}}function V(e){try{let t=JSON.parse(Y(e,"utf8"));return te(t)?t:null}catch{return null}}function $e(e,t=ee,n=Date.now()){let r;try{r=z(e.lifecycleEvents)}catch{return}for(let i of r){let s=i.match(Ue);if(!s)continue;let o=c(e.lifecycleEvents,i),d=c(e.lifecycleEvents,s[1]),l=!t(Number(s[2]));if(!l)try{l=n-K(o).mtimeMs>=Fe}catch{continue}if(!l)continue;try{_(o,d)}catch(m){let u=m.code;if(u==="EEXIST")M(o);else if(u!=="ENOENT")throw m}}}function Ge(e){let n=ne(e).flatMap((i)=>{try{return[{name:i,size:K(c(e.lifecycleEvents,i)).size}]}catch{return[]}}),r=n.reduce((i,s)=>i+s.size,0);while(n.length>ye||r>ve){let i=n.shift();if(!i)break;try{M(c(e.lifecycleEvents,i.name)),r-=i.size}catch(s){if(s.code!=="ENOENT")throw s}}}function xs(e,t,n={}){let r={schema_version:j,event_id:n.eventId?.()??f(),occurred_at:(n.now?.()??new Date).toISOString(),...t};if(!te(r))throw new ft("invalid_lifecycle_event","Managed runtime lifecycle event is invalid.");return k(e.lifecycleEvents),Re(c(e.lifecycleEvents,Be(r)),`${JSON.stringify(r)}
|
|
5
|
-
`),Ge(e),r}async function ks(e,t,n){$e(e);let r=0;for(let i of ne(e)){let s=c(e.lifecycleEvents,i);if(n){let l=V(s);if(!l||!n(l))continue}let o=`${s}.sending-${process.pid}-${f()}`;try{_(s,o)}catch(l){if(l.code==="ENOENT")continue;throw l}let d=V(o);if(!d){M(o);continue}try{await t(d),M(o),r+=1}catch{try{_(o,s)}catch(l){if(l.code!=="ENOENT")throw l}break}}return r}export{ys,bs,vs,Ss,Es,xs,ks};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Mn,Eo,zt}from"./vm-hands-entry-lite-w0pegc58.js";import{On,Ve,po,In,Dn,Nn,Pr,x}from"./vm-hands-entry-lite-p7cqhtyg.js";import{xt}from"./vm-hands-entry-lite-1g1v87ky.js";import{Dr}from"./vm-hands-entry-lite-13rapgf5.js";import{j}from"./vm-hands-entry-lite-gc7550c0.js";import{a}from"./vm-hands-entry-lite-swrymqj9.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as z,spawn as H}from"child_process";import{randomBytes as Qe}from"crypto";import{chmodSync as De,existsSync as I,lstatSync as _e,mkdirSync as we,readFileSync as Re,rmSync as ee,writeFileSync as g}from"fs";import{connect as de}from"net";import{join as y}from"path";var S=32,w=76;var B="./desktop-wallpaper-0pjhgyfk.jpg";var O="./dock-browser-afp005mt.png";var F="./dock-files-rywdm96b.png";var k="./dock-terminal-s41cj1jp.png";var K=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
|
|
3
|
-
# The native Blaxel image ships no feh, hsetroot or compositor, but it does ship
|
|
4
|
-
# python3-gi and libX11. tint2 reads _XROOTPMAP_ID to draw its transparent panel.
|
|
5
|
-
# Usage: DISPLAY=:99 python3 set-root-wallpaper.py IMAGE
|
|
6
|
-
import ctypes, sys
|
|
7
|
-
import gi
|
|
8
|
-
gi.require_version("GdkPixbuf", "2.0")
|
|
9
|
-
from gi.repository import GdkPixbuf
|
|
10
|
-
x = ctypes.cdll.LoadLibrary("libX11.so.6")
|
|
11
|
-
x.XOpenDisplay.restype = ctypes.c_void_p
|
|
12
|
-
x.XOpenDisplay.argtypes = [ctypes.c_char_p]
|
|
13
|
-
d = x.XOpenDisplay(None)
|
|
14
|
-
if not d: sys.exit("no display")
|
|
15
|
-
for name, res, args in [
|
|
16
|
-
("XDefaultScreen", ctypes.c_int, [ctypes.c_void_p]),
|
|
17
|
-
("XRootWindow", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_int]),
|
|
18
|
-
("XDisplayWidth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
19
|
-
("XDisplayHeight", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
20
|
-
("XDefaultDepth", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
21
|
-
("XDefaultVisual", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
22
|
-
("XDefaultGC", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_int]),
|
|
23
|
-
("XCreatePixmap", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_uint, ctypes.c_uint, ctypes.c_uint]),
|
|
24
|
-
("XCreateImage", ctypes.c_void_p, [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint, ctypes.c_int, ctypes.c_int]),
|
|
25
|
-
("XPutImage", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_uint, ctypes.c_uint]),
|
|
26
|
-
("XInternAtom", ctypes.c_ulong, [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int]),
|
|
27
|
-
("XChangeProperty", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_int, ctypes.c_int, ctypes.c_void_p, ctypes.c_int]),
|
|
28
|
-
("XSetWindowBackgroundPixmap", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong]),
|
|
29
|
-
("XClearWindow", ctypes.c_int, [ctypes.c_void_p, ctypes.c_ulong]),
|
|
30
|
-
("XSetCloseDownMode", ctypes.c_int, [ctypes.c_void_p, ctypes.c_int]),
|
|
31
|
-
("XCloseDisplay", ctypes.c_int, [ctypes.c_void_p]),
|
|
32
|
-
]:
|
|
33
|
-
f = getattr(x, name); f.restype = res; f.argtypes = args
|
|
34
|
-
s = x.XDefaultScreen(d); root = x.XRootWindow(d, s)
|
|
35
|
-
w, h = x.XDisplayWidth(d, s), x.XDisplayHeight(d, s)
|
|
36
|
-
if x.XDefaultDepth(d, s) != 24: sys.exit("unsupported depth")
|
|
37
|
-
# Scale to cover the screen, then crop the centre.
|
|
38
|
-
src = GdkPixbuf.Pixbuf.new_from_file(sys.argv[1])
|
|
39
|
-
k = max(w / src.get_width(), h / src.get_height())
|
|
40
|
-
sw, sh = max(w, round(src.get_width() * k)), max(h, round(src.get_height() * k))
|
|
41
|
-
pb = src.scale_simple(sw, sh, GdkPixbuf.InterpType.BILINEAR).new_subpixbuf((sw - w) // 2, (sh - h) // 2, w, h).copy()
|
|
42
|
-
if pb.get_has_alpha(): pb = pb.composite_color_simple(w, h, GdkPixbuf.InterpType.NEAREST, 255, 1, 0, 0)
|
|
43
|
-
rgb, stride = pb.get_pixels(), pb.get_rowstride()
|
|
44
|
-
bgrx = bytearray(w * h * 4)
|
|
45
|
-
for y in range(h):
|
|
46
|
-
row = rgb[y * stride:y * stride + w * 3]; o = y * w * 4
|
|
47
|
-
bgrx[o:o + w * 4:4] = row[2::3]; bgrx[o + 1:o + w * 4:4] = row[1::3]; bgrx[o + 2:o + w * 4:4] = row[0::3]
|
|
48
|
-
buf = ctypes.create_string_buffer(bytes(bgrx), len(bgrx))
|
|
49
|
-
pix = x.XCreatePixmap(d, root, w, h, 24)
|
|
50
|
-
img = x.XCreateImage(d, x.XDefaultVisual(d, s), 24, 2, 0, buf, w, h, 32, 0) # ZPixmap
|
|
51
|
-
x.XPutImage(d, pix, x.XDefaultGC(d, s), img, 0, 0, 0, 0, w, h)
|
|
52
|
-
ref = ctypes.c_ulong(pix)
|
|
53
|
-
for atom in (b"_XROOTPMAP_ID", b"ESETROOT_PMAP_ID"):
|
|
54
|
-
x.XChangeProperty(d, root, x.XInternAtom(d, atom, 0), 20, 32, 0, ctypes.byref(ref), 1) # XA_PIXMAP, PropModeReplace
|
|
55
|
-
x.XSetWindowBackgroundPixmap(d, root, pix)
|
|
56
|
-
x.XClearWindow(d, root)
|
|
57
|
-
x.XSetCloseDownMode(d, 1) # RetainPermanent: the pixmap outlives this process
|
|
58
|
-
x.XCloseDisplay(d)
|
|
59
|
-
`;function ye(e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
60
|
-
<openbox_config xmlns="http://openbox.org/3.4/rc">
|
|
61
|
-
<theme><keepBorder>no</keepBorder></theme>
|
|
62
|
-
<applications>
|
|
63
|
-
<!-- Debian Chromium is "Chromium"; Chrome for Testing is "Chromium-browser". -->
|
|
64
|
-
<application class="Chromium*">
|
|
65
|
-
<decor>no</decor>
|
|
66
|
-
<position force="yes"><x>${S}</x><y>${S}</y></position>
|
|
67
|
-
<size><width>${e.width-S*2}</width><height>${e.height-S-w}</height></size>
|
|
68
|
-
</application>
|
|
69
|
-
</applications>
|
|
70
|
-
</openbox_config>`}var le=`# Remote sandbox dock \u2014 launcher icons only, centred, no panel fill
|
|
71
|
-
panel_items = L
|
|
72
|
-
panel_size = 100% 46
|
|
73
|
-
panel_margin = 0 10
|
|
74
|
-
panel_padding = 0 0 10
|
|
75
|
-
panel_position = bottom center horizontal
|
|
76
|
-
panel_shrink = 1
|
|
77
|
-
panel_background_id = 0
|
|
78
|
-
panel_layer = top
|
|
79
|
-
mouse_effects = 1
|
|
80
|
-
mouse_hover_icon_asb = 100 0 12
|
|
81
|
-
mouse_pressed_icon_asb = 100 0 -12
|
|
82
|
-
|
|
83
|
-
launcher_icon_size = 46
|
|
84
|
-
launcher_padding = 0 0 10
|
|
85
|
-
launcher_background_id = 0
|
|
86
|
-
launcher_tooltip = 1
|
|
87
|
-
|
|
88
|
-
launcher_item_app = /tmp/ara-chromium.desktop
|
|
89
|
-
launcher_item_app = /tmp/ara-terminal.desktop
|
|
90
|
-
launcher_item_app = /tmp/ara-files.desktop
|
|
91
|
-
`,ue=`corner-radius = 12;
|
|
92
|
-
rounded-corners-exclude = [
|
|
93
|
-
"class_g = 'tint2'",
|
|
94
|
-
"window_type = 'dock'",
|
|
95
|
-
"window_type = 'desktop'"
|
|
96
|
-
];
|
|
97
|
-
backend = "xrender";
|
|
98
|
-
shadow = false;
|
|
99
|
-
fading = false;
|
|
100
|
-
vsync = false;
|
|
101
|
-
inactive-opacity = 1.0;
|
|
102
|
-
active-opacity = 1.0;
|
|
103
|
-
`,Pe="/tmp/ara-dock-browser.png",Se=`[Desktop Entry]
|
|
104
|
-
Name=Chrome
|
|
105
|
-
Exec=chromium --no-sandbox %U
|
|
106
|
-
Icon=${Pe}
|
|
107
|
-
Type=Application
|
|
108
|
-
Categories=Network;WebBrowser;
|
|
109
|
-
`,Xe=`[Desktop Entry]
|
|
110
|
-
Name=Terminal
|
|
111
|
-
Exec=bash -c "DISPLAY=:99 xterm -fa DejaVuSansMono -fs 11 -bg black -fg white"
|
|
112
|
-
Icon=/tmp/ara-dock-terminal.png
|
|
113
|
-
Type=Application
|
|
114
|
-
Categories=System;TerminalEmulator;
|
|
115
|
-
`,fe=`[Desktop Entry]
|
|
116
|
-
Name=Files
|
|
117
|
-
Exec=bash -c "DISPLAY=:99 pcmanfm --no-desktop"
|
|
118
|
-
Icon=/tmp/ara-dock-files.png
|
|
119
|
-
Type=Application
|
|
120
|
-
Categories=System;FileManager;
|
|
121
|
-
`;var V={"wallpaper.jpg":B,"dock-browser.png":O,"dock-terminal.png":k,"dock-files.png":F},Te=K,he='set_wallpaper() { if command -v feh >/dev/null 2>&1; then feh --bg-fill "$1"; else python3 "$2" "$1"; fi; }';function v(e){let s=(i)=>i.replaceAll("DISPLAY=:99",`DISPLAY=${e.display}`).replaceAll("/tmp/ara-",`${e.root}/ara-`),p=new Set(e.absent??[]),n=le.split(`
|
|
122
|
-
`).filter((i)=>!(p.has("terminal")&&i.endsWith("/ara-terminal.desktop"))&&!(p.has("files")&&i.endsWith("/ara-files.desktop"))).join(`
|
|
123
|
-
`),t={"openbox/rc.xml":ye(e.screen),"tint2/tint2rc":s(n),"picom/picom.conf":ue,...p.has("terminal")?{}:{"ara-terminal.desktop":s(Xe)},...p.has("files")?{}:{"ara-files.desktop":s(fe)},"ara-chromium.desktop":s(Se).replace("chromium --no-sandbox %U",e.browserExec),"ara-set-root-wallpaper.py":Te},o=[...R.slice(0,3),he,'[ ! -f "$ROOT/ara-wallpaper.jpg" ] || set_wallpaper "$ROOT/ara-wallpaper.jpg" "$ROOT/ara-set-root-wallpaper.py" || true',...R.slice(3)];return{files:t,start:o}}var R=['ticks() { line=$(cat "/proc/$1/stat" 2>/dev/null) || return 1; rest=${line##*) }; case $rest in Z*|X*) return 1;; esac; printf "%s" "$rest" | cut -d " " -f20; }','alive() { [ -f "$ROOT/$1.pid" ] || return 1; read -r pid start <"$ROOT/$1.pid"; current=$(ticks "$pid") || return 1; [ "$current" = "$start" ] && kill -0 "$pid" 2>/dev/null; }','launch() { name=$1; shift; "$@" 9>&- >"$ROOT/$name.log" 2>&1 & pid=$!; start=$(ticks "$pid"); printf "%s %s\\n" "$pid" "$start" >"$ROOT/$name.pid"; }','if [ -f "$ROOT/tint2/tint2rc" ] && ! alive tint2 && command -v tint2 >/dev/null 2>&1; then launch tint2 tint2 -c "$ROOT/tint2/tint2rc"; fi','if [ -f "$ROOT/picom/picom.conf" ] && ! alive picom && command -v picom >/dev/null 2>&1; then launch picom picom --config "$ROOT/picom/picom.conf"; fi'];var Ae=43200000,D=":99",Ee=60000,_=15000,C={width:1280,height:800},Ne=/^[A-Za-z0-9._:-]{1,160}$/;function Le(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}var Je=["video","viewer","viewer_same_network","viewer_network"];function Ce(e,s=Date.now()){let p=["relay_url","session_id","expires_at"];if(!Le(e)||p.some((c)=>!(c in e))||Object.keys(e).some((c)=>!p.includes(c)&&!Je.includes(c)))throw new r("invalid_display_request","Reason desktop request is malformed.");let n="video"in e?Eo(e.video):void 0,t="viewer"in e?Mn(e.viewer):null;if(n===null)throw new r("invalid_display_request","Reason desktop video request is invalid.");let o=null;try{o=typeof e.relay_url==="string"?new URL(e.relay_url):null}catch{}if(!o||o.protocol!=="wss:"&&o.protocol!=="ws:"||o.username||o.password)throw new r("invalid_display_request","Reason desktop relay URL is invalid.");if(typeof e.session_id!=="string"||!Ne.test(e.session_id))throw new r("invalid_display_request","Reason desktop session identity is invalid.");let i=typeof e.expires_at==="string"?Date.parse(e.expires_at):Number.NaN;if(!Number.isFinite(i)||i<=s)throw new r("invalid_display_request","Reason desktop session has already expired.");return{relay_url:e.relay_url,session_id:e.session_id,expires_at:new Date(Math.min(i,s+Ae)).toISOString(),...n?{video:n}:{},...t?{viewer:t}:{},...n&&e.viewer_same_network===!0?{viewer_same_network:!0}:{}}}function $t(e=process.platform){return(e==="linux"||e==="darwin"||e==="win32")&&x()?.features.display===!0}async function Ms(){if(process.platform==="win32")return $t()&&await Pr();if(process.platform!=="darwin")return $t();return await Pr()}function G(e){we(e,{recursive:!0,mode:448});let s=_e(e);if(!s.isDirectory()||s.isSymbolicLink()||process.getuid&&s.uid!==process.getuid())throw new r("display_unavailable","Reason desktop state directory is not private.");De(e,448)}function Ue(e,s){let p=(t)=>{let o=Buffer.alloc(2);return o.writeUInt16BE(t.length),Buffer.concat([o,t])},n=Buffer.from([255,255]);return Buffer.concat([n,p(Buffer.alloc(0)),p(Buffer.from(e)),p(Buffer.from("MIT-MAGIC-COOKIE-1")),p(s)])}function T(e,s,p=2000){return new Promise((n)=>{let t=de(e),o="",i=(c)=>{t.destroy(),n(c)};t.setTimeout(p,()=>i(!1)),t.once("error",()=>i(!1)),t.once("close",()=>i(!1)),t.once("connect",()=>{if(!s)i(!0)}),t.on("data",(c)=>{if(o+=c.toString("latin1"),o.length>=4)i(o.startsWith("RFB "))})})}async function m(e,s){let p=Date.now()+s;while(Date.now()<p){if(await e())return!0;await new Promise((n)=>setTimeout(n,100))}return!1}function d(e,s,p){return new Promise((n)=>{let t=H(e,s,{detached:!0,stdio:"ignore",env:p});t.once("error",()=>n(-1)),t.once("exit",(o)=>n(o)),t.unref(),setTimeout(()=>n(null),_).unref()})}var U=null;function qe(e=a()){return U??=ge(e).finally(()=>{U=null}),U}async function ge(e){let s=x({home:e});if(!s?.xvfb||!s.x11vnc||!s.openbox)throw new r("display_unavailable","Run `reason desktop install` on this machine to enable its desktop.");xt({root:s.root,automation:s.automation,extensionDir:s.extensionDir});let p=y(s.root,"display");G(p);let n=await Me(e,p,s.x11vnc);if(n)return n;let t={display:D,xauthority:y(p,"Xauthority"),rfbSocket:y(p,"rfb.sock")},o=y(p,"pulse"),i=(async()=>{try{G(o)}catch{return null}return await po(o,s.pulseaudio)})();G(y(p,"home"));let c=re(p,t,s.pulseaudio),h=async()=>({...t,sound:await i});if(await T({path:t.rfbSocket},!0))return pe(y(p,"theme"),R,c),await h();if(!I(t.xauthority))g(t.xauthority,Ue(D.slice(1),Qe(16)),{mode:384,flag:"wx"});let l=te(y(p,"theme"),t.display,C),q={path:`/tmp/.X11-unix/X${D.slice(1)}`};if(!await T(q,!1)){let u=`${C.width}x${C.height}`;if(s.xvnc)ee(t.rfbSocket,{force:!0}),d(s.xvnc,[t.display,"-geometry",u,"-depth","24","-nolisten","tcp","-auth",t.xauthority,"-rfbport","-1","-rfbunixpath",t.rfbSocket,"-SecurityTypes","None","-UseBlacklist=0","-AlwaysShared","-desktop","Reason"],c);else d(s.xvfb,[t.display,"-screen","0",`${u}x24`,"-nolisten","tcp","-auth",t.xauthority],c);if(!await m(()=>T(q,!1),_)||s.xvnc&&!await m(()=>T({path:t.rfbSocket},!0),_))throw new r("display_unavailable","Reason could not start the virtual display.");d(s.openbox,["--config-file",l.openboxConfig],c)}if(await ne(l,c),!await se(s.x11vnc,t,p,"x11vnc.log",c))throw new r("display_unavailable","Reason could not start the desktop server.");return await h()}function re(e,s,p){let n={HOME:y(e,"home"),PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:s.display,XAUTHORITY:s.xauthority};if(p)n.PULSE_SERVER=Ve(On(y(e,"pulse")));return n}async function se(e,s,p,n,t){if(await T({path:s.rfbSocket},!0))return!0;ee(s.rfbSocket,{force:!0});let o=await d(e,["-display",s.display,"-auth",s.xauthority,"-rfbport","0","-rfbportv6","-1","-unixsock",s.rfbSocket,"-nopw","-forever","-shared","-noxdamage","-sb","0","-rfbversion","3.7","-quiet","-bg","-o",y(p,n)],t);if(o!==null&&o!==0)return!1;return await m(()=>T({path:s.rfbSocket},!0),_)}async function me(){let e=["DISPLAY","XAUTHORITY","WAYLAND_DISPLAY","XDG_SESSION_TYPE"],s=(p)=>Object.fromEntries(e.flatMap((n)=>p[n]?[[n,p[n]]]:[]));if(process.env.DISPLAY)return s(process.env);try{let p=await new Promise((n,t)=>z("systemctl",["--user","show-environment"],{encoding:"utf8",timeout:2000},(o,i)=>o?t(o):n(i)));return s(Object.fromEntries(p.split(`
|
|
124
|
-
`).flatMap((n)=>{let t=n.indexOf("=");return t>0?[[n.slice(0,t),n.slice(t+1)]]:[]})))}catch{return{}}}var Z=new Set;async function Me(e,s,p){let n=await me(),t=/^:(\d+)(?:\.\d+)?$/.exec(n.DISPLAY??"")?.[1];if(!t||`:${t}`===D||n.WAYLAND_DISPLAY||n.XDG_SESSION_TYPE==="wayland")return null;let o={display:`:${t}`,xauthority:n.XAUTHORITY??y(e,".Xauthority"),rfbSocket:y(s,`rfb-${t}.sock`)},i=`${o.display} ${o.xauthority}`;if(Z.has(i)||!await T({path:`/tmp/.X11-unix/X${t}`},!1))return null;let c={HOME:e,PATH:"/usr/local/bin:/usr/bin:/bin",DISPLAY:o.display,XAUTHORITY:o.xauthority};if(await se(p,o,s,`x11vnc-${t}.log`,c))return{...o,sound:null};return Z.add(i),process.stderr.write(`Reason worker: your screen ${o.display} could not be served; using the virtual desktop
|
|
125
|
-
`),null}function te(e,s,p){let n=`chromium --no-first-run --no-default-browser-check${process.geteuid?.()===0?" --no-sandbox":""} %U`,t=[["terminal","xterm"],["files","pcmanfm"]].filter(([,i])=>!I(`/usr/bin/${i}`)).map(([i])=>i),o=v({root:e,display:s,screen:p,browserExec:n,absent:t});for(let i of["","openbox","tint2","picom"])G(y(e,i));for(let[i,c]of Object.entries(o.files))g(y(e,i),c,{mode:384});for(let[i,c]of Object.entries(V))g(y(e,`ara-${i}`),Re(c),{mode:384});return{root:e,openboxConfig:y(e,"openbox","rc.xml"),start:o.start}}function ne(e,s){return pe(e.root,[...e.start,"openbox --reconfigure >/dev/null 2>&1 || true"],s)}function pe(e,s,p){let n=[`ROOT=${JSON.stringify(e)}`,...s].join(`
|
|
126
|
-
`);return new Promise((t)=>{let o=H("/bin/sh",["-c",n],{stdio:"ignore",env:{...p,PATH:"/usr/bin:/bin"}}),i=setTimeout(()=>{o.kill(),t()},_);o.once("error",()=>{clearTimeout(i),t()}),o.once("exit",()=>{clearTimeout(i),t()})})}var We=2073600,je=320;function Be(e,s){let p=Math.min(1,Math.sqrt(We/(e.width*e.height))),n=(t,o)=>Math.min(Math.floor(o/8)*8,Math.max(je,Math.round(t*p/8)*8));return{width:n(e.width,s.width),height:n(e.height,s.height)}}function oe(e,s,p){return new Promise((n)=>z(e,s,{env:p,encoding:"utf8",timeout:5000},(t,o)=>n(t?null:o)))}function Oe(e){let s=/current (\d+) x (\d+), maximum (\d+) x (\d+)/.exec(e),p=e.split(`
|
|
127
|
-
`),n=p.findIndex((o)=>/^\S+ connected/.test(o));if(!s||n<0)return null;let t=[];for(let o of p.slice(n+1)){let i=/^\s+(\d+x\d+)\s/.exec(o);if(!i)break;t.push(i[1])}return{current:{width:Number(s[1]),height:Number(s[2])},maximum:{width:Number(s[3]),height:Number(s[4])},output:p[n].split(" ")[0],modes:t}}async function Fe(e,s,p){if(e.display!==D)return null;let n={PATH:"/usr/bin:/bin",DISPLAY:e.display,XAUTHORITY:e.xauthority},t=(h)=>oe("xrandr",h,n),o=Oe(await t(["--query"])??"");if(!o||o.maximum.width<=o.current.width&&o.maximum.height<=o.current.height)return null;let i=Be(s,o.maximum);if(i.width===o.current.width&&i.height===o.current.height)return{size:i,changed:!1};let c=`${i.width}x${i.height}`;if(!o.modes.includes(c)){if(await t(["--newmode",c,"60",...[i.width,i.width,i.width,i.width,i.height,i.height,i.height,i.height].map(String)]),await t(["--addmode",o.output,c])===null)return null}return p(),await t(["--output",o.output,"--mode",c])===null?null:{size:i,changed:!0}}async function ke(e,s){let p=x({home:a()});if(!p)return;let n=y(p.root,"display"),t=re(n,e,p.pulseaudio);await ne(te(y(n,"theme"),e.display,s),t);let o=s.width-S*2,i=s.height-S-w;await oe("xdotool",["search","--onlyvisible","--class","Chromium","windowsize","%@",String(o),String(i),"windowmove","%@",String(S),String(S)],{...t,PATH:"/usr/bin:/bin"})}var Y=Promise.resolve();function Ge(e,s,p=()=>{}){let n=Y.then(()=>Fe(e,s,p));return Y=n.then((t)=>t?.changed?ke(e,t.size):void 0).catch(()=>{}),n.then((t)=>t?.size??null,()=>null)}async function Bt(e,s={}){let p=s.now??Date.now,n=Ce(e.payload,p());if(e.signal.throwIfAborted(),!n.video)throw new r("display_video_required","Reason desktops stream as video now; this request came without it.");let t=s.platform??process.platform;if(t!=="linux"&&t!=="darwin"&&t!=="win32")throw new r("display_video_unsupported","This machine does not serve desktop video.");let o=n.video,i=(s.video?.desktop??(t==="darwin"?async()=>In:t==="win32"?async()=>Dn:qe))();return await Ke(e.signal,n,s,p,(c)=>Nn(c,{request:o,desktop:i,...n.viewer?{viewer:n.viewer}:{},viewerSameNetwork:n.viewer_same_network===!0},{resizeDesktop:Ge,...s.video}),(c)=>zt({type:"error",code:c}))}function Ke(e,s,p,n,t,o){let i=n();return new Promise((c,h)=>{let l=null,q=!1,u=!1,M,A,Q,E=!1,P=null,X=(b)=>{if(u)return;if(P)b=P.outcome;u=!0,clearTimeout(M),clearTimeout(A),e.removeEventListener("abort",L),Q?.close();try{l?.close(1000,"display_session_over")}catch{}if("error"in b){h(b.error);return}c({reason:b.reason,...Q?.summary(),duration_ms:Math.max(0,n()-i)})},N=()=>X({error:new r("display_relay_unavailable","Reason could not reach the desktop relay.")}),L=()=>{let b=e.reason;X({error:b instanceof r?b:new r("cancelled","Reason closed the desktop session.")})},W=()=>{if(!P||!l)return;let{outcome:b}=P,f=!("error"in b)?b.reason:b.error instanceof r?b.error.code:"display_unavailable";if(!P.told)try{l.send(o(f))}catch{}X(b)};if(Q=t({get done(){return u||P!==null},get open(){return q&&!u&&P===null},get bufferedAmount(){return l?.bufferedAmount??0},send(b){if(u||P||!q||!l)return;try{l.send(b)}catch{X({reason:"relay_closed"})}},end:(b)=>{if(u||P)return;if(!("error"in b)&&E&&q){X(b);return}if(P={outcome:b,told:!("error"in b)&&q},E&&q)W()}}),u){Q.close();return}if(e.aborted){L();return}e.addEventListener("abort",L,{once:!0}),M=setTimeout(()=>X({reason:"session_expired"}),Math.max(1,Date.parse(s.expires_at)-n())),A=setTimeout(()=>X({reason:"viewer_absent"}),p.viewerWaitMs??Ee);try{l=(p.connect??Dr)(s.relay_url,(p.loadProxy??j)()?.url)}catch{N();return}l.binaryType="arraybuffer",l.onopen=()=>{if(u||!l)return;q=!0,Q?.opened()},l.onmessage=(b)=>{if(u)return;let f=b.data,J=f instanceof ArrayBuffer?new Uint8Array(f):ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength):null;if(!J||J.byteLength===0)return;if(clearTimeout(A),E=!0,P){W();return}Q?.received(J)},l.onclose=()=>{if(u)return;if(!q){N();return}X({reason:"relay_closed"})},l.onerror=()=>{if(u||q)return;N()}})}
|
|
128
|
-
export{$t,Ms,G,qe,Bt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{t,o,i,W,ee,s,n}from"./vm-hands-entry-lite-a1xa7s06.js";var lt=32768,Lt=67108864,Cr=16384,E=204800,kn=600000,_=["content-type","anthropic-version","user-agent"],m=s(["openai-completions","openai-responses","anthropic-messages"]),f=new Set(_),C=ee(t(),t().max(2048)).refine((e)=>Object.keys(e).every((r)=>f.has(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)),"Only non-secret custom endpoint request headers are permitted");function u(e){try{let r=new URL(e);return["http:","https:"].includes(r.protocol)&&!r.username&&!r.password&&!r.search&&!r.hash?r:null}catch{return null}}function Ar(e,r){let c=u(e.baseUrl),l=u(r.baseUrl),a=u(e.url);if(!c||!l||!a||e.method!=="POST"||r.execution!=="device")return!1;let d=(p)=>p.origin+p.pathname.replace(/\/+$/,"");if(d(c)!==d(l)||a.origin!==c.origin)return!1;let h=r.api==="openai-completions"?"/chat/completions":r.api==="openai-responses"?"/responses":"/v1/messages";return a.pathname===c.pathname.replace(/\/+$/,"")+h}var Cn=i({baseUrl:t().max(2048),url:t().max(4096),method:n("POST"),body:t().refine((e)=>new TextEncoder().encode(e).byteLength<=E).optional(),headers:C,credentialOrganizationId:t().uuid(),accountKey:t().min(1).max(256).optional()}).strict().refine((e)=>m.options.some((r)=>Ar(e,{baseUrl:e.baseUrl,api:r,execution:"device"})),"Invalid custom endpoint inference URL"),x=i({status:o().int().min(200).max(599),statusText:t().max(256).refine((e)=>!/[\r\n\0]/.test(e)),headers:ee(t(),t().max(4096)).refine((e)=>Object.keys(e).every((r)=>["content-type","retry-after","x-request-id","request-id"].includes(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)))}).strict(),D=W([i({eof:n(!0)}).strict(),i({eof:n(!1),data:t().max(Math.ceil(lt/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((e)=>e.length>0&&e.length*3/4-(e.endsWith("==")?2:e.endsWith("=")?1:0)<=lt)}).strict()]),y=i({bytes:o().int().min(0).max(Lt),chunks:o().int().min(0).max(Cr)}).strict(),An=i({apiKey:t().min(1).max(16384).refine((e)=>!/[\r\n\0]/.test(e)),api:m}).strict(),S=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function Pn(e){return typeof e==="string"&&S.includes(e)}var O="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",g={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${O}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."};var I=new Set(Object.values(g));export{lt,Lt,Cr,kn,Ar,Cn,An,Pn};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Nt}from"./vm-hands-entry-lite-np07qyeq.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{fe,se,C}from"./vm-hands-entry-lite-87vmbt38.js";import{spawn as J,spawnSync as ee}from"child_process";import{existsSync as h,mkdtempSync as ne,readFileSync as K,readdirSync as te,realpathSync as re,rmSync as oe,statSync as G}from"fs";import{platform as T,tmpdir as ie}from"os";import{dirname as A,join as c,win32 as w}from"path";import{fileURLToPath as ae,pathToFileURL as W}from"url";var le=["bwrap","socat","rg"],de=2000;var ce=3,L=4000,ue=new Set([".git",".hg",".svn","node_modules"]),me=["runAsHostUid","sysrq-trigger"],X=c(A(A(ae(import.meta.url))),"packages","sandbox-runtime"),pe=c(X,"src","index.ts"),z=!1;function Hi(){z=!0}function j(){return z?c(A(re(process.execPath)),"runtime","srt"):void 0}function y(){let e=c(j()??X,"vendor","srt-win");return c(e,process.arch,"srt-win.exe")}async function Y(){let e=j();if(e&&process.platform==="linux"&&!h(c(e,"vendor","seccomp",process.arch,"apply-seccomp")))throw Error("packaged_sandbox_runtime_vendor_missing");if(e&&process.platform==="win32"&&!h(y()))throw Error("packaged_sandbox_runtime_vendor_missing");if(e){let i=K(c(e,"sandbox-runtime.mjs"),"utf8");for(let s of me)if(!i.includes(s))throw Error(`packaged_sandbox_runtime_fork_missing:${s}`)}let n=(await import(e?W(c(e,"sandbox-runtime.mjs")).href:W(pe).href)).SandboxManager;if(!n||typeof n.initialize!=="function"||typeof n.wrapWithSandboxArgv!=="function")throw Error("sandbox-runtime does not expose the expected SandboxManager API.");return{SandboxManager:n}}function ge(e={}){if((e.platformName??T())!=="linux")return!1;let o=e.fileExists??h,n=e.readFile??((i)=>K(i,"utf8"));for(let i of["/.dockerenv","/run/.containerenv"])try{if(o(i))return!0}catch{}try{return/docker|containerd|kubepods|lxc|libpod/.test(n("/proc/1/cgroup"))}catch{return!1}}function we(e){return["/bin/true","/usr/bin/true"].find((t)=>e(t))??null}function Se(e,t){return e==="strict"?["--ro-bind","/","/","--unshare-pid","--unshare-user","--cap-drop","ALL","--proc","/proc","--",t]:["--ro-bind","/","/","--unshare-pid","--unshare-user","--bind","/proc","/proc","--",t]}function be(e,t){try{let o=ee("bwrap",Se(e,t),{stdio:"ignore",timeout:de});return!o.error&&o.status===0}catch{return!1}}function xe(e){let t=e.platformName??T(),o=e.fileExists??h;if(t==="win32")return(e.bash??fe)()&&o(y())?m??"strict":null;if(t!=="linux")return null;let n=e.hasExecutable??Nt;if(!le.every((l)=>n(l)))return null;let i=we(o);if(!i)return null;let s=m??(e.containerized??ge({platformName:t})?"weak":"strict");return(e.probeNamespaces??((l)=>be(l,i)))(s)?s:null}var S=null,M=!1,p=null,F=null;var m=null,P=null,_=null,E=null,v=[],g=new Map;function D(){throw b("sandbox_mode_conflict"),new r("sandbox_unavailable","Sandbox process policy conflicts with an existing probe or session. Restart the worker.")}function zi(e){if(m!==null&&m!==e||M&&S!==null&&S!==e||P!==null&&P!==e)D();m=e}function b(e){if(!p)process.stderr.write(`Reason worker: confined commands are off (${e})
|
|
3
|
-
`);p=e}function ur(e){if(p)return!1;if(!M){if(S=xe(e??{}),M=!0,S&&!e)Ce()}return S!==null}function he(){return ur()?S:null}var R=null,x=0;function I(e,t){if(p)throw new r("sandbox_unavailable","Confined execution is unavailable in this worker process.");if(m&&e.sandboxMode&&m!==e.sandboxMode)D();let o=m??e.sandboxMode??he();if(!o)throw new r("sandbox_unavailable","Confined command execution is unavailable on this operating system.");if(P&&P!==o)D();return P=o,R??=(async()=>{let{SandboxManager:n}=await(e.loadSandboxRuntime??Y)();return await n.initialize(Ne(o,t)),n})().catch((n)=>{if(R=null,t)_=null,process.stderr.write(`Reason worker: the Windows sandbox did not start for this folder (${String(n).slice(0,500)})
|
|
4
|
-
`);else b(`initialize_failed: ${String(n)}`);throw n instanceof r?n:new r("sandbox_unavailable","The confined execution sandbox failed to start.")}),R.then((n)=>{if(p)throw new r("sandbox_unavailable","Confined execution became unavailable during sandbox initialization.");return n})}function O(){if(x-=1,x===0)for(let e of v.splice(0))e()}async function ye(e,t=!0,o,n){let i=n===void 0?1/0:Date.now()+n;await Q();let s=_e();if(t)await s;let a=JSON.stringify(e),l=!1,u=()=>{if(!l)return;l=!1;let d=(g.get(a)??1)-1;if(d>0)g.set(a,d);else g.delete(a)};try{for(;;){if(o?.aborted)throw new r("cancelled","Operation was cancelled.");if(Date.now()>=i)return!1;if(E){await E;continue}let d=g.keys().next().value;if(_??=d??a,_===a&&(d===void 0||d===a))break;if(!l){l=!0,g.set(a,(g.get(a)??0)+1);continue}if(x===0&&d===a){Pe();continue}await new Promise((f)=>{if(v.push(f),o?.addEventListener("abort",()=>f(),{once:!0}),i!==1/0)setTimeout(f,Math.max(0,i-Date.now())).unref?.()})}return x+=1,!0}finally{if(l&&x===0)for(let d of v.splice(0))d();u()}}function Pe(){return E??=Me().finally(()=>{E=null}),E}function Ee(e,t,o=process.env){let n=o.USERPROFILE?w.resolve(o.USERPROFILE).toLowerCase():null,i=w.resolve(e).toLowerCase(),s=n!==null&&i.startsWith(`${n}\\`),a=t?q(o).filter((l)=>l.toLowerCase()===i||l.toLowerCase().startsWith(`${i}\\`)):[];return{denyRead:[],allowRead:[e],allowWrite:t?[e]:[],denyWrite:t?a:s?[]:[e]}}function q(e,t=process.execPath){let o=new Map;for(let n of[...(e.PATH??e.Path??"").split(";"),w.dirname(t)]){if(!n||!w.isAbsolute(n))continue;let i=w.resolve(n);if(!o.has(i.toLowerCase()))o.set(i.toLowerCase(),i)}return[...o.values()]}function Re(e=process.env,t=process.execPath){let o=[e.SystemRoot,e.ProgramFiles,e["ProgramFiles(x86)"],e.ProgramW6432,e.ProgramData,e.USERPROFILE].filter((n)=>!!n).map((n)=>w.resolve(n).toLowerCase());return q(e,t).filter((n)=>{let i=n.toLowerCase();return!o.some((s)=>i===s||i.startsWith(`${s}\\`))})}var U=null,H=null;function Q(e=y()){return H??=(async()=>{let t;try{t=JSON.parse((await V(e,["status"])).stdout).user?.user?.sid}catch{return null}if(typeof t!=="string"||!/^S-1-[0-9-]+$/.test(t))return null;if(!await new Promise((n)=>{let i=J(C("icacls"),[e,"/grant",`*${t}:(RX)`],{stdio:"ignore",windowsHide:!0,timeout:30000});i.on("error",()=>n(!1)),i.on("close",(s)=>n(s===0))}))process.stderr.write(`Reason worker: could not let the Windows sandbox user run srt-win.exe
|
|
5
|
-
`);return t})(),H}function V(e,t,o){return new Promise((n)=>{let i=J(e,t,{stdio:["pipe","pipe","ignore"],windowsHide:!0,timeout:120000}),s="";i.stdout?.setEncoding("utf8").on("data",(a)=>{s+=a}),i.on("error",()=>n({status:null,stdout:s})),i.on("close",(a)=>n({status:a,stdout:s})),i.stdin?.end(o??"")})}function _e(e=y()){return U??=(async()=>{let t=Re();if(t.length===0)return;let o=await Q(e),n=o?await V(e,["acl","stamp","--holder-pid",String(process.ppid),"--sandbox-user-sid",o],JSON.stringify({denyRead:[],denyWrite:t})):null;if(!n||n.status!==0&&n.status!==2)b(`program_folder_deny_failed: ${n?`exit ${n.status}`:"no sandbox user"}`),process.stderr.write(`Reason worker: could not deny the Windows sandbox writes to PATH folders (${n?`exit ${n.status}`:"no sandbox user"}); confined commands are off
|
|
6
|
-
`)})(),U}var Ae=`h=$(mktemp -d) || exit 125; trap 'rm -rf "$h"' EXIT; mkdir -p "$h/AppData/Roaming" "$h/AppData/Local"; w=$(cygpath -w "$h"); export HOME="$h" USERPROFILE="$w" APPDATA="$w\\AppData\\Roaming" LOCALAPPDATA="$w\\AppData\\Local" TEMP="$w" TMP="$w"; `;async function Me(){let e=R;if(R=null,_=null,!e)return;try{await(await e).reset()}catch{}}async function Ce(e={}){if(p)return!1;if(e.loadSandboxRuntime)return B(e.loadSandboxRuntime);if(!ur())return!1;return F??=B(Y),F}async function B(e){try{let{SandboxManager:t}=await e();if(process.platform==="win32"){if(!h(y()))b("dependencies_missing: srt-win.exe");return!p}let o=t.checkDependencies().errors;if(o.length>0)return b(`dependencies_missing: ${o.join(", ")}`),!1;return!p}catch(t){return b(`load_failed: ${String(t)}`),!1}}function hn(e=h,t=T()){if(t==="win32")return se("win32");return["/bin/bash","/bin/sh"].find((o)=>e(o))??"/bin/sh"}function ve(e){return e.map((t)=>`'${t.replaceAll("'","'\\''")}'`).join(" ")}function De(e,t,o=(n)=>te(n,{withFileTypes:!0}).filter((i)=>i.isDirectory()||i.isFile()).map((i)=>i.name)){let n=[],i=[{path:e,depth:0}],s=0;while(i.length>0&&s<L){let a=i.pop(),l;try{l=o(a.path)}catch{continue}for(let u of l){if(s+=1,s>L)break;let d=c(a.path,u);if(t(d)){n.push(d);continue}if(a.depth+1<ce&&!ue.has(u))i.push({path:d,depth:a.depth+1})}}return n}function Te(e){let t=c(e.root,".git"),o=[];try{if(G(t).isDirectory())o=[c(t,"config"),c(t,"hooks")]}catch{}return{denyRead:["/home","/root","/tmp","/tmp/.X11-unix",...e.protectedPaths],allowRead:[e.root,e.temporaryDirectory],allowWrite:[...e.allowWrite?[e.root]:[],e.temporaryDirectory],denyWrite:[...e.protectedPaths,...o]}}function ke(e,t){let o=c(t,".git"),n=[];try{if(G(o).isDirectory())n=[c(o,"config"),c(o,"hooks")]}catch{}return{denyRead:[...e],allowRead:[],allowWrite:[],denyWrite:[...e,...n]}}function Ne(e,t){if(t)return{network:{allowedDomains:[],deniedDomains:[]},filesystem:t,windows:{srtWin:{path:y()}}};return{network:{allowedDomains:[],deniedDomains:[]},filesystem:{denyRead:[],allowRead:[],allowWrite:[],denyWrite:[]},...e==="weak"?{enableWeakerNestedSandbox:!0}:{}}}function qi(e){let t=e.createTemporaryDirectory??(()=>ne(c(ie(),"reason-device-"))),o=e.removeTemporaryDirectory??((n)=>oe(n,{recursive:!0,force:!0}));return async(n,i,s)=>{let a=process.platform==="win32",l;if(a){let d=Ee(s.root,s.allowWrite);if(!await ye(d,!s.workerProbe,s.signal,s.timeoutMs))return{exitCode:null,signal:null,stdout:"",stderr:"",timedOut:!0,truncated:!1};try{l=await I(e,d)}catch(f){throw O(),f}}else l=await I(e),x+=1;let u;try{u=t();let d=De(s.root,e.isProtectedPath),f;try{f=await l.wrapWithSandboxArgv((a?Ae:"")+ve([n,...i]),e.shell??hn(),{filesystem:a?ke(d,s.root):Te({root:s.root,allowWrite:s.allowWrite,temporaryDirectory:u,protectedPaths:d})},s.signal,s.cwd)}catch(N){throw N instanceof r?N:new r("sandbox_unavailable","The confined execution sandbox could not wrap the command.")}let[k,...Z]=f.argv;if(!k)throw new r("sandbox_unavailable","The confined execution sandbox produced no command.");return await e.spawnCaptured(k,Z,{cwd:s.cwd,timeoutMs:s.timeoutMs,signal:s.signal,env:a?f.env:e.scrubEnvironment(s.root,u)})}finally{O();try{l.cleanupAfterCommand()}catch{}if(u!==void 0)o(u)}}}
|
|
7
|
-
export{Hi,zi,ur,hn,qi};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var i="libara_device_keychain.dylib",e="libreason_device_keychain.dylib";class ft extends Error{code;constructor(n,t){super(t);this.code=n;this.name="ManagedRuntimeError"}}import{existsSync as s}from"fs";import{join as a}from"path";function Po(n){let t=a(n,e);return s(t)?t:a(n,i)}
|
|
3
|
-
export{ft,Po};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{sr}from"./vm-hands-entry-lite-rfz60hb3.js";import{$e}from"./vm-hands-entry-lite-mcjca0ez.js";import{execFileSync as p}from"child_process";import{realpathSync as S,statSync as w}from"fs";import{tmpdir as P}from"os";import{createRequire as b}from"module";import{win32 as r}from"path";var h=["/bin/bash","/usr/bin/bash"],g="Git Bash was not found. Install Git for Windows (https://git-scm.com/download/win), then run `reason connect`.";function c(o){try{return w(o).isFile()}catch{return!1}}var i=(o)=>[r.join(o,"bin","bash.exe"),r.join(o,"usr","bin","bash.exe")];function x(o,e){let t=r.normalize(o).toLowerCase(),s=(e.SystemRoot??e.SYSTEMROOT??"C:\\Windows").toLowerCase();return t.startsWith(r.join(s,"system32").toLowerCase()+"\\")||t.startsWith(r.join(s,"sysnative").toLowerCase()+"\\")||t.includes("\\windowsapps\\")}function f(o=process.env,e=c){let t=[];for(let s of(o.PATH??o.Path??"").split(";"))if(s&&r.isAbsolute(s))t.push(r.join(s,"git.exe"));for(let s of[o.ProgramW6432,o.ProgramFiles,o["ProgramFiles(x86)"]])if(s)t.push(r.join(s,"Git","cmd","git.exe"));if(o.LOCALAPPDATA)t.push(r.join(o.LOCALAPPDATA,"Programs","Git","cmd","git.exe"));return t.find(e)??null}var a;function qo(o=process.platform){if(o!=="win32")return"git";return a??=f(),a}function J(o){let e=process.platform==="win32"?f(o):"git";if(!e)return null;try{return p(e,["--exec-path"],{encoding:"utf8",timeout:5000,windowsHide:!0,stdio:["ignore","pipe","ignore"],env:o}).trim()||null}catch{return null}}function y(o=process.env,e=J,t=c){let s=[],l=e(o);if(l)s.push(...i(r.resolve(l,"..","..","..")));for(let n of[o.ProgramW6432,o.ProgramFiles,o["ProgramFiles(x86)"]])if(n)s.push(...i(r.join(n,"Git")));if(o.LOCALAPPDATA)s.push(...i(r.join(o.LOCALAPPDATA,"Programs","Git")));for(let n of(o.PATH??o.Path??"").split(";"))if(n&&r.isAbsolute(n))s.push(r.join(n,"bash.exe"));return s.find((n)=>!x(n,o)&&t(n))??null}var d;function fe(o=process.platform){if(o!=="win32")return h.find(c)??null;return d??=y(),d}function se(o=process.platform){let e=fe(o);if(!e)throw Error(o==="win32"?g:"bash_unavailable");return e}function Wo(o=process.platform){return S(o==="win32"?P():"/tmp")}function Ie(o=process.platform,e=process.env){if(o!=="win32")return"/usr/bin:/bin";let t=e.SystemRoot??e.SYSTEMROOT??"C:\\Windows";return[r.join(t,"System32"),t,r.join(t,"System32","Wbem"),r.join(t,"System32","WindowsPowerShell","v1.0")].join(";")}function C(o,e=process.platform){if(e!=="win32"||/[\\/]/.test(o))return o;let t=/\.exe$/i.test(o)?o:`${o}.exe`,s=Ie(e).split(";");return r.join(t.toLowerCase()==="powershell.exe"?s[3]:s[0],t)}function De(o=process.platform,e=process.env){if(o!=="win32")return{PATH:Ie(o)};let t=e.SystemRoot??e.SYSTEMROOT??"C:\\Windows";return{PATH:Ie(o,e),SystemRoot:t,WINDIR:t}}function Ne(o=process.platform){return o==="win32"?{windowsHide:!0}:{detached:!0}}var u;function m(){if(u===void 0)u=$e(sr)(b(import.meta.url));return u}function Le(o,e=process.platform){let t=o.pid;if(e!=="win32"||t===void 0)return;let s=m();if(s?.track(t))o.once("close",()=>s.release(t))}function Me(o,e="SIGTERM",t=process.platform){if(t!=="win32"){process.kill(-o,e);return}if(e===0){process.kill(o,0);return}if(m()?.terminate(o))return;p(C("taskkill",t),["/PID",String(o),"/T","/F"],{stdio:"ignore",timeout:1e4,windowsHide:!0})}function A(o,e=63,t=process.platform){return t==="win32"||o.uid===process.getuid?.()&&(o.mode&e)===0}var N=/^(?:con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3]|conin\$|conout\$)(?:\..*)?$|:|[. ]$/i;function sn(o){return o!=="."&&o!==".."&&N.test(o)}
|
|
3
|
-
export{qo,fe,se,Wo,Ie,C,De,Ne,Le,Me,A,sn};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pt,I}from"./vm-hands-entry-lite-zce4hftk.js";import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{_,er}from"./vm-hands-entry-lite-nqdstx24.js";import{be}from"./vm-hands-entry-lite-yretc2th.js";function Bi(e,i){let t=T(e,"REASON_API_URL")?.trim();if(!t)return er(i);let n=new URL(t);if(n.protocol!=="https:"&&!(n.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(n.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return n.origin}function c(e){return T(e,"REASON_API_URL")?.trim()?Bi(e,"production"):void 0}function Vo(e){return T(e,"REASON_API_KEY")?.trim()||void 0}async function gs(e,i){let t=e.env??process.env,n=Vo(t);if(!n)return(e.getCredentials??Pt)({apiOrigin:c(t),signal:i});let a=Bi(t,e.channel??_({env:t})),o=await(e.fetchImpl??fetch)(a+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+n,accept:"application/json"},signal:i}),p=await o.json().catch(()=>({})),r=be(p)?p:{};if(!o.ok){let s=typeof r.detail==="string"?r.detail:typeof r.message==="string"?r.message:"API key authentication failed ("+o.status+")";throw new I(o.status,typeof r.error==="string"?r.error:"api_key_auth_failed",s)}if(typeof r.org_id!=="string"||!r.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let l=Array.isArray(r.scopes)?r.scopes.filter((s)=>typeof s==="string"):[];return{credentialKind:"api_key",apiOrigin:a,accessToken:n,orgId:r.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:l}}export{Bi,Vo,gs};
|