@reason-machines/cli-linux-x64 0.2.563 → 0.2.565

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 (44) hide show
  1. package/bin/reason +1 -1
  2. package/bin/vm-hands/{agent-network-3stvmqsj.js → agent-network-mnv1fm1c.js} +1 -1
  3. package/bin/vm-hands/{api-credentials-3wwkpts2.js → api-credentials-082cnpn9.js} +1 -1
  4. package/bin/vm-hands/{api-9xm5e4g9.js → api-sq672f51.js} +1 -1
  5. package/bin/vm-hands/{ask-relay-5f92e4c5.js → ask-relay-v5btnjvb.js} +2 -2
  6. package/bin/vm-hands/connect-cli-rxb3qtra.js +2 -0
  7. package/bin/vm-hands/{desktop-components-p0zx6qxg.js → desktop-components-099xyxmz.js} +1 -1
  8. package/bin/vm-hands/{local-automation-0a7enct8.js → local-automation-7pjd5nc1.js} +1 -1
  9. package/bin/vm-hands/{local-capabilities-d3ycjdyg.js → local-capabilities-ha0ey4zh.js} +1 -1
  10. package/bin/vm-hands/{local-display-session-pc85z6mg.js → local-display-session-0mkswxgk.js} +1 -1
  11. package/bin/vm-hands/local-display-video-c3fk87c5.js +2 -0
  12. package/bin/vm-hands/{local-managed-process-ka331rcr.js → local-managed-process-ahr2jync.js} +1 -1
  13. package/bin/vm-hands/{managed-runtime-nwj7cn7c.js → managed-runtime-shzb3tr3.js} +1 -1
  14. package/bin/vm-hands/{network-auto-update-tk104maa.js → network-auto-update-3m94436w.js} +2 -2
  15. package/bin/vm-hands/{network-sign-in-t9ng36rs.js → network-sign-in-xm79s170.js} +2 -2
  16. package/bin/vm-hands/{permissions-ywh8x4dq.js → permissions-scffy1px.js} +1 -1
  17. package/bin/vm-hands/{serve-service-43kmwskj.js → serve-service-grp91ybk.js} +1 -1
  18. package/bin/vm-hands/{status-ec366bs8.js → status-89999mdn.js} +3 -3
  19. package/bin/vm-hands/{version-6ys9zwbj.js → version-wyshazh7.js} +1 -1
  20. package/bin/vm-hands/{vm-hands-entry-lite-srtqjjqb.js → vm-hands-entry-lite-1eyg750p.js} +1 -1
  21. package/bin/vm-hands/{vm-hands-entry-lite-jgwjt10t.js → vm-hands-entry-lite-1xhpn3hw.js} +1 -1
  22. package/bin/vm-hands/{vm-hands-entry-lite-d12hx1dk.js → vm-hands-entry-lite-34b4tws6.js} +1 -1
  23. package/bin/vm-hands/{vm-hands-entry-lite-41nn0vbf.js → vm-hands-entry-lite-432khjd5.js} +1 -1
  24. package/bin/vm-hands/{vm-hands-entry-lite-pe374cn6.js → vm-hands-entry-lite-6vnjgy77.js} +1 -1
  25. package/bin/vm-hands/{vm-hands-entry-lite-0jy8mv4a.js → vm-hands-entry-lite-7r27208j.js} +1 -1
  26. package/bin/vm-hands/{vm-hands-entry-lite-mn8rjpxq.js → vm-hands-entry-lite-af45ma9p.js} +1 -1
  27. package/bin/vm-hands/{vm-hands-entry-lite-43bv9hf0.js → vm-hands-entry-lite-bsk184m7.js} +1 -1
  28. package/bin/vm-hands/{vm-hands-entry-lite-1wxwsb3f.js → vm-hands-entry-lite-dy204qh4.js} +1 -1
  29. package/bin/vm-hands/{vm-hands-entry-lite-61p78r72.js → vm-hands-entry-lite-gcqqnnze.js} +1 -1
  30. package/bin/vm-hands/{vm-hands-entry-lite-vbqfmsd3.js → vm-hands-entry-lite-ncyrz48z.js} +2 -2
  31. package/bin/vm-hands/{vm-hands-entry-lite-frg1b1rg.js → vm-hands-entry-lite-ngn4tafr.js} +2 -2
  32. package/bin/vm-hands/{vm-hands-entry-lite-j8s2vqpf.js → vm-hands-entry-lite-pt19vacn.js} +1 -1
  33. package/bin/vm-hands/{vm-hands-entry-lite-1w39j6vz.js → vm-hands-entry-lite-rqfhfp09.js} +1 -1
  34. package/bin/vm-hands/{vm-hands-entry-lite-k4d5rhpw.js → vm-hands-entry-lite-sz7z1qby.js} +1 -1
  35. package/bin/vm-hands/{vm-hands-entry-lite-zj9esd2g.js → vm-hands-entry-lite-t43bz0ey.js} +2 -2
  36. package/bin/vm-hands/{vm-hands-entry-lite-thstg177.js → vm-hands-entry-lite-t86kt9jz.js} +1 -1
  37. package/bin/vm-hands/{vm-hands-entry-lite-d431ffz0.js → vm-hands-entry-lite-tnj3483k.js} +1 -1
  38. package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
  39. package/bin/vm-hands/{vm-hands-executor-2ngwj96m.js → vm-hands-executor-kyb5t371.js} +1 -1
  40. package/bin/vm-hands/{vm-hands-op-runner-te2ze1e7.js → vm-hands-op-runner-gkt79hcp.js} +1 -1
  41. package/bin/vm-hands/{vm-hands-runtime-09ehkm3c.js → vm-hands-runtime-tdr6j55n.js} +3 -3
  42. package/package.json +1 -1
  43. package/bin/vm-hands/connect-cli-d3dp0r1t.js +0 -2
  44. package/bin/vm-hands/local-display-video-40avbg94.js +0 -2
package/bin/reason CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/reason
3
3
  size: 90322400 bytes
