@reason-machines/cli-linux-x64 0.2.566 → 0.2.567
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reason +1 -1
- package/bin/vm-hands/agent-network-0sng03r6.js +2 -0
- package/bin/vm-hands/api-credentials-h4neeejt.js +2 -0
- package/bin/vm-hands/api-mr6xds10.js +2 -0
- package/bin/vm-hands/{ask-relay-gk4ks8mg.js → ask-relay-c0v30hh6.js} +2 -2
- package/bin/vm-hands/connect-cli-jc4m755k.js +2 -0
- package/bin/vm-hands/credentials-nfx99zxr.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-5047vdn3.js +2 -0
- package/bin/vm-hands/desktop-account-d1g1m6yb.js +2 -0
- package/bin/vm-hands/desktop-components-7ngf8byq.js +2 -0
- package/bin/vm-hands/desktop-delegate-4hb0163k.js +2 -0
- package/bin/vm-hands/device-workspace-8941tdsy.js +2 -0
- package/bin/vm-hands/{fsevents-ezcg3e40.js → fsevents-e57jgcfe.js} +1 -1
- package/bin/vm-hands/hands-worker-source-8a4kh44t.js +2 -0
- package/bin/vm-hands/{index-w92ys6ra.js → index-y21r07rf.js} +8 -8
- package/bin/vm-hands/install-receipt-rckwjqmt.js +2 -0
- package/bin/vm-hands/local-automation-3mdhfw08.js +2 -0
- package/bin/vm-hands/local-capabilities-6e0gkrqq.js +2 -0
- package/bin/vm-hands/local-desktop-users-hkdfxqtj.js +2 -0
- package/bin/vm-hands/local-display-mac-gsh74khc.js +2 -0
- package/bin/vm-hands/local-display-session-r6s0wghh.js +2 -0
- package/bin/vm-hands/local-display-video-61peg1pj.js +2 -0
- package/bin/vm-hands/local-managed-process-p8xd7m5f.js +2 -0
- package/bin/vm-hands/local-pty-session-w0yhjdvz.js +2 -0
- package/bin/vm-hands/managed-runtime-4s8q8r7f.js +2 -0
- package/bin/vm-hands/{network-auto-update-qwds22kt.js → network-auto-update-wep7067g.js} +2 -2
- package/bin/vm-hands/network-contract-ht0psj5j.js +2 -0
- package/bin/vm-hands/{network-sign-in-kqdg70kc.js → network-sign-in-rdnerhpz.js} +2 -2
- package/bin/vm-hands/package-3rv6jngd.js +2 -0
- package/bin/vm-hands/permissions-mmg1gbdx.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-9r62swp0.js +2 -0
- package/bin/vm-hands/serve-service-k3mpxpj6.js +2 -0
- package/bin/vm-hands/{status-q55nprve.js → status-2s3zjapg.js} +5 -5
- package/bin/vm-hands/version-41q9twfs.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pg7nnyc6.js → vm-hands-entry-lite-04nx5y4f.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ezhfkjqr.js → vm-hands-entry-lite-07wr95rz.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-33at6g06.js → vm-hands-entry-lite-0xfme8gg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-xfak34av.js → vm-hands-entry-lite-1as6h9ed.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-gxf2r5en.js → vm-hands-entry-lite-1cdtev4n.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-fn2805g8.js → vm-hands-entry-lite-1sy80ca9.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-yg4dk99m.js → vm-hands-entry-lite-2927z566.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-6adz91f3.js → vm-hands-entry-lite-298kzt93.js} +70 -70
- package/bin/vm-hands/{vm-hands-entry-lite-3q2ng4e9.js → vm-hands-entry-lite-3594pdj0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rz1ep81m.js → vm-hands-entry-lite-3r063pb4.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-2qfmabqn.js → vm-hands-entry-lite-4kb5rq3d.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-5qrft0nw.js → vm-hands-entry-lite-6g9we34r.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-s93f3pbv.js → vm-hands-entry-lite-732hnx41.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-7aeqbfc8.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-y0jtj8zz.js → vm-hands-entry-lite-8twdd0ff.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-x6ybft9v.js → vm-hands-entry-lite-9gn7k5rp.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-b2w5071h.js → vm-hands-entry-lite-ax2w9ywb.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-2gxv7v1h.js → vm-hands-entry-lite-b3mfma12.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-qjrgvdbj.js → vm-hands-entry-lite-bbjsnjct.js} +21 -21
- package/bin/vm-hands/{vm-hands-entry-lite-zp7chzcc.js → vm-hands-entry-lite-bc9zq8gx.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ngry8nkq.js → vm-hands-entry-lite-bqs4pkyb.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-zpvr7wc6.js → vm-hands-entry-lite-bt6skt4h.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-q62g6sx0.js → vm-hands-entry-lite-chve4vmh.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-72h3t64b.js → vm-hands-entry-lite-crjaacc2.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-fs6jbfp3.js → vm-hands-entry-lite-cy8yc9gb.js} +19 -19
- package/bin/vm-hands/{vm-hands-entry-lite-30z7wsqr.js → vm-hands-entry-lite-dfphra23.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-a3gq377t.js → vm-hands-entry-lite-dh87ysh2.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-994kah8n.js → vm-hands-entry-lite-dtw6cj95.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-a8z57vry.js → vm-hands-entry-lite-dzdjwa06.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-chq0qx9f.js → vm-hands-entry-lite-g0bpdyfz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rxydyqke.js → vm-hands-entry-lite-h7f5a5mb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-13nx02p7.js → vm-hands-entry-lite-hh0kba1y.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-fccn6s4j.js → vm-hands-entry-lite-hpe54h0b.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-kbnxk71q.js → vm-hands-entry-lite-hpw27zfb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-284z7ct8.js → vm-hands-entry-lite-kankyeep.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-9wp7ahwa.js → vm-hands-entry-lite-n5jyzccm.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-88dxn9b5.js → vm-hands-entry-lite-peyr9y6z.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-cmmb9k3g.js → vm-hands-entry-lite-r131db1f.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-72084j3g.js → vm-hands-entry-lite-rmcdfbkk.js} +24 -24
- package/bin/vm-hands/{vm-hands-entry-lite-1b21avcs.js → vm-hands-entry-lite-sb1xtqxr.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-b1vanmtv.js → vm-hands-entry-lite-sxnvhzy5.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-cc8hwgxc.js → vm-hands-entry-lite-t2rhwchw.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-sh4mqy93.js → vm-hands-entry-lite-t3k90kdn.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-bkhc5mt4.js → vm-hands-entry-lite-tv5mcw97.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-12ck5swp.js → vm-hands-entry-lite-tzv8s0e7.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-50kqbrb7.js → vm-hands-entry-lite-vedb5r12.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-jj7873n8.js → vm-hands-entry-lite-vha0pf8k.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-fxptf351.js → vm-hands-entry-lite-vvhfaxpd.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-3gc2bn5a.js → vm-hands-entry-lite-wtjqjvea.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-p02vay5n.js → vm-hands-entry-lite-xd393rm3.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-z65xva21.js → vm-hands-entry-lite-ys4jhf7n.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ttfqxjms.js → vm-hands-entry-lite-zaj1vnnd.js} +9 -9
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-r6v6tzqj.js → vm-hands-executor-31ea40aw.js} +4 -4
- package/bin/vm-hands/{vm-hands-op-runner-wcbc42nw.js → vm-hands-op-runner-6r390v3d.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-2t08ywa4.js → vm-hands-runtime-z9m50n9p.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-w4zy5g2p.js +2 -0
- package/bin/vm-hands/worker-sandbox-2trfs79b.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/agent-network-pak3wvrv.js +0 -2
- package/bin/vm-hands/api-credentials-a433ykxs.js +0 -2
- package/bin/vm-hands/api-kex52g1d.js +0 -2
- package/bin/vm-hands/connect-cli-afdc1h11.js +0 -2
- package/bin/vm-hands/credentials-sk4sag42.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-3jscber1.js +0 -2
- package/bin/vm-hands/desktop-account-xma0330a.js +0 -2
- package/bin/vm-hands/desktop-components-y89gpa6e.js +0 -2
- package/bin/vm-hands/desktop-delegate-tch2qzx0.js +0 -2
- package/bin/vm-hands/device-workspace-4bj43nxq.js +0 -2
- package/bin/vm-hands/hands-worker-source-8pe7yv0m.js +0 -2
- package/bin/vm-hands/install-receipt-68xxg7hn.js +0 -2
- package/bin/vm-hands/local-automation-1s7035zm.js +0 -2
- package/bin/vm-hands/local-capabilities-h1hxzrhn.js +0 -2
- package/bin/vm-hands/local-desktop-users-jpf0resr.js +0 -2
- package/bin/vm-hands/local-display-mac-h5yz0ydd.js +0 -2
- package/bin/vm-hands/local-display-session-0vw1x2k6.js +0 -2
- package/bin/vm-hands/local-display-video-k4bgptc7.js +0 -2
- package/bin/vm-hands/local-managed-process-b79p5wwv.js +0 -2
- package/bin/vm-hands/local-pty-session-tqn2xmph.js +0 -2
- package/bin/vm-hands/managed-runtime-9jfx2885.js +0 -2
- package/bin/vm-hands/network-contract-nkwcf4r9.js +0 -2
- package/bin/vm-hands/package-9w0mmxb5.js +0 -2
- package/bin/vm-hands/permissions-q9nfdxrh.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-pck5har9.js +0 -2
- package/bin/vm-hands/serve-service-hcc0zvg8.js +0 -2
- package/bin/vm-hands/version-7q2ft41r.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-997y1m1r.js +0 -3
- package/bin/vm-hands/worker-preview-readiness-h96yr4wf.js +0 -2
- package/bin/vm-hands/worker-sandbox-6kkhvryn.js +0 -2
package/bin/reason
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ut,el,Vn,ir}from"./vm-hands-entry-lite-dzdjwa06.js";import"./vm-hands-entry-lite-3r063pb4.js";import"./vm-hands-entry-lite-r131db1f.js";import"./vm-hands-entry-lite-4kb5rq3d.js";import"./vm-hands-entry-lite-peyr9y6z.js";import"./vm-hands-entry-lite-0xfme8gg.js";import"./vm-hands-entry-lite-ys4jhf7n.js";import"./vm-hands-entry-lite-crjaacc2.js";import"./vm-hands-entry-lite-tzv8s0e7.js";import"./vm-hands-entry-lite-hpw27zfb.js";import"./vm-hands-entry-lite-04nx5y4f.js";import"./vm-hands-entry-lite-h7f5a5mb.js";export{ut as apiOriginFromEnvironment,Vn as environmentApiKey,el as explicitApiOrigin,ir as resolveApiCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{C,io,me}from"./vm-hands-entry-lite-3r063pb4.js";import"./vm-hands-entry-lite-r131db1f.js";import"./vm-hands-entry-lite-4kb5rq3d.js";import"./vm-hands-entry-lite-peyr9y6z.js";import"./vm-hands-entry-lite-0xfme8gg.js";import"./vm-hands-entry-lite-ys4jhf7n.js";import"./vm-hands-entry-lite-crjaacc2.js";import"./vm-hands-entry-lite-tzv8s0e7.js";import"./vm-hands-entry-lite-hpw27zfb.js";import"./vm-hands-entry-lite-04nx5y4f.js";import"./vm-hands-entry-lite-h7f5a5mb.js";export{C as ApiError,me as ReasonApi,io as createMachineEnrollmentTicketWithToken};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gn}from"./vm-hands-entry-lite-r131db1f.js";import{Fe,Qi,Nt}from"./vm-hands-entry-lite-xd393rm3.js";import"./vm-hands-entry-lite-ys4jhf7n.js";import"./vm-hands-entry-lite-0xfme8gg.js";import{g}from"./vm-hands-entry-lite-crjaacc2.js";import{Kr}from"./vm-hands-entry-lite-vha0pf8k.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-nfx99zxr.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:
|
|
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:Gn,...v?.length?{message_counts:v,...l.endpoint?{endpoint:l.endpoint}:{}}:{},...R?{hosted:this.hostedReport()}:{}},AbortSignal.any([this.signal,AbortSignal.timeout((Gn+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-rdnerhpz.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(!Qi(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-h4neeejt.js"),import("./api-mr6xds10.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,eo,gl,_l,to,yl,wl}from"./vm-hands-entry-lite-298kzt93.js";import"./vm-hands-entry-lite-kankyeep.js";import"./vm-hands-entry-lite-7aeqbfc8.js";import"./vm-hands-entry-lite-n5jyzccm.js";import"./vm-hands-entry-lite-dzdjwa06.js";import"./vm-hands-entry-lite-3r063pb4.js";import"./vm-hands-entry-lite-r131db1f.js";import"./vm-hands-entry-lite-4kb5rq3d.js";import"./vm-hands-entry-lite-rmcdfbkk.js";import"./vm-hands-entry-lite-bqs4pkyb.js";import"./vm-hands-entry-lite-6g9we34r.js";import"./vm-hands-entry-lite-cy8yc9gb.js";import"./vm-hands-entry-lite-bbjsnjct.js";import"./vm-hands-entry-lite-sxnvhzy5.js";import"./vm-hands-entry-lite-732hnx41.js";import"./vm-hands-entry-lite-2927z566.js";import"./vm-hands-entry-lite-07wr95rz.js";import"./vm-hands-entry-lite-9gn7k5rp.js";import"./vm-hands-entry-lite-3594pdj0.js";import"./vm-hands-entry-lite-1as6h9ed.js";import"./vm-hands-entry-lite-dh87ysh2.js";import"./vm-hands-entry-lite-bc9zq8gx.js";import"./vm-hands-entry-lite-b3mfma12.js";import"./vm-hands-entry-lite-g0bpdyfz.js";import"./vm-hands-entry-lite-vedb5r12.js";import"./vm-hands-entry-lite-t2rhwchw.js";import"./vm-hands-entry-lite-zaj1vnnd.js";import"./vm-hands-entry-lite-8twdd0ff.js";import"./vm-hands-entry-lite-peyr9y6z.js";import"./vm-hands-entry-lite-0xfme8gg.js";import"./vm-hands-entry-lite-ys4jhf7n.js";import"./vm-hands-entry-lite-ax2w9ywb.js";import"./vm-hands-entry-lite-hh0kba1y.js";import"./vm-hands-entry-lite-tv5mcw97.js";import"./vm-hands-entry-lite-crjaacc2.js";import"./vm-hands-entry-lite-tzv8s0e7.js";import"./vm-hands-entry-lite-hpw27zfb.js";import"./vm-hands-entry-lite-vvhfaxpd.js";import"./vm-hands-entry-lite-1cdtev4n.js";import"./vm-hands-entry-lite-t3k90kdn.js";import"./vm-hands-entry-lite-04nx5y4f.js";import"./vm-hands-entry-lite-h7f5a5mb.js";export{eo as computerDisconnected,fe as connectionDirectory,to as connectionReport,yl as restartConnection,wl as restartConnectionWhenIdle,gl as runConnectCli,_l as runDisconnectCli};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Q,so,ve,ao}from"./vm-hands-entry-lite-4kb5rq3d.js";import"./vm-hands-entry-lite-peyr9y6z.js";import"./vm-hands-entry-lite-0xfme8gg.js";import"./vm-hands-entry-lite-ys4jhf7n.js";import"./vm-hands-entry-lite-tzv8s0e7.js";import"./vm-hands-entry-lite-hpw27zfb.js";export{Q as credentialsPath,ao as deleteCredentials,ve as loadCredentials,so as saveCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rr,Br,Un,Ki,Fr,jr,pa,Ji,ha,fa,Hr}from"./vm-hands-entry-lite-1cdtev4n.js";export{rr as CUSTOM_ENDPOINT_DEVICE_CAPABILITY,Br as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,Fr as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,Ki as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,jr as CUSTOM_ENDPOINT_DEVICE_MAX_PAYLOAD_BYTES,Un as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,pa as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,fa as CustomEndpointDeviceCredentialSchema,ha as CustomEndpointDeviceRequestSchema,Ji as customEndpointRequestMatchesConfig,Hr as isCustomEndpointDeviceFailureCode};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Sr,Er,A,Qo,es,ts,rs}from"./vm-hands-entry-lite-vedb5r12.js";import"./vm-hands-entry-lite-t2rhwchw.js";import"./vm-hands-entry-lite-ax2w9ywb.js";import"./vm-hands-entry-lite-hh0kba1y.js";import"./vm-hands-entry-lite-tv5mcw97.js";import"./vm-hands-entry-lite-crjaacc2.js";import"./vm-hands-entry-lite-tzv8s0e7.js";import"./vm-hands-entry-lite-hpw27zfb.js";export{Sr as USER_CHROME_SOCKET_DIR,Er as desktopPaths,rs as desktopProfileAction,Qo as desktopVideoIdentity,es as downloadVerified,ts as keepDesktopMinimal,A as readDesktopComponents};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{at,kt,Oe,xt,Ke,Dr,Zt,Ne,X,te,zi,qi,Wi,Bn,Vi}from"./vm-hands-entry-lite-hpw27zfb.js";export{Wi as CLOUD_REPOSITORY_WORKSPACE_ID,zi as CLOUD_SESSION_CONTROL_BASE,Bn as CLOUD_SESSION_ROOT,kt as HANDS_WORKSPACE_BASE_KEY,xt as HANDS_WORKSPACE_LAYOUT_KEY,at as REASON_WORKSPACE_BASE,Oe as SESSION_WORKSPACE_LAYOUT,Ke as SESSION_WORKTREES,Dr as SESSION_WORKTREE_ID,qi as SIDECHAT_WORKSPACE_ID,Vi as cloudSessionLayoutOfRoot,X as deviceWorkspaceRootRelative,Ne as isDeviceWorkspacePath,Zt as isSessionWorktreePath,te as parseDeviceWorkspace};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{pl}from"./vm-hands-entry-lite-
|
|
2
|
+
import{pl}from"./vm-hands-entry-lite-1sy80ca9.js";var o;var r=pl(()=>{o=Error("Cannot find module 'fsevents'");o.code="MODULE_NOT_FOUND";throw o});r();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{U,H,nl,T,To}from"./vm-hands-entry-lite-bbjsnjct.js";import"./vm-hands-entry-lite-dh87ysh2.js";import"./vm-hands-entry-lite-bc9zq8gx.js";import"./vm-hands-entry-lite-hpw27zfb.js";import"./vm-hands-entry-lite-h7f5a5mb.js";export{T as REASON_HANDS_WORKER_ARTIFACT_SHA256,H as REASON_HANDS_WORKER_ENTRYPOINT,nl as REASON_HANDS_WORKER_SOURCE,To as REASON_HANDS_WORKER_STARTUP_REFUSALS,U as REASON_HANDS_WORKER_VERSION};
|