@reason-machines/cli-linux-x64 0.2.561 → 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.
- package/bin/reason +2 -2
- package/bin/vm-hands/agent-network-mnv1fm1c.js +2 -0
- package/bin/vm-hands/api-credentials-082cnpn9.js +2 -0
- package/bin/vm-hands/api-sq672f51.js +2 -0
- package/bin/vm-hands/{ask-relay-xx0rzpch.js → ask-relay-v5btnjvb.js} +2 -2
- package/bin/vm-hands/connect-cli-rxb3qtra.js +2 -0
- package/bin/vm-hands/credentials-sk4sag42.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-3jscber1.js +2 -0
- package/bin/vm-hands/desktop-account-xma0330a.js +2 -0
- package/bin/vm-hands/desktop-components-099xyxmz.js +2 -0
- package/bin/vm-hands/desktop-delegate-tch2qzx0.js +2 -0
- package/bin/vm-hands/device-workspace-4bj43nxq.js +2 -0
- package/bin/vm-hands/{fsevents-vxv56sp5.js → fsevents-ezcg3e40.js} +1 -1
- package/bin/vm-hands/hands-worker-source-8pe7yv0m.js +2 -0
- package/bin/vm-hands/{index-03p9c17x.js → index-w92ys6ra.js} +16 -16
- package/bin/vm-hands/install-receipt-68xxg7hn.js +2 -0
- package/bin/vm-hands/local-automation-7pjd5nc1.js +2 -0
- package/bin/vm-hands/local-capabilities-ha0ey4zh.js +2 -0
- package/bin/vm-hands/local-desktop-users-jpf0resr.js +2 -0
- package/bin/vm-hands/local-display-mac-h5yz0ydd.js +2 -0
- package/bin/vm-hands/local-display-session-0mkswxgk.js +2 -0
- package/bin/vm-hands/local-display-video-c3fk87c5.js +2 -0
- package/bin/vm-hands/local-managed-process-ahr2jync.js +2 -0
- package/bin/vm-hands/local-pty-session-tqn2xmph.js +2 -0
- package/bin/vm-hands/managed-runtime-shzb3tr3.js +2 -0
- package/bin/vm-hands/network-auto-update-3m94436w.js +3 -0
- package/bin/vm-hands/network-contract-nkwcf4r9.js +2 -0
- package/bin/vm-hands/{network-sign-in-61gmpmaa.js → network-sign-in-xm79s170.js} +2 -2
- package/bin/vm-hands/package-9w0mmxb5.js +2 -0
- package/bin/vm-hands/permissions-scffy1px.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-pck5har9.js +2 -0
- package/bin/vm-hands/serve-service-grp91ybk.js +2 -0
- package/bin/vm-hands/{status-khqk4cjw.js → status-89999mdn.js} +7 -7
- package/bin/vm-hands/version-wyshazh7.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zawytz09.js → vm-hands-entry-lite-12ck5swp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-j10cw3d9.js → vm-hands-entry-lite-13nx02p7.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-vdv4nm5f.js → vm-hands-entry-lite-1b21avcs.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-1eyg750p.js +48 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2dak7e1h.js → vm-hands-entry-lite-1xhpn3hw.js} +3 -5
- package/bin/vm-hands/{vm-hands-entry-lite-ms99mzp0.js → vm-hands-entry-lite-284z7ct8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-a7bf7xr7.js → vm-hands-entry-lite-2qfmabqn.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-q9s1e2y1.js → vm-hands-entry-lite-33at6g06.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-jgk5z8zc.js → vm-hands-entry-lite-34b4tws6.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-e3fn8ys2.js → vm-hands-entry-lite-3gc2bn5a.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hxfxs7r9.js → vm-hands-entry-lite-3q2ng4e9.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-432khjd5.js +150 -0
- package/bin/vm-hands/vm-hands-entry-lite-6vnjgy77.js +81 -0
- package/bin/vm-hands/{vm-hands-entry-lite-ht6hzkgj.js → vm-hands-entry-lite-7r27208j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hs6sdn60.js → vm-hands-entry-lite-88dxn9b5.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-997y1m1r.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zh6ncdjn.js → vm-hands-entry-lite-a3gq377t.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-m1we91g4.js → vm-hands-entry-lite-af45ma9p.js} +10 -10
- package/bin/vm-hands/{vm-hands-entry-lite-0wb1n769.js → vm-hands-entry-lite-b1vanmtv.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-5y4phfv1.js → vm-hands-entry-lite-bsk184m7.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-q9djb28r.js → vm-hands-entry-lite-cc8hwgxc.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-chq0qx9f.js +12 -0
- package/bin/vm-hands/{vm-hands-entry-lite-84mc1f7h.js → vm-hands-entry-lite-cmmb9k3g.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-gxpw14jv.js → vm-hands-entry-lite-dy204qh4.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-ptycjmkc.js → vm-hands-entry-lite-fccn6s4j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-qf990rxw.js → vm-hands-entry-lite-fn2805g8.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-71ebge0c.js → vm-hands-entry-lite-fxptf351.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-vkhacd00.js → vm-hands-entry-lite-gcqqnnze.js} +19 -19
- package/bin/vm-hands/{vm-hands-entry-lite-57ajjwmh.js → vm-hands-entry-lite-gxf2r5en.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hjjbjpd7.js → vm-hands-entry-lite-jj7873n8.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-9g52kxyj.js → vm-hands-entry-lite-kbnxk71q.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-ncyrz48z.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-y3nz20wb.js → vm-hands-entry-lite-ngn4tafr.js} +105 -105
- package/bin/vm-hands/{vm-hands-entry-lite-52qz0n30.js → vm-hands-entry-lite-ngry8nkq.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-8xv6c0rm.js → vm-hands-entry-lite-pg7nnyc6.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-h7nk2848.js → vm-hands-entry-lite-pt19vacn.js} +42 -42
- package/bin/vm-hands/{vm-hands-entry-lite-tcmye5ny.js → vm-hands-entry-lite-q62g6sx0.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-v4hr9x9h.js → vm-hands-entry-lite-qjrgvdbj.js} +34 -34
- package/bin/vm-hands/{vm-hands-entry-lite-bj3w2ven.js → vm-hands-entry-lite-rqfhfp09.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-krpqqx12.js → vm-hands-entry-lite-rxydyqke.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-weqam12f.js → vm-hands-entry-lite-s93f3pbv.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-z0ht62s4.js → vm-hands-entry-lite-sh4mqy93.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-xvccy3z4.js → vm-hands-entry-lite-sz7z1qby.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-wcgm41jq.js → vm-hands-entry-lite-t43bz0ey.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-6jxshhps.js → vm-hands-entry-lite-t86kt9jz.js} +6 -6
- package/bin/vm-hands/{vm-hands-entry-lite-7pfhwxn5.js → vm-hands-entry-lite-tnj3483k.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-wnqqjsew.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pxtycfdv.js → vm-hands-entry-lite-xfak34av.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-sy7dcccg.js → vm-hands-entry-lite-y0jtj8zz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-yvws5zpx.js → vm-hands-entry-lite-yg4dk99m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2rgf8866.js → vm-hands-entry-lite-z65xva21.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-jpvmkce5.js → vm-hands-entry-lite-zp7chzcc.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k5ytpgzz.js → vm-hands-entry-lite-zpvr7wc6.js} +19 -19
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/vm-hands-executor-kyb5t371.js +12 -0
- package/bin/vm-hands/vm-hands-op-runner-gkt79hcp.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-1qxf96z7.js → vm-hands-runtime-tdr6j55n.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-h96yr4wf.js +2 -0
- package/bin/vm-hands/worker-sandbox-6kkhvryn.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/agent-network-kk36zca7.js +0 -2
- package/bin/vm-hands/api-credentials-mtfdk175.js +0 -2
- package/bin/vm-hands/api-w6w7vfp3.js +0 -2
- package/bin/vm-hands/connect-cli-dmwph620.js +0 -2
- package/bin/vm-hands/credentials-s7ps7y6s.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-3xnrp33e.js +0 -2
- package/bin/vm-hands/desktop-account-eg8thn79.js +0 -2
- package/bin/vm-hands/device-workspace-h5rsecq8.js +0 -2
- package/bin/vm-hands/hands-worker-source-vk664w8p.js +0 -2
- package/bin/vm-hands/install-receipt-j04hdw1k.js +0 -2
- package/bin/vm-hands/local-automation-vvt9d9xb.js +0 -2
- package/bin/vm-hands/local-capabilities-pwv76ns5.js +0 -2
- package/bin/vm-hands/local-desktop-users-sq4trh07.js +0 -2
- package/bin/vm-hands/local-display-mac-yxcxvg2z.js +0 -2
- package/bin/vm-hands/local-display-session-axh9mfdk.js +0 -2
- package/bin/vm-hands/local-display-video-pxhztqk7.js +0 -2
- package/bin/vm-hands/local-managed-process-4mgqn7tg.js +0 -2
- package/bin/vm-hands/local-pty-session-edd8ttf9.js +0 -2
- package/bin/vm-hands/managed-runtime-pcagtyfz.js +0 -2
- package/bin/vm-hands/network-auto-update-wkzb91qz.js +0 -3
- package/bin/vm-hands/network-contract-8mxtma3w.js +0 -2
- package/bin/vm-hands/package-vwvzjtn0.js +0 -2
- package/bin/vm-hands/permissions-348prrcx.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-1nkpw1v3.js +0 -2
- package/bin/vm-hands/serve-service-3dkyznay.js +0 -2
- package/bin/vm-hands/version-c1hen0wn.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-9yfmkd1f.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ab1pq3xg.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-hn9pq7zj.js +0 -127
- package/bin/vm-hands/vm-hands-entry-lite-nn6zcvmp.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-z213y4pj.js +0 -150
- package/bin/vm-hands/vm-hands-executor-csdtg7kj.js +0 -12
- package/bin/vm-hands/vm-hands-op-runner-z7tsd84c.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-06tygyjs.js +0 -2
- package/bin/vm-hands/worker-sandbox-e1cpkzfz.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
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 90322400 bytes
|
|
4
|
+
sha256: 3dd804039b9cb2398c0f1e460d9947a48277adfcc9638b6a98dd0f55fc84d072
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
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{
|
|
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:
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Q,oo,ve,so}from"./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-12ck5swp.js";import"./vm-hands-entry-lite-kbnxk71q.js";export{Q as credentialsPath,so as deleteCredentials,ve as loadCredentials,oo as saveCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rr,Br,Hn,Gi,Fr,jr,da,Ki,pa,ha,Hr}from"./vm-hands-entry-lite-gxf2r5en.js";export{rr as CUSTOM_ENDPOINT_DEVICE_CAPABILITY,Br as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,Fr as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,Gi as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,jr as CUSTOM_ENDPOINT_DEVICE_MAX_PAYLOAD_BYTES,Hn as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,da as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,ha as CustomEndpointDeviceCredentialSchema,pa as CustomEndpointDeviceRequestSchema,Ki as customEndpointRequestMatchesConfig,Hr as isCustomEndpointDeviceFailureCode};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{at,kt,Oe,xt,Ke,Dr,Zt,Ne,X,te,Ui,zi,qi,Mn,Wi}from"./vm-hands-entry-lite-kbnxk71q.js";export{qi as CLOUD_REPOSITORY_WORKSPACE_ID,Ui as CLOUD_SESSION_CONTROL_BASE,Mn 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,zi as SIDECHAT_WORKSPACE_ID,Wi as cloudSessionLayoutOfRoot,X as deviceWorkspaceRootRelative,Ne as isDeviceWorkspacePath,Zt as isSessionWorktreePath,te as parseDeviceWorkspace};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{pl}from"./vm-hands-entry-lite-fn2805g8.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,Ro}from"./vm-hands-entry-lite-qjrgvdbj.js";import"./vm-hands-entry-lite-a3gq377t.js";import"./vm-hands-entry-lite-zp7chzcc.js";import"./vm-hands-entry-lite-kbnxk71q.js";import"./vm-hands-entry-lite-rxydyqke.js";export{T as REASON_HANDS_WORKER_ARTIFACT_SHA256,H as REASON_HANDS_WORKER_ENTRYPOINT,nl as REASON_HANDS_WORKER_SOURCE,Ro as REASON_HANDS_WORKER_STARTUP_REFUSALS,U as REASON_HANDS_WORKER_VERSION};
|