@reason-machines/cli-linux-arm64-musl 0.2.295 → 0.2.297
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/connect-cli-rwhzc14d.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-tv4wtdb2.js → custom-endpoint-device-p2bvtf6p.js} +1 -1
- package/bin/vm-hands/desktop-account-axaenf68.js +2 -0
- package/bin/vm-hands/{device-workspace-s5z0zr53.js → device-workspace-ecq3hfd6.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-emf3gv2b.js → hands-worker-source-w477y8ad.js} +1 -1
- package/bin/vm-hands/{index-bwnyk312.js → index-nxzv9qe7.js} +1 -1
- package/bin/vm-hands/local-automation-22z2k4vz.js +2 -0
- package/bin/vm-hands/local-capabilities-fyq9h5jc.js +2 -0
- package/bin/vm-hands/local-desktop-users-4756c92y.js +2 -0
- package/bin/vm-hands/local-display-mac-3zz66vzn.js +2 -0
- package/bin/vm-hands/local-display-session-j6w3b26a.js +2 -0
- package/bin/vm-hands/{network-contract-y6kbgyhe.js → network-contract-ggqak7gp.js} +1 -1
- package/bin/vm-hands/package-s6y0j1as.js +2 -0
- package/bin/vm-hands/permissions-dgzk0zvh.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-as5477xr.js +2 -0
- package/bin/vm-hands/{status-4cjfsvqj.js → status-8jpvepeq.js} +2 -2
- package/bin/vm-hands/version-929j7g2j.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-qdwm3ya8.js → vm-hands-entry-lite-0ergg2ky.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-yvftswfy.js → vm-hands-entry-lite-19b6k3f1.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-tkpfs08y.js → vm-hands-entry-lite-21qkhpm0.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-yadv8a82.js → vm-hands-entry-lite-6j2yaa4n.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-cfjx91rj.js → vm-hands-entry-lite-7k65s010.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5zzey257.js → vm-hands-entry-lite-8st97h7b.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-tf9322ea.js → vm-hands-entry-lite-99qvkd2y.js} +21 -21
- package/bin/vm-hands/{vm-hands-entry-lite-qz9mkksp.js → vm-hands-entry-lite-brkpme0v.js} +26 -26
- package/bin/vm-hands/{vm-hands-entry-lite-250sqsry.js → vm-hands-entry-lite-bswnp5ve.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ggkqyxmp.js → vm-hands-entry-lite-e9fkzekb.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-pr65ksfz.js → vm-hands-entry-lite-em388nee.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-zeay5yc9.js → vm-hands-entry-lite-g8dsm099.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-x3ytsxjm.js → vm-hands-entry-lite-h36c6h4q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-a3n86qqm.js → vm-hands-entry-lite-hf0mk7vd.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-32d3ydnw.js → vm-hands-entry-lite-m5jamh2w.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-zmf3vn3w.js → vm-hands-entry-lite-pf1ft65e.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-q2pb31vh.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-h7ndfgwc.js → vm-hands-entry-lite-q6fshf3h.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-tm7mv31d.js → vm-hands-entry-lite-rn0j7azy.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5rbj89cs.js → vm-hands-entry-lite-rrk5g62b.js} +67 -22
- package/bin/vm-hands/{vm-hands-entry-lite-d94sv87n.js → vm-hands-entry-lite-wgx7z7gt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-sn3vjjgx.js → vm-hands-entry-lite-xsq25kmd.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-mk9p22xa.js → vm-hands-entry-lite-ya1a2eep.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ngvxyjhy.js → vm-hands-entry-lite-yp315y25.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-z7twr5ec.js → vm-hands-entry-lite-z662b8yj.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-w3k6wwx4.js → vm-hands-executor-wwefyz6j.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-34mh58h8.js → vm-hands-op-runner-bdj7se5y.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-ws1x5fg0.js → vm-hands-runtime-mq34wp9n.js} +3 -3
- package/bin/vm-hands/worker-sandbox-snmfpfax.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/connect-cli-pwvhzdn1.js +0 -2
- package/bin/vm-hands/desktop-account-vr5beh82.js +0 -2
- package/bin/vm-hands/local-automation-jg8850x7.js +0 -2
- package/bin/vm-hands/local-capabilities-vr1j2605.js +0 -2
- package/bin/vm-hands/local-desktop-users-vztj8kn8.js +0 -2
- package/bin/vm-hands/local-display-mac-4mtwfgty.js +0 -2
- package/bin/vm-hands/local-display-session-9tbyrsqk.js +0 -2
- package/bin/vm-hands/package-q8gdr1z1.js +0 -2
- package/bin/vm-hands/permissions-5bmhsbwr.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-5wqth9ga.js +0 -2
- package/bin/vm-hands/version-eyf47yc7.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-mysjgrwy.js +0 -4
- package/bin/vm-hands/worker-sandbox-wqxffxa1.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Zg as c}from"./vm-hands-entry-lite-pr65ksfz.js";var g={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"},g0=Object.values(g),jZ=new Set;function MQ(Q,Z){let $=Q[Z];if($?.trim())return $;let X=Q[g[Z]];if(X?.trim())jZ.add(g[Z]);return X}function KZ(Q,Z){return{[Q]:Z,[g[Q]]:Z}}import{basename as BZ}from"path";var i=["production","staging"],OZ="https://api.reasonmachines.com",kZ="https://staging-api.reasonmachines.com";var l={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},AZ=new Set(["ara-staging","reason-staging"]);function KQ(Q={}){let Z=MQ(Q.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(Z){if(i.includes(Z))return Z;throw Error(`Unknown Reason CLI channel: ${Z}`)}let $=BZ(Q.executablePath??process.execPath).toLowerCase();return AZ.has($)?"staging":"production"}function h(Q){return Q==="staging"?kZ:OZ}function y0(Q){return`${h(Q)}/mcp/ara`}var BQ={production:["https://api.ara.so",l.production.api],staging:["https://api-staging.ara.so",l.staging.api]};function jQ(Q){let Z;try{Z=new URL(Q).origin}catch{return Q}let $=i.find((X)=>BQ[X].includes(Z));return $?h($):Z}function p0(Q,Z){return Q===Z||jQ(Q)===jQ(Z)}function OQ(Q,Z){return i.some(($)=>BQ[$].includes(Q)&&Z===h($))}function u0(Q,Z){try{let $=new URL(Z);return!$.username&&!$.password&&($.origin===h(Q)||$.origin===l[Q].api)}catch{return!1}}function d0(Q){try{let Z=new URL(Q).hostname.replace(/^\[|\]$/g,"").toLowerCase();return Z==="localhost"||Z==="127.0.0.1"||Z==="::1"}catch{return!1}}import{randomBytes as xQ}from"crypto";import{chmodSync as LQ,closeSync as FQ,constants as _Z,linkSync as bQ,lstatSync as x,mkdirSync as fQ,openSync as NZ,readdirSync as P,readFileSync as TQ,readlinkSync as D,renameSync as N,rmdirSync as CQ,symlinkSync as _,unlinkSync as B}from"fs";import{createRequire as xZ}from"module";import{constants as LZ}from"os";import{basename as f,join as U,sep as bZ}from"path";import{existsSync as m,lstatSync as AQ,readdirSync as PZ,readFileSync as FZ,readlinkSync as TZ,realpathSync as DZ}from"fs";import{join as K,sep as RZ}from"path";function o(Q,...Z){let $=K(Q,"ara"),X=K(Q,"reason");if(!v($))return K(X,...Z);if(!m(X))return K($,...Z);return m(K($,...Z))&&!m(K(X,...Z))?K($,...Z):K(X,...Z)}function v(Q){try{let Z=AQ(Q);if(!Z.isSymbolicLink())return Z.isDirectory();return TZ(Q)!=="reason"&&m(Q)}catch{return!1}}function PQ(Q,Z=[]){if(!v(Q))return!1;let $;try{$=[Q,...PZ(Q,{withFileTypes:!0}).filter((X)=>X.isDirectory()).map((X)=>K(Q,X.name))]}catch{return!1}return $.some((X)=>["connect","connect-once"].filter((z)=>!Z.includes(K(X,z))).some((z)=>{let W=K(X,z,"worker.json");try{AQ(W)}catch{return!1}try{let q=JSON.parse(FZ(W,"utf8"))?.stateDirectory;if(typeof q!=="string")return!0;let V=(J,w)=>J===w||J.startsWith(w+RZ);return V(q,Q)||V(kQ(q),kQ(Q))}catch{return!0}}))}function kQ(Q){try{return DZ(Q)}catch{return Q}}var u=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"]),n=new Set(["local-device.proxy.json"]),fZ=new Set(["local-device.key","local-device.binding"]),DQ=new Map;function r(Q,Z,$){let X=U(Q,"ara");if(/[/\\]\.reason-ssh[/\\][^/\\]+[/\\]installer-home[/\\]\.config$/.test(Q))return{state:G(X)?.isDirectory()?"kept":"absent"};return EQ(X,U(Q,"reason"),{linkAlways:!0,kept:(z)=>PQ(z,$??[]),native:Z===void 0?pQ:()=>Z},$!==void 0)}function SQ(Q,...Z){return r(Q),o(Q,...Z)}function z1(Q,Z=process.platform){let $=U(Q,"Library","Logs");if(Z==="darwin")for(let X of[""," Staging"," Development"])EQ(U($,`Ara${X}`),U($,`Reason${X}`),{linkAlways:!1,kept:()=>!1,native:pQ});return U($,"Reason")}var IQ="config_rename_unavailable:busy";function EQ(Q,Z,$,X=!1){let z=X?void 0:DQ.get(Q);if(z)return z;let W;try{W=CZ(Q,Z,$)}catch(q){let V=`config_rename_unavailable:${A(q)??"failed"}`;try{return{state:G(Q)?.isDirectory()?"kept":"absent",problem:V}}catch{return{state:"kept",problem:V}}}if(!(W.state==="absent"&&$.linkAlways)&&W.problem!==IQ&&!(W.state==="kept"&&!W.problem))DQ.set(Q,W);return W}function CZ(Q,Z,$){IZ(Z,$.native);let X=!1;for(let z=0;z<8;z+=1){let W=G(Q);if(W?.isSymbolicLink())return D(Q)===f(Z)?{state:X?"renamed":"linked"}:{state:"kept"};if(!W){if(p(Z))M(()=>B(Z),"ENOENT");if(!(X||$.linkAlways)||!R(Z))return{state:"absent"};let J=b(Z,"link");_(f(Z),J);try{M(()=>N(J,Q),"EISDIR","ENOTEMPTY","EEXIST","ENOTDIR")}finally{M(()=>B(J),"ENOENT")}continue}if(!W.isDirectory())return{state:"absent"};if($.kept(Q))return RQ(Z),{state:"kept"};let q=$.native();if(!q)return RQ(Z),{state:"kept",problem:"config_rename_unavailable:no_native"};let V=EZ(q,Q);if(!V)return{state:"kept",problem:IQ};try{if(x(Q).isSymbolicLink())continue;let J=SZ(q,Q,Z);if(J)return{state:"kept",problem:J};X=!0}finally{V()}}throw Object.assign(Error("legacy directory rename did not settle"),{code:"unsettled"})}function SZ(Q,Z,$){let X=G($);if(!X||p($)){if(!X)_(f($),$);try{Q.exchange(Z,$)}catch(J){if(p($))M(()=>B($),"ENOENT");return`config_rename_unavailable:${A(J)??"exchange_failed"}`}return null}if(!X.isDirectory())return"config_rename_unavailable:ENOTDIR";if(X.dev!==x(Z).dev)return"config_rename_unavailable:EXDEV";let z=[b($,"probe"),b($,"probe")];try{_("a",z[0]),_("b",z[1]),Q.exchange(z[0],z[1])}catch(J){return`config_rename_unavailable:${A(J)??"exchange_failed"}`}finally{for(let J of z)M(()=>B(J),"ENOENT")}let W=yQ($);for(let J of fZ){let w=G(U($,J)),j=G(U(Z,J));if(w&&j&&w.ino!==j.ino)fQ(`${W}-replaced`,{mode:448,recursive:!0}),N(U($,J),U(`${W}-replaced`,J))}let q={linked:new Map,unitsKept:new Set};gQ(Z,$,"",q);let V=b($,"rename");_(f($),V);try{Q.exchange(Z,V)}catch(J){return M(()=>B(V),"ENOENT"),`config_rename_unavailable:${A(J)??"exchange_failed"}`}return hQ(V,$,q,W),null}function t(Q){return Q===""||!Q.includes(bZ)}function gQ(Q,Z,$,X){let z=t($)&&y(U(Z,$),U(Q,$));if(z)X.unitsKept.add($);for(let W of P(U(Q,$))){if(z&&(u.has(W)||n.has(W)))continue;let q=U($,W),V=U(Q,q),J=U(Z,q),w=G(V);if(!w)continue;let j=G(J);if(w.isDirectory()){if(!j)M(()=>fQ(J,{mode:w.mode&4095}),"EEXIST"),LQ(J,w.mode&4095);if(R(J))gQ(Q,Z,q,X)}else if(!j){if(w.isSymbolicLink())M(()=>_(D(V),J),"EEXIST");else if(M(()=>bQ(V,J),"EEXIST","ENOENT"))X.linked.set(q,w.ino)}}}function IZ(Q,Z){let $;try{if(!R(Q))return;$=P(Q)}catch{return}for(let X of $){let z=/^\.(rename|link|probe|claim)-(\d+)-[0-9a-f]+$/.exec(X);if(!z)continue;let W=U(Q,X),q=G(W);if(!q)continue;if(!q.isDirectory()){if(!_Q(Number(z[2])))M(()=>B(W),"ENOENT");continue}let V=Z(),J=null;if(V){try{J=V.lock(W)}catch{continue}if(!J)continue}else if(_Q(Number(z[2])))continue;try{let w=b(Q,"claim");if(M(()=>N(W,w),"ENOENT"))hQ(w,Q,null,yQ(Q))}finally{J?.()}}}function hQ(Q,Z,$,X){for(let[z,W]of $?.linked??[])if(!G(U(Q,z))&&G(U(Z,z))?.ino===W)M(()=>B(U(Z,z)),"ENOENT");if(mQ(Q,Z,"",$),M(()=>CQ(Q),"ENOTEMPTY","EEXIST"))return;N(Q,X),LQ(X,448)}function mQ(Q,Z,$,X){let z=t($)&&(X?X.unitsKept.has($):y(U(Z,$),U(Q,$)));for(let W of P(U(Q,$))){let q=U($,W),V=U(Q,q),J=U(Z,q),w=x(V),j=G(J);if(j&&w.ino===j.ino&&w.dev===j.dev){B(V);continue}if(w.isFile()&&j?.isFile()&&X?.linked.get(q)===j.ino){N(V,J);continue}if(z&&(u.has(W)||n.has(W)))continue;if(!j){if(w.isFile()){if(M(()=>bQ(V,J),"EEXIST"))B(V)}else M(()=>N(V,J),"EEXIST","ENOTEMPTY");continue}if(w.isDirectory()&&j.isDirectory())mQ(Q,Z,q,X),M(()=>CQ(V),"ENOTEMPTY","EEXIST")}}function W1(Q){let Z=U(Q,"ara"),$=U(Q,"reason");if(!R(Z)||!R($))return null;let X=["",...P(Z,{withFileTypes:!0}).filter((z)=>z.isDirectory()&&!z.name.startsWith(".")).map((z)=>z.name)];for(let z of X){let W=U(Z,z),q=U($,z);if(!y(W,q)||!y(q,W))continue;if([...u,...n].some((J)=>a(U(W,J),U(q,J))===!1))return z}return null}function q1(Q){let Z=U(Q,"ara"),$=U(Q,"reason");if(!R(Z)||!R($))return null;let X=(z)=>{for(let W of P(U(Z,z))){let q=U(z,W);if(t(z)&&(W==="connect"||W==="connect-once"))continue;let V=x(U(Z,q)),J=G(U($,q));if(!J||V.ino===J.ino&&V.dev===J.dev)continue;if(V.isDirectory()&&J.isDirectory()&&!J.isSymbolicLink()){let w=X(q);if(w!==null)return w}else if(V.isSymbolicLink()||J.isSymbolicLink()){if(!(V.isSymbolicLink()&&J.isSymbolicLink()&&D(U(Z,q))===D(U($,q))))return q}else if(a(U(Z,q),U($,q))!==!0)return q}return null};return X("")}function a(Q,Z){let $=G(Q),X=G(Z);if(!$&&!X)return null;if(!$||!X||$.isDirectory()!==X.isDirectory())return!1;if($.ino===X.ino&&$.dev===X.dev)return!0;if($.isDirectory())return[...new Set([...P(Q),...P(Z)])].every((W)=>a(U(Q,W),U(Z,W))===!0);try{return TQ(Q).equals(TQ(Z))}catch{return!1}}function y(Q,Z){for(let $ of u)if(vQ(U(Q,$),U(Z,$)))return!0;return!1}function vQ(Q,Z){let $=G(Q);if(!$)return!1;let X=G(Z);if(!X)return!0;if($.isDirectory()){if(!X.isDirectory())return!0;return P(Q).some((z)=>vQ(U(Q,z),U(Z,z)))}if($.isSymbolicLink())return!X.isSymbolicLink()||D(Q)!==D(Z);return $.ino!==X.ino||$.dev!==X.dev}function RQ(Q){if(p(Q))M(()=>B(Q),"ENOENT")}function yQ(Q){return U(Q,`.pre-rename-${new Date().toISOString().replace(/[:.]/g,"-")}-${xQ(3).toString("hex")}`)}function p(Q){try{return x(Q).isSymbolicLink()&&D(Q)===f(Q)}catch{return!1}}function R(Q){let Z=G(Q);return Z!==null&&Z.isDirectory()}function EZ(Q,Z){for(let $=0;$<40;$+=1){let X=Q.lock(Z);if(X)return X;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,50)}return null}function b(Q,Z){return U(Q,`.${Z}-${process.pid}-${xQ(6).toString("hex")}`)}function _Q(Q){if(Q===process.pid)return!1;try{return process.kill(Q,0),!0}catch(Z){return A(Z)==="EPERM"}}function G(Q){try{return x(Q)}catch(Z){if(A(Z)==="ENOENT"||A(Z)==="ENOTDIR")return null;throw Z}}function M(Q,...Z){try{return Q(),!0}catch($){if(Z.includes(A($)??""))return!1;throw $}}function A(Q){return Q instanceof Error&&"code"in Q&&typeof Q.code==="string"?Q.code:void 0}var L,gZ=2,hZ=4,mZ=2,vZ=2,NQ=-100;function pQ(){if(L!==void 0)return L;if(L=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let Q;try{Q=xZ(import.meta.url)("bun:ffi")}catch{return null}let Z=process.platform==="darwin",$=Z?"__error":"__errno_location",X=Z?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`],{FFIType:z}=Q;for(let W of X)try{let q=Z?"renamex_np":"renameat2",J=Q.dlopen(W,{flock:{args:[z.i32,z.i32],returns:z.i32},[$]:{args:[],returns:z.ptr},[q]:Z?{args:[z.ptr,z.ptr,z.u32],returns:z.i32}:{args:[z.i32,z.ptr,z.i32,z.ptr,z.u32],returns:z.i32}}).symbols,w=J[$]();if(w===null)continue;let j=(T)=>{let k=Q.read.i32(w),O=Object.entries(LZ.errno).find(([,E])=>E===k)?.[0]??`errno_${k}`;return Object.assign(Error(`${T} failed: ${O}`),{code:O})},HQ=(T)=>Buffer.from(`${T}\x00`,"utf8");return L={exchange(T,k){let O=HQ(T),E=HQ(k);if((Z?J[q](Q.ptr(O),Q.ptr(E),mZ):J[q](NQ,Q.ptr(O),NQ,Q.ptr(E),vZ))!==0)throw j("exchange")},lock(T){let k=NZ(T,_Z.O_RDONLY);if(J.flock(k,gZ|hZ)===0)return()=>FQ(k);let O=j("lock");if(FQ(k),O.code==="EWOULDBLOCK"||O.code==="EAGAIN")return null;throw O}},L}catch{}return null}import{createHmac as V0,createPublicKey as w0,randomBytes as G0,randomUUID as zZ,verify as H0}from"crypto";import{chmodSync as qQ,existsSync as WZ,mkdirSync as M0,readFileSync as j0,realpathSync as K0,renameSync as B0,statSync as O0,unlinkSync as k0,writeFileSync as A0}from"fs";import{basename as P0,dirname as YQ,isAbsolute as qZ,join as s,resolve as F0}from"path";var Y1=[Object.freeze({family:"ara",channel:"stable",applicationId:"so.ara.desktop"}),Object.freeze({family:"ara",channel:"staging",applicationId:"so.ara.desktop.staging"}),Object.freeze({family:"reason",channel:"stable",applicationId:"com.reasonmachines.desktop"}),Object.freeze({family:"reason",channel:"staging",applicationId:"com.reasonmachines.desktop.staging"})];var yZ="REASON_DESKTOP_RUNTIME",pZ="REASON_DESKTOP_RUNTIME_CHANNEL",uZ="REASON_DESKTOP_RUNTIME_INSTANCE_ID",dZ="REASON_DESKTOP_RUNTIME_WORKSPACE_SCOPE",M1={[yZ]:"ARA_DESKTOP_RUNTIME",[pZ]:"ARA_DESKTOP_RUNTIME_CHANNEL",[uZ]:"ARA_DESKTOP_RUNTIME_INSTANCE_ID",[dZ]:"ARA_DESKTOP_RUNTIME_WORKSPACE_SCOPE"};function uQ(Q){if(Q===void 0)return;if(!/^[a-f0-9]{64}$/.test(Q))throw Error("Invalid desktop workspace scope.");return Q}import{chmodSync as QQ,existsSync as F,mkdirSync as ZQ,readFileSync as lQ,realpathSync as lZ,renameSync as iZ,unlinkSync as $Q,writeFileSync as XQ}from"fs";import{createPrivateKey as oZ,createPublicKey as nZ,generateKeyPairSync as rZ,randomUUID as tZ,sign as aZ}from"crypto";import{createRequire as eZ}from"module";import{homedir as Q0,platform as rQ}from"os";import{dirname as Z0,join as C}from"path";import{existsSync as sZ}from"fs";import{join as cQ}from"path";var e="libara_device_keychain.dylib",dQ="libreason_device_keychain.dylib";class cZ extends Error{code;constructor(Q,Z){super(Z);this.code=Q;this.name="ManagedRuntimeError"}}function sQ(Q){let Z=cQ(Q,dQ);return sZ(Z)?Z:cQ(Q,e)}var iQ=1,$0=16384,S=65536,X0=128,z0=128,tQ=65536;class Y extends Error{code;nativeStatus;constructor(Q,Z){super(`Reason Device proof boundary failed (${Q}).${Z===void 0?"":` Native status: ${Z}.`}`);this.code=Q;this.nativeStatus=Z;this.name="LocalCredentialBoundaryError"}}function aQ(Q){if(Q.code==="proof_key_read_failed"&&Q.nativeStatus===-25300)return"proof_key_missing";switch(Q.nativeStatus){case-25308:return"keychain_interaction_required";case-25293:return"keychain_access_denied";case-25291:return"keychain_unavailable";default:return Q.code}}var zQ=null;function eQ(){if(!zQ)try{zQ=eZ(import.meta.url)("bun:ffi")}catch{throw new Y("native_boundary_unavailable")}return zQ}function W0(Q){if(typeof Q!=="string")return null;try{let Z=new URL(Q);if(Z.protocol!=="https:"&&Z.hostname!=="127.0.0.1"&&Z.hostname!=="localhost"&&Z.hostname!=="[::1]"&&Z.hostname!=="::1")return null;return Z.origin}catch{return null}}function q0(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new Y("invalid_credential_record");let Z=Q,$=W0(Z.apiOrigin);if(Z.version!==iQ||!$||typeof Z.orgId!=="string"||Z.orgId.length<1||Z.orgId.length>160||typeof Z.deviceId!=="string"||Z.deviceId.length<1||Z.deviceId.length>160||typeof Z.credential!=="string"||!/^(?:reason|ara)_dev_/.test(Z.credential)||Z.credential.length>4096)throw new Y("invalid_credential_record");return{version:iQ,apiOrigin:$,orgId:Z.orgId,deviceId:Z.deviceId,credential:Z.credential}}function J0(Q=process.execPath){let Z=Q;try{Z=lZ(Q)}catch{}return sQ(Z0(Z))}function H(Q){return eQ().ptr(Q)}function Y0(Q){if(!F(Q))throw new Y("native_boundary_unavailable");let{dlopen:Z,FFIType:$}=eQ();try{return Z(Q,{ara_device_configure_scope:{args:[$.ptr,$.u64],returns:$.i32},ara_device_key_load_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_create_fresh_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_sign:{args:[$.ptr,$.u64,$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_is_non_extractable:{args:[$.ptr],returns:$.i32},ara_device_key_delete:{args:[$.ptr],returns:$.i32},ara_device_binding_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_binding_create:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_update:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_delete:{args:[$.ptr],returns:$.i32},ara_device_keychain_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_keychain_delete:{args:[$.ptr],returns:$.i32}})}catch(X){if(X instanceof Y)throw X;throw new Y("native_boundary_unavailable")}}function oQ(Q){return Buffer.from(Q).toString("base64url")}function I(Q){if(typeof Q!=="string"||!/^[A-Za-z0-9_-]{87}$/.test(Q))return!1;try{let Z=Buffer.from(Q,"base64url");return Z.byteLength===65&&Z[0]===4}catch{return!1}}function QZ(Q){if(Q.byteLength<8||Q.byteLength>72||Q[0]!==48)return!1;let Z=Q[1];return Z!==void 0&&Z<128&&Z+2===Q.byteLength}class ZZ{libraryPath;runtimePlatform;workspaceScope;library=null;constructor(Q=J0(),Z=rQ(),$){this.libraryPath=Q;this.runtimePlatform=Z;this.workspaceScope=$;uQ($)}symbols(){if(this.runtimePlatform!=="darwin")throw new Y("unsupported_platform");this.library??=Y0(this.libraryPath);let Q=new TextEncoder().encode(this.workspaceScope??""),Z=this.library.symbols.ara_device_configure_scope(H(Q.length?Q:new Uint8Array(1)),BigInt(Q.length));if(Z!==0)throw new Y("native_boundary_unavailable",Z);return this.library.symbols}publicKey(Q){let Z=new Uint8Array(X0),$=new BigUint64Array(1),X=Q==="load"?this.symbols().ara_device_key_load_public(H(Z),BigInt(Z.byteLength),H($)):this.symbols().ara_device_key_create_fresh_public(H(Z),BigInt(Z.byteLength),H($));if(X!==0)throw new Y(Q==="load"?"proof_key_read_failed":"proof_key_generation_failed",X);let z=Number($[0]);if(!Number.isSafeInteger(z)||z!==65)throw new Y("invalid_public_key");let W=oQ(Z.subarray(0,z));if(!I(W))throw new Y("invalid_public_key");return W}loadPublicKey(){return this.publicKey("load")}createFreshPublicKey(){return this.publicKey("create_fresh")}sign(Q){if(Q.byteLength<1||Q.byteLength>tQ)throw new Y("proof_sign_failed");let Z=new Uint8Array(z0),$=new BigUint64Array(1),X=this.symbols().ara_device_key_sign(H(Q),BigInt(Q.byteLength),H(Z),BigInt(Z.byteLength),H($));if(X!==0)throw new Y("proof_sign_failed",X);let z=Number($[0]);if(!Number.isSafeInteger(z)||z<1||z>Z.byteLength)throw new Y("invalid_signature");let W=Z.subarray(0,z);if(!QZ(W))throw new Y("invalid_signature");return oQ(W)}privateKeyIsNonExtractable(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_is_non_extractable(H(Q));if(Z!==0||Q[0]!==1)throw new Y("proof_key_read_failed",Z);return!0}deleteKey(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_delete(H(Q));if(Z!==0)throw new Y("proof_key_delete_failed",Z);return Q[0]===1}loadBinding(){let Q=new Uint8Array(S),Z=new BigUint64Array(1),$=this.symbols().ara_device_binding_read(H(Q),BigInt(Q.byteLength),H(Z));if($===1)return null;if($!==0)throw new Y("binding_read_failed",$);let X=Number(Z[0]);if(!Number.isSafeInteger(X)||X<1||X>Q.byteLength)throw new Y("invalid_binding");return Q.slice(0,X)}createBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");let Z=this.symbols().ara_device_binding_create(H(Q),BigInt(Q.byteLength));if(Z!==0)throw new Y("binding_create_failed",Z)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");let Z=this.symbols().ara_device_binding_update(H(Q),BigInt(Q.byteLength));if(Z!==0)throw new Y("binding_update_failed",Z)}deleteBinding(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_binding_delete(H(Q));if(Z!==0)throw new Y("binding_delete_failed",Z);return Q[0]===1}loadLegacyCredential(){let Q=new Uint8Array($0),Z=new BigUint64Array(1),$=this.symbols().ara_device_keychain_read(H(Q),BigInt(Q.byteLength),H(Z));if($===1)return null;if($!==0)throw new Y("legacy_credential_read_failed",$);let X=Number(Z[0]);if(!Number.isSafeInteger(X)||X<1||X>Q.byteLength)throw new Y("invalid_credential_record");try{let z=new TextDecoder("utf-8",{fatal:!0}).decode(Q.subarray(0,X));return q0(JSON.parse(z))}catch(z){if(z instanceof Y)throw z;throw new Y("invalid_credential_record")}}deleteLegacyCredential(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_keychain_delete(H(Q));if(Z!==0)throw new Y("legacy_credential_delete_failed",Z);return Q[0]===1}}function nQ(Q){let Z=Q.export({format:"jwk"});if(Z.crv!=="P-256"||typeof Z.x!=="string"||typeof Z.y!=="string")throw new Y("invalid_public_key");let $=Buffer.from(Z.x,"base64url"),X=Buffer.from(Z.y,"base64url");if($.byteLength!==32||X.byteLength!==32)throw new Y("invalid_public_key");let z=Buffer.concat([Buffer.of(4),$,X]).toString("base64url");if(!I(z))throw new Y("invalid_public_key");return z}function U0(){let Q=process.env.XDG_CONFIG_HOME?.trim()||C(Q0(),".config");r(Q);let Z=C(Q,"ara");return v(Z)?Z:C(Q,"reason")}class $Z{directory;constructor(Q=U0()){this.directory=Q}keyPath(){return C(this.directory,"local-device.key")}bindingPath(){return C(this.directory,"local-device.binding")}loadPrivateKeyObject(){let Q=this.keyPath();if(!F(Q))throw new Y("proof_key_read_failed");try{let Z=lQ(Q,"utf8");return oZ({key:Z,format:"pem"})}catch{throw new Y("proof_key_read_failed")}}loadPublicKey(){let Q=this.loadPrivateKeyObject(),Z=nZ(Q);return nQ(Z)}createFreshPublicKey(){ZQ(this.directory,{recursive:!0,mode:448});let{privateKey:Q,publicKey:Z}=rZ("ec",{namedCurve:"P-256"}),$=Q.export({type:"pkcs8",format:"pem"}),X=this.keyPath();return XQ(X,$,{mode:384}),QQ(X,384),nQ(Z)}sign(Q){if(Q.byteLength<1||Q.byteLength>tQ)throw new Y("proof_sign_failed");let Z=this.loadPrivateKeyObject(),$;try{$=aZ("sha256",Q,Z)}catch{throw new Y("proof_sign_failed")}if(!QZ($))throw new Y("invalid_signature");return $.toString("base64url")}privateKeyIsNonExtractable(){return!1}deleteKey(){let Q=this.keyPath();if(!F(Q))return!1;return $Q(Q),!0}loadBinding(){let Q=this.bindingPath();if(!F(Q))return null;try{return new Uint8Array(lQ(Q))}catch{return null}}createBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");ZQ(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(F(Z))throw new Y("binding_create_failed");XQ(Z,Q,{mode:384}),QQ(Z,384)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");ZQ(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(!F(Z))throw new Y("binding_update_failed");let $=`${Z}.${tZ()}`;try{XQ($,Q,{mode:384,flag:"wx"}),QQ($,384),iZ($,Z)}finally{if(F($))$Q($)}}deleteBinding(){let Q=this.bindingPath();if(!F(Q))return!1;return $Q(Q),!0}loadLegacyCredential(){return null}deleteLegacyCredential(){return!1}}function WQ(){return rQ()==="darwin"?new ZZ:new $Z}var UQ=4;var d="macos-keychain-p256-v1",JZ=1,T0=`ARA-DEVICE-BINDING-V1
|
|
2
|
+
import{_g as c}from"./vm-hands-entry-lite-em388nee.js";var g={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"},g0=Object.values(g),jZ=new Set;function MQ(Q,Z){let $=Q[Z];if($?.trim())return $;let X=Q[g[Z]];if(X?.trim())jZ.add(g[Z]);return X}function KZ(Q,Z){return{[Q]:Z,[g[Q]]:Z}}import{basename as BZ}from"path";var i=["production","staging"],OZ="https://api.reasonmachines.com",kZ="https://staging-api.reasonmachines.com";var l={production:{api:"https://api.reasonmachines.ai",app:"https://reasonmachines.ai"},staging:{api:"https://staging-api.reasonmachines.ai",app:"https://staging.reasonmachines.ai"}},AZ=new Set(["ara-staging","reason-staging"]);function KQ(Q={}){let Z=MQ(Q.env??process.env,"REASON_CLI_CHANNEL")?.trim().toLowerCase();if(Z){if(i.includes(Z))return Z;throw Error(`Unknown Reason CLI channel: ${Z}`)}let $=BZ(Q.executablePath??process.execPath).toLowerCase();return AZ.has($)?"staging":"production"}function h(Q){return Q==="staging"?kZ:OZ}function y0(Q){return`${h(Q)}/mcp/ara`}var BQ={production:["https://api.ara.so",l.production.api],staging:["https://api-staging.ara.so",l.staging.api]};function jQ(Q){let Z;try{Z=new URL(Q).origin}catch{return Q}let $=i.find((X)=>BQ[X].includes(Z));return $?h($):Z}function p0(Q,Z){return Q===Z||jQ(Q)===jQ(Z)}function OQ(Q,Z){return i.some(($)=>BQ[$].includes(Q)&&Z===h($))}function u0(Q,Z){try{let $=new URL(Z);return!$.username&&!$.password&&($.origin===h(Q)||$.origin===l[Q].api)}catch{return!1}}function d0(Q){try{let Z=new URL(Q).hostname.replace(/^\[|\]$/g,"").toLowerCase();return Z==="localhost"||Z==="127.0.0.1"||Z==="::1"}catch{return!1}}import{randomBytes as xQ}from"crypto";import{chmodSync as LQ,closeSync as FQ,constants as _Z,linkSync as bQ,lstatSync as x,mkdirSync as fQ,openSync as NZ,readdirSync as P,readFileSync as TQ,readlinkSync as D,renameSync as N,rmdirSync as CQ,symlinkSync as _,unlinkSync as B}from"fs";import{createRequire as xZ}from"module";import{constants as LZ}from"os";import{basename as f,join as U,sep as bZ}from"path";import{existsSync as m,lstatSync as AQ,readdirSync as PZ,readFileSync as FZ,readlinkSync as TZ,realpathSync as DZ}from"fs";import{join as K,sep as RZ}from"path";function o(Q,...Z){let $=K(Q,"ara"),X=K(Q,"reason");if(!v($))return K(X,...Z);if(!m(X))return K($,...Z);return m(K($,...Z))&&!m(K(X,...Z))?K($,...Z):K(X,...Z)}function v(Q){try{let Z=AQ(Q);if(!Z.isSymbolicLink())return Z.isDirectory();return TZ(Q)!=="reason"&&m(Q)}catch{return!1}}function PQ(Q,Z=[]){if(!v(Q))return!1;let $;try{$=[Q,...PZ(Q,{withFileTypes:!0}).filter((X)=>X.isDirectory()).map((X)=>K(Q,X.name))]}catch{return!1}return $.some((X)=>["connect","connect-once"].filter((z)=>!Z.includes(K(X,z))).some((z)=>{let W=K(X,z,"worker.json");try{AQ(W)}catch{return!1}try{let q=JSON.parse(FZ(W,"utf8"))?.stateDirectory;if(typeof q!=="string")return!0;let V=(J,w)=>J===w||J.startsWith(w+RZ);return V(q,Q)||V(kQ(q),kQ(Q))}catch{return!0}}))}function kQ(Q){try{return DZ(Q)}catch{return Q}}var u=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"]),n=new Set(["local-device.proxy.json"]),fZ=new Set(["local-device.key","local-device.binding"]),DQ=new Map;function r(Q,Z,$){let X=U(Q,"ara");if(/[/\\]\.reason-ssh[/\\][^/\\]+[/\\]installer-home[/\\]\.config$/.test(Q))return{state:G(X)?.isDirectory()?"kept":"absent"};return EQ(X,U(Q,"reason"),{linkAlways:!0,kept:(z)=>PQ(z,$??[]),native:Z===void 0?pQ:()=>Z},$!==void 0)}function SQ(Q,...Z){return r(Q),o(Q,...Z)}function z1(Q,Z=process.platform){let $=U(Q,"Library","Logs");if(Z==="darwin")for(let X of[""," Staging"," Development"])EQ(U($,`Ara${X}`),U($,`Reason${X}`),{linkAlways:!1,kept:()=>!1,native:pQ});return U($,"Reason")}var IQ="config_rename_unavailable:busy";function EQ(Q,Z,$,X=!1){let z=X?void 0:DQ.get(Q);if(z)return z;let W;try{W=CZ(Q,Z,$)}catch(q){let V=`config_rename_unavailable:${A(q)??"failed"}`;try{return{state:G(Q)?.isDirectory()?"kept":"absent",problem:V}}catch{return{state:"kept",problem:V}}}if(!(W.state==="absent"&&$.linkAlways)&&W.problem!==IQ&&!(W.state==="kept"&&!W.problem))DQ.set(Q,W);return W}function CZ(Q,Z,$){IZ(Z,$.native);let X=!1;for(let z=0;z<8;z+=1){let W=G(Q);if(W?.isSymbolicLink())return D(Q)===f(Z)?{state:X?"renamed":"linked"}:{state:"kept"};if(!W){if(p(Z))M(()=>B(Z),"ENOENT");if(!(X||$.linkAlways)||!R(Z))return{state:"absent"};let J=b(Z,"link");_(f(Z),J);try{M(()=>N(J,Q),"EISDIR","ENOTEMPTY","EEXIST","ENOTDIR")}finally{M(()=>B(J),"ENOENT")}continue}if(!W.isDirectory())return{state:"absent"};if($.kept(Q))return RQ(Z),{state:"kept"};let q=$.native();if(!q)return RQ(Z),{state:"kept",problem:"config_rename_unavailable:no_native"};let V=EZ(q,Q);if(!V)return{state:"kept",problem:IQ};try{if(x(Q).isSymbolicLink())continue;let J=SZ(q,Q,Z);if(J)return{state:"kept",problem:J};X=!0}finally{V()}}throw Object.assign(Error("legacy directory rename did not settle"),{code:"unsettled"})}function SZ(Q,Z,$){let X=G($);if(!X||p($)){if(!X)_(f($),$);try{Q.exchange(Z,$)}catch(J){if(p($))M(()=>B($),"ENOENT");return`config_rename_unavailable:${A(J)??"exchange_failed"}`}return null}if(!X.isDirectory())return"config_rename_unavailable:ENOTDIR";if(X.dev!==x(Z).dev)return"config_rename_unavailable:EXDEV";let z=[b($,"probe"),b($,"probe")];try{_("a",z[0]),_("b",z[1]),Q.exchange(z[0],z[1])}catch(J){return`config_rename_unavailable:${A(J)??"exchange_failed"}`}finally{for(let J of z)M(()=>B(J),"ENOENT")}let W=yQ($);for(let J of fZ){let w=G(U($,J)),j=G(U(Z,J));if(w&&j&&w.ino!==j.ino)fQ(`${W}-replaced`,{mode:448,recursive:!0}),N(U($,J),U(`${W}-replaced`,J))}let q={linked:new Map,unitsKept:new Set};gQ(Z,$,"",q);let V=b($,"rename");_(f($),V);try{Q.exchange(Z,V)}catch(J){return M(()=>B(V),"ENOENT"),`config_rename_unavailable:${A(J)??"exchange_failed"}`}return hQ(V,$,q,W),null}function t(Q){return Q===""||!Q.includes(bZ)}function gQ(Q,Z,$,X){let z=t($)&&y(U(Z,$),U(Q,$));if(z)X.unitsKept.add($);for(let W of P(U(Q,$))){if(z&&(u.has(W)||n.has(W)))continue;let q=U($,W),V=U(Q,q),J=U(Z,q),w=G(V);if(!w)continue;let j=G(J);if(w.isDirectory()){if(!j)M(()=>fQ(J,{mode:w.mode&4095}),"EEXIST"),LQ(J,w.mode&4095);if(R(J))gQ(Q,Z,q,X)}else if(!j){if(w.isSymbolicLink())M(()=>_(D(V),J),"EEXIST");else if(M(()=>bQ(V,J),"EEXIST","ENOENT"))X.linked.set(q,w.ino)}}}function IZ(Q,Z){let $;try{if(!R(Q))return;$=P(Q)}catch{return}for(let X of $){let z=/^\.(rename|link|probe|claim)-(\d+)-[0-9a-f]+$/.exec(X);if(!z)continue;let W=U(Q,X),q=G(W);if(!q)continue;if(!q.isDirectory()){if(!_Q(Number(z[2])))M(()=>B(W),"ENOENT");continue}let V=Z(),J=null;if(V){try{J=V.lock(W)}catch{continue}if(!J)continue}else if(_Q(Number(z[2])))continue;try{let w=b(Q,"claim");if(M(()=>N(W,w),"ENOENT"))hQ(w,Q,null,yQ(Q))}finally{J?.()}}}function hQ(Q,Z,$,X){for(let[z,W]of $?.linked??[])if(!G(U(Q,z))&&G(U(Z,z))?.ino===W)M(()=>B(U(Z,z)),"ENOENT");if(mQ(Q,Z,"",$),M(()=>CQ(Q),"ENOTEMPTY","EEXIST"))return;N(Q,X),LQ(X,448)}function mQ(Q,Z,$,X){let z=t($)&&(X?X.unitsKept.has($):y(U(Z,$),U(Q,$)));for(let W of P(U(Q,$))){let q=U($,W),V=U(Q,q),J=U(Z,q),w=x(V),j=G(J);if(j&&w.ino===j.ino&&w.dev===j.dev){B(V);continue}if(w.isFile()&&j?.isFile()&&X?.linked.get(q)===j.ino){N(V,J);continue}if(z&&(u.has(W)||n.has(W)))continue;if(!j){if(w.isFile()){if(M(()=>bQ(V,J),"EEXIST"))B(V)}else M(()=>N(V,J),"EEXIST","ENOTEMPTY");continue}if(w.isDirectory()&&j.isDirectory())mQ(Q,Z,q,X),M(()=>CQ(V),"ENOTEMPTY","EEXIST")}}function W1(Q){let Z=U(Q,"ara"),$=U(Q,"reason");if(!R(Z)||!R($))return null;let X=["",...P(Z,{withFileTypes:!0}).filter((z)=>z.isDirectory()&&!z.name.startsWith(".")).map((z)=>z.name)];for(let z of X){let W=U(Z,z),q=U($,z);if(!y(W,q)||!y(q,W))continue;if([...u,...n].some((J)=>a(U(W,J),U(q,J))===!1))return z}return null}function q1(Q){let Z=U(Q,"ara"),$=U(Q,"reason");if(!R(Z)||!R($))return null;let X=(z)=>{for(let W of P(U(Z,z))){let q=U(z,W);if(t(z)&&(W==="connect"||W==="connect-once"))continue;let V=x(U(Z,q)),J=G(U($,q));if(!J||V.ino===J.ino&&V.dev===J.dev)continue;if(V.isDirectory()&&J.isDirectory()&&!J.isSymbolicLink()){let w=X(q);if(w!==null)return w}else if(V.isSymbolicLink()||J.isSymbolicLink()){if(!(V.isSymbolicLink()&&J.isSymbolicLink()&&D(U(Z,q))===D(U($,q))))return q}else if(a(U(Z,q),U($,q))!==!0)return q}return null};return X("")}function a(Q,Z){let $=G(Q),X=G(Z);if(!$&&!X)return null;if(!$||!X||$.isDirectory()!==X.isDirectory())return!1;if($.ino===X.ino&&$.dev===X.dev)return!0;if($.isDirectory())return[...new Set([...P(Q),...P(Z)])].every((W)=>a(U(Q,W),U(Z,W))===!0);try{return TQ(Q).equals(TQ(Z))}catch{return!1}}function y(Q,Z){for(let $ of u)if(vQ(U(Q,$),U(Z,$)))return!0;return!1}function vQ(Q,Z){let $=G(Q);if(!$)return!1;let X=G(Z);if(!X)return!0;if($.isDirectory()){if(!X.isDirectory())return!0;return P(Q).some((z)=>vQ(U(Q,z),U(Z,z)))}if($.isSymbolicLink())return!X.isSymbolicLink()||D(Q)!==D(Z);return $.ino!==X.ino||$.dev!==X.dev}function RQ(Q){if(p(Q))M(()=>B(Q),"ENOENT")}function yQ(Q){return U(Q,`.pre-rename-${new Date().toISOString().replace(/[:.]/g,"-")}-${xQ(3).toString("hex")}`)}function p(Q){try{return x(Q).isSymbolicLink()&&D(Q)===f(Q)}catch{return!1}}function R(Q){let Z=G(Q);return Z!==null&&Z.isDirectory()}function EZ(Q,Z){for(let $=0;$<40;$+=1){let X=Q.lock(Z);if(X)return X;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,50)}return null}function b(Q,Z){return U(Q,`.${Z}-${process.pid}-${xQ(6).toString("hex")}`)}function _Q(Q){if(Q===process.pid)return!1;try{return process.kill(Q,0),!0}catch(Z){return A(Z)==="EPERM"}}function G(Q){try{return x(Q)}catch(Z){if(A(Z)==="ENOENT"||A(Z)==="ENOTDIR")return null;throw Z}}function M(Q,...Z){try{return Q(),!0}catch($){if(Z.includes(A($)??""))return!1;throw $}}function A(Q){return Q instanceof Error&&"code"in Q&&typeof Q.code==="string"?Q.code:void 0}var L,gZ=2,hZ=4,mZ=2,vZ=2,NQ=-100;function pQ(){if(L!==void 0)return L;if(L=null,process.platform!=="linux"&&process.platform!=="darwin")return null;let Q;try{Q=xZ(import.meta.url)("bun:ffi")}catch{return null}let Z=process.platform==="darwin",$=Z?"__error":"__errno_location",X=Z?["/usr/lib/libSystem.B.dylib"]:["libc.so.6",`libc.musl-${process.arch==="arm64"?"aarch64":"x86_64"}.so.1`],{FFIType:z}=Q;for(let W of X)try{let q=Z?"renamex_np":"renameat2",J=Q.dlopen(W,{flock:{args:[z.i32,z.i32],returns:z.i32},[$]:{args:[],returns:z.ptr},[q]:Z?{args:[z.ptr,z.ptr,z.u32],returns:z.i32}:{args:[z.i32,z.ptr,z.i32,z.ptr,z.u32],returns:z.i32}}).symbols,w=J[$]();if(w===null)continue;let j=(T)=>{let k=Q.read.i32(w),O=Object.entries(LZ.errno).find(([,E])=>E===k)?.[0]??`errno_${k}`;return Object.assign(Error(`${T} failed: ${O}`),{code:O})},HQ=(T)=>Buffer.from(`${T}\x00`,"utf8");return L={exchange(T,k){let O=HQ(T),E=HQ(k);if((Z?J[q](Q.ptr(O),Q.ptr(E),mZ):J[q](NQ,Q.ptr(O),NQ,Q.ptr(E),vZ))!==0)throw j("exchange")},lock(T){let k=NZ(T,_Z.O_RDONLY);if(J.flock(k,gZ|hZ)===0)return()=>FQ(k);let O=j("lock");if(FQ(k),O.code==="EWOULDBLOCK"||O.code==="EAGAIN")return null;throw O}},L}catch{}return null}import{createHmac as V0,createPublicKey as w0,randomBytes as G0,randomUUID as zZ,verify as H0}from"crypto";import{chmodSync as qQ,existsSync as WZ,mkdirSync as M0,readFileSync as j0,realpathSync as K0,renameSync as B0,statSync as O0,unlinkSync as k0,writeFileSync as A0}from"fs";import{basename as P0,dirname as YQ,isAbsolute as qZ,join as s,resolve as F0}from"path";var Y1=[Object.freeze({family:"ara",channel:"stable",applicationId:"so.ara.desktop"}),Object.freeze({family:"ara",channel:"staging",applicationId:"so.ara.desktop.staging"}),Object.freeze({family:"reason",channel:"stable",applicationId:"com.reasonmachines.desktop"}),Object.freeze({family:"reason",channel:"staging",applicationId:"com.reasonmachines.desktop.staging"})];var yZ="REASON_DESKTOP_RUNTIME",pZ="REASON_DESKTOP_RUNTIME_CHANNEL",uZ="REASON_DESKTOP_RUNTIME_INSTANCE_ID",dZ="REASON_DESKTOP_RUNTIME_WORKSPACE_SCOPE",M1={[yZ]:"ARA_DESKTOP_RUNTIME",[pZ]:"ARA_DESKTOP_RUNTIME_CHANNEL",[uZ]:"ARA_DESKTOP_RUNTIME_INSTANCE_ID",[dZ]:"ARA_DESKTOP_RUNTIME_WORKSPACE_SCOPE"};function uQ(Q){if(Q===void 0)return;if(!/^[a-f0-9]{64}$/.test(Q))throw Error("Invalid desktop workspace scope.");return Q}import{chmodSync as QQ,existsSync as F,mkdirSync as ZQ,readFileSync as lQ,realpathSync as lZ,renameSync as iZ,unlinkSync as $Q,writeFileSync as XQ}from"fs";import{createPrivateKey as oZ,createPublicKey as nZ,generateKeyPairSync as rZ,randomUUID as tZ,sign as aZ}from"crypto";import{createRequire as eZ}from"module";import{homedir as Q0,platform as rQ}from"os";import{dirname as Z0,join as C}from"path";import{existsSync as sZ}from"fs";import{join as cQ}from"path";var e="libara_device_keychain.dylib",dQ="libreason_device_keychain.dylib";class cZ extends Error{code;constructor(Q,Z){super(Z);this.code=Q;this.name="ManagedRuntimeError"}}function sQ(Q){let Z=cQ(Q,dQ);return sZ(Z)?Z:cQ(Q,e)}var iQ=1,$0=16384,S=65536,X0=128,z0=128,tQ=65536;class Y extends Error{code;nativeStatus;constructor(Q,Z){super(`Reason Device proof boundary failed (${Q}).${Z===void 0?"":` Native status: ${Z}.`}`);this.code=Q;this.nativeStatus=Z;this.name="LocalCredentialBoundaryError"}}function aQ(Q){if(Q.code==="proof_key_read_failed"&&Q.nativeStatus===-25300)return"proof_key_missing";switch(Q.nativeStatus){case-25308:return"keychain_interaction_required";case-25293:return"keychain_access_denied";case-25291:return"keychain_unavailable";default:return Q.code}}var zQ=null;function eQ(){if(!zQ)try{zQ=eZ(import.meta.url)("bun:ffi")}catch{throw new Y("native_boundary_unavailable")}return zQ}function W0(Q){if(typeof Q!=="string")return null;try{let Z=new URL(Q);if(Z.protocol!=="https:"&&Z.hostname!=="127.0.0.1"&&Z.hostname!=="localhost"&&Z.hostname!=="[::1]"&&Z.hostname!=="::1")return null;return Z.origin}catch{return null}}function q0(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new Y("invalid_credential_record");let Z=Q,$=W0(Z.apiOrigin);if(Z.version!==iQ||!$||typeof Z.orgId!=="string"||Z.orgId.length<1||Z.orgId.length>160||typeof Z.deviceId!=="string"||Z.deviceId.length<1||Z.deviceId.length>160||typeof Z.credential!=="string"||!/^(?:reason|ara)_dev_/.test(Z.credential)||Z.credential.length>4096)throw new Y("invalid_credential_record");return{version:iQ,apiOrigin:$,orgId:Z.orgId,deviceId:Z.deviceId,credential:Z.credential}}function J0(Q=process.execPath){let Z=Q;try{Z=lZ(Q)}catch{}return sQ(Z0(Z))}function H(Q){return eQ().ptr(Q)}function Y0(Q){if(!F(Q))throw new Y("native_boundary_unavailable");let{dlopen:Z,FFIType:$}=eQ();try{return Z(Q,{ara_device_configure_scope:{args:[$.ptr,$.u64],returns:$.i32},ara_device_key_load_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_create_fresh_public:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_sign:{args:[$.ptr,$.u64,$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_key_is_non_extractable:{args:[$.ptr],returns:$.i32},ara_device_key_delete:{args:[$.ptr],returns:$.i32},ara_device_binding_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_binding_create:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_update:{args:[$.ptr,$.u64],returns:$.i32},ara_device_binding_delete:{args:[$.ptr],returns:$.i32},ara_device_keychain_read:{args:[$.ptr,$.u64,$.ptr],returns:$.i32},ara_device_keychain_delete:{args:[$.ptr],returns:$.i32}})}catch(X){if(X instanceof Y)throw X;throw new Y("native_boundary_unavailable")}}function oQ(Q){return Buffer.from(Q).toString("base64url")}function I(Q){if(typeof Q!=="string"||!/^[A-Za-z0-9_-]{87}$/.test(Q))return!1;try{let Z=Buffer.from(Q,"base64url");return Z.byteLength===65&&Z[0]===4}catch{return!1}}function QZ(Q){if(Q.byteLength<8||Q.byteLength>72||Q[0]!==48)return!1;let Z=Q[1];return Z!==void 0&&Z<128&&Z+2===Q.byteLength}class ZZ{libraryPath;runtimePlatform;workspaceScope;library=null;constructor(Q=J0(),Z=rQ(),$){this.libraryPath=Q;this.runtimePlatform=Z;this.workspaceScope=$;uQ($)}symbols(){if(this.runtimePlatform!=="darwin")throw new Y("unsupported_platform");this.library??=Y0(this.libraryPath);let Q=new TextEncoder().encode(this.workspaceScope??""),Z=this.library.symbols.ara_device_configure_scope(H(Q.length?Q:new Uint8Array(1)),BigInt(Q.length));if(Z!==0)throw new Y("native_boundary_unavailable",Z);return this.library.symbols}publicKey(Q){let Z=new Uint8Array(X0),$=new BigUint64Array(1),X=Q==="load"?this.symbols().ara_device_key_load_public(H(Z),BigInt(Z.byteLength),H($)):this.symbols().ara_device_key_create_fresh_public(H(Z),BigInt(Z.byteLength),H($));if(X!==0)throw new Y(Q==="load"?"proof_key_read_failed":"proof_key_generation_failed",X);let z=Number($[0]);if(!Number.isSafeInteger(z)||z!==65)throw new Y("invalid_public_key");let W=oQ(Z.subarray(0,z));if(!I(W))throw new Y("invalid_public_key");return W}loadPublicKey(){return this.publicKey("load")}createFreshPublicKey(){return this.publicKey("create_fresh")}sign(Q){if(Q.byteLength<1||Q.byteLength>tQ)throw new Y("proof_sign_failed");let Z=new Uint8Array(z0),$=new BigUint64Array(1),X=this.symbols().ara_device_key_sign(H(Q),BigInt(Q.byteLength),H(Z),BigInt(Z.byteLength),H($));if(X!==0)throw new Y("proof_sign_failed",X);let z=Number($[0]);if(!Number.isSafeInteger(z)||z<1||z>Z.byteLength)throw new Y("invalid_signature");let W=Z.subarray(0,z);if(!QZ(W))throw new Y("invalid_signature");return oQ(W)}privateKeyIsNonExtractable(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_is_non_extractable(H(Q));if(Z!==0||Q[0]!==1)throw new Y("proof_key_read_failed",Z);return!0}deleteKey(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_key_delete(H(Q));if(Z!==0)throw new Y("proof_key_delete_failed",Z);return Q[0]===1}loadBinding(){let Q=new Uint8Array(S),Z=new BigUint64Array(1),$=this.symbols().ara_device_binding_read(H(Q),BigInt(Q.byteLength),H(Z));if($===1)return null;if($!==0)throw new Y("binding_read_failed",$);let X=Number(Z[0]);if(!Number.isSafeInteger(X)||X<1||X>Q.byteLength)throw new Y("invalid_binding");return Q.slice(0,X)}createBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");let Z=this.symbols().ara_device_binding_create(H(Q),BigInt(Q.byteLength));if(Z!==0)throw new Y("binding_create_failed",Z)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");let Z=this.symbols().ara_device_binding_update(H(Q),BigInt(Q.byteLength));if(Z!==0)throw new Y("binding_update_failed",Z)}deleteBinding(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_binding_delete(H(Q));if(Z!==0)throw new Y("binding_delete_failed",Z);return Q[0]===1}loadLegacyCredential(){let Q=new Uint8Array($0),Z=new BigUint64Array(1),$=this.symbols().ara_device_keychain_read(H(Q),BigInt(Q.byteLength),H(Z));if($===1)return null;if($!==0)throw new Y("legacy_credential_read_failed",$);let X=Number(Z[0]);if(!Number.isSafeInteger(X)||X<1||X>Q.byteLength)throw new Y("invalid_credential_record");try{let z=new TextDecoder("utf-8",{fatal:!0}).decode(Q.subarray(0,X));return q0(JSON.parse(z))}catch(z){if(z instanceof Y)throw z;throw new Y("invalid_credential_record")}}deleteLegacyCredential(){let Q=new Uint8Array(1),Z=this.symbols().ara_device_keychain_delete(H(Q));if(Z!==0)throw new Y("legacy_credential_delete_failed",Z);return Q[0]===1}}function nQ(Q){let Z=Q.export({format:"jwk"});if(Z.crv!=="P-256"||typeof Z.x!=="string"||typeof Z.y!=="string")throw new Y("invalid_public_key");let $=Buffer.from(Z.x,"base64url"),X=Buffer.from(Z.y,"base64url");if($.byteLength!==32||X.byteLength!==32)throw new Y("invalid_public_key");let z=Buffer.concat([Buffer.of(4),$,X]).toString("base64url");if(!I(z))throw new Y("invalid_public_key");return z}function U0(){let Q=process.env.XDG_CONFIG_HOME?.trim()||C(Q0(),".config");r(Q);let Z=C(Q,"ara");return v(Z)?Z:C(Q,"reason")}class $Z{directory;constructor(Q=U0()){this.directory=Q}keyPath(){return C(this.directory,"local-device.key")}bindingPath(){return C(this.directory,"local-device.binding")}loadPrivateKeyObject(){let Q=this.keyPath();if(!F(Q))throw new Y("proof_key_read_failed");try{let Z=lQ(Q,"utf8");return oZ({key:Z,format:"pem"})}catch{throw new Y("proof_key_read_failed")}}loadPublicKey(){let Q=this.loadPrivateKeyObject(),Z=nZ(Q);return nQ(Z)}createFreshPublicKey(){ZQ(this.directory,{recursive:!0,mode:448});let{privateKey:Q,publicKey:Z}=rZ("ec",{namedCurve:"P-256"}),$=Q.export({type:"pkcs8",format:"pem"}),X=this.keyPath();return XQ(X,$,{mode:384}),QQ(X,384),nQ(Z)}sign(Q){if(Q.byteLength<1||Q.byteLength>tQ)throw new Y("proof_sign_failed");let Z=this.loadPrivateKeyObject(),$;try{$=aZ("sha256",Q,Z)}catch{throw new Y("proof_sign_failed")}if(!QZ($))throw new Y("invalid_signature");return $.toString("base64url")}privateKeyIsNonExtractable(){return!1}deleteKey(){let Q=this.keyPath();if(!F(Q))return!1;return $Q(Q),!0}loadBinding(){let Q=this.bindingPath();if(!F(Q))return null;try{return new Uint8Array(lQ(Q))}catch{return null}}createBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");ZQ(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(F(Z))throw new Y("binding_create_failed");XQ(Z,Q,{mode:384}),QQ(Z,384)}updateBinding(Q){if(Q.byteLength<1||Q.byteLength>S)throw new Y("invalid_binding");ZQ(this.directory,{recursive:!0,mode:448});let Z=this.bindingPath();if(!F(Z))throw new Y("binding_update_failed");let $=`${Z}.${tZ()}`;try{XQ($,Q,{mode:384,flag:"wx"}),QQ($,384),iZ($,Z)}finally{if(F($))$Q($)}}deleteBinding(){let Q=this.bindingPath();if(!F(Q))return!1;return $Q(Q),!0}loadLegacyCredential(){return null}deleteLegacyCredential(){return!1}}function WQ(){return rQ()==="darwin"?new ZZ:new $Z}var UQ=4;var d="macos-keychain-p256-v1",JZ=1,T0=`ARA-DEVICE-BINDING-V1
|
|
3
3
|
`;function D0(Q){return Q===void 0||typeof Q==="number"&&Number.isInteger(Q)&&Q>=1&&Q<=4}function YZ(Q={},Z=c()){let $=KQ({env:{...process.env,...Q}}),X=Q.XDG_CONFIG_HOME?.trim()||s(Z,".config");return SQ(X,...$==="staging"?["staging"]:[])}function VQ(Q={},Z=c()){return s(YZ(Q,Z),"local-device.json")}function UZ(Q={},Z=c()){return s(YZ(Q,Z),"local-daemon.json")}function wQ(Q,Z){M0(YQ(Q),{recursive:!0,mode:448}),qQ(YQ(Q),448);let $=`${Q}.${process.pid}.${zZ()}.tmp`;try{A0($,`${JSON.stringify(Z,null,2)}
|
|
4
4
|
`,{mode:384,flag:"wx"}),qQ($,384),B0($,Q),qQ(Q,384)}finally{if(WZ($))k0($)}return Q}function GQ(Q){if(!WZ(Q))return null;try{return JSON.parse(j0(Q,"utf8"))}catch{return null}}function JQ(Q,Z,$){try{Q.onCredentialLifecycle?.({event:Z,...$?{reasonCode:$}:{}})}catch{}}function R0(Q){if(!Array.isArray(Q))return null;let Z=[];for(let $ of Q){if(!$||typeof $!=="object")return null;let X=$;if(typeof X.id!=="string"||typeof X.label!=="string"||typeof X.path!=="string"||typeof X.pathFingerprint!=="string"||!X.permissions||typeof X.permissions.read!=="boolean"||typeof X.permissions.write!=="boolean"||typeof X.permissions.execute!=="boolean"||typeof X.permissions.discover_environment!=="boolean"||typeof X.permissions.expose_mcp!=="boolean")return null;Z.push({id:X.id,label:X.label,path:X.path,pathFingerprint:X.pathFingerprint,permissions:X.permissions})}return Z}function VZ(Q,Z,$=[]){let X=Object.keys(Q);return Z.every((z)=>Object.hasOwn(Q,z))&&X.every((z)=>Z.includes(z)||$.includes(z))}function _0(Q){if(typeof Q!=="string")return null;try{let Z=new URL(Q);if(Z.protocol!=="https:"&&Z.hostname!=="127.0.0.1"&&Z.hostname!=="localhost")return null;return Z.origin}catch{return null}}function wZ(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let Z=Q,$=R0(Z.roots),X=_0(Z.apiOrigin);if(!X||typeof Z.orgId!=="string"||typeof Z.deviceId!=="string"||typeof Z.displayName!=="string"||typeof Z.registeredAt!=="string"||!D0(Z.handsSlots)||Z.worker!==void 0&&(!Z.worker||!/^[a-f0-9]{64}$/.test(Z.worker.configDigest)||!["persistent","ephemeral"].includes(Z.worker.lifetime)||!Number.isFinite(Date.parse(Z.worker.expiresAt)))||!$)return null;return{apiOrigin:X,orgId:Z.orgId,deviceId:Z.deviceId,displayName:Z.displayName,registeredAt:Z.registeredAt,...Z.handsSlots!==void 0?{handsSlots:Z.handsSlots}:{},...Z.worker!==void 0?{worker:Z.worker}:{},roots:$}}function N0(Q){return{...Q,credentialStorage:d}}function x0(Q){return{version:UQ,apiOrigin:Q.apiOrigin,orgId:Q.orgId,deviceId:Q.deviceId,devicePublicKey:Q.devicePublicKey,displayName:Q.displayName,registeredAt:Q.registeredAt,...Q.handsSlots!==void 0?{handsSlots:Q.handsSlots}:{},...Q.worker!==void 0?{worker:Q.worker}:{},roots:Q.roots.map((Z)=>({id:Z.id,label:Z.label,path:Z.path,pathFingerprint:Z.pathFingerprint,permissions:{read:Z.permissions.read,write:Z.permissions.write,execute:Z.permissions.execute,discover_environment:Z.permissions.discover_environment,expose_mcp:Z.permissions.expose_mcp}})),credentialStorage:d}}function GZ(Q){if(!Q||typeof Q!=="object"||Array.isArray(Q))return null;let Z=Q;if(!VZ(Z,["version","apiOrigin","orgId","deviceId","devicePublicKey","displayName","registeredAt","roots","credentialStorage"],["handsSlots","worker"]))return null;let $=wZ(Z);if(!$||Z.version!==UQ||Z.credentialStorage!==d||!I(Z.devicePublicKey))return null;return{version:UQ,...$,devicePublicKey:Z.devicePublicKey,credentialStorage:d}}function HZ(Q){return new TextEncoder().encode(`${T0}${JSON.stringify(x0(Q))}`)}function L0(Q){let Z=Buffer.from(Q,"base64url");return w0({format:"jwk",key:{kty:"EC",crv:"P-256",x:Z.subarray(1,33).toString("base64url"),y:Z.subarray(33,65).toString("base64url")}})}function b0(Q,Z){let $={version:JZ,state:Q,signature:Z.sign(HZ(Q))};return new TextEncoder().encode(JSON.stringify($))}function MZ(Q){let Z;try{Z=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(Q))}catch{throw new Y("invalid_binding")}if(!Z||typeof Z!=="object"||Array.isArray(Z))throw new Y("invalid_binding");let $=Z;if(!VZ($,["version","state","signature"])||$.version!==JZ||typeof $.signature!=="string"||!/^[A-Za-z0-9_-]{10,128}$/.test($.signature))throw new Y("invalid_binding");let X=GZ($.state);if(!X)throw new Y("invalid_binding");let z=!1;try{z=H0("sha256",HZ(X),L0(X.devicePublicKey),Buffer.from($.signature,"base64url"))}catch{z=!1}if(!z)throw new Y("invalid_binding");return X}function f0(Q){let{credentialStorage:Z,...$}=Q;return $}function C0(Q){return Q instanceof Y?aQ(Q):"credential_boundary_failed"}function v1(Q=VQ(),Z={}){let $=GQ(Q),X=Z.proofStore??Z.credentialStore??WQ(),z=X.loadBinding();if(!z){if($&&typeof $==="object"&&!Array.isArray($)&&S0($))return null;if($!==null)throw new Y("invalid_binding");return null}let W=MZ(z),q=X.loadPublicKey();if(X.privateKeyIsNonExtractable(),q!==W.devicePublicKey)throw new Y("invalid_public_key");let V=GZ($);if(Z.repair!==!1&&(!V||JSON.stringify(V)!==JSON.stringify(W)))wQ(Q,W);return f0(W)}function S0(Q){let Z=Q,$=wZ(Q);if(!$)return null;if(Z.version===2){if(typeof Z.deviceCredential!=="string"||!/^(?:reason|ara)_dev_/.test(Z.deviceCredential)||Z.deviceCredential.length>4096)return null;return{state:$,credentialSource:"plaintext-v2"}}if(Z.version!==3||Z.credentialStorage!=="macos-keychain-v1"||"deviceCredential"in Z)return null;return{state:$,credentialSource:"keychain-v3"}}function y1(Q,Z=VQ(),$={}){let X=$.proofStore??$.credentialStore??WQ();JQ($,"credential.store_started");try{if(!I(Q.devicePublicKey)||X.loadPublicKey()!==Q.devicePublicKey)throw new Y("invalid_public_key");X.privateKeyIsNonExtractable();let z=N0(Q),W=X.loadBinding();if(W){let V=MZ(W);if(V.devicePublicKey!==Q.devicePublicKey||V.orgId!==Q.orgId||V.deviceId!==Q.deviceId||V.apiOrigin!==Q.apiOrigin&&!OQ(V.apiOrigin,Q.apiOrigin))throw new Y("invalid_binding")}let q=b0(z,X);if(W)X.updateBinding(q);else X.createBinding(q);return wQ(Z,z),JQ($,"credential.store_completed"),Z}catch(z){throw JQ($,"credential.store_failed",C0(z)),z}}function p1(Q=UZ()){let Z=GQ(Q);if(!Z||typeof Z!=="object")return null;let $=Z;if($.version!==1||typeof $.pid!=="number"||!Number.isInteger($.pid)||!["starting","connected","stopped","error"].includes($.state??"")||typeof $.startedAt!=="string"||$.lastHeartbeatAt!==void 0&&typeof $.lastHeartbeatAt!=="string"||$.lastUsedAt!==void 0&&typeof $.lastUsedAt!=="string"||$.organizationId!==void 0&&typeof $.organizationId!=="string"||$.organizationName!==void 0&&typeof $.organizationName!=="string"||$.organizationSlug!==void 0&&typeof $.organizationSlug!=="string"||$.error!==void 0&&typeof $.error!=="string"||$.reconnectingSince!==void 0&&typeof $.reconnectingSince!=="string"||$.workspace!==void 0&&typeof $.workspace!=="string")return null;return $}function u1(Q,Z=UZ()){return wQ(Z,Q)}var XZ=1;function I0(Q=VQ()){return s(YQ(Q),"local-device.proxy.json")}function d1(Q=I0()){let Z=GQ(Q);if(!Z||typeof Z!=="object"||Array.isArray(Z))return null;let $=Z;if($.version!==XZ||typeof $.url!=="string"||$.url.length===0||$.caFile!==void 0&&(typeof $.caFile!=="string"||!qZ($.caFile)))return null;return{version:XZ,url:$.url,...$.caFile?{caFile:$.caFile}:{}}}function c1(Q,Z={read:!0,write:!1,execute:!1,discover_environment:!1,expose_mcp:!1},$=G0(32)){let X=new Set,z=[];for(let W of Q){let q=K0(qZ(W)?W:F0(W));if(!O0(q).isDirectory())throw Error(`Local execution root is not a directory: ${W}`);if(X.has(q))continue;X.add(q),z.push({id:zZ(),label:P0(q)||q,path:q,pathFingerprint:V0("sha256",$).update(q).digest("hex"),permissions:{...Z}})}if(z.length===0)throw Error("At least one explicit local execution root is required.");return z}
|
|
5
5
|
export{MQ as Be,KZ as Ce,i as De,KQ as Ee,h as Fe,y0 as Ge,jQ as He,p0 as Ie,OQ as Je,u0 as Ke,d0 as Le,r as Me,SQ as Ne,z1 as Oe,W1 as Pe,q1 as Qe,pQ as Re,cZ as Se,Y as Te,J0 as Ue,I as Ve,QZ as We,ZZ as Xe,$Z as Ye,VQ as Ze,UZ as _e,v1 as $e,y1 as af,p1 as bf,u1 as cf,XZ as df,d1 as ef,c1 as ff};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{mh as f}from"./vm-hands-entry-lite-yp315y25.js";var j=["Click browser element","Double click browser element","Type text","Clear browser field","Press key","Scroll browser element into view","Drag on computer","Select browser option","Check browser control","Uncheck browser control","Hover browser element","Focus browser element","Open browser page","Reload browser page","Go back in browser","Go forward in browser","Take browser screenshot"],$A=32;function R(x){if(!Array.isArray(x)||x.length>32||!x.every((A)=>typeof A==="string"&&j.includes(A)))return;return x.slice()}var KA="__ARA_PI_TOOL_CONFINED_SCRIPT_5f0c9e2a__",QA=262144;function Y(x){if(!x||typeof x!=="object"||Array.isArray(x))return!1;let A=x,W=Object.keys(A);return W.length===2&&W.includes("template")&&W.includes("quoteDepth")&&typeof A.template==="string"&&A.template.length<=262144&&!A.template.includes("\x00")&&A.template.split("__ARA_PI_TOOL_CONFINED_SCRIPT_5f0c9e2a__").length===2&&(A.quoteDepth===1||A.quoteDepth===2||A.quoteDepth===3)}var I=2,b=33554432,K=200000,D=4000000,_=240000,YA=`
|
|
3
|
+
...[executor output truncated]`,p=2000,k=1,i=16384,d=32768,y=128,LA=64,s=2097152,H=1,m=16384,c=32768,OA=8388608,n=1000,t=2500,r=2000,zA=t+r,o=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/,v=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,l={text_only:4430,invalid_json:4431,invalid_cancel_request:4432,invalid_sdk_response:4433,claim_required:4434,invalid_claim:4435,executor_mismatch:4436,stale_generation:4437,fence_conflict:4438,frame_too_large:4439,result_too_large:4440,progress_too_large:4441,terminal_cleanup_started:4442,job_journal_unavailable:4443},u=new Map(Object.entries(l).map(([x,A])=>[A,x]));function SA(x,A){return A||(u.get(x)??"")}var a=["cancelled","command_failed","duplicate_request_id","duplicate_result_evicted","invalid_repl_response","invalid_request","process_group_cleanup_unconfirmed","repl_failed","result_too_large","repl_response_too_large","repl_transport_failed","request_ledger_full","request_journal_unavailable","request_outcome_uncertain","maintenance_held","request_not_found","resume_digest_mismatch","spawn_failed","stale_generation","timeout"],e=new Set(a),w=16384,AA=200,xA=2000,WA=["maintenance_held","invalid_job_request","jobs_disabled","job_not_found","job_conflict","job_capacity","job_journal_unavailable","job_not_running","job_lease_expired","job_input_sequence","job_input_backpressure","stale_generation","pty_unsupported","job_mode_mismatch"];class G extends Error{code;constructor(x){super(x);this.name="HandsProtocolError",this.code=x}}function g(x){return new TextEncoder().encode(x).byteLength}function U(x){return typeof x==="object"&&x!==null&&!Array.isArray(x)}function B(x,A){let W=new Set(A);return Object.keys(x).every((N)=>W.has(N))}function M(x){return typeof x==="string"&&o.test(x)}function Z(x){return Number.isSafeInteger(x)&&Number(x)>=1}function J(x){return typeof x==="string"&&v.test(x)}function C(x){return typeof x==="string"&&x.startsWith("pty-")&&J(x.slice(4))}function z(x){return[x.cols,x.rows].every((A)=>Number.isSafeInteger(A)&&Number(A)>=1&&Number(A)<=n)}function E(x){if(typeof x!=="string"||x.length>Math.ceil(m/3)*4||x.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(x))return-1;let A=x.endsWith("==")?2:x.endsWith("=")?1:0;if(A&&"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(x[x.length-A-1])&(A===2?15:3))return-1;let N=x.length/4*3-A;return N<=m?N:-1}function S(x){return typeof x==="string"&&/^[0-9a-f]{64}$/.test(x)}function $(x){if(g(x)>b)throw new G("frame_too_large");try{return JSON.parse(x)}catch{throw new G("invalid_json")}}function BA(x){let A=$(x);if(!U(A)||!B(A,["version","generation","id","tool","input","semanticDigest","lifecycleLeaseId","workspaceBefore"])||A.version!==I||!Z(A.generation)||!M(A.id)||!["bash","repl","resume","read","edit","write","pi_tool"].includes(String(A.tool))||!U(A.input)||A.lifecycleLeaseId!==void 0&&(A.tool!=="bash"||!J(A.lifecycleLeaseId))||A.workspaceBefore!==void 0&&(!(A.tool==="bash"||A.tool==="repl"||A.tool==="pi_tool"&&A.input.tool==="bash")||!U(A.workspaceBefore)||!B(A.workspaceBefore,["script"])||typeof A.workspaceBefore.script!=="string"||A.workspaceBefore.script.length>K))throw new G("invalid_request");let W=U(A.workspaceBefore)&&typeof A.workspaceBefore.script==="string"?{workspaceBefore:{script:A.workspaceBefore.script}}:{};if(A.tool==="bash"){if(!B(A.input,["script","retainBackground","machineSdk"])||typeof A.input.script!=="string"||A.input.script.length>K||A.input.retainBackground!==void 0&&A.input.retainBackground!==!0||A.input.machineSdk!==void 0&&A.input.machineSdk!==!0||A.semanticDigest!==void 0&&!S(A.semanticDigest))throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"bash",input:{script:A.input.script,...A.input.retainBackground===!0?{retainBackground:!0}:{},...A.input.machineSdk===!0?{machineSdk:!0}:{}},...A.semanticDigest===void 0?{}:{semanticDigest:A.semanticDigest},...A.lifecycleLeaseId===void 0?{}:{lifecycleLeaseId:A.lifecycleLeaseId},...W}}if(A.tool==="resume"){if(A.semanticDigest!==void 0||!B(A.input,["semanticDigest"])||!S(A.input.semanticDigest))throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"resume",input:{semanticDigest:A.input.semanticDigest}}}if(A.tool==="repl"){if(!B(A.input,["code"])||typeof A.input.code!=="string"||A.input.code.length>K||A.semanticDigest!==void 0)throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"repl",input:{code:A.input.code},...W}}if(A.tool==="pi_tool"){let N=A.semanticDigest===void 0?GA(A.input):null;if(!N)throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"pi_tool",input:N,...W}}if(A.tool==="read"){if(!B(A.input,["path","offset","limit"])||typeof A.input.path!=="string"||A.input.path.length<1||A.input.path.length>K||A.semanticDigest!==void 0||A.input.offset!==void 0&&(!Number.isSafeInteger(A.input.offset)||Number(A.input.offset)<1)||A.input.limit!==void 0&&(!Number.isSafeInteger(A.input.limit)||Number(A.input.limit)<1||Number(A.input.limit)>2000))throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"read",input:{path:A.input.path,...A.input.offset===void 0?{}:{offset:Number(A.input.offset)},...A.input.limit===void 0?{}:{limit:Number(A.input.limit)}}}}if(A.tool==="edit"){if(!B(A.input,["path","edits"])||typeof A.input.path!=="string"||A.input.path.length<1||!Array.isArray(A.input.edits)||A.input.edits.length<1||A.input.edits.length>128||A.semanticDigest!==void 0)throw new G("invalid_request");let N=A.input.path.length,X=[];for(let V of A.input.edits){if(!U(V)||!B(V,["oldText","newText"])||typeof V.oldText!=="string"||V.oldText.length<1||typeof V.newText!=="string")throw new G("invalid_request");if(N+=V.oldText.length+V.newText.length,N>D)throw new G("invalid_request");X.push({oldText:V.oldText,newText:V.newText})}return{version:I,generation:A.generation,id:A.id,tool:"edit",input:{path:A.input.path,edits:X}}}if(A.tool!=="write"||!B(A.input,["path","content"])||typeof A.input.path!=="string"||A.input.path.length<1||typeof A.input.content!=="string"||A.input.path.length+A.input.content.length>D||A.semanticDigest!==void 0)throw new G("invalid_request");return{version:I,generation:A.generation,id:A.id,tool:"write",input:{path:A.input.path,content:A.input.content}}}function L(x){return x===void 0||typeof x==="number"&&Number.isFinite(x)}function GA(x){let A=x.args;if(!B(x,["tool","args"])||!U(A))return null;if(x.tool==="bash")return B(A,["command","timeout"])&&typeof A.command==="string"&&A.command.length<=K&&L(A.timeout)?{tool:"bash",args:{command:A.command,...A.timeout===void 0?{}:{timeout:Number(A.timeout)}}}:null;if(typeof A.path!=="string"||A.path.length>K)return null;if(x.tool==="read")return B(A,["path","offset","limit"])&&L(A.offset)&&L(A.limit)?{tool:"read",args:{path:A.path,...A.offset===void 0?{}:{offset:Number(A.offset)},...A.limit===void 0?{}:{limit:Number(A.limit)}}}:null;if(x.tool==="write")return B(A,["path","content"])&&typeof A.content==="string"&&A.path.length+A.content.length<=D?{tool:"write",args:{path:A.path,content:A.content}}:null;if(x.tool!=="edit"||!B(A,["path","edits"])||!Array.isArray(A.edits))return null;let W=A.path.length,N=[];for(let X of A.edits){if(!U(X)||!B(X,["oldText","newText"])||typeof X.oldText!=="string"||typeof X.newText!=="string")return null;if(W+=X.oldText.length+X.newText.length,W>D)return null;N.push({oldText:X.oldText,newText:X.newText})}return{tool:"edit",args:{path:A.path,edits:N}}}function NA(x){if(!U(x))return null;if("thrown"in x)return B(x,["thrown"])&&typeof x.thrown==="string"?{thrown:x.thrown}:null;let A=x.structuredContent;if(!B(x,["content","details","structuredContent","isError"])||!Array.isArray(x.content)||x.isError!==void 0&&x.isError!==!0||A!==void 0&&(!U(A)||!B(A,["output","truncated","full_output_path","exit_code","wall_time_seconds"])||typeof A.output!=="string"||typeof A.truncated!=="boolean"||A.full_output_path!==void 0&&typeof A.full_output_path!=="string"||typeof A.exit_code!=="number"||typeof A.wall_time_seconds!=="number"))return null;let W=[];for(let N of x.content)if(U(N)&&N.type==="text"&&B(N,["type","text"])&&typeof N.text==="string")W.push({type:"text",text:N.text});else if(U(N)&&N.type==="image"&&B(N,["type","data","mimeType"])&&typeof N.data==="string"&&typeof N.mimeType==="string")W.push({type:"image",data:N.data,mimeType:N.mimeType});else return null;return{content:W,...x.details===void 0?{}:{details:x.details},...U(A)?{structuredContent:{output:String(A.output),truncated:A.truncated===!0,...typeof A.full_output_path==="string"?{full_output_path:A.full_output_path}:{},exit_code:Number(A.exit_code),wall_time_seconds:Number(A.wall_time_seconds)}}:{},...x.isError===!0?{isError:!0}:{}}}function UA(x){let A=$(x);if(!U(A)||!B(A,["version","generation","id","ok","exitCode","stdout","stderr","cwd","error","resumed","browserActions","automaticProgressImage","piToolOutcome","workerElapsedMs","environmentWaitMs","workspaceBefore"])||A.version!==I||!Z(A.generation)||!M(A.id)||typeof A.ok!=="boolean"||!Number.isSafeInteger(A.exitCode)||Number(A.exitCode)<0||Number(A.exitCode)>255||typeof A.stdout!=="string"||A.stdout.length>_||typeof A.stderr!=="string"||A.stderr.length>_||A.cwd!==void 0&&(typeof A.cwd!=="string"||A.cwd.length<1||A.cwd.length>4096||!A.cwd.startsWith("/")||A.cwd.includes("\x00"))||A.error!==void 0&&(typeof A.error!=="string"||A.error.length<1||A.error.length>p||!e.has(A.error))||A.browserActions!==void 0&&!R(A.browserActions)||A.automaticProgressImage!==void 0&&(A.automaticProgressImage!==!0||!A.ok)||A.resumed!==void 0&&A.resumed!==!0||A.workerElapsedMs!==void 0&&(!Number.isSafeInteger(A.workerElapsedMs)||Number(A.workerElapsedMs)<0)||A.environmentWaitMs!==void 0&&(!Number.isSafeInteger(A.environmentWaitMs)||Number(A.environmentWaitMs)<0)||A.workspaceBefore!==void 0&&!h(A.workspaceBefore)||A.ok&&(A.exitCode!==0||A.error!==void 0)||!A.ok&&A.exitCode===0)throw new G("invalid_result");let W=A.piToolOutcome===void 0?void 0:NA(A.piToolOutcome);if(W===null||W&&!A.ok)throw new G("invalid_result");return{version:I,generation:A.generation,id:A.id,ok:A.ok,exitCode:Number(A.exitCode),stdout:A.stdout,stderr:A.stderr,...typeof A.cwd==="string"?{cwd:A.cwd}:{},...A.browserActions!==void 0?{browserActions:R(A.browserActions)}:{},...typeof A.error==="string"?{error:A.error}:{},...A.automaticProgressImage===!0?{automaticProgressImage:!0}:{},...A.resumed===!0?{resumed:!0}:{},...W?{piToolOutcome:W}:{},...A.workerElapsedMs!==void 0?{workerElapsedMs:Number(A.workerElapsedMs)}:{},...A.environmentWaitMs!==void 0?{environmentWaitMs:Number(A.environmentWaitMs)}:{},...h(A.workspaceBefore)?{workspaceBefore:{exitCode:A.workspaceBefore.exitCode,stdout:A.workspaceBefore.stdout,stderr:A.workspaceBefore.stderr}}:{}}}function h(x){return U(x)&&B(x,["exitCode","stdout","stderr"])&&Number.isSafeInteger(x.exitCode)&&Number(x.exitCode)>=0&&Number(x.exitCode)<=255&&typeof x.stdout==="string"&&x.stdout.length<=w&&typeof x.stderr==="string"&&x.stderr.length<=w}function FA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","id","sequence","stdout","stderr"])||A.type!=="progress"||A.version!==I||!Z(A.generation)||!M(A.id)||!Number.isSafeInteger(A.sequence)||Number(A.sequence)<1||typeof A.stdout!=="string"||A.stdout.length>_||typeof A.stderr!=="string"||A.stderr.length>_)throw new G("invalid_progress");return{type:"progress",version:I,generation:Number(A.generation),id:A.id,sequence:Number(A.sequence),stdout:A.stdout,stderr:A.stderr}}function IA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","fenceId","executorLaunchId","requestCancelVersion","managedJobsVersion","browserRunEnvelopeVersion","terminalCleanupVersion","guestMemoryVersion","guestMemoryDiagnosticsVersion","piToolsVersion","piToolsConfinement","backgroundBashVersion","machineSdkVersion","executionTimingVersion","environmentWaitVersion","workspaceBeforeVersion"])||A.type!=="claim"||A.version!==I||!Z(A.generation)||!J(A.fenceId)||!J(A.executorLaunchId)||A.requestCancelVersion!==void 0&&A.requestCancelVersion!==1||A.managedJobsVersion!==void 0&&A.managedJobsVersion!==k||A.guestMemoryVersion!==void 0&&A.guestMemoryVersion!==1||A.guestMemoryDiagnosticsVersion!==void 0&&(A.guestMemoryDiagnosticsVersion!==1||A.guestMemoryVersion!==1)||A.terminalCleanupVersion!==void 0&&A.terminalCleanupVersion!==1||A.browserRunEnvelopeVersion!==void 0&&A.browserRunEnvelopeVersion!==1||A.piToolsVersion!==void 0&&A.piToolsVersion!==1||A.piToolsConfinement!==void 0&&(!Y(A.piToolsConfinement)||A.piToolsVersion!==1)||A.backgroundBashVersion!==void 0&&A.backgroundBashVersion!==1||A.machineSdkVersion!==void 0&&A.machineSdkVersion!==1||A.executionTimingVersion!==void 0&&A.executionTimingVersion!==1||A.environmentWaitVersion!==void 0&&(A.environmentWaitVersion!==1||A.executionTimingVersion!==1)||A.workspaceBeforeVersion!==void 0&&A.workspaceBeforeVersion!==1)throw new G("invalid_claim");return{type:"claim",version:I,generation:A.generation,fenceId:A.fenceId,executorLaunchId:A.executorLaunchId,...A.requestCancelVersion===1?{requestCancelVersion:1}:{},...A.managedJobsVersion===1?{managedJobsVersion:1}:{},...A.guestMemoryVersion===1?{guestMemoryVersion:1}:{},...A.guestMemoryDiagnosticsVersion===1?{guestMemoryDiagnosticsVersion:1}:{},...A.terminalCleanupVersion===1?{terminalCleanupVersion:1}:{},...A.browserRunEnvelopeVersion===1?{browserRunEnvelopeVersion:1}:{},...A.piToolsVersion===1?{piToolsVersion:1}:{},...Y(A.piToolsConfinement)?{piToolsConfinement:{template:A.piToolsConfinement.template,quoteDepth:A.piToolsConfinement.quoteDepth}}:{},...A.backgroundBashVersion===1?{backgroundBashVersion:1}:{},...A.machineSdkVersion===1?{machineSdkVersion:1}:{},...A.executionTimingVersion===1?{executionTimingVersion:1}:{},...A.environmentWaitVersion===1?{environmentWaitVersion:1}:{},...A.workspaceBeforeVersion===1?{workspaceBeforeVersion:1}:{}}}function XA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","fenceId","executorLaunchId","workerVersion","workerArtifactSha256","requestCancelVersion","managedJobsVersion","lifecycleVersion","browserRunEnvelopeVersion","terminalCleanupVersion","guestMemoryVersion","guestMemoryDiagnosticsVersion","piToolsVersion","piToolsConfinementVersion","backgroundBashVersion","machineSdkVersion","executionTimingVersion","environmentWaitVersion","workspaceBeforeVersion"])||A.lifecycleVersion!==void 0&&A.lifecycleVersion!==1||A.workspaceBeforeVersion!==void 0&&A.workspaceBeforeVersion!==1||A.piToolsVersion!==void 0&&A.piToolsVersion!==1||A.piToolsConfinementVersion!==void 0&&(A.piToolsConfinementVersion!==1||A.piToolsVersion!==1)||A.backgroundBashVersion!==void 0&&A.backgroundBashVersion!==1||A.machineSdkVersion!==void 0&&A.machineSdkVersion!==1||A.executionTimingVersion!==void 0&&A.executionTimingVersion!==1||A.environmentWaitVersion!==void 0&&(A.environmentWaitVersion!==1||A.executionTimingVersion!==1)||A.guestMemoryVersion!==void 0&&A.guestMemoryVersion!==1||A.guestMemoryDiagnosticsVersion!==void 0&&(A.guestMemoryDiagnosticsVersion!==1||A.guestMemoryVersion!==1)||A.terminalCleanupVersion!==void 0&&A.terminalCleanupVersion!==1||A.browserRunEnvelopeVersion!==void 0&&A.browserRunEnvelopeVersion!==1||A.type!=="claim_ack"||A.version!==I||!Z(A.generation)||!J(A.fenceId)||!J(A.executorLaunchId)||!Number.isSafeInteger(A.workerVersion)||Number(A.workerVersion)<1||!S(A.workerArtifactSha256)||A.requestCancelVersion!==void 0&&A.requestCancelVersion!==1||A.managedJobsVersion!==void 0&&A.managedJobsVersion!==k)throw new G("invalid_claim_ack");return{type:"claim_ack",...A.guestMemoryVersion===1?{guestMemoryVersion:1}:{},...A.guestMemoryDiagnosticsVersion===1?{guestMemoryDiagnosticsVersion:1}:{},...A.terminalCleanupVersion===1?{terminalCleanupVersion:1}:{},...A.browserRunEnvelopeVersion===1?{browserRunEnvelopeVersion:1}:{},...A.lifecycleVersion===1?{lifecycleVersion:1}:{},...A.piToolsVersion===1?{piToolsVersion:1}:{},...A.piToolsConfinementVersion===1?{piToolsConfinementVersion:1}:{},...A.backgroundBashVersion===1?{backgroundBashVersion:1}:{},...A.machineSdkVersion===1?{machineSdkVersion:1}:{},...A.executionTimingVersion===1?{executionTimingVersion:1}:{},...A.environmentWaitVersion===1?{environmentWaitVersion:1}:{},...A.workspaceBeforeVersion===1?{workspaceBeforeVersion:1}:{},version:I,generation:A.generation,fenceId:A.fenceId,executorLaunchId:A.executorLaunchId,workerVersion:Number(A.workerVersion),workerArtifactSha256:A.workerArtifactSha256,...A.requestCancelVersion===1?{requestCancelVersion:1}:{},...A.managedJobsVersion===1?{managedJobsVersion:1}:{}}}function TA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","id","jobId","action","input"])||A.type!=="job"||A.version!==I||!Z(A.generation)||!M(A.id)||!M(A.jobId)||!U(A.input))throw new G("invalid_job_request");let W=A.input,N=Number.isSafeInteger(W.leaseExpiresAtMs)&&Number(W.leaseExpiresAtMs)>0,X=Number.isSafeInteger(W.sequence)&&Number(W.sequence)>=1;if(!(A.action==="start"?W.mode==="pty"?B(W,["mode","cols","rows","leaseExpiresAtMs"])&&C(A.jobId)&&z(W)&&N:B(W,["script","leaseExpiresAtMs"])&&typeof W.script==="string"&&W.script.length<=K&&N:A.action==="inspect"?B(W,["after"])&&Number.isSafeInteger(W.after)&&Number(W.after)>=0:A.action==="input"?"dataBase64"in W?B(W,["sequence","dataBase64"])&&C(A.jobId)&&X&&E(W.dataBase64)>0:B(W,["sequence","data","eof"])&&X&&typeof W.data==="string"&&W.data.length<=i&&typeof W.eof==="boolean":A.action==="resize"?B(W,["sequence","cols","rows"])&&C(A.jobId)&&X&&z(W):A.action==="renew"?B(W,["leaseExpiresAtMs"])&&N:A.action==="cancel"&&B(W,[])))throw new G("invalid_job_request");return A}function MA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","id","ok","job","error"])||A.type!=="job_result"||A.version!==I||!Z(A.generation)||!M(A.id))throw new G("invalid_job_result");if(A.ok===!1&&A.job===void 0&&typeof A.error==="string"&&WA.some((F)=>F===A.error))return A;let W=A.job;if(A.ok!==!0||A.error!==void 0||!U(W)||!B(W,["jobId","state","startedAtMs","finishedAtMs","leaseExpiresAtMs","exitCode","inputSequence","output","firstCursor","nextCursor","truncated","process","environmentRevision","environmentSnapshotId","pty"])||!M(W.jobId)||!["starting","running","exited","cancelled","expired","uncertain"].includes(String(W.state))||!Number.isSafeInteger(W.startedAtMs)||Number(W.startedAtMs)<1||!Number.isSafeInteger(W.leaseExpiresAtMs)||Number(W.leaseExpiresAtMs)<1||W.finishedAtMs!==null&&(!Number.isSafeInteger(W.finishedAtMs)||Number(W.finishedAtMs)<Number(W.startedAtMs))||W.exitCode!==null&&(!Number.isSafeInteger(W.exitCode)||Number(W.exitCode)<0||Number(W.exitCode)>255)||!Number.isSafeInteger(W.inputSequence)||Number(W.inputSequence)<0||!Number.isSafeInteger(W.firstCursor)||Number(W.firstCursor)<1||!Number.isSafeInteger(W.nextCursor)||Number(W.nextCursor)<Number(W.firstCursor)-1||typeof W.truncated!=="boolean"||!Array.isArray(W.output)||W.output.length>y)throw new G("invalid_job_result");if(W.environmentRevision===void 0!==(W.environmentSnapshotId===void 0)||W.environmentRevision!==void 0&&(!Number.isSafeInteger(W.environmentRevision)||Number(W.environmentRevision)<1||!J(W.environmentSnapshotId)))throw new G("invalid_job_result");let N=Number(W.firstCursor)-1,X=0;for(let F of W.output){if(!U(F)||!B(F,["cursor","stream","text"])||!Number.isSafeInteger(F.cursor)||Number(F.cursor)<=N||Number(F.cursor)>Number(W.nextCursor)||!["stdout","stderr"].includes(String(F.stream))||typeof F.text!=="string")throw new G("invalid_job_result");X+=F.text.length,N=Number(F.cursor)}if(X>d)throw new G("invalid_job_result");let V=W.state==="starting"||W.state==="running";if(V&&(W.finishedAtMs!==null||W.exitCode!==null)||!V&&W.finishedAtMs===null||W.state==="uncertain"&&W.exitCode!==null||W.state==="exited"&&W.exitCode===null||W.state==="cancelled"&&W.exitCode!==130||W.state==="expired"&&W.exitCode!==124)throw new G("invalid_job_result");if(W.process!==void 0){let F=W.process;if(!U(F)||!B(F,["pid","processGroupId","executorLaunchId"])||!Number.isSafeInteger(F.pid)||Number(F.pid)<1||F.processGroupId!==F.pid||!J(F.executorLaunchId)||!["starting","running"].includes(String(W.state)))throw new G("invalid_job_result")}if(W.pty!==void 0){let F=W.pty;if(!U(F)||!B(F,["version","cols","rows","output","cleanup"])||F.version!==H||!C(W.jobId)||!z(F)||W.output.length!==0||!Array.isArray(F.output)||F.output.length>y||(V?F.cleanup!=="pending":W.state==="uncertain"?F.cleanup!=="unconfirmed":F.cleanup!=="confirmed")||W.state==="running"&&(W.process===void 0||W.environmentRevision===void 0))throw new G("invalid_job_result");let T=Number(W.firstCursor)-1,P=0;for(let Q of F.output){if(!U(Q)||!B(Q,["cursor","dataBase64"])||!Number.isSafeInteger(Q.cursor)||Number(Q.cursor)<=T||Number(Q.cursor)>Number(W.nextCursor))throw new G("invalid_job_result");let q=E(Q.dataBase64);if(q<=0||(P+=q)>c)throw new G("invalid_job_result");T=Number(Q.cursor)}}return A}function qA(x){if(g(x)>s)throw new G("frame_too_large");let A=$(x);if(!U(A)||!B(A,["version","sessionId","operationId","runId","deviceId","rootId","workspace","binding","targetRevision","rootGrantRevision","generation","fenceId","executorLaunchId","job"])||A.version!==H||![A.sessionId,A.operationId,A.runId].every(M)||![A.deviceId,A.rootId,A.fenceId,A.executorLaunchId].every(J)||!Z(A.generation)||!Number.isSafeInteger(A.rootGrantRevision)||Number(A.rootGrantRevision)<1||!["workspace_source","mcp_control"].includes(String(A.binding))||!Number.isSafeInteger(A.targetRevision)||Number(A.targetRevision)<0||A.binding==="workspace_source"&&A.targetRevision!==0||!U(A.workspace))throw new G("invalid_pty_receipt");if(!f(A.workspace))throw new G("invalid_pty_receipt");let W=MA(JSON.stringify({type:"job_result",version:I,generation:A.generation,id:A.operationId,ok:!0,job:A.job}));if(!W.ok||!W.job.pty||W.job.pty.output.length!==0||W.job.process&&W.job.process.executorLaunchId!==A.executorLaunchId)throw new G("invalid_pty_receipt");return A}function yA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","id","targetId"])||A.type!=="cancel_request"||A.version!==I||!Z(A.generation)||!M(A.id)||!M(A.targetId))throw new G("invalid_cancel_request");return A}function mA(x){let A=$(x);if(!U(A)||!B(A,["type","version","generation","id","targetId","status"])||A.type!=="cancel_ack"||A.version!==I||!Z(A.generation)||!M(A.id)||!M(A.targetId)||!["cancelled","settled","not_found","unsupported","unconfirmed"].includes(String(A.status)))throw new G("invalid_cancel_ack");return A}function wA(x){let A=JSON.stringify(x);return BA(A),A}function hA(x){let A=JSON.stringify(x);return UA(A),A}function fA(x){let A=JSON.stringify(x);return FA(A),A}function kA(x){let A=JSON.stringify(x);return IA(A),A}function HA(x){let A=JSON.stringify(x);return XA(A),A}function O(x){return typeof x==="string"&&x.length>=1&&x.length<=AA&&!x.includes("\x00")}function VA(x){let A=["type","version","generation","id","jobRequestId","verb"];if(x.verb==="help")return B(x,A)?{verb:"help"}:null;if(x.verb==="describe"||x.verb==="namespace")return B(x,[...A,"name"])&&O(x.name)?{verb:x.verb,name:x.name}:null;if(x.verb==="search"){let W=x.args;if(!B(x,[...A,"query","args"])||typeof x.query!=="string"||x.query.trim().length<1||x.query.length>xA)return null;if(W===void 0)return{verb:"search",query:x.query};if(!U(W)||!B(W,["namespace","limit"])||W.namespace!==void 0&&!O(W.namespace)||W.limit!==void 0&&(!Number.isSafeInteger(W.limit)||Number(W.limit)<1||Number(W.limit)>50))return null;return{verb:"search",query:x.query,args:{...typeof W.namespace==="string"?{namespace:W.namespace}:{},...W.limit===void 0?{}:{limit:Number(W.limit)}}}}if(x.verb!=="call"||!B(x,[...A,"name","args"])||!O(x.name)||!U(x.args)||JSON.stringify(x.args).length>K)return null;return{verb:"call",name:x.name,args:x.args}}function gA(x){let A=$(x);if(!U(A)||A.type!=="sdk_request"||A.version!==I||!Z(A.generation)||!M(A.id)||!M(A.jobRequestId))throw new G("invalid_sdk_request");let W=VA(A);if(!W)throw new G("invalid_sdk_request");return{type:"sdk_request",version:I,generation:Number(A.generation),id:A.id,jobRequestId:A.jobRequestId,...W}}function ZA(x){let A=$(x);if(!U(A)||A.type!=="sdk_response"||A.version!==I||!Z(A.generation)||!M(A.id))throw new G("invalid_sdk_response");let W={type:"sdk_response",version:I,generation:Number(A.generation),id:A.id},N=["type","version","generation","id","ok"];if(A.ok===!0&&B(A,[...N,"result"])&&typeof A.result==="string"&&A.result.length<=_)return{...W,ok:!0,result:A.result};if(A.ok===!1&&B(A,[...N,"error"])&&typeof A.error==="string"&&A.error.length>=1&&A.error.length<=_)return{...W,ok:!1,error:A.error};throw new G("invalid_sdk_response")}function EA(x){let A=JSON.stringify(x);return ZA(A),A}
|
|
4
|
+
export{$A as gf,KA as hf,QA as if,I as jf,b as kf,K as lf,D as mf,_ as nf,YA as of,p as pf,k as qf,i as rf,d as sf,y as tf,LA as uf,s as vf,H as wf,m as xf,c as yf,OA as zf,n as Af,t as Bf,r as Cf,zA as Df,l as Ef,SA as Ff,a as Gf,w as Hf,AA as If,xA as Jf,WA as Kf,G as Lf,M as Mf,Z as Nf,J as Of,C as Pf,S as Qf,BA as Rf,UA as Sf,FA as Tf,IA as Uf,XA as Vf,TA as Wf,MA as Xf,qA as Yf,yA as Zf,mA as _f,wA as $f,hA as ag,fA as bg,kA as cg,HA as dg,gA as eg,ZA as fg,EA as gg};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mh as s}from"./vm-hands-entry-lite-a3n86qqm.js";var mc={};s(mc,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,util:()=>k,url:()=>gl,uppercase:()=>Xr,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,trim:()=>Tr,treeifyError:()=>Lt,transform:()=>ct,toUpperCase:()=>Br,toLowerCase:()=>Hr,toJSONSchema:()=>Yi,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,startsWith:()=>Kr,slugify:()=>Mr,size:()=>Dr,setErrorMap:()=>i4,set:()=>pl,safeParseAsync:()=>c$,safeParse:()=>l$,safeEncodeAsync:()=>w$,safeEncode:()=>k$,safeDecodeAsync:()=>S$,safeDecode:()=>D$,registry:()=>ui,regexes:()=>d,regex:()=>Ar,refine:()=>lg,record:()=>F$,readonly:()=>og,property:()=>Vi,promise:()=>$c,prettifyError:()=>Et,preprocess:()=>Dc,prefault:()=>y$,positive:()=>Ei,pipe:()=>di,partialRecord:()=>hl,parseAsync:()=>g$,parse:()=>$$,overwrite:()=>f,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,normalize:()=>Fr,nonpositive:()=>Wi,nonoptional:()=>a$,nonnegative:()=>Ai,never:()=>$t,negative:()=>Gi,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,multipleOf:()=>ur,minSize:()=>a,minLength:()=>nr,mime:()=>Qr,meta:()=>bc,maxSize:()=>$r,maxLength:()=>wr,map:()=>al,mac:()=>Sl,lte:()=>x,lt:()=>h,lowercase:()=>Vr,looseRecord:()=>yl,looseObject:()=>fl,locales:()=>Sn,literal:()=>rc,length:()=>Sr,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,iso:()=>Rr,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,includes:()=>qr,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,gte:()=>Q,gt:()=>y,globalRegistry:()=>X,getErrorMap:()=>t4,function:()=>gc,fromJSONSchema:()=>Sc,formatError:()=>$n,float64:()=>Vl,float32:()=>Al,flattenError:()=>un,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,endsWith:()=>Yr,encodeAsync:()=>_$,encode:()=>I$,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,decodeAsync:()=>U$,decode:()=>b$,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,core:()=>ir,config:()=>W,coerce:()=>bg,codec:()=>vc,clone:()=>K,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodRealError:()=>M,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIssueCode:()=>n4,ZodIntersection:()=>q$,ZodISOTime:()=>Hi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ti,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFirstPartyTypeKind:()=>Ig,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodError:()=>sb,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$,TimePrecision:()=>Qe,NEVER:()=>Ut,$output:()=>Ae,$input:()=>Ve,$brand:()=>kt});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>nI,safeEncode:()=>sc,safeDecodeAsync:()=>iI,safeDecode:()=>rI,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>ac,encode:()=>hc,describe:()=>ku,decodeAsync:()=>pc,decode:()=>yc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Gb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Eb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Vb,_trim:()=>Tr,_transform:()=>Tb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Cb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>xb,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>Kb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Xb,_readonly:()=>Zb,_property:()=>Vi,_promise:()=>yb,_positive:()=>Ei,_pipe:()=>fb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Hb,_number:()=>Me,_nullable:()=>Bb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>db,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Qb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>qb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Fb,_length:()=>Sr,_lazy:()=>hb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Ab,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Yb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Wb,_default:()=>Mb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>Rb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>Rc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Tc,required:()=>Mc,randomString:()=>Vc,propertyKeyTypes:()=>tn,promiseAllObject:()=>Ac,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Yc,partial:()=>Bc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Qc,objectClone:()=>Ec,numKeys:()=>Xc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Hc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>fc,getSizableOrigin:()=>on,getParsedType:()=>qc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Wc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Fc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>Kc,cloneDef:()=>Gc,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>dc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>xc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>jc,assertNever:()=>Jc,assertIs:()=>Pc,assertEqual:()=>Oc,assert:()=>Lc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function Oc(n){return n}function jc(n){return n}function Pc(n){}function Jc(n){throw Error("Unexpected value in exhaustive check")}function Lc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Ec(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Gc(n){return rr(n._zod.def)}function Wc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Ac(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Vc(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Xc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var qc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function Kc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Tc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Hc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Bc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Mc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function dc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function xc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function Rc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function Zc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
2
|
+
import{Nh as s}from"./vm-hands-entry-lite-hf0mk7vd.js";var mc={};s(mc,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,util:()=>k,url:()=>gl,uppercase:()=>Xr,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,trim:()=>Tr,treeifyError:()=>Lt,transform:()=>ct,toUpperCase:()=>Br,toLowerCase:()=>Hr,toJSONSchema:()=>Yi,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,startsWith:()=>Kr,slugify:()=>Mr,size:()=>Dr,setErrorMap:()=>i4,set:()=>pl,safeParseAsync:()=>c$,safeParse:()=>l$,safeEncodeAsync:()=>w$,safeEncode:()=>k$,safeDecodeAsync:()=>S$,safeDecode:()=>D$,registry:()=>ui,regexes:()=>d,regex:()=>Ar,refine:()=>lg,record:()=>F$,readonly:()=>og,property:()=>Vi,promise:()=>$c,prettifyError:()=>Et,preprocess:()=>Dc,prefault:()=>y$,positive:()=>Ei,pipe:()=>di,partialRecord:()=>hl,parseAsync:()=>g$,parse:()=>$$,overwrite:()=>f,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,normalize:()=>Fr,nonpositive:()=>Wi,nonoptional:()=>a$,nonnegative:()=>Ai,never:()=>$t,negative:()=>Gi,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,multipleOf:()=>ur,minSize:()=>a,minLength:()=>nr,mime:()=>Qr,meta:()=>bc,maxSize:()=>$r,maxLength:()=>wr,map:()=>al,mac:()=>Sl,lte:()=>x,lt:()=>h,lowercase:()=>Vr,looseRecord:()=>yl,looseObject:()=>fl,locales:()=>Sn,literal:()=>rc,length:()=>Sr,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,iso:()=>Rr,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,includes:()=>qr,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,gte:()=>Q,gt:()=>y,globalRegistry:()=>X,getErrorMap:()=>t4,function:()=>gc,fromJSONSchema:()=>Sc,formatError:()=>$n,float64:()=>Vl,float32:()=>Al,flattenError:()=>un,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,endsWith:()=>Yr,encodeAsync:()=>_$,encode:()=>I$,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,decodeAsync:()=>U$,decode:()=>b$,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,core:()=>ir,config:()=>W,coerce:()=>bg,codec:()=>vc,clone:()=>K,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodRealError:()=>M,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIssueCode:()=>n4,ZodIntersection:()=>q$,ZodISOTime:()=>Hi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ti,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFirstPartyTypeKind:()=>Ig,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodError:()=>sb,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$,TimePrecision:()=>Qe,NEVER:()=>Ut,$output:()=>Ae,$input:()=>Ve,$brand:()=>kt});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>nI,safeEncode:()=>sc,safeDecodeAsync:()=>iI,safeDecode:()=>rI,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>ac,encode:()=>hc,describe:()=>ku,decodeAsync:()=>pc,decode:()=>yc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Gb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Eb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Vb,_trim:()=>Tr,_transform:()=>Tb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Cb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>xb,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>Kb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Xb,_readonly:()=>Zb,_property:()=>Vi,_promise:()=>yb,_positive:()=>Ei,_pipe:()=>fb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Hb,_number:()=>Me,_nullable:()=>Bb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>db,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Qb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>qb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Fb,_length:()=>Sr,_lazy:()=>hb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Ab,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Yb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Wb,_default:()=>Mb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>Rb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>Rc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Tc,required:()=>Mc,randomString:()=>Vc,propertyKeyTypes:()=>tn,promiseAllObject:()=>Ac,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Yc,partial:()=>Bc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Qc,objectClone:()=>Ec,numKeys:()=>Xc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Hc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>fc,getSizableOrigin:()=>on,getParsedType:()=>qc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Wc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Fc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>Kc,cloneDef:()=>Gc,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>dc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>xc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>jc,assertNever:()=>Jc,assertIs:()=>Pc,assertEqual:()=>Oc,assert:()=>Lc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function Oc(n){return n}function jc(n){return n}function Pc(n){}function Jc(n){throw Error("Unexpected value in exhaustive check")}function Lc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Ec(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Gc(n){return rr(n._zod.def)}function Wc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Ac(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Vc(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Xc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var qc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function Kc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Tc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Hc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Bc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Mc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function dc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function xc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function Rc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function Zc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
3
3
|
`)}var Pr=(n)=>(i,o,v,r)=>{let t=v?{...v,async:!1}:{async:!1},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)throw new C;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Fn=Pr(B),Jr=(n)=>async(i,o,v,r)=>{let t=v?{...v,async:!0}:{async:!0},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)e=await e;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Tn=Jr(B),Lr=(n)=>(i,o,v)=>{let r=v?{...v,async:!1}:{async:!1},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)throw new C;return t.issues.length?{success:!1,error:new(n??en)(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Gt=Lr(B),Er=(n)=>async(i,o,v)=>{let r=v?{...v,async:!0}:{async:!0},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)t=await t;return t.issues.length?{success:!1,error:new n(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Wt=Er(B),Hn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Pr(n)(i,o,r)},hc=Hn(B),Bn=(n)=>(i,o,v)=>{return Pr(n)(i,o,v)},yc=Bn(B),Mn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Jr(n)(i,o,r)},ac=Mn(B),dn=(n)=>async(i,o,v)=>{return Jr(n)(i,o,v)},pc=dn(B),xn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Lr(n)(i,o,r)},sc=xn(B),Rn=(n)=>(i,o,v)=>{return Lr(n)(i,o,v)},rI=Rn(B),fn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Er(n)(i,o,r)},nI=fn(B),Zn=(n)=>async(i,o,v)=>{return Er(n)(i,o,v)},iI=Zn(B);var d={};s(d,{xid:()=>qt,uuid7:()=>eI,uuid6:()=>vI,uuid4:()=>oI,uuid:()=>Ur,uppercase:()=>vo,unicodeEmail:()=>Og,undefined:()=>to,ulid:()=>Xt,time:()=>yt,string:()=>pt,sha512_hex:()=>LI,sha512_base64url:()=>GI,sha512_base64:()=>EI,sha384_hex:()=>jI,sha384_base64url:()=>JI,sha384_base64:()=>PI,sha256_hex:()=>NI,sha256_base64url:()=>OI,sha256_base64:()=>zI,sha1_hex:()=>wI,sha1_base64url:()=>mI,sha1_base64:()=>SI,rfc5322Email:()=>$I,number:()=>gn,null:()=>io,nanoid:()=>Yt,md5_hex:()=>UI,md5_base64url:()=>DI,md5_base64:()=>kI,mac:()=>dt,lowercase:()=>oo,ksuid:()=>Kt,ipv6:()=>Mt,ipv4:()=>Bt,integer:()=>ro,idnEmail:()=>gI,httpProtocol:()=>Zt,html5Email:()=>uI,hostname:()=>II,hex:()=>_I,guid:()=>Ft,extendedDuration:()=>tI,emoji:()=>Ht,email:()=>Tt,e164:()=>Ct,duration:()=>Qt,domain:()=>bI,datetime:()=>at,date:()=>ht,cuid2:()=>Vt,cuid:()=>At,cidrv6:()=>Rt,cidrv4:()=>xt,browserEmail:()=>lI,boolean:()=>no,bigint:()=>st,base64url:()=>Cn,base64:()=>ft});var At=/^[cC][0-9a-z]{6,}$/,Vt=/^[0-9a-z]+$/,Xt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qt=/^[0-9a-vA-V]{20}$/,Kt=/^[A-Za-z0-9]{27}$/,Yt=/^[a-zA-Z0-9_-]{21}$/,Qt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ft=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ur=(n)=>{if(!n)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},oI=Ur(4),vI=Ur(6),eI=Ur(7),Tt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$I=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Og=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,gI=Og,lI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ht(){return new RegExp(cI,"u")}var Bt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dt=(n)=>{let i=R(n??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},xt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ft=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cn=/^[A-Za-z0-9_-]*$/,II=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,bI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Zt=/^https?$/,Ct=/^\+[1-9]\d{6,14}$/,jg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ht=new RegExp(`^${jg}$`);function Pg(n){return typeof n.precision==="number"?n.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":n.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${n.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yt(n){return new RegExp(`^${Pg(n)}$`)}function at(n){let i=Pg({precision:n.precision}),o=["Z"];if(n.local)o.push("");if(n.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let v=`${i}(?:${o.join("|")})`;return new RegExp(`^${jg}T(?:${v})$`)}var pt=(n)=>{let i=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},st=/^-?\d+n?$/,ro=/^-?\d+$/,gn=/^-?\d+(?:\.\d+)?$/,no=/^(?:true|false)$/i,io=/^null$/i;var to=/^undefined$/i;var oo=/^[^A-Z]*$/,vo=/^[^a-z]*$/,_I=/^[0-9a-fA-F]*$/;function ln(n,i){return new RegExp(`^[A-Za-z0-9+/]{${n}}${i}$`)}function cn(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var UI=/^[0-9a-fA-F]{32}$/,kI=ln(22,"=="),DI=cn(22),wI=/^[0-9a-fA-F]{40}$/,SI=ln(27,"="),mI=cn(27),NI=/^[0-9a-fA-F]{64}$/,zI=ln(43,"="),OI=cn(43),jI=/^[0-9a-fA-F]{96}$/,PI=ln(64,""),JI=cn(64),LI=/^[0-9a-fA-F]{128}$/,EI=ln(86,"=="),GI=cn(86);var E=l("$ZodCheck",(n,i)=>{var o;n._zod??(n._zod={}),n._zod.def=i,(o=n._zod).onattach??(o.onattach=[])}),Lg={number:"number",bigint:"bigint",object:"date"},hn=l("$ZodCheckLessThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<t)if(i.inclusive)r.maximum=i.value;else r.exclusiveMaximum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value<=i.value:v.value<i.value)return;v.issues.push({origin:o,code:"too_big",maximum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),yn=l("$ZodCheckGreaterThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>t)if(i.inclusive)r.minimum=i.value;else r.exclusiveMinimum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value>=i.value:v.value>i.value)return;v.issues.push({origin:o,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),eo=l("$ZodCheckMultipleOf",(n,i)=>{E.init(n,i),n._zod.onattach.push((o)=>{var v;(v=o._zod.bag).multipleOf??(v.multipleOf=i.value)}),n._zod.check=(o)=>{if(typeof o.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%i.value===BigInt(0):wt(o.value,i.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:i.value,input:o.value,inst:n,continue:!i.abort})}}),uo=l("$ZodCheckNumberFormat",(n,i)=>{E.init(n,i),i.format=i.format||"float64";let o=i.format?.includes("int"),v=o?"int":"number",[r,t]=jt[i.format];n._zod.onattach.push((e)=>{let u=e._zod.bag;if(u.format=i.format,u.minimum=r,u.maximum=t,o)u.pattern=ro}),n._zod.check=(e)=>{let u=e.value;if(o){if(!Number.isInteger(u)){e.issues.push({expected:v,format:i.format,code:"invalid_type",continue:!1,input:u,inst:n});return}if(!Number.isSafeInteger(u)){if(u>0)e.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});else e.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});return}}if(u<r)e.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!i.abort});if(u>t)e.issues.push({origin:"number",input:u,code:"too_big",maximum:t,inclusive:!0,inst:n,continue:!i.abort})}}),$o=l("$ZodCheckBigIntFormat",(n,i)=>{E.init(n,i);let[o,v]=Pt[i.format];n._zod.onattach.push((r)=>{let t=r._zod.bag;t.format=i.format,t.minimum=o,t.maximum=v}),n._zod.check=(r)=>{let t=r.value;if(t<o)r.issues.push({origin:"bigint",input:t,code:"too_small",minimum:o,inclusive:!0,inst:n,continue:!i.abort});if(t>v)r.issues.push({origin:"bigint",input:t,code:"too_big",maximum:v,inclusive:!0,inst:n,continue:!i.abort})}}),go=l("$ZodCheckMaxSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.size<=i.maximum)return;v.issues.push({origin:on(r),code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),lo=l("$ZodCheckMinSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.size>=i.minimum)return;v.issues.push({origin:on(r),code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),co=l("$ZodCheckSizeEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.size,r.maximum=i.size,r.size=i.size}),n._zod.check=(v)=>{let r=v.value,t=r.size;if(t===i.size)return;let e=t>i.size;v.issues.push({origin:on(r),...e?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Io=l("$ZodCheckMaxLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.length<=i.maximum)return;let e=vn(r);v.issues.push({origin:e,code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),bo=l("$ZodCheckMinLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.length>=i.minimum)return;let e=vn(r);v.issues.push({origin:e,code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),_o=l("$ZodCheckLengthEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.length,r.maximum=i.length,r.length=i.length}),n._zod.check=(v)=>{let r=v.value,t=r.length;if(t===i.length)return;let e=vn(r),u=t>i.length;v.issues.push({origin:e,...u?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Gr=l("$ZodCheckStringFormat",(n,i)=>{var o,v;if(E.init(n,i),n._zod.onattach.push((r)=>{let t=r._zod.bag;if(t.format=i.format,i.pattern)t.patterns??(t.patterns=new Set),t.patterns.add(i.pattern)}),i.pattern)(o=n._zod).check??(o.check=(r)=>{if(i.pattern.lastIndex=0,i.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:i.format,input:r.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})});else(v=n._zod).check??(v.check=()=>{})}),Uo=l("$ZodCheckRegex",(n,i)=>{Gr.init(n,i),n._zod.check=(o)=>{if(i.pattern.lastIndex=0,i.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),ko=l("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=oo),Gr.init(n,i)}),Do=l("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=vo),Gr.init(n,i)}),wo=l("$ZodCheckIncludes",(n,i)=>{E.init(n,i);let o=R(i.includes),v=new RegExp(typeof i.position==="number"?`^.{${i.position}}${o}`:o);i.pattern=v,n._zod.onattach.push((r)=>{let t=r._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(v)}),n._zod.check=(r)=>{if(r.value.includes(i.includes,i.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:r.value,inst:n,continue:!i.abort})}}),So=l("$ZodCheckStartsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`^${R(i.prefix)}.*`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.startsWith(i.prefix))return;v.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:v.value,inst:n,continue:!i.abort})}}),mo=l("$ZodCheckEndsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`.*${R(i.suffix)}$`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.endsWith(i.suffix))return;v.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:v.value,inst:n,continue:!i.abort})}});function Jg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues))}var No=l("$ZodCheckProperty",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{let v=i.schema._zod.run({value:o.value[i.property],issues:[]},{});if(v instanceof Promise)return v.then((r)=>Jg(r,o,i.property));Jg(v,o,i.property);return}}),zo=l("$ZodCheckMimeType",(n,i)=>{E.init(n,i);let o=new Set(i.mime);n._zod.onattach.push((v)=>{v._zod.bag.mime=i.mime}),n._zod.check=(v)=>{if(o.has(v.value.type))return;v.issues.push({code:"invalid_value",values:i.mime,input:v.value.type,inst:n,continue:!i.abort})}}),Oo=l("$ZodCheckOverwrite",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{o.value=i.tx(o.value)}});class an{constructor(n=[]){if(this.content=[],this.indent=0,this)this.args=n}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n==="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let o=n.split(`
|
|
4
4
|
`).filter((t)=>t),v=Math.min(...o.map((t)=>t.length-t.trimStart().length)),r=o.map((t)=>t.slice(v)).map((t)=>" ".repeat(this.indent*2)+t);for(let t of r)this.content.push(t)}compile(){let n=Function,i=this?.args,v=[...(this?.content??[""]).map((r)=>` ${r}`)];return new n(...i,v.join(`
|
|
5
5
|
`))}}var jo={major:4,minor:4,patch:3};var z=l("$ZodType",(n,i)=>{var o;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=jo;let v=[...n._zod.def.checks??[]];if(n._zod.traits.has("$ZodCheck"))v.unshift(n);for(let r of v)for(let t of r._zod.onattach)t(n);if(v.length===0)(o=n._zod).deferred??(o.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let r=(e,u,g)=>{let $=er(e),c;for(let b of u){if(b._zod.def.when){if(Jt(e))continue;if(!b._zod.def.when(e))continue}else if($)continue;let S=e.issues.length,D=b._zod.check(e);if(D instanceof Promise&&g?.async===!1)throw new C;if(c||D instanceof Promise)c=(c??Promise.resolve()).then(async()=>{if(await D,e.issues.length===S)return;if(!$)$=er(e,S)});else{if(e.issues.length===S)continue;if(!$)$=er(e,S)}}if(c)return c.then(()=>{return e});return e},t=(e,u,g)=>{if(er(e))return e.aborted=!0,e;let $=r(u,v,g);if($ instanceof Promise){if(g.async===!1)throw new C;return $.then((c)=>n._zod.parse(c,g))}return n._zod.parse($,g)};n._zod.run=(e,u)=>{if(u.skipChecks)return n._zod.parse(e,u);if(u.direction==="backward"){let $=n._zod.parse({value:e.value,issues:[]},{...u,skipChecks:!0});if($ instanceof Promise)return $.then((c)=>{return t(c,e,u)});return t($,e,u)}let g=n._zod.parse(e,u);if(g instanceof Promise){if(u.async===!1)throw new C;return g.then(($)=>r($,v,u))}return r(g,v,u)}}j(n,"~standard",()=>({validate:(r)=>{try{let t=Gt(n,r);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return Wt(n,r).then((e)=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),kr=l("$ZodString",(n,i)=>{z.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??pt(n._zod.bag),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=String(o.value)}catch(r){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:n}),o}}),J=l("$ZodStringFormat",(n,i)=>{Gr.init(n,i),kr.init(n,i)}),Jo=l("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=Ft),J.init(n,i)}),Lo=l("$ZodUUID",(n,i)=>{if(i.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(v===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=Ur(v))}else i.pattern??(i.pattern=Ur());J.init(n,i)}),Eo=l("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=Tt),J.init(n,i)}),Go=l("$ZodURL",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{try{let v=o.value.trim();if(!i.normalize&&i.protocol?.source===Zt.source){if(!/^https?:\/\//i.test(v)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:n,continue:!i.abort});return}}let r=new URL(v);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(r.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:o.value,inst:n,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:o.value,inst:n,continue:!i.abort})}if(i.normalize)o.value=r.href;else o.value=v;return}catch(v){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:n,continue:!i.abort})}}}),Wo=l("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=Ht()),J.init(n,i)}),Ao=l("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=Yt),J.init(n,i)}),Vo=l("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=At),J.init(n,i)}),Xo=l("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=Vt),J.init(n,i)}),qo=l("$ZodULID",(n,i)=>{i.pattern??(i.pattern=Xt),J.init(n,i)}),Ko=l("$ZodXID",(n,i)=>{i.pattern??(i.pattern=qt),J.init(n,i)}),Yo=l("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=Kt),J.init(n,i)}),Qo=l("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=at(i)),J.init(n,i)}),Fo=l("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=ht),J.init(n,i)}),To=l("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=yt(i)),J.init(n,i)}),Ho=l("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=Qt),J.init(n,i)}),Bo=l("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=Bt),J.init(n,i),n._zod.bag.format="ipv4"}),Mo=l("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=Mt),J.init(n,i),n._zod.bag.format="ipv6",n._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:n,continue:!i.abort})}}}),xo=l("$ZodMAC",(n,i)=>{i.pattern??(i.pattern=dt(i.delimiter)),J.init(n,i),n._zod.bag.format="mac"}),Ro=l("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=xt),J.init(n,i)}),fo=l("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=Rt),J.init(n,i),n._zod.check=(o)=>{let v=o.value.split("/");try{if(v.length!==2)throw Error();let[r,t]=v;if(!t)throw Error();let e=Number(t);if(`${e}`!==t)throw Error();if(e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:n,continue:!i.abort})}}});function Zo(n){if(n==="")return!0;if(/\s/.test(n))return!1;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Co=l("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=ft),J.init(n,i),n._zod.bag.contentEncoding="base64",n._zod.check=(o)=>{if(Zo(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:n,continue:!i.abort})}});function dg(n){if(!Cn.test(n))return!1;let i=n.replace(/[-_]/g,(v)=>v==="-"?"+":"/"),o=i.padEnd(Math.ceil(i.length/4)*4,"=");return Zo(o)}var ho=l("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Cn),J.init(n,i),n._zod.bag.contentEncoding="base64url",n._zod.check=(o)=>{if(dg(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:n,continue:!i.abort})}}),yo=l("$ZodE164",(n,i)=>{i.pattern??(i.pattern=Ct),J.init(n,i)});function xg(n,i=null){try{let o=n.split(".");if(o.length!==3)return!1;let[v]=o;if(!v)return!1;let r=JSON.parse(atob(v));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(i&&(!("alg"in r)||r.alg!==i))return!1;return!0}catch{return!1}}var ao=l("$ZodJWT",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(xg(o.value,i.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:n,continue:!i.abort})}}),po=l("$ZodCustomStringFormat",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(i.fn(o.value))return;o.issues.push({code:"invalid_format",format:i.format,input:o.value,inst:n,continue:!i.abort})}}),ii=l("$ZodNumber",(n,i)=>{z.init(n,i),n._zod.pattern=n._zod.bag.pattern??gn,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Number(o.value)}catch(e){}let r=o.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return o;let t=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:r,inst:n,...t?{received:t}:{}}),o}}),so=l("$ZodNumberFormat",(n,i)=>{uo.init(n,i),ii.init(n,i)}),In=l("$ZodBoolean",(n,i)=>{z.init(n,i),n._zod.pattern=no,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Boolean(o.value)}catch(t){}let r=o.value;if(typeof r==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:n}),o}}),ti=l("$ZodBigInt",(n,i)=>{z.init(n,i),n._zod.pattern=st,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=BigInt(o.value)}catch(r){}if(typeof o.value==="bigint")return o;return o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:n}),o}}),rv=l("$ZodBigIntFormat",(n,i)=>{$o.init(n,i),ti.init(n,i)}),nv=l("$ZodSymbol",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r==="symbol")return o;return o.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:n}),o}}),iv=l("$ZodUndefined",(n,i)=>{z.init(n,i),n._zod.pattern=to,n._zod.values=new Set([void 0]),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:n}),o}}),tv=l("$ZodNull",(n,i)=>{z.init(n,i),n._zod.pattern=io,n._zod.values=new Set([null]),n._zod.parse=(o,v)=>{let r=o.value;if(r===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:r,inst:n}),o}}),ov=l("$ZodAny",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),vv=l("$ZodUnknown",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),ev=l("$ZodNever",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{return o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:n}),o}}),uv=l("$ZodVoid",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"void",code:"invalid_type",input:r,inst:n}),o}}),$v=l("$ZodDate",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=new Date(o.value)}catch(u){}let r=o.value,t=r instanceof Date;if(t&&!Number.isNaN(r.getTime()))return o;return o.issues.push({expected:"date",code:"invalid_type",input:r,...t?{received:"Invalid Date"}:{},inst:n}),o}});function Gg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues));i.value[o]=n.value}var gv=l("$ZodArray",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:n}),o;o.value=Array(r.length);let t=[];for(let e=0;e<r.length;e++){let u=r[e],g=i.element._zod.run({value:u,issues:[]},v);if(g instanceof Promise)t.push(g.then(($)=>Gg($,o,e)));else Gg(g,o,e)}if(t.length)return Promise.all(t).then(()=>o);return o}});function ni(n,i,o,v,r,t){let e=o in v;if(n.issues.length){if(r&&t&&!e)return;i.issues.push(...H(o,n.issues))}if(!e&&!r){if(!n.issues.length)i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}if(n.value===void 0){if(e)i.value[o]=void 0}else i.value[o]=n.value}function Rg(n){let i=Object.keys(n.shape);for(let v of i)if(!n.shape?.[v]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${v}": expected a Zod schema`);let o=Ot(n.shape);return{...n,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(o)}}function fg(n,i,o,v,r,t){let e=[],u=r.keySet,g=r.catchall._zod,$=g.def.type,c=g.optin==="optional",b=g.optout==="optional";for(let S in i){if(S==="__proto__")continue;if(u.has(S))continue;if($==="never"){e.push(S);continue}let D=g.run({value:i[S],issues:[]},v);if(D instanceof Promise)n.push(D.then((N)=>ni(N,o,S,i,c,b)));else ni(D,o,S,i,c,b)}if(e.length)o.issues.push({code:"unrecognized_keys",keys:e,input:i,inst:t});if(!n.length)return o;return Promise.all(n).then(()=>{return o})}var Zg=l("$ZodObject",(n,i)=>{if(z.init(n,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let u=i.shape;Object.defineProperty(i,"shape",{get:()=>{let g={...u};return Object.defineProperty(i,"shape",{value:g}),g}})}let v=Or(()=>Rg(i));j(n._zod,"propValues",()=>{let u=i.shape,g={};for(let $ in u){let c=u[$]._zod;if(c.values){g[$]??(g[$]=new Set);for(let b of c.values)g[$].add(b)}}return g});let r=_r,t=i.catchall,e;n._zod.parse=(u,g)=>{e??(e=v.value);let $=u.value;if(!r($))return u.issues.push({expected:"object",code:"invalid_type",input:$,inst:n}),u;u.value={};let c=[],b=e.shape;for(let S of e.keys){let D=b[S],N=D._zod.optin==="optional",T=D._zod.optout==="optional",A=D._zod.run({value:$[S],issues:[]},g);if(A instanceof Promise)c.push(A.then((_t)=>ni(_t,u,S,$,N,T)));else ni(A,u,S,$,N,T)}if(!t)return c.length?Promise.all(c).then(()=>u):u;return fg(c,$,u,g,v.value,n)}}),lv=l("$ZodObjectJIT",(n,i)=>{Zg.init(n,i);let o=n._zod.parse,v=Or(()=>Rg(i)),r=(S)=>{let D=new an(["shape","payload","ctx"]),N=v.value,T=(Z)=>{let G=Yn(Z);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};D.write("const input = payload.value;");let A=Object.create(null),_t=0;for(let Z of N.keys)A[Z]=`key_${_t++}`;D.write("const newResult = {};");for(let Z of N.keys){let G=A[Z],V=Yn(Z),_g=S[Z],Ug=_g?._zod?.optin==="optional",zc=_g?._zod?.optout==="optional";if(D.write(`const ${G} = ${T(Z)};`),Ug&&zc)D.write(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{O as
|
|
2
|
+
import{Ch as $}from"./vm-hands-entry-lite-h36c6h4q.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 yh,Z as zh,S as Ah,k as Bh};
|