@reason-machines/cli-linux-arm64-musl 0.2.381 → 0.2.382
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/README.md +3 -1
- package/bin/ara +2 -2
- package/bin/vm-hands/api-credentials-xppmbg0m.js +2 -0
- package/bin/vm-hands/api-xmpbsm6b.js +2 -0
- package/bin/vm-hands/{ask-relay-fc0jc3t5.js → ask-relay-zjqyxvxe.js} +3 -3
- package/bin/vm-hands/connect-cli-ehxeg8m5.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-zhpake9f.js → custom-endpoint-device-bm94e9r0.js} +1 -1
- package/bin/vm-hands/desktop-account-3tnm4z5w.js +2 -0
- package/bin/vm-hands/{device-workspace-vbcry9d6.js → device-workspace-0xsj5ykf.js} +1 -1
- package/bin/vm-hands/hands-worker-source-azdrrhsz.js +2 -0
- package/bin/vm-hands/{index-bbk6a9sk.js → index-7f2kwwen.js} +1 -1
- package/bin/vm-hands/{install-receipt-7x81ek76.js → install-receipt-3xyx3rdd.js} +1 -1
- package/bin/vm-hands/local-automation-ynx1qr9v.js +2 -0
- package/bin/vm-hands/local-capabilities-855ch0dq.js +2 -0
- package/bin/vm-hands/local-desktop-users-ajb81vjm.js +2 -0
- package/bin/vm-hands/local-display-mac-9h6btvvq.js +2 -0
- package/bin/vm-hands/local-display-session-f9ywkbba.js +2 -0
- package/bin/vm-hands/local-pty-session-cjas515w.js +2 -0
- package/bin/vm-hands/managed-runtime-dars4628.js +2 -0
- package/bin/vm-hands/{network-contract-zqvt1v0t.js → network-contract-dsw79qkc.js} +1 -1
- package/bin/vm-hands/package-smk3nqjs.js +2 -0
- package/bin/vm-hands/permissions-pdmhp2s3.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-8fxjynte.js → reason-hands-protocol-7d7xj1h3.js} +1 -1
- package/bin/vm-hands/serve-service-n6xd6323.js +2 -0
- package/bin/vm-hands/status-2m75kz1h.js +96 -0
- package/bin/vm-hands/version-74zqccyz.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-06qnb2w1.js +458 -0
- package/bin/vm-hands/{vm-hands-entry-lite-7shpbsw8.js → vm-hands-entry-lite-1gxktkpe.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hgkf1svv.js → vm-hands-entry-lite-23bb8ce4.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-245929bs.js +346 -0
- package/bin/vm-hands/vm-hands-entry-lite-2e18tm6w.js +245 -0
- package/bin/vm-hands/{vm-hands-entry-lite-g036gtem.js → vm-hands-entry-lite-2t0vcvd8.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-0asdf4pm.js → vm-hands-entry-lite-2tcjqgfp.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-3n3xh0xv.js +540 -0
- package/bin/vm-hands/vm-hands-entry-lite-50n6vbfx.js +251 -0
- package/bin/vm-hands/{vm-hands-entry-lite-j2q1k9vb.js → vm-hands-entry-lite-51hmj6am.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-zfwg7ehq.js → vm-hands-entry-lite-5n4vsm6b.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-8fj07njx.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-4q8tsaqv.js → vm-hands-entry-lite-8zawqa9q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-3hbe4em3.js → vm-hands-entry-lite-9cmfthkq.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-45j8qwsf.js → vm-hands-entry-lite-9w5vs9zv.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-k7wwza46.js → vm-hands-entry-lite-aj1ccphg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-za55dtte.js → vm-hands-entry-lite-ammr3xbc.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-yjn6sk08.js → vm-hands-entry-lite-ch7y4b1b.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-34e71nbe.js → vm-hands-entry-lite-cwe16c51.js} +174 -16
- package/bin/vm-hands/vm-hands-entry-lite-dh5gwmyf.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-dsdwzasy.js +105 -0
- package/bin/vm-hands/{vm-hands-entry-lite-5pm6bhb8.js → vm-hands-entry-lite-e0gdt6r5.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5kgvss4p.js → vm-hands-entry-lite-e2mjbqmr.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-ejm5er3h.js +7 -0
- package/bin/vm-hands/{vm-hands-entry-lite-mh0xecf3.js → vm-hands-entry-lite-f02906k8.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite-f5230h6t.js +67 -0
- package/bin/vm-hands/{vm-hands-entry-lite-zh8p7ndn.js → vm-hands-entry-lite-fb5dzy9x.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-fyvgav60.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-g7h6wjqy.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-h8dbw0c7.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-nhtb458c.js → vm-hands-entry-lite-hnsm5t36.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-r6pap1kh.js → vm-hands-entry-lite-ma001vzh.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-anmv8hp7.js → vm-hands-entry-lite-mn64e4pt.js} +286 -104
- package/bin/vm-hands/{vm-hands-entry-lite-9cgm6g8t.js → vm-hands-entry-lite-pk3q774c.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-qef2ndkd.js +6 -0
- package/bin/vm-hands/vm-hands-entry-lite-qnnfvm5r.js +5 -0
- package/bin/vm-hands/vm-hands-entry-lite-qwf78yqr.js +11 -0
- package/bin/vm-hands/vm-hands-entry-lite-r8qg3wp1.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-rd0ak4ye.js +4 -0
- package/bin/vm-hands/{vm-hands-entry-lite-00qsbphw.js → vm-hands-entry-lite-rpn0frzb.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-g9rvf5qk.js → vm-hands-entry-lite-rtt2w6c6.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-sex82vb1.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-dgxxsdwb.js → vm-hands-entry-lite-xrthfx3q.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-kxdw4myj.js → vm-hands-entry-lite-y2s2w174.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hc3p6r9p.js → vm-hands-entry-lite-zjfr0zh8.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-qssgfea1.js → vm-hands-executor-yx6mxa2p.js} +1 -1
- package/bin/vm-hands/vm-hands-op-runner-yt3v3v6w.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-5me6cpmn.js → vm-hands-runtime-ygddqgbs.js} +3 -3
- package/bin/vm-hands/worker-sandbox-tgqbmy6b.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-af9g18n7.js +0 -2
- package/bin/vm-hands/api-credentials-65mrr3tn.js +0 -2
- package/bin/vm-hands/connect-cli-j478km3s.js +0 -2
- package/bin/vm-hands/desktop-account-5zvgspyw.js +0 -2
- package/bin/vm-hands/hands-worker-source-h0b1j53p.js +0 -2
- package/bin/vm-hands/local-automation-c86tjeft.js +0 -2
- package/bin/vm-hands/local-capabilities-1h99gkt6.js +0 -2
- package/bin/vm-hands/local-desktop-users-0hadyvx1.js +0 -2
- package/bin/vm-hands/local-display-mac-v1pc7177.js +0 -2
- package/bin/vm-hands/local-display-session-tzq0hne8.js +0 -2
- package/bin/vm-hands/local-pty-session-hs7rq03x.js +0 -2
- package/bin/vm-hands/managed-runtime-5dqaaw1x.js +0 -2
- package/bin/vm-hands/package-3cd7cfyv.js +0 -2
- package/bin/vm-hands/permissions-vbyqjbyb.js +0 -2
- package/bin/vm-hands/serve-service-be739c9s.js +0 -2
- package/bin/vm-hands/status-s8ny6men.js +0 -96
- package/bin/vm-hands/version-8s4syrp2.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-1085xsma.js +0 -5
- package/bin/vm-hands/vm-hands-entry-lite-4m40gwkf.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-62wmnm7g.js +0 -540
- package/bin/vm-hands/vm-hands-entry-lite-98076n5g.js +0 -62
- package/bin/vm-hands/vm-hands-entry-lite-bvbfcp1k.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-c01eyep6.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-dcynw6t2.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-hh24bq0d.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-jb2sr2r7.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-kt5aj2ax.js +0 -11
- package/bin/vm-hands/vm-hands-entry-lite-n9nnb482.js +0 -459
- package/bin/vm-hands/vm-hands-entry-lite-sb9a1jcn.js +0 -4
- package/bin/vm-hands/vm-hands-entry-lite-xg3d0a2y.js +0 -340
- package/bin/vm-hands/vm-hands-entry-lite-zamt8xp7.js +0 -181
- package/bin/vm-hands/vm-hands-entry-lite-ze9msfq1.js +0 -3
- package/bin/vm-hands/vm-hands-op-runner-b76rjaps.js +0 -2
- package/bin/vm-hands/worker-sandbox-wpzkvwer.js +0 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var e=String.raw`(function(require) {
|
|
3
|
+
if (process.platform !== "win32") return null;
|
|
4
|
+
let ffi, kernel32;
|
|
5
|
+
try {
|
|
6
|
+
ffi = require("bun:ffi");
|
|
7
|
+
const { FFIType } = ffi;
|
|
8
|
+
kernel32 = ffi.dlopen("kernel32.dll", {
|
|
9
|
+
CreateJobObjectW: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
10
|
+
SetInformationJobObject: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.u32], returns: FFIType.i32 },
|
|
11
|
+
QueryInformationJobObject: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
12
|
+
OpenProcess: { args: [FFIType.u32, FFIType.i32, FFIType.u32], returns: FFIType.u64 },
|
|
13
|
+
AssignProcessToJobObject: { args: [FFIType.u64, FFIType.u64], returns: FFIType.i32 },
|
|
14
|
+
TerminateJobObject: { args: [FFIType.u64, FFIType.u32], returns: FFIType.i32 },
|
|
15
|
+
CloseHandle: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
16
|
+
}).symbols;
|
|
17
|
+
} catch { return null; }
|
|
18
|
+
const jobs = new Map();
|
|
19
|
+
// JOBOBJECT_EXTENDED_LIMIT_INFORMATION (144 bytes, 64-bit): LimitFlags at 16.
|
|
20
|
+
const limit = (job, flags) => {
|
|
21
|
+
const limits = Buffer.alloc(144);
|
|
22
|
+
limits.writeUInt32LE(flags, 16);
|
|
23
|
+
return kernel32.SetInformationJobObject(job, 9, ffi.ptr(limits), 144) !== 0;
|
|
24
|
+
};
|
|
25
|
+
// Closing a job normally leaves what still runs in it running, as a process
|
|
26
|
+
// group's members outlive their leader; only terminate() or this process
|
|
27
|
+
// dying (its handles closing with KILL_ON_JOB_CLOSE still set) stops them.
|
|
28
|
+
const close = (job) => { limit(job, 0x800); kernel32.CloseHandle(job); };
|
|
29
|
+
return {
|
|
30
|
+
/** Puts the process in a new kill-on-close job; false when it could not. */
|
|
31
|
+
track(pid) {
|
|
32
|
+
const job = BigInt(kernel32.CreateJobObjectW(null, null));
|
|
33
|
+
if (job === 0n) return false;
|
|
34
|
+
const handle = BigInt(kernel32.OpenProcess(0x0101, 0, pid)); // PROCESS_SET_QUOTA | PROCESS_TERMINATE
|
|
35
|
+
// KILL_ON_JOB_CLOSE | BREAKAWAY_OK: a process that asks to leave (srt-win's
|
|
36
|
+
// broker, for its own sandbox job) may; everything else stays in.
|
|
37
|
+
const assigned = handle !== 0n && limit(job, 0x2000 | 0x800) && kernel32.AssignProcessToJobObject(job, handle) !== 0;
|
|
38
|
+
if (handle !== 0n) kernel32.CloseHandle(handle);
|
|
39
|
+
if (!assigned) { kernel32.CloseHandle(job); return false; }
|
|
40
|
+
// A reused pid: the earlier job's leader is gone; that job is forgotten as release() does.
|
|
41
|
+
if (jobs.has(pid)) close(jobs.get(pid));
|
|
42
|
+
jobs.set(pid, job);
|
|
43
|
+
return true;
|
|
44
|
+
},
|
|
45
|
+
/** How many processes of the job tracked for this pid still run; null when none is tracked. */
|
|
46
|
+
active(pid) {
|
|
47
|
+
const job = jobs.get(pid);
|
|
48
|
+
if (job === undefined) return null;
|
|
49
|
+
// JOBOBJECT_BASIC_ACCOUNTING_INFORMATION (48 bytes): ActiveProcesses at 40.
|
|
50
|
+
const information = Buffer.alloc(48);
|
|
51
|
+
return kernel32.QueryInformationJobObject(job, 1, ffi.ptr(information), 48, null) !== 0 ? information.readUInt32LE(40) : null;
|
|
52
|
+
},
|
|
53
|
+
/** Stops every process in the job tracked for this pid; false when none is tracked. */
|
|
54
|
+
terminate(pid) {
|
|
55
|
+
const job = jobs.get(pid);
|
|
56
|
+
return job !== undefined && kernel32.TerminateJobObject(job, 1) !== 0;
|
|
57
|
+
},
|
|
58
|
+
/** Forgets the job, leaving whatever still runs in it running. */
|
|
59
|
+
release(pid) {
|
|
60
|
+
const job = jobs.get(pid);
|
|
61
|
+
if (job === undefined) return;
|
|
62
|
+
jobs.delete(pid);
|
|
63
|
+
close(job);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
})`;
|
|
67
|
+
export{e as Dk};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{lj as J}from"./vm-hands-entry-lite-fyvgav60.js";import{readFileSync as L}from"fs";import{isAbsolute as M,normalize as Q}from"path";var W="REASON_WORKER_DESKTOP_USER",G=null;function X(q,B){for(let I of B.split(`
|
|
3
3
|
`)){let j=I.split(":");if(j.length<7||Number(j[2])!==q||!/^\d+$/.test(j[2])||!/^\d+$/.test(j[3]))continue;let x=j[5];if(!/^[a-z_][a-z0-9_-]*$/i.test(j[0])||!M(x)||Q(x)!==x||x==="/")return null;return{username:j[0],uid:q,gid:Number(j[3]),home:x}}return null}function b(q={}){let B="value"in q?q.value:process.env[W];if(G=null,B===void 0||B==="")return null;let I=q.platform??process.platform,j="euid"in q?q.euid:process.geteuid?.(),x=/^[1-9]\d{0,9}$/.test(B)?Number(B):NaN,C=I==="linux"&&j===0&&Number.isSafeInteger(x)?X(x,(q.passwd??(()=>L("/etc/passwd","utf8")))()):null;if(!C||C.gid===0)throw Error("worker_desktop_user_invalid");return G=C,C}function k(){return G}function y(){return G?.home??J()}
|
|
4
|
-
export{W as
|
|
4
|
+
export{W as Og,X as Pg,b as Qg,k as Rg,y as Sg};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{uj as X,wj as Y,yj as Z}from"./vm-hands-entry-lite-pk3q774c.js";import{execFileSync as z}from"child_process";import{existsSync as V,realpathSync as M}from"fs";import{userInfo as D}from"os";import{isAbsolute as $,join as C,normalize as F,parse as K}from"path";function Q(){let q=F(D().homedir);if(!$(q)||q===K(q).root)throw Error("Could not resolve the canonical user home.");return q}function O(q,B,J=Q()){let L=Z(B);if(B.kind==="managed"&&B.base){let G=M(J);return{anchor:G,boundary:C(G,B.base),path:C(G,L)}}if(B.kind==="root"&&Y(B.path)){let G=M(J);return{anchor:G,boundary:C(G,X),path:C(G,L)}}return{anchor:q,boundary:q,path:C(q,L)}}function _(q=Q()){return C(q,".config")}function b(){if(process.platform!=="darwin")return null;try{let q=z("/usr/bin/getconf",["DARWIN_USER_DIR"],{encoding:"utf8",timeout:5000}).trim();return $(q)?M(q):null}catch{return null}}function g(q=Q()){let B=C(q,"Library","Application Support","Ara"),J=C(q,"Library","Application Support","Reason");return V(B)&&!V(J)?B:J}
|
|
3
|
+
export{Q as lj,O as mj,_ as nj,b as oj,g as pj};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{spawn as N}from"child_process";import{statSync as O}from"fs";import{delimiter as Q,join as R}from"path";function X(q,z=process.env.PATH??"",D=process.env,G=process.platform){let A=G==="win32",H=q.includes("/")||A&&q.includes("\\");if(!q||H||q.includes("\x00"))return!1;let I=A?["",...(D.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];return z.split(Q).some((C)=>{if(!C)return!1;return I.some((E)=>{if(E===void 0)return!1;try{let J=O(R(C,`${q}${E}`));if(!J.isFile())return!1;return A||(J.mode&73)!==0}catch{return!1}})})}async function K(q){if(!q)return"";let z=[];try{for await(let D of q)z.push(Buffer.from(D))}catch{}return Buffer.concat(z).toString("utf8")}async function Y(q,z){let[D,...G]=q;if(!D)throw Error("A child process probe requires a program.");if(z.signal?.aborted)return{exitCode:-1,stdout:"",stderr:""};let A=N(D,G,{stdio:["ignore","pipe","pipe"],...z.env?{env:z.env}:{}}),H=K(A.stdout),I=K(A.stderr),C=()=>{try{A.kill()}catch{}};if(z.signal?.aborted)C();else z.signal?.addEventListener("abort",C,{once:!0});let E;try{return{exitCode:await Promise.race([new Promise((F)=>{A.once("error",()=>F(-1)),A.once("close",(M)=>F(M??-1))}),new Promise((F)=>{E=setTimeout(()=>{C(),F(-1)},z.timeoutMs)})]),stdout:await H,stderr:await I}}finally{if(E)clearTimeout(E);z.signal?.removeEventListener("abort",C)}}function Z(q){if(!(q>0))return;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,q)}
|
|
3
|
+
export{X as dd,Y as ed,Z as fd};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bk as N}from"./vm-hands-entry-lite-r8qg3wp1.js";import{randomUUID as K}from"crypto";import{closeSync as L,constants as V,fstatSync as M,lstatSync as Z,mkdirSync as $,openSync as O,readFileSync as T,realpathSync as b,renameSync as U,unlinkSync as X,writeFileSync as Y}from"fs";import{dirname as g,resolve as z}from"path";var A=65536;function J(j){try{return Z(j),!0}catch(q){if(q instanceof Error&&"code"in q&&q.code==="ENOENT")return!1;throw q}}function I(j,q=!1){if(!J(j)){if(!q)throw Error("worker_state_missing");D(j),$(j,{mode:448})}let C=Z(j);if(!C.isDirectory()||C.isSymbolicLink()||!N(C)||b(j)!==z(j))throw Error("worker_state_directory_not_private_or_canonical")}function D(j){let q=g(j);if(!J(q))D(q),$(q,{mode:448});if(b(q)!==z(q))throw Error("worker_parent_not_canonical")}function u(j,q=A){let C=O(j,V.O_RDONLY|V.O_NOFOLLOW);try{let G=M(C);if(!G.isFile()||G.nlink!==1||!N(G)||G.size>q)throw Error("worker_file_not_private");return T(C,"utf8")}finally{L(C)}}function f(j,q,C=A){let G=JSON.stringify(q);if(G===void 0)throw Error("worker_file_invalid");let Q=G+`
|
|
3
|
+
`;if(Buffer.byteLength(Q,"utf8")>C)throw Error("worker_file_too_large");if(I(g(j)),J(j))u(j,C);let H=`${j}.${K()}`;try{Y(H,Q,{mode:384,flag:"wx"}),U(H,j)}finally{if(J(H))X(H)}}
|
|
4
|
+
export{J as $c,I as ad,u as bd,f as cd};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{D as T,F as U}from"./vm-hands-entry-lite-
|
|
2
|
+
import{D as T,F as U}from"./vm-hands-entry-lite-f02906k8.js";import{_c as V}from"./vm-hands-entry-lite-rtt2w6c6.js";import{mi as M,oi as Q}from"./vm-hands-entry-lite-e2mjbqmr.js";import{Ci as G}from"./vm-hands-entry-lite-ma001vzh.js";function W(j,B){let k=G(j,"REASON_API_URL")?.trim();if(!k)return Q(B);let z=new URL(k);if(z.protocol!=="https:"&&!(z.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(z.hostname)))throw Error("REASON_API_URL must use HTTPS (HTTP is allowed only for loopback development).");return z.origin}function X(j){return G(j,"REASON_API_URL")?.trim()?W(j,"production"):void 0}function $(j){return G(j,"REASON_API_KEY")?.trim()||void 0}async function N(j,B){let k=j.env??process.env,z=$(k);if(!z)return(j.getCredentials??T)({apiOrigin:X(k),signal:B});let J=W(k,j.channel??M({env:k})),D=await(j.fetchImpl??fetch)(J+"/v3/self",{redirect:"error",headers:{authorization:"Bearer "+z,accept:"application/json"},signal:B}),L=await D.json().catch(()=>({})),w=V(L)?L:{};if(!D.ok){let H=typeof w.detail==="string"?w.detail:typeof w.message==="string"?w.message:"API key authentication failed ("+D.status+")";throw new U(D.status,typeof w.error==="string"?w.error:"api_key_auth_failed",H)}if(typeof w.org_id!=="string"||!w.org_id)throw Error("The API key in the environment did not resolve to a Workspace.");let Z=Array.isArray(w.scopes)?w.scopes.filter((H)=>typeof H==="string"):[];return{credentialKind:"api_key",apiOrigin:J,accessToken:z,orgId:w.org_id,clientId:"api-key",refreshToken:"",expiresAt:"",scopes:Z}}async function P(j){let B=await N(j),k=X(j.env??process.env);if(!B)throw Error(k?`Not signed in to ${k}. Set REASON_API_KEY, or run \`reason login --api-url ${k}\`.`:"Not signed in. Run `reason login`, or set REASON_API_KEY.");return B}
|
|
3
3
|
export{W as v,X as w,$ as x,N as y,P as z};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var p={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"},z=Object.values(p),x=new Set;function B(k,j){let q=k[j];if(q?.trim())return q;let w=k[p[j]];if(w?.trim())x.add(p[j]);return w}function D(k,j){return{[k]:j,[p[k]]:j}}
|
|
3
|
-
export{B as
|
|
3
|
+
export{B as Ci,D as Di};
|