@reason-machines/cli-linux-arm64-musl 0.2.342 → 0.2.344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ara +1 -1
- package/bin/vm-hands/api-credentials-d34gw13p.js +2 -0
- package/bin/vm-hands/api-t5zxz49k.js +2 -0
- package/bin/vm-hands/{ask-relay-z5ykm780.js → ask-relay-mxa9m9t7.js} +2 -2
- package/bin/vm-hands/connect-cli-2y57w3qz.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-z6d216tn.js → custom-endpoint-device-syw4d5k4.js} +1 -1
- package/bin/vm-hands/desktop-account-pm3zxjjt.js +2 -0
- package/bin/vm-hands/{device-workspace-w5m2krzy.js → device-workspace-s49yhsk7.js} +1 -1
- package/bin/vm-hands/hands-worker-source-0ca76sbd.js +2 -0
- package/bin/vm-hands/{index-ab0khksc.js → index-t1h1wd8g.js} +1 -1
- package/bin/vm-hands/local-automation-6jtf5yd8.js +2 -0
- package/bin/vm-hands/local-capabilities-d0j8q80s.js +2 -0
- package/bin/vm-hands/local-desktop-users-zxw8xxw9.js +2 -0
- package/bin/vm-hands/local-display-mac-jdgx19jw.js +2 -0
- package/bin/vm-hands/local-display-session-ete43m8f.js +2 -0
- package/bin/vm-hands/local-pty-session-frp7k8fz.js +2 -0
- package/bin/vm-hands/{network-contract-6fvpv5h6.js → network-contract-q68zd3xf.js} +1 -1
- package/bin/vm-hands/package-vj1s3sye.js +2 -0
- package/bin/vm-hands/permissions-wxr58rza.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-4qavazs4.js → reason-hands-protocol-k12eme4q.js} +1 -1
- package/bin/vm-hands/status-re8wbb15.js +96 -0
- package/bin/vm-hands/version-bp278twg.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-xr02bw8t.js → vm-hands-entry-lite-0jar357h.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-crh2cy1q.js → vm-hands-entry-lite-0wyjnvjz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-967c5n18.js → vm-hands-entry-lite-1jhry648.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-6qfax5p2.js → vm-hands-entry-lite-1xjtcxpn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-84d59wrf.js → vm-hands-entry-lite-289bc9v7.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-0r5vmp7p.js → vm-hands-entry-lite-2xh7sjs0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-1rn52w4j.js → vm-hands-entry-lite-51rabw4s.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-k6e9bt1m.js → vm-hands-entry-lite-7ba3nhgv.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-h1dtacsm.js → vm-hands-entry-lite-84cwhsqh.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ffgjezmx.js → vm-hands-entry-lite-8ynztq9j.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5b29hq7h.js → vm-hands-entry-lite-9dx3at21.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-bjc5fdv3.js +42 -0
- package/bin/vm-hands/{vm-hands-entry-lite-ngpcdqxk.js → vm-hands-entry-lite-c1p0mz65.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-e26ht37z.js → vm-hands-entry-lite-f7g390b5.js} +26 -26
- package/bin/vm-hands/{vm-hands-entry-lite-2r9pdqzf.js → vm-hands-entry-lite-f8ss5hkt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-tbrwer33.js → vm-hands-entry-lite-fnefqcw4.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-9k93fyhy.js → vm-hands-entry-lite-gt5pkv4h.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hdmwe5bp.js → vm-hands-entry-lite-k1qw05mt.js} +104 -104
- package/bin/vm-hands/{vm-hands-entry-lite-f5m8cde2.js → vm-hands-entry-lite-k2cvr710.js} +14 -2
- package/bin/vm-hands/vm-hands-entry-lite-k2e3q5qj.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-t5h3g60g.js → vm-hands-entry-lite-k469tezz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-mybm2kyz.js → vm-hands-entry-lite-knfh7w3j.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-kt418g2w.js +5 -0
- package/bin/vm-hands/{vm-hands-entry-lite-84t0sxks.js → vm-hands-entry-lite-m16qf0yy.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hz2ww2qe.js → vm-hands-entry-lite-mhsv58hw.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-g0jhbxz4.js → vm-hands-entry-lite-mw2vtxm3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-7djq90d1.js → vm-hands-entry-lite-pa111vpq.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-n76c16jk.js → vm-hands-entry-lite-pnkfgnqz.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-rkmkv423.js +529 -0
- package/bin/vm-hands/{vm-hands-entry-lite-g3axe41b.js → vm-hands-entry-lite-tfpebnar.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-h01d2fbm.js → vm-hands-entry-lite-wmxksawm.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hbqq9f9a.js → vm-hands-entry-lite-x5az8qvp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-v674xqzd.js → vm-hands-entry-lite-x6jqyxkx.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-9p8gxetg.js → vm-hands-entry-lite-yeahy7rk.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-4g0e4grj.js → vm-hands-executor-evkgp60b.js} +1 -1
- package/bin/vm-hands/vm-hands-op-runner-brfr12s6.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-5t6s4k63.js → vm-hands-runtime-8c2ycaph.js} +3 -3
- package/bin/vm-hands/worker-sandbox-1kpm6af4.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-46arm6n3.js +0 -2
- package/bin/vm-hands/api-credentials-xt853vej.js +0 -2
- package/bin/vm-hands/connect-cli-w1wdrkp0.js +0 -2
- package/bin/vm-hands/desktop-account-ndf87vz8.js +0 -2
- package/bin/vm-hands/hands-worker-source-tv5dj6wm.js +0 -2
- package/bin/vm-hands/local-automation-we5k29ph.js +0 -2
- package/bin/vm-hands/local-capabilities-wnhek3h0.js +0 -2
- package/bin/vm-hands/local-desktop-users-qs13y705.js +0 -2
- package/bin/vm-hands/local-display-mac-nm4a2m36.js +0 -2
- package/bin/vm-hands/local-display-session-6fev7evp.js +0 -2
- package/bin/vm-hands/local-pty-session-fakj59cv.js +0 -2
- package/bin/vm-hands/package-vyhgakbw.js +0 -2
- package/bin/vm-hands/permissions-rp0ndr13.js +0 -2
- package/bin/vm-hands/status-k5f7hxcs.js +0 -96
- package/bin/vm-hands/version-tny61mj7.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-8tf0kw71.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ammwy4z8.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-ffa7xfss.js +0 -529
- package/bin/vm-hands/vm-hands-entry-lite-x6tft70v.js +0 -5
- package/bin/vm-hands/vm-hands-op-runner-9yh3qjrw.js +0 -2
- package/bin/vm-hands/worker-sandbox-w5jq1qzm.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{O as
|
|
2
|
+
import{Af as $}from"./vm-hands-entry-lite-51rabw4s.js";var O=$.version,Z=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function S(B,D){if(!Z.test(B)||!Z.test(D))throw Error("cannot compare invalid CLI versions");let J=(q)=>{let y=q.indexOf("-");return y===-1?[q,void 0]:[q.slice(0,y),q.slice(y+1)]},[j,F]=J(B),[w,G]=J(D),K=j.split(".").map(BigInt),M=w.split(".").map(BigInt);for(let q=0;q<3;q+=1){if(K[q]===M[q])continue;return K[q]<M[q]?-1:1}if(F===void 0||G===void 0){if(F===G)return 0;return F===void 0?1:-1}let Q=F.split("."),U=G.split("."),A=Math.max(Q.length,U.length);for(let q=0;q<A;q+=1){let y=Q[q],z=U[q];if(y===void 0||z===void 0){if(y===z)return 0;return y===void 0?-1:1}if(y===z)continue;let H=/^\d+$/.test(y),W=/^\d+$/.test(z);if(H&&W){let X=BigInt(y),Y=BigInt(z);if(X===Y)continue;return X<Y?-1:1}if(H!==W)return H?-1:1;return y<z?-1:1}return 0}function k(B,D){return D?`cli ${B} \xB7 agent ${D}`:`cli ${B}`}
|
|
3
|
+
export{O as wf,Z as xf,S as yf,k as zf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ge as xe}from"./vm-hands-entry-lite-bjc5fdv3.js";import{Ee as W,Fe as oe,He as _t,Ie as Ne,Le as St,Me as wt,Ne as $,We as z,Xe as Je}from"./vm-hands-entry-lite-x5az8qvp.js";import{af as Se}from"./vm-hands-entry-lite-pa111vpq.js";import{cf as Jt,ff as xt,if as Z,kf as zt,lf as ae}from"./vm-hands-entry-lite-c1p0mz65.js";import{Pf as Ae,Qf as se}from"./vm-hands-entry-lite-yeahy7rk.js";import{Ih as Ot,wh as v,yh as tt,zh as D}from"./vm-hands-entry-lite-1xjtcxpn.js";import{Oh as q}from"./vm-hands-entry-lite-9dx3at21.js";import{ni as pe,ti as ye}from"./vm-hands-entry-lite-0jar357h.js";import{ui as _}from"./vm-hands-entry-lite-gt5pkv4h.js";import{spawn as I}from"child_process";import{randomUUID as Oe}from"crypto";import{closeSync as Vr,copyFileSync as de,existsSync as ut,fstatSync as Er,mkdirSync as fe,openSync as vr,readdirSync as V,readFileSync as ge,readlinkSync as to,renameSync as eo,rmSync as ro,statSync as oo}from"fs";import{connect as so}from"net";import{userInfo as Te}from"os";import{basename as le,dirname as mt,join as b}from"path";var At=`import { spawn, execFileSync } from "node:child_process";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { readFileSync, readlinkSync, lstatSync, realpathSync, statSync, mkdtempSync, mkdirSync, chmodSync, writeFileSync, readdirSync, rmSync, openSync, readSync, closeSync, renameSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
@@ -757,4 +757,4 @@ WantedBy=default.target
|
|
|
757
757
|
`),1;if(t.length===1&&t[0]==="doctor"){let i=await(e.grants??Ae)(o);if(!i)return r.write(`Reason computer use: Reason's permissions could not be read (computer_use_permission_status_unavailable)
|
|
758
758
|
`),1;return(e.stdout??process.stdout).write(wo(i)),0}if(t.length!==1||t[0]!=="mcp")return r.write(`Usage: reason __computer-use mcp|doctor
|
|
759
759
|
`),2;let[a,...c]=o;return(e.run??xo)(a,[...c,s.ocu,"mcp"],{...process.env,OPEN_COMPUTER_USE_DISABLE_APP_AGENT_PROXY:"1"})}function Ks(t=$){return t()?.userChrome??{code:"user_chrome_browser_use_missing"}}function Ce(t,e,r,o){return new Promise((s)=>{let a=I(t,e,{env:r,stdio:"ignore"}),c=setTimeout(()=>{a.kill("SIGKILL"),s(-1)},o);a.once("error",()=>{clearTimeout(c),s(-1)}),a.once("exit",(i)=>{clearTimeout(c),s(i??-1)})})}function So(t,e,r,o){return new Promise((s)=>{let a=I(t,e,{env:r,stdio:["ignore","pipe","ignore"]}),c="";a.stdout.setEncoding("utf8").on("data",(d)=>{c+=d});let i=setTimeout(()=>{a.kill("SIGKILL"),s(null)},o);a.once("error",()=>{clearTimeout(i),s(null)}),a.once("close",(d)=>{clearTimeout(i),s(d===0?c:null)})})}var po="/tmp/open-browser-use",yo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,Ao=33554432;function No(t,e){let r;try{r=t===null?null:JSON.parse(t)}catch{return null}let o=H(r)&&H(r.result)?r.result.metadata:null;if(!H(o)||o.extensionId!==e)return null;return typeof o.extensionInstanceId==="string"&&yo.test(o.extensionInstanceId)?o.extensionInstanceId:null}async function Be(t,e,r){let o=r.storages.map((i)=>{try{return V(i).filter((d)=>d.endsWith(".log")||d.endsWith(".ldb")).map((d)=>b(i,d))}catch{return[]}}),s;try{s=o.some((i)=>i.length>0)?V(r.socketDir).filter((i)=>i.endsWith(".sock")):[]}catch{return[]}let a=[];for(let i of s){let d=b(r.socketDir,i),f=No(await So(t,["info","--socket",d,"--timeout","2s"],e,5000),r.extensionId);if(f)a.push({instance:f,socket:d})}let c=[];for(let[i,d]of(a.length>0?o:[]).entries())for(let f of d)try{if(oo(f).size>Ao)continue;let n=ge(f),l=a.find((u)=>n.includes(u.instance));if(l){c.push({storage:r.storages[i],...l});break}}catch{}return c}async function Oo(t,e,r){return(await Be(t,e,r))[0]?.instance??null}function Ie(t,e,r){return Oo(t,e,{socketDir:po,extensionId:_t,storages:[b(r,"browser-profile","Default","Local Extension Settings",_t)]})}var ue=/^(Default|Profile ([0-9]+))$/;async function go(t,e,r=q(),o=St){let s=b(r,"Library","Application Support","Google","Chrome"),a=[];try{a=V(s)}catch(n){if(n.code==="EPERM")throw new _("browser_use_chrome_access_denied","macOS blocked Reason from reading Chrome's profiles. Allow Full Disk Access for Reason on this Mac and try again.")}let c=(n)=>Number(ue.exec(n)?.[2]??-1),i=a.filter((n)=>ue.test(n)&&ut(b(s,n,"Extensions",W))).sort((n,l)=>c(n)-c(l)),d=(n)=>b(s,n,"Local Extension Settings",W);return(await Be(t,e,{socketDir:o,extensionId:W,storages:i.map(d)})).map(({storage:n,instance:l,socket:u})=>({profile:i.find((m)=>d(m)===n),instance:l,socket:u}))}async function To(t,e,r=q(),o=St){let s=(await go(t,e,r,o))[0]?.instance;if(!s)throw new _("automation_user_chrome_not_connected","No Chrome profile on this Mac is connected to Reason. Open Chrome with the Reason extension, then try again.");return s}function me(t){return new Promise((e)=>{let r=so({path:t}),o=(s)=>{r.destroy(),e(s)};r.setTimeout(1000,()=>o(!1)),r.once("error",()=>o(!1)),r.once("connect",()=>o(!0))})}async function $e(t,e){let r=Date.now()+e;while(Date.now()<r){if(await t())return!0;await new Promise((o)=>setTimeout(o,200))}return!1}var ft=new Map;function lt(t,e){let r=ft.get(t);if(!r)r=e().finally(()=>ft.delete(t)),ft.set(t,r);return r}async function qo(t,e){if(await me(t))return;if(ro(t,{force:!0}),await Ce("dbus-daemon",["--session",`--address=unix:path=${t}`,"--fork"],e,1e4)!==0||!await $e(()=>me(t),5000))throw new _("automation_unavailable","Reason could not start the desktop session bus.")}async function be(t,e,r){let o=t.platform==="darwin-arm64"?async()=>await Ie(t.nativeHost,e,r)!==null:async()=>await Ce(t.nativeHost,["info"],e,5000)===0;if(await o())return;let s=["--profile-directory=Default",`--load-extension=${t.extensionDir}`,"--no-first-run","--no-default-browser-check","--window-size=1280,800","about:blank"],a,c=null,i=0;if(t.platform==="darwin-arm64"){let n=b(r,"browser-profile");z(n);let l=b(n,"NativeMessagingHosts");fe(l,{recursive:!0,mode:448});let u=wt(t.platform).nativeHostManifests[0];de(u,b(l,le(u)));let m=t.browser.slice(0,t.browser.indexOf(".app/")+4),S=s.filter((B)=>B!=="about:blank").concat("--no-startup-window","--use-mock-keychain");a=I("/usr/bin/open",["-g","-n","-a",m,"--args",`--user-data-dir=${n}`,...S],{env:e,stdio:"ignore"})}else{let n=b(e.HOME,".config","google-chrome"),l=b(n,"NativeMessagingHosts");fe(l,{recursive:!0,mode:448});let u=wt(t.platform).nativeHostManifests[0];de(u,b(l,le(u)));let m=process.geteuid?.()===0?["--no-sandbox"]:[];c=b(r,"browser.log");let S=vr(c,"a",384);i=Er(S).size,a=I(t.browser,[`--user-data-dir=${n}`,...s,...m,"--force-renderer-accessibility"],{detached:!0,stdio:["ignore",S,S],env:{...e,ACCESSIBILITY_ENABLED:"1"}}),Vr(S)}let d=!1;a.once("error",()=>{d=!0}),a.once("exit",(n)=>{d||=n!==0}),a.unref();let f=!1;if(await $e(async()=>d||(f=await o()),_o),!f){if(c&&ge(c).subarray(i).toString("utf8").includes("No usable sandbox"))throw new _("automation_browser_sandbox_unavailable","Chromium found no usable sandbox on this machine. Run the worker as a non-root user with unprivileged user namespaces enabled, or in a container with seccomp unconfined.");throw new _("automation_browser_unavailable","Reason could not connect the desktop browser.")}}async function Vs(t){await Ge(t,!0)}function Es(t){return Fe(t,Re(t))}function Fe(t,e){return t.platform==="darwin-arm64"?b(e,"browser-profile"):b(e,"home",".config","google-chrome")}function Re(t){let e=b(t.root,"automation");if(!ut(e)||!Co(t.automation))return t.automation;if(!Bo(Fe(t,e)))try{eo(e,t.automation)}catch{}return ut(e)?e:t.automation}function Co(t){try{return V(t).length===0}catch(e){return e.code==="ENOENT"}}function Bo(t){let e;try{e=to(b(t,"SingletonLock"))}catch{return!1}let r=Number(e.slice(e.lastIndexOf("-")+1));if(!Number.isSafeInteger(r)||r<=0)return!0;try{return process.kill(r,0),!0}catch(o){return o.code==="EPERM"}}async function Ge(t,e){pe({root:t.root,automation:t.automation,extensionDir:t.extensionDir});let r=Re(t);z(r);let o=Te().username,s={USER:o,LOGNAME:o,REASON_AUTOMATION_OCU:t.ocu,REASON_AUTOMATION_OBU:t.nativeHost};if(t.platform==="darwin-arm64"){let n={...s,HOME:q(),PATH:`${mt(t.node)}:/usr/bin:/bin:/usr/sbin:/sbin`,REASON_AUTOMATION_OCU:process.execPath,REASON_AUTOMATION_OCU_SUBCOMMAND:bo};if(!e)return n;await lt("browser",()=>be(t,n,r));let l=await Ie(t.nativeHost,n,r);if(!l)throw new _("automation_browser_unavailable","Reason could not connect the desktop browser.");return{...n,REASON_AUTOMATION_OBU_INSTANCE:l,REASON_AUTOMATION_BACKGROUND_TABS:"1"}}let a=await Je(),c=b(r,"home"),i=b(r,"runtime");z(c),z(i);let d=b(r,"bus"),f={...s,HOME:c,PATH:`${mt(t.node)}:/usr/bin:/bin`,DISPLAY:a.display,XAUTHORITY:a.xauthority,XDG_RUNTIME_DIR:i,DBUS_SESSION_BUS_ADDRESS:`unix:path=${d}`,...a.sound?{PULSE_SERVER:Ne(a.sound)}:{}};if(await lt("bus",()=>qo(d,f)),e)await lt("browser",()=>be(t,f,r));return f}async function Io(t,e,r){let o=Te().username,s={USER:o,LOGNAME:o,HOME:q(),PATH:`${mt(t.node)}:/usr/bin:/bin:/usr/sbin:/sbin`,REASON_AUTOMATION_OBU:e,REASON_AUTOMATION_BACKGROUND_TABS:"1"},a=await To(e,s);return r.throwIfAborted(),{...s,REASON_AUTOMATION_OBU_INSTANCE:a}}function Ue(t,e,r,o){if(typeof _e!=="string")return Promise.reject(new _("automation_unavailable","This Reason build has no automation runtime."));let s=_e;return new Promise((a,c)=>{let i=I(t,["--input-type=module","--eval",s],{env:{...e,REASON_CLOUD_GATEWAY_EXEC:"1",REASON_AUTOMATION_INLINE_RESULT:"1"},stdio:["pipe","pipe","pipe"],detached:!0}),d=[],f=0,n="",l=null,u=!1,m=(w)=>{l??=w;try{process.kill(-i.pid,"SIGKILL")}catch{i.kill("SIGKILL")}},S=(w)=>{if(u)return;u=!0,clearTimeout(B),o.removeEventListener("abort",g),w()},B=setTimeout(()=>m(new _("automation_timed_out","Reason automation did not finish in time.")),no),g=()=>m(new _("cancelled","Reason cancelled the automation call."));if(o.addEventListener("abort",g,{once:!0}),i.stdout.on("data",(w)=>{if(f+=w.byteLength,f>ao)m(new _("automation_output_too_large","Reason automation output is too large."));else d.push(w)}),i.stderr.setEncoding("utf8").on("data",(w)=>{n=(n+w).slice(-io)}),i.stdin.on("error",()=>{}),i.once("error",()=>S(()=>c(l??new _("automation_unavailable","Reason could not start the automation runtime.")))),i.once("close",(w)=>S(()=>{if(l)c(l);else a({code:w??1,stdout:Buffer.concat(d),stderr:n})})),o.aborted)g();i.stdin.end(r)})}var C=new Map;function $o(t,e,r){for(let[s,a]of C)if(a.expiresAt<=r)C.delete(s);while(C.size>=lo)C.delete(C.keys().next().value);let o=Oe();return C.set(o,{runId:t,bytes:e,expiresAt:r+fo}),o}async function Le(t,e,r,o={}){let s=await(o.environment??Ge)(t,e.kind==="browser");return r.throwIfAborted(),await(o.runtime??Ue)(t.node,s,JSON.stringify(e),r)}async function vs(t,e){let r=qe({call:t});if(!("call"in r))K();let o=$();if(!o?.features.computer||r.call.kind==="browser"&&!o.features.browser)throw new _("automation_unavailable","Run `reason desktop install` on this machine to enable computer and browser use.");return await Le(o,r.call,e)}function we(t,e,r){let o=t.stdout.byteLength>bt?$o(e,t.stdout,r):void 0;return{code:t.code,stderr:t.stderr,instance_id:mo,output_bytes:t.stdout.byteLength,chunk:t.stdout.subarray(0,bt).toString("base64"),...o?{output_id:o}:{}}}async function ta(t,e={}){let r=qe(t.payload),o=(e.now??Date.now)();if("output_id"in r){let m=C.get(r.output_id);if(!m||m.runId!==t.runId||m.expiresAt<=o||r.offset>m.bytes.byteLength)throw new _("automation_output_unavailable","Reason automation output expired.");return{chunk:m.bytes.subarray(r.offset,r.offset+bt).toString("base64")}}let s=(e.components??$)(),a=(e.platform??process.platform)==="darwin",c=a?(e.macIdentity??xt)():[],i=e.macSetup??X,d=!s?.features.computer||r.call.kind==="browser"&&!r.userChrome&&!s.features.browser;if(a&&(d||c.length===0||r.call.kind==="browser"&&r.userChrome&&!t.userChrome))return we(await ce({runId:t.runId,call:r.call,identity:c,desktopMissing:d,signal:t.signal},i),t.runId,o);if(!s?.features.computer)throw new _("automation_unavailable","Run `reason desktop install` on this machine to enable computer and browser use.");let f=r.userChrome?t.userChrome:void 0;if(r.userChrome&&!f)throw new _("automation_user_chrome_unavailable","Your own Chrome is not enabled on this computer: run `reason desktop install` on this Mac (and `reason connect --user-chrome on` if you turned it off).");if(r.call.kind==="browser"&&!f&&!s.features.browser)throw new _("automation_browser_not_installed",s.platform==="darwin-arm64"?"Browser use is unavailable on this machine: re-run `reason desktop install`.":"Browser use is unavailable on this machine: install a non-snap Chromium at /usr/bin/chromium, then re-run `reason desktop install`.");t.signal.throwIfAborted();let n=await ye(t.runId,t.signal,e.now),l="account"in e?e.account??null:Se(),u;try{if(f){let m=await(e.userChromeEnvironment??Io)(s,f,t.signal);t.signal.throwIfAborted(),u=await(e.runtime??Ue)(s.node,m,JSON.stringify(r.call),t.signal)}else if(l)u=await(e.delegate??Nt)(l,r.call,t.signal);else u=await Le(s,r.call,t.signal,e)}finally{n()}if(a)u=await ne({runId:t.runId,call:r.call,identity:c,output:u,signal:t.signal},i);return we(u,t.runId,o)}
|
|
760
|
-
export{Ut as
|
|
760
|
+
export{Ut as Kc,at as Lc,Dt as Mc,A as Nc,Mt as Oc,cs as Pc,kt as Qc,ns as Rc,dt as Sc,Ur as Tc,ds as Uc,fs as Vc,ls as Wc,_s as Xc,us as Yc,ms as Zc,We as _c,bt as $c,qe as ad,Ws as bd,xo as cd,Hs as dd,Ks as ed,go as fd,To as gd,Vs as hd,Es as id,vs as jd,ta as kd};
|