@reason-machines/cli-linux-arm64-musl 0.2.381 → 0.2.383

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.
Files changed (111) hide show
  1. package/README.md +3 -1
  2. package/bin/ara +2 -2
  3. package/bin/vm-hands/api-credentials-xppmbg0m.js +2 -0
  4. package/bin/vm-hands/api-xmpbsm6b.js +2 -0
  5. package/bin/vm-hands/{ask-relay-fc0jc3t5.js → ask-relay-h8f5dmfh.js} +3 -3
  6. package/bin/vm-hands/connect-cli-qvfxpk5t.js +2 -0
  7. package/bin/vm-hands/{custom-endpoint-device-zhpake9f.js → custom-endpoint-device-bm94e9r0.js} +1 -1
  8. package/bin/vm-hands/desktop-account-3tnm4z5w.js +2 -0
  9. package/bin/vm-hands/{device-workspace-vbcry9d6.js → device-workspace-0xsj5ykf.js} +1 -1
  10. package/bin/vm-hands/hands-worker-source-azdrrhsz.js +2 -0
  11. package/bin/vm-hands/{index-bbk6a9sk.js → index-7f2kwwen.js} +1 -1
  12. package/bin/vm-hands/{install-receipt-7x81ek76.js → install-receipt-3xyx3rdd.js} +1 -1
  13. package/bin/vm-hands/local-automation-pvy9revm.js +2 -0
  14. package/bin/vm-hands/local-capabilities-zfzyknay.js +2 -0
  15. package/bin/vm-hands/local-desktop-users-ajb81vjm.js +2 -0
  16. package/bin/vm-hands/local-display-mac-9h6btvvq.js +2 -0
  17. package/bin/vm-hands/local-display-session-xqncvp30.js +2 -0
  18. package/bin/vm-hands/local-pty-session-cjas515w.js +2 -0
  19. package/bin/vm-hands/managed-runtime-s414h5nm.js +2 -0
  20. package/bin/vm-hands/{network-contract-zqvt1v0t.js → network-contract-dsw79qkc.js} +1 -1
  21. package/bin/vm-hands/package-smk3nqjs.js +2 -0
  22. package/bin/vm-hands/permissions-3mkk9mfw.js +2 -0
  23. package/bin/vm-hands/{reason-hands-protocol-8fxjynte.js → reason-hands-protocol-7d7xj1h3.js} +1 -1
  24. package/bin/vm-hands/serve-service-txzqn5kj.js +2 -0
  25. package/bin/vm-hands/status-23eqx9t3.js +96 -0
  26. package/bin/vm-hands/version-3gj9bqhc.js +2 -0
  27. package/bin/vm-hands/{vm-hands-entry-lite-7shpbsw8.js → vm-hands-entry-lite-1gxktkpe.js} +2 -2
  28. package/bin/vm-hands/vm-hands-entry-lite-2e18tm6w.js +245 -0
  29. package/bin/vm-hands/{vm-hands-entry-lite-g036gtem.js → vm-hands-entry-lite-2t0vcvd8.js} +1 -1
  30. package/bin/vm-hands/vm-hands-entry-lite-3dc4v5bd.js +11 -0
  31. package/bin/vm-hands/{vm-hands-entry-lite-hgkf1svv.js → vm-hands-entry-lite-41nygv3p.js} +2 -2
  32. package/bin/vm-hands/{vm-hands-entry-lite-j2q1k9vb.js → vm-hands-entry-lite-51hmj6am.js} +1 -1
  33. package/bin/vm-hands/{vm-hands-entry-lite-zfwg7ehq.js → vm-hands-entry-lite-5n4vsm6b.js} +2 -2
  34. package/bin/vm-hands/{vm-hands-entry-lite-k7wwza46.js → vm-hands-entry-lite-7xbgw4m0.js} +2 -2
  35. package/bin/vm-hands/vm-hands-entry-lite-8fj07njx.js +3 -0
  36. package/bin/vm-hands/{vm-hands-entry-lite-3hbe4em3.js → vm-hands-entry-lite-9cmfthkq.js} +1 -1
  37. package/bin/vm-hands/{vm-hands-entry-lite-4q8tsaqv.js → vm-hands-entry-lite-9r5tz2dx.js} +2 -2
  38. package/bin/vm-hands/{vm-hands-entry-lite-45j8qwsf.js → vm-hands-entry-lite-9w5vs9zv.js} +1 -1
  39. package/bin/vm-hands/vm-hands-entry-lite-a0yfp7s2.js +251 -0
  40. package/bin/vm-hands/{vm-hands-entry-lite-za55dtte.js → vm-hands-entry-lite-ammr3xbc.js} +2 -2
  41. package/bin/vm-hands/vm-hands-entry-lite-dh5gwmyf.js +3 -0
  42. package/bin/vm-hands/{vm-hands-entry-lite-5pm6bhb8.js → vm-hands-entry-lite-e0gdt6r5.js} +1 -1
  43. package/bin/vm-hands/{vm-hands-entry-lite-5kgvss4p.js → vm-hands-entry-lite-e2mjbqmr.js} +2 -2
  44. package/bin/vm-hands/vm-hands-entry-lite-ejm5er3h.js +7 -0
  45. package/bin/vm-hands/vm-hands-entry-lite-eqhsewc0.js +105 -0
  46. package/bin/vm-hands/{vm-hands-entry-lite-mh0xecf3.js → vm-hands-entry-lite-f02906k8.js} +4 -4
  47. package/bin/vm-hands/vm-hands-entry-lite-f5230h6t.js +67 -0
  48. package/bin/vm-hands/{vm-hands-entry-lite-zh8p7ndn.js → vm-hands-entry-lite-fb5dzy9x.js} +2 -2
  49. package/bin/vm-hands/{vm-hands-entry-lite-yjn6sk08.js → vm-hands-entry-lite-fcrqyxz0.js} +1 -1
  50. package/bin/vm-hands/vm-hands-entry-lite-fyvgav60.js +3 -0
  51. package/bin/vm-hands/vm-hands-entry-lite-g5grabna.js +540 -0
  52. package/bin/vm-hands/vm-hands-entry-lite-g7h6wjqy.js +3 -0
  53. package/bin/vm-hands/{vm-hands-entry-lite-34e71nbe.js → vm-hands-entry-lite-g8pj1jxa.js} +174 -16
  54. package/bin/vm-hands/vm-hands-entry-lite-h1rxv02g.js +458 -0
  55. package/bin/vm-hands/vm-hands-entry-lite-h8dbw0c7.js +4 -0
  56. package/bin/vm-hands/{vm-hands-entry-lite-nhtb458c.js → vm-hands-entry-lite-hnsm5t36.js} +1 -1
  57. package/bin/vm-hands/{vm-hands-entry-lite-0asdf4pm.js → vm-hands-entry-lite-jzcc9h71.js} +3 -3
  58. package/bin/vm-hands/{vm-hands-entry-lite-r6pap1kh.js → vm-hands-entry-lite-ma001vzh.js} +1 -1
  59. package/bin/vm-hands/{vm-hands-entry-lite-anmv8hp7.js → vm-hands-entry-lite-mn64e4pt.js} +286 -104
  60. package/bin/vm-hands/{vm-hands-entry-lite-9cgm6g8t.js → vm-hands-entry-lite-pk3q774c.js} +1 -1
  61. package/bin/vm-hands/vm-hands-entry-lite-qef2ndkd.js +6 -0
  62. package/bin/vm-hands/vm-hands-entry-lite-qnnfvm5r.js +5 -0
  63. package/bin/vm-hands/vm-hands-entry-lite-r8qg3wp1.js +3 -0
  64. package/bin/vm-hands/vm-hands-entry-lite-rd0ak4ye.js +4 -0
  65. package/bin/vm-hands/{vm-hands-entry-lite-00qsbphw.js → vm-hands-entry-lite-rpn0frzb.js} +2 -2
  66. package/bin/vm-hands/{vm-hands-entry-lite-g9rvf5qk.js → vm-hands-entry-lite-rtt2w6c6.js} +1 -1
  67. package/bin/vm-hands/vm-hands-entry-lite-sex82vb1.js +3 -0
  68. package/bin/vm-hands/vm-hands-entry-lite-vcwgh8tr.js +346 -0
  69. package/bin/vm-hands/{vm-hands-entry-lite-dgxxsdwb.js → vm-hands-entry-lite-xrthfx3q.js} +2 -2
  70. package/bin/vm-hands/{vm-hands-entry-lite-kxdw4myj.js → vm-hands-entry-lite-y2s2w174.js} +1 -1
  71. package/bin/vm-hands/{vm-hands-entry-lite-hc3p6r9p.js → vm-hands-entry-lite-zjfr0zh8.js} +2 -2
  72. package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
  73. package/bin/vm-hands/{vm-hands-executor-qssgfea1.js → vm-hands-executor-9p92j0mv.js} +1 -1
  74. package/bin/vm-hands/vm-hands-op-runner-ers4cefp.js +2 -0
  75. package/bin/vm-hands/{vm-hands-runtime-5me6cpmn.js → vm-hands-runtime-en4gj0t0.js} +3 -3
  76. package/bin/vm-hands/worker-sandbox-tgqbmy6b.js +2 -0
  77. package/package.json +1 -1
  78. package/bin/vm-hands/api-af9g18n7.js +0 -2
  79. package/bin/vm-hands/api-credentials-65mrr3tn.js +0 -2
  80. package/bin/vm-hands/connect-cli-j478km3s.js +0 -2
  81. package/bin/vm-hands/desktop-account-5zvgspyw.js +0 -2
  82. package/bin/vm-hands/hands-worker-source-h0b1j53p.js +0 -2
  83. package/bin/vm-hands/local-automation-c86tjeft.js +0 -2
  84. package/bin/vm-hands/local-capabilities-1h99gkt6.js +0 -2
  85. package/bin/vm-hands/local-desktop-users-0hadyvx1.js +0 -2
  86. package/bin/vm-hands/local-display-mac-v1pc7177.js +0 -2
  87. package/bin/vm-hands/local-display-session-tzq0hne8.js +0 -2
  88. package/bin/vm-hands/local-pty-session-hs7rq03x.js +0 -2
  89. package/bin/vm-hands/managed-runtime-5dqaaw1x.js +0 -2
  90. package/bin/vm-hands/package-3cd7cfyv.js +0 -2
  91. package/bin/vm-hands/permissions-vbyqjbyb.js +0 -2
  92. package/bin/vm-hands/serve-service-be739c9s.js +0 -2
  93. package/bin/vm-hands/status-s8ny6men.js +0 -96
  94. package/bin/vm-hands/version-8s4syrp2.js +0 -2
  95. package/bin/vm-hands/vm-hands-entry-lite-1085xsma.js +0 -5
  96. package/bin/vm-hands/vm-hands-entry-lite-4m40gwkf.js +0 -3
  97. package/bin/vm-hands/vm-hands-entry-lite-62wmnm7g.js +0 -540
  98. package/bin/vm-hands/vm-hands-entry-lite-98076n5g.js +0 -62
  99. package/bin/vm-hands/vm-hands-entry-lite-bvbfcp1k.js +0 -4
  100. package/bin/vm-hands/vm-hands-entry-lite-c01eyep6.js +0 -3
  101. package/bin/vm-hands/vm-hands-entry-lite-dcynw6t2.js +0 -3
  102. package/bin/vm-hands/vm-hands-entry-lite-hh24bq0d.js +0 -3
  103. package/bin/vm-hands/vm-hands-entry-lite-jb2sr2r7.js +0 -3
  104. package/bin/vm-hands/vm-hands-entry-lite-kt5aj2ax.js +0 -11
  105. package/bin/vm-hands/vm-hands-entry-lite-n9nnb482.js +0 -459
  106. package/bin/vm-hands/vm-hands-entry-lite-sb9a1jcn.js +0 -4
  107. package/bin/vm-hands/vm-hands-entry-lite-xg3d0a2y.js +0 -340
  108. package/bin/vm-hands/vm-hands-entry-lite-zamt8xp7.js +0 -181
  109. package/bin/vm-hands/vm-hands-entry-lite-ze9msfq1.js +0 -3
  110. package/bin/vm-hands/vm-hands-op-runner-b76rjaps.js +0 -2
  111. package/bin/vm-hands/worker-sandbox-wpzkvwer.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var U=".reason/workspace",T="workspace_base",y="sessions",W="workspace_layout",g=".reason/workspace/sessions",B=/^[0-9a-f]{8}$/;function C(j){if(!J(j))return!1;let q=".reason/workspace/sessions/";if(!j.startsWith(q))return!1;let z=j.slice(q.length).split("/");return z.length===2&&B.test(z[0])}var G=4096,X="workspaces/pi";function J(j){if(typeof j!=="string"||!j||j.length>G)return!1;if(j.startsWith("/")||j.includes("\x00")||j.includes("\\"))return!1;return j.split("/").every((q)=>q!==""&&q!=="."&&q!=="..")}function Z(j){if(j.kind==="root"){if(j.path===void 0)return".";if(!J(j.path))throw Error("invalid_device_workspace_identity");return j.path}if(!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/.test(j.workspaceId)||j.workspaceId==="."||j.workspaceId==="..")throw Error("invalid_device_workspace_identity");let q=j.layout==="sessions"?"sessions":X;return`${j.base?`${j.base}/`:""}${q}/${j.workspaceId}/repo`}function L(j){if(!j||typeof j!=="object"||Array.isArray(j))return null;let q=j;if(q.kind==="root"&&Object.keys(q).length===1)return{kind:"root"};if(q.kind==="root"&&Object.keys(q).length===2&&J(q.path))return{kind:"root",path:q.path};if(q.kind!=="managed"||typeof q.workspaceId!=="string"||Object.keys(q).length!==2+(q.base===void 0?0:1)+(q.layout===void 0?0:1)||q.base!==void 0&&q.base!==".reason/workspace"||q.layout!==void 0&&q.layout!=="sessions")return null;let z={kind:"managed",workspaceId:q.workspaceId,...q.base===".reason/workspace"?{base:".reason/workspace"}:{},...q.layout==="sessions"?{layout:"sessions"}:{}};try{return Z(z),z}catch{return null}}var b="/home/runner",P=10001,x="/run/reason/sessions",f=/^(?:\/[A-Za-z0-9._-]+)+$/,M=/-sidechat-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,H=/^(.+)-repository-[a-z0-9][a-z0-9._-]*-[0-9a-f]{12}$/;function K(j){return M.exec(j)?.[1]??H.exec(j)?.[1]??j}var $=/^((?:\/[A-Za-z0-9._-]+)+)\/\.reason\/workspace\/(workspaces\/pi|sessions)\/([^/]+)$/,A="*/.reason/workspace/workspaces/pi/*|*/.reason/workspace/sessions/*";function N(j,q=b,z="sessions"){if(!f.test(q)||q.split("/").some((V)=>V==="."||V===".."))throw Error("invalid_cloud_payload_home");let Q=`${q}/${Z({kind:"managed",workspaceId:j,base:".reason/workspace",...z?{layout:z}:{}})}`,F=`${x}/${K(j)}`;return{home:q,root:Q.slice(0,-5),checkout:Q,control:F,jobEnv:`${F}/job.env`,cloudAccess:`${F}/cloud-access`,logs:`${F}/logs`,pin:`${F}/ws`}}function Y(j){return $.exec(j.replace(/\/+$/,""))?.[2]==="sessions"?"sessions":null}function D(j){return{kind:"managed",workspaceId:j,layout:"sessions"}}function R(j){let q=$.exec(j.replace(/\/+$/,""));if(!q)return null;try{let z=N(q[3],q[1],Y(j));return z.root===j.replace(/\/+$/,"")?z:null}catch{return null}}
