@reason-machines/cli-linux-x64 0.2.553 → 0.2.554
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/reason +1 -1
- package/bin/vm-hands/api-1dsd0n4x.js +2 -0
- package/bin/vm-hands/api-credentials-gtrz9r3n.js +2 -0
- package/bin/vm-hands/connect-cli-jbwaswpq.js +2 -0
- package/bin/vm-hands/{desktop-account-d7x4xn27.js → desktop-account-t0afsge2.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-wc8a2nhs.js → hands-worker-source-qj7s9dk5.js} +1 -1
- package/bin/vm-hands/local-automation-c75g446p.js +2 -0
- package/bin/vm-hands/local-capabilities-1kcxmz0s.js +2 -0
- package/bin/vm-hands/{local-desktop-users-tjcpyakd.js → local-desktop-users-5scb9930.js} +1 -1
- package/bin/vm-hands/local-display-mac-pft73te9.js +2 -0
- package/bin/vm-hands/local-display-session-hvbp46qx.js +2 -0
- package/bin/vm-hands/local-display-video-yh6hfavd.js +2 -0
- package/bin/vm-hands/local-managed-process-g6vsy02z.js +2 -0
- package/bin/vm-hands/local-pty-session-njd0tprg.js +2 -0
- package/bin/vm-hands/{managed-runtime-9p83xxgg.js → managed-runtime-htxs6v4q.js} +1 -1
- package/bin/vm-hands/permissions-mhd63yr2.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-g54rtrhd.js +2 -0
- package/bin/vm-hands/{serve-service-83tm7ky3.js → serve-service-38k4j5rf.js} +1 -1
- package/bin/vm-hands/{status-mtmtkbbp.js → status-m1crm0qs.js} +2 -2
- package/bin/vm-hands/version-qp2wr1ds.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-645wzfhr.js → vm-hands-entry-lite-0wsr8edk.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-3dccjjq2.js → vm-hands-entry-lite-1pp7czc0.js} +24 -24
- package/bin/vm-hands/{vm-hands-entry-lite-kmtz5h74.js → vm-hands-entry-lite-1yv5qqew.js} +22 -22
- package/bin/vm-hands/{vm-hands-entry-lite-k9vk84wa.js → vm-hands-entry-lite-2v4zh9ze.js} +5 -5
- package/bin/vm-hands/vm-hands-entry-lite-3mn5c8wd.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-72nj66ab.js → vm-hands-entry-lite-46pwqvpf.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-55ja13pk.js → vm-hands-entry-lite-6qq4f3v5.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ycddfgr4.js → vm-hands-entry-lite-8mttvhef.js} +8 -8
- package/bin/vm-hands/{vm-hands-entry-lite-0yvkh3bg.js → vm-hands-entry-lite-a6brf7zp.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9azmqs47.js → vm-hands-entry-lite-ak0hd94p.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-2hfrcr50.js → vm-hands-entry-lite-bpamn7ny.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-w29d7ey0.js → vm-hands-entry-lite-dgfx0rbn.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-hq76nmrc.js → vm-hands-entry-lite-drggrrr8.js} +15 -15
- package/bin/vm-hands/{vm-hands-entry-lite-qdrmhn3f.js → vm-hands-entry-lite-g8md08wv.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-8s4namcq.js → vm-hands-entry-lite-ggyexab2.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5tnma5qb.js → vm-hands-entry-lite-gje7xvy9.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-hfx1q0b0.js → vm-hands-entry-lite-h1qjggz0.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-y9jarm7q.js → vm-hands-entry-lite-h2rq71rj.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-6pqfr3w2.js → vm-hands-entry-lite-h78c4zxd.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-zrkw5syq.js → vm-hands-entry-lite-jha299pc.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-sb7b4z8t.js → vm-hands-entry-lite-n7bd44rm.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-gezw3967.js → vm-hands-entry-lite-pg2czhxb.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-13s0mfpr.js → vm-hands-entry-lite-q2h781jg.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-xe0benev.js → vm-hands-entry-lite-qd46yhvz.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-qdzbd077.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-x3ym5t8r.js → vm-hands-entry-lite-r1n9zhsm.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-y5hv1gjv.js → vm-hands-entry-lite-ravxhygk.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-whfrwyxm.js → vm-hands-entry-lite-rp2twenv.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-8hwmhvyx.js → vm-hands-entry-lite-sqzryt00.js} +16 -16
- package/bin/vm-hands/{vm-hands-entry-lite-xrqztkhv.js → vm-hands-entry-lite-wghmyfba.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-e16bhf16.js → vm-hands-entry-lite-x8wjxgwr.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-n5vw984z.js → vm-hands-executor-0b1azv5m.js} +1 -1
- package/bin/vm-hands/{vm-hands-op-runner-91w40a0z.js → vm-hands-op-runner-f2pye28r.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-08q76986.js → vm-hands-runtime-7cwr0sys.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-gy36ejp9.js +2 -0
- package/bin/vm-hands/worker-sandbox-f1tfb3y0.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-18f1batz.js +0 -2
- package/bin/vm-hands/api-credentials-6jgf7w9q.js +0 -2
- package/bin/vm-hands/connect-cli-xgbm9xfg.js +0 -2
- package/bin/vm-hands/local-automation-gc28rhzv.js +0 -2
- package/bin/vm-hands/local-capabilities-aa7m3ac6.js +0 -2
- package/bin/vm-hands/local-display-mac-gtp439kc.js +0 -2
- package/bin/vm-hands/local-display-session-wkhda8j7.js +0 -2
- package/bin/vm-hands/local-display-video-14fj7scm.js +0 -2
- package/bin/vm-hands/local-managed-process-hq1x6wqt.js +0 -2
- package/bin/vm-hands/local-pty-session-yr22ryvy.js +0 -2
- package/bin/vm-hands/permissions-5dhys0br.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-k12sw3vm.js +0 -2
- package/bin/vm-hands/version-8z8e46x9.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-r7tb2z3z.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-vn7ag8c7.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-84stxabw.js +0 -2
- package/bin/vm-hands/worker-sandbox-563c5g2f.js +0 -2
- /package/bin/vm-hands/{vm-hands-entry-lite-b6gsggvp.js → vm-hands-entry-lite-tyem93c1.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-
|
|
2
|
+
import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-n7bd44rm.js";import"./vm-hands-entry-lite-s85p7tqp.js";import{at,co,xr,Nt}from"./vm-hands-entry-lite-drggrrr8.js";import"./vm-hands-entry-lite-wghmyfba.js";import"./vm-hands-entry-lite-1yv5qqew.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-qd46yhvz.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-gje7xvy9.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-dgfx0rbn.js";import"./vm-hands-entry-lite-h2rq71rj.js";import{ur,dr,Rt,Tt}from"./vm-hands-entry-lite-rp2twenv.js";import"./vm-hands-entry-lite-bpamn7ny.js";import"./vm-hands-entry-lite-h1qjggz0.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-tyem93c1.js";import{spawn as Me}from"child_process";import{chmodSync as Le,chownSync as Te,existsSync as E,lstatSync as ee,mkdirSync as J,mkdtempSync as We,readdirSync as X,readFileSync as k,realpathSync as He,rmdirSync as pe,rmSync as ze,writeFileSync as B}from"fs";import{basename as Ue,dirname as Be,join as d}from"path";import{readFileSync as ae,readlinkSync as ce}from"fs";import{relative as Ne}from"path";var ue=16;function le(e){return e.replace(/\\([0-7]{3})/g,(r,t)=>String.fromCharCode(Number.parseInt(t,8)))}function De(e){let r=[];for(let t of e.split(`
|
|
3
3
|
`)){let n=t.split(" ");if(n.length<10||!/^\d+:\d+$/.test(n[2]))continue;r.push({device:n[2],root:le(n[3]),mountPoint:le(n[4])})}return r}function Ae(e,r,t){let n=e.replace(/\/+$/,"")||"/",c=(m)=>n==="/"||m===n||m.startsWith(`${n}/`),o=(m)=>new Map(De(m).filter((_)=>c(_.mountPoint)).map((_)=>[`${_.mountPoint}\x00${_.device}\x00${_.root}`,_.mountPoint])),l=o(r),p=o(t),b=(m)=>Ne(n,m)||".",P=[...l].filter(([m])=>!p.has(m)).map(([,m])=>b(m)),x=[...p].filter(([m])=>!l.has(m)).map(([,m])=>b(m));return{missing:P,extra:x,referenceCount:l.size,ownCount:p.size}}function de(e,r,t,n="/proc"){let c,o,l=null;try{c=ae(`${n}/1/mountinfo`,"utf8"),o=ae(`${n}/self/mountinfo`,"utf8")}catch(_){let O=_&&typeof _==="object"&&"code"in _&&typeof _.code==="string"?_.code:"unreadable";r("vm_hands.mount_check_unavailable",{code:O});return}try{l=ce(`${n}/1/ns/mnt`)===ce(`${n}/self/ns/mnt`)}catch{}let{missing:p,extra:b,referenceCount:P,ownCount:x}=Ae(e,c,o),m={reference_count:P,own_count:x,missing_count:p.length,extra_count:b.length,same_namespace:l};if(b.length)r("vm_hands.mount_extra",{...m,extra:b.slice(0,ue)});if(p.length)throw r("vm_hands.mount_mismatch",{...m,missing:p.slice(0,ue)}),t(`${p.length} mount(s) under the Session root are missing from vm-hands' namespace`)}var ve="/sys/fs/cgroup/reason-payload",M="vm-hands",Fe="/run/ara-srt/fallbacks.jsonl",oe="/reason-person",Ke="/reason-workload",je="surface",ne=5000,Ge=1e4,fe="__VM_HANDS_PROOF_DIR__",Ee="__VM_HANDS_PROBE_NONCE__";class w extends Error{code;constructor(e,r){super(r);this.code=e}}function Ve(e,r){if(!/^[0-9a-f-]{36}$/i.test(r))throw new w("vm_hands_bind_invalid","bad bind id");return d(e,M,`b-${r.toLowerCase()}`)}var Je=5000,be=(e)=>`'${e.replaceAll("'","'\\''")}'`;function Ze(e,r){if(!r||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r))return e;let t=d(Be(e),r.toLowerCase());return Ue(e).toLowerCase()===r.toLowerCase()?e:t}function hn(e){let r=e.cgroup??ve,t=e.init.layout.payload_uid,n=e.init.workload_ended!==!0,c=(s)=>z(s,oe)||n&&z(s,Ke),o=e.log??(()=>{}),l=(s)=>Ze(e.init.layout.session_root,s),p=new Map,b=new Map,P=0,x=()=>{try{let s=k("/run/ara-srt/starts.jsonl","utf8"),i=s.slice(P>s.length?0:P).split(`
|
|
4
4
|
`).filter(Boolean);P=s.length;let u=i.map((f)=>{try{return Number(JSON.parse(f).elapsed_ms)||0}catch{return 0}});if(u.length)o("vm_hands.srt_server_starts",{count:u.length,elapsed_ms:u.slice(0,8)})}catch{}},m=null,_=!1,O=e.srtCgroup??"/sys/fs/cgroup/reason-srt",I=()=>{m??=me()},R=0,F=()=>{try{let s=k(Fe,"utf8"),i=s.slice(R>s.length?0:R);R=s.length;let u=i.split(`
|
|
5
5
|
`).filter(Boolean).slice(0,1000);if(!u.length)return null;let f={},g=0;for(let S of u)try{let h=JSON.parse(S),y=typeof h.code==="string"&&/^[a-z_]{1,40}$/.test(h.code)?h.code:"other";if(f[y]=(f[y]??0)+1,typeof h.elapsed_ms==="number")g=Math.max(g,h.elapsed_ms)}catch{f.unparsed=(f.unparsed??0)+1}return o("vm_hands.srt_fallbacks",{count:u.length,codes:f,max_elapsed_ms:g}),{count:u.length,codes:f,max_elapsed_ms:g}}catch{return null}},U=(s,i,u)=>Ce(s,i,u),K=(s)=>(i,u,f)=>Me("/bin/sh",["-c",`echo $$ > ${be(d(s,"cgroup.procs"))} || exit 125; exec "$@"`,"vm-hands-join",i,...u],f),Ce=K(d(r,M)),j=d(r,M,"probe"),T=(s)=>Ve(r,s),Oe=(s)=>{let i=T(s);try{J(i,{mode:493})}catch(u){if(!(u&&typeof u==="object"&&("code"in u)&&u.code==="EEXIST"))throw new w("vm_hands_bind_failed","bind cgroup")}return i},xe=(s)=>{try{pe(T(s))}catch{}},W=e.prespawn?co({spawnProcess:U,...e.relayDependencies?.sourceEntrypoint?{sourceEntrypoint:e.relayDependencies.sourceEntrypoint}:{},log:(s,i)=>o(s,i??{})}):null;W?.arm();let Y=W?setInterval(()=>{W.arm()},Je):null;Y?.unref?.();let q=new Set;async function G(s){let i=p.get(s);if(p.delete(s),!i)return;i.abort.abort(),await i.done}return{bindCgroup:T,async startExecutor(s){if(I(),b.set(s.bindId,me()),_=!0,!s.claim)throw new w("vm_hands_bind_invalid","an executor needs the claim it serves");await G(s.bindId);let{claim:i,bindId:u}=s,f=Oe(u),g=i.owner;if(!g||typeof g.device_id!=="string"||typeof i.root_id!=="string")throw new w("vm_hands_bind_invalid","claim without its owner Device or root");let S=new AbortController,h,y,N=new Promise((a,v)=>{h=a,y=v}),D,C=new Promise((a)=>{D=a}),H=Nt({headless:!0,hostExecution:!0,runtimeDirectory:e.runtimeDirectory,managedPty:{version:1,startupVerified:!0},deviceIdentity:{deviceId:g.device_id,rootId:i.root_id,apiOrigin:e.apiOrigin},claimOwner:i.owner,root:e.root,runId:i.run_id,operationId:i.operation_id,attemptId:i.attempt_id,payload:Object.fromEntries(Object.entries(i.payload).filter(([a])=>!a.startsWith("vm_hands_"))),signal:S.signal,...s.workspaceGrant?{workspaceGrant:s.workspaceGrant}:{},emitEvent:async(a,v)=>{if(a==="hands.ready"){h(v);return}if(a==="hands.started"||a==="hands.stopped"||a==="hands.failed")return;await e.forward(u,a,v)}},{...e.relayDependencies,spawnWorker:(a)=>K(f)(a.command,a.args,a.options),...W?{takePrespawnedWorker:(a)=>{let v=W.take(a);if(!v?.pid)return v;try{return B(d(f,"cgroup.procs"),String(v.pid)),v}catch{try{v.kill("SIGKILL")}catch{}return null}},adoptSpawnedWorker:W.adopt}:{}}).then(()=>{D("executor_stopped")},(a)=>{let v=a&&typeof a==="object"&&"code"in a?String(a.code):"executor_failed";y(new w(v,a instanceof Error?a.message:String(a))),D(v)}).finally(()=>y(new w("vm_hands_executor_exited","executor ended before it was ready")));if(p.set(u,{abort:S,done:H,exited:C,operationId:i.operation_id,runId:i.run_id,expiresAtMs:Date.parse(String(i.payload.expires_at??""))||0}),q.delete(u))G(u).catch(()=>{return});let A=await N,V=A.executor_launch_id;if(typeof V!=="string")throw new w("vm_hands_bind_failed","executor ready without a launch id");return{launchId:V,readyData:A,applied:{hands_confinement:typeof i.payload.hands_confinement==="string"?i.payload.hands_confinement:null,browser_egress:i.payload.browser_egress??null}}},takeSrtFallbacks:F,executorExited(s){return p.get(s)?.exited??new Promise(()=>{})},abortExecutor(s){if(!p.has(s)){q.add(s);return}G(s).catch(()=>{return})},freezeBind(s){let i=T(s);if(E(d(i,"cgroup.freeze")))B(d(i,"cgroup.freeze"),"1")},async killAndVerifyPayload(s){if(s?.bindId)q.delete(s.bindId);let i=new Set(s?.keep??[]);if(await Ie(s?.bindId??null,i,s?.own===!0),i.size)return;if((_||e.srtWarmLate?.()===!0)&&E(d(O,"cgroup.events")))x(),await re(O,Date.now()+ne,"srt"),e.onSrtReset?.();_=!1},async killProbe(){let s=Date.now()+ne;if(E(d(j,"cgroup.events"))){await re(j,s,"probe");try{pe(j)}catch{}}let i=ie(process.pid);if(i===null)throw new w("vm_hands_kill_unverified","agent start time unreadable");await Xe(r,i,s);let u=(g)=>{let S=ie(g);return S!==null&&S<=i},f=_e(t).filter((g)=>u(g)&&!c(g));if(f.length)throw o("vm_hands.kill_survivors",{pids:f.slice(0,16),at:"attest",...ge(f)}),new w("vm_hands_kill_unverified",`${f.length} payload-uid process(es) from before this agent`);if(m!==null){let g=[r,d(r,M)].map((y)=>y.replace(/^\/sys\/fs\/cgroup/,"")),S=O.replace(/^\/sys\/fs\/cgroup/,""),h=he(m).filter((y)=>y!==process.pid&&!c(y)&&!z(y,"/reason-vm-hands")&&!z(y,S)&&!g.some((N)=>te(y,N)));if(h.length&&_)throw o("vm_hands.kill_strays",{strays:se(h),at:"attest"}),new w("vm_hands_kill_unverified",`${h.length} process(es) the run started survived it`);if(h.length)o("vm_hands.attest_concurrent",{processes:se(h),count:h.length});m=null}},async runProbe({nonce:s,script:i}){if(I(),!i.includes(fe))throw new w("vm_hands_probe_failed","probe names no proof directory");let u=e.proofParent??"/tmp/reason-vm-hands-proof";J(u,{mode:457,recursive:!0});let f=ee(u);if(f.isSymbolicLink()||!f.isDirectory()||f.uid!==(process.getuid?.()??-1)||(f.mode&4095)!==457)throw new w("vm_hands_probe_failed","proof parent is not root's 0711 directory");let g=We(d(u,"p-")),S=!1;try{if(!/^[A-Za-z0-9/._-]+$/.test(g)||!/^[A-Za-z0-9_-]{1,128}$/.test(s))throw new w("vm_hands_probe_failed","proof directory path or nonce");Te(g,t,t),Le(g,448);let h=ee(g).ino;try{J(j,{mode:493})}catch(C){if(!(C&&typeof C==="object"&&("code"in C)&&C.code==="EEXIST"))throw new w("vm_hands_probe_failed","probe cgroup")}let y=K(j)("/bin/bash",["-c",i.replaceAll(fe,g).replaceAll(Ee,s)],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:["ignore","pipe","ignore"]}),N="";y.stdout?.on("data",(C)=>{if(N.length<16384)N+=C.toString("utf8").slice(0,16384-N.length)});let D=await new Promise((C)=>{let H=setTimeout(()=>{S=!0,y.kill("SIGKILL"),C(124)},Ge);y.once("error",()=>{clearTimeout(H),C(127)}),y.once("close",(A)=>{clearTimeout(H),C(A??1)})});return o("vm_hands.probe",{nonce_len:s.length,exit_code:D}),{exitCode:D,markers:N,proofDirInode:h}}finally{if(!S)ze(g,{recursive:!0,force:!0})}},restatLayout(s){let i=l(s),u=i===e.init.layout.session_root?e.init.layout.alias:d(i,"repo"),f="invalid";try{xr(i),f="0:0:755"}catch{}let g=!1,S=-1;try{let h=ee(u);S=h.uid,g=f==="0:0:755"&&u===d(i,"repo")&&!h.isSymbolicLink()&&h.isDirectory()&&He(u)===u&&h.uid===t}catch{}return{root_mode:f,alias_ok:g,owner_uid:S}},verifyMounts(s){let i=l(s);try{de(i,o,(u)=>new w("vm_hands_mount_mismatch",u))}catch(u){if(i!==e.init.layout.session_root&&u instanceof w&&u.code==="vm_hands_mount_mismatch"){o("vm_hands.member_mount_mismatch_served",{});return}throw u}},installEnvironment(s,i){let u=p.get(s);if(!u)throw new w("environment_unavailable","no executor owns an environment");return at({root:e.root,operationId:u.operationId,payload:i}).installed_revision},async stop(){if(Y)clearInterval(Y);W?.close(),await Promise.all([...p.keys()].map((s)=>G(s)))}};function $e(){try{return X(d(r,M),{withFileTypes:!0}).filter((s)=>s.isDirectory()&&/^b-[0-9a-f-]{36}$/.test(s.name)).map((s)=>s.name)}catch{return[]}}async function Ie(s,i,u=!1){let f=new Set([...i].map((S)=>S.toLowerCase())),g=en();try{await tn();let S=Date.now()+ne,h=new Set($e().filter((a)=>!f.has(a.slice(2))).map((a)=>a.slice(2)));if(s)h.add(s.toLowerCase());let y=null;for(let a of h){let v=G(a).catch(()=>{return}),Q=b.get(a);if(Q!==void 0)y=y===null?Q:Math.min(y,Q);if(E(d(T(a),"cgroup.events")))await re(T(a),S,"bind");await v}let N=[...f].map((a)=>T(a).replace(/^\/sys\/fs\/cgroup/,"")),D=["/",...[r,d(r,M)].map((a)=>a.replace(/^\/sys\/fs\/cgroup/,""))],C=O.replace(/^\/sys\/fs\/cgroup/,""),H=(a)=>c(a)||N.some((v)=>z(a,v))||D.some((v)=>te(a,v)),A=u?[]:_e(t).filter((a)=>!H(a));if(A.length)throw o("vm_hands.kill_survivors",{pids:A.slice(0,16),beside:f.size,...ge(A)}),new w("vm_hands_kill_unverified",`${A.length} payload-uid process(es) outside a live bind`);let V=(a)=>!H(a)&&!z(a,"/reason-vm-hands")&&!z(a,C)&&!D.some((v)=>te(a,v));if(y!==null){let a=he(y).filter((v)=>v!==process.pid&&V(v));if(a.length)throw o("vm_hands.kill_strays",{strays:se(a),beside:f.size}),new w("vm_hands_kill_unverified",`${a.length} process(es) the run started survived it`)}for(let a of h)b.delete(a),xe(a)}finally{g()}}}function ie(e,r="/proc"){try{let t=k(d(r,String(e),"stat"),"utf8"),n=Number(t.slice(t.lastIndexOf(")")+2).split(" ")[19]);return Number.isFinite(n)?n:null}catch{return null}}function Se(e,r="/proc"){try{let t=k(d(r,String(e),"stat"),"utf8"),n=Number(t.slice(t.lastIndexOf(")")+2).split(" ")[1]);return Number.isFinite(n)?n:null}catch{return null}}async function Xe(e,r,t){try{B(d(e,"cgroup.freeze"),"1")}catch(n){throw new w("vm_hands_kill_unverified",`payload cgroup.freeze: ${n instanceof Error?n.message:String(n)}`)}try{for(;;){let n=Pe(e).filter((o)=>ke(o,e)),c=new Set(n.filter((o)=>{let l=ie(o);return l!==null&&l<=r}));for(let o=!0;o;){o=!1;for(let l of n){if(c.has(l))continue;let p=Se(l);if(p!==null&&c.has(p))c.add(l),o=!0}}if(c.size===0)return;if(Date.now()>t)throw new w("vm_hands_kill_unverified",`${c.size} previous-boot process(es) survived`);for(let o of c)try{process.kill(o,"SIGKILL")}catch{}await new Promise((o)=>setTimeout(o,10))}}finally{try{B(d(e,"cgroup.freeze"),"0")}catch{}}}function te(e,r,t="/proc"){try{return k(d(t,String(e),"cgroup"),"utf8").split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ur,dr,Rt,Tt,It,vs}from"./vm-hands-entry-lite-
|
|
2
|
+
import{ur,dr,Rt,Tt,It,vs}from"./vm-hands-entry-lite-rp2twenv.js";export{ur as VM_HANDS_OP_RUNNER_PERSON_ARG,dr as VM_HANDS_OP_RUNNER_SURFACE_ARG,Tt as VM_HANDS_SURFACE_DIRECTORY_ARG,It as VM_HANDS_SURFACE_OPS,Rt as VM_HANDS_SURFACE_UID_ARG,vs as runVmHandsOpRunner};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rt}from"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import{It}from"./vm-hands-entry-lite-
|
|
3
|
-
`,{mode:420}),o("srt_base_keyed",{})}catch{o("srt_base_keyed_skipped",{reason:"error"})}}function B(o,n){let t=(u)=>(n("srt_warm_skipped",{reason:u}),Promise.resolve());if(typeof o.srt_base_settings!=="string")return t("no_settings");let s=Buffer.from(o.srt_base_settings,"base64");if(s.length===0||s.length>se||s.toString("base64")!==o.srt_base_settings)return t("settings_invalid");let a;try{let u=N(U);if(!u.isDirectory()||u.uid!==0||(u.mode&18)!==0)return t("cgroup_unsafe");let f=oe.find((m)=>N(m,{throwIfNoEntry:!1})!==void 0);if(!f)return t("cgroup_or_exec_missing");a=f;for(let[m,S]of[[a,!1],["/usr/local/bin",!0]]){let _=N(m);if((S?!_.isDirectory():!_.isFile())||_.uid!==0||(_.mode&18)!==0)return t("srt_exec_unsafe")}}catch{return t("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return t("not_root");let l=performance.now(),y=ne("sha256").update(s).digest("hex"),c=`${O}/srt-base-settings.json`;try{z(c,s,{mode:384,flag:"w"})}catch{return t("settings_write")}let v=ee("/bin/sh",["-c",`echo $$ > ${U}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",a,"--settings",c,"--idle-ms",String(ae),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((u)=>{v.once("error",()=>{n("srt_warm_failed",{reason:"spawn"}),u()}),v.once("close",(f)=>{n(f===0?"srt_warm_done":"srt_warm_failed",{exit_code:f,warm_ms:Math.round(performance.now()-l),settings_sha256:y}),u()})})}var Y=3000;function Re(o){if(!o||typeof o!=="object"||Array.isArray(o))return null;let n=o,{layout:t,device_key:s,credential:a}=n;return typeof n.workspace_id==="string"&&Number.isSafeInteger(n.instance_generation)&&typeof n.api_origin==="string"&&re.test(n.api_origin)&&typeof n.manifest_digest==="string"&&!!a&&typeof a.key_id==="string"&&Number.isSafeInteger(a.expires_at_ms)&&typeof a.signature==="string"&&!!t&&typeof t.session_root==="string"&&typeof t.alias==="string"&&Number.isSafeInteger(t.payload_uid)&&typeof t.kind==="string"&&!!s&&typeof s.pkcs8==="string"&&typeof s.spki==="string"?n:null}function D(o){j(o,{recursive:!0,mode:448});let n=te(o);if(!n.isDirectory()||(n.mode&63)!==0||n.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${o}`)}async function ce(o){let[{CLI_VERSION:n},t,s,a]=await Promise.all([import("./version-
|
|
4
|
-
`)){let t=n.split(":");if(t.length>=4&&Number(t[2])===o&&/^\d+$/.test(t[3]??"")&&Number(t[3])>0)return Number(t[3])}throw Error("vm_hands_payload_account_unavailable")}function fe(o,n){let t=n.owner;if(!t||typeof t.organization_id!=="string"||typeof t.device_id!=="string"||typeof n.root_id!=="string")return null;return{version:4,apiOrigin:o.api_origin,orgId:t.organization_id,deviceId:t.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:n.root_id,label:"workspace",path:V,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}function we(o=process.platform,n="/proc/self/oom_score_adj"){if(o!=="linux")return null;let t;try{t=G(n,"utf8").trim()}catch{return{value:"unreadable"}}if(!/^-?\d+$/.test(t))return{value:"unreadable"};let s=Number(t);return s<0?{value:s}:null}async function ke(o,n){let t=we();if(t)n("vm_hands.oom_protected",{code:"vm_hands_oom_protected",value:t.value}),await new Promise(()=>{setInterval(()=>{return},1073741824)});D(O),D(W),D(A),ie(n);let s=B(o,n),a=!1,l=async()=>{if(!await Promise.race([s.then(()=>!0),new Promise((r)=>setTimeout(()=>r(!1),Y).unref?.())]))a=!0,n("srt_warm_late",{wait_ms:Y})},[{configureDesktopAccount:y},{configureWorkerSandbox:c}]=await Promise.all([import("./desktop-account-
|
|
2
|
+
import{rt}from"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import{It}from"./vm-hands-entry-lite-rp2twenv.js";import{qi,pn,Wi}from"./vm-hands-entry-lite.js";import{spawn as ee}from"child_process";import{createHash as ne}from"crypto";import{lstatSync as N,mkdirSync as j,readFileSync as G,statSync as te,writeFileSync as z}from"fs";var O="/run/reason-vm-hands",W="/run/reason-vm-hands/env",A="/run/reason-vm-hands/surface",V="/home/runner/.reason/workspace",re=/^https:\/\/[a-z0-9.-]+(?::\d{1,5})?$/,U="/sys/fs/cgroup/reason-srt",oe=["/usr/local/bin/reason-srt-exec","/usr/local/bin/ara-srt-exec"],se=65536,ae=21600000;function ie(o,n="/run/ara-srt"){try{if((process.getuid?.()??-1)!==0)return;j(n,{recursive:!0,mode:448});let t=N(n);if(!t.isDirectory()||t.uid!==0||(t.mode&63)!==0){o("srt_base_keyed_skipped",{reason:"socket_dir_unsafe"});return}z(`${n}/base-keyed`,`1
|
|
3
|
+
`,{mode:420}),o("srt_base_keyed",{})}catch{o("srt_base_keyed_skipped",{reason:"error"})}}function B(o,n){let t=(u)=>(n("srt_warm_skipped",{reason:u}),Promise.resolve());if(typeof o.srt_base_settings!=="string")return t("no_settings");let s=Buffer.from(o.srt_base_settings,"base64");if(s.length===0||s.length>se||s.toString("base64")!==o.srt_base_settings)return t("settings_invalid");let a;try{let u=N(U);if(!u.isDirectory()||u.uid!==0||(u.mode&18)!==0)return t("cgroup_unsafe");let f=oe.find((m)=>N(m,{throwIfNoEntry:!1})!==void 0);if(!f)return t("cgroup_or_exec_missing");a=f;for(let[m,S]of[[a,!1],["/usr/local/bin",!0]]){let _=N(m);if((S?!_.isDirectory():!_.isFile())||_.uid!==0||(_.mode&18)!==0)return t("srt_exec_unsafe")}}catch{return t("cgroup_or_exec_missing")}if((process.getuid?.()??-1)!==0)return t("not_root");let l=performance.now(),y=ne("sha256").update(s).digest("hex"),c=`${O}/srt-base-settings.json`;try{z(c,s,{mode:384,flag:"w"})}catch{return t("settings_write")}let v=ee("/bin/sh",["-c",`echo $$ > ${U}/cgroup.procs || exit 125; exec "$@"`,"vm-hands-srt",a,"--settings",c,"--idle-ms",String(ae),"--","/bin/true"],{cwd:"/",env:{PATH:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},stdio:"ignore"});return new Promise((u)=>{v.once("error",()=>{n("srt_warm_failed",{reason:"spawn"}),u()}),v.once("close",(f)=>{n(f===0?"srt_warm_done":"srt_warm_failed",{exit_code:f,warm_ms:Math.round(performance.now()-l),settings_sha256:y}),u()})})}var Y=3000;function Re(o){if(!o||typeof o!=="object"||Array.isArray(o))return null;let n=o,{layout:t,device_key:s,credential:a}=n;return typeof n.workspace_id==="string"&&Number.isSafeInteger(n.instance_generation)&&typeof n.api_origin==="string"&&re.test(n.api_origin)&&typeof n.manifest_digest==="string"&&!!a&&typeof a.key_id==="string"&&Number.isSafeInteger(a.expires_at_ms)&&typeof a.signature==="string"&&!!t&&typeof t.session_root==="string"&&typeof t.alias==="string"&&Number.isSafeInteger(t.payload_uid)&&typeof t.kind==="string"&&!!s&&typeof s.pkcs8==="string"&&typeof s.spki==="string"?n:null}function D(o){j(o,{recursive:!0,mode:448});let n=te(o);if(!n.isDirectory()||(n.mode&63)!==0||n.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${o}`)}async function ce(o){let[{CLI_VERSION:n},t,s,a]=await Promise.all([import("./version-qp2wr1ds.js"),import("./hands-worker-source-qj7s9dk5.js"),import("./network-contract-kx0hz3wt.js"),import("./device-workspace-b534qy2c.js")]),{REASON_HANDS_PROTOCOL_VERSION:l}=await import("./reason-hands-protocol-g54rtrhd.js");return{reason_runtime_version:n,bridge_version:n,protocol_version:rt,execution_eligible:!0,instance_generation:o.instance_generation,capabilities:{supported_operations:["hands.connect"],hands_worker_artifact_sha256:t.REASON_HANDS_WORKER_ARTIFACT_SHA256,hands_worker_entrypoint:t.REASON_HANDS_WORKER_ENTRYPOINT,hands_slots:1,max_payload_bytes:s.LOCAL_OPERATION_MAX_BYTES,max_result_bytes:s.LOCAL_OPERATION_MAX_BYTES,operation_constraints:{"hands.connect":{ready:!0,execution_mode:"host",transport:"wss_relay",worker:"ara_hands",slots:1,session_group:s.HANDS_SESSION_GROUP,worker_version:t.REASON_HANDS_WORKER_VERSION,protocol_version:l,worker_artifact_sha256:t.REASON_HANDS_WORKER_ARTIFACT_SHA256,worker_entrypoint:t.REASON_HANDS_WORKER_ENTRYPOINT,policy_mode:"full_access",policy_version:1,workspace_base:a.REASON_WORKSPACE_BASE,workspace_layout:a.SESSION_WORKSPACE_LAYOUT,browser_state:"optional_headless",desktop:!1,max_session_ms:43200000,environment_delivery:s.HANDS_ENVIRONMENT_DELIVERY,[s.HANDS_ENVIRONMENT_AT_CLAIM_KEY]:s.HANDS_ENVIRONMENT_AT_CLAIM,[s.HANDS_CLOUD_ACCESS_KEY]:s.HANDS_CLOUD_ACCESS,[s.HANDS_LARGE_ENVIRONMENT_KEY]:s.HANDS_LARGE_ENVIRONMENT,[s.HANDS_CONFINEMENT_KEY]:s.HANDS_CONFINEMENT,[s.HANDS_JOBS_USER_KEY]:s.HANDS_JOBS_USER,vm_hands:"v1"}}}}}var I=["fs.read","fs.write","fs.export","fs.import","exec.run","exec.full","process.list","ports.list","pty.start","jobs.control"],X=["automation.call.v1","display.stream.v1","preview.serve.v1","tunnel.open","tunnel.close"],de=new Set(["pty.start","jobs.control","tunnel.open","tunnel.close"]),ue=60000,le=30000;function J(o,n){return{executionMode:"unsandboxed",runtimeDirectory:n,readiness:{...Object.fromEntries(I.map((t)=>[t,!0])),...o.lanes},...o.probing?{probing:X.filter((t)=>o.lanes[t]!==!0)}:{},...o.displayVideo?{displayVideo:!0}:{}}}function _e(o,n,t){let s=n([{id:"vm-hands",label:"workspace",path:V,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}],{worker:J(t,A)}),a=o.capabilities,l={...a.operation_constraints};for(let c of I)l[c]={...s.operation_constraints?.[c]??{},ready:!0,execution_mode:s.operation_constraints?.[c]?.execution_mode??"host"};let y=X.filter((c)=>s.operation_constraints?.[c]!==void 0);for(let c of y)l[c]=s.operation_constraints[c];return{...o,capabilities:{...a,supported_operations:["hands.connect",...I,...y],operation_constraints:l}}}function pe(o){for(let n of G("/etc/passwd","utf8").split(`
|
|
4
|
+
`)){let t=n.split(":");if(t.length>=4&&Number(t[2])===o&&/^\d+$/.test(t[3]??"")&&Number(t[3])>0)return Number(t[3])}throw Error("vm_hands_payload_account_unavailable")}function fe(o,n){let t=n.owner;if(!t||typeof t.organization_id!=="string"||typeof t.device_id!=="string"||typeof n.root_id!=="string")return null;return{version:4,apiOrigin:o.api_origin,orgId:t.organization_id,deviceId:t.device_id,devicePublicKey:"",displayName:"vm-hands",registeredAt:new Date(0).toISOString(),handsSlots:1,roots:[{id:n.root_id,label:"workspace",path:V,pathFingerprint:"0".repeat(64),permissions:{read:!0,write:!0,execute:!0,discover_environment:!0,expose_mcp:!1}}]}}function we(o=process.platform,n="/proc/self/oom_score_adj"){if(o!=="linux")return null;let t;try{t=G(n,"utf8").trim()}catch{return{value:"unreadable"}}if(!/^-?\d+$/.test(t))return{value:"unreadable"};let s=Number(t);return s<0?{value:s}:null}async function ke(o,n){let t=we();if(t)n("vm_hands.oom_protected",{code:"vm_hands_oom_protected",value:t.value}),await new Promise(()=>{setInterval(()=>{return},1073741824)});D(O),D(W),D(A),ie(n);let s=B(o,n),a=!1,l=async()=>{if(!await Promise.race([s.then(()=>!0),new Promise((r)=>setTimeout(()=>r(!1),Y).unref?.())]))a=!0,n("srt_warm_late",{wait_ms:Y})},[{configureDesktopAccount:y},{configureWorkerSandbox:c}]=await Promise.all([import("./desktop-account-t0afsge2.js"),import("./worker-sandbox-f1tfb3y0.js")]);c();try{y({value:String(o.layout.payload_uid)})}catch{n("payload_account_unavailable"),await new Promise(()=>{setInterval(()=>{return},1073741824)})}let v=new AbortController;for(let e of["SIGTERM","SIGINT"])process.on(e,()=>v.abort());let u=new Map,f,m=new Promise((e)=>{f=e}),S=m.then(()=>import("./vm-hands-executor-0b1azv5m.js")).then(({createVmHandsExecutor:e})=>{let r=e({init:o,root:V,runtimeDirectory:O,apiOrigin:o.api_origin,prespawn:!0,onSrtReset:()=>{a=!1,s=B(o,n)},srtWarmLate:()=>a,forward:(d,i,E)=>u.get(d)?.(i,E)??Promise.reject(Error("vm_hands_not_bound")),log:(d,i)=>n(d,i)});return n("executor_loaded"),r}),_=(e)=>async(...r)=>(await S)[e](...r),x=null;S.then((e)=>{x=(r)=>e.executorExited(r)});let g={startExecutor:async(...e)=>(await l(),_("startExecutor")(...e)),killAndVerifyPayload:_("killAndVerifyPayload"),killProbe:_("killProbe"),runProbe:async(...e)=>(await l(),_("runProbe")(...e)),restatLayout:(e)=>{throw Error("replaced below")},verifyMounts:(e)=>{throw Error("replaced below")},installEnvironment:()=>{throw Error("replaced below")},executorExited:(e)=>x?x(e):new Promise(()=>{}),takeSrtFallbacks:()=>null};S.then((e)=>{g.restatLayout=(r)=>e.restatLayout(r),g.verifyMounts=(r)=>e.verifyMounts(r),g.installEnvironment=(r,d)=>e.installEnvironment(r,d),g.freezeBind=(r)=>e.freezeBind(r),g.abortExecutor=(r)=>e.abortExecutor(r),g.takeSrtFallbacks=()=>e.takeSrtFallbacks?.()??null});let q=await qi(o),C=new pn(o,q,g,{envRoot:W}),M=ce(o),w={probing:!0,lanes:{},displayVideo:!1},L=null,K=null,Q=Promise.all([M,import("./local-capabilities-1kcxmz0s.js")]).then(([e,r])=>{K=()=>_e(e,r.capabilityInventoryForRoots,w),n("device_ops_loaded")}).catch((e)=>n("device_ops_unavailable",{error:e instanceof Error?e.name:"error"})),H,R=(e)=>{clearTimeout(H),w=e,L?.()},b=m.then(()=>import("./vm-hands-executor-0b1azv5m.js")).then(({createVmHandsOpRunners:e,vmHandsBindCgroup:r,VM_HANDS_PAYLOAD_CGROUP:d})=>e({payloadUid:o.layout.payload_uid,payloadGid:pe(o.layout.payload_uid),bindCgroup:(i)=>r(d,i),surfaceDirectory:A,onSurfaceReadiness:(i)=>{if(i)R({probing:!1,lanes:i.lanes??{},displayVideo:i.display_video===!0});else if(w.probing)R({probing:!1,lanes:{},displayVideo:!1})},log:(i,E)=>n(i,E)})).catch(()=>null);b.then((e)=>e?.warm("person")),b.then(async(e)=>{if(!e){R({probing:!1,lanes:{},displayVideo:!1});return}let r=Date.now()+le;while(C.settingUp&&Date.now()<r)await new Promise((d)=>setTimeout(d,250));H=setTimeout(()=>{if(w.probing)R({probing:!1,lanes:{},displayVideo:!1})},ue),H.unref?.(),e.warm("surface")}),n("agent_ready"),await Wi({apiOrigin:o.api_origin,agent:C,signal:v.signal,heartbeat:async()=>K?.()??await M,onHeartbeatNow:(e)=>{L=e},executeOp:async({kind:e,claim:r,bindId:d,signal:i,emit:E})=>{let k=fe(o,r);if(!k)return{status:"failed",error_code:"vm_hands_bind_invalid"};let F={executionMode:"unsandboxed",runtimeDirectory:O,readiness:{...Object.fromEntries(I.map((p)=>[p,!0])),"tunnel.open":w.lanes["tunnel.open"]===!0,"tunnel.close":w.lanes["tunnel.close"]===!0}},T=(p)=>{let h=typeof p.kind==="string"?p.kind:"";if(h)E({kind:h,...p.data&&typeof p.data==="object"?{data:p.data}:{}})};if(r.capability==="exec.full"&&e!=="person")return{status:"failed",error_code:"capability_not_granted"};if(r.capability==="automation.call.v1"&&e!=="model")return{status:"failed",error_code:"capability_not_granted"};let Z=r.capability==="pty.start"&&e==="person"&&!r.authority;if(de.has(String(r.capability))&&!Z||r.capability==="ports.list"){let{executeLocalOperation:p}=await import("./local-capabilities-1kcxmz0s.js");return p(k,r,{worker:F,signal:i,emit:(h)=>T(h)})}let P=await b;if(!P)return{status:"failed",error_code:"vm_hands_payload_account_unavailable"};if(It.has(String(r.capability))){if(w.lanes[String(r.capability)]!==!0)return{status:"failed",error_code:"capability_unavailable"};return P.run("surface",{id:String(r.attempt_id),claim:r,state:k,worker:J(w,A)},T,i)}return P.run(e,{id:String(r.attempt_id),claim:r,state:k,worker:F},T,i,d)},controlOp:async({claim:e,control:r})=>It.has(String(e.capability))&&((await b)?.notify("surface",{t:"control",id:String(e.attempt_id),control:{kind:r.kind,payload:r.payload??{}}})??!1),opCompleted:({claim:e,status:r,acknowledged:d})=>{if(d&&e.capability==="preview.serve.v1")b.then((i)=>i?.notify("surface",{t:"retire",operation_id:String(e.operation_id),status:r}))},readyData:({launchId:e})=>({executor_launch_id:e}),log:(e,r)=>{if(e==="vm_hands.registered"||e==="vm_hands.reconnected")f();n(e,r)},onTurn:(e,r)=>{if(r)u.set(e,r);else u.delete(e)}}),await(await S).stop(),(await b)?.stop()}export{Re as parseVmHandsInit,ke as runVmHands};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{D,Ps,rs}from"./vm-hands-entry-lite-r7tb2z3z.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{D as ApiError,rs as ReasonApi,Ps as createMachineEnrollmentTicketWithToken};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{zi,es,ts,As}from"./vm-hands-entry-lite-e16bhf16.js";import"./vm-hands-entry-lite-r7tb2z3z.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{zi as apiOriginFromEnvironment,ts as environmentApiKey,es as explicitApiOrigin,As as resolveApiCredentials};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{it,Ss,Es,xs}from"./vm-hands-entry-lite-x3ym5t8r.js";import"./vm-hands-entry-lite-y5hv1gjv.js";import"./vm-hands-entry-lite-13s0mfpr.js";import"./vm-hands-entry-lite-e16bhf16.js";import"./vm-hands-entry-lite-r7tb2z3z.js";import"./vm-hands-entry-lite-04x5xjt6.js";import"./vm-hands-entry-lite-0yvkh3bg.js";import"./vm-hands-entry-lite-3dccjjq2.js";import"./vm-hands-entry-lite-9azmqs47.js";import"./vm-hands-entry-lite-qdrmhn3f.js";import"./vm-hands-entry-lite-hq76nmrc.js";import"./vm-hands-entry-lite-5tnma5qb.js";import"./vm-hands-entry-lite-kmtz5h74.js";import"./vm-hands-entry-lite-2hfrcr50.js";import"./vm-hands-entry-lite-hfx1q0b0.js";import"./vm-hands-entry-lite-zrkw5syq.js";import"./vm-hands-entry-lite-8hwmhvyx.js";import"./vm-hands-entry-lite-ycddfgr4.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-645wzfhr.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-55ja13pk.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-xe0benev.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{Ss as computerDisconnected,it as connectionDirectory,Es as connectionReport,xs as restartConnection};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Pn,Us,zs,qs,Ws,Rn}from"./vm-hands-entry-lite-zrkw5syq.js";import"./vm-hands-entry-lite-8hwmhvyx.js";import"./vm-hands-entry-lite-ycddfgr4.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-645wzfhr.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-55ja13pk.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-xe0benev.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{zs as ensureLocalBrowser,Pn as localAutomationAvailable,qs as localBrowserProfile,Us as localUserChromeHost,Ws as runAutomationCallLocally,Rn as runLocalAutomation};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ns,Vi,mn,is,os,ss,as,$s,Ms,Bs,Fs}from"./vm-hands-entry-lite-3dccjjq2.js";import"./vm-hands-entry-lite-9azmqs47.js";import"./vm-hands-entry-lite-qdrmhn3f.js";import"./vm-hands-entry-lite-hq76nmrc.js";import"./vm-hands-entry-lite-5tnma5qb.js";import"./vm-hands-entry-lite-kmtz5h74.js";import"./vm-hands-entry-lite-2hfrcr50.js";import"./vm-hands-entry-lite-hfx1q0b0.js";import"./vm-hands-entry-lite-zrkw5syq.js";import"./vm-hands-entry-lite-8hwmhvyx.js";import"./vm-hands-entry-lite-ycddfgr4.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-645wzfhr.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-55ja13pk.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-vj7xzb3y.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-xe0benev.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{r as LocalCapabilityError,ns as SHORT_REQUEST_CAPABILITIES,$s as capabilityInventoryForRoots,Vi as confinedExecutionShell,is as defaultLocalCommandRunner,Ms as deliverLocalHandsEnvironment,as as enrolledRootPaths,Fs as executeLocalOperation,Bs as rebindLocalHandsControl,os as runFileCapability,ss as runTransferCapability,mn as spawnCaptured};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ft,Vs,G,qe,jt}from"./vm-hands-entry-lite-8hwmhvyx.js";import"./vm-hands-entry-lite-ycddfgr4.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-645wzfhr.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-xe0benev.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{qe as ensureLinuxDesktop,Ft as localDisplayAvailable,Vs as localDisplayReady,G as privateDirectory,jt as runLocalDisplayStream};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{In,Dn,On,Nn,Rr}from"./vm-hands-entry-lite-ycddfgr4.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{In as MAC_SCREEN,Dn as WINDOWS_SCREEN,On as createDisplayVideoLane,Rr as localDisplayVideoAvailable,Nn as simulatorVideoFfmpeg};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{st,fr,js,Hs}from"./vm-hands-entry-lite-qdrmhn3f.js";import"./vm-hands-entry-lite-hq76nmrc.js";import"./vm-hands-entry-lite-5tnma5qb.js";import"./vm-hands-entry-lite-kmtz5h74.js";import"./vm-hands-entry-lite-2hfrcr50.js";import"./vm-hands-entry-lite-hfx1q0b0.js";import"./vm-hands-entry-lite-xrqztkhv.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";import"./vm-hands-entry-lite-07apxfh8.js";import"./vm-hands-entry-lite-fxzadxz4.js";import"./vm-hands-entry-lite-xe0benev.js";import"./vm-hands-entry-lite-b6gsggvp.js";import"./vm-hands-entry-lite-s85p7tqp.js";export{st as ManagedProcessStoppedError,js as controlManagedDeviceProcess,Hs as retireManagedDeviceProcess,fr as runManagedDeviceProcess};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Dr,Vt,Or,ds,Hn,Nr,Un}from"./vm-hands-entry-lite-645wzfhr.js";import"./vm-hands-entry-lite-w29d7ey0.js";import"./vm-hands-entry-lite-y9jarm7q.js";import"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-4anjdcth.js";import"./vm-hands-entry-lite-a3p6xz53.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Vt as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,Or as LOCAL_PTY_MAX_SESSIONS,Dr as LOCAL_PTY_MAX_SESSION_MS,Nr as defaultConnect,ds as defaultLoginShell,Hn as ptyRuntimeSupported,Un as runLocalPtySession};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ls,us,Ks,Js}from"./vm-hands-entry-lite-6pqfr3w2.js";import"./vm-hands-entry-lite-k9vk84wa.js";import"./vm-hands-entry-lite-8s4namcq.js";import"./vm-hands-entry-lite-vn7ag8c7.js";import"./vm-hands-entry-lite-8dfw96ym.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Js as allowMacPermissions,Ks as permissionsSummary,us as readMacPermissions,ls as reasonIdentity};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{P,Br,Fr,zn,ft,qn,jr,Je,Se,Wn,Xe,Yt,ne,Ye,Vn,Ee,Zt,Hr,Qt,Ur,Gn,ae,U,L,ce,zr,qr,Kn}from"./vm-hands-entry-lite-sb7b4z8t.js";import"./vm-hands-entry-lite-48rphbjm.js";export{Ur as REASON_HANDS_CLOSE_CODES,Xe as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,jr as REASON_HANDS_JOB_MAX_INPUT_CHARS,Je as REASON_HANDS_JOB_MAX_OUTPUT_CHARS,Se as REASON_HANDS_JOB_MAX_OUTPUT_CHUNKS,Wn as REASON_HANDS_JOB_MAX_RECORDS,qn as REASON_HANDS_MAX_ERROR_CHARS,Br as REASON_HANDS_MAX_FRAME_BYTES,Fr as REASON_HANDS_MAX_INPUT_CHARS,ft as REASON_HANDS_MAX_OUTPUT_CHARS,zn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,P as REASON_HANDS_PROTOCOL_VERSION,Hr as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Qt as REASON_HANDS_PTY_CLEANUP_RECEIPT_MS,Zt as REASON_HANDS_PTY_CLEANUP_SWEEP_MS,Ee as REASON_HANDS_PTY_MAX_DIMENSION,ne as REASON_HANDS_PTY_MAX_INPUT_BYTES,Ye as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Vn as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Yt as REASON_HANDS_PTY_PROTOCOL_VERSION,Gn as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,U as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,L as isReasonHandsUuid,zr as parseReasonHandsJobRequest,qr as parseReasonHandsJobResult,Kn as parseReasonHandsPtyReceipt};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{R}from"./vm-hands-entry-lite-a3p6xz53.js";import{jo}from"./vm-hands-entry-lite-4anjdcth.js";import{Fe,un,Dt,dn}from"./vm-hands-entry-lite-04x5xjt6.js";import{Qn}from"./vm-hands-entry-lite-vn7ag8c7.js";import{t,o,d,u,n,gs,W,g,s,i}from"./vm-hands-entry-lite-wzv13c8k.js";var M=/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/;function v(e){let r=typeof e==="string"?M.exec(e):null;return r?{major:Number(r[1]),minor:Number(r[2])}:null}var z=25,x=1e5,j=/^[0-9a-f]{64}$/,L=n({day:t().regex(/^\d{4}-\d{2}-\d{2}$/),sent:o().int().min(0).max(x),received:o().int().min(0).max(x)}),N=20,H=n({name:t().min(1).max(100),address:t().min(1).max(300).optional()}),F=n({name:t().min(1).max(100),agent:t().min(1).max(100)}),Le=n({machine:t().min(1).max(200),person:t().min(1).max(200),team:t().min(1).max(200),team_id:t().min(1).max(200).optional(),workspace:d().optional(),version:t().max(64).optional(),wait_seconds:o().int().min(0).max(z).optional(),message_counts:u(L).max(14).optional().catch(void 0),endpoint:t().regex(j).optional().catch(void 0),hosted:u(H).max(50).optional().catch(void 0)}),B=g("kind",[n({id:t(),kind:i("who"),all:d().optional()}),n({id:t(),kind:i("send"),to:t(),body:t(),from_name:t(),from_agent:t(),wake:d(),reply_to:t().max(100).optional(),notify:d().optional()})]),P=n({job:B.nullable(),retry_after_seconds:o().optional(),hosted:u(F).max(N).optional().catch(void 0)}),G=n({address:t(),person:t(),machine:t(),agent:t(),repo:t().nullable(),branch:t().nullable(),status:t(),since:o().nullable(),doing:t().nullable(),worker:d(),tier:t().max(10).optional()}),J=n({person:t(),machine:t(),online:d()}),K=n({team:t().nullable(),sessions:u(G).max(2000),machines:u(J).max(500),all:d().optional()}),Q=n({address:t().max(300),state:t().max(40),note:t().max(500)}),De=W([n({who:K}),n({sent:n({ids:u(t().max(100)).max(500),recipients:u(t().max(300)).max(500),from:t().max(300),deliveries:u(Q).max(500).optional()})}),n({error:t().min(1).max(2000)})]),V=n({id:t().max(100),from:t().max(300),from_agent:t().max(100).nullable(),to:t().max(300),reply_to:t().max(100).nullable(),body:t().max(64000),sent_at:o()}),Ne=n({messages:u(V).max(100),team:t().min(1).max(200).optional(),team_id:t().min(1).max(200).optional(),workspace:d().optional(),session:t().min(1).max(100).optional().catch(void 0),machine:t().min(1).max(200).optional().catch(void 0)});var I=["run","mcp:read","mcp:write","secrets:read","secrets:write","sessions:read","sessions:debug","devices:read","devices:write","devices:use","ssh:write","knowledge:read","memory:read","memory:write","skills:read","skills:write","repos:read","repos:write","reviews:read","reviews:write","deployment:read","analytics:read","org:read","org:write","attachments:read","attachments:write","guardrails:read","guardrails:write","network:read","network:write","automations:read","automations:write","agent_auth:read"];var sn=I.filter((e)=>e!=="network:read"&&e!=="network:write");class b extends Error{oauthCode;constructor(e,r=null){super(e);this.oauthCode=r;this.name="LoginError"}}function Y(e,r){let a=typeof e.error==="string"?e.error:null,l=typeof e.error_description==="string"?e.error_description:a?a:r;return new b(l,a)}async function X(e,r,a,l){let c=await a(`${e}/mcp/oauth/token`,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded"},body:r,signal:l}),m=await c.json().catch(()=>({}));if(!c.ok)throw Y(m,`OAuth token request failed (${c.status})`);return m}var Z=1e4;async function ee(e,r={}){let a=r.fetchImpl??fetch,l=await X(e.apiOrigin,new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken}),a,AbortSignal.timeout(Z)).catch((m)=>{if(m instanceof Error&&m.name==="TimeoutError")throw new b("Reason did not answer the login refresh in time. Check the network and retry.");throw m});if(typeof l.access_token!=="string"||typeof l.refresh_token!=="string"||typeof l.expires_in!=="number")throw new b("Reason returned an incomplete refreshed login.");let c={...e,accessToken:l.access_token,refreshToken:l.refresh_token,expiresAt:new Date(Date.now()+l.expires_in*1000).toISOString(),scopes:typeof l.scope==="string"?l.scope.split(/\s+/).filter(Boolean):e.scopes};return un(c,r.path??Fe()),c}var w=new Map,ne=2000,te=100;function A(e,r){if(!r)return e;if(r.aborted)return Promise.reject(r.reason);return new Promise((a,l)=>{let c=()=>l(r.reason);r.addEventListener("abort",c,{once:!0}),e.then(a,l).finally(()=>r.removeEventListener("abort",c))})}async function ot(e={}){let r=e.path??Fe(),a=Dt(r);if(!a)return null;let l=e.apiOrigin??R(process.env,"REASON_API_URL")?.trim();if(l&&!jo(a.apiOrigin,new URL(l).origin))return null;if(!(Date.parse(a.expiresAt)<=Date.now()+60000)&&(!e.forceRefresh||e.refused!==void 0&&a.accessToken!==e.refused))return a;let m=[r,a.apiOrigin,a.clientId,a.refreshToken].join("\x00"),p=w.get(m);if(p)return A(p,e.signal);let f;return f=ee(a,{fetchImpl:e.fetchImpl,path:r}).catch(async(y)=>{if(!(y instanceof b)||y.oauthCode!=="invalid_grant"&&y.oauthCode!=="invalid_client")throw y;let k=(_)=>_!==null&&(y.oauthCode==="invalid_client"?_.clientId!==a.clientId:_.refreshToken!==a.refreshToken),E=Date.now()+ne;while(!k(Dt(r))&&Date.now()<E)await new Promise((_)=>setTimeout(_,te));if(k(Dt(r)))return ot({fetchImpl:e.fetchImpl,path:r});return dn(r),null}).finally(()=>{if(w.get(m)===f)w.delete(m)}),w.set(m,f),A(f,e.signal)}var se=n({label:t(),used_percent:o().min(0).max(100).nullable(),resets_at:t().nullable(),exhausted:d().nullable()}),oe=n({groups:u(n({selectable:d().optional(),accounts:u(n({source_id:t().min(1),model_ids:u(t().min(1)).optional()}))}))});function re(e){let r=oe.safeParse(e);if(!r.success)return;return r.data.groups.some((a)=>a.selectable!==!1&&a.accounts.some((l)=>l.model_ids===void 0||l.model_ids.length>0))}class D extends Error{status;code;suggestedModel;retryAfterMs;resolutionReason;refusal;constructor(e,r,a,l,c,m,p){super(a);this.status=e;this.code=r;this.suggestedModel=l;this.retryAfterMs=c;this.resolutionReason=m;this.refusal=p;this.name="ApiError"}static rateLimitDelayMs(e,r){if(!(e instanceof D)||e.status!==429)return null;return Math.min(60000,Math.max(r,e.retryAfterMs??0))}}var ie=["minimal","low","medium","high","xhigh","max"],ae=n({id:t().min(1),kind:t(),name:t(),custom_name:t().nullish(),status:t(),online:d(),compatible:d().optional(),compatibility_reason:t().nullish(),folder_lane_of:t().nullish(),roots:u(n({id:t().min(1),label:t()}))}),le=n({devices:u(ae),end_cursor:t().nullish(),has_next_page:d().optional()}),ce=n({id:t().min(1),name:t()}),de=n({items:u(ce)}),me=n({id:t().min(1),name:t(),main:d(),mine:d(),session_id:t().nullish(),appearance:n({color:t().nullish()}).nullish().catch(null)}),ue=n({items:u(me)}),ge=n({skill_id:t().min(1),name:t(),description:t().nullish(),activation_keywords:u(t()).default([]),is_enabled:d().default(!0)}),he=n({items:u(ge).default([])}),pe=n({id:t().min(1),kind:t(),enabled:d(),schedule:n({expression:t().nullish(),every_seconds:o().nullish(),next_run_at:t().nullish()}).nullish(),github:n({event:t().nullish(),action:t().nullish(),repo:t().nullish()}).nullish(),last_fired_at:t().nullish()}),T=n({id:t().min(1),name:t().nullish(),instructions:t().nullish(),enabled:d(),triggers:u(pe).default([])}),fe=n({items:u(T).default([]),end_cursor:t().nullish(),has_next_page:d().optional()}),ye=n({id:t().min(1),slug:t().nullish(),name:t(),description:t().nullish(),transport:t().nullish(),url:t().nullish(),enabled:d()}),_e=n({items:u(ye).default([])}),Re=n({status:t(),summary:t().nullish(),category:t().nullish(),outcome:t().nullish(),message_count:o().nullish(),pr_url:t().nullish(),cost_usd:o().nullish(),generated_at:t().nullish()}),C=n({tags:u(t()).default([])}),be=s(["linux","macos"]),U=n({id:t().min(1),name:t().min(1),platform:be.nullable(),workers:n({total:o().int(),online:o().int(),busy:o().int(),idle:o().int()}),sessions:n({queued:o().int(),running:o().int()})}),we=n({machines:u(U)}),Se=n({machine:U}),ke=n({deleted:i(!0),revoked_workers:o().int(),revoked_tokens:o().int()}),ve=n({token:n({id:t().min(1),machine_id:t().min(1),token_prefix:t()}),secret:t().startsWith("rmt_")}),O=gs({machine_id:t().min(1),machine_name:t().min(1)}),xe=O.extend({organization_id:t().min(1)}),fn=n({id:t().min(1),name:t().min(1),state:s(["waiting","placed"]),queue_position:o().int().nullable()});var yn=W([n({kind:i("cloud")}),n({kind:s(["mac","headless"]),device_id:t().min(1),root_id:t().min(1)})]);function h(e,r,a){let l=e.safeParse(r);if(!l.success)throw new D(502,a,"Reason returned an unexpected response.");return l.data}var Pe=n({error:n({type:t(),message:t()})});function S(e,r,a){let l=Pe.safeParse(r),c=typeof r.error==="string"?r.error:l.success?l.data.error.type:`http_${e}`,m=typeof r.detail==="string"?r.detail:typeof r.message==="string"?r.message:l.success?l.data.error.message:`Reason request failed (${e}${typeof r.error==="string"?` ${r.error}`:""})`,p=c==="github_connection_required"&&typeof r.connect_url==="string"&&/^https?:\/\//.test(r.connect_url)?` Connect it at ${r.connect_url}`:"",f=a===null||a.trim()===""?NaN:Number(a);return new D(e,c,`${m}${p}`,typeof r.suggested_model==="string"?r.suggested_model:void 0,Number.isFinite(f)&&f>=0?f*1000:void 0,typeof r.resolution_reason==="string"?r.resolution_reason:void 0,typeof r.code==="string"?{code:r.code,...typeof r.billing_path==="string"&&/^\/(?![/\\])/.test(r.billing_path)?{billingPath:r.billing_path}:{}}:void 0)}async function Ps(e){let r=await(e.fetchImpl??fetch)(`${e.apiOrigin}/v3/machines/enrollment-tickets`,{method:"POST",headers:{authorization:`Bearer ${e.token}`,accept:"application/json","content-type":"application/json"},body:JSON.stringify(e.body),signal:AbortSignal.timeout(30000),redirect:"error"}),a=await r.json().catch(()=>({}));if(!r.ok)throw S(r.status,a,r.headers.get("retry-after"));return h(xe,a,"invalid_machine_ticket")}var Ie=n({items:u(n({name:t()}))}),Ae=n({name:t(),scope:t(),result:s(["created","updated"]).optional(),warning:n({message:t()}).optional()});class rs{options;credentials;constructor(e,r={}){this.options=r;this.credentials=e}trackEvent(e,r={}){}async request(e,r={}){let{status:a,headers:l,json:c}=await this.exchange(e,r);if(a<200||a>299)throw S(a,c,l.get("retry-after"));return c}async exchange(e,r={},a=!1){let l=this.options.fetchImpl??fetch;if(!a&&r.retryUnauthorized!==!1)await this.renewBeforeExpiry(l,r.signal);let c=await l(`${this.credentials.apiOrigin}/v3${e}`,{method:r.method??"GET",headers:{authorization:`Bearer ${this.credentials.accessToken}`,accept:"application/json","user-agent":Qn,"x-reason-agent":"Reason CLI","x-client-surface":this.options.clientSurface??"direct_cli",...r.raw?{"content-type":r.raw.contentType}:r.body===void 0?{}:{"content-type":"application/json"},...r.headers,...r.ifNoneMatch?{"if-none-match":r.ifNoneMatch}:{}},body:r.raw?r.raw.bytes:r.body===void 0?void 0:JSON.stringify(r.body),signal:r.signal,redirect:r.ifNoneMatch?"manual":"error"}),m=await c.json().catch(()=>({}));if(c.status===401&&!a&&r.retryUnauthorized!==!1&&this.credentials.credentialKind!=="api_key"){let p=await ot({fetchImpl:l,path:this.options.credentialsPath,forceRefresh:!0,refused:this.credentials.accessToken,signal:r.signal});if(p)return this.credentials=p,this.exchange(e,r,!0)}return{status:c.status,headers:c.headers,json:m}}async renewBeforeExpiry(e,r){let a=this.credentials;if(a.credentialKind==="api_key"||!(Date.parse(a.expiresAt)<=Date.now()+60000))return;let l=await ot({fetchImpl:e,path:this.options.credentialsPath,signal:r}).catch(()=>null);if(l&&l.apiOrigin===a.apiOrigin&&l.orgId===a.orgId&&l.clientId===a.clientId)this.credentials=l}createHeadlessDeviceEnrollmentTicket(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollment-tickets`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}async enrollHeadlessDevice(e){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/enrollments`,{method:"POST",body:e,signal:AbortSignal.timeout(30000),retryUnauthorized:!1})}catch(r){if(r instanceof D&&(r.status===404||r.status===405||r.status===403&&r.code==="endpoint_not_available"))return null;throw r}}addDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}removeDeviceRoot(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices/${encodeURIComponent(e)}/roots/${encodeURIComponent(r)}`,{method:"DELETE",signal:AbortSignal.timeout(30000)})}machinePath(e,r=""){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/machines`;return e===void 0?a:`${a}/${encodeURIComponent(e)}${r}`}async listMachines(){return h(we,await this.request(this.machinePath()),"invalid_machine_list").machines}async createMachine(e){let r=await this.request(this.machinePath(),{method:"POST",body:{name:e.name,...e.platform?{platform:e.platform}:{}}});return h(Se,r,"invalid_machine").machine}async deleteMachine(e){let r=await this.request(this.machinePath(e),{method:"DELETE"});return h(ke,r,"invalid_machine_deletion")}async listSecretNames(e){let r=await this.request(`${this.secretsPath()}?scope=${e}`);return h(Ie,r,"invalid_secret_list").items.map((a)=>a.name)}async setSecret(e){let r=await this.request(this.secretsPath(),{method:"POST",body:e});return h(Ae,r,"invalid_secret_write")}secretsPath(){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/secrets`}async createMachineToken(e){let r=await this.request(this.machinePath(e,"/tokens"),{method:"POST",body:{}});return h(ve,r,"invalid_machine_token")}async createMachineEnrollmentTicket(e,r){let a=await this.request(this.machinePath(e,"/enrollment-tickets"),{method:"POST",body:r,signal:AbortSignal.timeout(30000),retryUnauthorized:!1});return h(O,a,"invalid_machine_ticket")}self(e){return this.request("/self",{signal:e})}submitFeedback(e){return this.request("/feedback",{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}agentNetwork(e=AbortSignal.timeout(30000)){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{signal:e})}startAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}rotateAgentNetwork(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{method:"PUT",body:e,signal:AbortSignal.timeout(30000)})}async claimAgentNetworkRelayJob(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/claim`,{method:"POST",body:e,signal:r});return h(P,a,"invalid_agent_network_job")}async completeAgentNetworkRelayJob(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/jobs/${encodeURIComponent(e)}`,{method:"POST",body:r,signal:AbortSignal.timeout(30000)})}async recordAgentNetworkRelayReplies(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network/relay/replies`,{method:"POST",body:e,signal:AbortSignal.timeout(30000)})}async workspaceMembers(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/members/users`,{signal:AbortSignal.timeout(30000)})).items??[]).flatMap((r)=>typeof r.email==="string"?[{email:r.email,role:typeof r.role==="string"?r.role:"member"}]:[])}claimExistingCliPairing(e){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/onboarding/import/pairing/claim-existing`,{method:"POST",body:{pairing_code:e}})}async claudeCodeSignIn(e){return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials`,{retryUnauthorized:!1,signal:e?AbortSignal.any([e,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000)})).claude_code_sign_in===!0}connectAnthropicProvider(e,r,a={}){let l=e.kind==="setup_token"?{setup_token:e.token}:{access_token:e.credential.access,refresh_token:e.credential.refresh,expires_at:new Date(e.credential.expires).toISOString()};return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/provider-credentials/anthropic`,{method:"POST",retryUnauthorized:a.retryUnauthorized,signal:a.signal,body:{...l,...r?{account_key:r}:{}}})}async listRepositories(){return((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/repositories`)).items??[]).flatMap((r)=>{let a=typeof r.full_name==="string"?r.full_name:typeof r.repo_full_name==="string"?r.repo_full_name:null;if(!a)return[];return[{repo_id:typeof r.repo_id==="string"?r.repo_id:void 0,full_name:a,provider:r.provider==="gitlab"?"gitlab":"github",default_branch:typeof r.default_branch==="string"?r.default_branch:null,private:typeof r.private==="boolean"?r.private:void 0}]})}async listProjects(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/projects`),r=de.safeParse(e);if(!r.success)throw new D(502,"invalid_project_list","Reason returned an unexpected project list.");return r.data.items}async listReasons(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons`);return h(ue,e,"invalid_reason_list").items}async openReasonConversation(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/reasons/${encodeURIComponent(e)}/conversation`,{method:"POST"});return h(n({session_id:t().min(1)}),r,"invalid_reason_conversation").session_id}async listSkills(){try{let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills`);return h(he,e,"invalid_skill_list").items}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return[];throw e}}async listDevices(){let e=[],r=null;for(let a=0;a<50;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/devices${r?`?after=${encodeURIComponent(r)}`:""}`),c=le.safeParse(l);if(!c.success)throw new D(502,"invalid_device_list","Reason returned an unexpected machine list.");if(e.push(...c.data.devices),r=c.data.has_next_page?c.data.end_cursor??null:null,!r)break}return e}async listModels(){try{let r=((await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`)).models??[]).filter((c)=>c.hidden!==!0),a=r.filter((c)=>c.available!==!1).map(({reasoning_efforts:c,hidden:m,available:p,...f})=>({...f,...Array.isArray(c)?{reasoning_efforts:ie.filter((y)=>c.includes(y))}:{}})),l=new Set(a.map((c)=>c.detail));return{models:a.length>1&&l.size===1?a.map(({detail:c,...m})=>m):a,runnable:a.length>0||r.length===0}}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return{models:[],runnable:!0};throw e}}async getAgentVersion(e){try{let r=await this.request("/deployment",{signal:e,retryUnauthorized:!1});return v(r.reason_version)?r.reason_version:null}catch{return null}}async getUsageQuota(){try{let e=se.safeParse(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/usage/quota`));if(!e.success)return null;let r;try{r=re(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`))}catch{}return{...e.data,own_inference:r}}catch(e){if(e instanceof D&&(e.status===403||e.status===404))return null;throw e}}async listSessionFields(e){let r=new URLSearchParams({first:String(Math.min(Math.max(e.first,1),200)),status:e.status??"active"});if(e.origin)r.set("origin",e.origin);r.set("fields",e.fields.join(","));let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${r.toString()}`,{status:l,headers:c,json:m}=await this.exchange(a,e.etag?{ifNoneMatch:e.etag}:{});if(l===304)return null;if(l<200||l>299)throw S(l,m,c.get("retry-after"));return{items:Array.isArray(m.items)?m.items:[],etag:c.get("etag")}}async listSessions(e=50,r,a={}){let l=new URLSearchParams({first:String(Math.min(Math.max(e,1),200)),status:a.status??"active"});if(r)l.set("project_id",r);if(a.origin)l.set("origin",a.origin);return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions?${l.toString()}`)).items??[]}getSession(e,r){let a=r?.fields.length?`?fields=${encodeURIComponent(r.fields.join(","))}`:"";return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${a}`)}async prestartSession(e){let r=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/prestart`,{method:"POST",body:{client_session_id:e}});return r?.status==="starting"||r?.status==="ready"}async createSession(e){let r=e.mode==="ephemeral"||e.workspaceOwnership==="externally-managed";if(e.attachments?.length)await this.requireSessionAttachments();if(r||e.runtimeProfile){let c=await this.request("/deployment");if(r&&(!Array.isArray(c.session_modes)||!c.session_modes.includes(e.mode??"standard")||!Array.isArray(c.workspace_ownerships)||!c.workspace_ownerships.includes(e.workspaceOwnership??"managed")))throw Error("Deployment does not support the requested Session policy; refusing to create a Session.");if(e.runtimeProfile&&(!Array.isArray(c.experimental_runtime_profiles)||!c.experimental_runtime_profiles.includes(e.runtimeProfile)))throw Error("Deployment does not support the requested runtime profile; refusing to create a Session.")}let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions`,{method:"POST",body:{prompt:e.prompt,...e.attachments?.length?{attachments:e.attachments}:{},...e.mode?{mode:e.mode}:{},...e.workspaceOwnership?{workspace_ownership:e.workspaceOwnership}:{},...e.target?{target:e.target}:{},...e.repo?{repo:e.repo}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.reasoningEffort?{reasoning_effort:e.reasoningEffort}:{},...e.runtimeProfile?{experimental_runtime_profile:e.runtimeProfile}:{},...e.ref?{ref:e.ref}:{},...e.branch?{branch:e.branch}:{},...e.completionMode?{completion_mode:e.completionMode}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.clientSessionId?{client_session_id:e.clientSessionId}:{},...e.longRunning?{long_running:{enabled:!0}}:{},...e.spendLimitRcu?{spend_limit_rcu:e.spendLimitRcu}:{},idempotency_key:`cli-${crypto.randomUUID()}`}}),l=await this.getSession(a.session_id);if(r){let c=l.session_policy,m=["memoryRead","memoryWrite","skills","inheritedInstructions","integrations","secretInjection"];if(!c||c.version!==1||c.mode!==(e.mode??"standard")||c.workspaceOwnership!==(e.workspaceOwnership??"managed")||!c.components||m.some((p)=>c.components[p]!==!0))throw await this.cancelSession(a.session_id),Error("Server did not attest the requested Session policy; cancellation requested.")}if(e.runtimeProfile&&l.experimental_runtime_profile!==e.runtimeProfile)throw await this.cancelSession(a.session_id),Error("Server did not attest the requested runtime profile; cancellation requested.");return l}async getEvents(e,r=-1,a={}){try{return await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/events?after_seq=${r}&limit=500${a.waitMs?`&wait_ms=${a.waitMs}`:""}`,a.signal?{signal:a.signal}:{})}catch(l){if(!(l instanceof D)||l.status!==403&&l.status!==404)throw l;return{session:await this.getSession(e),items:[],next_seq:r}}}async getMessages(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages?first=500${r===void 0?"":`&after_seq=${r}`}`)}async getAttachments(e,r){try{return(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/attachments${r?`?view=${r}`:""}`)).items??[]}catch(a){if(a instanceof D&&(a.status===403||a.status===404))return[];throw a}}async requireSessionAttachments(){let e=await this.request("/deployment",{headers:{"cache-control":"no-cache"}});if(e.session_attachments!==!0){let r=typeof e.reason_version==="string"&&/^\d+\.\d+(?:\.\d+)?$/.test(e.reason_version)?`Agent ${e.reason_version}`:null,a=typeof e.commit_sha==="string"&&/^[a-f0-9]{40,64}$/i.test(e.commit_sha)?`server ${e.commit_sha.slice(0,12)}`:null,l=[r,a].filter(Boolean).join(", ");throw Error(`This server does not support Session image attachments: ${new URL(this.credentials.apiOrigin).host}${l?` (${l})`:""}. The API server needs an attachment-capable deployment; updating the Agent version alone is not enough. Your image was not sent; retry after the server update.`)}}async sendMessage(e,r,a={}){if(a.attachments?.length)await this.requireSessionAttachments();return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:{message:r,...a.attachments?.length?{attachments:a.attachments}:{},...a.model?{model:a.model}:{},...a.reasoningEffort?{reasoning_effort:a.reasoningEffort}:{},...a.target?{target:a.target}:{},...a.delivery?{delivery:a.delivery}:{}}})}async steerQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/steer`,{method:"POST",body:{}})}async withdrawQueuedMessage(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/queued`,{method:"DELETE"})}async getConversation(e){let r=[],a=null;for(let l=0;l<50;l+=1){let c=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/conversation${a?`?after=${encodeURIComponent(a)}`:""}`);if(r.push(...c.items??[]),!c.has_next_page||!c.end_cursor)break;a=c.end_cursor}return r}createSharedLink(e,r){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/shared-links`,{method:"POST",body:{url:r.url,...r.label?{label:r.label}:{},...r.expiresInSeconds!==void 0?{expires_in_seconds:r.expiresInSeconds}:{}}})}sessionAction(e,r,a={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/${r}`,{method:"POST",body:a})}renameSession(e,r){return this.sessionAction(e,"rename",{title:r||null})}moveSessionToProject(e,r){return this.sessionAction(e,"project",{project_id:r})}compactSession(e){return this.sessionAction(e,"compact")}retrySession(e){return this.sessionAction(e,"retry")}rewindSession(e,r){return this.sessionAction(e,"rewind",{message_id:r.messageId,content:r.content,request_id:r.requestId})}forkSession(e,r){return this.sessionAction(e,"fork",{...r.message?{message:r.message}:{},client_session_id:r.clientSessionId})}cancelSession(e,r={}){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}/cancel`,{method:"POST",body:r.mode==="hard"?{mode:"hard"}:{}})}sessionPath(e,r=""){return`/organizations/${encodeURIComponent(this.credentials.orgId)}/sessions/${encodeURIComponent(e)}${r}`}async archiveSession(e){await this.request(this.sessionPath(e,"/archive"),{method:"POST",body:{}})}async unarchiveSession(e){await this.request(this.sessionPath(e,"/unarchive"),{method:"POST",body:{}})}async deleteSession(e){await this.request(this.sessionPath(e),{method:"DELETE"})}async listSessionTags(e){return h(C,await this.request(this.sessionPath(e,"/tags")),"invalid_session_tags").tags}async appendSessionTags(e,r){let a=await this.request(this.sessionPath(e,"/tags"),{method:"POST",body:{tags:r}});return h(C,a,"invalid_session_tags").tags}async sessionInsight(e,r=!1){let a=await this.request(this.sessionPath(e,r?"/insights/generate":"/insights"),r?{method:"POST",body:{}}:{});return h(Re,a,"invalid_session_insight")}async listAutomations(){let e=[],r=null;for(let a=0;a<20;a+=1){let l=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations?first=100${r?`&after=${encodeURIComponent(r)}`:""}`),c=h(fe,l,"invalid_automation_list");if(e.push(...c.items),r=c.has_next_page?c.end_cursor??null:null,!r)break}return e}async createScheduledAutomation(e,r){let a=`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations`,l=h(T,await this.request(a,{method:"POST",body:{name:e.name,instructions:e.instructions,...e.repo?{repo:e.repo.full_name,provider:e.repo.provider}:{}}}),"invalid_automation");try{await this.request(`${a}/${encodeURIComponent(l.id)}/triggers`,{method:"POST",body:r})}catch(c){throw await this.deleteAutomation(l.id).catch(()=>{return}),c}return l}async setAutomationEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"PATCH",body:{enabled:r}})}async deleteAutomation(e){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/automations/${encodeURIComponent(e)}`,{method:"DELETE"})}async transcribe(e,r){let a=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/transcribe`,{method:"POST",raw:{bytes:e,contentType:r}});return h(n({transcript:t()}),a,"invalid_transcript").transcript}async listMcpServers(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/mcp-servers`);return h(_e,e,"invalid_mcp_server_list").items}async setSkillEnabled(e,r){await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/skills/${encodeURIComponent(e)}`,{method:"PUT",body:{is_enabled:r}})}}
|
|
3
|
-
export{ot,D,Ps,rs};
|
|
File without changes
|