@reason-machines/cli-linux-x64 0.2.419 → 0.2.421
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 +8 -7
- package/bin/reason +2 -2
- package/bin/runtime/srt/sandbox-runtime.mjs +52 -52
- package/bin/vm-hands/api-18d75dfn.js +2 -0
- package/bin/vm-hands/api-credentials-3vhge1ap.js +2 -0
- package/bin/vm-hands/connect-cli-5r07fda9.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-17t4efc4.js +2 -0
- package/bin/vm-hands/desktop-account-6sjrxy69.js +2 -0
- package/bin/vm-hands/device-workspace-s50q53sz.js +2 -0
- package/bin/vm-hands/fsevents-p3d8kd0p.js +2 -0
- package/bin/vm-hands/hands-worker-source-kddz4y15.js +2 -0
- package/bin/vm-hands/index-wrw65904.js +12818 -0
- package/bin/vm-hands/install-receipt-ysa70fvh.js +2 -0
- package/bin/vm-hands/local-automation-764g234v.js +2 -0
- package/bin/vm-hands/local-capabilities-mg6eae35.js +2 -0
- package/bin/vm-hands/local-desktop-users-cppjjr81.js +2 -0
- package/bin/vm-hands/local-display-mac-0qz3b627.js +2 -0
- package/bin/vm-hands/local-display-session-a59620te.js +2 -0
- package/bin/vm-hands/local-display-video-6zdpjv5n.js +2 -0
- package/bin/vm-hands/local-managed-process-s7j196kq.js +2 -0
- package/bin/vm-hands/local-pty-session-rpk05ap5.js +2 -0
- package/bin/vm-hands/managed-runtime-vg23x3np.js +2 -0
- package/bin/vm-hands/network-contract-trkxqc0w.js +2 -0
- package/bin/vm-hands/package-xqbhdf15.js +2 -0
- package/bin/vm-hands/permissions-zkrmth58.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-xn3ddz70.js +2 -0
- package/bin/vm-hands/serve-service-y2sa6493.js +2 -0
- package/bin/vm-hands/status-6qmcgcem.js +10 -0
- package/bin/vm-hands/version-42drg7mg.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-agsp101y.js → vm-hands-entry-lite-21qpxvt8.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-2x8g6ktg.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-33hwmnd3.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-3krzmhkk.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-4vks5phw.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-4wpqs406.js +126 -0
- package/bin/vm-hands/vm-hands-entry-lite-50zbqwkv.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-5dtfehjv.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-60pg3wxj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-6c67a3jc.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-7fsj5nrx.js +539 -0
- package/bin/vm-hands/vm-hands-entry-lite-8r31b0ps.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-8wf6y7xy.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-aj139v8j.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-avc65bd7.js +65 -0
- package/bin/vm-hands/{vm-hands-entry-lite-vsa7t6m9.js → vm-hands-entry-lite-beyyy1gz.js} +54 -54
- package/bin/vm-hands/vm-hands-entry-lite-bx5zy5bd.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-c8ga19q0.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-djg69hf4.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-dk79tnax.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-dsxpxqd3.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-ec9jemny.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-fbhqfzbq.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-4k4h9rcq.js → vm-hands-entry-lite-fcvf8md1.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-g4zd2d5n.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-gvh1qskx.js +128 -0
- package/bin/vm-hands/vm-hands-entry-lite-hbs3tpdg.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-hek6nw5m.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-hk6trmwa.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-jev771b3.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-jzz73e3f.js +112 -0
- package/bin/vm-hands/vm-hands-entry-lite-m1yxqqaz.js +14 -0
- package/bin/vm-hands/vm-hands-entry-lite-np07qyeq.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-nzmkyezg.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-pf5qtbj5.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-qy9xg6em.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-6y6pz2yw.js → vm-hands-entry-lite-rfz60hb3.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-s1nwwtcs.js +452 -0
- package/bin/vm-hands/vm-hands-entry-lite-s4bharcb.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-s5qkb1fk.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-tdgtpx8e.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-vpz54vwj.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-weqw6ykz.js +52 -0
- package/bin/vm-hands/vm-hands-entry-lite-wx4ax7wg.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-fzkfajew.js → vm-hands-entry-lite-ycnrtwdf.js} +5 -9
- package/bin/vm-hands/vm-hands-entry-lite-yretc2th.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-z76nfb19.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-zp6naptr.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite.js +3 -1
- package/bin/vm-hands/vm-hands-executor-957e80sb.js +11 -0
- package/bin/vm-hands/vm-hands-op-runner-65erpgzp.js +2 -0
- package/bin/vm-hands/vm-hands-runtime-6stbsbbw.js +4 -0
- package/bin/vm-hands/worker-preview-readiness-w62n91kr.js +2 -0
- package/bin/vm-hands/worker-sandbox-2r5nseff.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-s4897qxy.js +0 -2
- package/bin/vm-hands/api-m73x3da5.js +0 -2
- package/bin/vm-hands/ask-relay-4kwcx2b7.js +0 -8
- package/bin/vm-hands/connect-cli-34b18gjs.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-j012b4bd.js +0 -2
- package/bin/vm-hands/desktop-account-0q0arpzk.js +0 -2
- package/bin/vm-hands/device-workspace-3jxhs54b.js +0 -2
- package/bin/vm-hands/hands-worker-source-y64axsw3.js +0 -2
- package/bin/vm-hands/index-194s4vz0.js +0 -12818
- package/bin/vm-hands/install-receipt-1g68b446.js +0 -2
- package/bin/vm-hands/local-automation-k2w46hn2.js +0 -2
- package/bin/vm-hands/local-capabilities-tdzbqmrb.js +0 -2
- package/bin/vm-hands/local-desktop-users-6thzvydd.js +0 -2
- package/bin/vm-hands/local-display-mac-59ma7sxa.js +0 -2
- package/bin/vm-hands/local-display-session-4833qq7h.js +0 -2
- package/bin/vm-hands/local-display-video-c1143mz6.js +0 -2
- package/bin/vm-hands/local-managed-process-mr0zpk7c.js +0 -2
- package/bin/vm-hands/local-pty-session-bwarwpsd.js +0 -2
- package/bin/vm-hands/managed-runtime-vz1wqwwg.js +0 -2
- package/bin/vm-hands/network-contract-gprc37sw.js +0 -2
- package/bin/vm-hands/package-ej9snd47.js +0 -2
- package/bin/vm-hands/permissions-7sfghef4.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-jsrkawe2.js +0 -2
- package/bin/vm-hands/serve-service-kngyzh74.js +0 -2
- package/bin/vm-hands/status-jz29fb95.js +0 -96
- package/bin/vm-hands/version-g29vt13t.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-0h4qmgm2.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-0k13wmzm.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1exfjv79.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-26q3hbdc.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-28s7v15d.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-2m5dwrdf.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-37hvds7z.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-3rqdzqhk.js +0 -112
- package/bin/vm-hands/vm-hands-entry-lite-4gh5kfr4.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-6nwbqg37.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-714wspqb.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-7zk0r3p9.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-9qep7pka.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-am6kj1n1.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-as1tkffn.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-bxt4n1nj.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-c2g3wmkp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-d2w8tghq.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-d98m00b8.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-daxcxjze.js +0 -344
- package/bin/vm-hands/vm-hands-entry-lite-dcnyve97.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-e1b89x66.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ej5ffjck.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-ejkba2nk.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-f3wh0dza.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-f5xb489y.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-feybcq63.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-fpp2bs9y.js +0 -452
- package/bin/vm-hands/vm-hands-entry-lite-gt497d5x.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-gxper06w.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-j2ng164q.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-jp9q2vsx.js +0 -127
- package/bin/vm-hands/vm-hands-entry-lite-magmzx9c.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ntx8fdyq.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-pfzczmaa.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-pkc4ry5x.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-pp7jfqzr.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-q8wkrzer.js +0 -66
- package/bin/vm-hands/vm-hands-entry-lite-s823n1q9.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-s9xf5z69.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-tchc7z17.js +0 -128
- package/bin/vm-hands/vm-hands-entry-lite-tytfs183.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-v4jtxgaj.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-vgpt2n1v.js +0 -11
- package/bin/vm-hands/vm-hands-entry-lite-xp3qzxk5.js +0 -3
- package/bin/vm-hands/vm-hands-executor-epyhpjv3.js +0 -11
- package/bin/vm-hands/vm-hands-op-runner-fn1qph82.js +0 -2
- package/bin/vm-hands/vm-hands-runtime-8vt9etvv.js +0 -4
- package/bin/vm-hands/worker-preview-readiness-yfjgban2.js +0 -2
- package/bin/vm-hands/worker-sandbox-z0t69av8.js +0 -2
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tl as e}from"./vm-hands-entry-lite-ejkba2nk.js";var i=e((o,t)=>{t.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{i as Ha};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I as T,K as U}from"./vm-hands-entry-lite-7zk0r3p9.js";import{td as V}from"./vm-hands-entry-lite-gt497d5x.js";import{Yi as M,_i as Q}from"./vm-hands-entry-lite-26q3hbdc.js";import{mj as G}from"./vm-hands-entry-lite-4k4h9rcq.js";function W(j,B){let k=G(j,"REASON_API_URL")?.trim();if(!k)return Q(B);let z=new URL(k);if(z.protocol!=="https:"&&!(z.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(z.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return z.origin}function X(j){return G(j,"REASON_API_URL")?.trim()?W(j,"production"):void 0}function $(j){return G(j,"REASON_API_KEY")?.trim()||void 0}async function N(j,B){let k=j.env??process.env,z=$(k);if(!z)return(j.getCredentials??T)({apiOrigin:X(k),signal:B});let J=W(k,j.channel??M({env:k})),D=await(j.fetchImpl??fetch)(J+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+z,accept:"application/json"},signal:B}),L=await D.json().catch(()=>({})),w=V(L)?L:{};if(!D.ok){let H=typeof w.detail==="string"?w.detail:typeof w.message==="string"?w.message:"API key authentication failed ("+D.status+")";throw new U(D.status,typeof w.error==="string"?w.error:"api_key_auth_failed",H)}if(typeof w.org_id!=="string"||!w.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let Z=Array.isArray(w.scopes)?w.scopes.filter((H)=>typeof H==="string"):[];return{credentialKind:"api_key",apiOrigin:J,accessToken:z,orgId:w.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:Z}}async function P(j){let B=await N(j),k=X(j.env??process.env);if(!B)throw Error(k?`Not signed in to ${k}. Set REASON_API_KEY, or run \`reason login --api-url ${k}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return B}
|
|
3
|
-
export{W as A,X as B,$ as C,N as D,P as E};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ie as Qz,Me as Zz,Oe as R,Re as $z}from"./vm-hands-entry-lite-as1tkffn.js";import{Yi as Jz}from"./vm-hands-entry-lite-26q3hbdc.js";import{mj as Hz}from"./vm-hands-entry-lite-4k4h9rcq.js";import{Gj as e,Vj as V,Xj as zz}from"./vm-hands-entry-lite-0h4qmgm2.js";import{hl as X}from"./vm-hands-entry-lite-gxper06w.js";import{spawnSync as C}from"child_process";import{createHash as Iz,randomUUID as Wz}from"crypto";import{chmodSync as bz,existsSync as y,mkdirSync as Sz,readdirSync as wz,readFileSync as L,renameSync as _z,rmSync as Y,statSync as xz,writeFileSync as Rz}from"fs";import{dirname as yz,isAbsolute as Bz,join as N}from"path";import{spawnSync as Oz}from"child_process";import{readFileSync as Cz}from"fs";import{userInfo as v}from"os";import{join as Kz}from"path";var Vz="REASON_SCHEDULED_TASK";function l(H){return Kz(H,"AppData","Local","Reason","Tasks")}function A(H){if(/[\0-\x1f\x7f"%]/.test(H))throw Error(`A background task cannot use a value with a double quote, percent sign or control character: ${H}`);return`'${H.replace(/['\u2018\u2019\u201a\u201b]/g,"$&$&")}'`}function a(H){if(!/^[A-Za-z0-9._-]+$/.test(H))throw Error(`Invalid Windows Scheduled Task name: ${H}`);return`$env:${Vz}=${A(H)};`}function c(H){let z=Object.entries(H.environment).map(([Q,Z])=>{if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Q))throw Error(`Invalid Windows Scheduled Task environment name: ${Q}`);return`$env:${Q}=${A(Z)};`}),J=`$global:LASTEXITCODE=1; & ${[H.program,...H.args].map(A).join(" ")} 2>&1 | ForEach-Object { Add-Content -LiteralPath ${A(H.log)} -Value $_.ToString() -Encoding UTF8 }; $c=$LASTEXITCODE;`;return[a(H.name),...z,"$ErrorActionPreference='Continue';",H.keepAlive?`do { ${J} if ($c) { Start-Sleep -Seconds 10 } } while ($c)`:`${J} exit $c`].join(" ")}function S(H){return H.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Pz(){let H=process.env.USERDOMAIN?.trim();return H?`${H}\\${v().username}`:v().username}function h(H){let z=S(H.user??Pz()),J=H.schedule==="logon",Q=H.schedule==="logon"?`<LogonTrigger><Enabled>true</Enabled><UserId>${z}</UserId></LogonTrigger>`:`<TimeTrigger><Repetition><Interval>PT${H.schedule.everyMinutes}M</Interval><StopAtDurationEnd>false</StopAtDurationEnd></Repetition><StartBoundary>2026-01-01T00:00:00</StartBoundary><Enabled>true</Enabled></TimeTrigger>`,Z=`-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -Command "${H.script}"`;return`<?xml version="1.0" encoding="UTF-16"?>
|
|
3
|
-
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
4
|
-
<RegistrationInfo>
|
|
5
|
-
<Description>${S(H.description)}</Description>
|
|
6
|
-
</RegistrationInfo>
|
|
7
|
-
<Triggers>
|
|
8
|
-
${Q}
|
|
9
|
-
</Triggers>
|
|
10
|
-
<Principals>
|
|
11
|
-
<Principal id="Author">
|
|
12
|
-
<UserId>${z}</UserId>
|
|
13
|
-
<LogonType>InteractiveToken</LogonType>
|
|
14
|
-
<RunLevel>LeastPrivilege</RunLevel>
|
|
15
|
-
</Principal>
|
|
16
|
-
</Principals>
|
|
17
|
-
<Settings>
|
|
18
|
-
<MultipleInstancesPolicy>${J?"StopExisting":"IgnoreNew"}</MultipleInstancesPolicy>
|
|
19
|
-
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
|
20
|
-
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
|
21
|
-
<StartWhenAvailable>true</StartWhenAvailable>
|
|
22
|
-
<IdleSettings>
|
|
23
|
-
<StopOnIdleEnd>false</StopOnIdleEnd>
|
|
24
|
-
<RestartOnIdle>false</RestartOnIdle>
|
|
25
|
-
</IdleSettings>
|
|
26
|
-
<ExecutionTimeLimit>${J?"PT0S":"PT1H"}</ExecutionTimeLimit>
|
|
27
|
-
<Priority>${J?5:7}</Priority>
|
|
28
|
-
</Settings>
|
|
29
|
-
<Actions Context="Author">
|
|
30
|
-
<Exec>
|
|
31
|
-
<Command>%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe</Command>
|
|
32
|
-
<Arguments>${S(Z)}</Arguments>
|
|
33
|
-
</Exec>
|
|
34
|
-
</Actions>
|
|
35
|
-
</Task>
|
|
36
|
-
`}function n(H){return Buffer.concat([Buffer.from([255,254]),Buffer.from(H.replaceAll(`\r
|
|
37
|
-
`,`
|
|
38
|
-
`).replaceAll(`
|
|
39
|
-
`,`\r
|
|
40
|
-
`),"utf16le")])}function r(H){let z=Cz(H);return(z[0]===255&&z[1]===254?z.subarray(2).toString("utf16le"):z.toString("utf8")).replaceAll(`\r
|
|
41
|
-
`,`
|
|
42
|
-
`)}function i(H,z){return["/Create","/TN",H,"/XML",z,"/F"]}function w(H){return["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",Buffer.from(H,"utf16le").toString("base64")]}function _(H){return`'*${a(H).replaceAll("'","''")}*'`}function x(H,z){return w(["$all = @(Get-CimInstance Win32_Process)",`$wrappers = @($all | ? { $_.ProcessId -ne $PID -and $_.CommandLine -like ${_(H)} })`,...z.keepWrapper?[]:["foreach ($w in $wrappers) { Stop-Process -Id $w.ProcessId -Force -ErrorAction SilentlyContinue }"],`foreach ($w in $wrappers) { $all | ? { $_.ParentProcessId -eq $w.ProcessId } | % { taskkill.exe /F ${z.tree?"/T ":""}/PID $_.ProcessId | Out-Null } }`].join(`
|
|
43
|
-
`))}function s(H){return w(["$all = @(Get-CimInstance Win32_Process)",`$wrappers = @($all | ? { $_.ProcessId -ne $PID -and $_.CommandLine -like ${_(H)} })`,"foreach ($w in $wrappers) { if ($all | ? { $_.ParentProcessId -eq $w.ProcessId -and $_.Name -ne 'conhost.exe' }) { 'running'; exit 0 } }","exit 1"].join(`
|
|
44
|
-
`))}function t(H,z=process.pid){let J=Oz(X("powershell.exe"),w(["$all = @{}; Get-CimInstance Win32_Process | % { $all[[int]$_.ProcessId] = $_ }",`$p = $all[${Math.trunc(z)}]`,"for ($i = 0; $p -and $i -lt 64; $i++) {",` if ($p.CommandLine -like ${_(H)}) { exit 10 }`," $n = $all[[int]$p.ParentProcessId]"," if (-not $n -or $n.ProcessId -eq $p.ProcessId -or $n.CreationDate -gt $p.CreationDate) { exit 11 }"," $p = $n","}","exit 11"].join(`
|
|
45
|
-
`)),{stdio:"ignore",timeout:15000,windowsHide:!0});return J.status===10?!0:J.status===11?!1:null}var P="REASON_WORKER_SERVICE",kz="worker_identity_unavailable";function qH(H){return{platform:process.platform,home:H,uid:process.getuid?.(),command:(z,J)=>C(X(z),[...J],{stdio:"ignore"}).status??1,read:(z,J)=>{let Q=C(X(z),[...J],{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4});return Q.status===0?Q.stdout:null},sleep:(z)=>Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,z),workerIdentity:(z)=>zz(H,z),insideService:(z,J)=>Ez(z,process.platform,process.getuid?.(),J)}}function Ez(H,z,J,Q=!0){if(process.env[P]===H||process.env.XPC_SERVICE_NAME===H)return!0;if(z==="linux")try{return L("/proc/self/cgroup","utf8").includes(`/${H}.service`)}catch{return!0}if(z==="win32")return t(H)??Q;if(z!=="darwin")return!1;if(typeof J!=="number")return!0;let Z=C("/bin/launchctl",["print",`gui/${J}/${H}`],{encoding:"utf8",timeout:5000});if(Z.status===fz)return!1;if(Z.error||Z.status!==0)return!0;let B=Number(/^\s*pid = (\d+)$/m.exec(Z.stdout??"")?.[1]??0);if(!B)return!1;let q=process.pid;for(let $=0;$<64&&q>1;$+=1){if(q===B)return!0;let j=C("/bin/ps",["-o","ppid=","-p",String(q)],{encoding:"utf8",timeout:5000}),G=Number(j.stdout?.trim());if(j.error||j.status!==0||!Number.isSafeInteger(G)||G<=0)return!0;if(G===q)return!1;q=G}return q>1}var fz=113;class M extends Error{code;constructor(H,z){super(H);this.code=z}}function jH(H,z){if(!u(H.home,H.platform))throw new M(Mz);if(H.platform==="darwin")F(H);let J=$z(Qz(z,H.home)),Q=Jz({env:z})==="staging",Z=Q?"ara-staging":"ara",B=[J?Zz(J):null,Hz(z,"REASON_CLI_LAUNCHER_PATH")?.trim(),H.platform==="win32"?N(H.home,"AppData","Local","Reason",...Q?["staging"]:[],"bin",Q?"reason-staging.exe":"reason.exe"):N(H.home,".local","bin",Z)];for(let q of B)try{if(q&&Bz(q)&&xz(q).isFile())return R(q)}catch{}throw new M(`A background service runs the installed Reason launcher, which was not found. Install Reason with: ${H.platform==="win32"?"irm https://reasonmachines.com/install.ps1 | iex":"curl -fsSL https://reasonmachines.com/install | sh"}`,"worker_launcher_missing")}var k=/(<key>ProgramArguments<\/key>\s*<array>\n)((?:\s*<string>[^<]*<\/string>\n)*)(\s*<\/array>)/,O=new RegExp(`(\\n\\s*<key>${V}</key>\\s*<string>)[^<]*(</string>)`),mz=/(<key>EnvironmentVariables<\/key>\s*<dict>[\s\S]*?)(\n\s*<\/dict>)/;function uz(H){return H.replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll("'","'").replaceAll("&","&")}function E(H){let z=[...(k.exec(H)?.[2]??"").matchAll(/<string>([^<]*)<\/string>/g)].map((Q)=>uz(Q[1])),J=z[1]==="--run-worker"?z.slice(2):z;return J[0]?{launcher:J[0],args:J.slice(1)}:null}function GH(H,z){if(!pz(z))return null;try{return E(L(N(H,"Library","LaunchAgents",`${z}.plist`),"utf8"))?.launcher??null}catch{return null}}function qz(H,z,J){let Q=J.workerIdentity?.(H)??null;return{program:Q?[Q.executable,"--run-worker",H,...z]:[H,...z],identity:Q}}function f(H){return H.map((z)=>` <string>${D(z)}</string>`).join(`
|
|
46
|
-
`)}function jz(H,z){let J;try{J=L(H,"utf8")}catch{return null}let Q=E(J);if(!Q)return null;let Z=Bz(Q.launcher)?R(Q.launcher):Q.launcher,{program:B,identity:q}=qz(Z,Q.args,z),$=J.replace(k,(j,G,U,g)=>`${G}${f(B)}
|
|
47
|
-
${g}`);if(!q)$=$.replace(O,"");else if(O.test($))$=$.replace(O,(j,G,U)=>`${G}${D(q.app)}${U}`);else $=$.replace(mz,(j,G,U)=>`${G}
|
|
48
|
-
<key>${V}</key>
|
|
49
|
-
<string>${D(q.app)}</string>${U}`);return $===J?null:$}function dz(H,z){let J=jz(H,z);if(J!==null)b(H,J)}function MH(H,z,J){if(z.platform!=="darwin")return!1;let Q=d(H,z,J);return Q!==null&&jz(Q.definition,z)!==null}var I="com.reasonmachines.worker.",m="so.reason.worker.",W=[I,m];function pz(H){return W.some((z)=>H.startsWith(z)&&/^[A-Za-z0-9._-]+$/.test(H.slice(z.length)))}function Gz(H,z=I){return`${z}connect${H==="production"?"":`.${H}`}`}function YH(H,z){return W.some((J)=>H===Gz(z,J))}function gz(H,z,J){if(z==="connect")return Gz(H.channel,J);let Q=Iz("sha256").update(H.workspaceRoot).digest("hex").slice(0,8);return`${J}${H.name.toLowerCase()}.${Q}`}var Mz="A background service needs macOS (launchd), Linux (systemd --user) or Windows (Task Scheduler).";function u(H,z){if(z==="darwin")return{directory:N(H,"Library","LaunchAgents"),suffix:".plist"};if(z==="linux")return{directory:N(H,".config","systemd","user"),suffix:".service"};if(z==="win32")return{directory:l(H),suffix:".xml"};return null}function T(H,z,J,Q=I){let Z=gz(H,J,Q),B=u(z.home,z.platform);if(!B)return null;return{label:Z,definition:N(B.directory,`${Z}${B.suffix}`),logs:z.platform==="linux"?`journalctl --user -u ${Z}.service`:N(H.stateDirectory,"service.log")}}function DH(H,z){let J=u(H,z);if(!J)return[];try{return wz(J.directory).filter((Q)=>W.some((Z)=>Q.startsWith(Z))&&Q.endsWith(J.suffix)).sort().map((Q)=>N(J.directory,Q))}catch{return[]}}function d(H,z,J="serve"){return Yz(H,z,J)[0]??null}function Yz(H,z,J){return W.map((Q)=>T(H,z,J,Q)).filter((Q)=>Q!==null&&y(Q.definition))}function Dz(H,z,J){let Q=T(H,z,J,m);return Q&&y(Q.definition)?Q:null}function vz(H,z,J){let Q=T(H,z,J),Z=Dz(H,z,J);if(!Q||!Z||!y(Q.definition)||z.insideService?.(Z.label))return null;if(!lz(Q,z))return"current_not_running";if(z.platform==="darwin"){if(typeof z.uid==="number"&&z.uid>0)z.command("/bin/launchctl",["bootout",`gui/${z.uid}/${Z.label}`]);return Y(Z.definition,{force:!0}),"retired"}if(z.platform==="win32")return K(Z,z,!0),"retired";return z.command("systemctl",["--user","disable","--now",`${Z.label}.service`]),Y(Z.definition,{force:!0}),z.command("systemctl",["--user","daemon-reload"]),"retired"}function lz(H,z){if(z.platform==="darwin")return typeof z.uid==="number"&&z.uid>0&&z.command("/bin/launchctl",["print",`gui/${z.uid}/${H.label}`])===0;if(z.platform==="win32")return z.command("schtasks",["/Query","/TN",H.label])===0;let J=`${H.label}.service`;return z.command("systemctl",["--user","is-enabled","--quiet",J])===0&&az.has(z.read("systemctl",["--user","show","--property=ActiveState","--value",J])?.trim()??"")}var az=new Set(["active","activating","reloading"]);function UH(H,z){if(z.platform==="darwin"){if(typeof z.uid!=="number"||z.uid<=0)return!1;let J=z.read("/bin/launchctl",["print",`gui/${z.uid}/${H.label}`]);return Number(/^\s*pid = (\d+)$/m.exec(J??"")?.[1]??0)>0}if(z.platform==="win32")return z.read("powershell.exe",s(H.label))?.trim()==="running";return Number(z.read("systemctl",["--user","show","--property=MainPID","--value",`${H.label}.service`])?.trim()??0)>0}function NH(H){let{config:z,launcher:J,host:Q,kind:Z}=H,B=T(z,Q,Z);if(!B)return!1;let q;try{q=Q.platform==="win32"?r(B.definition):L(B.definition,"utf8")}catch{return!1}if(Q.platform==="win32")return q===Tz(z,Z,B,J);if(Q.platform!=="darwin")return q===Nz(z,Z,B,J,Q.home,H.path);let $=E(q);return q.replace(O,"").replace(k,(G,U,g,Az)=>`${U}${$?`${f([$.launcher,...$.args])}
|
|
50
|
-
`:""}${Az}`)===Uz(z,Z,B,J,{...Q,workerIdentity:()=>null},H.path).plist}function p(H,z){if(z==="connect")return{args:["connect"],environment:{REASON_CLI_CHANNEL:H.channel},description:"Reason connection of this computer"};return{args:["serve",H.name,"--dir",H.workspaceRoot,...H.executionMode==="confined"?["--sandbox"]:[]],environment:{},description:`Reason machine ${H.name} worker`}}function D(H){return H.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function o(H,z=!1){if(/[\0-\x1f\x7f]/.test(H))throw new M("A background service cannot use a path with control characters.");let J=H.replaceAll("\\","\\\\").replaceAll('"',"\\\"").replaceAll("%","%%");return`"${z?J.replaceAll("$","$$$$"):J}"`}function Uz(H,z,J,Q,Z,B){let q=p(H,z),$=qz(Q,q.args,Z),j={HOME:Z.home,PATH:B,[P]:J.label,...q.environment,...$.identity?{[V]:$.identity.app}:{}};return{identity:$.identity,plist:`<?xml version="1.0" encoding="UTF-8"?>
|
|
51
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
52
|
-
<plist version="1.0">
|
|
53
|
-
<dict>
|
|
54
|
-
<key>Label</key>
|
|
55
|
-
<string>${D(J.label)}</string>
|
|
56
|
-
<key>AssociatedBundleIdentifiers</key>
|
|
57
|
-
<array>
|
|
58
|
-
<string>${e}</string>
|
|
59
|
-
</array>
|
|
60
|
-
<key>ProgramArguments</key>
|
|
61
|
-
<array>
|
|
62
|
-
${f($.program)}
|
|
63
|
-
</array>
|
|
64
|
-
<key>EnvironmentVariables</key>
|
|
65
|
-
<dict>
|
|
66
|
-
${Object.entries(j).map(([G,U])=>` <key>${G}</key>
|
|
67
|
-
<string>${D(U)}</string>`).join(`
|
|
68
|
-
`)}
|
|
69
|
-
</dict>
|
|
70
|
-
<key>RunAtLoad</key>
|
|
71
|
-
<true/>
|
|
72
|
-
<key>KeepAlive</key>
|
|
73
|
-
<dict>
|
|
74
|
-
<key>SuccessfulExit</key>
|
|
75
|
-
<false/>
|
|
76
|
-
</dict>
|
|
77
|
-
<key>ThrottleInterval</key>
|
|
78
|
-
<integer>10</integer>
|
|
79
|
-
<key>ExitTimeOut</key>
|
|
80
|
-
<integer>${Math.ceil(H.shutdownGraceMs/1000)+10}</integer>
|
|
81
|
-
<key>ProcessType</key>
|
|
82
|
-
<string>Standard</string>
|
|
83
|
-
<key>Umask</key>
|
|
84
|
-
<integer>63</integer>
|
|
85
|
-
<key>StandardOutPath</key>
|
|
86
|
-
<string>${D(J.logs)}</string>
|
|
87
|
-
<key>StandardErrorPath</key>
|
|
88
|
-
<string>${D(J.logs)}</string>
|
|
89
|
-
</dict>
|
|
90
|
-
</plist>
|
|
91
|
-
`}}function Nz(H,z,J,Q,Z,B){let q=p(H,z);return`[Unit]
|
|
92
|
-
Description=${q.description}
|
|
93
|
-
|
|
94
|
-
[Service]
|
|
95
|
-
ExecStart=${[Q,...q.args].map(($)=>o($,!0)).join(" ")}
|
|
96
|
-
Environment=${[`HOME=${Z}`,`PATH=${B}`,`${P}=${J.label}`,...Object.entries(q.environment).map(([$,j])=>`${$}=${j}`)].map(($)=>o($)).join(" ")}
|
|
97
|
-
Restart=on-failure
|
|
98
|
-
RestartSec=10
|
|
99
|
-
TimeoutStopSec=${Math.ceil(H.shutdownGraceMs/1000)+10}
|
|
100
|
-
UMask=0077
|
|
101
|
-
|
|
102
|
-
[Install]
|
|
103
|
-
WantedBy=default.target
|
|
104
|
-
`}function Tz(H,z,J,Q){let Z=p(H,z);return h({description:Z.description,schedule:"logon",script:c({name:J.label,program:Q,args:Z.args,environment:{[P]:J.label,...Z.environment},log:J.logs,keepAlive:!0})})}function Lz(H,z,J){z.command("powershell.exe",x(H.label,{tree:J,keepWrapper:!J}))}function K(H,z,J){z.command("schtasks",["/Delete","/F","/TN",H.label]),z.command("powershell.exe",x(H.label,{tree:J,keepWrapper:!1})),Y(H.definition,{force:!0})}function b(H,z){Sz(yz(H),{recursive:!0,mode:448});let J=`${H}.${Wz()}.tmp`;try{Rz(J,z,{mode:384,flag:"wx"}),bz(J,384),_z(J,H)}finally{Y(J,{force:!0})}}function F(H){if(typeof H.uid!=="number"||!Number.isSafeInteger(H.uid)||H.uid<=0)throw new M("Set up a background service as your own user, not with sudo.","worker_service_root_user");return`gui/${H.uid}`}function TH(H){let{config:z,launcher:J,host:Q}=H,Z=H.kind??"serve",B=Dz(z,Q,Z),q=B!==null&&Q.insideService?.(B.label)===!0,$=T(z,Q,Z,q?m:I);if(!$)throw new M(Mz);if(Q.platform==="darwin")F(Q);if(Q.platform==="linux"&&Q.command("systemctl",["--user","show-environment"])!==0)throw new M("No background service here: this computer has no systemd user session.","worker_service_manager_missing");let j=Q.platform==="darwin"?Uz(z,Z,$,J,Q,H.path):null;if(b($.definition,j?j.plist:Q.platform==="win32"?n(Tz(z,Z,$,J)):Nz(z,Z,$,J,Q.home,H.path)),Xz(z,Q,$,q?null:B),j)return j.identity?$:{...$,identityProblem:kz};if(Q.platform==="win32")return $;return{...$,lingering:Q.command("loginctl",["enable-linger"])===0}}function Xz(H,z,J,Q){if(z.platform==="darwin"){let q=F(z);if(Q)z.command("/bin/launchctl",["bootout",`${q}/${Q.label}`]);if(Fz(H,J,z)){if(Q)Y(Q.definition,{force:!0});return}if(Y(J.definition,{force:!0}),Q)z.command("/bin/launchctl",["bootstrap",q,Q.definition]);throw new M("Could not start the background service (launchctl bootstrap failed).","worker_service_start_failed")}if(z.platform==="win32"){if(Q)K(Q,z,!0);if(z.command("schtasks",i(J.label,J.definition))===0){if(Lz(J,z,z.insideService?.(J.label)!==!0),z.command("schtasks",["/Run","/TN",J.label])===0)return}throw K(J,z,!0),new M("Could not start the background service (schtasks failed).")}let Z=`${J.label}.service`,B=Q?`${Q.label}.service`:null;if(z.command("systemctl",["--user","daemon-reload"])!==0||B!==null&&z.command("systemctl",["--user","disable","--now",B])!==0||z.command("systemctl",["--user","enable",Z])!==0||z.command("systemctl",["--user","restart",Z])!==0){if(z.command("systemctl",["--user","disable",Z]),Y(J.definition,{force:!0}),z.command("systemctl",["--user","daemon-reload"]),B)z.command("systemctl",["--user","enable","--now",B]);throw new M("Could not start the background service (systemctl --user failed).","worker_service_start_failed")}if(Q)Y(Q.definition,{force:!0}),z.command("systemctl",["--user","daemon-reload"])}function Fz(H,z,J){let Q=F(J);J.command("/bin/launchctl",["bootout",`${Q}/${z.label}`]);let Z=(Math.ceil(H.shutdownGraceMs/1000)+10)*1000;for(let B=0,q=100;;q=Math.min(q*2,2000)){if(J.command("/bin/launchctl",["bootstrap",Q,z.definition])===0)return!0;if(B>=Z)return!1;J.sleep(q),B+=q}}function LH(H,z,J){let Q=d(H,z,J);if(!Q)return null;let Z=z.insideService?.(Q.label)===!0;if(z.platform==="darwin"&&!Z)dz(Q.definition,z);let B=T(H,z,J);if(B&&Q.label!==B.label&&!Z)return b(B.definition,L(Q.definition,"utf8").replaceAll(Q.label,B.label)),Xz(H,z,B,Q),B;let q=z.platform==="darwin"&&Z,$;if(z.platform==="win32")Lz(Q,z,!Z),$=z.command("schtasks",["/Run","/TN",Q.label])===0;else if(q)$=z.command("/bin/launchctl",["kickstart","-k",`${F(z)}/${Q.label}`])===0;else if(z.platform==="darwin")$=Fz(H,Q,z);else z.command("systemctl",["--user","enable",`${Q.label}.service`]),$=z.command("systemctl",["--user","restart",`${Q.label}.service`])===0;if(!$)throw new M(`Could not restart the background service ${Q.label}.`,"worker_service_restart_failed");if(B&&Q.label===B.label)vz(H,z,J);return Q}function XH(H,z,J,Q){let Z=d(H,J,Q),B=T(z,J,Q);if(J.platform!=="darwin"||!Z||!B)return;let q=`<string>${D(Z.logs)}</string>`,$=L(Z.definition,"utf8");if($.includes(q))b(Z.definition,$.replaceAll(q,`<string>${D(B.logs)}</string>`))}function FH(H,z,J="serve"){let Q=Yz(H,z,J);for(let Z of Q){if(z.platform==="win32"){K(Z,z,z.insideService?.(Z.label,!1)!==!0);continue}if(z.platform==="darwin"){if(typeof z.uid==="number"&&z.uid>0)z.command("/bin/launchctl",["bootout",`gui/${z.uid}/${Z.label}`]);Y(Z.definition,{force:!0});continue}z.command("systemctl",["--user","disable","--now",`${Z.label}.service`]),Y(Z.definition,{force:!0}),z.command("systemctl",["--user","daemon-reload"])}return Q[0]??null}
|
|
105
|
-
export{l as ie,P as je,kz as ke,qH as le,M as me,jH as ne,GH as oe,MH as pe,Gz as qe,YH as re,DH as se,d as te,vz as ue,UH as ve,NH as we,TH as xe,LH as ye,XH as ze,FH as Ae};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var n=Object.create;var{getPrototypeOf:o,defineProperty:e,getOwnPropertyNames:k,getOwnPropertyDescriptor:p}=Object,l=Object.prototype.hasOwnProperty;function m(a){return this[a]}var q,r,u=(a,b,c)=>{var d=a!=null&&typeof a==="object";if(d){var h=b?q??=new WeakMap:r??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?n(o(a)):{};let f=b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c;for(let g of k(a))if(!l.call(f,g))e(f,g,{get:m.bind(a,g),enumerable:!0});if(d)h.set(a,f);return f},v=(a)=>{var b=(j??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of k(a))if(!l.call(b,d))e(b,d,{get:m.bind(a,d),enumerable:!(c=p(a,d))||c.enumerable})}return j.set(a,b),b},j,w=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=(a)=>a;function t(a,b){this[a]=s.bind(null,b)}var x=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:t.bind(b,c)})};var y=(a,b)=>()=>(a&&(b=a(a=0)),b);var z=import.meta.require;
|
|
3
|
-
export{u as rl,v as sl,w as tl,x as ul,y as vl,z as wl};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{hd as L,id as S,md as f}from"./vm-hands-entry-lite-j2ng164q.js";import{il as R,jl as E,kl as W}from"./vm-hands-entry-lite-gxper06w.js";import{spawn as x}from"child_process";import{randomUUID as J}from"crypto";import{basename as k}from"path";import{fileURLToPath as m}from"url";function g(){let $=k(process.execPath).startsWith("bun");return{command:process.execPath,args:[...$?["--no-env-file",m(new URL("./worker-candidate-entry.ts",import.meta.url))]:[],"worker","__preview-probe"]}}async function d($,Q,H=g()){if(Q.aborted||!["darwin","linux","win32"].includes(process.platform)||process.platform==="win32"&&!S())return!1;let F=new AbortController,C=()=>F.abort();Q.addEventListener("abort",C,{once:!0});let T=setTimeout(C,5000),B=x(H.command,H.args,{cwd:$,...E(),stdio:["pipe","pipe","ignore"],env:R()});W(B);let Z=!1,N=new Promise((j)=>B.once("close",()=>{Z=!0,j()}));B.on("error",C);let O,V,D=new Promise((j)=>{O=j}),P=new Promise((j)=>{V=j}),_=new Promise((j)=>F.signal.addEventListener("abort",()=>j(null),{once:!0})),K="",A=0,G=!1;B.stdout.setEncoding("utf8"),B.stdout.on("data",(j)=>{if(A+=Buffer.byteLength(j),K+=j,A>512){C();return}while(K.includes(`
|
|
3
|
-
`)){let X=K.indexOf(`
|
|
4
|
-
`),Y=K.slice(0,X);K=K.slice(X+1);try{if(!G){let z=JSON.parse(Y);if(!z||Object.keys(z).length!==2||!Number.isInteger(z.port)||z.port<1024||z.port>65535||typeof z.token!=="string"||!/^[a-zA-Z0-9_-]{43}$/.test(z.token))throw Error("probe_receipt_invalid");G=!0,O({port:z.port,token:z.token})}else if(Y==="ready")V(!0);else C()}catch{C()}}}),N.then(C);let M,q=!1;try{let j=await Promise.race([D,_]);if(!j||!B.pid||F.signal.aborted||Q.aborted)return!1;let X=Date.now()+4500,Y=J(),z={organizationId:J(),userId:J(),runId:J(),deviceId:J(),rootId:J(),attachmentRevision:0,grantRevision:1,jobId:"readiness",generation:1,fenceId:J(),port:j.port,expiresAtMs:X},y={binding:z,executorLaunchId:Y,job:{jobId:z.jobId,state:"running",startedAtMs:Date.now(),finishedAtMs:null,leaseExpiresAtMs:X,exitCode:null,inputSequence:0,output:[],firstCursor:1,nextCursor:0,truncated:!1,process:{pid:B.pid,processGroupId:B.pid,executorLaunchId:Y}}},I=f({binding:z,deniedPorts:new Set,readCurrentJob:async()=>!Z&&!F.signal.aborted?y:null});M=await L({binding:z,deviceRelayUrl:`ws://127.0.0.1:${j.port}/device/readiness/${j.token}`,port:I,signal:F.signal}),q=await Promise.race([P,_])===!0&&!F.signal.aborted&&!Q.aborted}catch{q=!1}finally{if(clearTimeout(T),Q.removeEventListener("abort",C),M?.close(),F.abort(),B.stdin.destroy(),!Z)B.kill("SIGKILL");await N}return q&&Z}
|
|
5
|
-
export{d as y};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ml as N}from"./vm-hands-entry-lite-gxper06w.js";import{randomUUID as K}from"crypto";import{closeSync as L,constants as V,fstatSync as M,lstatSync as Z,mkdirSync as $,openSync as O,readFileSync as T,realpathSync as b,renameSync as U,unlinkSync as X,writeFileSync as Y}from"fs";import{dirname as g,resolve as z}from"path";var A=65536;function J(j){try{return Z(j),!0}catch(q){if(q instanceof Error&&"code"in q&&q.code==="ENOENT")return!1;throw q}}function I(j,q=!1){if(!J(j)){if(!q)throw Error("worker_state_missing");D(j),$(j,{mode:448})}let C=Z(j);if(!C.isDirectory()||C.isSymbolicLink()||!N(C)||b(j)!==z(j))throw Error("worker_state_directory_not_private_or_canonical")}function D(j){let q=g(j);if(!J(q))D(q),$(q,{mode:448});if(b(q)!==z(q))throw Error("worker_parent_not_canonical")}function u(j,q=A){let C=O(j,V.O_RDONLY|V.O_NOFOLLOW);try{let G=M(C);if(!G.isFile()||G.nlink!==1||!N(G)||G.size>q)throw Error("worker_file_not_private");return T(C,"utf8")}finally{L(C)}}function f(j,q,C=A){let G=JSON.stringify(q);if(G===void 0)throw Error("worker_file_invalid");let Q=G+`
|
|
3
|
-
`;if(Buffer.byteLength(Q,"utf8")>C)throw Error("worker_file_too_large");if(I(g(j)),J(j))u(j,C);let H=`${j}.${K()}`;try{Y(H,Q,{mode:384,flag:"wx"}),U(H,j)}finally{if(J(H))X(H)}}
|
|
4
|
-
export{J as xd,I as yd,u as zd,f as Ad};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var U=".reason/workspace",T="workspace_base",y="sessions",W="workspace_layout",g=".reason/workspace/sessions",B=/^[0-9a-f]{8}$/;function C(j){if(!J(j))return!1;let q=".reason/workspace/sessions/";if(!j.startsWith(q))return!1;let z=j.slice(q.length).split("/");return z.length===2&&B.test(z[0])}var G=4096,X="workspaces/pi";function J(j){if(typeof j!=="string"||!j||j.length>G)return!1;if(j.startsWith("/")||j.includes("\x00")||j.includes("\\"))return!1;return j.split("/").every((q)=>q!==""&&q!=="."&&q!=="..")}function Z(j){if(j.kind==="root"){if(j.path===void 0)return".";if(!J(j.path))throw Error("invalid_device_workspace_identity");return j.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(j.workspaceId)||j.workspaceId==="."||j.workspaceId==="..")throw Error("invalid_device_workspace_identity");let q=j.layout==="sessions"?"sessions":X;return`${j.base?`${j.base}/`:""}${q}/${j.workspaceId}/repo`}function L(j){if(!j||typeof j!=="object"||Array.isArray(j))return null;let q=j;if(q.kind==="root"&&Object.keys(q).length===1)return{kind:"root"};if(q.kind==="root"&&Object.keys(q).length===2&&J(q.path))return{kind:"root",path:q.path};if(q.kind!=="managed"||typeof q.workspaceId!=="string"||Object.keys(q).length!==2+(q.base===void 0?0:1)+(q.layout===void 0?0:1)||q.base!==void 0&&q.base!==".reason/workspace"||q.layout!==void 0&&q.layout!=="sessions")return null;let z={kind:"managed",workspaceId:q.workspaceId,...q.base===".reason/workspace"?{base:".reason/workspace"}:{},...q.layout==="sessions"?{layout:"sessions"}:{}};try{return Z(z),z}catch{return null}}var b="/home/runner",P=10001,x="/run/reason/sessions",f=/^(?:\/[A-Za-z0-9._-]+)+$/,M=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,H=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function K(j){return M.exec(j)?.[1]??H.exec(j)?.[1]??j}var $=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/,A="*/.reason/workspace/workspaces/pi/*|*/.reason/workspace/sessions/*";function N(j,q=b,z="sessions"){if(!f.test(q)||q.split("/").some((V)=>V==="."||V===".."))throw Error("invalid_cloud_payload_home");let Q=`${q}/${Z({kind:"managed",workspaceId:j,base:".reason/workspace",...z?{layout:z}:{}})}`,F=`${x}/${K(j)}`;return{home:q,root:Q.slice(0,-5),checkout:Q,control:F,jobEnv:`${F}/job.env`,cloudAccess:`${F}/cloud-access`,logs:`${F}/logs`,pin:`${F}/ws`}}function Y(j){return $.exec(j.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function D(j){return{kind:"managed",workspaceId:j,layout:"sessions"}}function R(j){let q=$.exec(j.replace(/\/+$/,""));if(!q)return null;try{let z=N(q[3],q[1],Y(j));return z.root===j.replace(/\/+$/,"")?z:null}catch{return null}}
|
|
3
|
-
export{U as bk,T as ck,y as dk,W as ek,g as fk,B as gk,C as hk,J as ik,Z as jk,L as kk,b as lk,P as mk,x as nk,M as ok,H as pk,$ as qk,A as rk,N as sk,Y as tk,D as uk,R as vk};
|