3
- export{U as bj,T as cj,y as dj,W as ej,g as fj,B as gj,C as hj,J as ij,Z as jj,L as kj,b as lj,P as mj,x as nj,M as oj,H as pj,$ as qj,A as rj,N as sj,Y as tj,D as uj,R as vj};
3
+ export{U as qj,T as rj,y as sj,W as tj,g as uj,B as vj,C as wj,J as xj,Z as yj,L as zj,b as Aj,P as Bj,x as Cj,M as Dj,H as Ej,$ as Fj,A as Gj,N as Hj,Y as Ij,D as Jj,R as Kj};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import{Vi as I}from"./vm-hands-entry-lite-sex82vb1.js";import{Ak as g,sk as R,vk as U,yk as C,zk as O}from"./vm-hands-entry-lite-r8qg3wp1.js";import{spawn as S}from"child_process";import{existsSync as x,mkdirSync as T,readFileSync as w,writeFileSync as E}from"fs";import{homedir as H}from"os";import{basename as L,delimiter as D,join as G,win32 as $}from"path";var N=process.platform==="win32"?U("win32"):"/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",b=N.split(D),_=5000,j=65536,k=new Set(["zsh","bash"]),f=[[".local","bin"],[".bun","bin"],[".cargo","bin"],["go","bin"]],P=(z,J)=>new Promise((B,Q)=>{let K;try{K=S(z,[...J],{...C(),stdio:["ignore","pipe","ignore"]}),O(K)}catch(X){Q(X);return}let W=[],V=0,Z=null,q=(X)=>{Z??=Error(X);try{if(K.pid!==void 0)g(K.pid,"SIGKILL")}catch{}},F=setTimeout(()=>q("login_shell_timeout"),_);K.stdout?.on("data",(X)=>{if(V+=X.length,V>j)q("login_shell_output_too_large");else W.push(X)}),K.once("error",(X)=>{clearTimeout(F),Q(X)}),K.once("close",(X)=>{if(clearTimeout(F),Z)Q(Z);else if(X!==0)Q(Error("login_shell_exit_nonzero"));else B(Buffer.concat(W).toString("utf8"))})});function v(z){return typeof z==="string"&&z.startsWith("/")&&!z.includes("\x00")&&k.has(L(z))}function M(z){let J=new Set,B=[];for(let Q of z){if(J.has(Q))continue;J.add(Q),B.push(Q)}return B}function A(z,J=process.platform){let B=J==="win32",Q=z.split(`
3
+ `).at(-1)??"",K=[];for(let W of Q.split(B?";":":")){let V=W.trim();if(B?!$.isAbsolute(V):!V.startsWith("/"))continue;if(V.includes("\x00"))continue;if(I(V))continue;K.push(V)}return M(K)}function y(z){let J=z?.home??H(),B=z?.directoryExists??x,Q=f.map((K)=>G(J,...K)).filter((K)=>{try{return B(K)}catch{return!1}});return M([...Q,...process.platform==="win32"?A(process.env.PATH??process.env.Path??""):[],...b]).join(D)}async function d(z){let J=z?.shell??process.env.SHELL,B=()=>({path:y({home:z?.home,directoryExists:z?.directoryExists}),source:"fallback"});if(process.platform==="win32"||!v(J))return B();let Q;try{Q=await(z?.runLoginShell??P)(J,["-lic",'printf %s "$PATH"'])}catch{return B()}if(Buffer.byteLength(Q,"utf8")>j)return B();let K=A(Q);if(K.length===0)return B();return{path:M([...K,...b]).join(":"),source:"login_shell"}}function n(z){let J=null;return()=>{return J??=d(z),J}}function Y(z){if(z===void 0||z.includes("\x00")||Buffer.byteLength(z,"utf8")>32768)return;return z}function r(z){let J=z.source??process.env,B={HOME:z.home,PATH:z.path??N,TMPDIR:z.temporaryDirectory,SHELL:Y(J.SHELL)??"/bin/zsh",LANG:Y(J.LANG)??"C.UTF-8",LC_ALL:Y(J.LC_ALL)??Y(J.LANG)??"C.UTF-8"},Q=Y(J.LC_CTYPE),K=Y(J.TERM),W=Y(J.COLORTERM);if(Q)B.LC_CTYPE=Q;if(K)B.TERM=K;if(W)B.COLORTERM=W;if(process.platform==="win32"){for(let V of h){let Z=Y(J[V]);if(Z)B[V]=Z}B.TEMP=B.TMP=z.temporaryDirectory,B.SHELL=R()??B.SHELL,B.PATH=m(B.PATH)}return B}function m(z,J=G(H(),".reason","python3")){let B=(W)=>z.split($.delimiter).filter((V)=>V&&!/[\\/]WindowsApps[\\/]?$/i.test(V)).map((V)=>$.join(V,W)).find((V)=>x(V)),Q=B("python.exe");if(B("python3.exe")||!Q)return z;let K=`#!/bin/sh
4
+ exec "${Q.replaceAll("\\","/")}" "$@"
5
+ `;try{let W=G(J,"python3");if(!x(W)||w(W,"utf8")!==K)T(J,{recursive:!0}),E(W,K)}catch{return z}return[J,z].join($.delimiter)}var h=["SystemRoot","SystemDrive","windir","ComSpec","PATHEXT","USERPROFILE","USERNAME","USERDOMAIN","APPDATA","LOCALAPPDATA","ProgramData","ProgramFiles","ProgramFiles(x86)","ProgramW6432","CommonProgramFiles","NUMBER_OF_PROCESSORS","PROCESSOR_ARCHITECTURE","OS"];
6
+ export{N as Hc,A as Ic,y as Jc,n as Kc,r as Lc,m as Mc};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{li as A,mi as x,ni as u,wi as y}from"./vm-hands-entry-lite-e2mjbqmr.js";import{Ci as c}from"./vm-hands-entry-lite-ma001vzh.js";import{randomUUID as m}from"crypto";import{chmodSync as l,existsSync as p,mkdirSync as jJ,readlinkSync as YJ,readFileSync as GJ,renameSync as OJ,unlinkSync as VJ,writeFileSync as FJ}from"fs";import{homedir as d}from"os";import{basename as P,dirname as H,isAbsolute as v,join as I,normalize as n,relative as HJ,resolve as LJ}from"path";import{unlinkSync as WJ}from"fs";import{dirname as XJ,join as ZJ}from"path";function $J(J){return ZJ(XJ(J),"future-device-grant.json")}function o(J){try{WJ($J(J))}catch(Q){if(!(Q instanceof Error&&("code"in Q)&&Q.code==="ENOENT"))throw Q}}var N=3,NJ=1,TJ=2,D=1,a=1,r="Reason may read and write files and run commands in this signed-in OS account, subject to saved restrictions and operating system permissions.",b="Reason may later execute on this computer inside a Reason sandbox, limited to folders explicitly attached by the user.",zJ=[b,"Ara may later execute on this computer inside an Ara sandbox, limited to folders explicitly attached by the user."];function i(J){return typeof J==="string"&&zJ.includes(J)}var BJ=["future_device","updates_only","cli_only"];function h(J){return typeof J==="string"&&BJ.some((Q)=>Q===J)}function SJ(J=process.env,Q=d()){return J.XDG_CONFIG_HOME?.trim()||I(Q,".config")}function K(J=process.env,Q=d()){let U=x({env:J}),W=SJ(J,Q);return I(W,y(W).state==="kept"?"ara":"reason",...U==="staging"?["staging"]:[],"installation.json")}function G(J){return typeof J==="string"&&J.trim().length>0}var _J=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function IJ(J){return typeof J==="string"&&_J.test(J)}function C(J){return G(J)&&v(J)&&n(J)===J}function t(J){if(!J||typeof J!=="object"||Array.isArray(J))return!1;let Q=J;return C(Q.path)&&(Q.role==="launcher"&&(Q.kind==="file"||Q.kind==="symlink")||Q.role==="worker_root"&&Q.kind==="directory"||Q.role==="alias"&&Q.kind==="symlink"&&C(Q.target))}function g(J){return J.owned_paths?.every((Q)=>Q.role!=="alias"||J.installer==="shell"&&Q.path===I(J.install_dir,J.channel==="staging"?"reason-staging":"reason")&&Q.target===I(J.install_dir,J.channel==="staging"?"ara-staging":"ara")&&J.owned_paths?.some((U)=>U.role==="launcher"&&U.path===Q.target))??!1}function e(J,Q){try{return LJ(H(J),YJ(J))===Q}catch{return!1}}function vJ(J){let Q=P(J),U=Q==="ara"?"reason":Q==="ara-staging"?"reason-staging":null;if(!U)return J;let W=I(H(J),U);return e(W,J)?W:J}function M(J,Q){let U=HJ(J,Q);return U.length>0&&!U.startsWith("..")&&!v(U)}function JJ(J){if(J===null)return!0;if(!J||typeof J!=="object"||Array.isArray(J))return!1;let Q=J;return(Q.kind==="shell_profile"||Q.kind==="windows_user_path")&&G(Q.location)&&G(Q.value)&&(typeof Q.added_by_installer==="boolean"||typeof Q.added_by_ara==="boolean")&&(Q.added_by_installer===void 0||typeof Q.added_by_installer==="boolean")&&(Q.added_by_ara===void 0||typeof Q.added_by_ara==="boolean")}function q(J){return J.added_by_installer??J.added_by_ara??!1}function QJ(J,Q){if(Q===null)return J==="cli_only";if(!Q||typeof Q!=="object"||Array.isArray(Q))return!1;let U=Q;if(U.version!==D||!G(U.recorded_at))return!1;if(J==="future_device")return U.decision==="authorized"&&i(U.scope);return U.scope===null&&U.decision===(J==="updates_only"?"ask":"disabled")}function AJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return null;let Q=J;if(Q.schema_version!==NJ||!A.includes(Q.channel)||Q.install_method!=="curl"||Q.installer!=="shell"&&Q.installer!=="powershell"||!G(Q.installed_at)||!G(Q.version)||!G(Q.target)||!C(Q.install_dir)||!Array.isArray(Q.owned_paths)||!Q.owned_paths.every(t)||!Q.owned_paths.every((U)=>M(Q.install_dir,U.path))||!g(Q)||!JJ(Q.path_entry))return null;return{...Q,schema_version:N,installation_id:null,background_mode:"cli_only",device_consent:null}}function DJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return null;let Q=J;if(Q.schema_version!==TJ||!UJ(Q)||!h(Q.background_mode)||!QJ(Q.background_mode,Q.device_consent))return null;return{...Q,schema_version:N,installation_id:null}}function UJ(J){return A.includes(J.channel)&&(J.install_method==="curl"&&(J.installer==="shell"||J.installer==="powershell")||J.install_method==="desktop"&&J.installer==="desktop"&&Array.isArray(J.owned_paths)&&J.owned_paths.length===0&&J.path_entry===null)&&G(J.installed_at)&&G(J.version)&&G(J.target)&&C(J.install_dir)&&Array.isArray(J.owned_paths)&&J.owned_paths.every(t)&&J.owned_paths.every((Q)=>M(J.install_dir,Q.path))&&g(J)&&JJ(J.path_entry)}function KJ(J){let Q=AJ(J);if(Q)return Q;let U=DJ(J);if(U)return U;if(!J||typeof J!=="object"||Array.isArray(J))return null;let W=J;if(W.schema_version!==N||!IJ(W.installation_id)||!UJ(W)||!h(W.background_mode)||!QJ(W.background_mode,W.device_consent)||W.desktop_account_access!==void 0&&(W.desktop_account_access===null||typeof W.desktop_account_access!=="object"||Array.isArray(W.desktop_account_access)||W.desktop_account_access.version!==a||W.desktop_account_access.scope!==r||!G(W.desktop_account_access.recorded_at)||!Number.isFinite(Date.parse(W.desktop_account_access.recorded_at))))return null;return W}function E(J=K()){if(!p(J))return null;try{return KJ(JSON.parse(GJ(J,"utf8")))}catch{return null}}function f(J){return Boolean(J?.installation_id&&J.background_mode==="future_device"&&J.device_consent?.version===D&&J.device_consent.decision==="authorized"&&i(J.device_consent.scope))}function s(J,Q){let U=E(Q);if(!(f(U)&&f(J)&&U.installation_id===J.installation_id&&U.channel===J.channel))o(Q);jJ(H(Q),{recursive:!0,mode:448}),l(H(Q),448);let X=`${Q}.${process.pid}.${m()}.tmp`;try{FJ(X,`${JSON.stringify(J,null,2)}
3
+ `,{mode:384,flag:"wx"}),l(X,384),OJ(X,Q)}finally{if(p(X))VJ(X)}let Y=H(Q),$=P(Y)==="staging"?H(Y):Y;if(P($)==="reason")y(H($));return J}function RJ(J=K(),Q=new Date){let U=E(J);if(!U?.installation_id)throw Error("Reason installation ownership is missing; reinstall the current CLI before enabling Device execution");if(f(U))return U;let W={...U,background_mode:"future_device",device_consent:{version:D,decision:"authorized",scope:b,recorded_at:Q.toISOString()}};return delete W.desktop_account_access,s(W,J)}function hJ(J,Q=K(),U=new Date){if(!A.includes(J.channel))throw Error("invalid installation channel");if(!J.version.trim())throw Error("installation version is required");if(!J.target.trim())throw Error("installation target is required");let W=_(J.installDir,"install directory"),X=E(Q);if(X?.installation_id&&!J.accountAccess)return RJ(Q,U);return s({...X??{schema_version:N,channel:J.channel,install_method:"desktop",installer:"desktop",installed_at:U.toISOString(),version:J.version.trim(),target:J.target.trim(),install_dir:W,owned_paths:[],path_entry:null},schema_version:N,installation_id:X?.installation_id??m(),background_mode:"future_device",...J.accountAccess?{desktop_account_access:{version:a,scope:r,recorded_at:U.toISOString()}}:{},device_consent:{version:D,decision:"authorized",scope:b,recorded_at:U.toISOString()}},Q)}function qJ(J,Q){return J.kind===Q.kind&&J.location===Q.location&&J.value===Q.value}function _(J,Q){let U=n(J);if(!v(U))throw Error(`${Q} must be an absolute path`);return U}function CJ(J,Q=K(),U=new Date){if(!A.includes(J.channel))throw Error("invalid installation channel");if(!J.version.trim())throw Error("installation version is required");if(!J.target.trim())throw Error("installation target is required");let W=_(J.install_dir,"install directory"),X=E(Q),Y=J.backgroundMode??"preserve",$=Y==="preserve"?X?.background_mode??"cli_only":Y,L=X?.channel===J.channel&&f(X)&&$==="future_device",T=Y==="preserve"&&!X||X?.channel===J.channel&&(Y==="preserve"||L),O={path:_(J.launcherPath,"launcher path"),kind:J.launcherKind,role:"launcher"};if(!M(W,O.path))throw Error("launcher path must be inside the install directory");let z=(J.workerRoots??[]).map((j)=>_(j,"worker root"));if(z.some((j)=>!M(W,j)))throw Error("worker root must be inside the install directory");let B=[];if(J.aliasPath){let j={path:_(J.aliasPath,"alias path"),kind:"symlink",role:"alias",target:O.path};if(!g({installer:J.installer,channel:J.channel,install_dir:W,owned_paths:[O,j]})||!e(j.path,j.target))throw Error("alias must be the channel's symlink to its canonical launcher");B.push(j)}let R=[...X?.channel===J.channel&&X.install_dir===W?X.owned_paths:[],O,...B,...z.map((j)=>({path:j,kind:"directory",role:"worker_root"}))],k=Array.from(new Map(R.map((j)=>[j.path,j])).values()),Z=J.pathEntry??null,F=Z?X?.path_entry&&qJ(Z,X.path_entry)?{...Z,added_by_installer:q(Z)||q(X.path_entry),added_by_ara:q(Z)||q(X.path_entry)}:Z:X?.path_entry??null,S={schema_version:N,installation_id:X?.installation_id??m(),channel:J.channel,install_method:"curl",installer:J.installer,installed_at:U.toISOString(),version:J.version.trim(),target:J.target.trim(),install_dir:W,owned_paths:k,path_entry:F,background_mode:$,device_consent:T?X?.device_consent??null:{version:D,decision:$==="future_device"?"authorized":$==="updates_only"?"ask":"disabled",scope:$==="future_device"?b:null,recorded_at:U.toISOString()},...L&&X.desktop_account_access?{desktop_account_access:X.desktop_account_access}:{}};return s(S,Q)}function w(J,Q){let U=J.indexOf(Q);if(U===-1)return;let W=J[U+1];if(!W||W.startsWith("--"))throw Error(`${Q} needs a value`);return W}function V(J,Q){let U=w(J,Q);if(!U)throw Error(`${Q} is required`);return U}function gJ(J,Q={}){let U=Q.io??{stdout:process.stdout,stderr:process.stderr};try{let W=new Set(["--channel","--installer","--version","--target","--install-dir","--launcher-path","--launcher-kind","--worker-root","--path-kind","--path-location","--path-value","--background-mode"]);for(let Z=0;Z<J.length;Z+=1){let F=J[Z];if(F==="--path-added")continue;if(!W.has(F))throw Error(`unknown option: ${F}`);if(Z+=1,Z>=J.length)throw Error(`${F} needs a value`)}let X=Q.env??process.env,Y=V(J,"--channel"),$=x({env:X,executablePath:Q.executablePath});if(Y!==$)throw Error(`installer channel ${Y} does not match running ${$} CLI`);let L=V(J,"--installer");if(L!=="shell"&&L!=="powershell")throw Error("--installer must be shell or powershell");let T=V(J,"--launcher-kind");if(T!=="file"&&T!=="symlink")throw Error("--launcher-kind must be file or symlink");let O=w(J,"--path-kind"),z=null;if(O){if(O!=="shell_profile"&&O!=="windows_user_path")throw Error("--path-kind must be shell_profile or windows_user_path");z={kind:O,location:V(J,"--path-location"),value:V(J,"--path-value"),added_by_installer:J.includes("--path-added"),added_by_ara:J.includes("--path-added")}}else if(J.includes("--path-location")||J.includes("--path-value")||J.includes("--path-added"))throw Error("path entry flags require --path-kind");let B={channel:$,install_method:"curl",installer:L,version:V(J,"--version"),target:V(J,"--target"),install_dir:V(J,"--install-dir"),launcherPath:V(J,"--launcher-path"),launcherKind:T,workerRoots:J.flatMap((Z,F)=>{if(Z!=="--worker-root")return[];let S=J[F+1];if(!S||S.startsWith("--"))throw Error("--worker-root needs a value");return[S]}),pathEntry:z,backgroundMode:(()=>{let Z=w(J,"--background-mode")??"preserve";if(Z!=="preserve"&&!h(Z))throw Error("--background-mode must be future_device, updates_only, cli_only, or preserve");return Z})()},R=c(X,"REASON_INSTALL_ALIAS_PATH");if(R)B.aliasPath=R;let k=K(u(X,$),Q.home??d());return(Q.writeReceipt??CJ)(B,k,Q.now?.()??new Date),0}catch(W){return U.stderr.write(`Reason installer receipt: ${W instanceof Error?W.message:String(W)}
4
+ `),1}}
5
+ export{N as ge,D as he,a as ie,r as je,b as ke,BJ as le,SJ as me,K as ne,e as oe,vJ as pe,q as qe,KJ as re,E as se,f as te,RJ as ue,hJ as ve,CJ as we,gJ as xe};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Dk as D}from"./vm-hands-entry-lite-f5230h6t.js";import{execFileSync as M}from"child_process";import{realpathSync as C,statSync as N}from"fs";import{tmpdir as U}from"os";import{createRequire as F}from"module";import{win32 as Z}from"path";var j=["/bin/bash","/usr/bin/bash"],I="Git Bash was not found. Install Git for Windows (https://git-scm.com/download/win), then run `reason connect`.";function k(K){try{return N(K).isFile()}catch{return!1}}var q=(K)=>[Z.join(K,"bin","bash.exe"),Z.join(K,"usr","bin","bash.exe")];function J(K,Q){let L=Z.normalize(K).toLowerCase(),Y=(Q.SystemRoot??Q.SYSTEMROOT??"C:\\Windows").toLowerCase();return L.startsWith(Z.join(Y,"system32").toLowerCase()+"\\")||L.startsWith(Z.join(Y,"sysnative").toLowerCase()+"\\")||L.includes("\\windowsapps\\")}function u(K=process.env,Q=k){let L=[];for(let Y of(K.PATH??K.Path??"").split(";"))if(Y&&Z.isAbsolute(Y))L.push(Z.join(Y,"git.exe"));for(let Y of[K.ProgramW6432,K.ProgramFiles,K["ProgramFiles(x86)"]])if(Y)L.push(Z.join(Y,"Git","cmd","git.exe"));if(K.LOCALAPPDATA)L.push(Z.join(K.LOCALAPPDATA,"Programs","Git","cmd","git.exe"));return L.find(Q)??null}var T;function S(K=process.platform){if(K!=="win32")return"git";return T??=u(),T}function O(K){let Q=process.platform==="win32"?u(K):"git";if(!Q)return null;try{return M(Q,["--exec-path"],{encoding:"utf8",timeout:5000,windowsHide:!0,stdio:["ignore","pipe","ignore"],env:K}).trim()||null}catch{return null}}function P(K=process.env,Q=O,L=k){let Y=[],H=Q(K);if(H)Y.push(...q(Z.resolve(H,"..","..","..")));for(let $ of[K.ProgramW6432,K.ProgramFiles,K["ProgramFiles(x86)"]])if($)Y.push(...q(Z.join($,"Git")));if(K.LOCALAPPDATA)Y.push(...q(Z.join(K.LOCALAPPDATA,"Programs","Git")));for(let $ of(K.PATH??K.Path??"").split(";"))if($&&Z.isAbsolute($))Y.push(Z.join($,"bash.exe"));return Y.find(($)=>!J($,K)&&L($))??null}var z;function G(K=process.platform){if(K!=="win32")return j.find(k)??null;return z??=P(),z}function y(K=process.platform){let Q=G(K);if(!Q)throw Error(K==="win32"?I:"bash_unavailable");return Q}function w(K=process.platform){return C(K==="win32"?U():"/tmp")}function X(K=process.platform,Q=process.env){if(K!=="win32")return"/usr/bin:/bin";let L=Q.SystemRoot??Q.SYSTEMROOT??"C:\\Windows";return[Z.join(L,"System32"),L,Z.join(L,"System32","Wbem"),Z.join(L,"System32","WindowsPowerShell","v1.0")].join(";")}function W(K,Q=process.platform){if(Q!=="win32"||/[\\/]/.test(K))return K;let L=/\.exe$/i.test(K)?K:`${K}.exe`,Y=X(Q).split(";");return Z.join(L.toLowerCase()==="powershell.exe"?Y[3]:Y[0],L)}function f(K=process.platform,Q=process.env){if(K!=="win32")return{PATH:X(K)};let L=Q.SystemRoot??Q.SYSTEMROOT??"C:\\Windows";return{PATH:X(K,Q),SystemRoot:L,WINDIR:L}}function h(K=process.platform){return K==="win32"?{windowsHide:!0}:{detached:!0}}var V;function A(){if(V===void 0)V=Function("require",`return ${D}(require)`)(F(import.meta.url));return V}function v(K,Q=process.platform){let L=K.pid;if(Q!=="win32"||L===void 0)return;let Y=A();if(Y?.track(L))K.once("close",()=>Y.release(L))}function c(K,Q="SIGTERM",L=process.platform){if(L!=="win32"){process.kill(-K,Q);return}if(Q===0){process.kill(K,0);return}if(A()?.terminate(K))return;M(W("taskkill",L),["/PID",String(K),"/T","/F"],{stdio:"ignore",timeout:1e4,windowsHide:!0})}function p(K,Q=63,L=process.platform){return L==="win32"||K.uid===process.getuid?.()&&(K.mode&Q)===0}var _=/^(?:con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3]|conin\$|conout\$)(?:\..*)?$|:|[. ]$/i;function l(K){return K!=="."&&K!==".."&&_.test(K)}
3
+ export{I as qk,S as rk,G as sk,y as tk,w as uk,X as vk,W as wk,f as xk,h as yk,v as zk,c as Ak,p as Bk,l as Ck};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{wk as b}from"./vm-hands-entry-lite-r8qg3wp1.js";import{Ek as W}from"./vm-hands-entry-lite-51hmj6am.js";import{execFileSync as C}from"child_process";import{mkdirSync as f,readdirSync as K,readFileSync as k,rmSync as G,statSync as A,writeFileSync as F}from"fs";import{join as $,sep as R}from"path";import{setTimeout as L}from"timers/promises";var O=3000,Y=null;function x(z){return $(z,"users")}function I(z){if(Y?.root===z.root)return;let H=x(z.root);f(H,{recursive:!0,mode:448}),F($(H,String(process.pid)),"",{mode:384}),Y=z}function w(){if(!Y)return;G($(x(Y.root),String(process.pid)),{force:!0}),Y=null}function B(z){try{return process.kill(z,0),!0}catch(H){return H instanceof Error&&"code"in H&&H.code==="EPERM"}}function j(){let z=process.getuid?.();if(process.platform==="linux")return K("/proc").flatMap((N)=>{if(!/^\d+$/.test(N))return[];try{if(A(`/proc/${N}`).uid!==z)return[];let Q=k(`/proc/${N}/cmdline`).toString("utf8").split("\x00").join(" ").trim();return Q?[{pid:Number(N),command:Q}]:[]}catch{return[]}});if(process.platform==="win32")return C(b("powershell.exe"),["-NoLogo","-NoProfile","-NonInteractive","-Command",'Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.CommandLine)" }'],{encoding:"utf8",maxBuffer:16777216,windowsHide:!0}).split(/\r?\n/).flatMap((Q)=>{let V=/^(\d+) (.+)$/.exec(Q.trim());return V?[{pid:Number(V[1]),command:V[2]}]:[]});return C("/bin/ps",["-axww","-o","pid=,uid=,command="],{encoding:"utf8",maxBuffer:16777216}).split(`
3
+ `).flatMap((N)=>{let Q=/^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(N);return Q&&Number(Q[2])===z?[{pid:Number(Q[1]),command:Q[3]}]:[]})}async function h(){let z=Y;if(!z)return{released:"unused",stopped:0};let H=x(z.root);G($(H,String(process.pid)),{force:!0}),Y=null;let N=!1;for(let J of K(H)){let U=Number(J);if(Number.isSafeInteger(U)&&U>0&&B(U))N=!0;else G($(H,J),{force:!0})}if(N)return{released:"shared",stopped:0};let Q=j().filter((J)=>J.pid!==process.pid&&(J.command.includes(`${z.root}${R}`)||J.command.includes(`${z.automation}${R}`)||J.command.includes(z.extensionDir))),V=(J,U)=>{try{process.kill(J,U)}catch{}};for(let J of Q)V(J.pid,"SIGTERM");for(let J=Date.now()+O;Date.now()<J&&Q.some((U)=>B(U.pid));)await new Promise((U)=>setTimeout(U,100));for(let J of Q)if(B(J.pid))V(J.pid,"SIGKILL");return{released:"stopped",stopped:Q.length}}var v=20000,M=30000,P=100,Z=new Map,X=null,q=[];function y(z){Z.set(z,(Z.get(z)??0)+1);let H=!1;return()=>{if(H)return;H=!0;let N=(Z.get(z)??1)-1;if(N>0){Z.set(z,N);return}if(Z.delete(z),X?.run===z)X.idleUntil=0}}function D(){return new W("automation_desktop_busy","Another Session, or another agent of this Session, is using this worker's desktop. Retry after it finishes.")}function E(z,H){return X!==null&&X.run!==z&&(X.calls>0||H<X.idleUntil)}async function u(z,H,N=Date.now){let Q=Symbol(z);q.push(Q);try{let U=N()+M;for(;;){if(!E(z,N())&&(X?.run===z||q[0]===Q))break;if(N()>=U)throw D();await L(P,void 0,{signal:H}).catch(()=>H.throwIfAborted())}}finally{q.splice(q.indexOf(Q),1)}if(X?.run!==z)X={run:z,calls:0,idleUntil:0};let V=X;V.calls+=1;let J=!1;return()=>{if(J)return;J=!0,V.calls-=1,V.idleUntil=N()+v}}
4
+ export{I as jk,w as kk,h as lk,v as mk,M as nk,y as ok,u as pk};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Vj as w}from"./vm-hands-entry-lite-hc3p6r9p.js";var S="inference.custom.v1",K=32768,P=67108864,Q=16384,T=204800,z=600000,U=["content-type","anthropic-version","user-agent"],L=w.enum(["openai-completions","openai-responses","anthropic-messages"]),V=new Set(U),W=w.record(w.string(),w.string().max(2048)).refine((j)=>Object.keys(j).every((A)=>V.has(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)),"Only non-secret custom endpoint request headers are permitted");function F(j){try{let A=new URL(j);return["http:","https:"].includes(A.protocol)&&!A.username&&!A.password&&!A.search&&!A.hash?A:null}catch{return null}}function X(j,A){let B=F(j.baseUrl),H=F(A.baseUrl),D=F(j.url);if(!B||!H||!D||j.method!=="POST"||A.execution!=="device")return!1;let I=(J)=>J.origin+J.pathname.replace(/\/+$/,"");if(I(B)!==I(H)||D.origin!==B.origin)return!1;let O=A.api==="openai-completions"?"/chat/completions":A.api==="openai-responses"?"/responses":"/v1/messages";return D.pathname===B.pathname.replace(/\/+$/,"")+O}var b=w.object({baseUrl:w.string().max(2048),url:w.string().max(4096),method:w.literal("POST"),body:w.string().refine((j)=>new TextEncoder().encode(j).byteLength<=T).optional(),headers:W,credentialOrganizationId:w.string().uuid(),accountKey:w.string().min(1).max(256).optional()}).strict().refine((j)=>L.options.some((A)=>X(j,{baseUrl:j.baseUrl,api:A,execution:"device"})),"Invalid custom endpoint inference URL"),k=w.object({status:w.number().int().min(200).max(599),statusText:w.string().max(256).refine((j)=>!/[\r\n\0]/.test(j)),headers:w.record(w.string(),w.string().max(4096)).refine((j)=>Object.keys(j).every((A)=>["content-type","retry-after","x-request-id","request-id"].includes(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)))}).strict(),y=w.union([w.object({eof:w.literal(!0)}).strict(),w.object({eof:w.literal(!1),data:w.string().max(Math.ceil(K/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((j)=>j.length>0&&j.length*3/4-(j.endsWith("==")?2:j.endsWith("=")?1:0)<=K)}).strict()]),M=w.object({bytes:w.number().int().min(0).max(P),chunks:w.number().int().min(0).max(Q)}).strict(),p=w.object({apiKey:w.string().min(1).max(16384).refine((j)=>!/[\r\n\0]/.test(j)),api:L}).strict(),Y=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function c(j){return typeof j==="string"&&Y.includes(j)}var Z="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",G={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${Z}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."},q="Local custom endpoints require a session on your connected computer. This custom endpoint's Execution location is Your computer, so Reason cloud never calls it. Connect your computer with the Reason desktop app or CLI and run this session there, or set the endpoint's Execution location to Reason cloud with a public https Base URL in Models, or choose another model.";function _(j){return typeof j==="string"&&j.startsWith("Local custom endpoints require a session on your connected computer.")}var $=new Set(Object.values(G));function h(j){return Object.hasOwn(G,j)?G[j]:null}function v(j){return typeof j==="string"&&($.has(j)||_(j))}var N="returned HTTP 403: its firewall blocked Reason cloud",x=/^Your model endpoint \S+ (?:returned HTTP 40[34]|returned HTTP 403: its firewall blocked Reason cloud|was unreachable: it refused the connection)\.$/,C=/Attention Required! \| Cloudflare|Sorry, you have been blocked|cf-error-details/i;function n(j,A,B){if(!/^[a-z0-9.-]+$/i.test(j))return null;if(A==="connection_refused")return`Your model endpoint ${j} was unreachable: it refused the connection.`;if(A===403&&B&&C.test(B))return`Your model endpoint ${j} ${N}.`;return A===403||A===404?`Your model endpoint ${j} returned HTTP ${A}.`:null}function E(j){return typeof j==="string"&&x.test(j)}function d(j){return E(j)&&j.includes(N)}
3
- export{S as Wc,K as Xc,P as Yc,Q as Zc,T as _c,z as $c,U as ad,X as bd,b as cd,k as dd,y as ed,M as fd,p as gd,Y as hd,c as id,q as jd,_ as kd,h as ld,v as md,n as nd,E as od,d as pd};
2
+ import{ik as w}from"./vm-hands-entry-lite-zjfr0zh8.js";var S="inference.custom.v1",K=32768,P=67108864,Q=16384,T=204800,z=600000,U=["content-type","anthropic-version","user-agent"],L=w.enum(["openai-completions","openai-responses","anthropic-messages"]),V=new Set(U),W=w.record(w.string(),w.string().max(2048)).refine((j)=>Object.keys(j).every((A)=>V.has(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)),"Only non-secret custom endpoint request headers are permitted");function F(j){try{let A=new URL(j);return["http:","https:"].includes(A.protocol)&&!A.username&&!A.password&&!A.search&&!A.hash?A:null}catch{return null}}function X(j,A){let B=F(j.baseUrl),H=F(A.baseUrl),D=F(j.url);if(!B||!H||!D||j.method!=="POST"||A.execution!=="device")return!1;let I=(J)=>J.origin+J.pathname.replace(/\/+$/,"");if(I(B)!==I(H)||D.origin!==B.origin)return!1;let O=A.api==="openai-completions"?"/chat/completions":A.api==="openai-responses"?"/responses":"/v1/messages";return D.pathname===B.pathname.replace(/\/+$/,"")+O}var b=w.object({baseUrl:w.string().max(2048),url:w.string().max(4096),method:w.literal("POST"),body:w.string().refine((j)=>new TextEncoder().encode(j).byteLength<=T).optional(),headers:W,credentialOrganizationId:w.string().uuid(),accountKey:w.string().min(1).max(256).optional()}).strict().refine((j)=>L.options.some((A)=>X(j,{baseUrl:j.baseUrl,api:A,execution:"device"})),"Invalid custom endpoint inference URL"),k=w.object({status:w.number().int().min(200).max(599),statusText:w.string().max(256).refine((j)=>!/[\r\n\0]/.test(j)),headers:w.record(w.string(),w.string().max(4096)).refine((j)=>Object.keys(j).every((A)=>["content-type","retry-after","x-request-id","request-id"].includes(A))&&Object.values(j).every((A)=>!/[\r\n\0]/.test(A)))}).strict(),y=w.union([w.object({eof:w.literal(!0)}).strict(),w.object({eof:w.literal(!1),data:w.string().max(Math.ceil(K/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((j)=>j.length>0&&j.length*3/4-(j.endsWith("==")?2:j.endsWith("=")?1:0)<=K)}).strict()]),M=w.object({bytes:w.number().int().min(0).max(P),chunks:w.number().int().min(0).max(Q)}).strict(),p=w.object({apiKey:w.string().min(1).max(16384).refine((j)=>!/[\r\n\0]/.test(j)),api:L}).strict(),Y=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function c(j){return typeof j==="string"&&Y.includes(j)}var Z="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",G={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${Z}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."},q="Local custom endpoints require a session on your connected computer. This custom endpoint's Execution location is Your computer, so Reason cloud never calls it. Connect your computer with the Reason desktop app or CLI and run this session there, or set the endpoint's Execution location to Reason cloud with a public https Base URL in Models, or choose another model.";function _(j){return typeof j==="string"&&j.startsWith("Local custom endpoints require a session on your connected computer.")}var $=new Set(Object.values(G));function h(j){return Object.hasOwn(G,j)?G[j]:null}function v(j){return typeof j==="string"&&($.has(j)||_(j))}var N="returned HTTP 403: its firewall blocked Reason cloud",x=/^Your model endpoint \S+ (?:returned HTTP 40[34]|returned HTTP 403: its firewall blocked Reason cloud|was unreachable: it refused the connection)\.$/,C=/Attention Required! \| Cloudflare|Sorry, you have been blocked|cf-error-details/i;function n(j,A,B){if(!/^[a-z0-9.-]+$/i.test(j))return null;if(A==="connection_refused")return`Your model endpoint ${j} was unreachable: it refused the connection.`;if(A===403&&B&&C.test(B))return`Your model endpoint ${j} ${N}.`;return A===403||A===404?`Your model endpoint ${j} returned HTTP ${A}.`:null}function E(j){return typeof j==="string"&&x.test(j)}function d(j){return E(j)&&j.includes(N)}
3
+ export{S as gd,K as hd,P as id,Q as jd,T as kd,z as ld,U as md,X as nd,b as od,k as pd,y as qd,M as rd,p as sd,Y as td,c as ud,q as vd,_ as wd,h as xd,v as yd,n as zd,E as Ad,d as Bd};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}
3
- export{r as Sc};
3
+ export{r as _c};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{resolve as H,sep as J}from"path";var K=[[".ssh"],[".gnupg"],[".aws"],[".azure"],[".kube"],[".docker"],[".infisical"],[".password-store"],[".terraform.d"],[".config","ara"],[".config","reason"],[".config","gh"],[".config","gcloud"],[".config","infisical"],[".config","op"],[".config","1password"],[".config","pass"],[".local","share","keyrings"],["library","keychains"],["library","application support","so.ara.desktop"],["appdata","roaming","github cli"],["appdata","roaming","gcloud"],["appdata","roaming","microsoft","credentials"],["appdata","local","microsoft","credentials"],["appdata","roaming","microsoft","protect"],["appdata","roaming","1password"],["appdata","local","1password"],["appdata","roaming","microsoft","windows","start menu","programs","startup"],["documents","windowspowershell"],["documents","powershell"],["appdata","local","reason"]],V=[[".codex","config.toml"],[".cursor","mcp.json"],[".claude","settings.json"],[".claude","settings.local.json"],[".cargo","credentials"],[".cargo","credentials.toml"],[".gem","credentials"],[".config","git","config"],[".config","git","credentials"],[".config","pip","pip.conf"]],Z=new Set([".bash_login",".bash_profile",".bashrc",".bunfig.toml",".claude.json",".env",".envrc",".git-credentials",".gitconfig",".mcp.json",".netrc",".npmrc",".profile",".pypirc",".terraformrc",".yarnrc",".yarnrc.yml",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","auth.json","credentials.json","credentials.tfrc.json","local-daemon.json","local-device.json","mcp.json"]),$=[".key",".p12",".pfx",".pem"];function B(z,j){if(z.length<j.length)return!1;for(let k=0;k<=z.length-j.length;k+=1)if(j.every((b,G)=>z[k+G]===b))return!0;return!1}function A(z){let j=H(z).split(J).filter(Boolean).map((b)=>b.toLowerCase());if(K.some((b)=>B(j,b)))return!0;if(V.some((b)=>B(j,b)))return!0;let k=j.at(-1)??"";return Z.has(k)||k.startsWith(".env.")||$.some((b)=>k.endsWith(b))}
3
+ export{K as Ri,V as Si,Z as Ti,$ as Ui,A as Vi};