@reason-machines/cli-linux-x64 0.2.559 → 0.2.560
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-j5f603sy.js +2 -0
- package/bin/vm-hands/api-credentials-7rhpwe7n.js +2 -0
- package/bin/vm-hands/api-vkgf7wma.js +2 -0
- package/bin/vm-hands/ask-relay-2vf6fa2t.js +5 -0
- package/bin/vm-hands/connect-cli-06x1wfgv.js +2 -0
- package/bin/vm-hands/credentials-s7ps7y6s.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-3xnrp33e.js +2 -0
- package/bin/vm-hands/desktop-account-eg8thn79.js +2 -0
- package/bin/vm-hands/device-workspace-h5rsecq8.js +2 -0
- package/bin/vm-hands/{fsevents-fev1pxw2.js → fsevents-vxv56sp5.js} +1 -1
- package/bin/vm-hands/hands-worker-source-vk664w8p.js +2 -0
- package/bin/vm-hands/{index-j6wffzfd.js → index-03p9c17x.js} +106 -106
- package/bin/vm-hands/install-receipt-j04hdw1k.js +2 -0
- package/bin/vm-hands/local-automation-8b1znx0p.js +2 -0
- package/bin/vm-hands/local-capabilities-m6pzcc94.js +2 -0
- package/bin/vm-hands/local-desktop-users-sq4trh07.js +2 -0
- package/bin/vm-hands/local-display-mac-yxcxvg2z.js +2 -0
- package/bin/vm-hands/local-display-session-zyd8s6n6.js +2 -0
- package/bin/vm-hands/local-display-video-rk680vwg.js +2 -0
- package/bin/vm-hands/local-managed-process-w26jhyfg.js +2 -0
- package/bin/vm-hands/local-pty-session-edd8ttf9.js +2 -0
- package/bin/vm-hands/managed-runtime-ykv5nyva.js +2 -0
- package/bin/vm-hands/network-auto-update-mrjz964a.js +3 -0
- package/bin/vm-hands/network-contract-8mxtma3w.js +2 -0
- package/bin/vm-hands/network-sign-in-8yvdx5rm.js +3 -0
- package/bin/vm-hands/package-vwvzjtn0.js +2 -0
- package/bin/vm-hands/permissions-nmxr8238.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-1nkpw1v3.js +2 -0
- package/bin/vm-hands/serve-service-det934tz.js +2 -0
- package/bin/vm-hands/status-fr7192eh.js +96 -0
- package/bin/vm-hands/version-5d6gbmrd.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-0as6nsks.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-0ex2twm5.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-0wb1n769.js +9 -0
- package/bin/vm-hands/{vm-hands-entry-lite-a3p6xz53.js → vm-hands-entry-lite-2rgf8866.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-4jgykvd3.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-52qz0n30.js +7 -0
- package/bin/vm-hands/vm-hands-entry-lite-57ajjwmh.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-71ebge0c.js +42 -0
- package/bin/vm-hands/vm-hands-entry-lite-84mc1f7h.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-8pcs85ak.js +105 -0
- package/bin/vm-hands/vm-hands-entry-lite-8w0ah5j9.js +11 -0
- package/bin/vm-hands/vm-hands-entry-lite-8xv6c0rm.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-9g52kxyj.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-a6ss0ges.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-a7bf7xr7.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-ab1pq3xg.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-bnpdn6fw.js +127 -0
- package/bin/vm-hands/vm-hands-entry-lite-cspd38hc.js +539 -0
- package/bin/vm-hands/{vm-hands-entry-lite-q1yvw4xz.js → vm-hands-entry-lite-e3fn8ys2.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-f8p11q6h.js +452 -0
- package/bin/vm-hands/{vm-hands-entry-lite-jrce7v4r.js → vm-hands-entry-lite-f95mg81d.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-fhx46jny.js +10 -0
- package/bin/vm-hands/{vm-hands-entry-lite-506b6pcz.js → vm-hands-entry-lite-fk2s50nc.js} +5 -5
- package/bin/vm-hands/vm-hands-entry-lite-hjjbjpd7.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-hs6sdn60.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-hxfxs7r9.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-2v4zh9ze.js → vm-hands-entry-lite-j10cw3d9.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-8rmbdm6c.js → vm-hands-entry-lite-jhsa4av7.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-jpvmkce5.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-k5ytpgzz.js +65 -0
- package/bin/vm-hands/{vm-hands-entry-lite-s85p7tqp.js → vm-hands-entry-lite-krpqqx12.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-q2h781jg.js → vm-hands-entry-lite-ms99mzp0.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-nn6zcvmp.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-46pwqvpf.js → vm-hands-entry-lite-ptycjmkc.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-pxtycfdv.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-q3er9m6y.js +9 -0
- package/bin/vm-hands/vm-hands-entry-lite-q9djb28r.js +4 -0
- package/bin/vm-hands/vm-hands-entry-lite-q9s1e2y1.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-qegwyvyz.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pzj5s203.js → vm-hands-entry-lite-qf990rxw.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-rhx6adbr.js +52 -0
- package/bin/vm-hands/vm-hands-entry-lite-sy7dcccg.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-tcmye5ny.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-tvnfm4xg.js +150 -0
- package/bin/vm-hands/{vm-hands-entry-lite-1yv5qqew.js → vm-hands-entry-lite-v4hr9x9h.js} +45 -45
- package/bin/vm-hands/vm-hands-entry-lite-vdv4nm5f.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-weqam12f.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-y4df9n3f.js +345 -0
- package/bin/vm-hands/vm-hands-entry-lite-yvws5zpx.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-qd46yhvz.js → vm-hands-entry-lite-z0ht62s4.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-zawytz09.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-h2rq71rj.js → vm-hands-entry-lite-zh6ncdjn.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-p2jvbq5w.js → vm-hands-executor-qny3mx8f.js} +8 -8
- package/bin/vm-hands/vm-hands-op-runner-5q01rhkc.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-889hfy4p.js → vm-hands-runtime-gjjm5fzd.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-06tygyjs.js +2 -0
- package/bin/vm-hands/worker-sandbox-e1cpkzfz.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-x30e4ezb.js +0 -2
- package/bin/vm-hands/api-y6v8wdsq.js +0 -2
- package/bin/vm-hands/connect-cli-32wrv6sw.js +0 -2
- package/bin/vm-hands/credentials-sbza33ac.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-mydksbg8.js +0 -2
- package/bin/vm-hands/desktop-account-t0afsge2.js +0 -2
- package/bin/vm-hands/device-workspace-b534qy2c.js +0 -2
- package/bin/vm-hands/hands-worker-source-qj7s9dk5.js +0 -2
- package/bin/vm-hands/install-receipt-zv1bjbgh.js +0 -2
- package/bin/vm-hands/local-automation-pwwqrnt7.js +0 -2
- package/bin/vm-hands/local-capabilities-scnpxe96.js +0 -2
- package/bin/vm-hands/local-desktop-users-5scb9930.js +0 -2
- package/bin/vm-hands/local-display-mac-pft73te9.js +0 -2
- package/bin/vm-hands/local-display-session-9362hqsn.js +0 -2
- package/bin/vm-hands/local-display-video-dndhr5v1.js +0 -2
- package/bin/vm-hands/local-managed-process-zm639p1g.js +0 -2
- package/bin/vm-hands/local-pty-session-njd0tprg.js +0 -2
- package/bin/vm-hands/managed-runtime-cqkw2mtn.js +0 -2
- package/bin/vm-hands/network-contract-kx0hz3wt.js +0 -2
- package/bin/vm-hands/package-way7qesn.js +0 -2
- package/bin/vm-hands/permissions-jxycbgay.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-g54rtrhd.js +0 -2
- package/bin/vm-hands/serve-service-byvya1ym.js +0 -2
- package/bin/vm-hands/status-f1k1qmck.js +0 -10
- package/bin/vm-hands/version-czwf27v3.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-04x5xjt6.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-07apxfh8.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-0wsr8edk.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-1tgxze8w.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-2twtpxmp.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-3gbf905c.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-48rphbjm.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-4anjdcth.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-73f4cgkf.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-8dfw96ym.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-ak0hd94p.js +0 -7
- package/bin/vm-hands/vm-hands-entry-lite-bpamn7ny.js +0 -9
- package/bin/vm-hands/vm-hands-entry-lite-dgfx0rbn.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-ecz6fzds.js +0 -126
- package/bin/vm-hands/vm-hands-entry-lite-frd7e74y.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-fxzadxz4.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-gje7xvy9.js +0 -6
- package/bin/vm-hands/vm-hands-entry-lite-h1qjggz0.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-j3fw7x65.js +0 -14
- package/bin/vm-hands/vm-hands-entry-lite-jydpev8e.js +0 -452
- package/bin/vm-hands/vm-hands-entry-lite-k84zsash.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-kf2jgke1.js +0 -150
- package/bin/vm-hands/vm-hands-entry-lite-m0gsez4t.js +0 -539
- package/bin/vm-hands/vm-hands-entry-lite-n7bd44rm.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-p5ny1pw4.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-qcktp8d9.js +0 -52
- package/bin/vm-hands/vm-hands-entry-lite-ravxhygk.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-s0rx4fm8.js +0 -105
- package/bin/vm-hands/vm-hands-entry-lite-tyem93c1.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-vj7xzb3y.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-wghmyfba.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-wzv13c8k.js +0 -65
- package/bin/vm-hands/vm-hands-entry-lite-yptpy066.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-yretc2th.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-zf0h0qjy.js +0 -2
- package/bin/vm-hands/vm-hands-op-runner-2bfbyj4e.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-gy36ejp9.js +0 -2
- package/bin/vm-hands/worker-sandbox-f1tfb3y0.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: 90318304 bytes
|
|
4
|
+
sha256: 761f89dda5347f403bcc174c507fb97ea2cf55ddd0eaec378ae8e5726dac78c4
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lt,Gc,Un,ir}from"./vm-hands-entry-lite-4jgykvd3.js";import"./vm-hands-entry-lite-0as6nsks.js";import"./vm-hands-entry-lite-84mc1f7h.js";import"./vm-hands-entry-lite-a7bf7xr7.js";import"./vm-hands-entry-lite-hs6sdn60.js";import"./vm-hands-entry-lite-q9s1e2y1.js";import"./vm-hands-entry-lite-2rgf8866.js";import"./vm-hands-entry-lite-qegwyvyz.js";import"./vm-hands-entry-lite-zawytz09.js";import"./vm-hands-entry-lite-9g52kxyj.js";import"./vm-hands-entry-lite-8xv6c0rm.js";import"./vm-hands-entry-lite-krpqqx12.js";export{lt as apiOriginFromEnvironment,Un as environmentApiKey,Gc as explicitApiOrigin,ir as resolveApiCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{C,eo,me}from"./vm-hands-entry-lite-0as6nsks.js";import"./vm-hands-entry-lite-84mc1f7h.js";import"./vm-hands-entry-lite-a7bf7xr7.js";import"./vm-hands-entry-lite-hs6sdn60.js";import"./vm-hands-entry-lite-q9s1e2y1.js";import"./vm-hands-entry-lite-2rgf8866.js";import"./vm-hands-entry-lite-qegwyvyz.js";import"./vm-hands-entry-lite-zawytz09.js";import"./vm-hands-entry-lite-9g52kxyj.js";import"./vm-hands-entry-lite-8xv6c0rm.js";import"./vm-hands-entry-lite-krpqqx12.js";export{C as ApiError,me as ReasonApi,eo as createMachineEnrollmentTicketWithToken};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zn}from"./vm-hands-entry-lite-84mc1f7h.js";import{Fe,Ji,Ot}from"./vm-hands-entry-lite-fhx46jny.js";import"./vm-hands-entry-lite-2rgf8866.js";import"./vm-hands-entry-lite-q9s1e2y1.js";import{g}from"./vm-hands-entry-lite-qegwyvyz.js";import{Ur}from"./vm-hands-entry-lite-hjjbjpd7.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-s7ps7y6s.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
|
+
`,{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
|
+
`,{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:zn,...v?.length?{message_counts:v,...l.endpoint?{endpoint:l.endpoint}:{}}:{},...R?{hosted:this.hostedReport()}:{}},AbortSignal.any([this.signal,AbortSignal.timeout((zn+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-8yvdx5rm.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(!Ji(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=Ot.openInstalled();if(n)try{let[{resolveApiCredentials:i},{ReasonApi:r}]=await Promise.all([import("./api-credentials-7rhpwe7n.js"),import("./api-vkgf7wma.js")]),a=await i({});if(a&&a.credentialKind!=="api_key"){let o=Ur(),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,Xi,ll,ul,Yi,dl,pl}from"./vm-hands-entry-lite-y4df9n3f.js";import"./vm-hands-entry-lite-ms99mzp0.js";import"./vm-hands-entry-lite-nn6zcvmp.js";import"./vm-hands-entry-lite-8w0ah5j9.js";import"./vm-hands-entry-lite-4jgykvd3.js";import"./vm-hands-entry-lite-0as6nsks.js";import"./vm-hands-entry-lite-84mc1f7h.js";import"./vm-hands-entry-lite-a7bf7xr7.js";import"./vm-hands-entry-lite-cspd38hc.js";import"./vm-hands-entry-lite-52qz0n30.js";import"./vm-hands-entry-lite-0ex2twm5.js";import"./vm-hands-entry-lite-f8p11q6h.js";import"./vm-hands-entry-lite-0wb1n769.js";import"./vm-hands-entry-lite-weqam12f.js";import"./vm-hands-entry-lite-v4hr9x9h.js";import"./vm-hands-entry-lite-yvws5zpx.js";import"./vm-hands-entry-lite-fk2s50nc.js";import"./vm-hands-entry-lite-tvnfm4xg.js";import"./vm-hands-entry-lite-hxfxs7r9.js";import"./vm-hands-entry-lite-pxtycfdv.js";import"./vm-hands-entry-lite-zh6ncdjn.js";import"./vm-hands-entry-lite-jpvmkce5.js";import"./vm-hands-entry-lite-bnpdn6fw.js";import"./vm-hands-entry-lite-q9djb28r.js";import"./vm-hands-entry-lite-8pcs85ak.js";import"./vm-hands-entry-lite-sy7dcccg.js";import"./vm-hands-entry-lite-hs6sdn60.js";import"./vm-hands-entry-lite-q9s1e2y1.js";import"./vm-hands-entry-lite-2rgf8866.js";import"./vm-hands-entry-lite-rhx6adbr.js";import"./vm-hands-entry-lite-j10cw3d9.js";import"./vm-hands-entry-lite-q3er9m6y.js";import"./vm-hands-entry-lite-qegwyvyz.js";import"./vm-hands-entry-lite-zawytz09.js";import"./vm-hands-entry-lite-9g52kxyj.js";import"./vm-hands-entry-lite-71ebge0c.js";import"./vm-hands-entry-lite-57ajjwmh.js";import"./vm-hands-entry-lite-z0ht62s4.js";import"./vm-hands-entry-lite-8xv6c0rm.js";import"./vm-hands-entry-lite-krpqqx12.js";export{Xi as computerDisconnected,fe as connectionDirectory,Yi as connectionReport,dl as restartConnection,pl as restartConnectionWhenIdle,ll as runConnectCli,ul as runDisconnectCli};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Q,ro,ve,no}from"./vm-hands-entry-lite-a7bf7xr7.js";import"./vm-hands-entry-lite-hs6sdn60.js";import"./vm-hands-entry-lite-q9s1e2y1.js";import"./vm-hands-entry-lite-2rgf8866.js";import"./vm-hands-entry-lite-zawytz09.js";import"./vm-hands-entry-lite-9g52kxyj.js";export{Q as credentialsPath,no as deleteCredentials,ve as loadCredentials,ro as saveCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rr,Dr,Bn,qi,Or,Nr,na,Wi,ia,oa,Lr}from"./vm-hands-entry-lite-57ajjwmh.js";export{rr as CUSTOM_ENDPOINT_DEVICE_CAPABILITY,Dr as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,Or as CUSTOM_ENDPOINT_DEVICE_MAX_BODY_BYTES,qi as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,Nr as CUSTOM_ENDPOINT_DEVICE_MAX_PAYLOAD_BYTES,Bn as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,na as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,oa as CustomEndpointDeviceCredentialSchema,ia as CustomEndpointDeviceRequestSchema,Wi as customEndpointRequestMatchesConfig,Lr as isCustomEndpointDeviceFailureCode};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{st,Et,Oe,kt,Ge,Cr,Zt,Ne,X,te,Fi,ji,Hi,Nn,Ui}from"./vm-hands-entry-lite-9g52kxyj.js";export{Hi as CLOUD_REPOSITORY_WORKSPACE_ID,Fi as CLOUD_SESSION_CONTROL_BASE,Nn as CLOUD_SESSION_ROOT,Et as HANDS_WORKSPACE_BASE_KEY,kt as HANDS_WORKSPACE_LAYOUT_KEY,st as REASON_WORKSPACE_BASE,Oe as SESSION_WORKSPACE_LAYOUT,Ge as SESSION_WORKTREES,Cr as SESSION_WORKTREE_ID,ji as SIDECHAT_WORKSPACE_ID,Ui 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{ol}from"./vm-hands-entry-lite-qf990rxw.js";var o;var r=ol(()=>{o=Error("Cannot find module 'fsevents'");o.code="MODULE_NOT_FOUND";throw o});r();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{U,H,Xc,R,Ro}from"./vm-hands-entry-lite-v4hr9x9h.js";import"./vm-hands-entry-lite-zh6ncdjn.js";import"./vm-hands-entry-lite-jpvmkce5.js";import"./vm-hands-entry-lite-9g52kxyj.js";import"./vm-hands-entry-lite-krpqqx12.js";export{R as REASON_HANDS_WORKER_ARTIFACT_SHA256,H as REASON_HANDS_WORKER_ENTRYPOINT,Xc as REASON_HANDS_WORKER_SOURCE,Ro as REASON_HANDS_WORKER_STARTUP_REFUSALS,U as REASON_HANDS_WORKER_VERSION};
|