@reason-machines/cli-linux-x64 0.2.568 → 0.2.570

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.
Files changed (76) hide show
  1. package/bin/reason +2 -2
  2. package/bin/vm-hands/agent-network-nswyx8m2.js +2 -0
  3. package/bin/vm-hands/{api-credentials-ntpwt7rg.js → api-credentials-kp2sjeds.js} +1 -1
  4. package/bin/vm-hands/api-h2pwjbr1.js +2 -0
  5. package/bin/vm-hands/{ask-relay-hfa5kzxn.js → ask-relay-eqv9sq9m.js} +2 -2
  6. package/bin/vm-hands/connect-cli-gc79h47t.js +2 -0
  7. package/bin/vm-hands/{credentials-nfx99zxr.js → credentials-gwh93z0q.js} +1 -1
  8. package/bin/vm-hands/{custom-endpoint-device-5047vdn3.js → custom-endpoint-device-fdemgypq.js} +1 -1
  9. package/bin/vm-hands/desktop-account-15zym6ze.js +2 -0
  10. package/bin/vm-hands/desktop-components-py12mt6g.js +2 -0
  11. package/bin/vm-hands/{hands-worker-source-8a4kh44t.js → hands-worker-source-vd87swg4.js} +1 -1
  12. package/bin/vm-hands/{install-receipt-rckwjqmt.js → install-receipt-7hvy0181.js} +1 -1
  13. package/bin/vm-hands/local-automation-bt51qn3g.js +2 -0
  14. package/bin/vm-hands/local-capabilities-q9jvmztz.js +2 -0
  15. package/bin/vm-hands/local-display-session-j807vr40.js +2 -0
  16. package/bin/vm-hands/local-display-video-3b5qegyk.js +2 -0
  17. package/bin/vm-hands/local-managed-process-48t1899b.js +2 -0
  18. package/bin/vm-hands/{local-pty-session-w0yhjdvz.js → local-pty-session-bk7pp5nb.js} +1 -1
  19. package/bin/vm-hands/{managed-runtime-e4cj6r2s.js → managed-runtime-v7fz5zzh.js} +1 -1
  20. package/bin/vm-hands/{network-auto-update-8f2745gk.js → network-auto-update-1pfqzgd6.js} +2 -2
  21. package/bin/vm-hands/{network-contract-ht0psj5j.js → network-contract-8fjtkgma.js} +1 -1
  22. package/bin/vm-hands/{network-sign-in-s00679q9.js → network-sign-in-xdx20n1p.js} +1 -1
  23. package/bin/vm-hands/{permissions-74rj58e1.js → permissions-19yptfxx.js} +1 -1
  24. package/bin/vm-hands/{reason-hands-protocol-9r62swp0.js → reason-hands-protocol-yga8dh1m.js} +1 -1
  25. package/bin/vm-hands/{serve-service-19s965ze.js → serve-service-1sp5n0cm.js} +1 -1
  26. package/bin/vm-hands/{status-099b2ec1.js → status-pbv2pezp.js} +6 -6
  27. package/bin/vm-hands/{version-avq09c5d.js → version-w7r1n5k3.js} +1 -1
  28. package/bin/vm-hands/{vm-hands-entry-lite-ksfd234v.js → vm-hands-entry-lite-10fwwbwj.js} +1 -1
  29. package/bin/vm-hands/{vm-hands-entry-lite-bbjsnjct.js → vm-hands-entry-lite-13pzgnj9.js} +1 -1
  30. package/bin/vm-hands/{vm-hands-entry-lite-fp3gaa2c.js → vm-hands-entry-lite-43ja1g10.js} +1 -1
  31. package/bin/vm-hands/{vm-hands-entry-lite-8s5n4wps.js → vm-hands-entry-lite-4x9p79j4.js} +1 -1
  32. package/bin/vm-hands/{vm-hands-entry-lite-vvhfaxpd.js → vm-hands-entry-lite-6dkjbe2b.js} +3 -3
  33. package/bin/vm-hands/{vm-hands-entry-lite-ezkb7f6j.js → vm-hands-entry-lite-7pj0tvht.js} +8 -8
  34. package/bin/vm-hands/{vm-hands-entry-lite-mktndd2r.js → vm-hands-entry-lite-7x2dnf35.js} +14 -14
  35. package/bin/vm-hands/{vm-hands-entry-lite-jm9jpj77.js → vm-hands-entry-lite-7z05qb3m.js} +11 -11
  36. package/bin/vm-hands/{vm-hands-entry-lite-bcz4qpp6.js → vm-hands-entry-lite-92qqzeas.js} +2 -2
  37. package/bin/vm-hands/{vm-hands-entry-lite-0xfme8gg.js → vm-hands-entry-lite-a4fn6ye1.js} +2 -2
  38. package/bin/vm-hands/vm-hands-entry-lite-a8pm6cqb.js +10 -0
  39. package/bin/vm-hands/{vm-hands-entry-lite-7jmt3q38.js → vm-hands-entry-lite-asyv9pk8.js} +2 -2
  40. package/bin/vm-hands/{vm-hands-entry-lite-t2rhwchw.js → vm-hands-entry-lite-cg84jcgd.js} +2 -2
  41. package/bin/vm-hands/{vm-hands-entry-lite-7aeqbfc8.js → vm-hands-entry-lite-ck130wm6.js} +2 -2
  42. package/bin/vm-hands/{vm-hands-entry-lite-vha0pf8k.js → vm-hands-entry-lite-ea3cts1t.js} +1 -1
  43. package/bin/vm-hands/{vm-hands-entry-lite-bt6skt4h.js → vm-hands-entry-lite-ef0ergar.js} +3 -3
  44. package/bin/vm-hands/{vm-hands-entry-lite-9meg54bs.js → vm-hands-entry-lite-epzkdacr.js} +4 -4
  45. package/bin/vm-hands/{vm-hands-entry-lite-3594pdj0.js → vm-hands-entry-lite-f6np7g11.js} +1 -1
  46. package/bin/vm-hands/{vm-hands-entry-lite-dhn0fs5e.js → vm-hands-entry-lite-g4e21m1g.js} +2 -2
  47. package/bin/vm-hands/{vm-hands-entry-lite-4kb5rq3d.js → vm-hands-entry-lite-hnsdwskm.js} +3 -3
  48. package/bin/vm-hands/{vm-hands-entry-lite-rpf4t8r4.js → vm-hands-entry-lite-m4zkvq9s.js} +15 -15
  49. package/bin/vm-hands/{vm-hands-entry-lite-kzygj0q8.js → vm-hands-entry-lite-mayj6bpv.js} +2 -2
  50. package/bin/vm-hands/{vm-hands-entry-lite-mzw2vcah.js → vm-hands-entry-lite-mkha0rqp.js} +96 -96
  51. package/bin/vm-hands/{vm-hands-entry-lite-1cdtev4n.js → vm-hands-entry-lite-pnx4zgd6.js} +1 -1
  52. package/bin/vm-hands/{vm-hands-entry-lite-bc9zq8gx.js → vm-hands-entry-lite-sk4qxvzq.js} +1 -1
  53. package/bin/vm-hands/{vm-hands-entry-lite-1as6h9ed.js → vm-hands-entry-lite-ttemn34n.js} +4 -4
  54. package/bin/vm-hands/{vm-hands-entry-lite-y2vqwds4.js → vm-hands-entry-lite-vgwm0t9m.js} +2 -2
  55. package/bin/vm-hands/{vm-hands-entry-lite-h5x725z8.js → vm-hands-entry-lite-w4vnk4tg.js} +6 -6
  56. package/bin/vm-hands/{vm-hands-entry-lite-8twdd0ff.js → vm-hands-entry-lite-yqzy5wp8.js} +1 -1
  57. package/bin/vm-hands/{vm-hands-entry-lite-2qh3rat2.js → vm-hands-entry-lite-ysmjfpef.js} +1 -1
  58. package/bin/vm-hands/{vm-hands-entry-lite-r131db1f.js → vm-hands-entry-lite-zhxpfb3n.js} +1 -1
  59. package/bin/vm-hands/{vm-hands-entry-lite-n9277v11.js → vm-hands-entry-lite-zm0707rq.js} +1 -1
  60. package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
  61. package/bin/vm-hands/{vm-hands-executor-xd8v5v0e.js → vm-hands-executor-e75we703.js} +1 -1
  62. package/bin/vm-hands/{vm-hands-op-runner-nr4ncs4p.js → vm-hands-op-runner-86zndw34.js} +1 -1
  63. package/bin/vm-hands/{vm-hands-runtime-qvy5s122.js → vm-hands-runtime-ad8q3cjr.js} +3 -3
  64. package/bin/vm-hands/{worker-sandbox-2trfs79b.js → worker-sandbox-6aepsk73.js} +1 -1
  65. package/package.json +1 -1
  66. package/bin/vm-hands/agent-network-dw7yrrwt.js +0 -2
  67. package/bin/vm-hands/api-xvjq0bka.js +0 -2
  68. package/bin/vm-hands/connect-cli-2ja7aj4w.js +0 -2
  69. package/bin/vm-hands/desktop-account-d1g1m6yb.js +0 -2
  70. package/bin/vm-hands/desktop-components-577haqrs.js +0 -2
  71. package/bin/vm-hands/local-automation-fxdb4ynz.js +0 -2
  72. package/bin/vm-hands/local-capabilities-8fgrfpj4.js +0 -2
  73. package/bin/vm-hands/local-display-session-8b2hx1k6.js +0 -2
  74. package/bin/vm-hands/local-display-video-511qjgmq.js +0 -2
  75. package/bin/vm-hands/local-managed-process-h0fypn67.js +0 -2
  76. package/bin/vm-hands/vm-hands-entry-lite-rd7bm9we.js +0 -10
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{R}from"./vm-hands-entry-lite-ys4jhf7n.js";import{w}from"./vm-hands-entry-lite-0xfme8gg.js";import{ot,cs,Mi,We}from"./vm-hands-entry-lite-8twdd0ff.js";import{ms,$n,jc}from"./vm-hands-entry-lite-2qh3rat2.js";import{B}from"./vm-hands-entry-lite-04nx5y4f.js";import{spawnSync as v}from"child_process";import{createHash as Se,randomUUID as we}from"crypto";import{chmodSync as $e,existsSync as T,mkdirSync as ye,readdirSync as Fe,readFileSync as p,renameSync as ve,rmSync as u,statSync as be,writeFileSync as Ae}from"fs";import{dirname as xe,isAbsolute as q,join as g}from"path";import{spawnSync as ue}from"child_process";import{readFileSync as me}from"fs";import{userInfo as O}from"os";import{join as fe}from"path";var ge="REASON_SCHEDULED_TASK";function Ni(r){return fe(r,"AppData","Local","Reason","Tasks")}function S(r){if(/[\0-\x1f\x7f"%]/.test(r))throw Error(`A background task cannot use a value with a double quote, percent sign or control character: ${r}`);return`'${r.replace(/['\u2018\u2019\u201a\u201b]/g,"$&$&")}'`}function D(r){if(!/^[A-Za-z0-9._-]+$/.test(r))throw Error(`Invalid Windows Scheduled Task name: ${r}`);return`$env:${ge}=${S(r)};`}function H(r){let e=Object.entries(r.environment).map(([t,i])=>{if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw Error(`Invalid Windows Scheduled Task environment name: ${t}`);return`$env:${t}=${S(i)};`}),n=`$global:LASTEXITCODE=1; & ${[r.program,...r.args].map(S).join(" ")} 2>&1 | ForEach-Object { Add-Content -LiteralPath ${S(r.log)} -Value $_.ToString() -Encoding UTF8 }; $c=$LASTEXITCODE;`;return[D(r.name),...e,"$ErrorActionPreference='Continue';",r.keepAlive?`do { ${n} if ($c) { Start-Sleep -Seconds 10 } } while ($c)`:`${n} exit $c`].join(" ")}function I(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function pe(){let r=process.env.USERDOMAIN?.trim();return r?`${r}\\${O().username}`:O().username}function M(r){let e=I(r.user??pe()),n=r.schedule==="logon",t=r.schedule==="logon"?`<LogonTrigger><Enabled>true</Enabled><UserId>${e}</UserId></LogonTrigger>`:`<TimeTrigger><Repetition><Interval>PT${r.schedule.everyMinutes}M</Interval><StopAtDurationEnd>false</StopAtDurationEnd></Repetition><StartBoundary>2026-01-01T00:00:00</StartBoundary><Enabled>true</Enabled></TimeTrigger>`,i=`-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -Command "${r.script}"`;return`<?xml version="1.0" encoding="UTF-16"?>
2
+ import{R}from"./vm-hands-entry-lite-ys4jhf7n.js";import{w}from"./vm-hands-entry-lite-a4fn6ye1.js";import{ot,cs,Mi,We}from"./vm-hands-entry-lite-yqzy5wp8.js";import{ms,$n,jc}from"./vm-hands-entry-lite-ysmjfpef.js";import{B}from"./vm-hands-entry-lite-04nx5y4f.js";import{spawnSync as v}from"child_process";import{createHash as ke,randomUUID as Se}from"crypto";import{chmodSync as we,existsSync as T,mkdirSync as $e,readdirSync as Fe,readFileSync as p,renameSync as ye,rmSync as u,statSync as ve,writeFileSync as be}from"fs";import{dirname as Ae,isAbsolute as q,join as g}from"path";import{spawnSync as ue}from"child_process";import{readFileSync as de}from"fs";import{userInfo as O}from"os";import{join as me}from"path";var fe="REASON_SCHEDULED_TASK";function Ni(r){return me(r,"AppData","Local","Reason","Tasks")}function S(r){if(/[\0-\x1f\x7f"%]/.test(r))throw Error(`A background task cannot use a value with a double quote, percent sign or control character: ${r}`);return`'${r.replace(/['\u2018\u2019\u201a\u201b]/g,"$&$&")}'`}function D(r){if(!/^[A-Za-z0-9._-]+$/.test(r))throw Error(`Invalid Windows Scheduled Task name: ${r}`);return`$env:${fe}=${S(r)};`}function H(r){let e=Object.entries(r.environment).map(([t,i])=>{if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw Error(`Invalid Windows Scheduled Task environment name: ${t}`);return`$env:${t}=${S(i)};`}),n=`$global:LASTEXITCODE=1; & ${[r.program,...r.args].map(S).join(" ")} 2>&1 | ForEach-Object { Add-Content -LiteralPath ${S(r.log)} -Value $_.ToString() -Encoding UTF8 }; $c=$LASTEXITCODE;`;return[D(r.name),...e,"$ErrorActionPreference='Continue';",r.keepAlive?`do { ${n} if ($c) { Start-Sleep -Seconds 10 } } while ($c)`:`${n} exit $c`].join(" ")}function I(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function ge(){let r=process.env.USERDOMAIN?.trim();return r?`${r}\\${O().username}`:O().username}function M(r){let e=I(r.user??ge()),n=r.schedule==="logon",t=r.schedule==="logon"?`<LogonTrigger><Enabled>true</Enabled><UserId>${e}</UserId></LogonTrigger>`:`<TimeTrigger><Repetition><Interval>PT${r.schedule.everyMinutes}M</Interval><StopAtDurationEnd>false</StopAtDurationEnd></Repetition><StartBoundary>2026-01-01T00:00:00</StartBoundary><Enabled>true</Enabled></TimeTrigger>`,i=`-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -Command "${r.script}"`;return`<?xml version="1.0" encoding="UTF-16"?>
3
3
  <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
4
4
  <RegistrationInfo>
5
5
  <Description>${I(r.description)}</Description>
@@ -37,17 +37,17 @@ import{R}from"./vm-hands-entry-lite-ys4jhf7n.js";import{w}from"./vm-hands-entry-
37
37
  `,`
38
38
  `).replaceAll(`
39
39
  `,`\r
40
- `),"utf16le")])}function U(r){let e=me(r);return(e[0]===255&&e[1]===254?e.subarray(2).toString("utf16le"):e.toString("utf8")).replaceAll(`\r
40
+ `),"utf16le")])}function U(r){let e=de(r);return(e[0]===255&&e[1]===254?e.subarray(2).toString("utf16le"):e.toString("utf8")).replaceAll(`\r
41
41
  `,`
42
42
  `)}function V(r,e){return["/Create","/TN",r,"/XML",e,"/F"]}function x(r){return["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",Buffer.from(r,"utf16le").toString("base64")]}function E(r){return`'*${D(r).replaceAll("'","''")}*'`}function _(r,e){return x(["$all = @(Get-CimInstance Win32_Process)",`$wrappers = @($all | ? { $_.ProcessId -ne $PID -and $_.CommandLine -like ${E(r)} })`,...e.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 ${e.tree?"/T ":""}/PID $_.ProcessId | Out-Null } }`].join(`
43
43
  `))}function F(r){return x(["$all = @(Get-CimInstance Win32_Process)",`$wrappers = @($all | ? { $_.ProcessId -ne $PID -and $_.CommandLine -like ${E(r)} })`,"foreach ($w in $wrappers) { if ($all | ? { $_.ParentProcessId -eq $w.ProcessId -and $_.Name -ne 'conhost.exe' }) { 'running'; exit 0 } }","exit 1"].join(`
44
44
  `))}function X(r,e=process.pid){let n=ue(B("powershell.exe"),x(["$all = @{}; Get-CimInstance Win32_Process | % { $all[[int]$_.ProcessId] = $_ }",`$p = $all[${Math.trunc(e)}]`,"for ($i = 0; $p -and $i -lt 64; $i++) {",` if ($p.CommandLine -like ${E(r)}) { 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 n.status===10?!0:n.status===11?!1:null}var ke="REASON_WORKER_SERVICE",Ee="worker_identity_unavailable";function de(r){return{platform:process.platform,home:r,uid:process.getuid?.(),command:(e,n)=>v(B(e),[...n],{stdio:"ignore"}).status??1,read:(e,n)=>{let t=v(B(e),[...n],{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4});return t.status===0?t.stdout:null},sleep:(e)=>Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e),workerIdentity:(e)=>jc(r,e),insideService:(e,n)=>_e(e,process.platform,process.getuid?.(),n)}}function _e(r,e,n,t=!0){if(process.env[ke]===r||process.env.XPC_SERVICE_NAME===r)return!0;if(e==="linux")try{return p("/proc/self/cgroup","utf8").includes(`/${r}.service`)}catch{return!0}if(e==="win32")return X(r)??t;if(e!=="darwin")return!1;if(typeof n!=="number")return!0;let i=v("/bin/launchctl",["print",`gui/${n}/${r}`],{encoding:"utf8",timeout:5000});if(i.status===Te)return!1;if(i.error||i.status!==0)return!0;let s=Number(/^\s*pid = (\d+)$/m.exec(i.stdout??"")?.[1]??0);if(!s)return!1;let a=process.pid;for(let o=0;o<64&&a>1;o+=1){if(a===s)return!0;let l=v("/bin/ps",["-o","ppid=","-p",String(a)],{encoding:"utf8",timeout:5000}),c=Number(l.stdout?.trim());if(l.error||l.status!==0||!Number.isSafeInteger(c)||c<=0)return!0;if(c===a)return!1;a=c}return a>1}var Te=113;class j extends Error{code;constructor(r,e){super(r);this.code=e}}function ze(r,e){if(!ee(r.home,r.platform))throw new j(Q);if(r.platform==="darwin")k(r);let n=We(ot(e,r.home)),t=w({env:e})==="staging",i=t?"ara-staging":"ara",s=[n?cs(n):null,R(e,"REASON_CLI_LAUNCHER_PATH")?.trim(),r.platform==="win32"?g(r.home,"AppData","Local","Reason",...t?["staging"]:[],"bin",t?"reason-staging.exe":"reason.exe"):g(r.home,".local","bin",i)];for(let a of s)try{if(a&&q(a)&&be(a).isFile())return Mi(a)}catch{}throw new j(`A background service runs the installed Reason launcher, which was not found. Install Reason with: ${r.platform==="win32"?"irm https://reasonmachines.com/install.ps1 | iex":"curl -fsSL https://reasonmachines.com/install | sh"}`,"worker_launcher_missing")}var P=/(<key>ProgramArguments<\/key>\s*<array>\n)((?:\s*<string>[^<]*<\/string>\n)*)(\s*<\/array>)/,y=new RegExp(`(\\n\\s*<key>${$n}</key>\\s*<string>)[^<]*(</string>)`),Pe=/(<key>EnvironmentVariables<\/key>\s*<dict>[\s\S]*?)(\n\s*<\/dict>)/;function Re(r){return r.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&apos;","'").replaceAll("&amp;","&")}function Y(r){let e=[...(P.exec(r)?.[2]??"").matchAll(/<string>([^<]*)<\/string>/g)].map((t)=>Re(t[1])),n=e[1]==="--run-worker"?e.slice(2):e;return n[0]?{launcher:n[0],args:n.slice(1)}:null}function J(r,e,n){let t=n.workerIdentity?.(r)??null;return{program:t?[t.executable,"--run-worker",r,...e]:[r,...e],identity:t}}function C(r){return r.map((e)=>` <string>${d(e)}</string>`).join(`
45
+ `)),{stdio:"ignore",timeout:15000,windowsHide:!0});return n.status===10?!0:n.status===11?!1:null}var xe="REASON_WORKER_SERVICE",Ee="worker_identity_unavailable";function pe(r){return{platform:process.platform,home:r,uid:process.getuid?.(),command:(e,n)=>v(B(e),[...n],{stdio:"ignore"}).status??1,read:(e,n)=>{let t=v(B(e),[...n],{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4});return t.status===0?t.stdout:null},sleep:(e)=>Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e),workerIdentity:(e)=>jc(r,e),insideService:(e,n)=>_e(e,process.platform,process.getuid?.(),n)}}function _e(r,e,n,t=!0){if(process.env[xe]===r||process.env.XPC_SERVICE_NAME===r)return!0;if(e==="linux")try{return p("/proc/self/cgroup","utf8").includes(`/${r}.service`)}catch{return!0}if(e==="win32")return X(r)??t;if(e!=="darwin")return!1;if(typeof n!=="number")return!0;let i=v("/bin/launchctl",["print",`gui/${n}/${r}`],{encoding:"utf8",timeout:5000});if(i.status===Te)return!1;if(i.error||i.status!==0)return!0;let s=Number(/^\s*pid = (\d+)$/m.exec(i.stdout??"")?.[1]??0);if(!s)return!1;let a=process.pid;for(let o=0;o<64&&a>1;o+=1){if(a===s)return!0;let l=v("/bin/ps",["-o","ppid=","-p",String(a)],{encoding:"utf8",timeout:5000}),c=Number(l.stdout?.trim());if(l.error||l.status!==0||!Number.isSafeInteger(c)||c<=0)return!0;if(c===a)return!1;a=c}return a>1}var Te=113;class j extends Error{code;constructor(r,e){super(r);this.code=e}}function ze(r,e){if(!ee(r.home,r.platform))throw new j(Q);if(r.platform==="darwin")k(r);let n=We(ot(e,r.home)),t=w({env:e})==="staging",i=t?"ara-staging":"ara",s=[n?cs(n):null,R(e,"REASON_CLI_LAUNCHER_PATH")?.trim(),r.platform==="win32"?g(r.home,"AppData","Local","Reason",...t?["staging"]:[],"bin",t?"reason-staging.exe":"reason.exe"):g(r.home,".local","bin",i)];for(let a of s)try{if(a&&q(a)&&ve(a).isFile())return Mi(a)}catch{}throw new j(`A background service runs the installed Reason launcher, which was not found. Install Reason with: ${r.platform==="win32"?"irm https://reasonmachines.com/install.ps1 | iex":"curl -fsSL https://reasonmachines.com/install | sh"}`,"worker_launcher_missing")}var P=/(<key>ProgramArguments<\/key>\s*<array>\n)((?:\s*<string>[^<]*<\/string>\n)*)(\s*<\/array>)/,y=new RegExp(`(\\n\\s*<key>${$n}</key>\\s*<string>)[^<]*(</string>)`),Pe=/(<key>EnvironmentVariables<\/key>\s*<dict>[\s\S]*?)(\n\s*<\/dict>)/;function Re(r){return r.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&apos;","'").replaceAll("&amp;","&")}function Y(r){let e=[...(P.exec(r)?.[2]??"").matchAll(/<string>([^<]*)<\/string>/g)].map((t)=>Re(t[1])),n=e[1]==="--run-worker"?e.slice(2):e;return n[0]?{launcher:n[0],args:n.slice(1)}:null}function J(r,e,n){let t=n.workerIdentity?.(r)??null;return{program:t?[t.executable,"--run-worker",r,...e]:[r,...e],identity:t}}function C(r){return r.map((e)=>` <string>${d(e)}</string>`).join(`
46
46
  `)}function z(r,e){let n;try{n=p(r,"utf8")}catch{return null}let t=Y(n);if(!t)return null;let i=q(t.launcher)?Mi(t.launcher):t.launcher,{program:s,identity:a}=J(i,t.args,e),o=n.replace(P,(l,c,m,L)=>`${c}${C(s)}
47
47
  ${L}`);if(!a)o=o.replace(y,"");else if(y.test(o))o=o.replace(y,(l,c,m)=>`${c}${d(a.app)}${m}`);else o=o.replace(Pe,(l,c,m)=>`${c}
48
48
  <key>${$n}</key>
49
- <string>${d(a.app)}</string>${m}`);return o===n?null:o}function Ce(r,e){let n=z(r,e);if(n!==null)A(r,n)}function is(r,e,n){if(e.platform!=="darwin")return!1;let t=qe(r,e,n);return t!==null&&z(t.definition,e)!==null}var W="com.reasonmachines.worker.",h="so.reason.worker.",Z=[W,h];function kn(r,e=W){return`${e}connect${r==="production"?"":`.${r}`}`}function os(r,e){return Z.some((n)=>r===kn(e,n))}function he(r,e,n){if(e==="connect")return kn(r.channel,n);let t=Se("sha256").update(r.workspaceRoot).digest("hex").slice(0,8);return`${n}${r.name.toLowerCase()}.${t}`}var Q="A background service needs macOS (launchd), Linux (systemd --user) or Windows (Task Scheduler).";function ee(r,e){if(e==="darwin")return{directory:g(r,"Library","LaunchAgents"),suffix:".plist"};if(e==="linux")return{directory:g(r,".config","systemd","user"),suffix:".service"};if(e==="win32")return{directory:Ni(r),suffix:".xml"};return null}function f(r,e,n,t=W){let i=he(r,n,t),s=ee(e.home,e.platform);if(!s)return null;return{label:i,definition:g(s.directory,`${i}${s.suffix}`),logs:e.platform==="linux"?`journalctl --user -u ${i}.service`:g(r.stateDirectory,"service.log")}}function qe(r,e,n="serve"){return re(r,e,n)[0]??null}function re(r,e,n){return Z.map((t)=>f(r,e,n,t)).filter((t)=>t!==null&&T(t.definition))}function ne(r,e,n){let t=f(r,e,n,h);return t&&T(t.definition)?t:null}function Li(r,e,n){let t=f(r,e,n),i=ne(r,e,n);if(!t||!i||!T(t.definition)||e.insideService?.(i.label))return null;if(!Ne(t,e))return"current_not_running";if(e.platform==="darwin"){if(typeof e.uid==="number"&&e.uid>0)e.command("/bin/launchctl",["bootout",`gui/${e.uid}/${i.label}`]);return u(i.definition,{force:!0}),"retired"}if(e.platform==="win32")return b(i,e,!0),"retired";return e.command("systemctl",["--user","disable","--now",`${i.label}.service`]),u(i.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"]),"retired"}function Ne(r,e){if(e.platform==="darwin")return typeof e.uid==="number"&&e.uid>0&&e.command("/bin/launchctl",["print",`gui/${e.uid}/${r.label}`])===0;if(e.platform==="win32")return e.command("schtasks",["/Query","/TN",r.label])===0;let n=`${r.label}.service`;return e.command("systemctl",["--user","is-enabled","--quiet",n])===0&&Le.has(e.read("systemctl",["--user","show","--property=ActiveState","--value",n])?.trim()??"")}var Le=new Set(["active","activating","reloading"]);function $i(r,e){if(e.platform==="darwin"){if(typeof e.uid!=="number"||e.uid<=0)return!1;let n=e.read("/bin/launchctl",["print",`gui/${e.uid}/${r.label}`]);return Number(/^\s*pid = (\d+)$/m.exec(n??"")?.[1]??0)>0}if(e.platform==="win32")return e.read("powershell.exe",F(r.label))?.trim()==="running";return Number(e.read("systemctl",["--user","show","--property=MainPID","--value",`${r.label}.service`])?.trim()??0)>0}function ss(r){let{config:e,launcher:n,host:t,kind:i}=r,s=f(e,t,i);if(!s)return!1;let a;try{a=t.platform==="win32"?U(s.definition):p(s.definition,"utf8")}catch{return!1}if(t.platform==="win32")return a===oe(e,i,s,n);if(t.platform!=="darwin")return a===ie(e,i,s,n,t.home,r.path);let o=Y(a);return a.replace(y,"").replace(P,(c,m,L,ce)=>`${m}${o?`${C([o.launcher,...o.args])}
50
- `:""}${ce}`)===te(e,i,s,n,{...t,workerIdentity:()=>null},r.path).plist}function N(r,e){if(e==="connect")return{args:["connect"],environment:{REASON_CLI_CHANNEL:r.channel},description:"Reason connection of this computer"};return{args:["serve",r.name,"--dir",r.workspaceRoot,...r.executionMode==="confined"?["--sandbox"]:[]],environment:{},description:`Reason machine ${r.name} worker`}}function d(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function G(r,e=!1){if(/[\0-\x1f\x7f]/.test(r))throw new j("A background service cannot use a path with control characters.");let n=r.replaceAll("\\","\\\\").replaceAll('"',"\\\"").replaceAll("%","%%");return`"${e?n.replaceAll("$","$$$$"):n}"`}function te(r,e,n,t,i,s){let a=N(r,e),o=J(t,a.args,i),l={HOME:i.home,PATH:s,[ke]:n.label,...a.environment,...o.identity?{[$n]:o.identity.app}:{}};return{identity:o.identity,plist:`<?xml version="1.0" encoding="UTF-8"?>
49
+ <string>${d(a.app)}</string>${m}`);return o===n?null:o}function Ce(r,e){let n=z(r,e);if(n!==null)A(r,n)}function is(r,e,n){if(e.platform!=="darwin")return!1;let t=qe(r,e,n);return t!==null&&z(t.definition,e)!==null}var W="com.reasonmachines.worker.",h="so.reason.worker.",Z=[W,h];function kn(r,e=W){return`${e}connect${r==="production"?"":`.${r}`}`}function os(r,e){return Z.some((n)=>r===kn(e,n))}function he(r,e,n){if(e==="connect")return kn(r.channel,n);let t=ke("sha256").update(r.workspaceRoot).digest("hex").slice(0,8);return`${n}${r.name.toLowerCase()}.${t}`}var Q="A background service needs macOS (launchd), Linux (systemd --user) or Windows (Task Scheduler).";function ee(r,e){if(e==="darwin")return{directory:g(r,"Library","LaunchAgents"),suffix:".plist"};if(e==="linux")return{directory:g(r,".config","systemd","user"),suffix:".service"};if(e==="win32")return{directory:Ni(r),suffix:".xml"};return null}function f(r,e,n,t=W){let i=he(r,n,t),s=ee(e.home,e.platform);if(!s)return null;return{label:i,definition:g(s.directory,`${i}${s.suffix}`),logs:e.platform==="linux"?`journalctl --user -u ${i}.service`:g(r.stateDirectory,"service.log")}}function qe(r,e,n="serve"){return re(r,e,n)[0]??null}function re(r,e,n){return Z.map((t)=>f(r,e,n,t)).filter((t)=>t!==null&&T(t.definition))}function ne(r,e,n){let t=f(r,e,n,h);return t&&T(t.definition)?t:null}function Li(r,e,n){let t=f(r,e,n),i=ne(r,e,n);if(!t||!i||!T(t.definition)||e.insideService?.(i.label))return null;if(!Ne(t,e))return"current_not_running";if(e.platform==="darwin"){if(typeof e.uid==="number"&&e.uid>0)e.command("/bin/launchctl",["bootout",`gui/${e.uid}/${i.label}`]);return u(i.definition,{force:!0}),"retired"}if(e.platform==="win32")return b(i,e,!0),"retired";return e.command("systemctl",["--user","disable","--now",`${i.label}.service`]),u(i.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"]),"retired"}function Ne(r,e){if(e.platform==="darwin")return typeof e.uid==="number"&&e.uid>0&&e.command("/bin/launchctl",["print",`gui/${e.uid}/${r.label}`])===0;if(e.platform==="win32")return e.command("schtasks",["/Query","/TN",r.label])===0;let n=`${r.label}.service`;return e.command("systemctl",["--user","is-enabled","--quiet",n])===0&&Le.has(e.read("systemctl",["--user","show","--property=ActiveState","--value",n])?.trim()??"")}var Le=new Set(["active","activating","reloading"]);function $i(r,e){if(e.platform==="darwin"){if(typeof e.uid!=="number"||e.uid<=0)return!1;let n=e.read("/bin/launchctl",["print",`gui/${e.uid}/${r.label}`]);return Number(/^\s*pid = (\d+)$/m.exec(n??"")?.[1]??0)>0}if(e.platform==="win32")return e.read("powershell.exe",F(r.label))?.trim()==="running";return Number(e.read("systemctl",["--user","show","--property=MainPID","--value",`${r.label}.service`])?.trim()??0)>0}function ss(r){let{config:e,launcher:n,host:t,kind:i}=r,s=f(e,t,i);if(!s)return!1;let a;try{a=t.platform==="win32"?U(s.definition):p(s.definition,"utf8")}catch{return!1}if(t.platform==="win32")return a===oe(e,i,s,n);if(t.platform!=="darwin")return a===ie(e,i,s,n,t.home,r.path);let o=Y(a);return a.replace(y,"").replace(P,(c,m,L,ce)=>`${m}${o?`${C([o.launcher,...o.args])}
50
+ `:""}${ce}`)===te(e,i,s,n,{...t,workerIdentity:()=>null},r.path).plist}function N(r,e){if(e==="connect")return{args:["connect"],environment:{REASON_CLI_CHANNEL:r.channel},description:"Reason connection of this computer"};return{args:["serve",r.name,"--dir",r.workspaceRoot,...r.executionMode==="confined"?["--sandbox"]:[]],environment:{},description:`Reason machine ${r.name} worker`}}function d(r){return r.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function G(r,e=!1){if(/[\0-\x1f\x7f]/.test(r))throw new j("A background service cannot use a path with control characters.");let n=r.replaceAll("\\","\\\\").replaceAll('"',"\\\"").replaceAll("%","%%");return`"${e?n.replaceAll("$","$$$$"):n}"`}function te(r,e,n,t,i,s){let a=N(r,e),o=J(t,a.args,i),l={HOME:i.home,PATH:s,[xe]:n.label,...a.environment,...o.identity?{[$n]:o.identity.app}:{}};return{identity:o.identity,plist:`<?xml version="1.0" encoding="UTF-8"?>
51
51
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
52
52
  <plist version="1.0">
53
53
  <dict>
@@ -93,7 +93,7 @@ Description=${a.description}
93
93
 
94
94
  [Service]
95
95
  ExecStart=${[t,...a.args].map((o)=>G(o,!0)).join(" ")}
96
- Environment=${[`HOME=${i}`,`PATH=${s}`,`${ke}=${n.label}`,...Object.entries(a.environment).map(([o,l])=>`${o}=${l}`)].map((o)=>G(o)).join(" ")}
96
+ Environment=${[`HOME=${i}`,`PATH=${s}`,`${xe}=${n.label}`,...Object.entries(a.environment).map(([o,l])=>`${o}=${l}`)].map((o)=>G(o)).join(" ")}
97
97
  Restart=on-failure
98
98
  RestartSec=10
99
99
  TimeoutStopSec=${Math.ceil(r.shutdownGraceMs/1000)+10}
@@ -101,5 +101,5 @@ UMask=0077
101
101
 
102
102
  [Install]
103
103
  WantedBy=default.target
104
- `}function oe(r,e,n,t){let i=N(r,e);return M({description:i.description,schedule:"logon",script:H({name:n.label,program:t,args:i.args,environment:{[ke]:n.label,...i.environment},log:n.logs,keepAlive:!0})})}function se(r,e,n){e.command("powershell.exe",_(r.label,{tree:n,keepWrapper:!n}))}function b(r,e,n){e.command("schtasks",["/Delete","/F","/TN",r.label]),e.command("powershell.exe",_(r.label,{tree:n,keepWrapper:!1})),u(r.definition,{force:!0})}function A(r,e){ye(xe(r),{recursive:!0,mode:448});let n=`${r}.${we()}.tmp`;try{Ae(n,e,{mode:384,flag:"wx"}),$e(n,384),ve(n,r)}finally{u(n,{force:!0})}}function k(r){if(typeof r.uid!=="number"||!Number.isSafeInteger(r.uid)||r.uid<=0)throw new j("Set up a background service as your own user, not with sudo.","worker_service_root_user");return`gui/${r.uid}`}function xn(r){let{config:e,launcher:n,host:t}=r,i=r.kind??"serve",s=ne(e,t,i),a=s!==null&&t.insideService?.(s.label)===!0,o=f(e,t,i,a?h:W);if(!o)throw new j(Q);if(t.platform==="darwin")k(t);if(t.platform==="linux"&&t.command("systemctl",["--user","show-environment"])!==0)throw new j("No background service here: this computer has no systemd user session.","worker_service_manager_missing");let l=t.platform==="darwin"?te(e,i,o,n,t,r.path):null;if(A(o.definition,l?l.plist:t.platform==="win32"?K(oe(e,i,o,n)):ie(e,i,o,n,t.home,r.path)),ae(e,t,o,a?null:s),l)return l.identity?o:{...o,identityProblem:Ee};if(t.platform==="win32")return o;return{...o,lingering:t.command("loginctl",["enable-linger"])===0}}function ae(r,e,n,t){if(e.platform==="darwin"){let a=k(e);if(t)e.command("/bin/launchctl",["bootout",`${a}/${t.label}`]);if(le(r,n,e)){if(t)u(t.definition,{force:!0});return}if(u(n.definition,{force:!0}),t)e.command("/bin/launchctl",["bootstrap",a,t.definition]);throw new j("Could not start the background service (launchctl bootstrap failed).","worker_service_start_failed")}if(e.platform==="win32"){if(t)b(t,e,!0);if(e.command("schtasks",V(n.label,n.definition))===0){if(se(n,e,e.insideService?.(n.label)!==!0),e.command("schtasks",["/Run","/TN",n.label])===0)return}throw b(n,e,!0),new j("Could not start the background service (schtasks failed).")}let i=`${n.label}.service`,s=t?`${t.label}.service`:null;if(e.command("systemctl",["--user","daemon-reload"])!==0||s!==null&&e.command("systemctl",["--user","disable","--now",s])!==0||e.command("systemctl",["--user","enable",i])!==0||e.command("systemctl",["--user","restart",i])!==0){if(e.command("systemctl",["--user","disable",i]),u(n.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"]),s)e.command("systemctl",["--user","enable","--now",s]);throw new j("Could not start the background service (systemctl --user failed).","worker_service_start_failed")}if(t)u(t.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"])}function le(r,e,n){let t=k(n);n.command("/bin/launchctl",["bootout",`${t}/${e.label}`]);let i=(Math.ceil(r.shutdownGraceMs/1000)+10)*1000;for(let s=0,a=100;;a=Math.min(a*2,2000)){if(n.command("/bin/launchctl",["bootstrap",t,e.definition])===0)return!0;if(s>=i)return!1;n.sleep(a),s+=a}}function Ie(r,e,n){let t=qe(r,e,n);if(!t)return null;let i=e.insideService?.(t.label)===!0;if(e.platform==="darwin"&&!i)Ce(t.definition,e);let s=f(r,e,n);if(s&&t.label!==s.label&&!i)return A(s.definition,p(t.definition,"utf8").replaceAll(t.label,s.label)),ae(r,e,s,t),s;let a=e.platform==="darwin"&&i,o;if(e.platform==="win32")se(t,e,!i),o=e.command("schtasks",["/Run","/TN",t.label])===0;else if(a)o=e.command("/bin/launchctl",["kickstart","-k",`${k(e)}/${t.label}`])===0;else if(e.platform==="darwin")o=le(r,t,e);else e.command("systemctl",["--user","enable",`${t.label}.service`]),o=e.command("systemctl",["--user","restart",`${t.label}.service`])===0;if(!o)throw new j(`Could not restart the background service ${t.label}.`,"worker_service_restart_failed");if(s&&t.label===s.label)Li(r,e,n);return t}function as(r,e,n,t){let i=qe(r,n,t),s=f(e,n,t);if(n.platform!=="darwin"||!i||!s)return;let a=`<string>${d(i.logs)}</string>`,o=p(i.definition,"utf8");if(o.includes(a))A(i.definition,o.replaceAll(a,`<string>${d(s.logs)}</string>`))}function Cn(r,e,n="serve"){let t=re(r,e,n);for(let i of t){if(e.platform==="win32"){b(i,e,e.insideService?.(i.label,!1)!==!0);continue}if(e.platform==="darwin"){if(typeof e.uid==="number"&&e.uid>0)e.command("/bin/launchctl",["bootout",`gui/${e.uid}/${i.label}`]);u(i.definition,{force:!0});continue}e.command("systemctl",["--user","disable","--now",`${i.label}.service`]),u(i.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"])}return t[0]??null}
105
- export{Ni,ke,de,j,ze,is,kn,os,qe,Li,$i,ss,xn,Ie,as,Cn};
104
+ `}function oe(r,e,n,t){let i=N(r,e);return M({description:i.description,schedule:"logon",script:H({name:n.label,program:t,args:i.args,environment:{[xe]:n.label,...i.environment},log:n.logs,keepAlive:!0})})}function se(r,e,n){e.command("powershell.exe",_(r.label,{tree:n,keepWrapper:!n}))}function b(r,e,n){e.command("schtasks",["/Delete","/F","/TN",r.label]),e.command("powershell.exe",_(r.label,{tree:n,keepWrapper:!1})),u(r.definition,{force:!0})}function A(r,e){$e(Ae(r),{recursive:!0,mode:448});let n=`${r}.${Se()}.tmp`;try{be(n,e,{mode:384,flag:"wx"}),we(n,384),ye(n,r)}finally{u(n,{force:!0})}}function k(r){if(typeof r.uid!=="number"||!Number.isSafeInteger(r.uid)||r.uid<=0)throw new j("Set up a background service as your own user, not with sudo.","worker_service_root_user");return`gui/${r.uid}`}function xn(r){let{config:e,launcher:n,host:t}=r,i=r.kind??"serve",s=ne(e,t,i),a=s!==null&&t.insideService?.(s.label)===!0,o=f(e,t,i,a?h:W);if(!o)throw new j(Q);if(t.platform==="darwin")k(t);if(t.platform==="linux"&&t.command("systemctl",["--user","show-environment"])!==0)throw new j("No background service here: this computer has no systemd user session.","worker_service_manager_missing");let l=t.platform==="darwin"?te(e,i,o,n,t,r.path):null;if(A(o.definition,l?l.plist:t.platform==="win32"?K(oe(e,i,o,n)):ie(e,i,o,n,t.home,r.path)),ae(e,t,o,a?null:s),l)return l.identity?o:{...o,identityProblem:Ee};if(t.platform==="win32")return o;return{...o,lingering:t.command("loginctl",["enable-linger"])===0}}function ae(r,e,n,t){if(e.platform==="darwin"){let a=k(e);if(t)e.command("/bin/launchctl",["bootout",`${a}/${t.label}`]);if(le(r,n,e)){if(t)u(t.definition,{force:!0});return}if(u(n.definition,{force:!0}),t)e.command("/bin/launchctl",["bootstrap",a,t.definition]);throw new j("Could not start the background service (launchctl bootstrap failed).","worker_service_start_failed")}if(e.platform==="win32"){if(t)b(t,e,!0);if(e.command("schtasks",V(n.label,n.definition))===0){if(se(n,e,e.insideService?.(n.label)!==!0),e.command("schtasks",["/Run","/TN",n.label])===0)return}throw b(n,e,!0),new j("Could not start the background service (schtasks failed).")}let i=`${n.label}.service`,s=t?`${t.label}.service`:null;if(e.command("systemctl",["--user","daemon-reload"])!==0||s!==null&&e.command("systemctl",["--user","disable","--now",s])!==0||e.command("systemctl",["--user","enable",i])!==0||e.command("systemctl",["--user","restart",i])!==0){if(e.command("systemctl",["--user","disable",i]),u(n.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"]),s)e.command("systemctl",["--user","enable","--now",s]);throw new j("Could not start the background service (systemctl --user failed).","worker_service_start_failed")}if(t)u(t.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"])}function le(r,e,n){let t=k(n);n.command("/bin/launchctl",["bootout",`${t}/${e.label}`]);let i=(Math.ceil(r.shutdownGraceMs/1000)+10)*1000;for(let s=0,a=100;;a=Math.min(a*2,2000)){if(n.command("/bin/launchctl",["bootstrap",t,e.definition])===0)return!0;if(s>=i)return!1;n.sleep(a),s+=a}}function Ie(r,e,n){let t=qe(r,e,n);if(!t)return null;let i=e.insideService?.(t.label)===!0;if(e.platform==="darwin"&&!i)Ce(t.definition,e);let s=f(r,e,n);if(s&&t.label!==s.label&&!i)return A(s.definition,p(t.definition,"utf8").replaceAll(t.label,s.label)),ae(r,e,s,t),s;let a=e.platform==="darwin"&&i,o;if(e.platform==="win32")se(t,e,!i),o=e.command("schtasks",["/Run","/TN",t.label])===0;else if(a)o=e.command("/bin/launchctl",["kickstart","-k",`${k(e)}/${t.label}`])===0;else if(e.platform==="darwin")o=le(r,t,e);else e.command("systemctl",["--user","enable",`${t.label}.service`]),o=e.command("systemctl",["--user","restart",`${t.label}.service`])===0;if(!o)throw new j(`Could not restart the background service ${t.label}.`,"worker_service_restart_failed");if(s&&t.label===s.label)Li(r,e,n);return t}function as(r,e,n,t){let i=qe(r,n,t),s=f(e,n,t);if(n.platform!=="darwin"||!i||!s)return;let a=`<string>${d(i.logs)}</string>`,o=p(i.definition,"utf8");if(o.includes(a))A(i.definition,o.replaceAll(a,`<string>${d(s.logs)}</string>`))}function Cn(r,e,n="serve"){let t=re(r,e,n);for(let i of t){if(e.platform==="win32"){b(i,e,e.insideService?.(i.label,!1)!==!0);continue}if(e.platform==="darwin"){if(typeof e.uid==="number"&&e.uid>0)e.command("/bin/launchctl",["bootout",`gui/${e.uid}/${i.label}`]);u(i.definition,{force:!0});continue}e.command("systemctl",["--user","disable","--now",`${i.label}.service`]),u(i.definition,{force:!0}),e.command("systemctl",["--user","daemon-reload"])}return t[0]??null}
105
+ export{Ni,xe,pe,j,ze,is,kn,os,qe,Li,$i,ss,xn,Ie,as,Cn};