4
- sha256: 1c02a8a3eb7c480db9f4c2f4c426d96a14314d427a171fe4f2700d5950329015
4
+ sha256: 3dd804039b9cb2398c0f1e460d9947a48277adfcc9638b6a98dd0f55fc84d072
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ce,fl,ml,Xr,Zi,Nt}from"./vm-hands-entry-lite-d12hx1dk.js";import"./vm-hands-entry-lite-cmmb9k3g.js";export{Nt as AgentNetwork,Ce as AgentNetworkUnavailable,Xr as DaemonRefusal,ml as installedEngineVersion,fl as refreshEngine,Zi as sessionForgotten};
2
+ import{Ce,fl,ml,Xr,Zi,Nt}from"./vm-hands-entry-lite-34b4tws6.js";import"./vm-hands-entry-lite-cmmb9k3g.js";export{Nt as AgentNetwork,Ce as AgentNetworkUnavailable,Xr as DaemonRefusal,ml as installedEngineVersion,fl as refreshEngine,Zi as sessionForgotten};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ut,el,Wn,ir}from"./vm-hands-entry-lite-d431ffz0.js";import"./vm-hands-entry-lite-0jy8mv4a.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{ut as apiOriginFromEnvironment,Wn as environmentApiKey,el as explicitApiOrigin,ir as resolveApiCredentials};
2
+ import{ut,el,Wn,ir}from"./vm-hands-entry-lite-tnj3483k.js";import"./vm-hands-entry-lite-7r27208j.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{ut as apiOriginFromEnvironment,Wn as environmentApiKey,el as explicitApiOrigin,ir as resolveApiCredentials};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{C,no,me}from"./vm-hands-entry-lite-0jy8mv4a.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{C as ApiError,me as ReasonApi,no as createMachineEnrollmentTicketWithToken};
2
+ import{C,no,me}from"./vm-hands-entry-lite-7r27208j.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{C as ApiError,me as ReasonApi,no as createMachineEnrollmentTicketWithToken};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vn}from"./vm-hands-entry-lite-cmmb9k3g.js";import{Fe,Zi,Nt}from"./vm-hands-entry-lite-d12hx1dk.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-33at6g06.js";import{g}from"./vm-hands-entry-lite-1w39j6vz.js";import{Kr}from"./vm-hands-entry-lite-jj7873n8.js";import{createHash as q}from"crypto";import{existsSync as C,mkdirSync as K,readFileSync as x,rmSync as B,writeFileSync as H}from"fs";import{homedir as z}from"os";import{dirname as S,join as J}from"path";import{existsSync as G,mkdirSync as de,rmSync as he,writeFileSync as ue}from"fs";import{dirname as fe,join as Y}from"path";var U=(e)=>Y(e,".reason","do-not-track");function W(e){let t=e.DO_NOT_TRACK?.trim().toLowerCase();if(!t)return null;return t!=="0"&&t!=="false"}function N(e,t){return W(e)===!0||G(U(t))}var D=86400000,Q=60000,M=300000,X=300000,Z=5,j=5,ee=300,te=900000,E=21600000,ne=60000,y=(e)=>J(e,".reason","ask-relay.json"),m=(e)=>J(e,".reason","ask-relay-refused.json");async function w(){let{loadCredentials:e}=await import("./credentials-sk4sag42.js"),t=e();return t?[t.apiOrigin,t.orgId,t.clientId].join("\x00"):""}var I=(e)=>q("sha256").update(e).digest("hex");function O(e){try{let t=JSON.parse(x(m(e),"utf8"));return typeof t.login==="string"&&typeof t.refusals==="number"&&typeof t.until==="number"?{login:t.login,refusals:t.refusals,until:t.until}:null}catch{return null}}function _(e,t){try{if(!t){B(m(e),{force:!0});return}if(!C(S(m(e))))K(S(m(e)),{recursive:!0});H(m(e),`${JSON.stringify(t)}
2
+ import{Vn}from"./vm-hands-entry-lite-cmmb9k3g.js";import{Fe,Zi,Nt}from"./vm-hands-entry-lite-34b4tws6.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-33at6g06.js";import{g}from"./vm-hands-entry-lite-rqfhfp09.js";import{Kr}from"./vm-hands-entry-lite-jj7873n8.js";import{createHash as q}from"crypto";import{existsSync as C,mkdirSync as K,readFileSync as x,rmSync as B,writeFileSync as H}from"fs";import{homedir as z}from"os";import{dirname as S,join as J}from"path";import{existsSync as G,mkdirSync as de,rmSync as he,writeFileSync as ue}from"fs";import{dirname as fe,join as Y}from"path";var U=(e)=>Y(e,".reason","do-not-track");function W(e){let t=e.DO_NOT_TRACK?.trim().toLowerCase();if(!t)return null;return t!=="0"&&t!=="false"}function N(e,t){return W(e)===!0||G(U(t))}var D=86400000,Q=60000,M=300000,X=300000,Z=5,j=5,ee=300,te=900000,E=21600000,ne=60000,y=(e)=>J(e,".reason","ask-relay.json"),m=(e)=>J(e,".reason","ask-relay-refused.json");async function w(){let{loadCredentials:e}=await import("./credentials-sk4sag42.js"),t=e();return t?[t.apiOrigin,t.orgId,t.clientId].join("\x00"):""}var I=(e)=>q("sha256").update(e).digest("hex");function O(e){try{let t=JSON.parse(x(m(e),"utf8"));return typeof t.login==="string"&&typeof t.refusals==="number"&&typeof t.until==="number"?{login:t.login,refusals:t.refusals,until:t.until}:null}catch{return null}}function _(e,t){try{if(!t){B(m(e),{force:!0});return}if(!C(S(m(e))))K(S(m(e)),{recursive:!0});H(m(e),`${JSON.stringify(t)}
3
3
  `,{mode:384})}catch{}}var se=300000,ie=8,re=300000,d=(e)=>`${e.agent}:${e.name}`;function p(e){try{let t=JSON.parse(x(y(e),"utf8"));return{sessions:Array.isArray(t.sessions)?t.sessions.filter((s)=>typeof s?.name==="string"&&typeof s.agent==="string"&&typeof s.usedAt==="number"):[],hosted:Array.isArray(t.hosted)?t.hosted.filter((s)=>typeof s?.name==="string"&&typeof s.agent==="string"&&typeof s.at==="number"):[]}}catch{return{sessions:[],hosted:[]}}}function P(e,t){try{if(!C(S(y(e))))K(S(y(e)),{recursive:!0});H(y(e),`${JSON.stringify(t)}
4
4
  `,{mode:384})}catch{}}var h=(e,t)=>new Promise((s)=>{if(t.aborted)return s();let n=setTimeout(i,e);n.unref?.();function i(){clearTimeout(n),t.removeEventListener("abort",i),s()}t.addEventListener("abort",i,{once:!0})});function T(e){let t=e?.status;return typeof t==="number"?t:null}var L=60000;function ae(e){return{address:e.address.slice(0,300),state:e.state.slice(0,40),note:e.note.slice(0,500)}}function oe(e){let t=Number.isFinite(e.sentAt)&&Math.abs(e.sentAt)<8640000000000000?e.sentAt:Date.now();return{id:e.id.slice(0,100),from:e.from.slice(0,300),from_agent:e.fromAgent?.slice(0,100)??null,to:e.to.slice(0,300),reply_to:e.replyTo?.slice(0,100)??null,sent_at:t,body:e.body.length>L?`${e.body.slice(0,L)}
5
- [cut: the answer was ${e.body.length} characters]`:e.body}}class V{network;api;home;signal;log;team;sessions=new Map;readers=new Set;hosted=new Map;addresses=new Map;reclaimed=new Map;reportSoon=!1;constructor(e,t,s,n,i,r){this.network=e;this.api=t;this.home=s;this.signal=n;this.log=i;this.team=r}async run(){let e=Date.now()-D,t=p(this.home);for(let l of t.hosted)if(Date.now()-l.at<=M)this.hosted.set(d(l),l);for(let l of[...t.sessions.filter((u)=>u.usedAt>e),...this.hosted.values()])this.read(l);let s=0,n=0,i=-1/0,r=-1/0,a=-1/0,o=O(this.home);if(o)if(o.login===I(await w()))n=o.refusals,await this.untilSignedInAgain(Math.min(E,o.until-Date.now()));else _(this.home,null);while(!this.signal.aborted){let l=await this.network.team().catch(()=>null);if(!l){await h(60000,this.signal);continue}if(this.team!==null&&l.name!==this.team)return;if(this.team===null&&Date.now()-r>=re)r=Date.now(),this.sendLink();let u,F=new Date(Date.now()+86400000).toISOString().slice(0,10),v=Date.now()-i>=se&&!N(process.env,this.home)?l.messageCounts?.filter((c)=>c.day<=F).slice(-ie):void 0,R=this.reportSoon||Date.now()-a>=Q;this.reportSoon=!1;try{let c=await this.api.claimAgentNetworkRelayJob({machine:l.machine,person:l.person,...this.onNetwork(l),version:g,wait_seconds:Vn,...v?.length?{message_counts:v,...l.endpoint?{endpoint:l.endpoint}:{}}:{},...R?{hosted:this.hostedReport()}:{}},AbortSignal.any([this.signal,AbortSignal.timeout((Vn+20)*1000)]));if(v?.length)i=Date.now();if(R)a=Date.now();if(c.hosted)this.carryHosted(c.hosted);if(s=0,n>0)_(this.home,null);if(n=0,c.retry_after_seconds)await h(c.retry_after_seconds*1000,this.signal);u=c.job}catch(c){if(this.signal.aborted)return;let f=T(c);if(f===401){let A=I(await w()),b=O(this.home);n=Math.max(n,b?.login===A?b.refusals:0)+1;let k=Math.min(E,te*2**Math.min(n-1,10));_(this.home,{login:A,refusals:n,until:Date.now()+k}),await this.untilSignedInAgain(k);continue}if(f===403){await h(900000,this.signal);continue}if(f===404||f===405){await h(120000,this.signal);continue}s+=1,await h(Math.min(60000,1000*2**Math.min(s,6)),this.signal);continue}if(u)this.carry(u)}}linkSends={sent:null,refused:null};async sendLink(){try{let{sendTeamLink:e}=await import("./network-sign-in-t9ng36rs.js");this.linkSends=await e(this.network,this.linkSends,this.home,this.api)}catch{}}onNetwork(e){return{team:e.name,...e.teamId?{team_id:e.teamId}:{},...this.team===null?{workspace:!1}:{}}}async untilSignedInAgain(e){let t=await w(),s=Date.now()+e;while(!this.signal.aborted&&Date.now()<s)if(await h(Math.min(ne,Math.max(0,s-Date.now())),this.signal),await w()!==t)return}async carry(e){let t;try{t=e.kind==="who"?{who:await this.who(e)}:{sent:await this.send(e)}}catch(s){t={error:s instanceof Error?s.message:String(s)}}for(let s=1;;s+=1)try{if(await this.api.completeAgentNetworkRelayJob(e.id,t),e.kind==="send")this.log(Fe(`relayed a message to ${e.to} from ${"sent"in t?t.sent.from:e.from_name}`),"relayed");return}catch(n){if(s>=4||this.signal.aborted){this.log(Fe(`couldn't report a relayed call: ${n instanceof Error?n.message:String(n)}`));return}await h(s*1000,this.signal)}}async who(e){let t=e.all===!0,s=await this.network.snapshot({all:t});return{all:t,team:s.team,sessions:s.sessions.map((n)=>({address:n.address,person:n.person,machine:n.machine,agent:n.agent,repo:n.repo,branch:n.branch,status:n.status,since:n.since,doing:n.doing,worker:n.worker,...n.tier?{tier:n.tier.slice(0,10)}:{}})),machines:s.machines.map((n)=>({person:n.person,machine:n.machine,online:n.online}))}}hostedReport(){return[...this.hosted.values()].filter((e)=>this.wanted(e)).slice(0,50).map((e)=>{let t=this.addresses.get(d(e));return{name:e.name,...t?{address:t}:{}}})}carryHosted(e){let t=Date.now(),s=new Map(e.map((n)=>[d(n),{name:n.name,agent:n.agent,at:t}]));for(let[n,i]of this.hosted){if(s.has(n))continue;this.hosted.delete(n),this.letGo(i)}for(let[n,i]of s){if(this.hosted.has(n))this.sessions.get(n)?.then((r)=>r.idle()).catch(()=>{});this.hosted.set(n,i),this.read(i)}P(this.home,{...p(this.home),hosted:[...this.hosted.values()]})}letGo(e){if(this.wanted(e))return;let t=d(e),s=this.sessions.get(t);this.sessions.delete(t),this.addresses.delete(t),this.reclaimed.delete(t),s?.then(async(n)=>{for(let i=0;i<j;i+=1){let r=await n.next(Z).catch(()=>[]);if(r.length===0||!await this.handOver(e,n,r,!0).then(()=>!0,()=>!1))break}if(!this.sessions.has(t))await n.end()}).catch(()=>{})}async reclaim(e,t){let s=d(e);if(!this.hosted.has(s)||t.address.slice(t.address.indexOf("/")+1)===e.name)return;if(Date.now()-(this.reclaimed.get(s)??-1/0)<X)return;if(this.reclaimed.set(s,Date.now()),!await t.rename(e.name).then(()=>!0,()=>!1))return;this.addresses.set(s,t.address),this.reportSoon=!0}wanted(e){let t=this.hosted.get(d(e));if(t&&Date.now()-t.at<=M)return!0;let s=p(this.home).sessions.find((n)=>n.name===e.name&&n.agent===e.agent)?.usedAt??0;return Date.now()-s<=D}async send(e){let t={name:e.from_name,agent:e.from_agent},{session:s,result:n}=await this.withSession(t,(i)=>i.send(e.to,e.body,e.reply_to,{notify:e.notify===!0}));return this.remember(t),this.read(t),{ids:n.ids,recipients:n.recipients,from:s.address,deliveries:n.deliveries.slice(0,500).map(ae)}}async withSession(e,t,s=()=>!0){let n=this.session(e),i=await n;try{return{session:i,result:await t(i)}}catch(r){if(!Zi(r)||!s())throw r;let a=d(e);if(this.sessions.get(a)===n)this.sessions.delete(a);let o=await this.session(e);return{session:o,result:await t(o)}}}session(e){let t=d(e),s=this.sessions.get(t);if(!s)s=this.network.session(e.name,{agent:e.agent}).then(async(n)=>(this.addresses.set(t,n.address),await n.idle(`personal agent (${e.agent}), through Reason`).catch(()=>{}),n)),s.catch(()=>this.sessions.delete(t)),this.sessions.set(t,s);return s}remember(e){let t=p(this.home),s=t.sessions.filter((n)=>n.name!==e.name||n.agent!==e.agent);P(this.home,{...t,sessions:[...s,{...e,usedAt:Date.now()}].slice(-50)})}async handOver(e,t,s,n){let i=await this.network.team();if(!i)throw Error("not on a team");let r=n?{session:e.name,machine:i.machine}:{};await this.api.recordAgentNetworkRelayReplies({messages:s.map(oe),...this.onNetwork(i),...r}).catch((a)=>{let o=T(a);if(o===null||o>=500||o===429||o===401)throw a;this.log(`dropped ${s.length} answer(s) the server refused (HTTP ${o})`)}),await t.ack(s.map((a)=>a.id))}read(e){let t=d(e);if(this.readers.has(t))return;this.readers.add(t),(async()=>{let s=0;try{while(!this.signal.aborted&&this.wanted(e))try{let n=this.hosted.has(t),{session:i,result:r}=await this.withSession(e,async(a)=>(await this.reclaim(e,a),await a.next(ee)),()=>this.wanted(e));if(r.length===0)continue;await this.handOver(e,i,r,n||this.hosted.has(t)),s=0}catch{if(this.signal.aborted)return;s+=1,await h(Math.min(60000,1000*2**Math.min(s,6)),this.signal)}}finally{if(this.readers.delete(t),!this.signal.aborted&&this.hosted.has(t)&&!this.wanted(e))this.hosted.delete(t),this.letGo(e)}})()}}async function le(e){await new V(e.network,e.api,e.home??z(),e.signal,e.log??(()=>{}),e.team).run()}async function De(e,t=()=>{}){let s="";while(!e.aborted){try{let n=Nt.openInstalled();if(n)try{let[{resolveApiCredentials:i},{ReasonApi:r}]=await Promise.all([import("./api-credentials-3wwkpts2.js"),import("./api-9xm5e4g9.js")]),a=await i({});if(a&&a.credentialKind!=="api_key"){let o=Kr(),l=o&&a.orgId.toLowerCase()===o.orgId.toLowerCase()?o.team:null;await le({network:n,api:new r(a),team:l,signal:e,log:t})}}finally{n.close()}s=""}catch(n){let i=Fe(`agent network relay: ${n instanceof Error?n.message:String(n)}`);if(i!==s)t(i);s=i}await h(300000,e)}}export{De as runBackgroundAskRelay};
5
+ [cut: the answer was ${e.body.length} characters]`:e.body}}class V{network;api;home;signal;log;team;sessions=new Map;readers=new Set;hosted=new Map;addresses=new Map;reclaimed=new Map;reportSoon=!1;constructor(e,t,s,n,i,r){this.network=e;this.api=t;this.home=s;this.signal=n;this.log=i;this.team=r}async run(){let e=Date.now()-D,t=p(this.home);for(let l of t.hosted)if(Date.now()-l.at<=M)this.hosted.set(d(l),l);for(let l of[...t.sessions.filter((u)=>u.usedAt>e),...this.hosted.values()])this.read(l);let s=0,n=0,i=-1/0,r=-1/0,a=-1/0,o=O(this.home);if(o)if(o.login===I(await w()))n=o.refusals,await this.untilSignedInAgain(Math.min(E,o.until-Date.now()));else _(this.home,null);while(!this.signal.aborted){let l=await this.network.team().catch(()=>null);if(!l){await h(60000,this.signal);continue}if(this.team!==null&&l.name!==this.team)return;if(this.team===null&&Date.now()-r>=re)r=Date.now(),this.sendLink();let u,F=new Date(Date.now()+86400000).toISOString().slice(0,10),v=Date.now()-i>=se&&!N(process.env,this.home)?l.messageCounts?.filter((c)=>c.day<=F).slice(-ie):void 0,R=this.reportSoon||Date.now()-a>=Q;this.reportSoon=!1;try{let c=await this.api.claimAgentNetworkRelayJob({machine:l.machine,person:l.person,...this.onNetwork(l),version:g,wait_seconds:Vn,...v?.length?{message_counts:v,...l.endpoint?{endpoint:l.endpoint}:{}}:{},...R?{hosted:this.hostedReport()}:{}},AbortSignal.any([this.signal,AbortSignal.timeout((Vn+20)*1000)]));if(v?.length)i=Date.now();if(R)a=Date.now();if(c.hosted)this.carryHosted(c.hosted);if(s=0,n>0)_(this.home,null);if(n=0,c.retry_after_seconds)await h(c.retry_after_seconds*1000,this.signal);u=c.job}catch(c){if(this.signal.aborted)return;let f=T(c);if(f===401){let A=I(await w()),b=O(this.home);n=Math.max(n,b?.login===A?b.refusals:0)+1;let k=Math.min(E,te*2**Math.min(n-1,10));_(this.home,{login:A,refusals:n,until:Date.now()+k}),await this.untilSignedInAgain(k);continue}if(f===403){await h(900000,this.signal);continue}if(f===404||f===405){await h(120000,this.signal);continue}s+=1,await h(Math.min(60000,1000*2**Math.min(s,6)),this.signal);continue}if(u)this.carry(u)}}linkSends={sent:null,refused:null};async sendLink(){try{let{sendTeamLink:e}=await import("./network-sign-in-xm79s170.js");this.linkSends=await e(this.network,this.linkSends,this.home,this.api)}catch{}}onNetwork(e){return{team:e.name,...e.teamId?{team_id:e.teamId}:{},...this.team===null?{workspace:!1}:{}}}async untilSignedInAgain(e){let t=await w(),s=Date.now()+e;while(!this.signal.aborted&&Date.now()<s)if(await h(Math.min(ne,Math.max(0,s-Date.now())),this.signal),await w()!==t)return}async carry(e){let t;try{t=e.kind==="who"?{who:await this.who(e)}:{sent:await this.send(e)}}catch(s){t={error:s instanceof Error?s.message:String(s)}}for(let s=1;;s+=1)try{if(await this.api.completeAgentNetworkRelayJob(e.id,t),e.kind==="send")this.log(Fe(`relayed a message to ${e.to} from ${"sent"in t?t.sent.from:e.from_name}`),"relayed");return}catch(n){if(s>=4||this.signal.aborted){this.log(Fe(`couldn't report a relayed call: ${n instanceof Error?n.message:String(n)}`));return}await h(s*1000,this.signal)}}async who(e){let t=e.all===!0,s=await this.network.snapshot({all:t});return{all:t,team:s.team,sessions:s.sessions.map((n)=>({address:n.address,person:n.person,machine:n.machine,agent:n.agent,repo:n.repo,branch:n.branch,status:n.status,since:n.since,doing:n.doing,worker:n.worker,...n.tier?{tier:n.tier.slice(0,10)}:{}})),machines:s.machines.map((n)=>({person:n.person,machine:n.machine,online:n.online}))}}hostedReport(){return[...this.hosted.values()].filter((e)=>this.wanted(e)).slice(0,50).map((e)=>{let t=this.addresses.get(d(e));return{name:e.name,...t?{address:t}:{}}})}carryHosted(e){let t=Date.now(),s=new Map(e.map((n)=>[d(n),{name:n.name,agent:n.agent,at:t}]));for(let[n,i]of this.hosted){if(s.has(n))continue;this.hosted.delete(n),this.letGo(i)}for(let[n,i]of s){if(this.hosted.has(n))this.sessions.get(n)?.then((r)=>r.idle()).catch(()=>{});this.hosted.set(n,i),this.read(i)}P(this.home,{...p(this.home),hosted:[...this.hosted.values()]})}letGo(e){if(this.wanted(e))return;let t=d(e),s=this.sessions.get(t);this.sessions.delete(t),this.addresses.delete(t),this.reclaimed.delete(t),s?.then(async(n)=>{for(let i=0;i<j;i+=1){let r=await n.next(Z).catch(()=>[]);if(r.length===0||!await this.handOver(e,n,r,!0).then(()=>!0,()=>!1))break}if(!this.sessions.has(t))await n.end()}).catch(()=>{})}async reclaim(e,t){let s=d(e);if(!this.hosted.has(s)||t.address.slice(t.address.indexOf("/")+1)===e.name)return;if(Date.now()-(this.reclaimed.get(s)??-1/0)<X)return;if(this.reclaimed.set(s,Date.now()),!await t.rename(e.name).then(()=>!0,()=>!1))return;this.addresses.set(s,t.address),this.reportSoon=!0}wanted(e){let t=this.hosted.get(d(e));if(t&&Date.now()-t.at<=M)return!0;let s=p(this.home).sessions.find((n)=>n.name===e.name&&n.agent===e.agent)?.usedAt??0;return Date.now()-s<=D}async send(e){let t={name:e.from_name,agent:e.from_agent},{session:s,result:n}=await this.withSession(t,(i)=>i.send(e.to,e.body,e.reply_to,{notify:e.notify===!0}));return this.remember(t),this.read(t),{ids:n.ids,recipients:n.recipients,from:s.address,deliveries:n.deliveries.slice(0,500).map(ae)}}async withSession(e,t,s=()=>!0){let n=this.session(e),i=await n;try{return{session:i,result:await t(i)}}catch(r){if(!Zi(r)||!s())throw r;let a=d(e);if(this.sessions.get(a)===n)this.sessions.delete(a);let o=await this.session(e);return{session:o,result:await t(o)}}}session(e){let t=d(e),s=this.sessions.get(t);if(!s)s=this.network.session(e.name,{agent:e.agent}).then(async(n)=>(this.addresses.set(t,n.address),await n.idle(`personal agent (${e.agent}), through Reason`).catch(()=>{}),n)),s.catch(()=>this.sessions.delete(t)),this.sessions.set(t,s);return s}remember(e){let t=p(this.home),s=t.sessions.filter((n)=>n.name!==e.name||n.agent!==e.agent);P(this.home,{...t,sessions:[...s,{...e,usedAt:Date.now()}].slice(-50)})}async handOver(e,t,s,n){let i=await this.network.team();if(!i)throw Error("not on a team");let r=n?{session:e.name,machine:i.machine}:{};await this.api.recordAgentNetworkRelayReplies({messages:s.map(oe),...this.onNetwork(i),...r}).catch((a)=>{let o=T(a);if(o===null||o>=500||o===429||o===401)throw a;this.log(`dropped ${s.length} answer(s) the server refused (HTTP ${o})`)}),await t.ack(s.map((a)=>a.id))}read(e){let t=d(e);if(this.readers.has(t))return;this.readers.add(t),(async()=>{let s=0;try{while(!this.signal.aborted&&this.wanted(e))try{let n=this.hosted.has(t),{session:i,result:r}=await this.withSession(e,async(a)=>(await this.reclaim(e,a),await a.next(ee)),()=>this.wanted(e));if(r.length===0)continue;await this.handOver(e,i,r,n||this.hosted.has(t)),s=0}catch{if(this.signal.aborted)return;s+=1,await h(Math.min(60000,1000*2**Math.min(s,6)),this.signal)}}finally{if(this.readers.delete(t),!this.signal.aborted&&this.hosted.has(t)&&!this.wanted(e))this.hosted.delete(t),this.letGo(e)}})()}}async function le(e){await new V(e.network,e.api,e.home??z(),e.signal,e.log??(()=>{}),e.team).run()}async function De(e,t=()=>{}){let s="";while(!e.aborted){try{let n=Nt.openInstalled();if(n)try{let[{resolveApiCredentials:i},{ReasonApi:r}]=await Promise.all([import("./api-credentials-082cnpn9.js"),import("./api-sq672f51.js")]),a=await i({});if(a&&a.credentialKind!=="api_key"){let o=Kr(),l=o&&a.orgId.toLowerCase()===o.orgId.toLowerCase()?o.team:null;await le({network:n,api:new r(a),team:l,signal:e,log:t})}}finally{n.close()}s=""}catch(n){let i=Fe(`agent network relay: ${n instanceof Error?n.message:String(n)}`);if(i!==s)t(i);s=i}await h(300000,e)}}export{De as runBackgroundAskRelay};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fe,Qi,gl,_l,eo,yl,wl}from"./vm-hands-entry-lite-ngn4tafr.js";import"./vm-hands-entry-lite-284z7ct8.js";import"./vm-hands-entry-lite-997y1m1r.js";import"./vm-hands-entry-lite-dy204qh4.js";import"./vm-hands-entry-lite-tnj3483k.js";import"./vm-hands-entry-lite-7r27208j.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-pt19vacn.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-bsk184m7.js";import"./vm-hands-entry-lite-gcqqnnze.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-1xhpn3hw.js";import"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{Qi as computerDisconnected,fe as connectionDirectory,eo as connectionReport,yl as restartConnection,wl as restartConnectionWhenIdle,gl as runConnectCli,_l as runDisconnectCli};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Sr,Er,A,Zo,Qo,es,ts}from"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{Sr as USER_CHROME_SOCKET_DIR,Er as desktopPaths,ts as desktopProfileAction,Zo as desktopVideoIdentity,Qo as downloadVerified,es as keepDesktopMinimal,A as readDesktopComponents};
2
+ import{Sr,Er,A,Zo,Qo,es,ts}from"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{Sr as USER_CHROME_SOCKET_DIR,Er as desktopPaths,ts as desktopProfileAction,Zo as desktopVideoIdentity,Qo as downloadVerified,es as keepDesktopMinimal,A as readDesktopComponents};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{hr,Oo,No,Lo,Cl,$o}from"./vm-hands-entry-lite-jgwjt10t.js";import"./vm-hands-entry-lite-41nn0vbf.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-srtqjjqb.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-mn8rjpxq.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{No as ensureLocalBrowser,hr as localAutomationAvailable,Lo as localBrowserProfile,Oo as localUserChromeHost,Cl as runAutomationCallLocally,$o as runLocalAutomation};
2
+ import{hr,Oo,No,Lo,Cl,$o}from"./vm-hands-entry-lite-1xhpn3hw.js";import"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{No as ensureLocalBrowser,hr as localAutomationAvailable,Lo as localBrowserProfile,Oo as localUserChromeHost,Cl as runAutomationCallLocally,$o as runLocalAutomation};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qr,en,ho,Gn,tl,rl,Kn,fo,mo,go,Jn}from"./vm-hands-entry-lite-j8s2vqpf.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-43bv9hf0.js";import"./vm-hands-entry-lite-61p78r72.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-jgwjt10t.js";import"./vm-hands-entry-lite-41nn0vbf.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-srtqjjqb.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-mn8rjpxq.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";export{r as LocalCapabilityError,Qr as SHORT_REQUEST_CAPABILITIES,fo as capabilityInventoryForRoots,en as confinedExecutionShell,Gn as defaultLocalCommandRunner,mo as deliverLocalHandsEnvironment,Kn as enrolledRootPaths,Jn as executeLocalOperation,go as rebindLocalHandsControl,tl as runFileCapability,rl as runTransferCapability,ho as spawnCaptured};
2
+ import{Qr,en,ho,Gn,tl,rl,Kn,fo,mo,go,Jn}from"./vm-hands-entry-lite-pt19vacn.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-bsk184m7.js";import"./vm-hands-entry-lite-gcqqnnze.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-1xhpn3hw.js";import"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";export{r as LocalCapabilityError,Qr as SHORT_REQUEST_CAPABILITIES,fo as capabilityInventoryForRoots,en as confinedExecutionShell,Gn as defaultLocalCommandRunner,mo as deliverLocalHandsEnvironment,Kn as enrolledRootPaths,Jn as executeLocalOperation,go as rebindLocalHandsControl,tl as runFileCapability,rl as runTransferCapability,ho as spawnCaptured};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{un,Mo,Te,jt,dn}from"./vm-hands-entry-lite-41nn0vbf.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-srtqjjqb.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{jt as ensureLinuxDesktop,un as localDisplayAvailable,Mo as localDisplayReady,Te as privateDirectory,dn as runLocalDisplayStream};
2
+ import{un,Mo,Te,jt,dn}from"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{jt as ensureLinuxDesktop,un as localDisplayAvailable,Mo as localDisplayReady,Te as privateDirectory,dn as runLocalDisplayStream};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Go,Ko,Jo,Xo,Jt}from"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{Go as MAC_SCREEN,Ko as WINDOWS_SCREEN,Jo as createDisplayVideoLane,Jt as localDisplayVideoAvailable,Xo as simulatorVideoFfmpeg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{lr,Qn,wo,ei}from"./vm-hands-entry-lite-43bv9hf0.js";import"./vm-hands-entry-lite-61p78r72.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{lr as ManagedProcessStoppedError,wo as controlManagedDeviceProcess,ei as retireManagedDeviceProcess,Qn as runManagedDeviceProcess};
2
+ import{lr,Qn,wo,ei}from"./vm-hands-entry-lite-bsk184m7.js";import"./vm-hands-entry-lite-gcqqnnze.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{lr as ManagedProcessStoppedError,wo as controlManagedDeviceProcess,ei as retireManagedDeviceProcess,Qn as runManagedDeviceProcess};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qc,Lt,bl,Yr,vl,Sl,Ze,El,kl,ie,xl,N,ro}from"./vm-hands-entry-lite-1wxwsb3f.js";import"./vm-hands-entry-lite-yg4dk99m.js";import{bn,Di}from"./vm-hands-entry-lite-1b21avcs.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{Qc as MANAGED_RUNTIME_MANIFEST_URL,bn as MANAGED_RUNTIME_MAX_MANIFEST_BYTES,ie as acquireManagedRuntimeDirectoryLock,xl as acquireManagedRuntimeLock,Ze as currentManagedRuntimeVersion,Yr as fetchManagedRuntimeBytes,ro as flushManagedRuntimeLifecycleEvents,Sl as installManagedRuntimeLauncher,El as isManagedRuntimeVersionExecutable,bl as legacyManagedRuntimePaths,kl as managedRuntimeExecutableVersion,Lt as managedRuntimePaths,Di as parseAndVerifyManagedRuntimeManifest,N as recordManagedRuntimeLifecycle,vl as updateManagedRuntime};
2
+ import{Qc,Lt,bl,Yr,vl,Sl,Ze,El,kl,ie,xl,N,ro}from"./vm-hands-entry-lite-dy204qh4.js";import"./vm-hands-entry-lite-yg4dk99m.js";import{bn,Di}from"./vm-hands-entry-lite-1b21avcs.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{Qc as MANAGED_RUNTIME_MANIFEST_URL,bn as MANAGED_RUNTIME_MAX_MANIFEST_BYTES,ie as acquireManagedRuntimeDirectoryLock,xl as acquireManagedRuntimeLock,Ze as currentManagedRuntimeVersion,Yr as fetchManagedRuntimeBytes,ro as flushManagedRuntimeLifecycleEvents,Sl as installManagedRuntimeLauncher,El as isManagedRuntimeVersionExecutable,bl as legacyManagedRuntimePaths,kl as managedRuntimeExecutableVersion,Lt as managedRuntimePaths,Di as parseAndVerifyManagedRuntimeManifest,N as recordManagedRuntimeLifecycle,vl as updateManagedRuntime};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{R}from"./vm-hands-entry-lite-z65xva21.js";import{w}from"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-rxydyqke.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{ot,We}from"./vm-hands-entry-lite-y0jtj8zz.js";import{ys}from"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1wxwsb3f.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-0jy8mv4a.js";import"./vm-hands-entry-lite-d431ffz0.js";import"./vm-hands-entry-lite-mn8rjpxq.js";import"./vm-hands-entry-lite-61p78r72.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-frg1b1rg.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-997y1m1r.js";import"./vm-hands-entry-lite-j8s2vqpf.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-43bv9hf0.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-41nn0vbf.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-srtqjjqb.js";import"./vm-hands-entry-lite-jgwjt10t.js";import"./vm-hands-entry-lite-284z7ct8.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-12ck5swp.js";import{Me,Be}from"./vm-hands-entry-lite-pg7nnyc6.js";import{spawn as I}from"child_process";import{randomUUID as A}from"crypto";import{closeSync as M,existsSync as T,mkdirSync as y,openSync as N,readFileSync as U,renameSync as O,rmSync as V,writeFileSync as F}from"fs";import{homedir as u}from"os";import{dirname as p,join as h}from"path";var L=["curl","npm","bun","brew"];function x(e){return L.includes(e)}function v(e,n=process.env){let r=R(n,"REASON_INSTALL_METHOD");if(x(r))return r;let t=e.replaceAll("\\","/").toLowerCase();if(t.includes("/.bun/install/global/"))return"bun";if(t.includes("/node_modules/"))return"npm";if(t.includes("/cellar/")||t.includes("/homebrew/"))return"brew";return"curl"}var f=86400000,_=7200000,W=900000,q=900000,J=30000,B=3600000,j=43200000,G="network-update-check.json",K="automatic-updates-declined.json",H="network-update.log";function g(e,n){return p(ot(e,n))}function S(e=process.env,n=u()){return T(h(g(e,n),K))}function b(e){if(!e||e.channel!=="production"||e.install_method!=="curl")return"no_receipt";return e.background_mode==="cli_only"?null:"background_updater"}function Y(e={}){let n=e.env??process.env,r=e.home??u(),t=e.executablePath??process.execPath;if(!(e.compiled??ys(e.main)))return"source_checkout";if(w({env:n,executablePath:t})!=="production")return"not_production";if(v(t,n)!=="curl")return"package_manager";let o=e.receipt===void 0?We(ot(n,r)):e.receipt,s=b(o);if(s)return s;if(S(n,r))return"declined";return"eligible"}async function jt(e,n=process.env,r=u()){if(e.background_mode!=="cli_only")return"background_updater";if(S(n,r))return"declined";if(b(e)!==null)return"none";let{installedEngineVersion:t}=await import("./agent-network-3stvmqsj.js");return t(r)===null?"none":"reason_network"}function X(e){try{let n=JSON.parse(U(e,"utf8"));return n?.schema_version===1&&typeof n.next_at==="string"&&Number.isFinite(Date.parse(n.next_at))?n:null}catch{return null}}function z(e,n){y(p(e),{recursive:!0,mode:448});let r=`${e}.${process.pid}.${A()}.tmp`;try{F(r,`${JSON.stringify(n)}
3
- `,{mode:384,flag:"wx"}),O(r,e)}finally{V(r,{force:!0})}}function Q(e={}){let n=h(g(e.env??process.env,e.home??u()),G),r=(e.now??new Date).getTime(),t=()=>{let i=(e.random??Math.random)();return Number.isFinite(i)?Math.min(Math.max(i,0),1):0},o=(i)=>z(n,{schema_version:1,next_at:new Date(i).toISOString()}),s=X(n),c=s?Date.parse(s.next_at):NaN;if(!s||c>r+f+_)return o(r+Math.floor(t()*f)),!1;if(r<c)return!1;return o(r+f+Math.round((t()*2-1)*_)),!0}function Z(e,n={}){let r=n.platform??process.platform,t=n.kill??Be,o=(c)=>{try{t(e,c,r)}catch{}};if(o("SIGTERM"),r==="win32")return;setTimeout(()=>o("SIGKILL"),n.graceMs??J).unref?.()}function ee(e={}){let n=e.env??process.env,r=e.platform??process.platform,t=h(g(n,e.home??u()),H);y(p(t),{recursive:!0,mode:448});let o=N(t,"w",384);return new Promise((s)=>{let c=!1,i=(d)=>{if(c)return;c=!0,clearTimeout(a),s(d)},l=I(e.executablePath??process.execPath,["update","--quiet"],{env:n,stdio:["ignore",o,o],windowsHide:!0,...Me(r)});M(o);let a=setTimeout(()=>{if(l.pid)Z(l.pid,{platform:r,...e.killGraceMs===void 0?{}:{graceMs:e.killGraceMs},...e.kill?{kill:e.kill}:{}});i(124)},e.timeoutMs??q);a.unref?.(),l.once("error",()=>i(127)),l.once("exit",(d,m)=>i(m?128:d??1))})}function te(e,n){return new Promise((r)=>{if(n.aborted)return r();let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),r()},{once:!0})})}function ne(e,n=()=>new Date){let r=-1/0,t="";return(o)=>{let s=n().getTime();if(s-r<B||o===t&&s-r<j)return;r=s,t=o,e(o)}}async function Gt(e,n,r,t={}){let o=t.env??process.env,s=t.home??u(),c=t.sleep??te,i=t.now??(()=>new Date);if(o.REASON_NETWORK_NO_UPDATE||o.TINCAN_NO_UPDATE)return;let l=ne(n,i);try{let a=t.refreshEngine??(async(m)=>(await import("./agent-network-3stvmqsj.js")).refreshEngine({home:s,env:o,beforeRestart:m})),d=()=>l("moved the network engine to this release's pin; its daemon restarts on it");if(await a(d)){d();return}}catch(a){l(`couldn't move the network engine to this release's pin: ${a instanceof Error?a.message:String(a)}`)}while(!e.aborted){try{if(Y({env:o,home:s,...t.executablePath?{executablePath:t.executablePath}:{},...t.compiled===void 0?{}:{compiled:t.compiled}})==="eligible"&&Q({env:o,home:s,now:i(),...t.random?{random:t.random}:{}})){let d=await(t.update??(()=>ee({env:o,home:s,...t.executablePath?{executablePath:t.executablePath}:{}})))();if(d===0)await r();else l(`reason update failed (exit ${d}); the next try is in about a day`)}}catch(a){l(`automatic update: ${a instanceof Error?a.message:String(a)}`)}await c(t.tickMs??W,e)}}export{jt as automaticUpdatesFor,Gt as keepNetworkComputerCurrent};
2
+ import{R}from"./vm-hands-entry-lite-z65xva21.js";import{w}from"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-rxydyqke.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{ot,We}from"./vm-hands-entry-lite-y0jtj8zz.js";import{ys}from"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-dy204qh4.js";import"./vm-hands-entry-lite-xfak34av.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-7r27208j.js";import"./vm-hands-entry-lite-tnj3483k.js";import"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-gcqqnnze.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-ngn4tafr.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-997y1m1r.js";import"./vm-hands-entry-lite-pt19vacn.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-bsk184m7.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-1xhpn3hw.js";import"./vm-hands-entry-lite-284z7ct8.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-12ck5swp.js";import{Me,Be}from"./vm-hands-entry-lite-pg7nnyc6.js";import{spawn as I}from"child_process";import{randomUUID as A}from"crypto";import{closeSync as M,existsSync as T,mkdirSync as y,openSync as N,readFileSync as U,renameSync as O,rmSync as V,writeFileSync as F}from"fs";import{homedir as u}from"os";import{dirname as p,join as h}from"path";var L=["curl","npm","bun","brew"];function x(e){return L.includes(e)}function v(e,n=process.env){let r=R(n,"REASON_INSTALL_METHOD");if(x(r))return r;let t=e.replaceAll("\\","/").toLowerCase();if(t.includes("/.bun/install/global/"))return"bun";if(t.includes("/node_modules/"))return"npm";if(t.includes("/cellar/")||t.includes("/homebrew/"))return"brew";return"curl"}var f=86400000,_=7200000,W=900000,q=900000,J=30000,B=3600000,j=43200000,G="network-update-check.json",K="automatic-updates-declined.json",H="network-update.log";function g(e,n){return p(ot(e,n))}function S(e=process.env,n=u()){return T(h(g(e,n),K))}function b(e){if(!e||e.channel!=="production"||e.install_method!=="curl")return"no_receipt";return e.background_mode==="cli_only"?null:"background_updater"}function Y(e={}){let n=e.env??process.env,r=e.home??u(),t=e.executablePath??process.execPath;if(!(e.compiled??ys(e.main)))return"source_checkout";if(w({env:n,executablePath:t})!=="production")return"not_production";if(v(t,n)!=="curl")return"package_manager";let o=e.receipt===void 0?We(ot(n,r)):e.receipt,s=b(o);if(s)return s;if(S(n,r))return"declined";return"eligible"}async function jt(e,n=process.env,r=u()){if(e.background_mode!=="cli_only")return"background_updater";if(S(n,r))return"declined";if(b(e)!==null)return"none";let{installedEngineVersion:t}=await import("./agent-network-mnv1fm1c.js");return t(r)===null?"none":"reason_network"}function X(e){try{let n=JSON.parse(U(e,"utf8"));return n?.schema_version===1&&typeof n.next_at==="string"&&Number.isFinite(Date.parse(n.next_at))?n:null}catch{return null}}function z(e,n){y(p(e),{recursive:!0,mode:448});let r=`${e}.${process.pid}.${A()}.tmp`;try{F(r,`${JSON.stringify(n)}
3
+ `,{mode:384,flag:"wx"}),O(r,e)}finally{V(r,{force:!0})}}function Q(e={}){let n=h(g(e.env??process.env,e.home??u()),G),r=(e.now??new Date).getTime(),t=()=>{let i=(e.random??Math.random)();return Number.isFinite(i)?Math.min(Math.max(i,0),1):0},o=(i)=>z(n,{schema_version:1,next_at:new Date(i).toISOString()}),s=X(n),c=s?Date.parse(s.next_at):NaN;if(!s||c>r+f+_)return o(r+Math.floor(t()*f)),!1;if(r<c)return!1;return o(r+f+Math.round((t()*2-1)*_)),!0}function Z(e,n={}){let r=n.platform??process.platform,t=n.kill??Be,o=(c)=>{try{t(e,c,r)}catch{}};if(o("SIGTERM"),r==="win32")return;setTimeout(()=>o("SIGKILL"),n.graceMs??J).unref?.()}function ee(e={}){let n=e.env??process.env,r=e.platform??process.platform,t=h(g(n,e.home??u()),H);y(p(t),{recursive:!0,mode:448});let o=N(t,"w",384);return new Promise((s)=>{let c=!1,i=(d)=>{if(c)return;c=!0,clearTimeout(a),s(d)},l=I(e.executablePath??process.execPath,["update","--quiet"],{env:n,stdio:["ignore",o,o],windowsHide:!0,...Me(r)});M(o);let a=setTimeout(()=>{if(l.pid)Z(l.pid,{platform:r,...e.killGraceMs===void 0?{}:{graceMs:e.killGraceMs},...e.kill?{kill:e.kill}:{}});i(124)},e.timeoutMs??q);a.unref?.(),l.once("error",()=>i(127)),l.once("exit",(d,m)=>i(m?128:d??1))})}function te(e,n){return new Promise((r)=>{if(n.aborted)return r();let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),r()},{once:!0})})}function ne(e,n=()=>new Date){let r=-1/0,t="";return(o)=>{let s=n().getTime();if(s-r<B||o===t&&s-r<j)return;r=s,t=o,e(o)}}async function Gt(e,n,r,t={}){let o=t.env??process.env,s=t.home??u(),c=t.sleep??te,i=t.now??(()=>new Date);if(o.REASON_NETWORK_NO_UPDATE||o.TINCAN_NO_UPDATE)return;let l=ne(n,i);try{let a=t.refreshEngine??(async(m)=>(await import("./agent-network-mnv1fm1c.js")).refreshEngine({home:s,env:o,beforeRestart:m})),d=()=>l("moved the network engine to this release's pin; its daemon restarts on it");if(await a(d)){d();return}}catch(a){l(`couldn't move the network engine to this release's pin: ${a instanceof Error?a.message:String(a)}`)}while(!e.aborted){try{if(Y({env:o,home:s,...t.executablePath?{executablePath:t.executablePath}:{},...t.compiled===void 0?{}:{compiled:t.compiled}})==="eligible"&&Q({env:o,home:s,now:i(),...t.random?{random:t.random}:{}})){let d=await(t.update??(()=>ee({env:o,home:s,...t.executablePath?{executablePath:t.executablePath}:{}})))();if(d===0)await r();else l(`reason update failed (exit ${d}); the next try is in about a day`)}}catch(a){l(`automatic update: ${a instanceof Error?a.message:String(a)}`)}await c(t.tickMs??W,e)}}export{jt as automaticUpdatesFor,Gt as keepNetworkComputerCurrent};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./vm-hands-entry-lite-cmmb9k3g.js";import{Fe}from"./vm-hands-entry-lite-d12hx1dk.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{ve}from"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-rxydyqke.js";import{be}from"./vm-hands-entry-lite-0jy8mv4a.js";import{Ir}from"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-d431ffz0.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import{Ea,ka,xa,Kr,Jr}from"./vm-hands-entry-lite-jj7873n8.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import{createHash as y}from"crypto";var _={start:"/network/auth/start",poll:"/network/auth/poll",key:"/network/auth/key",teams:"/v3/network/teams",leave:"/v3/network/teams/leave",proof:"/v3/network/proof"};async function I(r,e,t={}){let o=AbortSignal.timeout(t.timeoutMs??30000),i=await fetch(r,{method:"POST",redirect:"error",signal:t.signal?AbortSignal.any([t.signal,o]):o,headers:{"content-type":"application/json","user-agent":Ir,...t.token?{authorization:`Bearer ${t.token}`}:{}},body:JSON.stringify(e)}),n=await i.json().catch(()=>({}));return{status:i.status,body:n&&typeof n==="object"?n:{}}}var d=(r)=>y("sha256").update(r).digest("hex");async function b(r,e,t,o,i=!1){let n={team_id:t.teamId,team_name:t.teamName,link:o,...i?{own_copy:!0}:{}},s=await I(`${r}${_.teams}`,n,{token:e}).catch(()=>null);return s!==null&&s.status>=200&&s.status<300}async function v(r,e,t,o,i={}){let n=Jr(t);if(!n||!i.ownCopy&&e.registered===d(n.secret))return!0;let s=Ea(i.home),a=ve(s)?await be({path:s}).catch(()=>null):null,c=(await r.team())?.name??e.team;if(a&&await b(a.apiOrigin,a.accessToken,{teamId:n.teamId,teamName:c},t,i.ownCopy)){if(!i.ownCopy&&e.registered!==d(n.secret))xa({...e,registered:d(n.secret)},i.home);return!0}return o?.stderr.write(T(`Your Reason account still lists ${Fe(c)}'s old link; signing in for this network refreshes it: reason network join '${t}'`)+`
3
- `),!1}var S=300000,R=21600000;async function xe(r,e,t,o){let i=ka(t),n=o?await r.team():null;if(i&&(!o||i.team===n?.name)){let{url:l}=await r.link(),u=Jr(l);if(!u||d(u.secret)===e.sent)return e;return await v(r,i,l,null,{ownCopy:!0,...t?{home:t}:{}})?{...e,sent:d(u.secret)}:e}if(!o||!n?.teamId||Kr(t)?.team===n.name)return e;let{url:s}=await r.link(),a=Jr(s);if(!a||a.teamId!==n.teamId.toLowerCase())return e;let c=d(a.secret);if(c===e.sent||e.refused?.link===c&&Date.now()<e.refused.until)return e;if(await(async()=>{let l=await o.agentNetwork();if(l.team===n.name||l.link&&Jr(l.link)?.teamId===a.teamId)return!1;return await o.registerNetworkTeam({team_id:a.teamId,team_name:n.name,link:s,own_copy:!0}),!0})().catch(()=>!1))return{sent:c,refused:null};let g=e.refused?.link===c?e.refused.tries+1:1;return{...e,refused:{link:c,tries:g,until:Date.now()+Math.min(R,S*2**Math.min(g-1,10))}}}var T=(r)=>process.stdout.isTTY?`\x1B[2m${r}\x1B[22m`:r;export{xe as sendTeamLink};
2
+ import"./vm-hands-entry-lite-cmmb9k3g.js";import{Fe}from"./vm-hands-entry-lite-34b4tws6.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{ve}from"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-rxydyqke.js";import{be}from"./vm-hands-entry-lite-7r27208j.js";import{Ir}from"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-tnj3483k.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import{Ea,ka,xa,Kr,Jr}from"./vm-hands-entry-lite-jj7873n8.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import{createHash as k}from"crypto";var _={start:"/network/auth/start",poll:"/network/auth/poll",key:"/network/auth/key",teams:"/v3/network/teams",leave:"/v3/network/teams/leave",proof:"/v3/network/proof"};async function I(r,e,t={}){let o=AbortSignal.timeout(t.timeoutMs??30000),i=await fetch(r,{method:"POST",redirect:"error",signal:t.signal?AbortSignal.any([t.signal,o]):o,headers:{"content-type":"application/json","user-agent":Ir,...t.token?{authorization:`Bearer ${t.token}`}:{}},body:JSON.stringify(e)}),n=await i.json().catch(()=>({}));return{status:i.status,body:n&&typeof n==="object"?n:{}}}var u=(r)=>k("sha256").update(r).digest("hex");async function b(r,e,t,o,i=!1){let n={team_id:t.teamId,team_name:t.teamName,link:o,...i?{own_copy:!0}:{}},s=await I(`${r}${_.teams}`,n,{token:e}).catch(()=>null);return s!==null&&s.status>=200&&s.status<300}async function v(r,e,t,o,i={}){let n=Jr(t);if(!n||!i.ownCopy&&e.registered===u(n.secret))return!0;let s=Ea(i.home),a=ve(s)?await be({path:s}).catch(()=>null):null,c=(await r.team())?.name??e.team;if(a&&await b(a.apiOrigin,a.accessToken,{teamId:n.teamId,teamName:c},t,i.ownCopy)){if(!i.ownCopy&&e.registered!==u(n.secret))xa({...e,registered:u(n.secret)},i.home);return!0}return o?.stderr.write(T(`Your Reason account still lists ${Fe(c)}'s old link; signing in for this network refreshes it: reason network join '${t}'`)+`
3
+ `),!1}var S=300000,R=21600000;async function xe(r,e,t,o){let i=ka(t),n=o?await r.team():null;if(i&&(!o||i.team===n?.name)){let{url:l}=await r.link(),d=Jr(l);if(!d||u(d.secret)===e.sent)return e;return await v(r,i,l,null,{ownCopy:!0,...t?{home:t}:{}})?{...e,sent:u(d.secret)}:e}if(!o||!n?.teamId||Kr(t)?.team===n.name)return e;let{url:s}=await r.link(),a=Jr(s);if(!a||a.teamId!==n.teamId.toLowerCase())return e;let c=u(a.secret);if(c===e.sent||e.refused?.link===c&&Date.now()<e.refused.until)return e;if(await(async()=>{let l=await o.agentNetwork();if(l.team===n.name||l.link&&Jr(l.link)?.teamId===a.teamId)return!1;return await o.registerNetworkTeam({team_id:a.teamId,team_name:n.name,link:s,own_copy:!0}),!0})().catch(()=>!1))return{sent:c,refused:null};let g=e.refused?.link===c?e.refused.tries+1:1;return{...e,refused:{link:c,tries:g,until:Date.now()+Math.min(R,S*2**Math.min(g-1,10))}}}var T=(r)=>process.stdout.isTTY?`\x1B[2m${r}\x1B[22m`:r;export{xe as sendTeamLink};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{sl,Ac,Rl,al,Tl}from"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{al as allowMacPermissions,Rl as permissionsSummary,Ac as readMacPermissions,sl as reasonIdentity,Tl as runPermissionsCli};
2
+ import{sl,Ac,Rl,al,Tl}from"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{al as allowMacPermissions,Rl as permissionsSummary,Ac as readMacPermissions,sl as reasonIdentity,Tl as runPermissionsCli};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ke,de,j,ze,ns,En,is,qe,Ni,Li,os,kn,Ie,ss,xn}from"./vm-hands-entry-lite-mn8rjpxq.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-1w39j6vz.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{ke as WORKER_SERVICE_ENV,j as WorkerServiceError,En as connectServiceLabel,de as defaultWorkerServiceHost,kn as installWorkerService,qe as installedWorkerService,is as isConnectServiceLabel,xn as removeWorkerService,Ie as restartWorkerService,ss as retargetWorkerServiceLogs,Ni as retireLegacyWorkerService,os as workerServiceDefinitionCurrent,ze as workerServiceLauncher,Li as workerServiceProcessRunning,ns as workerServiceRetargetPending};
2
+ import{ke,de,j,ze,ns,En,is,qe,Ni,Li,os,kn,Ie,ss,xn}from"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-88dxn9b5.js";import"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-z65xva21.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-rqfhfp09.js";import"./vm-hands-entry-lite-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import"./vm-hands-entry-lite-rxydyqke.js";export{ke as WORKER_SERVICE_ENV,j as WorkerServiceError,En as connectServiceLabel,de as defaultWorkerServiceHost,kn as installWorkerService,qe as installedWorkerService,is as isConnectServiceLabel,xn as removeWorkerService,Ie as restartWorkerService,ss as retargetWorkerServiceLogs,Ni as retireLegacyWorkerService,os as workerServiceDefinitionCurrent,ze as workerServiceLauncher,Li as workerServiceProcessRunning,ns as workerServiceRetargetPending};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-z65xva21.js";import{w,Ve,kc}from"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{Q}from"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-rxydyqke.js";import{me}from"./vm-hands-entry-lite-0jy8mv4a.js";import{g}from"./vm-hands-entry-lite-1w39j6vz.js";import{ir}from"./vm-hands-entry-lite-d431ffz0.js";import{mn,rt}from"./vm-hands-entry-lite-xfak34av.js";import{f,S,nr,Z,fe,Qi,eo}from"./vm-hands-entry-lite-frg1b1rg.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-j8s2vqpf.js";import"./vm-hands-entry-lite-61p78r72.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-997y1m1r.js";import"./vm-hands-entry-lite-pe374cn6.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-thstg177.js";import"./vm-hands-entry-lite-zj9esd2g.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-1wxwsb3f.js";import{We}from"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-mn8rjpxq.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-43bv9hf0.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-41nn0vbf.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-srtqjjqb.js";import"./vm-hands-entry-lite-jgwjt10t.js";import"./vm-hands-entry-lite-284z7ct8.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-88dxn9b5.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{t,o,d,n,c,i}from"./vm-hands-entry-lite-zpvr7wc6.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import{createHash as Ye,randomBytes as Qe}from"crypto";import{readFileSync as Ze,realpathSync as ye,renameSync as en,unlinkSync as nn,writeFileSync as tn}from"fs";import{dirname as rn,join as we}from"path";import{spawnSync as xe}from"child_process";import{accessSync as $e,constants as Ue,existsSync as J,mkdirSync as Le,readFileSync as Te,renameSync as Ee,writeFileSync as Oe}from"fs";import{homedir as De}from"os";import{delimiter as Ne,dirname as Fe,join as D}from"path";import{existsSync as Me,readFileSync as Ae}from"fs";import{join as Pe}from"path";var Ie=`---
2
+ import"./vm-hands-entry-lite-cmmb9k3g.js";import"./vm-hands-entry-lite-z65xva21.js";import{w,Ve,kc}from"./vm-hands-entry-lite-33at6g06.js";import"./vm-hands-entry-lite-kbnxk71q.js";import{Q}from"./vm-hands-entry-lite-2qfmabqn.js";import"./vm-hands-entry-lite-rxydyqke.js";import{me}from"./vm-hands-entry-lite-7r27208j.js";import{g}from"./vm-hands-entry-lite-rqfhfp09.js";import{ir}from"./vm-hands-entry-lite-tnj3483k.js";import{mn,rt}from"./vm-hands-entry-lite-xfak34av.js";import{f,S,nr,Z,fe,Qi,eo}from"./vm-hands-entry-lite-ngn4tafr.js";import"./vm-hands-entry-lite-fxptf351.js";import"./vm-hands-entry-lite-gxf2r5en.js";import"./vm-hands-entry-lite-pt19vacn.js";import"./vm-hands-entry-lite-gcqqnnze.js";import"./vm-hands-entry-lite-s93f3pbv.js";import"./vm-hands-entry-lite-ngry8nkq.js";import"./vm-hands-entry-lite-997y1m1r.js";import"./vm-hands-entry-lite-6vnjgy77.js";import"./vm-hands-entry-lite-13nx02p7.js";import"./vm-hands-entry-lite-t86kt9jz.js";import"./vm-hands-entry-lite-t43bz0ey.js";import"./vm-hands-entry-lite-cc8hwgxc.js";import"./vm-hands-entry-lite-dy204qh4.js";import{We}from"./vm-hands-entry-lite-y0jtj8zz.js";import"./vm-hands-entry-lite-af45ma9p.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-bsk184m7.js";import"./vm-hands-entry-lite-sh4mqy93.js";import"./vm-hands-entry-lite-3q2ng4e9.js";import"./vm-hands-entry-lite-432khjd5.js";import"./vm-hands-entry-lite-chq0qx9f.js";import"./vm-hands-entry-lite-1eyg750p.js";import"./vm-hands-entry-lite-1xhpn3hw.js";import"./vm-hands-entry-lite-284z7ct8.js";import"./vm-hands-entry-lite-b1vanmtv.js";import"./vm-hands-entry-lite-yg4dk99m.js";import"./vm-hands-entry-lite-88dxn9b5.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{t,o,d,n,c,i}from"./vm-hands-entry-lite-zpvr7wc6.js";import"./vm-hands-entry-lite-pg7nnyc6.js";import{createHash as Ye,randomBytes as Qe}from"crypto";import{readFileSync as Ze,realpathSync as ye,renameSync as en,unlinkSync as nn,writeFileSync as tn}from"fs";import{dirname as rn,join as we}from"path";import{spawnSync as xe}from"child_process";import{accessSync as $e,constants as Ue,existsSync as J,mkdirSync as Le,readFileSync as Te,renameSync as Ee,writeFileSync as Oe}from"fs";import{homedir as De}from"os";import{delimiter as Ne,dirname as Fe,join as D}from"path";import{existsSync as Me,readFileSync as Ae}from"fs";import{join as Pe}from"path";var Ie=`---
3
3
  name: reason
4
4
  description: Integrate software with Reason's public REST API using a scoped API key. Use for API clients, CI, service integrations, or cloud coding-session automation.
5
5
  ---
@@ -63,7 +63,7 @@ retired MCP configuration that can be cleaned up, and automatic updates.
63
63
  `,sn=5000,an=300000,cn=n({version:i(1),key:t(),at:o(),self:n({principal_type:t(),user_id:t().optional(),user_name:t().nullish(),email:t().nullish(),org_id:t(),organization_name:t().nullish(),organization_slug:t().nullish(),mcp_connections:d(n({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})}),Re=(e)=>`${e.apiOrigin}
64
64
  ${Ye("sha256").update(e.accessToken).digest("hex")}`;function ln(e,r,a){try{let u=cn.safeParse(JSON.parse(Ze(e,"utf8")));if(!u.success||u.data.key!==Re(r))return null;let l=a-u.data.at;return l>=0&&l<an?u.data.self:null}catch{return null}}function un(e,r,a,u){let l=`${e}.${process.pid}.${Qe(6).toString("hex")}.tmp`;try{let m={version:1,key:Re(r),at:u,self:a};tn(l,`${JSON.stringify(m)}
65
65
  `,{mode:384,flag:"wx"}),en(l,e)}catch{try{nn(l)}catch{}}}var dn=30000;function pn(e,r=Date.now(),a=null){let u=rt(e),l=(()=>{if(u?.state!=="connected"&&u?.state!=="starting")return!1;try{return process.kill(u.pid,0),!0}catch{return!1}})(),m=l&&u?.state==="connected",R=(k)=>m&&r-k>=0&&r-k<dn,v=he.safeParse(u?.fullDiskAccess),_=mn(u,a,r);return{..._?{permission_recovery:_}:{},full_disk_access:v.success&&R(v.data.checkedAt)?v.data.status:"unknown",keep_awake:{enabled:nr(e)==="battery_and_ac",holding:u?.idleSleepHold===!0&&R(Date.parse(u.lastHeartbeatAt??""))},executable:l&&v.success?v.data.executablePath:null}}function gn(e=w()){if(process.platform!=="darwin")return null;let r=Z(we(fe(ye(s()),e),"worker.json"));return r?pn(f(r).daemon,Date.now(),S(r)):null}var fn={background_updater:"enabled",reason_network:"enabled, daily by Reason Network",declined:"disabled (installed with --background-mode cli_only)",none:"disabled"},Ce={connected:"connected",starting:"starting",reconnecting:"reconnecting",stopping:"stopping",not_running:"not running",removed:"removed from Reason (run `reason connect` to connect it again)"};async function it(e,r={}){let a=r.io??{stdout:process.stdout,stderr:process.stderr};if(e.includes("--help")||e.includes("-h"))return a.stdout.write(on),0;if(e.some((m)=>m!=="--json"))return a.stderr.write(`Usage: reason status [--json]
66
- `),1;let u=new AbortController,l=setTimeout(()=>u.abort(Error("timed out reading the account")),sn);try{let m=r.now?.()??new Date,R=performance.now(),v=R,_=()=>{let p=performance.now(),P=Math.round(p-v);return v=p,P},k=null,N=(p)=>(k=p instanceof Error?p.message:String(p),null),b=await ir(r,u.signal).catch(N),q=_(),C=b?.credentialKind==="api_key",M=b&&!C?we(rn(Q(r.env??process.env)),"status-account.json"):null,x=b&&M&&e.includes("--json")?ln(M,b,m.getTime()):null,h=x??(b?await(r.getSelf??((p,P)=>new me(p).self(P)))(b,u.signal).catch(N):null);if(b&&h&&!x&&M)un(M,b,h,m.getTime());let W=_(),F=r.manager??new K,j=e.includes("--json")?[]:F.statuses(),U=(r.loadReceipt??We)(),z=U?await(r.automaticUpdates??(async(p)=>p.background_mode==="cli_only"?(await import("./network-auto-update-tk104maa.js")).automaticUpdatesFor(p,r.env??process.env,r.home):"background_updater"))(U).catch(()=>U.background_mode==="cli_only"?"none":"background_updater"):null,B=await(r.readConnection??(()=>eo({channel:r.channel})))().catch(()=>null),I=null;try{if(B)I=(r.readConnectionMacState??(()=>gn(r.channel??w())))()}catch{}let y=B&&I?{...B,...I}:B,G=(()=>{try{return(r.readDisconnected??(()=>Qi(ye(s()),r.channel??w())))()}catch{return!1}})(),_e=_(),ne=h?{id:h.org_id,name:h.organization_name??null,slug:h.organization_slug??null}:null,T=h?{id:h.user_id??null,name:(C?h.service_user_name:h.user_name)??null,email:h.email??null,credential:C?"api_key":"login"}:null,X=r.channel??w(),L={version:g,channel:X,api_origin:b?.apiOrigin??Ve(X),account:T,account_error:k,organization:ne,mcp:j.map((p)=>({client:p.id,label:p.label,status:le(p),installed_at:p.installed?F.installationPath(p.id):null,last_used_at:h?ue(p,h):null})),connection:y,disconnected:G,installation:U&&z?{background_mode:U.background_mode,automatic_updates:z==="background_updater"||z==="reason_network",automatic_updates_by:z,future_device_consent:U.device_consent?.decision??"disabled"}:null,timings_ms:{process:Math.round(R),credentials:q,account:W,local:_e,total:Math.round(performance.now()-R)}};if(e.includes("--json"))return a.stdout.write(`${JSON.stringify(L,null,2)}
66
+ `),1;let u=new AbortController,l=setTimeout(()=>u.abort(Error("timed out reading the account")),sn);try{let m=r.now?.()??new Date,R=performance.now(),v=R,_=()=>{let p=performance.now(),P=Math.round(p-v);return v=p,P},k=null,N=(p)=>(k=p instanceof Error?p.message:String(p),null),b=await ir(r,u.signal).catch(N),q=_(),C=b?.credentialKind==="api_key",M=b&&!C?we(rn(Q(r.env??process.env)),"status-account.json"):null,x=b&&M&&e.includes("--json")?ln(M,b,m.getTime()):null,h=x??(b?await(r.getSelf??((p,P)=>new me(p).self(P)))(b,u.signal).catch(N):null);if(b&&h&&!x&&M)un(M,b,h,m.getTime());let W=_(),F=r.manager??new K,j=e.includes("--json")?[]:F.statuses(),U=(r.loadReceipt??We)(),z=U?await(r.automaticUpdates??(async(p)=>p.background_mode==="cli_only"?(await import("./network-auto-update-3m94436w.js")).automaticUpdatesFor(p,r.env??process.env,r.home):"background_updater"))(U).catch(()=>U.background_mode==="cli_only"?"none":"background_updater"):null,B=await(r.readConnection??(()=>eo({channel:r.channel})))().catch(()=>null),I=null;try{if(B)I=(r.readConnectionMacState??(()=>gn(r.channel??w())))()}catch{}let y=B&&I?{...B,...I}:B,G=(()=>{try{return(r.readDisconnected??(()=>Qi(ye(s()),r.channel??w())))()}catch{return!1}})(),_e=_(),ne=h?{id:h.org_id,name:h.organization_name??null,slug:h.organization_slug??null}:null,T=h?{id:h.user_id??null,name:(C?h.service_user_name:h.user_name)??null,email:h.email??null,credential:C?"api_key":"login"}:null,X=r.channel??w(),L={version:g,channel:X,api_origin:b?.apiOrigin??Ve(X),account:T,account_error:k,organization:ne,mcp:j.map((p)=>({client:p.id,label:p.label,status:le(p),installed_at:p.installed?F.installationPath(p.id):null,last_used_at:h?ue(p,h):null})),connection:y,disconnected:G,installation:U&&z?{background_mode:U.background_mode,automatic_updates:z==="background_updater"||z==="reason_network",automatic_updates_by:z,future_device_consent:U.device_consent?.decision??"disabled"}:null,timings_ms:{process:Math.round(R),credentials:q,account:W,local:_e,total:Math.round(performance.now()-R)}};if(e.includes("--json"))return a.stdout.write(`${JSON.stringify(L,null,2)}
67
67
  `),0;if(X==="staging")a.stdout.write(`Reason ${g} \xB7 channel: STAGING
68
68
  `),a.stdout.write(`API: ${L.api_origin}
69
69
  `);else a.stdout.write(`Reason ${g}
@@ -79,7 +79,7 @@ This computer
79
79
  `),y.version)a.stdout.write(`Version: ${y.version}${y.version===g?"":` (${g} is installed; \`reason connect\` restarts it on that)`}
80
80
  `);if(a.stdout.write(`Folder: ${y.folder}
81
81
  `),a.stdout.write(`Sessions: ${y.sessions_running===null?"":`${y.sessions_running} running, `}${y.sessions_max===null?"every Session you start":y.sessions_max===1?"one at a time":`up to ${y.sessions_max} at once`}
82
- `),I){let p=I,P=await(r.readPermissionsSummary??(async()=>{let{permissionsSummary:Se,readMacPermissions:ve,reasonIdentity:be}=await import("./permissions-ywh8x4dq.js"),{macScreenStatus:ke}=await import("./local-display-mac-h5yz0ydd.js");return Se(await ve({identity:()=>be(),grants:ke,worker:async()=>p}))}))().catch(()=>null);if(P)a.stdout.write(`${P}
82
+ `),I){let p=I,P=await(r.readPermissionsSummary??(async()=>{let{permissionsSummary:Se,readMacPermissions:ve,reasonIdentity:be}=await import("./permissions-scffy1px.js"),{macScreenStatus:ke}=await import("./local-display-mac-h5yz0ydd.js");return Se(await ve({identity:()=>be(),grants:ke,worker:async()=>p}))}))().catch(()=>null);if(P)a.stdout.write(`${P}
83
83
  `);a.stdout.write(`Keep awake: ${I.keep_awake.enabled?"on":"off"}${I.keep_awake.holding?" (holding)":""}
84
84
  `)}if(y.service)a.stdout.write(`Logs: ${y.service.logs}
85
85
  `);for(let p of y.workspaces??[]){let P=p.state==="removed"?"removed from that workspace":p.blocked?"offline (this computer is outside that workspace's allowed networks)":p.device_id?Ce[p.state]:"connecting";a.stdout.write(`Also in workspace ${p.name??p.organization_id}${p.account?" (another Reason account's)":""}: ${P}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{g,Ir,Hc,Il,ys}from"./vm-hands-entry-lite-1w39j6vz.js";export{Ir as CLI_USER_AGENT,g as CLI_VERSION,Hc as CLI_VERSION_PATTERN,Il as compareCliVersions,ys as isCompiledRelease};
2
+ import{g,Ir,Hc,Il,ys}from"./vm-hands-entry-lite-rqfhfp09.js";export{Ir as CLI_USER_AGENT,g as CLI_VERSION,Hc as CLI_VERSION_PATTERN,Il as compareCliVersions,ys as isCompiledRelease};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{D,Dn,ds,Pr,ps,hs}from"./vm-hands-entry-lite-13nx02p7.js";import{wc,bc,A,Zo}from"./vm-hands-entry-lite-pe374cn6.js";import{Ue}from"./vm-hands-entry-lite-chq0qx9f.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as xt,spawn as _e}from"child_process";import{existsSync as vt}from"fs";import{connect as Et}from"net";function dt(){let e=new Set,t=null,s=(n)=>({holder:t?.viewer??null,you:t===n,same_user:Boolean(t?.viewer&&n.viewer&&t.viewer.user_id===n.viewer.user_id)}),i=()=>{for(let n of e)n.notify(s(n))};return{join(n){return e.add(n),n.notify(s(n)),()=>{if(!e.delete(n))return;if(t!==n)return;t=null,i()}},claim(n){if(t===n||!e.has(n))return;t=n,i()}}}var Ce=dt();import{spawn as pt}from"child_process";import{existsSync as ft}from"fs";import{connect as mt}from"net";import{join as j}from"path";var ze="reason_desktop",N={sampleRate:48000,channels:2,codec:"opus"},ht=5000,yt=107,gt=262144,Vo=(e)=>j(e,"native"),Kt=(e)=>`unix:${e}`;function he(e,t=1000){if(!ft(e))return Promise.resolve(!1);return new Promise((s)=>{let i=mt({path:e}),n=(l)=>{i.destroy(),s(l)};i.setTimeout(t,()=>n(!1)),i.once("error",()=>n(!1)),i.once("close",()=>n(!1)),i.once("connect",()=>n(!0))})}async function _c(e,t){if(!t)return null;let s=Vo(e);if(Buffer.byteLength(s)>yt||/["'\\\s]/.test(s))return null;try{if(await he(s))return s;let i=pt(t,["--daemonize=no","--system=no","--use-pid-file=no","--exit-idle-time=-1","--disallow-exit=yes","--realtime=no","--high-priority=no","--disallow-module-loading=yes","--log-level=warning",`--log-target=file:${j(e,"pulseaudio.log")}`,"-n",`--load=module-native-protocol-unix socket="${s}" auth-anonymous=1 auth-cookie-enabled=0`,`--load=module-null-sink sink_name=${ze} rate=${N.sampleRate} channels=${N.channels} sink_properties=device.description=Reason_desktop`],{detached:!0,stdio:"ignore",env:{HOME:e,PATH:"/usr/bin:/bin",XDG_RUNTIME_DIR:e,PULSE_RUNTIME_PATH:j(e,"runtime"),PULSE_STATE_PATH:j(e,"state")}});Ue(i.pid);let n=!1;i.once("error",()=>{n=!0}),i.once("exit",()=>{n=!0}),i.unref();let l=Date.now()+ht;while(Date.now()<l){if(await he(s))return s;if(n)return await he(s)?s:null;await new Promise((c)=>setTimeout(c,50))}if(!n)i.kill("SIGKILL");return null}catch{return null}}function Oe(){let{sampleRate:e,channels:t}=N;return["-hide_banner","-loglevel","error","-nostdin","-fflags","nobuffer","-f","pulse","-sample_rate",String(e),"-channels",String(t),"-fragment_size",String(e*t*2/50),"-i",`${ze}.monitor`,"-vn","-ac",String(t),"-ar",String(e),"-c:a","libopus","-b:a","64k","-application","lowdelay","-frame_duration","20","-flush_packets","1","-page_duration","20000","-f","ogg","pipe:1"]}var bt=[79,103,103,83],wt=Buffer.from("OpusHead"),_t=Buffer.from("OpusTags"),Be=(e,t)=>e.byteLength>=t.byteLength&&t.every((s,i)=>e[i]===s);class ye extends Error{constructor(e){super(e);this.name="OggProtocolError"}}class ge{buffer=new Uint8Array(0);partial=[];partialBytes=0;push(e){let t=new Uint8Array(this.buffer.byteLength+e.byteLength);t.set(this.buffer),t.set(e,this.buffer.byteLength);let s=[],i=0;while(t.byteLength-i>=27){if(bt.some((b,f)=>t[i+f]!==b)||t[i+4]!==0)throw new ye("invalid_page");let n=(t[i+5]&1)!==0,l=t[i+26];if(t.byteLength-i<27+l)break;let c=t.subarray(i+27,i+27+l),h=c.reduce((b,f)=>b+f,0),g=27+l+h;if(t.byteLength-i<g)break;if(!n&&this.partialBytes>0)this.resetPartial();let m=n&&this.partialBytes===0,p=i+27+l,w=p;for(let b of c){if(p+=b,b===255)continue;if(this.appendPartial(t.subarray(w,p),m),w=p,!m){let f=this.takePartial();if(f.byteLength>0&&!Be(f,wt)&&!Be(f,_t))s.push(f)}m=!1,this.resetPartial()}if(w<p)this.appendPartial(t.subarray(w,p),m);i+=g}return this.buffer=t.slice(i),s}appendPartial(e,t){if(t||e.byteLength===0)return;if(this.partialBytes+=e.byteLength,this.partialBytes>gt)throw new ye("packet_too_large");this.partial.push(e.slice())}takePartial(){if(this.partial.length===1)return this.partial[0];let e=new Uint8Array(this.partialBytes),t=0;for(let s of this.partial)e.set(s,t),t+=s.byteLength;return e}resetPartial(){this.partial=[],this.partialBytes=0}}import{spawn as kt}from"child_process";var Ve=1048576,St=String.raw`
2
+ import{D,Dn,ds,Pr,ps,hs}from"./vm-hands-entry-lite-13nx02p7.js";import{wc,bc,A,Zo}from"./vm-hands-entry-lite-6vnjgy77.js";import{Ue}from"./vm-hands-entry-lite-chq0qx9f.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as xt,spawn as _e}from"child_process";import{existsSync as vt}from"fs";import{connect as Et}from"net";function dt(){let e=new Set,t=null,s=(n)=>({holder:t?.viewer??null,you:t===n,same_user:Boolean(t?.viewer&&n.viewer&&t.viewer.user_id===n.viewer.user_id)}),i=()=>{for(let n of e)n.notify(s(n))};return{join(n){return e.add(n),n.notify(s(n)),()=>{if(!e.delete(n))return;if(t!==n)return;t=null,i()}},claim(n){if(t===n||!e.has(n))return;t=n,i()}}}var Ce=dt();import{spawn as pt}from"child_process";import{existsSync as ft}from"fs";import{connect as mt}from"net";import{join as j}from"path";var ze="reason_desktop",N={sampleRate:48000,channels:2,codec:"opus"},ht=5000,yt=107,gt=262144,Vo=(e)=>j(e,"native"),Kt=(e)=>`unix:${e}`;function he(e,t=1000){if(!ft(e))return Promise.resolve(!1);return new Promise((s)=>{let i=mt({path:e}),n=(l)=>{i.destroy(),s(l)};i.setTimeout(t,()=>n(!1)),i.once("error",()=>n(!1)),i.once("close",()=>n(!1)),i.once("connect",()=>n(!0))})}async function _c(e,t){if(!t)return null;let s=Vo(e);if(Buffer.byteLength(s)>yt||/["'\\\s]/.test(s))return null;try{if(await he(s))return s;let i=pt(t,["--daemonize=no","--system=no","--use-pid-file=no","--exit-idle-time=-1","--disallow-exit=yes","--realtime=no","--high-priority=no","--disallow-module-loading=yes","--log-level=warning",`--log-target=file:${j(e,"pulseaudio.log")}`,"-n",`--load=module-native-protocol-unix socket="${s}" auth-anonymous=1 auth-cookie-enabled=0`,`--load=module-null-sink sink_name=${ze} rate=${N.sampleRate} channels=${N.channels} sink_properties=device.description=Reason_desktop`],{detached:!0,stdio:"ignore",env:{HOME:e,PATH:"/usr/bin:/bin",XDG_RUNTIME_DIR:e,PULSE_RUNTIME_PATH:j(e,"runtime"),PULSE_STATE_PATH:j(e,"state")}});Ue(i.pid);let n=!1;i.once("error",()=>{n=!0}),i.once("exit",()=>{n=!0}),i.unref();let l=Date.now()+ht;while(Date.now()<l){if(await he(s))return s;if(n)return await he(s)?s:null;await new Promise((c)=>setTimeout(c,50))}if(!n)i.kill("SIGKILL");return null}catch{return null}}function Oe(){let{sampleRate:e,channels:t}=N;return["-hide_banner","-loglevel","error","-nostdin","-fflags","nobuffer","-f","pulse","-sample_rate",String(e),"-channels",String(t),"-fragment_size",String(e*t*2/50),"-i",`${ze}.monitor`,"-vn","-ac",String(t),"-ar",String(e),"-c:a","libopus","-b:a","64k","-application","lowdelay","-frame_duration","20","-flush_packets","1","-page_duration","20000","-f","ogg","pipe:1"]}var bt=[79,103,103,83],wt=Buffer.from("OpusHead"),_t=Buffer.from("OpusTags"),Be=(e,t)=>e.byteLength>=t.byteLength&&t.every((s,i)=>e[i]===s);class ye extends Error{constructor(e){super(e);this.name="OggProtocolError"}}class ge{buffer=new Uint8Array(0);partial=[];partialBytes=0;push(e){let t=new Uint8Array(this.buffer.byteLength+e.byteLength);t.set(this.buffer),t.set(e,this.buffer.byteLength);let s=[],i=0;while(t.byteLength-i>=27){if(bt.some((b,f)=>t[i+f]!==b)||t[i+4]!==0)throw new ye("invalid_page");let n=(t[i+5]&1)!==0,l=t[i+26];if(t.byteLength-i<27+l)break;let c=t.subarray(i+27,i+27+l),h=c.reduce((b,f)=>b+f,0),g=27+l+h;if(t.byteLength-i<g)break;if(!n&&this.partialBytes>0)this.resetPartial();let m=n&&this.partialBytes===0,p=i+27+l,w=p;for(let b of c){if(p+=b,b===255)continue;if(this.appendPartial(t.subarray(w,p),m),w=p,!m){let f=this.takePartial();if(f.byteLength>0&&!Be(f,wt)&&!Be(f,_t))s.push(f)}m=!1,this.resetPartial()}if(w<p)this.appendPartial(t.subarray(w,p),m);i+=g}return this.buffer=t.slice(i),s}appendPartial(e,t){if(t||e.byteLength===0)return;if(this.partialBytes+=e.byteLength,this.partialBytes>gt)throw new ye("packet_too_large");this.partial.push(e.slice())}takePartial(){if(this.partial.length===1)return this.partial[0];let e=new Uint8Array(this.partialBytes),t=0;for(let s of this.partial)e.set(s,t),t+=s.byteLength;return e}resetPartial(){this.partial=[],this.partialBytes=0}}import{spawn as kt}from"child_process";var Ve=1048576,St=String.raw`
3
3
  import gi, json, os, sys
4
4
  gi.require_version("Gtk", "3.0")
5
5
  from gi.repository import Gtk, Gdk, GLib
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Xt,yc,le,Sr,Er,A}from"./vm-hands-entry-lite-pe374cn6.js";import{ue}from"./vm-hands-entry-lite-cc8hwgxc.js";import{Rr}from"./vm-hands-entry-lite-13nx02p7.js";import{Tr}from"./vm-hands-entry-lite-thstg177.js";import{Bi}from"./vm-hands-entry-lite-zj9esd2g.js";import{Ue,wr,br,Yo}from"./vm-hands-entry-lite-chq0qx9f.js";import{Kt}from"./vm-hands-entry-lite-srtqjjqb.js";import{qr,ba}from"./vm-hands-entry-lite-sh4mqy93.js";import{Te,jt}from"./vm-hands-entry-lite-41nn0vbf.js";import{de,ze}from"./vm-hands-entry-lite-mn8rjpxq.js";import{$r}from"./vm-hands-entry-lite-fxptf351.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{B}from"./vm-hands-entry-lite-pg7nnyc6.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{spawn as S,spawnSync as De}from"child_process";import{createHash as Le,randomUUID as re}from"crypto";import{closeSync as $e,copyFileSync as J,existsSync as C,fstatSync as Be,mkdirSync as z,openSync as We,readdirSync as N,readFileSync as W,readlinkSync as qe,renameSync as ne,rmSync as Fe,statSync as He,writeFileSync as Ge}from"fs";import{connect as je}from"net";import{tmpdir as P,userInfo as ie}from"os";import{basename as V,delimiter as Xe,dirname as M,join as m}from"path";var q=`import { spawn, execFileSync } from "node:child_process";
2
+ import{Xt,yc,le,Sr,Er,A}from"./vm-hands-entry-lite-6vnjgy77.js";import{ue}from"./vm-hands-entry-lite-cc8hwgxc.js";import{Rr}from"./vm-hands-entry-lite-13nx02p7.js";import{Tr}from"./vm-hands-entry-lite-t86kt9jz.js";import{Bi}from"./vm-hands-entry-lite-t43bz0ey.js";import{Ue,wr,br,Yo}from"./vm-hands-entry-lite-chq0qx9f.js";import{Kt}from"./vm-hands-entry-lite-1eyg750p.js";import{qr,ba}from"./vm-hands-entry-lite-sh4mqy93.js";import{Te,jt}from"./vm-hands-entry-lite-432khjd5.js";import{de,ze}from"./vm-hands-entry-lite-af45ma9p.js";import{$r}from"./vm-hands-entry-lite-fxptf351.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{B}from"./vm-hands-entry-lite-pg7nnyc6.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{spawn as S,spawnSync as De}from"child_process";import{createHash as Le,randomUUID as re}from"crypto";import{closeSync as $e,copyFileSync as J,existsSync as C,fstatSync as Be,mkdirSync as z,openSync as We,readdirSync as N,readFileSync as W,readlinkSync as qe,renameSync as ne,rmSync as Fe,statSync as He,writeFileSync as Ge}from"fs";import{connect as je}from"net";import{tmpdir as P,userInfo as ie}from"os";import{basename as V,delimiter as Xe,dirname as M,join as m}from"path";var q=`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";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import{io}from"./vm-hands-entry-lite-cmmb9k3g.js";import{spawnSync as p}from"child_process";import{createHash as de}from"crypto";import{chmodSync as ge,closeSync as pe,existsSync as w,linkSync as fe,lstatSync as me,mkdirSync as Q,mkdtempSync as he,openSync as we,readdirSync as ye,readFileSync as Ee,readSync as ke,realpathSync as Ne,renameSync as E,rmSync as k,statSync as Y,symlinkSync as W,writeFileSync as I}from"fs";import{connect as Se}from"net";import{homedir as m}from"os";import{basename as Z,dirname as R,join as u}from"path";import{inflateRawSync as be}from"zlib";var oe=new Set(["<","\u02C2","\u1438","\u2039","\u3008","\u276C","\u276E","\u2770","\u16B2","\u2D66","\uD800\uDF2D","\uD81A\uDEEC","\uD834\uDE36","\u27E8","\u27EA","\u29FC","\u3008","\u300A","\uFE64","\uFF1C"]),D=(e)=>e===" "||e==="\t"||e===`
3
3
  `||e==="\f"||e==="\r",ie=(e)=>e.length===1&&e>="!"&&e<="~",G=(e)=>e.length===1&&/[A-Za-z]/.test(e);function J(e){let n=Array.from(e),t=(r)=>{let s=r+Math.min(n.length-r,64),o=r;while(o<s&&(D(n[o])||n[o]==="/"))o+=1;let i=o-r,a=[];while(o<s&&!D(n[o])&&n[o]!==">"&&n[o]!=="\uFF1E")a.push(n[o++]);return i+a.length===s-r&&n.length-r>64||!a.every(ie)||ae(a)};return n.map((r,s)=>oe.has(r)&&t(s+1)?"[":r).join("")}function ae(e){let n=1;for(let t of e){let r=t==="0"?"o":t==="3"?"e":t==="4"||t==="@"?"a":t==="5"||t==="$"?"s":G(t)?t.toLowerCase():t,s="reason".indexOf(r),o=s<0?0:1<<s;if(n=1|(G(t)?0:n)|(n&o)<<1,n&64)return!0}return!1}var ce=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function U(e){return J(e.replace(ce," ").replace(/[\u2028\u2029]/g," "))}var le=["CLAUDECODE","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","CODEX_SESSION_ID","GROK_SESSION_ID","GROK_WORKSPACE_ROOT","GEMINI_CLI","CURSOR_AGENT","OPENCODE","COPILOT_CLI","COPILOT_AGENT_SESSION_ID","AI_AGENT"];function ue(e=process.env,n=Boolean(process.stderr.isTTY)){let t=le.some((r)=>e[r]!==void 0)||Object.keys(e).some((r)=>r.startsWith("CODEX_SANDBOX"))||Boolean(e.REASON_NETWORK_AGENT)||Boolean(e.TINCAN_AGENT);return n&&!t}function Fe(e,n=ue()){return n?e:U(e)}class Ce extends Error{}var f="reason-network",g="0.12.10",_e={"aarch64-apple-darwin":"fd3e6eccf76aa3f3cdcbe516bb2e0885bc9416e89378d858c5d96e58a37a2996","x86_64-apple-darwin":"68a224c4e51ec91c4754fdda2724de0e72ba3f27b687b2466a7c7d5e492ad72c","aarch64-unknown-linux-musl":"ca6177ba2ac3fc2d1ca0a06953cb33ee09ab6d83f5b957bee54339b41b6672b4","x86_64-unknown-linux-musl":"d872f3e96066ed717cc775f9c580a2ab68feace60e06427ff216cec985f2115a","aarch64-pc-windows-msvc":"67b4f3f9c3f7e69e285eef863009fa014195b1c91a4e8b1abca81f1a085e55ed","x86_64-pc-windows-msvc":"9fad0c86fdc56e7b837b7c98960f685dd63721f4e6be5a172f8198eee82e5869"},Re="https://reasonmachines.com/cli/engine",N="REASON_AGENT_NETWORK_BIN";function ve(e=process.platform,n=process.arch){let t=n==="arm64"?"aarch64":n==="x64"?"x86_64":null,r=e==="darwin"?"apple-darwin":e==="linux"?"unknown-linux-musl":e==="win32"?"pc-windows-msvc":null;return t&&r?`${t}-${r}`:null}function ee(e){return`${f}-${e}${e.endsWith("-windows-msvc")?".zip":".tar.gz"}`}function xe(e){let n=_e[e];return n?{url:`${Re}/${g}/${ee(e)}`,sha256:n}:null}function A(e){let n=p(e,["--version"],{encoding:"utf8",timeout:5000}),[t,r]=n.status===0?n.stdout.trim().split(/\s+/):[];return t===f?r??null:null}function _(e,n){let t=e.split(".").map(Number),r=n.split(".").map(Number);for(let s=0;s<3;s+=1)if((t[s]??0)!==(r[s]??0))return(t[s]??0)>(r[s]??0);return!0}function S(e=m(),n=process.platform){return u(e,".reason","bin",`${f}${n==="win32"?".exe":""}`)}var v=process.platform==="win32"?`~\\.local\\bin\\${f}.exe`:`~/.local/bin/${f}`;async function Te(e=process.env,n=()=>{}){if(e[N])return e[N];let t=S(),r=T(),s=r?.path===t&&y(t)===r.fingerprint?r:null,o=s?.kept,i=M(e)?null:$e(o);if(s?.version===g&&!i)return t;let a=w(t)?A(t):null;if(i){let c=A(i.path),d=a&&_(a,g)?a:g;if(!c||!_(d,c)){if(c)n(`Reason Network: ${v} (${c}) is newer than the version \`reason network\` keeps up to date (${d}), so it was left as it is.`);o=i.fingerprint,i=null}}if(s?.version===g&&!i)return F(t,o);if(!a||!_(a,g))await ne(t);let l=p(t,["setup",...M(e)?["--no-service"]:[]],{env:await C(e),encoding:"utf8",timeout:60000});if(l.status!==0){let c=b((l.stderr||l.stdout||"").trim().split(`
4
- `).pop()??"");if(s)return B(m(),{...s,fingerprint:y(t)??s.fingerprint,...o?{kept:o}:{}}),n(i?`Reason Network: couldn't move your agents off ${v}${c?` (${c})`:""}; they keep using it. Run reason network to try again.`:`Reason Network: couldn't finish setting up on this computer${c?` (${c})`:""}. Run reason network to try again.`),t;throw new Ce(`Couldn't connect this computer's agents to the network${c?` (${c})`:""}. Run reason network to try again.`)}if(i)o=Pe(i,t,n);return F(t,o),p(t,["stop"],{env:e,stdio:"ignore",timeout:15000}),t}function $e(e){let n=u(m(),".local","bin",Z(S())),t;try{t=me(n)}catch{return null}let r=`${t.size}:${t.mtimeMs}:${t.ino}`;if(!t.isFile()||r===e)return null;try{let s=Y(S());if(s.ino===t.ino&&s.dev===t.dev)return null}catch{}try{let s=Buffer.alloc(2),o=we(n,"r");try{ke(o,s,0,2,0)}finally{pe(o)}if(s.toString("latin1")==="#!")return null}catch{return null}return{path:n,fingerprint:r}}function Pe(e,n,t){let r=`${e.path}.reason-${process.pid}`;try{if(k(r,{force:!0}),process.platform==="win32"){try{W(n,r,"file")}catch{fe(n,r)}te(r,e.path,"win32")}else W(n,r),E(r,e.path);t(`Reason Network: your agents on this computer now use the version \`reason network\` keeps up to date (${v} points to it). Restart a running agent to pick it up.`);return}catch(s){return k(r,{force:!0}),t(`Reason Network: your agents on this computer now use the version \`reason network\` keeps up to date, but ${v} couldn't be pointed to it (${s instanceof Error?s.message:String(s)}). Remove that copy so it can't take them back.`),e.fingerprint}}async function fl(e={}){let n=e.env??process.env,t=e.home??m(),r=S(t),s=T(t);if(n[N]||s?.path!==r||y(r)!==s.fingerprint)return!1;if(s.version===g)return!1;let o=A(r);if(o&&_(o,g))return!1;return await ne(r),B(t,{...s,fingerprint:y(r)??""}),e.beforeRestart?.(),p(r,["stop"],{env:n,stdio:"ignore",timeout:15000}),!0}async function C(e){if(e[j])return e;try{let{defaultWorkerServiceHost:n,workerServiceLauncher:t}=await import("./serve-service-43kmwskj.js");return{...e,[j]:t(n(m()),e)}}catch{return e}}var j="REASON_NETWORK_REASON_BIN";function M(e=process.env){return Boolean(e.REASON_NETWORK_NO_SERVICE||e.TINCAN_NO_SERVICE)}var L=(e)=>u(e,".reason","ask-engine.json");function y(e){try{let n=Y(e);return`${n.size}:${n.mtimeMs}:${n.ino}`}catch{return null}}function ml(e=m()){return T(e)?.version??null}function T(e=m()){try{let n=JSON.parse(Ee(L(e),"utf8"));if(typeof n.path!=="string"||typeof n.fingerprint!=="string"||typeof n.version!=="string")return null;return{path:n.path,fingerprint:n.fingerprint,version:n.version,...typeof n.kept==="string"?{kept:n.kept}:{}}}catch{return null}}function B(e,n){Q(R(L(e)),{recursive:!0}),I(L(e),JSON.stringify(n))}function F(e,n){let t=y(e);if(t)B(m(),{path:e,fingerprint:t,version:g,...n?{kept:n}:{}});return e}async function ne(e){let n=ve(),t=n?xe(n):null;if(!n||!t)throw new Ce(`Reason Network runs on macOS, Linux and Windows (arm64 or x64); this is ${process.platform} ${process.arch}.`);let{url:r,sha256:s}=t,o;try{let a=await fetch(r,{signal:AbortSignal.timeout(120000)});if(!a.ok)throw Error(`HTTP ${a.status}`);o=Buffer.from(await a.arrayBuffer())}catch(a){let l=a instanceof Error&&a.name==="TimeoutError"?"no download within 2 minutes":a instanceof Error?a.message.replace(/\.$/,""):String(a);throw new Ce(`Couldn't download Reason Network from ${new URL(r).host} (${l}). Check the connection and run reason network again.`)}if(de("sha256").update(o).digest("hex")!==s)throw new Ce("The Reason Network download didn't match its checksum, so it wasn't installed.");Oe(o,n,e)}var H="Couldn't unpack the Reason Network download.";function Oe(e,n,t,r=process.platform){Q(R(t),{recursive:!0});let s=he(u(R(t),".reason-engine-"));try{let o=u(s,f);if(ee(n).endsWith(".zip"))o=u(s,`${f}.exe`),I(o,Ie(e,`${f}.exe`));else{I(u(s,"engine.tar.gz"),e);let i=p("tar",["--no-same-owner","-xzf",u(s,"engine.tar.gz"),"-C",s],{encoding:"utf8"});if(i.status!==0||!w(o)){let a=(i.stderr??"").trim().split(`
4
+ `).pop()??"");if(s)return B(m(),{...s,fingerprint:y(t)??s.fingerprint,...o?{kept:o}:{}}),n(i?`Reason Network: couldn't move your agents off ${v}${c?` (${c})`:""}; they keep using it. Run reason network to try again.`:`Reason Network: couldn't finish setting up on this computer${c?` (${c})`:""}. Run reason network to try again.`),t;throw new Ce(`Couldn't connect this computer's agents to the network${c?` (${c})`:""}. Run reason network to try again.`)}if(i)o=Pe(i,t,n);return F(t,o),p(t,["stop"],{env:e,stdio:"ignore",timeout:15000}),t}function $e(e){let n=u(m(),".local","bin",Z(S())),t;try{t=me(n)}catch{return null}let r=`${t.size}:${t.mtimeMs}:${t.ino}`;if(!t.isFile()||r===e)return null;try{let s=Y(S());if(s.ino===t.ino&&s.dev===t.dev)return null}catch{}try{let s=Buffer.alloc(2),o=we(n,"r");try{ke(o,s,0,2,0)}finally{pe(o)}if(s.toString("latin1")==="#!")return null}catch{return null}return{path:n,fingerprint:r}}function Pe(e,n,t){let r=`${e.path}.reason-${process.pid}`;try{if(k(r,{force:!0}),process.platform==="win32"){try{W(n,r,"file")}catch{fe(n,r)}te(r,e.path,"win32")}else W(n,r),E(r,e.path);t(`Reason Network: your agents on this computer now use the version \`reason network\` keeps up to date (${v} points to it). Restart a running agent to pick it up.`);return}catch(s){return k(r,{force:!0}),t(`Reason Network: your agents on this computer now use the version \`reason network\` keeps up to date, but ${v} couldn't be pointed to it (${s instanceof Error?s.message:String(s)}). Remove that copy so it can't take them back.`),e.fingerprint}}async function fl(e={}){let n=e.env??process.env,t=e.home??m(),r=S(t),s=T(t);if(n[N]||s?.path!==r||y(r)!==s.fingerprint)return!1;if(s.version===g)return!1;let o=A(r);if(o&&_(o,g))return!1;return await ne(r),B(t,{...s,fingerprint:y(r)??""}),e.beforeRestart?.(),p(r,["stop"],{env:n,stdio:"ignore",timeout:15000}),!0}async function C(e){if(e[j])return e;try{let{defaultWorkerServiceHost:n,workerServiceLauncher:t}=await import("./serve-service-grp91ybk.js");return{...e,[j]:t(n(m()),e)}}catch{return e}}var j="REASON_NETWORK_REASON_BIN";function M(e=process.env){return Boolean(e.REASON_NETWORK_NO_SERVICE||e.TINCAN_NO_SERVICE)}var L=(e)=>u(e,".reason","ask-engine.json");function y(e){try{let n=Y(e);return`${n.size}:${n.mtimeMs}:${n.ino}`}catch{return null}}function ml(e=m()){return T(e)?.version??null}function T(e=m()){try{let n=JSON.parse(Ee(L(e),"utf8"));if(typeof n.path!=="string"||typeof n.fingerprint!=="string"||typeof n.version!=="string")return null;return{path:n.path,fingerprint:n.fingerprint,version:n.version,...typeof n.kept==="string"?{kept:n.kept}:{}}}catch{return null}}function B(e,n){Q(R(L(e)),{recursive:!0}),I(L(e),JSON.stringify(n))}function F(e,n){let t=y(e);if(t)B(m(),{path:e,fingerprint:t,version:g,...n?{kept:n}:{}});return e}async function ne(e){let n=ve(),t=n?xe(n):null;if(!n||!t)throw new Ce(`Reason Network runs on macOS, Linux and Windows (arm64 or x64); this is ${process.platform} ${process.arch}.`);let{url:r,sha256:s}=t,o;try{let a=await fetch(r,{signal:AbortSignal.timeout(120000)});if(!a.ok)throw Error(`HTTP ${a.status}`);o=Buffer.from(await a.arrayBuffer())}catch(a){let l=a instanceof Error&&a.name==="TimeoutError"?"no download within 2 minutes":a instanceof Error?a.message.replace(/\.$/,""):String(a);throw new Ce(`Couldn't download Reason Network from ${new URL(r).host} (${l}). Check the connection and run reason network again.`)}if(de("sha256").update(o).digest("hex")!==s)throw new Ce("The Reason Network download didn't match its checksum, so it wasn't installed.");Oe(o,n,e)}var H="Couldn't unpack the Reason Network download.";function Oe(e,n,t,r=process.platform){Q(R(t),{recursive:!0});let s=he(u(R(t),".reason-engine-"));try{let o=u(s,f);if(ee(n).endsWith(".zip"))o=u(s,`${f}.exe`),I(o,Ie(e,`${f}.exe`));else{I(u(s,"engine.tar.gz"),e);let i=p("tar",["--no-same-owner","-xzf",u(s,"engine.tar.gz"),"-C",s],{encoding:"utf8"});if(i.status!==0||!w(o)){let a=(i.stderr??"").trim().split(`
5
5
  `).slice(-3).join("; "),l=i.error?`tar failed: ${i.error.message}`:i.signal?`tar was stopped by ${i.signal}`:i.status!==0?`tar exited ${i.status}${a?`: ${a}`:""}`:`no ${f} in it`;throw new Ce(`Couldn't unpack the Reason Network download (${l}).`)}}ge(o,493),te(o,t,r)}finally{k(s,{recursive:!0,force:!0})}}function Ie(e,n){let t=e.lastIndexOf(Buffer.from("PK\x05\x06","latin1"));if(t<0||t+22>e.length)throw new Ce(H);let r=e.readUInt32LE(t+16);for(let s=e.readUInt16LE(t+10);s>0;s-=1){if(r+46>e.length||e.readUInt32LE(r)!==33639248)break;let o=e.readUInt16LE(r+28);if(e.toString("utf8",r+46,r+46+o)===n){let i=e.readUInt16LE(r+10),a=e.readUInt32LE(r+20),l=e.readUInt32LE(r+24),c=e.readUInt32LE(r+42);if(c+30>e.length||e.readUInt32LE(c)!==67324752)break;let d=c+30+e.readUInt16LE(c+26)+e.readUInt16LE(c+28);if(d+a>e.length)break;let h=e.subarray(d,d+a),P;try{P=i===0?Buffer.from(h):i===8?be(h):Buffer.alloc(0)}catch{break}if(i!==0&&i!==8||P.length!==l)break;return P}r+=46+o+e.readUInt16LE(r+30)+e.readUInt16LE(r+32)}throw new Ce(H)}function te(e,n,t){if(t!=="win32"||!w(n)){E(e,n);return}let r=R(n),s=(i)=>i.startsWith(`${Z(n)}.`)&&i.endsWith(".old");for(let i of ye(r).filter(s))try{k(u(r,i),{force:!0})}catch{}let o=`${n}.${process.pid}-${Date.now()}.old`;E(n,o);try{E(e,n)}catch(i){throw E(o,n),i}try{k(o,{force:!0})}catch{}}function Ae(e=process.env,n=m()){let t=e.REASON_NETWORK_HOME?.trim()||e.TINCAN_HOME?.trim();if(t)return t;let r=u(n,".reason","network"),s=u(n,".tincan");return!K(r)&&K(s)?s:r}var K=(e)=>w(u(e,"network.db"))||w(u(e,"tincan.db"));function Me(e,n=process.platform,t=Ne.native){let r=w(u(e,"network.db"))||!w(u(e,"tincan.db"));if(n==="win32"){let o=e;try{o=t(e),o=o.startsWith("\\\\?\\")?o.slice(4):o.startsWith("\\\\")?`UNC\\${o.slice(2)}`:o}catch{}return`\\\\.\\pipe\\${r?"reason-network":"tincan"}-${z(o)}`}let s=u(e,r?"network.sock":"tincan.sock");if(Buffer.byteLength(s)<100)return s;return u("/tmp",`${r?"reason-network":"tincan"}-${process.getuid?.()??0}`,`${z(s)}.sock`)}function z(e){let n=0xcbf29ce484222325n;for(let t of Buffer.from(e))n=BigInt.asUintN(64,(n^BigInt(t))*0x100000001b3n);return n.toString(16).padStart(16,"0")}class Xr extends Error{code;constructor(e,n){super(e);this.code=n}}function Zi(e){return e instanceof Xr&&/isn't registered/.test(e.message)}var re="not_in_team",se=15000,Le=new Set(["who","team","inbox","unread","held"]),Be=90000,De="Reason Network on this computer closed the connection";class x{socket;nextId=1;buffer="";pending=new Map;closed=null;hungUp=!1;constructor(e){this.socket=e;e.setEncoding("utf8"),e.on("data",(t)=>this.read(t));let n=(t)=>{this.closed=t;for(let r of this.pending.values())r.reject(t);this.pending.clear()};e.on("error",(t)=>n(t)),e.on("close",()=>n(Error(this.hungUp?"the connection to Reason Network on this computer was closed here":De)))}static open(e){return new Promise((n,t)=>{let r=Se(e);r.once("connect",()=>n(new x(r))),r.once("error",t)})}read(e){this.buffer+=e;let n=this.buffer.indexOf(`
6
6
  `);while(n>=0){let t=this.buffer.slice(0,n);if(this.buffer=this.buffer.slice(n+1),n=this.buffer.indexOf(`
7
7
  `),!t.trim())continue;let r;try{r=JSON.parse(t)}catch{continue}if(typeof r.id!=="number")continue;let s=this.pending.get(r.id);if(!s)continue;if(this.pending.delete(r.id),r.ok){s.resolve(r.result);continue}let o=r.error??"Reason Network on this computer refused the request",i=typeof r.code==="string"?r.code:/not (in|connected to) a team/i.test(o)?re:null;s.reject(new Xr(b(o),i))}}call(e,n={},t=se){if(this.closed)return Promise.reject(this.closed);let r=this.nextId++;return this.socket.write(`${JSON.stringify({id:r,op:e,...n})}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ls,us,Mc,Dn}from"./vm-hands-entry-lite-13nx02p7.js";import{A}from"./vm-hands-entry-lite-pe374cn6.js";import{Ue,wr,br}from"./vm-hands-entry-lite-chq0qx9f.js";import{qr}from"./vm-hands-entry-lite-sh4mqy93.js";import{Vo,Kt,_c,Go,Ko,Jo,Jt}from"./vm-hands-entry-lite-srtqjjqb.js";import{bi}from"./vm-hands-entry-lite-3q2ng4e9.js";import{Se}from"./vm-hands-entry-lite-xfak34av.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as se,spawn as ce}from"child_process";import{randomBytes as qe}from"crypto";import{chmodSync as Ce,existsSync as ne,lstatSync as Ge,mkdirSync as Oe,readFileSync as S,rmSync as ae,writeFileSync as R}from"fs";import{connect as he}from"net";import{join as p}from"path";var B=32,N=76;var M="./desktop-wallpaper-fd8f2wb2.jpg";var v="./dock-browser-y53t41cx.png";var Z="./dock-files-cp52htdw.png";var V="./dock-terminal-1es514yq.png";var z="./grok-wallpaper-71zwn2pj.jpg";var W="./grok-dock-browser-pzw59wnd.png";var j="./grok-dock-files-eckq444x.png";var U="./grok-dock-terminal-hcpz3e43.png";var ee=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
2
+ import{ls,us,Mc,Dn}from"./vm-hands-entry-lite-13nx02p7.js";import{A}from"./vm-hands-entry-lite-6vnjgy77.js";import{Ue,wr,br}from"./vm-hands-entry-lite-chq0qx9f.js";import{qr}from"./vm-hands-entry-lite-sh4mqy93.js";import{Vo,Kt,_c,Go,Ko,Jo,Jt}from"./vm-hands-entry-lite-1eyg750p.js";import{bi}from"./vm-hands-entry-lite-3q2ng4e9.js";import{Se}from"./vm-hands-entry-lite-xfak34av.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{execFile as se,spawn as ce}from"child_process";import{randomBytes as qe}from"crypto";import{chmodSync as Ce,existsSync as ne,lstatSync as Ge,mkdirSync as Oe,readFileSync as S,rmSync as ae,writeFileSync as R}from"fs";import{connect as he}from"net";import{join as p}from"path";var B=32,N=76;var M="./desktop-wallpaper-fd8f2wb2.jpg";var v="./dock-browser-y53t41cx.png";var Z="./dock-files-cp52htdw.png";var V="./dock-terminal-1es514yq.png";var z="./grok-wallpaper-71zwn2pj.jpg";var W="./grok-dock-browser-pzw59wnd.png";var j="./grok-dock-files-eckq444x.png";var U="./grok-dock-terminal-hcpz3e43.png";var ee=`# Sets the X root window background and _XROOTPMAP_ID, as feh --bg-fill does.
3
3
  # The native Blaxel image ships no feh, hsetroot or compositor, but it does ship
4
4
  # python3-gi and libX11. tint2 reads _XROOTPMAP_ID to draw its transparent panel.
5
5
  # Usage: DISPLAY=:99 python3 set-root-wallpaper.py IMAGE
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{D}from"./vm-hands-entry-lite-13nx02p7.js";import{_s}from"./vm-hands-entry-lite-thstg177.js";import{rs}from"./vm-hands-entry-lite-cc8hwgxc.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{createHash as pe}from"crypto";import{once as Te}from"events";import{createWriteStream as Ne,existsSync as Ae,mkdirSync as Me,mkdtempSync as Pt,readFileSync as L,readdirSync as Dt,renameSync as Ue,realpathSync as He,rmSync as Le,statSync as z,writeFileSync as je}from"fs";import{delimiter as Nt,dirname as J,join as a}from"path";import{finished as Fe}from"stream/promises";var Xt="omljlfpmafedpplnpkkahegadhkimdje",yc="https://chromewebstore.google.com/detail/reason/omljlfpmafedpplnpkkahegadhkimdje";var x={ocu:{repository:"https://github.com/iFurySt/open-codex-computer-use.git",revision:"386a260d1ab8b690adbbb27f7471595cf0c2b752",version:"0.3.5"},obu:{repository:"https://github.com/iFurySt/open-browser-use.git",revision:"ac015846df75928fbcf0f3a0f3ba3a210ce1a507",version:"0.1.42"}},S={version:"155.0.8059.84",macArm64Sha256:"13b9e98ce56f5ce18e100a009f455c9285f399e7c9dc8a76fdf2f3a9755bb5f2",linux64Sha256:"cf0f049892dea22e6a6db26d47ed0d7776b7158edcbec4634086633df8bafcbc",win64Sha256:"507f2a031441d10c62b5e3d4e863f09ac1198a571c1419976cbd8387f639afde"};var R={ocu:{url:`https://registry.npmjs.org/open-computer-use/-/open-computer-use-${x.ocu.version}.tgz`,sha256:"7c16a87c8cd357787b02c0ebd040dd5f93880c1fb51c1901caa2e0c05d063130",size_bytes:5844280},obu:{url:`https://registry.npmjs.org/open-browser-use/-/open-browser-use-${x.obu.version}.tgz`,sha256:"9386d8ce0a147b3f55e1807b68edf736836378807541c457c9b5f6ca2cabaa4e",size_bytes:21372018},extension:{url:`https://github.com/iFurySt/open-browser-use/releases/download/v${x.obu.version}/open-browser-use-chrome-extension-${x.obu.version}.zip`,sha256:"c9c07bec1175e12ea6985b0e7784a5ef01fd03f014b958224a1e17dcd838a241",size_bytes:31070}},le="pnbmoicbkopffjjgfgfglopechaiemkp";import{spawn as B}from"child_process";import{createRequire as Se}from"module";import{join as ke}from"path";var Ee=30000,Ce=1048576;function G(){return process.env.SystemRoot??"C:\\Windows"}function Ie(){return ke(G(),"System32","WindowsPowerShell","v1.0","powershell.exe")}var Oe=String.raw`
2
+ import{D}from"./vm-hands-entry-lite-13nx02p7.js";import{_s}from"./vm-hands-entry-lite-t86kt9jz.js";import{rs}from"./vm-hands-entry-lite-cc8hwgxc.js";import{s}from"./vm-hands-entry-lite-12ck5swp.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import{createHash as pe}from"crypto";import{once as Te}from"events";import{createWriteStream as Ne,existsSync as Ae,mkdirSync as Me,mkdtempSync as Pt,readFileSync as L,readdirSync as Dt,renameSync as Ue,realpathSync as He,rmSync as Le,statSync as z,writeFileSync as je}from"fs";import{delimiter as Nt,dirname as J,join as a}from"path";import{finished as Fe}from"stream/promises";var Xt="omljlfpmafedpplnpkkahegadhkimdje",yc="https://chromewebstore.google.com/detail/reason/omljlfpmafedpplnpkkahegadhkimdje";var x={ocu:{repository:"https://github.com/iFurySt/open-codex-computer-use.git",revision:"386a260d1ab8b690adbbb27f7471595cf0c2b752",version:"0.3.5"},obu:{repository:"https://github.com/iFurySt/open-browser-use.git",revision:"ac015846df75928fbcf0f3a0f3ba3a210ce1a507",version:"0.1.42"}},S={version:"155.0.8059.84",macArm64Sha256:"13b9e98ce56f5ce18e100a009f455c9285f399e7c9dc8a76fdf2f3a9755bb5f2",linux64Sha256:"cf0f049892dea22e6a6db26d47ed0d7776b7158edcbec4634086633df8bafcbc",win64Sha256:"507f2a031441d10c62b5e3d4e863f09ac1198a571c1419976cbd8387f639afde"};var R={ocu:{url:`https://registry.npmjs.org/open-computer-use/-/open-computer-use-${x.ocu.version}.tgz`,sha256:"7c16a87c8cd357787b02c0ebd040dd5f93880c1fb51c1901caa2e0c05d063130",size_bytes:5844280},obu:{url:`https://registry.npmjs.org/open-browser-use/-/open-browser-use-${x.obu.version}.tgz`,sha256:"9386d8ce0a147b3f55e1807b68edf736836378807541c457c9b5f6ca2cabaa4e",size_bytes:21372018},extension:{url:`https://github.com/iFurySt/open-browser-use/releases/download/v${x.obu.version}/open-browser-use-chrome-extension-${x.obu.version}.zip`,sha256:"c9c07bec1175e12ea6985b0e7784a5ef01fd03f014b958224a1e17dcd838a241",size_bytes:31070}},le="pnbmoicbkopffjjgfgfglopechaiemkp";import{spawn as B}from"child_process";import{createRequire as Se}from"module";import{join as ke}from"path";var Ee=30000,Ce=1048576;function G(){return process.env.SystemRoot??"C:\\Windows"}function Ie(){return ke(G(),"System32","WindowsPowerShell","v1.0","powershell.exe")}var Oe=String.raw`
3
3
  $ErrorActionPreference = "Stop"
4
4
  Add-Type -TypeDefinition @"
5
5
  using System;