@reason-machines/cli-linux-arm64-musl 0.2.352 → 0.2.354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ara +1 -1
- package/bin/vm-hands/{api-0wscteg6.js → api-3wwh4c28.js} +1 -1
- package/bin/vm-hands/{api-credentials-6qs21t88.js → api-credentials-j2hvs3zw.js} +1 -1
- package/bin/vm-hands/{ask-relay-0j7e2qfb.js → ask-relay-d8gbx7rd.js} +2 -2
- package/bin/vm-hands/{connect-cli-vqcvzj5n.js → connect-cli-vcfcb2g3.js} +1 -1
- package/bin/vm-hands/{local-automation-snr7w7rm.js → local-automation-449dhm5r.js} +1 -1
- package/bin/vm-hands/{local-capabilities-ggbsk169.js → local-capabilities-3x0b9xmk.js} +1 -1
- package/bin/vm-hands/{local-display-session-fcptmmhc.js → local-display-session-0ffgn43h.js} +1 -1
- package/bin/vm-hands/{permissions-fwvgtbvr.js → permissions-pjfvzajr.js} +1 -1
- package/bin/vm-hands/{status-a1xhjh72.js → status-yqrfan74.js} +2 -2
- package/bin/vm-hands/{version-3k9sc1xe.js → version-hz0ddxsn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-q2z2f9n4.js → vm-hands-entry-lite-14ff4san.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-qbg33vxp.js → vm-hands-entry-lite-75v7p1ab.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-pztap0be.js → vm-hands-entry-lite-7z169ekf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-0d93secz.js → vm-hands-entry-lite-8q8mxthp.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9khka7wc.js → vm-hands-entry-lite-d7s2d8bp.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hz0ywb12.js → vm-hands-entry-lite-rw994s8q.js} +18 -18
- package/bin/vm-hands/{vm-hands-entry-lite-22q8r2qr.js → vm-hands-entry-lite-s069zk82.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-gkd1gkfc.js → vm-hands-entry-lite-s97jy69e.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hwjtyptw.js → vm-hands-entry-lite-w7gxe8ta.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-1ey4kprv.js → vm-hands-entry-lite-y7jx1x8p.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-8hez8yg7.js → vm-hands-entry-lite-zg2xz3b1.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-8m5p7snz.js → vm-hands-executor-645jqht0.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-48q5h3dw.js → vm-hands-op-runner-dj3pn7eg.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-ncemfwsx.js → vm-hands-runtime-sw74b6rq.js} +2 -2
- package/package.json +1 -1
package/bin/ara
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{F as a,G as b,H as c,I as d,J as e,K as f}from"./vm-hands-entry-lite-
|
|
2
|
+
import{F as a,G as b,H as c,I as d,J as e,K as f}from"./vm-hands-entry-lite-y7jx1x8p.js";import"./vm-hands-entry-lite-fs3ahdgg.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{d as sessionPlace,c as sessionMachine,e as createMachineEnrollmentTicketWithToken,f as ReasonApi,b as REASONING_EFFORTS,a as ApiError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{v as a,w as b,x as c,y as d,z as e}from"./vm-hands-entry-lite-
|
|
2
|
+
import{v as a,w as b,x as c,y as d,z as e}from"./vm-hands-entry-lite-w7gxe8ta.js";import"./vm-hands-entry-lite-y7jx1x8p.js";import"./vm-hands-entry-lite-fs3ahdgg.js";import"./vm-hands-entry-lite-gcn3rmz6.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{d as resolveApiCredentials,e as requireApiCredentials,b as explicitApiOrigin,c as environmentApiKey,a as apiOriginFromEnvironment};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{L as _}from"./vm-hands-entry-lite-fs3ahdgg.js";import{sf as c}from"./vm-hands-entry-lite-
|
|
2
|
+
import{L as _}from"./vm-hands-entry-lite-fs3ahdgg.js";import{sf as c}from"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-k17ntg9v.js";import{wi as g}from"./vm-hands-entry-lite-nd1k2jz9.js";import{existsSync as Pz,mkdirSync as Uz,readFileSync as Cz,writeFileSync as Mz}from"fs";import{homedir as Oz}from"os";import{dirname as w,join as fz}from"path";import{spawnSync as W}from"child_process";import{createHash as p}from"crypto";import{chmodSync as m,existsSync as K,mkdirSync as b,mkdtempSync as a,readFileSync as i,renameSync as t,rmSync as r,statSync as s,writeFileSync as S}from"fs";import{connect as n}from"net";import{homedir as R}from"os";import{dirname as O,join as H}from"path";class V extends Error{}var D="reason-network",U="0.10.3",o={"aarch64-apple-darwin":"1e793a89ea8b53c603cddbc65ac08b0dd83f1dbfc30a1987858e2c52e2ed907c","x86_64-apple-darwin":"ef1f0f8d7d9e8a286de54eeb78f8ff8a53152c1a661c50b6182bfefa8eef8a02","aarch64-unknown-linux-musl":"75fdfd10314225ffb2875acc7ac73c66de23b5678b684d70b4678eb16ba35124","x86_64-unknown-linux-musl":"17111a623396eed0a2d98aa4d3bb03f00da37c25bdc39b6d0ba3ab202dfbe874"},e="https://reasonmachines.com/cli/engine",G="REASON_AGENT_NETWORK_BIN";function zz(){let z=process.arch==="arm64"?"aarch64":process.arch==="x64"?"x86_64":null,X=process.platform==="darwin"?"apple-darwin":process.platform==="linux"?"unknown-linux-musl":null;return z&&X?`${z}-${X}`:null}function Xz(z){let X=W(z,["--version"],{encoding:"utf8",timeout:5000}),[Z,$]=X.status===0?X.stdout.trim().split(/\s+/):[];return Z===D?$??null:null}function Zz(z,X){let Z=z.split(".").map(Number),$=X.split(".").map(Number);for(let q=0;q<3;q+=1)if((Z[q]??0)!==($[q]??0))return(Z[q]??0)>($[q]??0);return!0}function E(){return H(R(),".reason","bin","reason-network")}async function $z(z=process.env){if(z[G])return z[G];let X=E(),Z=v();if(Z?.path===X&&T(X)===Z.fingerprint)return X;let $=K(X)?Xz(X):null;if(!$||!Zz($,U))await Qz(X);let q=W(X,["setup",...qz(z)?["--no-service"]:[]],{env:z,encoding:"utf8",timeout:60000});if(q.status!==0){let Q=P((q.stderr||q.stdout||"").trim().split(`
|
|
3
3
|
`).pop()??"");throw new V(`Couldn't connect this computer's agents to the network${Q?` (${Q})`:""}. Run reason network setup to try again.`)}return W(X,["stop"],{env:z,stdio:"ignore",timeout:15000}),Bz(X)}function qz(z=process.env){return Boolean(z.REASON_NETWORK_NO_SERVICE||z.TINCAN_NO_SERVICE)}var f=()=>H(R(),".reason","ask-engine.json");function T(z){try{let X=s(z);return`${X.size}:${X.mtimeMs}:${X.ino}`}catch{return null}}function v(){try{let z=JSON.parse(i(f(),"utf8"));return typeof z.path==="string"&&typeof z.fingerprint==="string"&&z.version===U?{path:z.path,fingerprint:z.fingerprint}:null}catch{return null}}function Bz(z){let X=T(z);if(!X)return z;let Z=O(f());if(!K(Z))b(Z,{recursive:!0});return S(f(),JSON.stringify({path:z,fingerprint:X,version:U})),z}async function Qz(z){let X=zz(),Z=X?o[X]:void 0;if(!X||!Z)throw new V(`Reason Network runs on macOS and Linux (arm64 or x64); this is ${process.platform} ${process.arch}.`);let $=`${e}/${U}/${D}-${X}.tar.gz`,q;try{let Y=await fetch($,{signal:AbortSignal.timeout(120000)});if(!Y.ok)throw Error(`HTTP ${Y.status}`);q=Buffer.from(await Y.arrayBuffer())}catch(Y){let F=Y instanceof Error&&Y.name==="TimeoutError"?"no download within 2 minutes":Y instanceof Error?Y.message.replace(/\.$/,""):String(Y);throw new V(`Couldn't download the network engine from ${new URL($).host} (${F}). Check the connection and run reason network again.`)}if(p("sha256").update(q).digest("hex")!==Z)throw new V("The downloaded network engine didn't match its checksum, so it wasn't installed.");b(O(z),{recursive:!0});let B=a(H(O(z),".reason-engine-"));try{if(S(H(B,"engine.tar.gz"),q),W("tar",["-xzf",H(B,"engine.tar.gz"),"-C",B]).status!==0||!K(H(B,D)))throw new V("Couldn't unpack the network engine.");m(H(B,D),493),t(H(B,D),z)}finally{r(B,{recursive:!0,force:!0})}}function Yz(z=process.env,X=R()){let Z=z.REASON_NETWORK_HOME?.trim()||z.TINCAN_HOME?.trim();if(Z)return Z;let $=H(X,".reason","network"),q=H(X,".tincan");return!A($)&&A(q)?q:$}var A=(z)=>K(H(z,"network.db"))||K(H(z,"tincan.db"));function Hz(z){let X=K(H(z,"network.db"))||!K(H(z,"tincan.db")),Z=H(z,X?"network.sock":"tincan.sock");if(Buffer.byteLength(Z)<100)return Z;let $=0xcbf29ce484222325n;for(let q of Buffer.from(Z))$=BigInt.asUintN(64,($^BigInt(q))*0x100000001b3n);return H("/tmp",`${X?"reason-network":"tincan"}-${process.getuid?.()??0}`,`${$.toString(16).padStart(16,"0")}.sock`)}var u=15000,Jz=new Set(["who","team","inbox","unread","held"]),Kz=90000;class x{socket;nextId=1;buffer="";pending=new Map;closed=null;constructor(z){this.socket=z;z.setEncoding("utf8"),z.on("data",(Z)=>this.read(Z));let X=(Z)=>{this.closed=Z;for(let $ of this.pending.values())$.reject(Z);this.pending.clear()};z.on("error",(Z)=>X(Z)),z.on("close",()=>X(Error("the network daemon closed the connection")))}static open(z){return new Promise((X,Z)=>{let $=n(z);$.once("connect",()=>X(new x($))),$.once("error",Z)})}read(z){this.buffer+=z;let X=this.buffer.indexOf(`
|
|
4
4
|
`);while(X>=0){let Z=this.buffer.slice(0,X);if(this.buffer=this.buffer.slice(X+1),X=this.buffer.indexOf(`
|
|
5
5
|
`),!Z.trim())continue;let $;try{$=JSON.parse(Z)}catch{continue}if(typeof $.id!=="number")continue;let q=this.pending.get($.id);if(!q)continue;if(this.pending.delete($.id),$.ok)q.resolve($.result);else q.reject(Error(P($.error??"the network daemon refused the request")))}}call(z,X={},Z=u){if(this.closed)return Promise.reject(this.closed);let $=this.nextId++;return this.socket.write(`${JSON.stringify({id:$,op:z,...X})}
|
|
6
6
|
`),new Promise((q,Q)=>{let B=setTimeout(()=>{this.pending.delete($),Q(Error(`the network daemon didn't answer ${z} within ${Math.round(Z/1000)}s`))},Z);this.pending.set($,{resolve:(Y)=>{clearTimeout(B),q(Y)},reject:(Y)=>{clearTimeout(B),Q(Y)}})})}get isClosed(){return this.closed!==null}close(){this.socket.end()}}var M=/^(Claude Code|Grok|Codex) \u00B7 (.*)$/,Vz={"Claude Code":"claude-code",Grok:"grok",Codex:"codex"},Lz=/^ask-[0-9a-f]{6}$/;function j(z){return{id:z.id,from:z.from,fromAgent:z.from_agent,to:z.to,replyTo:z.reply_to,body:z.body,sentAt:z.sent_at}}function N(z){return{person:z.person,machine:z.machine,isMe:z.is_me,online:z.online,link:z.link,rttMs:z.rtt_ms}}class L{engine;env;connection=null;waits=new Set;constructor(z,X){this.engine=z;this.env=X}static async open(z=process.env){return new L(await $z(z),z)}static openInstalled(z=process.env){if(z[G])return new L(z[G],z);let X=E(),Z=v();return Z?.path===X&&T(X)===Z.fingerprint?new L(X,z):null}socketPath(){return Hz(Yz(this.env))}async open(){try{return await x.open(this.socketPath())}catch{return W(this.engine,["who","--json"],{env:this.env,stdio:"ignore",timeout:15000}),await x.open(this.socketPath())}}async call(z,X={},Z){if(!this.connection||this.connection.isClosed)this.connection=await this.open();try{return await this.connection.call(z,X,Z)}catch($){if(!/closed|ECONNRESET|EPIPE/.test(String($)))throw $;if(this.connection=await this.open(),!Jz.has(z))throw $;return await this.connection.call(z,X)}}async waitOn(z,X){let Z=await this.open();this.waits.add(Z);try{return await Z.call(z,X,X.wait_secs*1000+u)}finally{this.waits.delete(Z),Z.close()}}close(){this.connection?.close(),this.connection=null;for(let z of this.waits)z.close();this.waits.clear()}async team(){try{let z=await this.call("team");return{...z,machines:z.machines.map(N)}}catch(z){if(/team/i.test(String(z)))return null;throw z}}async snapshot(z={}){let X=await this.call("who",{all:Boolean(z.all),...z.filter?{filter:z.filter}:{}}),Z=new Set(X.sessions.filter((q)=>M.test(q.doing??"")).map((q)=>`${q.person}/${q.machine}:${q.cwd}`)),$=X.sessions.filter((q)=>z.all||!Lz.test(q.name)).filter((q)=>M.test(q.doing??"")||!Z.has(`${q.person}/${q.machine}:${q.cwd}`)).map((q)=>{let Q=M.exec(q.doing??"");return{address:q.address,name:q.name,person:q.person,machine:q.machine,agent:Q?Vz[Q[1]]:q.agent,cwd:q.cwd,repo:q.repo,branch:q.branch,status:Q?Q[2]==="ready for work"?"idle":Q[2]==="stopped"?"offline":"busy":q.status,since:q.since,doing:Q?Q[2]:q.doing,isMe:q.is_me,worker:Boolean(Q)}});return{team:X.team,person:X.person,machine:X.machine,machines:X.machines.map(N),sessions:$}}async send(z,X,Z={}){if(!Z.from)await this.call("hook",{agent:"cli",event:"stop",session_id:"terminal",name:"terminal",cwd:process.cwd(),mail:!1});let $=await this.call("send",{from:Z.from??"terminal",to:z,body:X,...Z.replyTo?{reply_to:Z.replyTo}:{},wake:Z.wake??!0});return{ids:$.ids,recipients:$.recipients.map((q)=>q.address)}}async session(z,X={}){let Z=X.agent??"cli",$=(B,Y={})=>this.call("hook",{agent:Z,event:B,session_id:z,name:z,cwd:process.cwd(),mail:!1,...Y}),q=await $("stop"),Q=`${Z}:${z}`;return{name:z,address:q.address??z,next:async(B)=>{return(await this.waitOn("inbox",{key:Q,wait_secs:B,peek:!0})).messages.map(j)},ack:async(B)=>{if(B.length)await this.call("delivered",{key:Q,ids:B})},busy:async(B)=>{if(await $("prompt"),B)await $("doing",{doing:B})},idle:async(B)=>{if(await $("stop"),B)await $("doing",{doing:B})},doing:async(B)=>{await $("doing",{doing:B})},send:(B,Y,F)=>this.send(B,Y,{from:Q,...F?{replyTo:F}:{}})}}async inbox(z={}){let Z=(await this.waitOn("inbox",{key:"cli:terminal",wait_secs:z.waitSeconds??0,peek:!0}).catch(($)=>{if(/isn't registered/.test(String($)))return{messages:[]};throw $})).messages.map(j);if(Z.length&&!z.peek)await this.call("delivered",{key:"cli:terminal",ids:Z.map(($)=>$.id)});return Z}async link(z={}){return await this.call("link",{new:Boolean(z.new)})}async changeTeam(z,X){try{return await this.call(z,X,Kz)}finally{this.close()}}async changeOntoTeam(z,X){try{await this.changeTeam(z,X)}catch(Z){if(!/closed|ECONNRESET|EPIPE/.test(String(Z)))throw Z;if(await this.team())return;await this.changeTeam(z,X)}}async createTeam(z,X){await this.changeOntoTeam("create_team",{name:z,person:X})}async join(z,X){await this.changeOntoTeam("join",{ticket:z,person:X})}async leave(){return await this.changeTeam("leave",{force:!0})}async remove(z){return await this.call("remove",{who:z})}passthrough(z,X={}){this.close();let Z=W(this.engine,z,{stdio:["inherit","pipe","pipe"],encoding:"utf8",env:this.env});if(!X.quiet||Z.status!==0)process.stdout.write(P(Z.stdout??"")),process.stderr.write(P(Z.stderr??""));return Z.status??1}}function P(z){return z.replace(/not in a team yet:[^\n]*/g,"this computer isn't on a team yet: run `reason network setup`").replace(/`tincan (\w+)/g,"`reason network $1").replace(/\btincan (who|send|inbox|invite|join|team|link|setup|doctor|remove|leave|listen)\b/g,"reason network $1").replace(/(?<![\w./-])tincan(?![\w./-])/gi,"Reason Network")}import{existsSync as kz,mkdirSync as cz,readFileSync as Wz,writeFileSync as lz}from"fs";import{homedir as Dz,hostname as mz}from"os";import{dirname as iz,join as Fz}from"path";var Gz=(z)=>Fz(z,".reason","ask.json");function xz(z){try{let X=JSON.parse(Wz(Gz(z),"utf8"));if(typeof X.orgId!=="string"||typeof X.team!=="string")return null;let Z=X.pendingRotation;return{orgId:X.orgId,team:X.team,...typeof X.checkedAt==="number"?{checkedAt:X.checkedAt}:{},...Z&&typeof Z.link==="string"&&typeof Z.team==="string"&&typeof Z.replaces==="string"?{pendingRotation:Z}:{}}}catch{return null}}function y(z=Dz()){let X=xz(z);return X?{orgId:X.orgId,team:X.team}:null}var d=86400000,Rz=300,C=(z)=>fz(z,".reason","ask-relay.json");function I(z){try{let X=JSON.parse(Cz(C(z),"utf8"));return{sessions:Array.isArray(X.sessions)?X.sessions.filter((Z)=>typeof Z?.name==="string"&&typeof Z.agent==="string"&&typeof Z.usedAt==="number"):[]}}catch{return{sessions:[]}}}function Tz(z,X){try{if(!Pz(w(C(z))))Uz(w(C(z)),{recursive:!0});Mz(C(z),`${JSON.stringify(X)}
|
|
7
7
|
`,{mode:384})}catch{}}var J=(z,X)=>new Promise((Z)=>{if(X.aborted)return Z();let $=setTimeout(q,z);$.unref?.();function q(){clearTimeout($),X.removeEventListener("abort",q),Z()}X.addEventListener("abort",q,{once:!0})});function h(z){let X=z?.status;return typeof X==="number"?X:null}var k=60000;function Iz(z){let X=Number.isFinite(z.sentAt)&&Math.abs(z.sentAt)<8640000000000000?z.sentAt:Date.now();return{id:z.id.slice(0,100),from:z.from.slice(0,300),from_agent:z.fromAgent?.slice(0,100)??null,to:z.to.slice(0,300),reply_to:z.replyTo?.slice(0,100)??null,sent_at:X,body:z.body.length>k?`${z.body.slice(0,k)}
|
|
8
|
-
[cut: the answer was ${z.body.length} characters]`:z.body}}class l{network;api;home;signal;log;team;sessions=new Map;readers=new Set;constructor(z,X,Z,$,q,Q){this.network=z;this.api=X;this.home=Z;this.signal=$;this.log=q;this.team=Q}async run(){let z=Date.now()-d;for(let Z of I(this.home).sessions)if(Z.usedAt>z)this.read(Z);let X=0;while(!this.signal.aborted){let Z=await this.network.team().catch(()=>null);if(!Z){await J(60000,this.signal);continue}if(Z.name!==this.team)return;let $;try{let q=await this.api.claimAgentNetworkRelayJob({machine:Z.machine,person:Z.person,team:Z.name,version:c,wait_seconds:_},AbortSignal.any([this.signal,AbortSignal.timeout((_+20)*1000)]));if(X=0,q.retry_after_seconds)await J(q.retry_after_seconds*1000,this.signal);$=q.job}catch(q){if(this.signal.aborted)return;let Q=h(q);if(Q===403||Q===401){await J(900000,this.signal);continue}if(Q===404||Q===405){await J(120000,this.signal);continue}X+=1,await J(Math.min(60000,1000*2**Math.min(X,6)),this.signal);continue}if($)this.carry($)}}async carry(z){let X;try{X=z.kind==="who"?{who:await this.who()}:{sent:await this.send(z)}}catch(Z){X={error:Z instanceof Error?Z.message:String(Z)}}for(let Z=1;;Z+=1)try{if(await this.api.completeAgentNetworkRelayJob(z.id,X),z.kind==="send")this.log(`relayed a message to ${z.to} from ${"sent"in X?X.sent.from:z.from_name}`);return}catch($){if(Z>=4||this.signal.aborted){this.log(`couldn't report a relayed call: ${$ instanceof Error?$.message:String($)}`);return}await J(Z*1000,this.signal)}}async who(){let z=await this.network.snapshot();return{team:z.team,sessions:z.sessions.map((X)=>({address:X.address,person:X.person,machine:X.machine,agent:X.agent,repo:X.repo,branch:X.branch,status:X.status,since:X.since,doing:X.doing,worker:X.worker})),machines:z.machines.map((X)=>({person:X.person,machine:X.machine,online:X.online}))}}async send(z){let X={name:z.from_name,agent:z.from_agent},Z=await this.session(X),$=await Z.send(z.to,z.body);return this.remember(X),this.read(X),{ids:$.ids,recipients:$.recipients,from:Z.address}}session(z){let X=`${z.agent}:${z.name}`,Z=this.sessions.get(X);if(!Z)Z=this.network.session(z.name,{agent:z.agent}).then(async($)=>{return await $.idle(`personal agent (${z.agent}), through Reason`).catch(()=>{}),$}),Z.catch(()=>this.sessions.delete(X)),this.sessions.set(X,Z);return Z}remember(z){let Z=I(this.home).sessions.filter(($)=>$.name!==z.name||$.agent!==z.agent);Tz(this.home,{sessions:[...Z,{...z,usedAt:Date.now()}].slice(-50)})}read(z){let X=`${z.agent}:${z.name}`;if(this.readers.has(X))return;this.readers.add(X),(async()=>{let Z=0;try{while(!this.signal.aborted){let $=I(this.home).sessions.find((q)=>q.name===z.name&&q.agent===z.agent)?.usedAt??0;if(Date.now()-$>d)return;try{let q=await this.session(z),Q=await q.next(Rz);if(Q.length===0)continue;await this.api.recordAgentNetworkRelayReplies(Q.map(Iz)).catch((B)=>{let Y=h(B);if(Y===null||Y>=500||Y===429||Y===401)throw B;this.log(`dropped ${Q.length} answer(s) the server refused (HTTP ${Y})`)}),await q.ack(Q.map((B)=>B.id)),Z=0}catch{if(this.signal.aborted)return;this.sessions.delete(X),Z+=1,await J(Math.min(60000,1000*2**Math.min(Z,6)),this.signal)}}}finally{this.readers.delete(X)}})()}}async function _z(z){await new l(z.network,z.api,z.home??Oz(),z.signal,z.log??(()=>{}),z.team).run()}async function $X(z,X=()=>{}){while(!z.aborted){try{let Z=y(),$=Z?L.openInstalled():null;if(Z&&$){let[{requireApiCredentials:q},{ReasonApi:Q}]=await Promise.all([import("./api-credentials-
|
|
8
|
+
[cut: the answer was ${z.body.length} characters]`:z.body}}class l{network;api;home;signal;log;team;sessions=new Map;readers=new Set;constructor(z,X,Z,$,q,Q){this.network=z;this.api=X;this.home=Z;this.signal=$;this.log=q;this.team=Q}async run(){let z=Date.now()-d;for(let Z of I(this.home).sessions)if(Z.usedAt>z)this.read(Z);let X=0;while(!this.signal.aborted){let Z=await this.network.team().catch(()=>null);if(!Z){await J(60000,this.signal);continue}if(Z.name!==this.team)return;let $;try{let q=await this.api.claimAgentNetworkRelayJob({machine:Z.machine,person:Z.person,team:Z.name,version:c,wait_seconds:_},AbortSignal.any([this.signal,AbortSignal.timeout((_+20)*1000)]));if(X=0,q.retry_after_seconds)await J(q.retry_after_seconds*1000,this.signal);$=q.job}catch(q){if(this.signal.aborted)return;let Q=h(q);if(Q===403||Q===401){await J(900000,this.signal);continue}if(Q===404||Q===405){await J(120000,this.signal);continue}X+=1,await J(Math.min(60000,1000*2**Math.min(X,6)),this.signal);continue}if($)this.carry($)}}async carry(z){let X;try{X=z.kind==="who"?{who:await this.who()}:{sent:await this.send(z)}}catch(Z){X={error:Z instanceof Error?Z.message:String(Z)}}for(let Z=1;;Z+=1)try{if(await this.api.completeAgentNetworkRelayJob(z.id,X),z.kind==="send")this.log(`relayed a message to ${z.to} from ${"sent"in X?X.sent.from:z.from_name}`);return}catch($){if(Z>=4||this.signal.aborted){this.log(`couldn't report a relayed call: ${$ instanceof Error?$.message:String($)}`);return}await J(Z*1000,this.signal)}}async who(){let z=await this.network.snapshot();return{team:z.team,sessions:z.sessions.map((X)=>({address:X.address,person:X.person,machine:X.machine,agent:X.agent,repo:X.repo,branch:X.branch,status:X.status,since:X.since,doing:X.doing,worker:X.worker})),machines:z.machines.map((X)=>({person:X.person,machine:X.machine,online:X.online}))}}async send(z){let X={name:z.from_name,agent:z.from_agent},Z=await this.session(X),$=await Z.send(z.to,z.body);return this.remember(X),this.read(X),{ids:$.ids,recipients:$.recipients,from:Z.address}}session(z){let X=`${z.agent}:${z.name}`,Z=this.sessions.get(X);if(!Z)Z=this.network.session(z.name,{agent:z.agent}).then(async($)=>{return await $.idle(`personal agent (${z.agent}), through Reason`).catch(()=>{}),$}),Z.catch(()=>this.sessions.delete(X)),this.sessions.set(X,Z);return Z}remember(z){let Z=I(this.home).sessions.filter(($)=>$.name!==z.name||$.agent!==z.agent);Tz(this.home,{sessions:[...Z,{...z,usedAt:Date.now()}].slice(-50)})}read(z){let X=`${z.agent}:${z.name}`;if(this.readers.has(X))return;this.readers.add(X),(async()=>{let Z=0;try{while(!this.signal.aborted){let $=I(this.home).sessions.find((q)=>q.name===z.name&&q.agent===z.agent)?.usedAt??0;if(Date.now()-$>d)return;try{let q=await this.session(z),Q=await q.next(Rz);if(Q.length===0)continue;await this.api.recordAgentNetworkRelayReplies(Q.map(Iz)).catch((B)=>{let Y=h(B);if(Y===null||Y>=500||Y===429||Y===401)throw B;this.log(`dropped ${Q.length} answer(s) the server refused (HTTP ${Y})`)}),await q.ack(Q.map((B)=>B.id)),Z=0}catch{if(this.signal.aborted)return;this.sessions.delete(X),Z+=1,await J(Math.min(60000,1000*2**Math.min(Z,6)),this.signal)}}}finally{this.readers.delete(X)}})()}}async function _z(z){await new l(z.network,z.api,z.home??Oz(),z.signal,z.log??(()=>{}),z.team).run()}async function $X(z,X=()=>{}){while(!z.aborted){try{let Z=y(),$=Z?L.openInstalled():null;if(Z&&$){let[{requireApiCredentials:q},{ReasonApi:Q}]=await Promise.all([import("./api-credentials-j2hvs3zw.js"),import("./api-3wwh4c28.js")]),B=await q({});if(B.credentialKind!=="api_key"&&B.orgId.toLowerCase()===Z.orgId.toLowerCase())try{await _z({network:$,api:new Q(B),team:Z.team,signal:z,log:X})}finally{$.close()}}}catch(Z){X(`agent network relay: ${Z instanceof Error?Z.message:String(Z)}`)}await J(300000,z)}}export{$X as runBackgroundAskRelay,_z as runAskRelay};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as a,i as b,j as c,k as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m}from"./vm-hands-entry-lite-
|
|
2
|
+
import{h as a,i as b,j as c,k as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m}from"./vm-hands-entry-lite-s069zk82.js";import"./vm-hands-entry-lite-tdgbgcer.js";import"./vm-hands-entry-lite-w7gxe8ta.js";import"./vm-hands-entry-lite-y7jx1x8p.js";import"./vm-hands-entry-lite-fs3ahdgg.js";import"./vm-hands-entry-lite-8q8mxthp.js";import"./vm-hands-entry-lite-rw994s8q.js";import"./vm-hands-entry-lite-dyy62gt3.js";import"./vm-hands-entry-lite-wpx6sg6d.js";import"./vm-hands-entry-lite-nbtpm59m.js";import"./vm-hands-entry-lite-nvhzj5b0.js";import"./vm-hands-entry-lite-gcn3rmz6.js";import"./vm-hands-entry-lite-beannz0s.js";import"./vm-hands-entry-lite-zg2xz3b1.js";import"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-7z169ekf.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-s97jy69e.js";import"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{g as runDisconnectCli,f as runConnectCli,m as restartConnectionWhenIdle,l as restartConnection,h as logoutConnection,k as connectionUsesUserChrome,i as connectionReport,j as connectionForBrowserExtension,c as connectionDirectory,d as computerDisconnected,e as addConnectionFolder,b as DISCONNECT_HELP,a as CONNECT_HELP};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$c as e,Xc as a,Yc as b,Zc as c,_c as d,ad as f,bd as g,cd as h,dd as i,ed as j,fd as k,gd as l}from"./vm-hands-entry-lite-
|
|
2
|
+
import{$c as e,Xc as a,Yc as b,Zc as c,_c as d,ad as f,bd as g,cd as h,dd as i,ed as j,fd as k,gd as l}from"./vm-hands-entry-lite-zg2xz3b1.js";import"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-7z169ekf.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-s97jy69e.js";import"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{d as runRelayed,e as runMacComputerUse,l as runLocalAutomation,k as runAutomationCallLocally,b as parseAutomationPayload,g as localUserChromeProfiles,h as localUserChromeInstance,f as localUserChromeHost,j as localBrowserProfile,c as localAutomationAvailable,i as ensureLocalBrowser,a as AUTOMATION_CHUNK_BYTES};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fa as c,ga as d,ha as e,ia as f,ja as g,ka as h,la as i,ma as j,na as k,oa as l,pa as m,qa as n,ra as o,sa as p,ta as q,ua as r,va as s,wa as t}from"./vm-hands-entry-lite-
|
|
2
|
+
import{fa as c,ga as d,ha as e,ia as f,ja as g,ka as h,la as i,ma as j,na as k,oa as l,pa as m,qa as n,ra as o,sa as p,ta as q,ua as r,va as s,wa as t}from"./vm-hands-entry-lite-8q8mxthp.js";import"./vm-hands-entry-lite-rw994s8q.js";import"./vm-hands-entry-lite-dyy62gt3.js";import"./vm-hands-entry-lite-wpx6sg6d.js";import"./vm-hands-entry-lite-nbtpm59m.js";import{lc as b}from"./vm-hands-entry-lite-nvhzj5b0.js";import"./vm-hands-entry-lite-gcn3rmz6.js";import"./vm-hands-entry-lite-beannz0s.js";import"./vm-hands-entry-lite-zg2xz3b1.js";import"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-7z169ekf.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-s97jy69e.js";import"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import{qi as a}from"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{g as spawnCaptured,f as sandboxProfile,e as safeEnvironment,j as runTransferCapability,i as runFileCapability,s as rebindLocalHandsControl,b as isProtectedLocalPath,t as executeLocalOperation,l as enrolledWorkspaceRootFingerprint,p as enrolledRootPaths,o as enrolledHomeContainedRootFingerprints,m as enrolledAccountRootPath,n as enrolledAccountRootFingerprint,r as deliverLocalHandsEnvironment,h as defaultLocalCommandRunner,d as confinedExecutionShell,q as capabilityInventoryForRoots,c as SHORT_REQUEST_CAPABILITIES,a as LocalCapabilityError,k as LOCAL_CAPABILITY_REGISTRY};
|
package/bin/vm-hands/{local-display-session-fcptmmhc.js → local-display-session-0ffgn43h.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ne as a,Oe as b,Pe as c,Qe as d,Re as e,Se as f,Te as g,Ue as h}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ne as a,Oe as b,Pe as c,Qe as d,Re as e,Se as f,Te as g,Ue as h}from"./vm-hands-entry-lite-7z169ekf.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-s97jy69e.js";import"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import"./vm-hands-entry-lite-6qfax5p2.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{h as runLocalDisplayStream,f as privateDirectory,c as parseDisplayStreamPayload,e as localDisplayReady,d as localDisplayAvailable,g as ensureLinuxDesktop,a as LOCAL_DISPLAY_MAX_SESSION_MS,b as LINUX_WORKER_DISPLAY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{if as a,jf as b,kf as c,lf as d,mf as e,nf as f,of as g,pf as h,qf as i,rf as j}from"./vm-hands-entry-lite-
|
|
2
|
+
import{if as a,jf as b,kf as c,lf as d,mf as e,nf as f,of as g,pf as h,qf as i,rf as j}from"./vm-hands-entry-lite-s97jy69e.js";import"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import"./vm-hands-entry-lite-tj1y61bg.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{j as runPermissionsCli,d as reasonIdentity,e as readMacPermissions,f as permissionsSummary,i as parsePermissionsArgs,c as fullDiskAccessTarget,g as formatMacPermissions,h as allowMacPermissions,a as PERMISSIONS_HELP,b as MAC_PERMISSION_IDS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{d as jq,e as Dq,f as Vq,g as kq,j as Hq,k as zq,p as Aq}from"./vm-hands-entry-lite-
|
|
2
|
+
import{d as jq,e as Dq,f as Vq,g as kq,j as Hq,k as zq,p as Aq}from"./vm-hands-entry-lite-s069zk82.js";import"./vm-hands-entry-lite-tdgbgcer.js";import{y as Fq}from"./vm-hands-entry-lite-w7gxe8ta.js";import{A as Wq,K as bq}from"./vm-hands-entry-lite-y7jx1x8p.js";import"./vm-hands-entry-lite-fs3ahdgg.js";import"./vm-hands-entry-lite-8q8mxthp.js";import"./vm-hands-entry-lite-rw994s8q.js";import"./vm-hands-entry-lite-dyy62gt3.js";import"./vm-hands-entry-lite-wpx6sg6d.js";import"./vm-hands-entry-lite-nbtpm59m.js";import"./vm-hands-entry-lite-nvhzj5b0.js";import"./vm-hands-entry-lite-gcn3rmz6.js";import"./vm-hands-entry-lite-beannz0s.js";import{Gc as Kq}from"./vm-hands-entry-lite-zg2xz3b1.js";import"./vm-hands-entry-lite-qf01e5f1.js";import"./vm-hands-entry-lite-7z169ekf.js";import"./vm-hands-entry-lite-xhjbc3e4.js";import"./vm-hands-entry-lite-s97jy69e.js";import{sf as N}from"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-c9wp99nr.js";import"./vm-hands-entry-lite-jfwz0br7.js";import{hg as Qq,mg as Bq}from"./vm-hands-entry-lite-33ttamma.js";import"./vm-hands-entry-lite-mybm2kyz.js";import{vh as z,wh as u,xh as s}from"./vm-hands-entry-lite-6qfax5p2.js";import{Kh as l}from"./vm-hands-entry-lite-5b29hq7h.js";import"./vm-hands-entry-lite-84d59wrf.js";import{ii as G}from"./vm-hands-entry-lite-k17ntg9v.js";import"./vm-hands-entry-lite-6f5eypjm.js";import"./vm-hands-entry-lite-tj1y61bg.js";import{wi as $q}from"./vm-hands-entry-lite-nd1k2jz9.js";import{createHash as aq,randomBytes as nq}from"crypto";import{readFileSync as eq,realpathSync as Pq,renameSync as q3,unlinkSync as x3,writeFileSync as J3}from"fs";import{dirname as X3,join as yq}from"path";import{spawnSync as wq}from"child_process";import{accessSync as Lq,constants as fq,existsSync as L,mkdirSync as Sq,readFileSync as hq,renameSync as Cq,writeFileSync as gq}from"fs";import{homedir as mq}from"os";import{delimiter as pq,dirname as dq,join as T}from"path";import{existsSync as vq,readFileSync as Eq}from"fs";import{join as Mq}from"path";var _q=`---
|
|
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
|
---
|
|
@@ -79,7 +79,7 @@ This computer
|
|
|
79
79
|
`),W.version)x.stdout.write(`Version: ${W.version}${W.version===N?"":` (${N} is installed; \`reason connect\` restarts it on that)`}
|
|
80
80
|
`);if(x.stdout.write(`Folder: ${W.folder}
|
|
81
81
|
`),x.stdout.write(`Sessions: ${W.sessions_running===null?"":`${W.sessions_running} running, `}${W.sessions_max===null?"every Session you start":W.sessions_max===1?"one at a time":`up to ${W.sessions_max} at once`}
|
|
82
|
-
`),A){let Z=A,H=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Oq,reasonIdentity:Tq}=await import("./permissions-
|
|
82
|
+
`),A){let Z=A,H=await(J.readPermissionsSummary??(async()=>{let{permissionsSummary:Rq,readMacPermissions:Oq,reasonIdentity:Tq}=await import("./permissions-pjfvzajr.js"),{macScreenStatus:Uq}=await import("./local-display-mac-gj72gkfb.js");return Rq(await Oq({identity:()=>Tq(),grants:Uq,worker:async()=>Z}))}))().catch(()=>null);if(H)x.stdout.write(`${H}
|
|
83
83
|
`);x.stdout.write(`Keep awake: ${A.keep_awake.enabled?"on":"off"}${A.keep_awake.holding?" (holding)":""}
|
|
84
84
|
`)}if(W.service)x.stdout.write(`Logs: ${W.service.logs}
|
|
85
85
|
`);for(let Z of W.workspaces??[]){let H=Z.state==="removed"?"removed from that workspace":Z.blocked?"offline (this computer is outside that workspace's allowed networks)":Z.device_id?Gq[Z.state]:"connecting";x.stdout.write(`Also in workspace ${Z.name??Z.organization_id}${Z.account?" (another Reason account's)":""}: ${H}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sf as a,tf as b,uf as c,vf as d}from"./vm-hands-entry-lite-
|
|
2
|
+
import{sf as a,tf as b,uf as c,vf as d}from"./vm-hands-entry-lite-d7s2d8bp.js";import"./vm-hands-entry-lite-14ff4san.js";import"./vm-hands-entry-lite-nd1k2jz9.js";export{c as compareCliVersions,d as cliAndAgentVersion,b as CLI_VERSION_PATTERN,a as CLI_VERSION};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var r={name:"github-native-engineer-device-worker-production",version:"0.2.
|
|
2
|
+
var r={name:"github-native-engineer-device-worker-production",version:"0.2.354",private:!0,type:"module",engines:{node:">=22",bun:">=1.3.0"},workspaces:["../../packages/runtime-distribution"],dependencies:{"@anthropic-ai/sandbox-runtime":"^0.0.73","@earendil-works/pi-tui":"1.0.0","@modelcontextprotocol/sdk":"^1.29.0","@reason/runtime-distribution":"workspace:*","playwright-core":"1.60.0",zod:"^4.4.3"},overrides:{"@hono/node-server":"1.19.15","@earendil-works/pi-agent-core":"1.0.0","@earendil-works/pi-ai":"1.0.0","@earendil-works/pi-coding-agent":"1.0.0","@earendil-works/chord":"1.0.0","@earendil-works/pi-codemode":"1.0.0","@earendil-works/pi-mcp":"1.0.0","@earendil-works/pi-telemetry":"1.0.0","@earendil-works/pi-tui":"1.0.0","brace-expansion":"2.1.7",axios:"1.20.0","basic-ftp":"6.2.1","@grpc/grpc-js":"1.14.5",browserslist:"4.28.8","engine.io":"6.6.7","fast-uri":"3.1.8",hono:"^4.13.7","ip-address":"10.7.1",nanoid:"3.3.18",dompurify:"3.4.13",postcss:"8.5.23",qs:"6.16.0","shell-quote":"1.11.0","socket.io-parser":"4.2.7",tmp:"0.2.7",toml:"4.2.0",undici:"8.10.2",ws:"^8.21.0","js-yaml":"4.3.2","@modelcontextprotocol/sdk":"1.31.0","proxy-addr":"2.0.8","source-map-js":"1.2.2"}};
|
|
3
3
|
export{r as wf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qi as M}from"./vm-hands-entry-lite-tj1y61bg.js";import{wi as G}from"./vm-hands-entry-lite-nd1k2jz9.js";import{readdirSync as D,readFileSync as I}from"fs";import{userInfo as A}from"os";var O="--vm-hands-op-runner-kind=person";function x(q){let Q=new Set([q]),K=[];try{K=D("/proc")}catch{}for(let z of K){if(!/^\d+$/.test(z))continue;try{let X=I(`/proc/${z}/stat`,"utf8");if(Number(X.slice(X.lastIndexOf(")")+2).split(" ")[3])===q)Q.add(Number(z))}catch{}}for(let z of Q)try{process.kill(z,"SIGKILL")}catch{}}var C=(q)=>{let Q=globalThis.Bun;if(!Q)throw new M("pty_unavailable","Reason terminals require the Bun runtime.");let K=Q.spawn({cmd:[q.shell,...q.args],cwd:q.cwd,env:{...q.environment,TERM:"xterm-256color"},terminal:{cols:q.cols,rows:q.rows,data:(J,Y)=>q.onData(Y)}}),z=K.terminal,X=()=>{x(K.pid);try{z?.close()}catch{}};if(!z)throw X(),new M("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(J)=>z.write(J),resize:(J,Y)=>z.resize(J,Y),kill:X,exited:K.exited.then((J)=>typeof J==="number"?J:null,()=>null)}};function L(){let q=(()=>{try{return A().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...q?{USER:q,LOGNAME:q}:{}}}async function P(){let[{executeLocalOperation:q,spawnCaptured:Q},{runLocalPtySession:K},{configureDesktopAccount:z},{configureWorkerSandbox:X}]=await Promise.all([import("./local-capabilities-
|
|
2
|
+
import{qi as M}from"./vm-hands-entry-lite-tj1y61bg.js";import{wi as G}from"./vm-hands-entry-lite-nd1k2jz9.js";import{readdirSync as D,readFileSync as I}from"fs";import{userInfo as A}from"os";var O="--vm-hands-op-runner-kind=person";function x(q){let Q=new Set([q]),K=[];try{K=D("/proc")}catch{}for(let z of K){if(!/^\d+$/.test(z))continue;try{let X=I(`/proc/${z}/stat`,"utf8");if(Number(X.slice(X.lastIndexOf(")")+2).split(" ")[3])===q)Q.add(Number(z))}catch{}}for(let z of Q)try{process.kill(z,"SIGKILL")}catch{}}var C=(q)=>{let Q=globalThis.Bun;if(!Q)throw new M("pty_unavailable","Reason terminals require the Bun runtime.");let K=Q.spawn({cmd:[q.shell,...q.args],cwd:q.cwd,env:{...q.environment,TERM:"xterm-256color"},terminal:{cols:q.cols,rows:q.rows,data:(J,Y)=>q.onData(Y)}}),z=K.terminal,X=()=>{x(K.pid);try{z?.close()}catch{}};if(!z)throw X(),new M("pty_unavailable","Reason could not allocate a pseudo-terminal.");return{write:(J)=>z.write(J),resize:(J,Y)=>z.resize(J,Y),kill:X,exited:K.exited.then((J)=>typeof J==="number"?J:null,()=>null)}};function L(){let q=(()=>{try{return A().username}catch{return}})();return{PATH:process.env.PATH,HOME:process.env.HOME,SHELL:process.env.SHELL,LANG:"C.UTF-8",...q?{USER:q,LOGNAME:q}:{}}}async function P(){let[{executeLocalOperation:q,spawnCaptured:Q},{runLocalPtySession:K},{configureDesktopAccount:z},{configureWorkerSandbox:X}]=await Promise.all([import("./local-capabilities-3x0b9xmk.js"),import("./local-pty-session-zen80k1k.js"),import("./desktop-account-gcysz0m3.js"),import("./worker-sandbox-yw24sxyp.js")]);X();let T=process.argv.includes(O),J=($,j,F)=>Q($,j[0]==="-lic"?["-lc",...j.slice(1)]:j,F),Y=(process.geteuid?.()??0)!==0,H=new Map,Z=($)=>{try{process.send?.($)}catch{}};process.on("message",($)=>{let j=$;if(j?.t==="cancel"){H.get(j.id)?.abort();return}if(j?.t!=="op")return;if(!Y){Z({t:"done",id:j.id,completion:{status:"failed",error_code:"vm_hands_payload_account_unavailable"}});return}let F=j.claim.capability;if(F==="pty.start"&&!T){Z({t:"done",id:j.id,completion:{status:"failed",error_code:"capability_not_granted"}});return}let U=new AbortController;H.set(j.id,U);let V=F==="pty.start"?{runPtySession:(B)=>K(B,{spawnPty:C,environment:L(),loadProxy:()=>null})}:{worker:j.worker,...F==="exec.full"?{spawnFullControl:J}:{}};q(j.state,j.claim,{...V,signal:U.signal,emit:(B)=>{let{deliverySignal:N,...W}=B;Z({t:"event",id:j.id,event:W})}}).then((B)=>Z({t:"done",id:j.id,completion:B}),(B)=>Z({t:"done",id:j.id,completion:{status:"failed",error_code:B&&typeof B==="object"&&"code"in B&&typeof B.code==="string"?B.code:"vm_hands_op_failed"}})).finally(()=>H.delete(j.id))}),process.on("disconnect",()=>process.exit(0)),await new Promise(()=>{})}
|
|
3
3
|
export{O as a,C as b,P as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze as Zq}from"./vm-hands-entry-lite-xhjbc3e4.js";import{af as Aq}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ze as Zq}from"./vm-hands-entry-lite-xhjbc3e4.js";import{af as Aq}from"./vm-hands-entry-lite-s97jy69e.js";import{Bf as H,Ef as L0,Hf as y0,If as T8,Jf as sq,Lf as $8,Of as iq,Qf as nq}from"./vm-hands-entry-lite-c9wp99nr.js";import{Zf as j0}from"./vm-hands-entry-lite-jfwz0br7.js";import{pg as U0}from"./vm-hands-entry-lite-33ttamma.js";import{Kh as d}from"./vm-hands-entry-lite-5b29hq7h.js";import{ji as W0}from"./vm-hands-entry-lite-6f5eypjm.js";import{qi as M}from"./vm-hands-entry-lite-tj1y61bg.js";import{execFile as tx,spawn as T0}from"child_process";import{randomBytes as ex}from"crypto";import{chmodSync as q1,existsSync as B0,lstatSync as x1,mkdirSync as X1,readFileSync as Q1,rmSync as P1,writeFileSync as o8}from"fs";import{connect as b1}from"net";import{join as _}from"path";var Uq="./desktop-wallpaper-0pjhgyfk.jpg";var Lq="./dock-browser-afp005mt.png";var yq="./dock-files-rywdm96b.png";var jq="./dock-terminal-s41cj1jp.png";var Tq=`# 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{Aa as _4,Ab as J2,Ba as T4,Ca as P4,Da as s6,Db as X7,Ea as n6,Fa as S4,Ga as r6,Gb as j8,Ha as f3,Hb as h4,Ia as a6,Ja as i6,Jb as W7,Ka as o6,La as t6,Ma as k4,Na as e6,Oa as $7,Va as J7,Xa as f4,Ya as b4,bb as Q7,cb as B7,mb as y4,qb as V7,rb as G7,sb as n4,tb as r4,vb as U7,xa as A4,xb as O8,yb as h0,za as L2,zb as v0}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Aa as _4,Ab as J2,Ba as T4,Ca as P4,Da as s6,Db as X7,Ea as n6,Fa as S4,Ga as r6,Gb as j8,Ha as f3,Hb as h4,Ia as a6,Ja as i6,Jb as W7,Ka as o6,La as t6,Ma as k4,Na as e6,Oa as $7,Va as J7,Xa as f4,Ya as b4,bb as Q7,cb as B7,mb as y4,qb as V7,rb as G7,sb as n4,tb as r4,vb as U7,xa as A4,xb as O8,yb as h0,za as L2,zb as v0}from"./vm-hands-entry-lite-rw994s8q.js";import{Kb as Y7,Nb as F7,Pb as N7,Qb as H7}from"./vm-hands-entry-lite-dyy62gt3.js";import{Vb as Z7}from"./vm-hands-entry-lite-wpx6sg6d.js";import{$b as o0,_b as i0,gc as z0}from"./vm-hands-entry-lite-nbtpm59m.js";import{hc as j1,ic as I1,jc as A1,kc as _1,lc as L0}from"./vm-hands-entry-lite-nvhzj5b0.js";import{mc as V1}from"./vm-hands-entry-lite-gcn3rmz6.js";import{Bc as d6,oc as V2,pc as G2,qc as l3,sc as s3,uc as c3,vc as n3,zc as r3}from"./vm-hands-entry-lite-beannz0s.js";import{Wc as Q2,Zc as z7,gd as q7}from"./vm-hands-entry-lite-zg2xz3b1.js";import{$d as h6,Ad as g8,Cd as m1,Ed as D6,Fd as M6,Gd as w6,Hd as L6,Id as O6,Jd as j6,Kd as I6,Ld as A6,Md as _6,Nd as T6,Od as P6,Pd as R6,Qd as z6,Rd as q6,Sd as E6,Td as g6,Ud as S6,Vd as k6,Wd as f6,Xd as b6,Zd as x6,_d as y6,ae as m6,be as v6,ce as p6,de as u6,hd as P1,id as R1,jd as S3,je as S8,kd as F2,ke as k8,ld as C6,le as f8,md as k3,me as b8,nd as W4,ne as x8,od as Y4,oe as y8,pd as w0,qe as h8,re as m8,se as v8,td as H0,te as p8,ue as u8,ve as d8,wd as d,we as l8,xd as h1,xe as s8,ye as c8,ze as n8}from"./vm-hands-entry-lite-qf01e5f1.js";import{Fe as Q6,Je as L5,Ke as v5,Qe as E7,Te as O5,Ue as e1}from"./vm-hands-entry-lite-7z169ekf.js";import{Ye as Z2}from"./vm-hands-entry-lite-xhjbc3e4.js";import{Af as w7,Cf as L7,Df as O7,Ff as j7,Gf as I7,xf as C7,yf as D7,zf as M7}from"./vm-hands-entry-lite-c9wp99nr.js";import{Rf as A7,Sf as _7,Tf as T7,Xf as P7,_f as R7}from"./vm-hands-entry-lite-jfwz0br7.js";import{ig as x4,pg as K7}from"./vm-hands-entry-lite-33ttamma.js";import{Hg as l6,ug as R3}from"./vm-hands-entry-lite-mybm2kyz.js";import{Kh as E1,Lh as c6,Mh as E4,Nh as g4}from"./vm-hands-entry-lite-5b29hq7h.js";import{Ph as P3,Rh as Q1,Xh as L8,Yh as D4}from"./vm-hands-entry-lite-84d59wrf.js";import{ii as V}from"./vm-hands-entry-lite-k17ntg9v.js";import{qi as C}from"./vm-hands-entry-lite-tj1y61bg.js";import{wi as W8}from"./vm-hands-entry-lite-nd1k2jz9.js";import{request as i7}from"http";import{request as o7}from"https";import{lookup as t7}from"dns/promises";import{isIP as e7}from"net";async function $9($){let J=new URL($.url);return await new Promise((Z,Q)=>{let B=(J.protocol==="https:"?o7:i7)(J,{method:"POST",headers:{...$.headers,"accept-encoding":"identity"},signal:$.signal,timeout:s3},(K)=>Z({response:K,close:()=>{K.destroy(),B.destroy(),K.socket?.destroy()}}));B.once("error",Q),B.once("timeout",()=>B.destroy(Object.assign(Error("custom_endpoint_timeout"),{code:"ETIMEDOUT"}))),B.end($.body)})}var a3=new Set(["ENOTFOUND","EAI_AGAIN","EAI_NONAME","EAI_NODATA","EAI_FAIL","DNSException"]),J9=new Set(["ECONNREFUSED","ETIMEDOUT","ECONNRESET","EHOSTUNREACH","ENETUNREACH","EHOSTDOWN","ENETDOWN","EPIPE","ECONNABORTED","EADDRNOTAVAIL","ConnectionRefused","ConnectionClosed","ConnectionTimedOut","Timeout"]);function i3($,J=0){if(!$||typeof $!=="object"||J>3)return null;let Z=$.code;if(typeof Z==="string"){if(a3.has(Z))return"custom_endpoint_host_not_found";if(J9.has(Z))return"custom_endpoint_connection_failed";if(/^(?:ERR_TLS_|ERR_SSL_|CERT_|UNABLE_TO_(?:GET|VERIFY|DECRYPT)|DEPTH_ZERO_SELF_SIGNED|SELF_SIGNED_CERT|HOSTNAME_MISMATCH|EPROTO$)/.test(Z))return"custom_endpoint_tls_failed"}for(let Q of[...$ instanceof AggregateError?$.errors:[],$.cause]){let B=i3(Q,J+1);if(B)return B}return null}async function Z9($,J){let Z=i3($),Q=new URL(J).hostname.replace(/^\[|\]$/g,"");if(Z!==null&&Z!=="custom_endpoint_connection_failed"||e7(Q)!==0)return Z;let B;return await Promise.race([t7(Q).then(()=>!0,(G)=>!a3.has(String(G?.code))),new Promise((G)=>{B=setTimeout(()=>G(!0),5000)})]).finally(()=>clearTimeout(B))?Z:"custom_endpoint_host_not_found"}function Q9($){for(let J=42;;J++){if(J===127)J=256;let Z=String.fromCodePoint(J);if(!$.includes(Z))return Z}}function B9($,J){let Z=Buffer.from($),Q=Buffer.from(J),B=new Uint32Array(Z.length);for(let G=1,U=0;G<Z.length;G++){while(U&&Z[G]!==Z[U])U=B[U-1];if(Z[G]===Z[U])U++;B[G]=U}let K=0;return(G,U=!1)=>{let W=Buffer.allocUnsafe(G.length*Q.length+K),Y=0;for(let X of G){while(K&&Z[K]!==X){let F=B[K-1];Y+=Z.copy(W,Y,0,K-F),K=F}if(Z[K]===X){if(K++,K===Z.length)Y+=Q.copy(W,Y),K=0}else W[Y++]=X}if(U)Y+=Z.copy(W,Y,0,K),K=0;return W.subarray(0,Y)}}async function o3($){$.signal.throwIfAborted();let J=n3.safeParse($.payload);if(!J.success)throw new C("custom_endpoint_invalid_request","Invalid local model request.");let Z=J.data,Q=r3.parse(await $.credential($.signal));if(!c3(Z,{baseUrl:Z.baseUrl,api:Q.api,execution:"device"}))throw new C("custom_endpoint_invalid_request","The request does not match the configured API.");$.signal.throwIfAborted();let B,K,G=0,U=0,W=0,Y=Q9(Q.apiKey),X=B9(Q.apiKey,Y),F=async(N,D)=>{$.signal.throwIfAborted(),await new Promise((L,M)=>{let I=()=>{$.signal.removeEventListener("abort",I),M($.signal.reason)};if($.signal.addEventListener("abort",I,{once:!0}),$.signal.aborted){I();return}Promise.resolve().then(()=>{return $.signal.throwIfAborted(),$.emit(N,D)}).then(()=>{$.signal.removeEventListener("abort",I),L()},(P)=>{$.signal.removeEventListener("abort",I),M(P)})})},H=async(N)=>{if(G+=N.length,G>G2)throw new C("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");for(let D=0;D<N.length;D+=V2){if(W>=l3)throw new C("custom_endpoint_response_too_large","Local model response exceeds the chunk limit.");await F(`custom_endpoint.chunk.${W++}`,{eof:!1,data:N.subarray(D,D+V2).toString("base64")})}};try{let N=await $9({url:Z.url,body:Z.body,signal:$.signal,headers:{...Z.headers,...Q.api==="anthropic-messages"?{"x-api-key":Q.apiKey}:{authorization:`Bearer ${Q.apiKey}`}}});B=N.response,K=N.close;let D=B.statusCode??500;if(D>=300&&D<400)throw new C("custom_endpoint_redirect_refused","Local model redirects are not followed.");if(B.headers["content-encoding"]&&B.headers["content-encoding"]!=="identity")throw new C("custom_endpoint_encoding_unsupported","The local server must honor identity encoding.");let L={};for(let M of["content-type","retry-after","x-request-id","request-id"]){let I=B.headers[M];if(typeof I==="string")L[M]=I.replaceAll(Q.apiKey,Y).slice(0,4096)}await F("custom_endpoint.headers",{status:D,statusText:(B.statusMessage??"").replaceAll(Q.apiKey,Y).slice(0,256),headers:L});for await(let M of B){$.signal.throwIfAborted();let I=Buffer.isBuffer(M)?M:Buffer.from(M);if(U+=I.length,U>G2)throw new C("custom_endpoint_response_too_large","Local model response exceeds the transport limit.");await H(X(I))}return await H(X(Buffer.alloc(0),!0)),await F(`custom_endpoint.chunk.${W}`,{eof:!0}),{bytes:G,chunks:W}}catch(N){if($.signal.throwIfAborted(),N instanceof C)throw N;throw new C((B?null:await Z9(N,Z.url))??"custom_endpoint_request_failed","The local model server could not complete the request.")}finally{K?.()}}import{join as t3}from"path";function K9($,J){return $===t3(J,".ara","workspace")||$===t3(J,".reason","workspace")}function e3($,J){let Z=$.filter((Q)=>K9(Q.path,J));return Z.length===1?Z[0].path:null}var V9=/^[a-f0-9]{64}$/;var U2=32,G9=/^\/[^\x00-\x1f\x7f\\]*$/;function L1($){if(typeof $!=="string"||$.length>4096||!G9.test($))return!1;if($==="/")return!0;return $.split("/").slice(1).every((J)=>J!==""&&J!=="."&&J!=="..")}function O1($){if(!$||typeof $!=="object"||Array.isArray($))return;let J=$;if(!L1(J.home)||!Array.isArray(J.roots)||J.roots.length>U2)return;let Z=[];for(let Q of J.roots){if(!Q||typeof Q!=="object"||Array.isArray(Q))return;let{path_fingerprint:B,path:K}=Q;if(typeof B!=="string"||!V9.test(B)||!L1(K))return;Z.push({path_fingerprint:B,path:K})}return{home:J.home,roots:Z}}function U9($){let J=/^Reason contributor (rc_[0-9a-f]{32})$/.exec($.name)?.[1];return $.email.toLowerCase()==="343777287+reason-contributors@users.noreply.github.com"&&J?J:void 0}function X9($){return U9($)??$.email.toLowerCase()}function X2($){let J=/^Co-authored-by:\s*([^<>\r\n]+) <([^<>\s]+)>$/i.exec($.trim());return J?X9({name:J[1],email:J[2]}):$.trim().toLowerCase()}var n0=($)=>$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[a-z]/gi,(J)=>`[${J.toLowerCase()}${J.toUpperCase()}]`),W9=[...j1.map(($)=>`/(${$.map(n0).join("/")})(/|$)`),...I1.map(($)=>`/(${$.map(n0).join("/")})(/|$)`),...[...A1].map(($)=>`/(${n0($)})$`),`/${n0(".env.")}[^/]*$`,..._1.map(($)=>`/[^/]*${n0($)}$`)],$4=`function localGithubSandboxProfile(root, temporary) {
|
|
3
3
|
return ['(version 1)','(deny default)','(import "system.sb")','(allow process-exec process-fork)',
|
|
4
4
|
'(allow file-read* (subpath "/bin") (subpath "/sbin") (subpath "/usr/bin") (subpath "/usr/sbin") (subpath "/usr/libexec") (subpath "/usr/share") (subpath "/private/var/select") (literal "/private/var/db/xcode_select_link"))',
|
|
5
5
|
'(allow file-read-metadata (path-ancestors "/opt/homebrew/bin") (path-ancestors "/usr/local/bin") (path-ancestors "/Library/Developer/CommandLineTools"))',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{wf as $}from"./vm-hands-entry-lite-
|
|
2
|
+
import{wf as $}from"./vm-hands-entry-lite-14ff4san.js";var O=$.version,Z=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function S(B,D){if(!Z.test(B)||!Z.test(D))throw Error("cannot compare invalid CLI versions");let J=(q)=>{let y=q.indexOf("-");return y===-1?[q,void 0]:[q.slice(0,y),q.slice(y+1)]},[j,F]=J(B),[w,G]=J(D),K=j.split(".").map(BigInt),M=w.split(".").map(BigInt);for(let q=0;q<3;q+=1){if(K[q]===M[q])continue;return K[q]<M[q]?-1:1}if(F===void 0||G===void 0){if(F===G)return 0;return F===void 0?1:-1}let Q=F.split("."),U=G.split("."),A=Math.max(Q.length,U.length);for(let q=0;q<A;q+=1){let y=Q[q],z=U[q];if(y===void 0||z===void 0){if(y===z)return 0;return y===void 0?-1:1}if(y===z)continue;let H=/^\d+$/.test(y),W=/^\d+$/.test(z);if(H&&W){let X=BigInt(y),Y=BigInt(z);if(X===Y)continue;return X<Y?-1:1}if(H!==W)return H?-1:1;return y<z?-1:1}return 0}function k(B,D){return D?`cli ${B} \xB7 agent ${D}`:`cli ${B}`}
|
|
3
3
|
export{O as sf,Z as tf,S as uf,k as vf};
|