@reason-machines/cli-linux-arm64-musl 0.2.340 → 0.2.342
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-46arm6n3.js +2 -0
- package/bin/vm-hands/api-credentials-xt853vej.js +2 -0
- package/bin/vm-hands/{ask-relay-4sqvsm4w.js → ask-relay-z5ykm780.js} +2 -2
- package/bin/vm-hands/connect-cli-w1wdrkp0.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-zhkesj7w.js → custom-endpoint-device-z6d216tn.js} +1 -1
- package/bin/vm-hands/desktop-account-ndf87vz8.js +2 -0
- package/bin/vm-hands/{device-workspace-kmdera1y.js → device-workspace-w5m2krzy.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-gffxw6cf.js → hands-worker-source-tv5dj6wm.js} +1 -1
- package/bin/vm-hands/{index-n922jg9n.js → index-ab0khksc.js} +1 -1
- package/bin/vm-hands/local-automation-we5k29ph.js +2 -0
- package/bin/vm-hands/local-capabilities-wnhek3h0.js +2 -0
- package/bin/vm-hands/local-desktop-users-qs13y705.js +2 -0
- package/bin/vm-hands/local-display-mac-nm4a2m36.js +2 -0
- package/bin/vm-hands/local-display-session-6fev7evp.js +2 -0
- package/bin/vm-hands/local-pty-session-fakj59cv.js +2 -0
- package/bin/vm-hands/network-contract-6fvpv5h6.js +2 -0
- package/bin/vm-hands/package-vyhgakbw.js +2 -0
- package/bin/vm-hands/permissions-rp0ndr13.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-08mbrn5k.js → reason-hands-protocol-4qavazs4.js} +1 -1
- package/bin/vm-hands/{status-1z27ngw6.js → status-k5f7hxcs.js} +6 -6
- package/bin/vm-hands/version-tny61mj7.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-samn6qm5.js → vm-hands-entry-lite-0r5vmp7p.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-24kpdwd0.js → vm-hands-entry-lite-1rn52w4j.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-z9jkcg00.js → vm-hands-entry-lite-2r9pdqzf.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-0nb9zkz1.js → vm-hands-entry-lite-5b29hq7h.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-png3h0cm.js → vm-hands-entry-lite-6qfax5p2.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-z59ar4qz.js → vm-hands-entry-lite-7djq90d1.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ytmcecfr.js → vm-hands-entry-lite-84d59wrf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-4b8ypyym.js → vm-hands-entry-lite-84t0sxks.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-pqama7tv.js → vm-hands-entry-lite-8tf0kw71.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-rhpmp59p.js → vm-hands-entry-lite-967c5n18.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-y4nntb2w.js → vm-hands-entry-lite-9k93fyhy.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-dnx92ytp.js → vm-hands-entry-lite-9p8gxetg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-723q0mmr.js → vm-hands-entry-lite-ammwy4z8.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-w2yb86jm.js → vm-hands-entry-lite-crh2cy1q.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-pqfp5nk3.js → vm-hands-entry-lite-e26ht37z.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-6cj7s7rc.js → vm-hands-entry-lite-f5m8cde2.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-xs3zrvh4.js → vm-hands-entry-lite-ffa7xfss.js} +30 -30
- package/bin/vm-hands/{vm-hands-entry-lite-70vrdkp5.js → vm-hands-entry-lite-g0jhbxz4.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hh0002ye.js → vm-hands-entry-lite-g3axe41b.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-tn74fzs8.js → vm-hands-entry-lite-h1dtacsm.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-nmer42xs.js → vm-hands-entry-lite-hbqq9f9a.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-knj1659k.js → vm-hands-entry-lite-hdmwe5bp.js} +80 -80
- package/bin/vm-hands/{vm-hands-entry-lite-9n6m4qgf.js → vm-hands-entry-lite-hz2ww2qe.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-t2q10vjr.js → vm-hands-entry-lite-k6e9bt1m.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-bbezym6j.js → vm-hands-entry-lite-mybm2kyz.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-k9sm5kaf.js → vm-hands-entry-lite-n76c16jk.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-saxkssgm.js → vm-hands-entry-lite-ngpcdqxk.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-d3s6xt2v.js → vm-hands-entry-lite-tbrwer33.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-kf5eeggb.js → vm-hands-entry-lite-v674xqzd.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-d17bx1yc.js → vm-hands-entry-lite-x6tft70v.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-cag8nazq.js → vm-hands-entry-lite-xr02bw8t.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-x0evgr52.js → vm-hands-executor-4g0e4grj.js} +1 -1
- package/bin/vm-hands/vm-hands-op-runner-9yh3qjrw.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-ed5v1v3x.js → vm-hands-runtime-5t6s4k63.js} +3 -3
- package/bin/vm-hands/worker-sandbox-w5jq1qzm.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-cb63vj4j.js +0 -2
- package/bin/vm-hands/api-credentials-r3gava82.js +0 -2
- package/bin/vm-hands/connect-cli-n73y6yss.js +0 -2
- package/bin/vm-hands/desktop-account-a0tc6tgz.js +0 -2
- package/bin/vm-hands/local-automation-g46nrrje.js +0 -2
- package/bin/vm-hands/local-capabilities-dp99ggby.js +0 -2
- package/bin/vm-hands/local-desktop-users-xwcgrstv.js +0 -2
- package/bin/vm-hands/local-display-mac-6hn25df7.js +0 -2
- package/bin/vm-hands/local-display-session-sc34t5xx.js +0 -2
- package/bin/vm-hands/local-pty-session-2r99e4z9.js +0 -2
- package/bin/vm-hands/network-contract-cg7j1pz9.js +0 -2
- package/bin/vm-hands/package-65d4a80w.js +0 -2
- package/bin/vm-hands/permissions-g00kvtjx.js +0 -2
- package/bin/vm-hands/version-mr1ama42.js +0 -2
- package/bin/vm-hands/vm-hands-op-runner-jtrdv8x2.js +0 -2
- package/bin/vm-hands/worker-sandbox-g70ryvcd.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var r={name:"github-native-engineer-device-worker-production",version:"0.2.
|
|
3
|
-
export{r as
|
|
2
|
+
var r={name:"github-native-engineer-device-worker-production",version:"0.2.342",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
|
+
export{r as yf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{O as
|
|
2
|
+
import{yf as $}from"./vm-hands-entry-lite-1rn52w4j.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
|
+
export{O as uf,Z as vf,S as wf,k as xf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{Q as
|
|
2
|
+
import{Th as X,Vh as Y,Xh as Z}from"./vm-hands-entry-lite-84d59wrf.js";import{execFileSync as z}from"child_process";import{existsSync as V,realpathSync as M}from"fs";import{userInfo as D}from"os";import{isAbsolute as $,join as C,normalize as F,parse as K}from"path";function Q(){let q=F(D().homedir);if(!$(q)||q===K(q).root)throw Error("Could not resolve the canonical macOS user home.");return q}function O(q,B,J=Q()){let L=Z(B);if(B.kind==="managed"&&B.base){let G=M(J);return{anchor:G,boundary:C(G,B.base),path:C(G,L)}}if(B.kind==="root"&&Y(B.path)){let G=M(J);return{anchor:G,boundary:C(G,X),path:C(G,L)}}return{anchor:q,boundary:q,path:C(q,L)}}function _(q=Q()){return C(q,".config")}function b(){if(process.platform!=="darwin")return null;try{let q=z("/usr/bin/getconf",["DARWIN_USER_DIR"],{encoding:"utf8",timeout:5000}).trim();return $(q)?M(q):null}catch{return null}}function g(q=Q()){let B=C(q,"Library","Application Support","Ara"),J=C(q,"Library","Application Support","Reason");return V(B)&&!V(J)?B:J}
|
|
3
|
+
export{Q as Kh,O as Lh,_ as Mh,b as Nh,g as Oh};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j={REASON_API_KEY:"ARA_API_KEY",REASON_API_URL:"ARA_API_URL",REASON_CLI_CHANNEL:"ARA_CLI_CHANNEL",REASON_CLI_LAUNCHER_PATH:"ARA_CLI_LAUNCHER_PATH",REASON_MANAGED_RUNTIME_ROOT:"ARA_MANAGED_RUNTIME_ROOT",REASON_INSTALL_ALIAS_PATH:"ARA_INSTALL_ALIAS_PATH",REASON_INSTALL_DIR:"ARA_INSTALL_DIR",REASON_INSTALL_METHOD:"ARA_INSTALL_METHOD",REASON_INSTALL_PINNED_VERSION:"ARA_INSTALL_PINNED_VERSION",REASON_INSTALL_UPGRADE:"ARA_INSTALL_UPGRADE"},mJ=Object.values(j),UJ=new Set;function m(J,Q){let V=J[Q];if(V?.trim())return V;let Z=J[j[Q]];if(Z?.trim())UJ.add(j[Q]);return Z}function DJ(J,Q){return{[J]:Q,[j[J]]:Q}}import{basename as PJ}from"path";var x=["production","staging"],GJ="https://api.reasonmachines.com",HJ="https://staging-api.reasonmachines.com";var f={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},RJ=new Set(["ara-staging","reason-staging"]);function lJ(J={}){let Q=m(J.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(Q){if(x.includes(Q))return Q;throw Error(`Unknown Reason CLI channel: ${Q}`)}let V=PJ(J.executablePath??process.execPath).toLowerCase();return RJ.has(V)?"staging":"production"}function I(J){return J==="staging"?HJ:GJ}function iJ(J){return`${I(J)}/mcp/ara`}var s={production:["https://api.ara.so",f.production.api],staging:["https://api-staging.ara.so",f.staging.api]};function y(J){let Q;try{Q=new URL(J).origin}catch{return J}let V=x.find((Z)=>s[Z].includes(Q));return V?I(V):Q}function rJ(J,Q){return J===Q||y(J)===y(Q)}function oJ(J,Q){return x.some((V)=>s[V].includes(J)&&Q===I(V))}function aJ(J,Q){try{let V=new URL(Q);return!V.username&&!V.password&&(V.origin===I(J)||V.origin===f[J].api)}catch{return!1}}function tJ(J){try{let Q=new URL(J).hostname.replace(/^\[|\]$/g,"").toLowerCase();return Q==="localhost"||Q==="127.0.0.1"||Q==="::1"}catch{return!1}}import{randomBytes as VJ}from"crypto";import{chmodSync as ZJ,closeSync as a,constants as FJ,linkSync as $J,lstatSync as A,mkdirSync as XJ,openSync as CJ,readdirSync as H,readFileSync as t,readlinkSync as E,renameSync as _,rmdirSync as KJ,symlinkSync as k,unlinkSync as U}from"fs";import{createRequire as OJ}from"module";import{constants as bJ}from"os";import{basename as O,join as K,sep as jJ}from"path";import{existsSync as N,lstatSync as l,readdirSync as EJ,readFileSync as TJ,readlinkSync as kJ,realpathSync as _J}from"fs";import{join as L,sep as AJ}from"path";function i(J,...Q){let V=L(J,"ara"),Z=L(J,"reason");if(!r(V))return L(Z,...Q);if(!N(Z))return L(V,...Q);return N(L(V,...Q))&&!N(L(Z,...Q))?L(V,...Q):L(Z,...Q)}function r(J){try{let Q=l(J);if(!Q.isSymbolicLink())return Q.isDirectory();return kJ(J)!=="reason"&&N(J)}catch{return!1}}function o(J,Q=[]){if(!r(J))return!1;let V;try{V=[J,...EJ(J,{withFileTypes:!0}).filter((Z)=>Z.isDirectory()).map((Z)=>L(J,Z.name))]}catch{return!1}return V.some((Z)=>["connect","connect-once"].filter(($)=>!Q.includes(L(Z,$))).some(($)=>{let z=L(Z,$,"worker.json");try{l(z)}catch{return!1}try{let q=JSON.parse(TJ(z,"utf8"))?.stateDirectory;if(typeof q!=="string")return!0;let M=(X,B)=>X===B||X.startsWith(B+AJ);return M(q,J)||M(c(q),c(J))}catch{return!0}}))}function c(J){try{return _J(J)}catch{return J}}var v=new Set(["credentials.json","local-device.json","local-device.revoked.json","local-device.auth-migration.json","local-device.json.registration-pending.json","local-daemon.json","local-daemon.json.workspaces.json","local-root-fingerprint-key.json","instances","workspaces"]),g=new Set(["local-device.proxy.json"]),IJ=new Set(["local-device.key","local-device.binding"]),n=new Map;function NJ(J,Q,V){let Z=K(J,"ara");if(/[/\\]\.reason-ssh[/\\][^/\\]+[/\\]installer-home[/\\]\.config$/.test(J))return{state:W(Z)?.isDirectory()?"kept":"absent"};return qJ(Z,K(J,"reason"),{linkAlways:!0,kept:($)=>o($,V??[]),native:Q===void 0?LJ:()=>Q},V!==void 0)}function YQ(J,...Q){return NJ(J),i(J,...Q)}function wQ(J,Q=process.platform){let V=K(J,"Library","Logs");if(Q==="darwin")for(let Z of[""," Staging"," Development"])qJ(K(V,`Ara${Z}`),K(V,`Reason${Z}`),{linkAlways:!1,kept:()=>!1,native:LJ});return K(V,"Reason")}var zJ="config_rename_unavailable:busy";function qJ(J,Q,V,Z=!1){let $=Z?void 0:n.get(J);if($)return $;let z;try{z=SJ(J,Q,V)}catch(q){let M=`config_rename_unavailable:${G(q)??"failed"}`;try{return{state:W(J)?.isDirectory()?"kept":"absent",problem:M}}catch{return{state:"kept",problem:M}}}if(!(z.state==="absent"&&V.linkAlways)&&z.problem!==zJ&&!(z.state==="kept"&&!z.problem))n.set(J,z);return z}function SJ(J,Q,V){vJ(Q,V.native);let Z=!1;for(let $=0;$<8;$+=1){let z=W(J);if(z?.isSymbolicLink())return E(J)===O(Q)?{state:Z?"renamed":"linked"}:{state:"kept"};if(!z){if(u(Q))Y(()=>U(Q),"ENOENT");if(!(Z||V.linkAlways)||!T(Q))return{state:"absent"};let X=C(Q,"link");k(O(Q),X);try{Y(()=>_(X,J),"EISDIR","ENOTEMPTY","EEXIST","ENOTDIR")}finally{Y(()=>U(X),"ENOENT")}continue}if(!z.isDirectory())return{state:"absent"};if(V.kept(J))return e(Q),{state:"kept"};let q=V.native();if(!q)return e(Q),{state:"kept",problem:"config_rename_unavailable:no_native"};let M=fJ(q,J);if(!M)return{state:"kept",problem:zJ};try{if(A(J).isSymbolicLink())continue;let X=uJ(q,J,Q);if(X)return{state:"kept",problem:X};Z=!0}finally{M()}}throw Object.assign(Error("legacy directory rename did not settle"),{code:"unsettled"})}function uJ(J,Q,V){let Z=W(V);if(!Z||u(V)){if(!Z)k(O(V),V);try{J.exchange(Q,V)}catch(X){if(u(V))Y(()=>U(V),"ENOENT");return`config_rename_unavailable:${G(X)??"exchange_failed"}`}return null}if(!Z.isDirectory())return"config_rename_unavailable:ENOTDIR";if(Z.dev!==A(Q).dev)return"config_rename_unavailable:EXDEV";let $=[C(V,"probe"),C(V,"probe")];try{k("a",$[0]),k("b",$[1]),J.exchange($[0],$[1])}catch(X){return`config_rename_unavailable:${G(X)??"exchange_failed"}`}finally{for(let X of $)Y(()=>U(X),"ENOENT")}let z=wJ(V);for(let X of IJ){let B=W(K(V,X)),w=W(K(Q,X));if(B&&w&&B.ino!==w.ino)XJ(`${z}-replaced`,{mode:448,recursive:!0}),_(K(V,X),K(`${z}-replaced`,X))}let q={linked:new Map,unitsKept:new Set};MJ(Q,V,"",q);let M=C(V,"rename");k(O(V),M);try{J.exchange(Q,M)}catch(X){return Y(()=>U(M),"ENOENT"),`config_rename_unavailable:${G(X)??"exchange_failed"}`}return BJ(M,V,q,z),null}function h(J){return J===""||!J.includes(jJ)}function MJ(J,Q,V,Z){let $=h(V)&&S(K(Q,V),K(J,V));if($)Z.unitsKept.add(V);for(let z of H(K(J,V))){if($&&(v.has(z)||g.has(z)))continue;let q=K(V,z),M=K(J,q),X=K(Q,q),B=W(M);if(!B)continue;let w=W(X);if(B.isDirectory()){if(!w)Y(()=>XJ(X,{mode:B.mode&4095}),"EEXIST"),ZJ(X,B.mode&4095);if(T(X))MJ(J,Q,q,Z)}else if(!w){if(B.isSymbolicLink())Y(()=>k(E(M),X),"EEXIST");else if(Y(()=>$J(M,X),"EEXIST","ENOENT"))Z.linked.set(q,B.ino)}}}function vJ(J,Q){let V;try{if(!T(J))return;V=H(J)}catch{return}for(let Z of V){let $=/^\.(rename|link|probe|claim)-(\d+)-[0-9a-f]+$/.exec(Z);if(!$)continue;let z=K(J,Z),q=W(z);if(!q)continue;if(!q.isDirectory()){if(!JJ(Number($[2])))Y(()=>U(z),"ENOENT");continue}let M=Q(),X=null;if(M){try{X=M.lock(z)}catch{continue}if(!X)continue}else if(JJ(Number($[2])))continue;try{let B=C(J,"claim");if(Y(()=>_(z,B),"ENOENT"))BJ(B,J,null,wJ(J))}finally{X?.()}}}function BJ(J,Q,V,Z){for(let[$,z]of V?.linked??[])if(!W(K(J,$))&&W(K(Q,$))?.ino===z)Y(()=>U(K(Q,$)),"ENOENT");if(WJ(J,Q,"",V),Y(()=>KJ(J),"ENOTEMPTY","EEXIST"))return;_(J,Z),ZJ(Z,448)}function WJ(J,Q,V,Z){let $=h(V)&&(Z?Z.unitsKept.has(V):S(K(Q,V),K(J,V)));for(let z of H(K(J,V))){let q=K(V,z),M=K(J,q),X=K(Q,q),B=A(M),w=W(X);if(w&&B.ino===w.ino&&B.dev===w.dev){U(M);continue}if(B.isFile()&&w?.isFile()&&Z?.linked.get(q)===w.ino){_(M,X);continue}if($&&(v.has(z)||g.has(z)))continue;if(!w){if(B.isFile()){if(Y(()=>$J(M,X),"EEXIST"))U(M)}else Y(()=>_(M,X),"EEXIST","ENOTEMPTY");continue}if(B.isDirectory()&&w.isDirectory())WJ(J,Q,q,Z),Y(()=>KJ(M),"ENOTEMPTY","EEXIST")}}function LQ(J){let Q=K(J,"ara"),V=K(J,"reason");if(!T(Q)||!T(V))return null;let Z=["",...H(Q,{withFileTypes:!0}).filter(($)=>$.isDirectory()&&!$.name.startsWith(".")).map(($)=>$.name)];for(let $ of Z){let z=K(Q,$),q=K(V,$);if(!S(z,q)||!S(q,z))continue;if([...v,...g].some((X)=>d(K(z,X),K(q,X))===!1))return $}return null}function UQ(J){let Q=K(J,"ara"),V=K(J,"reason");if(!T(Q)||!T(V))return null;let Z=($)=>{for(let z of H(K(Q,$))){let q=K($,z);if(h($)&&(z==="connect"||z==="connect-once"))continue;let M=A(K(Q,q)),X=W(K(V,q));if(!X||M.ino===X.ino&&M.dev===X.dev)continue;if(M.isDirectory()&&X.isDirectory()&&!X.isSymbolicLink()){let B=Z(q);if(B!==null)return B}else if(M.isSymbolicLink()||X.isSymbolicLink()){if(!(M.isSymbolicLink()&&X.isSymbolicLink()&&E(K(Q,q))===E(K(V,q))))return q}else if(d(K(Q,q),K(V,q))!==!0)return q}return null};return Z("")}function d(J,Q){let V=W(J),Z=W(Q);if(!V&&!Z)return null;if(!V||!Z||V.isDirectory()!==Z.isDirectory())return!1;if(V.ino===Z.ino&&V.dev===Z.dev)return!0;if(V.isDirectory())return[...new Set([...H(J),...H(Q)])].every((z)=>d(K(J,z),K(Q,z))===!0);try{return t(J).equals(t(Q))}catch{return!1}}function S(J,Q){for(let V of v)if(YJ(K(J,V),K(Q,V)))return!0;return!1}function YJ(J,Q){let V=W(J);if(!V)return!1;let Z=W(Q);if(!Z)return!0;if(V.isDirectory()){if(!Z.isDirectory())return!0;return H(J).some(($)=>YJ(K(J,$),K(Q,$)))}if(V.isSymbolicLink())return!Z.isSymbolicLink()||E(J)!==E(Q);return V.ino!==Z.ino||V.dev!==Z.dev}function e(J){if(u(J))Y(()=>U(J),"ENOENT")}function wJ(J){return K(J,`.pre-rename-${new Date().toISOString().replace(/[:.]/g,"-")}-${VJ(3).toString("hex")}`)}function u(J){try{return A(J).isSymbolicLink()&&E(J)===O(J)}catch{return!1}}function T(J){let Q=W(J);return Q!==null&&Q.isDirectory()}function fJ(J,Q){for(let V=0;V<40;V+=1){let Z=J.lock(Q);if(Z)return Z;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,50)}return null}function C(J,Q){return K(J,`.${Q}-${process.pid}-${VJ(6).toString("hex")}`)}function JJ(J){if(J===process.pid)return!1;try{return process.kill(J,0),!0}catch(Q){return G(Q)==="EPERM"}}function W(J){try{return A(J)}catch(Q){if(G(Q)==="ENOENT"||G(Q)==="ENOTDIR")return null;throw Q}}function Y(J,...Q){try{return J(),!0}catch(V){if(Q.includes(G(V)??""))return!1;throw V}}function G(J){return J instanceof Error&&"code"in J&&typeof J.code==="string"?J.code:void 0}var F,xJ=2,gJ=4,hJ=2,dJ=2,QJ=-100;function LJ(){if(F!==void 0)return F;if(F=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let J;try{J=OJ(import.meta.url)("bun:ffi")}catch{return null}let Q=process.platform==="darwin",V=Q?"__error":"__errno_location",Z=Q?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`],{FFIType:$}=J;for(let z of Z)try{let q=Q?"renamex_np":"renameat2",X=J.dlopen(z,{flock:{args:[$.i32,$.i32],returns:$.i32},[V]:{args:[],returns:$.ptr},[q]:Q?{args:[$.ptr,$.ptr,$.u32],returns:$.i32}:{args:[$.i32,$.ptr,$.i32,$.ptr,$.u32],returns:$.i32}}).symbols,B=X[V]();if(B===null)continue;let w=(R)=>{let P=J.read.i32(B),D=Object.entries(bJ.errno).find(([,b])=>b===P)?.[0]??`errno_${P}`;return Object.assign(Error(`${R} failed: ${D}`),{code:D})},p=(R)=>Buffer.from(`${R}\x00`,"utf8");return F={exchange(R,P){let D=p(R),b=p(P);if((Q?X[q](J.ptr(D),J.ptr(b),hJ):X[q](QJ,J.ptr(D),QJ,J.ptr(b),dJ))!==0)throw w("exchange")},lock(R){let P=CJ(R,FJ.O_RDONLY);if(X.flock(P,xJ|gJ)===0)return()=>a(P);let D=w("lock");if(a(P),D.code==="EWOULDBLOCK"||D.code==="EAGAIN")return null;throw D}},F}catch{}return null}
|
|
3
|
-
export{m as
|
|
3
|
+
export{m as sh,DJ as th,x as uh,lJ as vh,I as wh,iJ as xh,y as yh,rJ as zh,oJ as Ah,aJ as Bh,tJ as Ch,r as Dh,NJ as Eh,YQ as Fh,wQ as Gh,LQ as Hh,UQ as Ih,LJ as Jh};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Kh as J}from"./vm-hands-entry-lite-5b29hq7h.js";import{readFileSync as L}from"fs";import{isAbsolute as M,normalize as Q}from"path";var W="REASON_WORKER_DESKTOP_USER",G=null;function X(q,B){for(let I of B.split(`
|
|
3
3
|
`)){let j=I.split(":");if(j.length<7||Number(j[2])!==q||!/^\d+$/.test(j[2])||!/^\d+$/.test(j[3]))continue;let x=j[5];if(!/^[a-z_][a-z0-9_-]*$/i.test(j[0])||!M(x)||Q(x)!==x||x==="/")return null;return{username:j[0],uid:q,gid:Number(j[3]),home:x}}return null}function b(q={}){let B="value"in q?q.value:process.env[W];if(G=null,B===void 0||B==="")return null;let I=q.platform??process.platform,j="euid"in q?q.euid:process.geteuid?.(),x=/^[1-9]\d{0,9}$/.test(B)?Number(B):NaN,C=I==="linux"&&j===0&&Number.isSafeInteger(x)?X(x,(q.passwd??(()=>L("/etc/passwd","utf8")))()):null;if(!C||C.gid===0)throw Error("worker_desktop_user_invalid");return G=C,C}function k(){return G}function y(){return G?.home??J()}
|
|
4
|
-
export{W as
|
|
4
|
+
export{W as Xe,X as Ye,b as Ze,k as _e,y as $e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var U=".reason/workspace",T="workspace_base",y="sessions",W="workspace_layout",g=".reason/workspace/sessions",B=/^[0-9a-f]{8}$/;function C(j){if(!J(j))return!1;let q=".reason/workspace/sessions/";if(!j.startsWith(q))return!1;let z=j.slice(q.length).split("/");return z.length===2&&B.test(z[0])}var G=4096,X="workspaces/pi";function J(j){if(typeof j!=="string"||!j||j.length>G)return!1;if(j.startsWith("/")||j.includes("\x00")||j.includes("\\"))return!1;return j.split("/").every((q)=>q!==""&&q!=="."&&q!=="..")}function Z(j){if(j.kind==="root"){if(j.path===void 0)return".";if(!J(j.path))throw Error("invalid_device_workspace_identity");return j.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(j.workspaceId)||j.workspaceId==="."||j.workspaceId==="..")throw Error("invalid_device_workspace_identity");let q=j.layout==="sessions"?"sessions":X;return`${j.base?`${j.base}/`:""}${q}/${j.workspaceId}/repo`}function L(j){if(!j||typeof j!=="object"||Array.isArray(j))return null;let q=j;if(q.kind==="root"&&Object.keys(q).length===1)return{kind:"root"};if(q.kind==="root"&&Object.keys(q).length===2&&J(q.path))return{kind:"root",path:q.path};if(q.kind!=="managed"||typeof q.workspaceId!=="string"||Object.keys(q).length!==2+(q.base===void 0?0:1)+(q.layout===void 0?0:1)||q.base!==void 0&&q.base!==".reason/workspace"||q.layout!==void 0&&q.layout!=="sessions")return null;let z={kind:"managed",workspaceId:q.workspaceId,...q.base===".reason/workspace"?{base:".reason/workspace"}:{},...q.layout==="sessions"?{layout:"sessions"}:{}};try{return Z(z),z}catch{return null}}var b="/home/runner",P=10001,x="/run/reason/sessions",f=/^(?:\/[A-Za-z0-9._-]+)+$/,M=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,H=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function K(j){return M.exec(j)?.[1]??H.exec(j)?.[1]??j}var $=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/,A="*/.reason/workspace/workspaces/pi/*|*/.reason/workspace/sessions/*";function N(j,q=b,z="sessions"){if(!f.test(q)||q.split("/").some((V)=>V==="."||V===".."))throw Error("invalid_cloud_payload_home");let Q=`${q}/${Z({kind:"managed",workspaceId:j,base:".reason/workspace",...z?{layout:z}:{}})}`,F=`${x}/${K(j)}`;return{home:q,root:Q.slice(0,-5),checkout:Q,control:F,jobEnv:`${F}/job.env`,cloudAccess:`${F}/cloud-access`,logs:`${F}/logs`,pin:`${F}/ws`}}function Y(j){return $.exec(j.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function D(j){return{kind:"managed",workspaceId:j,layout:"sessions"}}function R(j){let q=$.exec(j.replace(/\/+$/,""));if(!q)return null;try{let z=N(q[3],q[1],Y(j));return z.root===j.replace(/\/+$/,"")?z:null}catch{return null}}
|
|
3
|
-
export{U as
|
|
3
|
+
export{U as Ph,T as Qh,y as Rh,W as Sh,g as Th,B as Uh,C as Vh,J as Wh,Z as Xh,L as Yh,b as Zh,P as _h,x as $h,M as ai,H as bi,$ as ci,A as di,N as ei,Y as fi,D as gi,R as hi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{C as T,E as U}from"./vm-hands-entry-lite-
|
|
2
|
+
import{C as T,E as U}from"./vm-hands-entry-lite-n76c16jk.js";import{pc as V}from"./vm-hands-entry-lite-ffgjezmx.js";import{sh as G,vh as M,wh as Q}from"./vm-hands-entry-lite-6qfax5p2.js";function W(j,B){let k=G(j,"REASON_API_URL")?.trim();if(!k)return Q(B);let z=new URL(k);if(z.protocol!=="https:"&&!(z.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(z.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return z.origin}function X(j){return G(j,"REASON_API_URL")?.trim()?W(j,"production"):void 0}function $(j){return G(j,"REASON_API_KEY")?.trim()||void 0}async function N(j,B){let k=j.env??process.env,z=$(k);if(!z)return(j.getCredentials??T)({apiOrigin:X(k),signal:B});let J=W(k,j.channel??M({env:k})),D=await(j.fetchImpl??fetch)(J+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+z,accept:"application/json"},signal:B}),L=await D.json().catch(()=>({})),w=V(L)?L:{};if(!D.ok){let H=typeof w.detail==="string"?w.detail:typeof w.message==="string"?w.message:"API key authentication failed ("+D.status+")";throw new U(D.status,typeof w.error==="string"?w.error:"api_key_auth_failed",H)}if(typeof w.org_id!=="string"||!w.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let Z=Array.isArray(w.scopes)?w.scopes.filter((H)=>typeof H==="string"):[];return{credentialKind:"api_key",apiOrigin:J,accessToken:z,orgId:w.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:Z}}async function P(j){let B=await N(j),k=X(j.env??process.env);if(!B)throw Error(k?`Not signed in to ${k}. Set REASON_API_KEY, or run \`reason login --api-url ${k}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return B}
|
|
3
3
|
export{W as u,X as v,$ as w,N as x,P as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lb as j,Mb as q}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Lb as j,Mb as q}from"./vm-hands-entry-lite-k6e9bt1m.js";function y(v=process.platform){if(j(),v==="linux")q("strict")}
|
|
3
3
|
export{y as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{si as e}from"./vm-hands-entry-lite-hz2ww2qe.js";var i=e((o,t)=>{t.exports={name:"playwright-core",version:"1.60.0",description:"A high-level API to automate web browsers",repository:{type:"git",url:"git+https://github.com/microsoft/playwright.git"},homepage:"https://playwright.dev",engines:{node:">=18"},author:{name:"Microsoft Corporation"},license:"Apache-2.0",exports:{".":{types:"./index.d.ts",import:"./index.mjs",require:"./index.js",default:"./index.js"},"./package.json":"./package.json","./lib/bootstrap":"./lib/bootstrap.js","./lib/coreBundle":"./lib/coreBundle.js","./lib/utilsBundle":"./lib/utilsBundle.js","./lib/tools/cli-client/program":"./lib/tools/cli-client/program.js"},bin:{"playwright-core":"cli.js"},types:"types/types.d.ts"}});
|
|
3
3
|
export{i as P};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{pi as l}from"./vm-hands-entry-lite-9k93fyhy.js";import{execFile as zj,spawn as I}from"child_process";var Cj="h264_ws_v1",kj="video",h=["smooth","sharp","data_saver","balanced"];var Yj="video_presets";var V=8388608,Y=65536,Lj="control",Aj="v1",d=200;function s(q){if(!q||typeof q!=="object"||Array.isArray(q))return null;let j=q,J=(Q)=>typeof Q==="string"&&Q.length>0&&Q.length<=d;if(Object.keys(j).length!==2||!J(j.user_id)||!J(j.name))return null;return{user_id:j.user_id,name:j.name}}var xj="windows",Mj="v1",A=200,o=(q)=>typeof q==="string"&&h.includes(q);function fj(q){if(!q||typeof q!=="object"||Array.isArray(q))return null;let j=q;if(Object.keys(j).length!==2||j.format!=="h264_ws_v1"||!o(j.preset))return null;return{format:"h264_ws_v1",preset:j.preset}}var $={hello:1,frame:2,stats:3,pong:4,serverClipboard:5,error:6,audioHello:7,audio:8,control:9,windows:10,pointer:16,key:17,config:18,ping:19,clientClipboard:20,keyframeRequest:21,ack:22,audioEnable:23};class U extends Error{constructor(q){super(q);this.name="DisplayVideoProtocolError"}}var e=new TextEncoder,jj=new TextDecoder("utf-8",{fatal:!0});function H(q,j){if(j.byteLength+1>V)throw new U("message_too_large");let J=new Uint8Array(5+j.byteLength),Q=new DataView(J.buffer);return Q.setUint32(0,j.byteLength+1),Q.setUint8(4,q),J.set(j,5),J}function R(q){let j=e.encode(q);if(j.byteLength>Y)throw new U("text_too_large");return j}function f(q,j){if(!Number.isInteger(q)||q<0||q>65535)throw new U(`invalid_${j}`);return q}function qj(q){if(!Number.isFinite(q))throw new U("invalid_window");return Math.max(-2147483648,Math.min(2147483647,Math.round(q)))}function hj(q){switch(q.type){case"hello":{let j=R(q.codec),J=new Uint8Array(6+j.byteLength),Q=new DataView(J.buffer);return Q.setUint16(0,f(q.width,"width")),Q.setUint16(2,f(q.height,"height")),Q.setUint8(4,Math.max(1,Math.min(240,Math.round(q.fps)))),Q.setUint8(5,h.indexOf(q.preset)),J.set(j,6),H($.hello,J)}case"frame":{let j=new Uint8Array(13+q.data.byteLength),J=new DataView(j.buffer);return J.setUint8(0,q.key?1:0),J.setUint32(1,q.seq>>>0),J.setBigUint64(5,BigInt(Math.max(0,Math.floor(q.captureMicros)))),j.set(q.data,13),H($.frame,j)}case"stats":return H($.stats,R(JSON.stringify(q.stats)));case"pong":case"ping":{let j=new Uint8Array(8);return new DataView(j.buffer).setFloat64(0,q.token),H(q.type==="ping"?$.ping:$.pong,j)}case"serverClipboard":return H($.serverClipboard,R(q.text));case"clientClipboard":return H($.clientClipboard,R(q.text));case"error":return H($.error,R(q.code));case"pointer":{let j=new Uint8Array(5),J=new DataView(j.buffer);return J.setUint16(0,f(q.x,"x")),J.setUint16(2,f(q.y,"y")),J.setUint8(4,q.buttons&255),H($.pointer,j)}case"key":{let j=new Uint8Array(5),J=new DataView(j.buffer);return J.setUint8(0,q.down?1:0),J.setUint32(1,q.keysym>>>0),H($.key,j)}case"config":return H($.config,Uint8Array.of(h.indexOf(q.preset)));case"keyframeRequest":return H($.keyframeRequest,new Uint8Array(0));case"audioHello":{let j=R(q.codec),J=new Uint8Array(5+j.byteLength),Q=new DataView(J.buffer);return Q.setUint32(0,q.sampleRate>>>0),Q.setUint8(4,q.channels&255),J.set(j,5),H($.audioHello,J)}case"audio":{let j=new Uint8Array(8+q.data.byteLength);return new DataView(j.buffer).setBigUint64(0,BigInt(Math.max(0,Math.floor(q.captureMicros)))),j.set(q.data,8),H($.audio,j)}case"control":return H($.control,R(JSON.stringify(q.control)));case"windows":{let j=q.bounds.slice(0,A),J=new Uint8Array(j.length*16),Q=new DataView(J.buffer);return j.forEach((Z,z)=>{[Z.x,Z.y,Z.width,Z.height].forEach((G,F)=>Q.setInt32(z*16+F*4,qj(G)))}),H($.windows,J)}case"audioEnable":return H($.audioEnable,Uint8Array.of(q.on?1:0));case"ack":{let j=new Uint8Array(4);return new DataView(j.buffer).setUint32(0,q.seq>>>0),H($.ack,j)}}}function T(q){let j=h[q];if(!j)throw new U("invalid_preset");return j}function C(q,j){if(q.byteLength!==j)throw new U("invalid_length")}function k(q){if(q.byteLength>Y)throw new U("text_too_large");try{return jj.decode(q)}catch{throw new U("invalid_text")}}function Jj(q){let j;try{j=JSON.parse(k(q))}catch{throw new U("invalid_stats")}let J=j;if(!J||typeof J!=="object"||["fps","kbps","dropped","restarts","queued_bytes"].some((Z)=>typeof J[Z]!=="number"||!Number.isFinite(J[Z])))throw new U("invalid_stats");return{fps:J.fps,kbps:J.kbps,dropped:J.dropped,restarts:J.restarts,queued_bytes:J.queued_bytes}}function Qj(q){let j;try{j=JSON.parse(k(q))}catch{throw new U("invalid_control")}let J=j;if(!J||typeof J!=="object"||typeof J.you!=="boolean"||typeof J.same_user!=="boolean")throw new U("invalid_control");let Q=J.holder===null?null:s(J.holder);if(Q===null&&J.holder!==null)throw new U("invalid_control");return{holder:Q,you:J.you,same_user:J.same_user}}function Zj(q,j){let J=new DataView(j.buffer,j.byteOffset,j.byteLength);switch(q){case $.hello:if(j.byteLength<6)throw new U("invalid_length");return{type:"hello",width:J.getUint16(0),height:J.getUint16(2),fps:J.getUint8(4),preset:T(J.getUint8(5)),codec:k(j.subarray(6))};case $.frame:if(j.byteLength<14)throw new U("invalid_length");if(J.getUint8(0)>1)throw new U("invalid_frame_flags");return{type:"frame",key:J.getUint8(0)===1,seq:J.getUint32(1),captureMicros:Number(J.getBigUint64(5)),data:j.subarray(13)};case $.stats:return{type:"stats",stats:Jj(j)};case $.ping:case $.pong:return C(j,8),{type:q===$.ping?"ping":"pong",token:J.getFloat64(0)};case $.serverClipboard:return{type:"serverClipboard",text:k(j)};case $.clientClipboard:return{type:"clientClipboard",text:k(j)};case $.error:return{type:"error",code:k(j)};case $.pointer:return C(j,5),{type:"pointer",x:J.getUint16(0),y:J.getUint16(2),buttons:J.getUint8(4)};case $.key:if(C(j,5),J.getUint8(0)>1)throw new U("invalid_key_flags");return{type:"key",down:J.getUint8(0)===1,keysym:J.getUint32(1)};case $.config:return C(j,1),{type:"config",preset:T(J.getUint8(0))};case $.keyframeRequest:return C(j,0),{type:"keyframeRequest"};case $.audioHello:if(j.byteLength<5)throw new U("invalid_length");return{type:"audioHello",sampleRate:J.getUint32(0),channels:J.getUint8(4),codec:k(j.subarray(5))};case $.audio:if(j.byteLength<9)throw new U("invalid_length");return{type:"audio",captureMicros:Number(J.getBigUint64(0)),data:j.subarray(8)};case $.audioEnable:if(C(j,1),J.getUint8(0)>1)throw new U("invalid_audio_flags");return{type:"audioEnable",on:J.getUint8(0)===1};case $.control:return{type:"control",control:Qj(j)};case $.windows:{if(j.byteLength%16!==0||j.byteLength>A*16)throw new U("invalid_length");let Q=[];for(let Z=0;Z<j.byteLength;Z+=16)Q.push({x:J.getInt32(Z),y:J.getInt32(Z+4),width:J.getInt32(Z+8),height:J.getInt32(Z+12)});return{type:"windows",bounds:Q}}case $.ack:return C(j,4),{type:"ack",seq:J.getUint32(0)};default:return null}}class $j{buffer=new Uint8Array(0);push(q){let j=new Uint8Array(this.buffer.byteLength+q.byteLength);j.set(this.buffer),j.set(q,this.buffer.byteLength);let J=[],Q=0;while(j.byteLength-Q>=4){let Z=new DataView(j.buffer,j.byteOffset+Q,4).getUint32(0);if(Z<1||Z>V)throw new U("invalid_message_length");if(j.byteLength-Q-4<Z)break;let z=j[Q+4],G=j.slice(Q+5,Q+4+Z),F=Zj(z,G);if(F)J.push(F);Q+=4+Z}return this.buffer=j.slice(Q),J}}var t="/usr/bin/osascript",Gj=5000,Kj=1048576,Uj=String.raw`
|
|
3
3
|
ObjC.import("CoreGraphics");
|
|
4
4
|
ObjC.import("ApplicationServices");
|
|
5
5
|
ObjC.import("AppKit");
|
|
@@ -109,4 +109,4 @@ function run() {
|
|
|
109
109
|
`);X>=0;X=B.indexOf(`
|
|
110
110
|
`)){let S=B.slice(0,X);if(B=B.slice(X+1),!S.startsWith("c "))continue;let O=S.slice(2);if(O.length>Math.ceil(Y/3)*4||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(O)){K({reason:"display_protocol"});return}let _=Buffer.from(O,"base64");if(_.byteLength<=Y)q.clipboard(_.toString("utf8"));if(z)return}if(B.length>Math.ceil(Y/3)*4+2)K({reason:"display_protocol"})}),G.once("error",()=>W("Reason could not watch this Mac's desktop clipboard.")),G.once("exit",()=>{if(!z)W("Reason could not watch this Mac's desktop clipboard.")})};return J.stdout.on("data",(B)=>{if(z||Z===null)return;Z+=B.toString("utf8");let N=Z.indexOf(`
|
|
111
111
|
`);if(N<0){if(Z.length>4096)K({reason:"display_protocol"});return}let X=y(Z.slice(0,N));if(Z=null,!X)K({reason:"display_protocol"});else if(!X.screen||!X.accessibility)W(j.length>0?"Reason's background worker needs Screen Recording and Accessibility on this Mac (its own Reason entry in System Settings > Privacy & Security, not the Reason app's): run `reason permissions allow` on this Mac.":"Allow Screen Recording and Accessibility for this Mac's Reason worker, then restart it.");else i(),q.ready({width:X.width,height:X.height})}),J.stdin.on("error",()=>{return}),J.once("error",()=>W("Reason could not start this Mac's desktop input.")),J.once("exit",()=>{if(Z!==null)W("Reason could not start this Mac's desktop input.");else K({reason:"display_closed"})}),{pointer:(B,N,X)=>L(Q.pointer(B,N,X)),key:(B,N)=>L(Q.key(B,N)),clipboard:(B)=>L([`c ${Buffer.from(B,"utf8").toString("base64")}`]),close(){z=!0,F()}}}
|
|
112
|
-
export{Cj as
|
|
112
|
+
export{Cj as zf,kj as Af,h as Bf,Yj as Cf,Y as Df,Lj as Ef,Aj as Ff,s as Gf,xj as Hf,Mj as If,fj as Jf,hj as Kf,$j as Lf,y as Mf,Sj as Nf,_j as Of,Hj as Pf,Tj as Qf,a as Rf,Vj as Sf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Be as W}from"./vm-hands-entry-lite-0r5vmp7p.js";var E=W.string().max(201).regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/).refine((Q)=>Q.split("/").every((Z)=>Z!=="."&&Z!=="..")),G=W.string().min(1).max(255).regex(/^[A-Za-z0-9_][A-Za-z0-9_./-]*$/).refine((Q)=>!Q.includes("..")&&!Q.includes("//")&&!Q.endsWith("/")&&!Q.endsWith(".lock")),g=W.string().regex(/^[a-f0-9]{40}$/),N=W.number().int().positive(),T=W.string().min(1).max(256),A=W.string().max(60000),q={version:W.literal(1),repoFullName:E},S=W.array(W.string().max(1024).regex(/^Co-authored-by: [^<>\r\n\x00]+ <[^<>\s]+@[^<>\s]+>$/)).max(500),y=W.strictObject({expectedTrailers:S,missingFromHead:S}),d=W.discriminatedUnion("action",[W.strictObject({action:W.literal("edit"),title:T.optional(),body:A.optional(),base:G.optional()}),W.strictObject({action:W.enum(["ready","draft","close"])}),W.strictObject({action:W.literal("metadata"),field:W.enum(["reviewer","assignee","label"]),change:W.enum(["add","remove"]),value:W.string().min(1).max(100).refine((Q)=>!/[\r\n\0]/.test(Q))})]),a=W.discriminatedUnion("kind",[W.strictObject({...q,kind:W.literal("read"),path:W.string().min(1).max(2048),accept:W.enum(["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"]).optional()}),W.strictObject({...q,kind:W.literal("pr_review_context"),number:N,after:W.string().min(1).max(1024).optional()}),W.strictObject({...q,kind:W.literal("prepare"),branch:G,baseSha:g,defaultBranch:G}),W.strictObject({...q,kind:W.literal("publish"),branch:G,defaultBranch:G,baseSha:g,remoteHeadSha:g.nullable(),contributorTrailers:S.optional()}),W.strictObject({...q,kind:W.literal("pr_create"),head:G,base:G,title:T,body:A,draft:W.boolean()}),W.strictObject({...q,kind:W.literal("pr_mutation"),number:N,mutation:d}),W.strictObject({...q,kind:W.literal("pr_merge"),number:N,expectedHeadSha:g,expectedBaseRef:G,method:W.enum(["merge","squash","rebase"]),commitBody:W.string().max(65536).optional()})]),I=245760,e=W.discriminatedUnion("kind",[W.strictObject({kind:W.literal("pr_review_context"),body:W.string().max(I)}),W.strictObject({kind:W.literal("prepare"),headSha:g}),W.strictObject({kind:W.literal("read"),status:W.number().int().min(200).max(599),headers:W.record(W.string(),W.string().max(8192)).refine((Q)=>Object.keys(Q).every((Z)=>Z==="link"||Z==="content-type")),body:W.string().max(I)}),W.strictObject({kind:W.literal("publish"),headSha:g,scannedObjectCount:W.number().int().min(0).max(5000),attribution:y.optional()}),W.strictObject({kind:W.literal("pr_create"),url:W.string().max(1024).regex(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/)}),W.strictObject({kind:W.literal("pr_mutation"),number:N,applied:W.literal(!0)}),W.strictObject({kind:W.literal("pr_merge"),number:N,merged:W.literal(!0)})]).refine((Q)=>new TextEncoder().encode(JSON.stringify(Q)).byteLength<=I,"local_device_gh_result_too_large"),O=W.strictObject({source:W.enum(["agent","human"]),operationId:W.uuid()}),j=W.strictObject({version:W.literal(1),userId:W.guid(),deviceId:W.guid(),rootId:W.guid(),runId:W.guid(),merge:O.optional(),contributorRefresh:W.guid().optional(),repoFullName:E.nullable(),rootRevision:W.string().regex(/^[1-9][0-9]*$/),readOnly:W.boolean(),generation:W.number().int().positive().nullable(),fenceId:W.guid().nullable()}).refine((Q)=>Q.generation===null===(Q.fenceId===null));function C(Q){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(Q)&&Q.split("/").every((Z)=>Z!=="."&&Z!=="..")}function QQ(Q,Z,$={},H="read"){if(C(Q)&&(Z==="/search/issues"||Z.startsWith("/search/issues?")))return z(Q,Z,$);if(!C(Q)||!Z.startsWith(`/repos/${Q}/`)&&Z!==`/repos/${Q}`)throw Error("local_device_gh_repository_mismatch");if(/[\\#\u0000-\u001f]/.test(Z)||/%(?:2e|5c|00)/i.test(Z))throw Error("local_device_gh_path_denied");let V=new URL(Z,"https://api.github.com");if(V.pathname!==Z.split("?")[0]||V.username||V.password)throw Error("local_device_gh_path_denied");let Y;try{Y=decodeURIComponent(V.pathname.slice(`/repos/${Q}`.length))}catch{throw Error("local_device_gh_path_denied")}if(Y.includes("%")||Y.split("/").some((K)=>K==="."||K===".."))throw Error("local_device_gh_path_denied");if(($.method??"GET").toUpperCase()!=="GET"||$.body!=null)throw Error("local_device_gh_mutation_not_admitted");if(![/^$/,/^\/commits$/,/^\/pulls$/,/^\/pulls\/[1-9][0-9]*(?:\/(?:commits|files|reviews|comments))?$/,/^\/issues\/[1-9][0-9]*(?:\/comments)?$/,/^\/issues\/comments\/[1-9][0-9]*\/reactions$/,/^\/commits\/[A-Za-z0-9_./-]+(?:\/(?:check-runs|status))?$/,/^\/check-runs\/[1-9][0-9]*(?:\/annotations)?$/,/^\/branches\/[A-Za-z0-9_./-]+$/,/^\/git\/ref\/heads\/[A-Za-z0-9_./-]+$/,/^\/compare\/[A-Za-z0-9_./-]+\.\.\.[A-Za-z0-9_./-]+$/].some((K)=>K.test(Y)))throw Error("local_device_gh_path_denied");if(V.searchParams.forEach((K,B)=>{if(B==="per_page"&&/^[1-9][0-9]*$/.test(K)&&Number(K)<=100)return;if(B==="page"&&/^[1-9][0-9]*$/.test(K)&&Number(K)<=100)return;if(Y==="/pulls"&&B==="state"&&["open","closed","all"].includes(K))return;if(Y==="/pulls"&&B==="sort"&&K==="updated")return;if(Y==="/pulls"&&B==="direction"&&K==="desc")return;if(Y==="/pulls"&&["head","base"].includes(B)&&/^[A-Za-z0-9_./:-]{1,255}$/.test(K))return;throw Error("local_device_gh_query_denied")}),$.headers)new Headers($.headers).forEach((B,c)=>{if(c!=="accept"||!["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"].includes(B))throw Error("local_device_gh_header_denied")})}function z(Q,Z,$){if(/[\\#\u0000-\u001f]/.test(Z))throw Error("local_device_gh_path_denied");let H=new URL(Z,"https://api.github.com");if(H.pathname!=="/search/issues"||H.username||H.password)throw Error("local_device_gh_path_denied");if(($.method??"GET").toUpperCase()!=="GET"||$.body!=null)throw Error("local_device_gh_mutation_not_admitted");let V=null;H.searchParams.forEach((X,K)=>{if(K==="q"&&V===null){V=X;return}if(K==="per_page"&&/^[1-9][0-9]*$/.test(X)&&Number(X)<=100)return;if(K==="page"&&/^[1-9][0-9]*$/.test(X)&&Number(X)<=100)return;throw Error("local_device_gh_query_denied")});let Y=`repo:${Q.toLowerCase()} `,U=V?.toLowerCase()??"";if(U.length>512||!(U+" ").startsWith(Y)||/(?:^|\s)(?:repo|org|user):/.test(U.slice(Y.length)))throw Error("local_device_gh_query_denied");if($.headers)new Headers($.headers).forEach((X,K)=>{if(K!=="accept"||X!=="application/vnd.github+json")throw Error("local_device_gh_header_denied")})}var WQ=`query PullRequestReviewContext($owner: String!, $repo: String!, $number: Int!, $after: String) {
|
|
3
3
|
repository(owner: $owner, name: $repo) {
|
|
4
4
|
nameWithOwner
|
|
5
5
|
pullRequest(number: $number) {
|
|
@@ -34,9 +34,9 @@ import{ze as W}from"./vm-hands-entry-lite-samn6qm5.js";var E=W.string().max(201)
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
}`;function ZQ(Q){return Q.kind==="read"||Q.kind==="pr_review_context"}var k=["inspect_project","fs.read","fs.write","fs.search","fs.watch","fs.upload","fs.export","fs.import","fs.download","exec.run","exec.full","process.run.v1","process.full.v1","pty.start","pty.input","pty.resize","pty.close","git.run","process.list","process.signal","ports.list","tunnel.open","tunnel.close","env.discover","setup.run","mcp.discover","mcp.start","mcp.proxy","browser.snapshot","browser.navigate","browser.act","computer.snapshot","computer.act","computer.use","browser.use","browser.recording.v1","browser.pr-proof.v1","hands.connect","jobs.control","environment.install","github.local.v1","inference.ollama.v1","inference.custom.v1","delegate.devin.copy.v1","delegate.cursor.copy.v1","display.stream.v1","automation.call.v1","preview.serve.v1","workspace.setup.v1","simulator.call.v1","simulator.stream.v1"];var x=2,P="/app/local-runtime",R=262144,wQ="x-reason-relay-host-alias",HQ="v1";function F(Q,Z){return{path:`${P}${Q}`,routerPath:Q,auth:Z}}function M(Q,Z){return{...F(Q,"device_proof"),forOperation($){return F(`/operations/${encodeURIComponent($)}${Z}`,"device_proof")}}}var VQ={register:F("/register","registration_bearer"),enroll:F("/enroll","none"),authChallenge:F("/auth/challenge","none"),identity:F("/identity","device_proof"),heartbeat:F("/heartbeat","device_proof"),rootsSync:F("/roots/sync","device_proof"),disconnect:F("/disconnect","device_proof"),lifecycle:F("/lifecycle","device_proof"),localSubscription:F("/local-subscription","device_proof"),ownerWorkspaces:F("/owner-workspaces","device_proof"),ownerWorkspaceEnrollment:F("/owner-workspaces/enrollment","device_proof"),sessionWorktrees:F("/session-worktrees","device_proof"),operationClaim:F("/operations/claim","device_proof"),operationHeartbeat:M("/operations/:operationId/heartbeat","/heartbeat"),operationEvents:M("/operations/:operationId/events","/events"),operationComplete:M("/operations/:operationId/complete","/complete"),operationEnvironment:M("/operations/:operationId/environment","/environment"),operationEnvironmentAck:M("/operations/:operationId/environment-ack","/environment-ack"),operationCustomEndpointCredential:M("/operations/:operationId/custom-endpoint-credential","/custom-endpoint-credential")},YQ=`${P}/session`,XQ=4096,BQ=5000,h=[/^\/app\/local-runtime\/heartbeat$/,/^\/app\/local-runtime\/operations\/claim$/,/^\/app\/local-runtime\/operations\/[0-9a-fA-F-]{36}\/(?:heartbeat|events|complete|environment|environment-ack)$/];function GQ(Q){return h.some((Z)=>Z.test(Q))}var qQ="vm_hands_v1",gQ=60000,MQ={unauthenticated:4401,unavailable:4404,overloaded:4429,serviceRestart:1012},NQ="hands_control_v1",UQ="environment.deliver",jQ="claim_v1",JQ="environment_at_claim",xQ="rebind_v1",IQ="resident_rebind",SQ="hands.rebind",mQ="snapshot_v1",PQ="cloud_access",CQ="playwright_v1",EQ="headless_browser",TQ="v1",AQ="job_env_large_values",kQ="srt_root_v1",LQ="hands_confinement",_Q="gid_v1",fQ="model_jobs_egress",bQ="setpriv_v1",cQ="jobs_user",yQ="spawning_attempt_v1",dQ="hands_session_group",OQ="
|
|
37
|
+
}`;function ZQ(Q){return Q.kind==="read"||Q.kind==="pr_review_context"}var k=["inspect_project","fs.read","fs.write","fs.search","fs.watch","fs.upload","fs.export","fs.import","fs.download","exec.run","exec.full","process.run.v1","process.full.v1","pty.start","pty.input","pty.resize","pty.close","git.run","process.list","process.signal","ports.list","tunnel.open","tunnel.close","env.discover","setup.run","mcp.discover","mcp.start","mcp.proxy","browser.snapshot","browser.navigate","browser.act","computer.snapshot","computer.act","computer.use","browser.use","browser.recording.v1","browser.pr-proof.v1","hands.connect","jobs.control","environment.install","github.local.v1","inference.ollama.v1","inference.custom.v1","delegate.devin.copy.v1","delegate.cursor.copy.v1","display.stream.v1","automation.call.v1","preview.serve.v1","workspace.setup.v1","simulator.call.v1","simulator.stream.v1"];var x=2,P="/app/local-runtime",R=262144,wQ="x-reason-relay-host-alias",HQ="v1";function F(Q,Z){return{path:`${P}${Q}`,routerPath:Q,auth:Z}}function M(Q,Z){return{...F(Q,"device_proof"),forOperation($){return F(`/operations/${encodeURIComponent($)}${Z}`,"device_proof")}}}var VQ={register:F("/register","registration_bearer"),enroll:F("/enroll","none"),authChallenge:F("/auth/challenge","none"),identity:F("/identity","device_proof"),heartbeat:F("/heartbeat","device_proof"),rootsSync:F("/roots/sync","device_proof"),disconnect:F("/disconnect","device_proof"),lifecycle:F("/lifecycle","device_proof"),localSubscription:F("/local-subscription","device_proof"),ownerWorkspaces:F("/owner-workspaces","device_proof"),ownerWorkspaceEnrollment:F("/owner-workspaces/enrollment","device_proof"),sessionWorktrees:F("/session-worktrees","device_proof"),operationClaim:F("/operations/claim","device_proof"),operationHeartbeat:M("/operations/:operationId/heartbeat","/heartbeat"),operationEvents:M("/operations/:operationId/events","/events"),operationComplete:M("/operations/:operationId/complete","/complete"),operationEnvironment:M("/operations/:operationId/environment","/environment"),operationEnvironmentAck:M("/operations/:operationId/environment-ack","/environment-ack"),operationCustomEndpointCredential:M("/operations/:operationId/custom-endpoint-credential","/custom-endpoint-credential")},YQ=`${P}/session`,XQ=4096,BQ=5000,h=[/^\/app\/local-runtime\/heartbeat$/,/^\/app\/local-runtime\/operations\/claim$/,/^\/app\/local-runtime\/operations\/[0-9a-fA-F-]{36}\/(?:heartbeat|events|complete|environment|environment-ack)$/];function GQ(Q){return h.some((Z)=>Z.test(Q))}var qQ="vm_hands_v1",gQ=60000,MQ={unauthenticated:4401,unavailable:4404,overloaded:4429,serviceRestart:1012},NQ="hands_control_v1",UQ="environment.deliver",jQ="claim_v1",JQ="environment_at_claim",xQ="rebind_v1",IQ="resident_rebind",SQ="hands.rebind",mQ="snapshot_v1",PQ="cloud_access",CQ="playwright_v1",EQ="headless_browser",TQ="v1",AQ="job_env_large_values",kQ="srt_root_v1",LQ="hands_confinement",_Q="gid_v1",fQ="model_jobs_egress",bQ="setpriv_v1",cQ="jobs_user",yQ="spawning_attempt_v1",dQ="hands_session_group",OQ="session_cap",zQ="none",RQ="same_launch_v1",hQ="exit_v1",pQ="start_wait",rQ="user_chrome",nQ="cloud_sessions";function m(Q){if(!D(Q)||Object.keys(Q).length!==5||Q.version!==1)return!1;let Z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["boot_generation","recording_operation_id","recording_attempt_id"].every(($)=>typeof Q[$]==="string"&&Z.test(Q[$]))&&typeof Q.root_version==="string"&&/^[0-9]{1,20}(?:\.[0-9]{1,6})?$/.test(Q.root_version)}function J(Q){if(!D(Q)||Object.keys(Q).length!==6)return!1;let Z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return typeof Q.device_id==="string"&&Z.test(Q.device_id)&&(Q.binding==="workspace_source"||Q.binding==="mcp_control")&&Number.isSafeInteger(Q.target_revision)&&Number(Q.target_revision)>=0&&Number.isSafeInteger(Q.root_grant_revision)&&Number(Q.root_grant_revision)>0&&Number.isSafeInteger(Q.target_generation)&&Number(Q.target_generation)>0&&typeof Q.target_fence_id==="string"&&Z.test(Q.target_fence_id)}var sQ=["lock_acquired","enrollment_started","enrollment_completed","readiness_started","readiness_completed","inventory_completed","control_ready"],oQ=86400000,iQ=["service.install_started","service.install_completed","service.install_failed","service.launcher_adopted","service.launcher_conflict","service.started","service.reconnecting","service.reconnected","service.idle_sleep_held","service.idle_sleep_released","service.idle_sleep_failed","service.start_failed","service.stopped","service.exit_failed","service.singleton_rejected","credential.migration_started","credential.migration_completed","credential.migration_failed","credential.store_started","credential.store_completed","credential.store_failed","credential.delete_started","credential.delete_completed","credential.delete_failed","update.check_started","update.not_available","update.download_started","update.downloaded","update.verified","update.activated","update.rollback","update.failed","executor.update.check_started","executor.update.not_available","executor.update.download_started","executor.update.downloaded","executor.update.verified","executor.update.activated","executor.update.rollback","executor.update.failed","identity.refresh_completed","identity.refresh_failed","update.device_moved","update.components_installed","update.deferred","update.deferral_expired","worker.previous_exit","worker.capabilities_withheld","identity.computer_use_unavailable"],p=["production","staging"];function L(Q){if(!D(Q)||Object.keys(Q).length!==3)return!1;let Z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["organization_id","user_id","device_id"].every(($)=>Object.hasOwn(Q,$)&&typeof Q[$]==="string"&&Z.test(Q[$])&&Q[$]!=="00000000-0000-0000-0000-000000000000")}var r="DEVICE-PROOF-V2",tQ="ARA-DEVICE-V1";function vQ(Q,Z=r){let $=Q.method.toUpperCase();if(!/^[A-Z]+$/.test($)||!Q.pathAndQuery.startsWith(`${P}/`)||Q.pathAndQuery.includes(`
|
|
38
38
|
`)||!/^[0-9]{1,20}$/.test(Q.timestamp)||!/^[A-Za-z0-9_-]{22,43}$/.test(Q.nonce)||Q.challenge.length<16||Q.challenge.length>1024||Q.challenge.includes(`
|
|
39
39
|
`)||!/^[a-f0-9]{64}$/.test(Q.bodySha256))throw Error("Invalid Reason Device proof input.");return Buffer.from([Z,$,Q.pathAndQuery,Q.timestamp,Q.nonce,Q.challenge,Q.bodySha256].join(`
|
|
40
|
-
`),"utf8")}function D(Q){return Boolean(Q)&&typeof Q==="object"&&!Array.isArray(Q)}function n(Q,Z){return typeof Q==="string"&&Z.some(($)=>$===Q)}function _(Q){return D(Q)&&typeof Q.id==="string"&&typeof Q.label==="string"&&typeof Q.path_fingerprint==="string"}function s(Q){return D(Q)&&Number.isInteger(Q.seq)&&Number(Q.seq)>=0&&typeof Q.kind==="string"&&/^[A-Za-z0-9._:-]{1,64}$/.test(Q.kind)&&D(Q.payload)}function w(Q){throw Error(Q)}function
|
|
41
|
-
`)||typeof Q.expires_at!=="string"||!Number.isFinite(Date.parse(Q.expires_at)))w("Reason returned an invalid Device proof challenge.");return{challenge:Q.challenge,expires_at:Q.expires_at}}function f(Q,Z){if(!D(Q)||typeof Q.device_id!=="string"||Q.auth_scheme!=="p256"||Q.organization_id!==void 0&&typeof Q.organization_id!=="string"||Q.protocol_version!==x||!Array.isArray(Q.roots)||!Q.roots.every(_)||Z&&typeof Q.organization_id!=="string"||Q.device_credential!==void 0)w(Z?"Reason returned an invalid Device enrollment.":"Reason returned an invalid Device registration.");return{...{device_id:Q.device_id,...typeof Q.organization_id==="string"?{organization_id:Q.organization_id}:{},protocol_version:x,roots:Q.roots},auth_scheme:"p256"}}function
|
|
42
|
-
export{a as kd,I as ld,e as md,j as nd,QQ as od,WQ as pd,ZQ as qd,k as rd,x as sd,P as td,R as ud,wQ as vd,HQ as wd,VQ as xd,YQ as yd,XQ as zd,BQ as Ad,GQ as Bd,qQ as Cd,gQ as Dd,MQ as Ed,NQ as Fd,UQ as Gd,jQ as Hd,JQ as Id,xQ as Jd,IQ as Kd,SQ as Ld,mQ as Md,PQ as Nd,CQ as Od,EQ as Pd,TQ as Qd,AQ as Rd,kQ as Sd,LQ as Td,_Q as Ud,fQ as Vd,bQ as Wd,cQ as Xd,yQ as Yd,dQ as Zd,OQ as _d,zQ as $d,RQ as ae,hQ as be,pQ as ce,rQ as de,nQ as ee,sQ as fe,
|
|
40
|
+
`),"utf8")}function D(Q){return Boolean(Q)&&typeof Q==="object"&&!Array.isArray(Q)}function n(Q,Z){return typeof Q==="string"&&Z.some(($)=>$===Q)}function _(Q){return D(Q)&&typeof Q.id==="string"&&typeof Q.label==="string"&&typeof Q.path_fingerprint==="string"}function s(Q){return D(Q)&&Number.isInteger(Q.seq)&&Number(Q.seq)>=0&&typeof Q.kind==="string"&&/^[A-Za-z0-9._:-]{1,64}$/.test(Q.kind)&&D(Q.payload)}function w(Q){throw Error(Q)}function lQ(Q,Z){let $=D(Q)?Q:{},H=typeof $.error==="string"?$.error:`http_${Z}`,V=typeof $.detail==="string"?$.detail:typeof $.message==="string"?$.message:`Reason Device request failed (${Z})`;return{code:H,message:V}}function o(Q){if(!D(Q)||typeof Q.challenge!=="string"||Q.challenge.length<16||Q.challenge.length>1024||Q.challenge.includes(`
|
|
41
|
+
`)||typeof Q.expires_at!=="string"||!Number.isFinite(Date.parse(Q.expires_at)))w("Reason returned an invalid Device proof challenge.");return{challenge:Q.challenge,expires_at:Q.expires_at}}function f(Q,Z){if(!D(Q)||typeof Q.device_id!=="string"||Q.auth_scheme!=="p256"||Q.organization_id!==void 0&&typeof Q.organization_id!=="string"||Q.protocol_version!==x||!Array.isArray(Q.roots)||!Q.roots.every(_)||Z&&typeof Q.organization_id!=="string"||Q.device_credential!==void 0)w(Z?"Reason returned an invalid Device enrollment.":"Reason returned an invalid Device registration.");return{...{device_id:Q.device_id,...typeof Q.organization_id==="string"?{organization_id:Q.organization_id}:{},protocol_version:x,roots:Q.roots},auth_scheme:"p256"}}function uQ(Q){return f(Q,!1)}function aQ(Q){let Z=f(Q,!0);if(typeof Z.organization_id!=="string")return w("Reason returned an invalid Device enrollment.");return{...Z,organization_id:Z.organization_id}}function eQ(Q){if(!D(Q)||typeof Q.server_time!=="string"||typeof Q.drain!=="boolean")return w("Reason returned an invalid Device heartbeat.");return{server_time:Q.server_time,drain:Q.drain,...b(Q),...typeof Q.update_policy==="string"||Q.update_policy===null?{update_policy:Q.update_policy}:{},...typeof Q.supported_protocol_version==="number"?{supported_protocol_version:Q.supported_protocol_version}:{},...t(Q.latest_cli_versions),...Q.hands_prespawn===!0?{hands_prespawn:!0}:{}}}var i=["account_root_metadata_supported","workspace_root_metadata_supported","account_root_path_supported","home_contained_roots_supported","root_paths_supported","startup_supported"];function b(Q){return Object.fromEntries(i.filter((Z)=>Q[Z]===!0).map((Z)=>[Z,!0]))}function QW(Q){if(!D(Q))return;try{return{...o(Q),...b(Q)}}catch{return}}function t(Q){if(!D(Q))return{};let Z={};for(let $ of p){let H=Q[$];if(typeof H==="string"&&/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/.test(H))Z[$]=H}return Object.keys(Z).length>0?{latest_cli_versions:Z}:{}}function WW(Q){if(!D(Q)||!Array.isArray(Q.roots)||!Q.roots.every(_))return w("Reason returned an invalid Device root sync.");return{roots:Q.roots}}function ZW(Q){if(!D(Q)||Q.user_id!==void 0&&typeof Q.user_id!=="string"||typeof Q.organization_id!=="string"||typeof Q.organization_name!=="string"||typeof Q.organization_slug!=="string")return w("Reason returned an invalid Device identity.");return{...typeof Q.user_id==="string"?{user_id:Q.user_id}:{},organization_id:Q.organization_id,organization_name:Q.organization_name,organization_slug:Q.organization_slug}}function $W(Q){if(!D(Q)||Q.disconnected!==!0)return w("Reason did not disconnect this Device.");let Z=Q.sessions_moved;return typeof Z==="number"&&Number.isSafeInteger(Z)&&Z>=0?{disconnected:!0,sessions_moved:Z}:{disconnected:!0}}function DW(Q){if(D(Q)&&Q.ok===!0&&typeof Q.expires==="number")return{ok:!0,expires:Q.expires};if(D(Q)&&Q.ok===!1&&typeof Q.error==="string")return{ok:!1,error:Q.error};return w("Reason did not answer the local login hand-over.")}function KW(Q){if(!D(Q)||Q.accepted!==!0)return w("Reason did not accept the Device lifecycle event.");return{accepted:!0}}function v(Q){return Buffer.byteLength(JSON.stringify(Q),"utf8")}function FW(Q,Z=k){if(!D(Q)||typeof Q.operation_id!=="string"||typeof Q.attempt_id!=="string"||typeof Q.attempt_token!=="string"||!/^(?:reason|ara)_attempt_/.test(Q.attempt_token)||typeof Q.lease_until!=="string"||typeof Q.run_id!=="string"||typeof Q.root_id!=="string"||Q.owner!==void 0&&!L(Q.owner)||!n(Q.capability,Z)||!D(Q.payload)||Q.protocol_version!==x||v(Q.payload)>R||Q.authority!==void 0&&!J(Q.authority)||Q.local_github_authority!==void 0&&!j.safeParse(Q.local_github_authority).success||Q.capability==="github.local.v1"&&!j.safeParse(Q.local_github_authority).success||Q.recording_authority!==void 0&&!m(Q.recording_authority)||Q.capability==="browser.recording.v1"&&(!m(Q.recording_authority)||!L(Q.owner))||Q.capability!=="browser.recording.v1"&&Q.recording_authority!==void 0)return w("Reason returned an invalid Device operation claim.");let $={operation_id:Q.operation_id,attempt_id:Q.attempt_id,attempt_token:Q.attempt_token,lease_until:Q.lease_until,run_id:Q.run_id,root_id:Q.root_id,capability:Q.capability,payload:Q.payload,...J(Q.authority)?{authority:Q.authority}:{},...m(Q.recording_authority)?{recording_authority:Object.freeze({...Q.recording_authority})}:{},...Q.local_github_authority!==void 0?{local_github_authority:j.parse(Q.local_github_authority)}:{},...Q.capability==="hands.connect"&&D(Q.environment)&&D(Q.environment.payload)&&J(Q.environment.authority)?{environment:{payload:Q.environment.payload,authority:Q.environment.authority}}:{},protocol_version:x};if(Q.owner!==void 0)$.owner=Object.freeze({...Q.owner});return $}function wW(Q){if(!D(Q)||typeof Q.lease_until!=="string"||!Array.isArray(Q.controls)||!Q.controls.every(s)||!Number.isInteger(Q.next_control_seq)||Number(Q.next_control_seq)<0)return w("Reason returned an invalid Device operation heartbeat.");return{lease_until:Q.lease_until,controls:Q.controls,next_control_seq:Number(Q.next_control_seq)}}function HW(Q){if(!D(Q)||!Number.isInteger(Q.next_event_seq)||Number(Q.next_event_seq)<0||typeof Q.duplicate!=="boolean"||!Number.isInteger(Q.accepted_count)||Number(Q.accepted_count)<0)return w("Reason returned an invalid Device operation event result.");return{next_event_seq:Number(Q.next_event_seq),duplicate:Q.duplicate,accepted_count:Number(Q.accepted_count)}}function VW(Q){if(!D(Q)||!D(Q.payload)||!J(Q.authority))return w("Reason returned an invalid Device environment delivery.");return{payload:Q.payload,authority:Q.authority}}function l(Q){return Q==="succeeded"||Q==="failed"||Q==="cancelled"||Q==="expired"}function YW(Q){if(!D(Q)||!l(Q.status)||typeof Q.idempotent!=="boolean")return w("Reason returned an invalid Device operation completion.");return{status:Q.status,idempotent:Q.idempotent}}
|
|
42
|
+
export{a as kd,I as ld,e as md,j as nd,QQ as od,WQ as pd,ZQ as qd,k as rd,x as sd,P as td,R as ud,wQ as vd,HQ as wd,VQ as xd,YQ as yd,XQ as zd,BQ as Ad,GQ as Bd,qQ as Cd,gQ as Dd,MQ as Ed,NQ as Fd,UQ as Gd,jQ as Hd,JQ as Id,xQ as Jd,IQ as Kd,SQ as Ld,mQ as Md,PQ as Nd,CQ as Od,EQ as Pd,TQ as Qd,AQ as Rd,kQ as Sd,LQ as Td,_Q as Ud,fQ as Vd,bQ as Wd,cQ as Xd,yQ as Yd,dQ as Zd,OQ as _d,zQ as $d,RQ as ae,hQ as be,pQ as ce,rQ as de,nQ as ee,sQ as fe,oQ as ge,iQ as he,r as ie,tQ as je,vQ as ke,lQ as le,o as me,uQ as ne,aQ as oe,eQ as pe,QW as qe,WW as re,ZW as se,$W as te,DW as ue,KW as ve,FW as we,wW as xe,HW as ye,VW as ze,YW as Ae};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Be as w}from"./vm-hands-entry-lite-0r5vmp7p.js";var $="inference.custom.v1",K=32768,O=67108864,P=16384,Q=204800,x=600000,S=["content-type","anthropic-version","user-agent"],L=w.enum(["openai-completions","openai-responses","anthropic-messages"]),T=new Set(S),U=w.record(w.string(),w.string().max(2048)).refine((j)=>Object.keys(j).every((A)=>T.has(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)),"Only non-secret custom endpoint request headers are permitted");function F(j){try{let A=new URL(j);return["http:","https:"].includes(A.protocol)&&!A.username&&!A.password&&!A.search&&!A.hash?A:null}catch{return null}}function V(j,A){let B=F(j.baseUrl),H=F(A.baseUrl),D=F(j.url);if(!B||!H||!D||j.method!=="POST"||A.execution!=="device")return!1;let I=(J)=>J.origin+J.pathname.replace(/\/+$/,"");if(I(B)!==I(H)||D.origin!==B.origin)return!1;let N=A.api==="openai-completions"?"/chat/completions":A.api==="openai-responses"?"/responses":"/v1/messages";return D.pathname===B.pathname.replace(/\/+$/,"")+N}var C=w.object({baseUrl:w.string().max(2048),url:w.string().max(4096),method:w.literal("POST"),body:w.string().refine((j)=>new TextEncoder().encode(j).byteLength<=Q).optional(),headers:U,credentialOrganizationId:w.string().uuid(),accountKey:w.string().min(1).max(256).optional()}).strict().refine((j)=>L.options.some((A)=>V(j,{baseUrl:j.baseUrl,api:A,execution:"device"})),"Invalid custom endpoint inference URL"),E=w.object({status:w.number().int().min(200).max(599),statusText:w.string().max(256).refine((j)=>!/[\r\n\0]/.test(j)),headers:w.record(w.string(),w.string().max(4096)).refine((j)=>Object.keys(j).every((A)=>["content-type","retry-after","x-request-id","request-id"].includes(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)))}).strict(),M=w.union([w.object({eof:w.literal(!0)}).strict(),w.object({eof:w.literal(!1),data:w.string().max(Math.ceil(K/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((j)=>j.length>0&&j.length*3/4-(j.endsWith("==")?2:j.endsWith("=")?1:0)<=K)}).strict()]),R=w.object({bytes:w.number().int().min(0).max(O),chunks:w.number().int().min(0).max(P)}).strict(),z=w.object({apiKey:w.string().min(1).max(16384).refine((j)=>!/[\r\n\0]/.test(j)),api:L}).strict(),W=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function p(j){return typeof j==="string"&&W.includes(j)}var X="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",G={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${X}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."},Y=new Set(Object.values(G));function b(j){return Object.hasOwn(G,j)?G[j]:null}function k(j){return typeof j==="string"&&Y.has(j)}var Z=/^Your model endpoint \S+ (?:returned HTTP 40[34]|was unreachable: it refused the connection)\.$/;function y(j,A){if(!/^[a-z0-9.-]+$/i.test(j))return null;if(A==="connection_refused")return`Your model endpoint ${j} was unreachable: it refused the connection.`;return A===403||A===404?`Your model endpoint ${j} returned HTTP ${A}.`:null}function q(j){return typeof j==="string"&&Z.test(j)}
|
|
3
3
|
export{$ as qc,K as rc,O as sc,P as tc,Q as uc,x as vc,S as wc,V as xc,C as yc,E as zc,M as Ac,R as Bc,z as Cc,W as Dc,p as Ec,b as Fc,k as Gc,y as Hc,q as Ic};
|