@reason-machines/cli-linux-x64 0.2.508 → 0.2.511
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/THIRD_PARTY_NOTICES.txt +0 -50
- package/bin/reason +2 -2
- package/bin/vm-hands/api-68t0w5r8.js +2 -0
- package/bin/vm-hands/api-credentials-d98wm1c4.js +2 -0
- package/bin/vm-hands/connect-cli-3z1w0fn6.js +2 -0
- package/bin/vm-hands/credentials-pgsb4v9j.js +2 -0
- package/bin/vm-hands/custom-endpoint-device-57hkdy1z.js +2 -0
- package/bin/vm-hands/desktop-account-j6fjngt1.js +2 -0
- package/bin/vm-hands/device-workspace-qjyzphga.js +2 -0
- package/bin/vm-hands/{fsevents-8zxmv89w.js → fsevents-sw63c1nr.js} +1 -1
- package/bin/vm-hands/hands-worker-source-xjbrgfar.js +2 -0
- package/bin/vm-hands/{index-ttmxy9nd.js → index-j4gb3cze.js} +10 -10
- package/bin/vm-hands/install-receipt-y7exc4wh.js +2 -0
- package/bin/vm-hands/local-automation-780w99r4.js +2 -0
- package/bin/vm-hands/local-capabilities-e8s80r9j.js +2 -0
- package/bin/vm-hands/local-desktop-users-q0391ha1.js +2 -0
- package/bin/vm-hands/local-display-mac-7pg0n3zs.js +2 -0
- package/bin/vm-hands/local-display-session-j1znexft.js +2 -0
- package/bin/vm-hands/local-display-video-ahs5g3ba.js +2 -0
- package/bin/vm-hands/local-managed-process-6d7b6ch1.js +2 -0
- package/bin/vm-hands/local-pty-session-q06ff8yk.js +2 -0
- package/bin/vm-hands/managed-runtime-ycrdc7n6.js +2 -0
- package/bin/vm-hands/network-contract-6mkf58vs.js +2 -0
- package/bin/vm-hands/package-sng72tm1.js +2 -0
- package/bin/vm-hands/permissions-bdxyn8v7.js +2 -0
- package/bin/vm-hands/reason-hands-protocol-zf7bpqwe.js +2 -0
- package/bin/vm-hands/serve-service-yvvgyrxa.js +2 -0
- package/bin/vm-hands/status-9ep9pqvv.js +10 -0
- package/bin/vm-hands/version-qrc35j69.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-v9qq2cgv.js → vm-hands-entry-lite-024t90qh.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-7777m86y.js → vm-hands-entry-lite-0gj3p9tg.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-6kns28gv.js → vm-hands-entry-lite-0pae1q0k.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-d2c2hr0j.js → vm-hands-entry-lite-0q01asmp.js} +39 -39
- package/bin/vm-hands/vm-hands-entry-lite-0sh835na.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-5gevvgec.js → vm-hands-entry-lite-1ek3r3w9.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-77j164ps.js → vm-hands-entry-lite-1zd088yv.js} +25 -25
- package/bin/vm-hands/{vm-hands-entry-lite-cjm54bxv.js → vm-hands-entry-lite-359n9b0z.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-38g65s5x.js → vm-hands-entry-lite-39qv4sqt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rzr2ncf5.js → vm-hands-entry-lite-3p7zk3yt.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-zjcan28e.js → vm-hands-entry-lite-4qzz0969.js} +21 -21
- package/bin/vm-hands/{vm-hands-entry-lite-6x1an7es.js → vm-hands-entry-lite-5np5k3wb.js} +4 -4
- package/bin/vm-hands/vm-hands-entry-lite-60pnam39.js +3 -0
- package/bin/vm-hands/vm-hands-entry-lite-64b6nx6h.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-wnt1695y.js → vm-hands-entry-lite-6g8b6jw5.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-txd50spx.js → vm-hands-entry-lite-70hq7mrs.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-x39tmj7j.js → vm-hands-entry-lite-7p4qsm5s.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-9bp1d166.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-ztv9msdv.js → vm-hands-entry-lite-abq9tw0y.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-wn9vrkqj.js → vm-hands-entry-lite-cb6z6b7g.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-np07qyeq.js → vm-hands-entry-lite-ckezse0f.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-vmhkg070.js → vm-hands-entry-lite-cy9ckdxb.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-qvvvg5jg.js → vm-hands-entry-lite-dbkb8zn6.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-tebh7dcm.js → vm-hands-entry-lite-dcrz19xf.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-5geb03sz.js → vm-hands-entry-lite-j5yc1ejg.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-k40j4vwe.js → vm-hands-entry-lite-jzw126a4.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-eabever7.js → vm-hands-entry-lite-k1wghndy.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-qpdpzg8g.js → vm-hands-entry-lite-m7pkmatv.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-psywfz8m.js → vm-hands-entry-lite-psjcmgj8.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-f62fvme8.js → vm-hands-entry-lite-pwmvq53c.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-fjn8verv.js → vm-hands-entry-lite-qny40hr2.js} +5 -5
- package/bin/vm-hands/{vm-hands-entry-lite-87vmbt38.js → vm-hands-entry-lite-qz74j563.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-gvjffc5t.js → vm-hands-entry-lite-qzcac2mf.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-aj4bv3wr.js → vm-hands-entry-lite-s455zena.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-rfz60hb3.js → vm-hands-entry-lite-s85p7tqp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ewr54tpc.js → vm-hands-entry-lite-svd5v9dr.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-wrvz9jxy.js → vm-hands-entry-lite-td73npv3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-hmaazqdr.js → vm-hands-entry-lite-vs47bs09.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-vwxg4fhe.js +42 -0
- package/bin/vm-hands/{vm-hands-entry-lite-ypsgm6ek.js → vm-hands-entry-lite-wng9s3k8.js} +10 -10
- package/bin/vm-hands/{vm-hands-entry-lite-nqdstx24.js → vm-hands-entry-lite-wp0d65yx.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-ncbzy69k.js → vm-hands-entry-lite-wx1fmrbs.js} +3 -3
- package/bin/vm-hands/vm-hands-entry-lite-x6akmegv.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-f69t48dj.js → vm-hands-entry-lite-ymqb2927.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-mk5ayds8.js → vm-hands-entry-lite-zc8fsn2e.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-1ts90rmh.js → vm-hands-executor-hggcrys1.js} +3 -3
- package/bin/vm-hands/vm-hands-op-runner-3p2cgtjy.js +2 -0
- package/bin/vm-hands/{vm-hands-runtime-zca3gekb.js → vm-hands-runtime-490vccjv.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-6kk98y4k.js +2 -0
- package/bin/vm-hands/worker-sandbox-j6cmex8e.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-credentials-sbhjbnav.js +0 -2
- package/bin/vm-hands/api-nqz67ppf.js +0 -2
- package/bin/vm-hands/connect-cli-76jsvdgq.js +0 -2
- package/bin/vm-hands/credentials-drj5ktpt.js +0 -2
- package/bin/vm-hands/custom-endpoint-device-j1x988g0.js +0 -2
- package/bin/vm-hands/desktop-account-4525j7h3.js +0 -2
- package/bin/vm-hands/device-workspace-pt07525s.js +0 -2
- package/bin/vm-hands/hands-worker-source-atg5dc7b.js +0 -2
- package/bin/vm-hands/install-receipt-6v65enmf.js +0 -2
- package/bin/vm-hands/local-automation-3w40a7x4.js +0 -2
- package/bin/vm-hands/local-capabilities-6zej0ngm.js +0 -2
- package/bin/vm-hands/local-desktop-users-9dqayaej.js +0 -2
- package/bin/vm-hands/local-display-mac-fnp3317m.js +0 -2
- package/bin/vm-hands/local-display-session-40m49yjn.js +0 -2
- package/bin/vm-hands/local-display-video-d5kd6mt9.js +0 -2
- package/bin/vm-hands/local-managed-process-kgwxtgwj.js +0 -2
- package/bin/vm-hands/local-pty-session-5yh2a63r.js +0 -2
- package/bin/vm-hands/managed-runtime-2e5x5c60.js +0 -2
- package/bin/vm-hands/network-contract-rzw769gw.js +0 -2
- package/bin/vm-hands/package-r7sgmw4t.js +0 -2
- package/bin/vm-hands/permissions-pct5sdhg.js +0 -2
- package/bin/vm-hands/reason-hands-protocol-8fgk2s53.js +0 -2
- package/bin/vm-hands/serve-service-3sa1ty9g.js +0 -2
- package/bin/vm-hands/status-5xwn7txy.js +0 -10
- package/bin/vm-hands/version-wrccch8z.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-3sjkzhf6.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-5tbntcyq.js +0 -42
- package/bin/vm-hands/vm-hands-entry-lite-8wcyveeh.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-kz26rfcv.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-qmk05xmy.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-swrymqj9.js +0 -3
- package/bin/vm-hands/vm-hands-op-runner-bhpqejtr.js +0 -2
- package/bin/vm-hands/worker-preview-readiness-7xtgxsar.js +0 -2
- package/bin/vm-hands/worker-sandbox-s9pyac8p.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rt}from"./vm-hands-entry-lite-
|
|
3
|
-
`,{mode:420}),r("srt_base_keyed",{})}catch{r("srt_base_keyed_skipped",{reason:"error"})}}function B(r,n){let t=(u)=>(n("srt_warm_skipped",{reason:u}),Promise.resolve());if(typeof r.srt_base_settings!=="string")return t("no_settings");let s=Buffer.from(r.srt_base_settings,"base64");if(s.length===0||s.length>se||s.toString("base64")!==r.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((y)=>N(y,{throwIfNoEntry:!1})!==void 0);if(!f)return t("cgroup_or_exec_missing");a=f;for(let[y,m]of[[a,!1],["/usr/local/bin",!0]]){let _=N(y);if((m?!_.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(),g=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:g}),u()})})}var Y=3000;function Re(r){if(!r||typeof r!=="object"||Array.isArray(r))return null;let n=r,{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(r){j(r,{recursive:!0,mode:448});let n=te(r);if(!n.isDirectory()||(n.mode&63)!==0||n.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${r}`)}async function ce(r){let[{CLI_VERSION:n},t,s,a]=await Promise.all([import("./version-
|
|
4
|
-
`)){let t=n.split(":");if(t.length>=4&&Number(t[2])===r&&/^\d+$/.test(t[3]??"")&&Number(t[3])>0)return Number(t[3])}throw Error("vm_hands_payload_account_unavailable")}function fe(r,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:r.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(r=process.platform,n="/proc/self/oom_score_adj"){if(r!=="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(r,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(r,n),a=!1,l=async()=>{if(!await Promise.race([s.then(()=>!0),new Promise((o)=>setTimeout(()=>o(!1),Y).unref?.())]))a=!0,n("srt_warm_late",{wait_ms:Y})},[{configureDesktopAccount:g},{configureWorkerSandbox:c}]=await Promise.all([import("./desktop-account-
|
|
2
|
+
import{rt}from"./vm-hands-entry-lite-vwxg4fhe.js";import"./vm-hands-entry-lite-64b6nx6h.js";import{Rt}from"./vm-hands-entry-lite-jzw126a4.js";import{Hi,pn,zi}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(r,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){r("srt_base_keyed_skipped",{reason:"socket_dir_unsafe"});return}z(`${n}/base-keyed`,`1
|
|
3
|
+
`,{mode:420}),r("srt_base_keyed",{})}catch{r("srt_base_keyed_skipped",{reason:"error"})}}function B(r,n){let t=(u)=>(n("srt_warm_skipped",{reason:u}),Promise.resolve());if(typeof r.srt_base_settings!=="string")return t("no_settings");let s=Buffer.from(r.srt_base_settings,"base64");if(s.length===0||s.length>se||s.toString("base64")!==r.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((y)=>N(y,{throwIfNoEntry:!1})!==void 0);if(!f)return t("cgroup_or_exec_missing");a=f;for(let[y,m]of[[a,!1],["/usr/local/bin",!0]]){let _=N(y);if((m?!_.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(),g=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:g}),u()})})}var Y=3000;function Re(r){if(!r||typeof r!=="object"||Array.isArray(r))return null;let n=r,{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(r){j(r,{recursive:!0,mode:448});let n=te(r);if(!n.isDirectory()||(n.mode&63)!==0||n.uid!==(process.getuid?.()??-1))throw Error(`vm_hands_runtime_directory_unsafe: ${r}`)}async function ce(r){let[{CLI_VERSION:n},t,s,a]=await Promise.all([import("./version-qrc35j69.js"),import("./hands-worker-source-xjbrgfar.js"),import("./network-contract-6mkf58vs.js"),import("./device-workspace-qjyzphga.js")]),{REASON_HANDS_PROTOCOL_VERSION:l}=await import("./reason-hands-protocol-zf7bpqwe.js");return{reason_runtime_version:n,bridge_version:n,protocol_version:rt,execution_eligible:!0,instance_generation:r.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(r,n){return{executionMode:"unsandboxed",runtimeDirectory:n,readiness:{...Object.fromEntries(I.map((t)=>[t,!0])),...r.lanes},...r.probing?{probing:X.filter((t)=>r.lanes[t]!==!0)}:{},...r.displayVideo?{displayVideo:!0}:{}}}function _e(r,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=r.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 g=X.filter((c)=>s.operation_constraints?.[c]!==void 0);for(let c of g)l[c]=s.operation_constraints[c];return{...r,capabilities:{...a,supported_operations:["hands.connect",...I,...g],operation_constraints:l}}}function pe(r){for(let n of G("/etc/passwd","utf8").split(`
|
|
4
|
+
`)){let t=n.split(":");if(t.length>=4&&Number(t[2])===r&&/^\d+$/.test(t[3]??"")&&Number(t[3])>0)return Number(t[3])}throw Error("vm_hands_payload_account_unavailable")}function fe(r,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:r.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(r=process.platform,n="/proc/self/oom_score_adj"){if(r!=="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(r,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(r,n),a=!1,l=async()=>{if(!await Promise.race([s.then(()=>!0),new Promise((o)=>setTimeout(()=>o(!1),Y).unref?.())]))a=!0,n("srt_warm_late",{wait_ms:Y})},[{configureDesktopAccount:g},{configureWorkerSandbox:c}]=await Promise.all([import("./desktop-account-j6fjngt1.js"),import("./worker-sandbox-j6cmex8e.js")]);c();try{g({value:String(r.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,y=new Promise((e)=>{f=e}),m=y.then(()=>import("./vm-hands-executor-hggcrys1.js")).then(({createVmHandsExecutor:e})=>{let o=e({init:r,root:V,runtimeDirectory:O,apiOrigin:r.api_origin,prespawn:!0,onSrtReset:()=>{a=!1,s=B(r,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"),o}),_=(e)=>async(...o)=>(await m)[e](...o),x=null;m.then((e)=>{x=(o)=>e.executorExited(o)});let S={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};m.then((e)=>{S.restatLayout=(o)=>e.restatLayout(o),S.verifyMounts=(o)=>e.verifyMounts(o),S.installEnvironment=(o,d)=>e.installEnvironment(o,d),S.freezeBind=(o)=>e.freezeBind(o),S.takeSrtFallbacks=()=>e.takeSrtFallbacks?.()??null});let q=await Hi(r),C=new pn(r,q,S,{envRoot:W}),M=ce(r),w={probing:!0,lanes:{},displayVideo:!1},L=null,K=null,Q=Promise.all([M,import("./local-capabilities-e8s80r9j.js")]).then(([e,o])=>{K=()=>_e(e,o.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=y.then(()=>import("./vm-hands-executor-hggcrys1.js")).then(({createVmHandsOpRunners:e,vmHandsBindCgroup:o,VM_HANDS_PAYLOAD_CGROUP:d})=>e({payloadUid:r.layout.payload_uid,payloadGid:pe(r.layout.payload_uid),bindCgroup:(i)=>o(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 o=Date.now()+le;while(C.settingUp&&Date.now()<o)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 zi({apiOrigin:r.api_origin,agent:C,signal:v.signal,heartbeat:async()=>K?.()??await M,onHeartbeatNow:(e)=>{L=e},executeOp:async({kind:e,claim:o,bindId:d,signal:i,emit:E})=>{let k=fe(r,o);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(o.capability==="exec.full"&&e!=="person")return{status:"failed",error_code:"capability_not_granted"};if(o.capability==="automation.call.v1"&&e!=="model")return{status:"failed",error_code:"capability_not_granted"};let Z=o.capability==="pty.start"&&e==="person"&&!o.authority;if(de.has(String(o.capability))&&!Z){let{executeLocalOperation:p}=await import("./local-capabilities-e8s80r9j.js");return p(k,o,{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(Rt.has(String(o.capability))){if(w.lanes[String(o.capability)]!==!0)return{status:"failed",error_code:"capability_unavailable"};return P.run("surface",{id:String(o.attempt_id),claim:o,state:k,worker:J(w,A)},T,i)}return P.run(e,{id:String(o.attempt_id),claim:o,state:k,worker:F},T,i,d)},controlOp:async({claim:e,control:o})=>Rt.has(String(e.capability))&&((await b)?.notify("surface",{t:"control",id:String(e.attempt_id),control:{kind:o.kind,payload:o.payload??{}}})??!1),opCompleted:({claim:e,status:o,acknowledged:d})=>{if(d&&e.capability==="preview.serve.v1")b.then((i)=>i?.notify("surface",{t:"retire",operation_id:String(e.operation_id),status:o}))},readyData:({launchId:e})=>({executor_launch_id:e}),log:(e,o)=>{if(e==="vm_hands.registered"||e==="vm_hands.reconnected")f();n(e,o)},onTurn:(e,o)=>{if(o)u.set(e,o);else u.delete(e)}}),await(await m).stop(),(await b)?.stop()}export{Re as parseVmHandsInit,ke as runVmHands};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bi,Vo,Go,ys}from"./vm-hands-entry-lite-vmhkg070.js";import"./vm-hands-entry-lite-qmk05xmy.js";import"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{Bi as apiOriginFromEnvironment,Go as environmentApiKey,Vo as explicitApiOrigin,ys as resolveApiCredentials};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I,bs,Ko}from"./vm-hands-entry-lite-qmk05xmy.js";import"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{I as ApiError,Ko as ReasonApi,bs as createMachineEnrollmentTicketWithToken};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{nt,hs,fs,ms}from"./vm-hands-entry-lite-ztv9msdv.js";import"./vm-hands-entry-lite-3sjkzhf6.js";import"./vm-hands-entry-lite-x39tmj7j.js";import"./vm-hands-entry-lite-vmhkg070.js";import"./vm-hands-entry-lite-qmk05xmy.js";import"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-5geb03sz.js";import"./vm-hands-entry-lite-d2c2hr0j.js";import"./vm-hands-entry-lite-6x1an7es.js";import"./vm-hands-entry-lite-6kns28gv.js";import"./vm-hands-entry-lite-zjcan28e.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-77j164ps.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-8wcyveeh.js";import"./vm-hands-entry-lite-wnt1695y.js";import"./vm-hands-entry-lite-qvvvg5jg.js";import"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-ypsgm6ek.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-5tbntcyq.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{hs as computerDisconnected,nt as connectionDirectory,fs as connectionReport,ms as restartConnection};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fe,an,Tt,cn}from"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Fe as credentialsPath,cn as deleteCredentials,Tt as loadCredentials,an as saveCredentials};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{lt,Lt,Cr,kn,Ar,Cn,An,Pn}from"./vm-hands-entry-lite-8wcyveeh.js";export{lt as CUSTOM_ENDPOINT_DEVICE_CHUNK_BYTES,Cr as CUSTOM_ENDPOINT_DEVICE_MAX_CHUNKS,Lt as CUSTOM_ENDPOINT_DEVICE_MAX_RESPONSE_BYTES,kn as CUSTOM_ENDPOINT_DEVICE_TIMEOUT_MS,An as CustomEndpointDeviceCredentialSchema,Cn as CustomEndpointDeviceRequestSchema,Ar as customEndpointRequestMatchesConfig,Pn as isCustomEndpointDeviceFailureCode};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ue,Ce,Z,Ae,de,rr,et,X,O,H,Yr,Qr,en,nr,tn}from"./vm-hands-entry-lite-38g65s5x.js";export{en as CLOUD_REPOSITORY_WORKSPACE_ID,Yr as CLOUD_SESSION_CONTROL_BASE,nr as CLOUD_SESSION_ROOT,Ce as HANDS_WORKSPACE_BASE_KEY,Ae as HANDS_WORKSPACE_LAYOUT_KEY,ue as REASON_WORKSPACE_BASE,Z as SESSION_WORKSPACE_LAYOUT,de as SESSION_WORKTREES,rr as SESSION_WORKTREE_ID,Qr as SIDECHAT_WORKSPACE_ID,tn as cloudSessionLayoutOfRoot,O as deviceWorkspaceRootRelative,X as isDeviceWorkspacePath,et as isSessionWorktreePath,H as parseDeviceWorkspace};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{D,R,es,b,En}from"./vm-hands-entry-lite-77j164ps.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{b as REASON_HANDS_WORKER_ARTIFACT_SHA256,R as REASON_HANDS_WORKER_ENTRYPOINT,es as REASON_HANDS_WORKER_SOURCE,En as REASON_HANDS_WORKER_STARTUP_REFUSALS,D as REASON_HANDS_WORKER_VERSION};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{os,Kr,ei,Jr,ti}from"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{os as FUTURE_DEVICE_CONSENT_SCOPE,Kr as installationReceiptPath,Jr as installerReasonAlias,ei as installerReceiptLauncher,ti as loadInstallationReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tn,Ns,Ls,Ms,$s,Rn}from"./vm-hands-entry-lite-wnt1695y.js";import"./vm-hands-entry-lite-qvvvg5jg.js";import"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-ypsgm6ek.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-5tbntcyq.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{Ls as ensureLocalBrowser,Tn as localAutomationAvailable,Ms as localBrowserProfile,Ns as localUserChromeHost,$s as runAutomationCallLocally,Rn as runLocalAutomation};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Jo,Ui,pn,Zo,Xo,Yo,Qo,Ps,Ts,Rs,Os}from"./vm-hands-entry-lite-d2c2hr0j.js";import"./vm-hands-entry-lite-6x1an7es.js";import"./vm-hands-entry-lite-6kns28gv.js";import"./vm-hands-entry-lite-zjcan28e.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-77j164ps.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-8wcyveeh.js";import"./vm-hands-entry-lite-wnt1695y.js";import"./vm-hands-entry-lite-qvvvg5jg.js";import"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-ypsgm6ek.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-5tbntcyq.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import{r}from"./vm-hands-entry-lite-qy9xg6em.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{r as LocalCapabilityError,Jo as SHORT_REQUEST_CAPABILITIES,Ps as capabilityInventoryForRoots,Ui as confinedExecutionShell,Zo as defaultLocalCommandRunner,Ts as deliverLocalHandsEnvironment,Qo as enrolledRootPaths,Os as executeLocalOperation,Rs as rebindLocalHandsControl,Xo as runFileCapability,Yo as runTransferCapability,pn as spawnCaptured};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xt,fa,ma,Mi,$i}from"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{fa as forgetLocalDesktopUse,$i as holdLocalDesktop,xt as noteLocalDesktopUse,ma as releaseLocalDesktop,Mi as trackDesktopRun};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$t,Bs,G,qe,Bt}from"./vm-hands-entry-lite-qvvvg5jg.js";import"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{qe as ensureLinuxDesktop,$t as localDisplayAvailable,Bs as localDisplayReady,G as privateDirectory,Bt as runLocalDisplayStream};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{In,Dn,Nn,Ln,Pr}from"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{In as MAC_SCREEN,Dn as WINDOWS_SCREEN,Nn as createDisplayVideoLane,Pr as localDisplayVideoAvailable,Ln as simulatorVideoFfmpeg};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{it,dr,Is,Ds}from"./vm-hands-entry-lite-6kns28gv.js";import"./vm-hands-entry-lite-zjcan28e.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-77j164ps.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-5tbntcyq.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{it as ManagedProcessStoppedError,Is as controlManagedDeviceProcess,Ds as retireManagedDeviceProcess,dr as runManagedDeviceProcess};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Or,qt,Ir,ns,Un,Dr,Hn}from"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-rzr2ncf5.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{qt as LOCAL_PTY_MAX_BUFFERED_OUTPUT_BYTES,Ir as LOCAL_PTY_MAX_SESSIONS,Or as LOCAL_PTY_MAX_SESSION_MS,Dr as defaultConnect,ns as defaultLoginShell,Un as ptyRuntimeSupported,Hn as runLocalPtySession};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{vs,Ss,Es,xs,ks,Cs,As}from"./vm-hands-entry-lite-5geb03sz.js";import"./vm-hands-entry-lite-f69t48dj.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{ks as acquireManagedRuntimeDirectoryLock,Es as currentManagedRuntimeVersion,As as flushManagedRuntimeLifecycleEvents,xs as isManagedRuntimeVersionExecutable,Ss as legacyManagedRuntimePaths,vs as managedRuntimePaths,Cs as recordManagedRuntimeLifecycle};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rt,Te,Ks,Js,Zs,ii,Xs,rn,oi,bt,si,ai,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Y,Re,q,Si,Ei,xi,Q,ki,Ci,Ai,Pi,Ti,vt,Ri,Ys,or,Oi,Qs,ss,ea,ta,ra,na,ia,oa,sa,aa,ca,la,ua,da,pa,ha}from"./vm-hands-entry-lite-5tbntcyq.js";export{Ri as AUTOMATION_CLOUD_SESSIONS,vt as AUTOMATION_USER_CHROME,gi as HANDS_CLOUD_ACCESS,_i as HANDS_CLOUD_ACCESS_KEY,pe as HANDS_CONFINEMENT,Y as HANDS_CONFINEMENT_KEY,li as HANDS_ENVIRONMENT_AT_CLAIM,ui as HANDS_ENVIRONMENT_AT_CLAIM_KEY,oi as HANDS_ENVIRONMENT_DELIVERY,bt as HANDS_ENVIRONMENT_DELIVER_CONTROL,yi as HANDS_HEADLESS_BROWSER,wi as HANDS_HEADLESS_BROWSER_KEY,Si as HANDS_JOBS_USER,Ei as HANDS_JOBS_USER_KEY,bi as HANDS_LARGE_ENVIRONMENT,vi as HANDS_LARGE_ENVIRONMENT_KEY,Re as HANDS_MODEL_JOBS_EGRESS,q as HANDS_MODEL_JOBS_EGRESS_KEY,hi as HANDS_REBIND,mi as HANDS_REBIND_CONTROL,fi as HANDS_REBIND_KEY,ki as HANDS_SESSION_CAP_KEY,Ci as HANDS_SESSION_CAP_NONE,xi as HANDS_SESSION_GROUP,Q as HANDS_SESSION_GROUP_KEY,di as HANDS_WORKSPACE_CHECK,pi as HANDS_WORKSPACE_CHECK_KEY,Pi as JOBS_START_WAIT,Ti as JOBS_START_WAIT_KEY,Te as LOCAL_OPERATION_MAX_BYTES,rt as LOCAL_RUNTIME_PROTOCOL_VERSION,Zs as LOCAL_RUNTIME_ROUTES,rn as LOCAL_RUNTIME_SESSION_CLAIM_WAIT_MAX_MS,ii as LOCAL_RUNTIME_SESSION_PATH,or as LOCAL_RUNTIME_WORKER_STARTUP_MAX_MS,Ks as RELAY_HOST_ALIAS_HEADER,Js as RELAY_HOST_ALIAS_VERSION,ci as VM_HANDS_UNBIND_UNVERIFIED_EVENT,si as VM_HANDS_WORKSPACE_DEFERRED_KEY,ai as VM_HANDS_WORKSPACE_GRANT_CONTROL,Ai as WORKER_PREVIEW_CARRIED_JOBS,Ys as WORKER_STARTUP_TIMING_STAGES,Oi as buildLocalRuntimeDeviceProofBytes,Xs as localRuntimeSessionRoutable,sa as parseLocalRuntimeDisconnectResponse,ta as parseLocalRuntimeEnrollmentResponse,Qs as parseLocalRuntimeErrorEnvelope,na as parseLocalRuntimeFirstHeartbeat,ra as parseLocalRuntimeHeartbeatResponse,oa as parseLocalRuntimeIdentityResponse,ca as parseLocalRuntimeLifecycleResponse,aa as parseLocalRuntimeLocalSubscriptionResponse,la as parseLocalRuntimeOperationClaim,ha as parseLocalRuntimeOperationCompletionResponse,pa as parseLocalRuntimeOperationEnvironmentResponse,da as parseLocalRuntimeOperationEventsResponse,ua as parseLocalRuntimeOperationHeartbeatResponse,ss as parseLocalRuntimeProofChallenge,ea as parseLocalRuntimeRegistrationResponse,ia as parseLocalRuntimeRootsSyncResponse};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ts,rs,js,Us}from"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Us as allowMacPermissions,js as permissionsSummary,rs as readMacPermissions,ts as reasonIdentity};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{P,$r,Br,zn,ht,qn,Fr,Je,Se,Wn,Ze,Jt,ne,Xe,Vn,Ee,Zt,jr,Xt,Ur,Gn,ae,U,N,ce,Hr,zr,Kn}from"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-38g65s5x.js";export{Ur as REASON_HANDS_CLOSE_CODES,Ze as REASON_HANDS_JOB_CONTROL_MAX_FRAME_BYTES,Fr 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,$r as REASON_HANDS_MAX_FRAME_BYTES,Br as REASON_HANDS_MAX_INPUT_CHARS,ht as REASON_HANDS_MAX_OUTPUT_CHARS,zn as REASON_HANDS_MAX_STRUCTURED_INPUT_CHARS,P as REASON_HANDS_PROTOCOL_VERSION,jr as REASON_HANDS_PTY_ANCHOR_EXIT_MS,Xt 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,Xe as REASON_HANDS_PTY_MAX_OUTPUT_BYTES,Vn as REASON_HANDS_PTY_MAX_PENDING_INPUT_BYTES,Jt as REASON_HANDS_PTY_PROTOCOL_VERSION,Gn as REASON_HANDS_WORKSPACE_BEFORE_MAX_OUTPUT_CHARS,U as isReasonHandsGeneration,ce as isReasonHandsPtyJobId,ae as isReasonHandsRequestId,N as isReasonHandsUuid,Hr as parseReasonHandsJobRequest,zr as parseReasonHandsJobResult,Kn as parseReasonHandsPtyReceipt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qr,xe,J,Jn,Hs,Ao,zs,Ye,is,Zn,qs,Ws,Wr,Vs,Gs}from"./vm-hands-entry-lite-ypsgm6ek.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-fcvf8md1.js";import"./vm-hands-entry-lite-swrymqj9.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-87vmbt38.js";import"./vm-hands-entry-lite-rfz60hb3.js";export{qr as WORKER_SERVICE_ENV,J as WorkerServiceError,Ao as connectServiceLabel,xe as defaultWorkerServiceHost,Ws as installWorkerService,Ye as installedWorkerService,zs as isConnectServiceLabel,Gs as removeWorkerService,Wr as restartWorkerService,Vs as retargetWorkerServiceLogs,is as retireLegacyWorkerService,qs as workerServiceDefinitionCurrent,Jn as workerServiceLauncher,Zn as workerServiceProcessRunning,Hs as workerServiceRetargetPending};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./vm-hands-entry-lite-qmk05xmy.js";import"./vm-hands-entry-lite-fcvf8md1.js";import{_}from"./vm-hands-entry-lite-nqdstx24.js";import"./vm-hands-entry-lite-38g65s5x.js";import"./vm-hands-entry-lite-f62fvme8.js";import"./vm-hands-entry-lite-rfz60hb3.js";import"./vm-hands-entry-lite-kz26rfcv.js";import"./vm-hands-entry-lite-vmhkg070.js";import{Vt,pt}from"./vm-hands-entry-lite-rzr2ncf5.js";import{w,M,lr,Be,nt}from"./vm-hands-entry-lite-ztv9msdv.js";import"./vm-hands-entry-lite-5tbntcyq.js";import"./vm-hands-entry-lite-d2c2hr0j.js";import"./vm-hands-entry-lite-zjcan28e.js";import"./vm-hands-entry-lite-tebh7dcm.js";import"./vm-hands-entry-lite-6x1an7es.js";import"./vm-hands-entry-lite-3sjkzhf6.js";import"./vm-hands-entry-lite-cjm54bxv.js";import"./vm-hands-entry-lite-eabever7.js";import"./vm-hands-entry-lite-fjn8verv.js";import"./vm-hands-entry-lite-wn9vrkqj.js";import"./vm-hands-entry-lite-ncbzy69k.js";import"./vm-hands-entry-lite-5geb03sz.js";import"./vm-hands-entry-lite-hmaazqdr.js";import"./vm-hands-entry-lite-ypsgm6ek.js";import"./vm-hands-entry-lite-8wcyveeh.js";import"./vm-hands-entry-lite-5gevvgec.js";import"./vm-hands-entry-lite-77j164ps.js";import"./vm-hands-entry-lite-wrvz9jxy.js";import"./vm-hands-entry-lite-6kns28gv.js";import"./vm-hands-entry-lite-v9qq2cgv.js";import"./vm-hands-entry-lite-qpdpzg8g.js";import"./vm-hands-entry-lite-qvvvg5jg.js";import"./vm-hands-entry-lite-wnt1695y.js";import"./vm-hands-entry-lite-x39tmj7j.js";import"./vm-hands-entry-lite-psywfz8m.js";import"./vm-hands-entry-lite-f69t48dj.js";import{a}from"./vm-hands-entry-lite-swrymqj9.js";import{t,o,u,i,s,n}from"./vm-hands-entry-lite-gvjffc5t.js";import"./vm-hands-entry-lite-87vmbt38.js";import{readFileSync as me,realpathSync as k,renameSync as ge,unlinkSync as fe,writeFileSync as he}from"fs";import{dirname as ye,join as I}from"path";function f(e){return`claude mcp add --transport http reason ${e}`}function h(e){return`codex mcp add reason --url ${e}
|
|
3
|
-
codex mcp login reason`}var F=f("https://mcp.reasonmachines.com/mcp"),z=h("https://mcp.reasonmachines.com/mcp"),B=`https://claude.ai/settings/connectors?add=custom&url=${encodeURIComponent("https://mcp.reasonmachines.com/mcp")}`,H=`https://cursor.com/install-mcp?name=reason&config=${encodeURIComponent(btoa(JSON.stringify({url:"https://mcp.reasonmachines.com/mcp"})))}`;var b="https://github.com/reason-machines/reason-plugins",X=`Connect a coding agent to Reason over MCP
|
|
4
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
reason mcp Show how to connect Claude Code, Codex, or another MCP client
|
|
7
|
-
reason mcp uninstall Remove only this machine's registrations of the earlier, retired server
|
|
8
|
-
|
|
9
|
-
Plugins for Claude Code and Codex: ${b}
|
|
10
|
-
`;var P=s(["granted","not_granted","unknown"]),C=i({status:P,checkedAt:o().finite(),executablePath:t().min(1)});var Oe=i({version:n(1),key:t(),at:o(),self:i({principal_type:t(),user_id:t().optional(),user_name:t().nullish(),email:t().nullish(),org_id:t(),organization_name:t().nullish(),organization_slug:t().nullish(),mcp_connections:u(i({client_id:t(),client_name:t(),last_used_at:t().nullable()})).optional()})});var x=30000;function L(e,c=Date.now(),y=null){let r=pt(e),d=(()=>{if(r?.state!=="connected"&&r?.state!=="starting")return!1;try{return process.kill(r.pid,0),!0}catch{return!1}})(),R=d&&r?.state==="connected",p=(g)=>R&&c-g>=0&&c-g<x,l=C.safeParse(r?.fullDiskAccess),m=Vt(r,y,c);return{...m?{permission_recovery:m}:{},full_disk_access:l.success&&p(l.data.checkedAt)?l.data.status:"unknown",keep_awake:{enabled:lr(e)==="battery_and_ac",holding:r?.idleSleepHold===!0&&p(Date.parse(r.lastHeartbeatAt??""))},executable:d&&l.success?l.data.executablePath:null}}function De(e=_()){if(process.platform!=="darwin")return null;let c=Be(I(nt(k(a()),e),"worker.json"));return c?L(w(c).daemon,Date.now(),M(c)):null}export{De as connectionMacState};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{t,St,k,o,d,u,c,g,ee,s,n}from"./vm-hands-entry-lite-gvjffc5t.js";var I=t().max(201).regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/).refine((e)=>e.split("/").every((r)=>r!=="."&&r!=="..")),y=t().min(1).max(255).regex(/^[A-Za-z0-9_][A-Za-z0-9_./-]*$/).refine((e)=>!e.includes("..")&&!e.includes("//")&&!e.endsWith("/")&&!e.endsWith(".lock")),x=t().regex(/^[a-f0-9]{40}$/),E=o().int().positive(),T=t().min(1).max(256),D=t().max(60000),L={version:n(1),repoFullName:I},C=u(t().max(1024).regex(/^(?:Co-authored-by: [^<>\r\n\x00]+ <[^<>\s]+@[^<>\s]+>|Reason-Contributor-ID: rc_[a-f0-9]{32})$/)).max(1000),G=c({expectedTrailers:C,missingFromHead:C}),z=g("action",[c({action:n("edit"),title:T.optional(),body:D.optional(),base:y.optional()}),c({action:s(["ready","draft","close"])}),c({action:n("metadata"),field:s(["reviewer","assignee","label"]),change:s(["add","remove"]),value:t().min(1).max(100).refine((e)=>!/[\r\n\0]/.test(e))})]),Pe=g("kind",[c({...L,kind:n("read"),path:t().min(1).max(2048),accept:s(["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"]).optional()}),c({...L,kind:n("pr_review_context"),number:E,after:t().min(1).max(1024).optional()}),c({...L,kind:n("prepare"),branch:y,baseSha:x,defaultBranch:y,diagnosticsVersion:n(1).optional()}),c({...L,kind:n("publish"),branch:y,defaultBranch:y,baseSha:x,remoteHeadSha:x.nullable(),contributorTrailers:C.optional()}),c({...L,kind:n("pr_create"),head:y,base:y,title:T,body:D,draft:d()}),c({...L,kind:n("pr_mutation"),number:E,mutation:z}),c({...L,kind:n("pr_merge"),number:E,expectedHeadSha:x,expectedBaseRef:y,method:s(["merge","squash","rebase"]),commitBody:t().max(65536).optional()})]),V=["local_device_gh_prepare_setup","local_device_gh_prepare_metadata","local_device_gh_prepare_private_init","local_device_gh_prepare_fetch","local_device_gh_prepare_base_mismatch","local_device_gh_prepare_checkout_validation","local_device_gh_prepare_checkout_init","local_device_gh_prepare_materialization"];function F(e){return V.some((r)=>r===e)}class ir extends Error{code;constructor(e){super(e);this.code=e}}function ni(e,r,i){let _=Pe.safeParse(e);return r==="failed"&&_.success&&_.data.kind==="prepare"&&_.data.diagnosticsVersion===1&&F(i)}var yt=245760,Bo=g("kind",[c({kind:n("pr_review_context"),body:t().max(yt)}),c({kind:n("prepare"),headSha:x}),c({kind:n("read"),status:o().int().min(200).max(599),headers:ee(t(),t().max(8192)).refine((e)=>Object.keys(e).every((r)=>r==="link"||r==="content-type")),body:t().max(yt)}),c({kind:n("publish"),headSha:x,scannedObjectCount:o().int().min(0).max(5000),attribution:G.optional()}),c({kind:n("pr_create"),url:t().max(1024).regex(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/)}),c({kind:n("pr_mutation"),number:E,applied:n(!0)}),c({kind:n("pr_merge"),number:E,merged:n(!0)})]).refine((e)=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=yt,"local_device_gh_result_too_large"),B=c({source:s(["agent","human"]),operationId:k()}),oe=c({version:n(1),userId:St(),deviceId:St(),rootId:St(),runId:St(),merge:B.optional(),contributorRefresh:St().optional(),repoFullName:I.nullable(),rootRevision:t().regex(/^[1-9][0-9]*$/),readOnly:d(),generation:o().int().positive().nullable(),fenceId:St().nullable()}).refine((e)=>e.generation===null===(e.fenceId===null));function w(e){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(e)&&e.split("/").every((r)=>r!=="."&&r!=="..")}function Fo(e,r,i={},_="read"){if(w(e)&&(r==="/search/issues"||r.startsWith("/search/issues?")))return J(e,r,i);if(!w(e)||!r.startsWith(`/repos/${e}/`)&&r!==`/repos/${e}`)throw Error("local_device_gh_repository_mismatch");if(/[\\#\u0000-\u001f]/.test(r)||/%(?:2e|5c|00)/i.test(r))throw Error("local_device_gh_path_denied");let R=new URL(r,"https://api.github.com");if(R.pathname!==r.split("?")[0]||R.username||R.password)throw Error("local_device_gh_path_denied");let h;try{h=decodeURIComponent(R.pathname.slice(`/repos/${e}`.length))}catch{throw Error("local_device_gh_path_denied")}if(h.includes("%")||h.split("/").some((p)=>p==="."||p===".."))throw Error("local_device_gh_path_denied");if((i.method??"GET").toUpperCase()!=="GET"||i.body!=null)throw Error("local_device_gh_mutation_not_admitted");if(![/^$/,/^\/commits$/,/^\/pulls$/,/^\/pulls\/[1-9][0-9]*(?:\/(?:commits|files|reviews|comments))?$/,/^\/issues\/[1-9][0-9]*(?:\/comments)?$/,/^\/issues\/comments\/[1-9][0-9]*\/reactions$/,/^\/commits\/[A-Za-z0-9_./-]+(?:\/(?:check-runs|status))?$/,/^\/check-runs\/[1-9][0-9]*(?:\/annotations)?$/,/^\/branches\/[A-Za-z0-9_./-]+$/,/^\/git\/ref\/heads\/[A-Za-z0-9_./-]+$/,/^\/compare\/[A-Za-z0-9_./-]+\.\.\.[A-Za-z0-9_./-]+$/].some((p)=>p.test(h)))throw Error("local_device_gh_path_denied");if(R.searchParams.forEach((p,b)=>{if(b==="per_page"&&/^[1-9][0-9]*$/.test(p)&&Number(p)<=100)return;if(b==="page"&&/^[1-9][0-9]*$/.test(p)&&Number(p)<=100)return;if(h==="/pulls"&&b==="state"&&["open","closed","all"].includes(p))return;if(h==="/pulls"&&b==="sort"&&p==="updated")return;if(h==="/pulls"&&b==="direction"&&p==="desc")return;if(h==="/pulls"&&["head","base"].includes(b)&&/^[A-Za-z0-9_./:-]{1,255}$/.test(p))return;throw Error("local_device_gh_query_denied")}),i.headers)new Headers(i.headers).forEach((b,j)=>{if(j!=="accept"||!["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"].includes(b))throw Error("local_device_gh_header_denied")})}function J(e,r,i){if(/[\\#\u0000-\u001f]/.test(r))throw Error("local_device_gh_path_denied");let _=new URL(r,"https://api.github.com");if(_.pathname!=="/search/issues"||_.username||_.password)throw Error("local_device_gh_path_denied");if((i.method??"GET").toUpperCase()!=="GET"||i.body!=null)throw Error("local_device_gh_mutation_not_admitted");let R=null;_.searchParams.forEach((f,p)=>{if(p==="q"&&R===null){R=f;return}if(p==="per_page"&&/^[1-9][0-9]*$/.test(f)&&Number(f)<=100)return;if(p==="page"&&/^[1-9][0-9]*$/.test(f)&&Number(f)<=100)return;throw Error("local_device_gh_query_denied")});let h=`repo:${e.toLowerCase()} `,S=R?.toLowerCase()??"";if(S.length>512||!(S+" ").startsWith(h)||/(?:^|\s)(?:repo|org|user):/.test(S.slice(h.length)))throw Error("local_device_gh_query_denied");if(i.headers)new Headers(i.headers).forEach((f,p)=>{if(p!=="accept"||f!=="application/vnd.github+json")throw Error("local_device_gh_header_denied")})}var jo=`query PullRequestReviewContext($owner: String!, $repo: String!, $number: Int!, $after: String) {
|
|
3
|
-
repository(owner: $owner, name: $repo) {
|
|
4
|
-
nameWithOwner
|
|
5
|
-
pullRequest(number: $number) {
|
|
6
|
-
number
|
|
7
|
-
reviewDecision
|
|
8
|
-
headRefOid
|
|
9
|
-
baseRefOid
|
|
10
|
-
baseRef {
|
|
11
|
-
branchProtectionRule {
|
|
12
|
-
requiresApprovingReviews
|
|
13
|
-
requiredApprovingReviewCount
|
|
14
|
-
requiresStatusChecks
|
|
15
|
-
requiredStatusCheckContexts
|
|
16
|
-
requiresConversationResolution
|
|
17
|
-
dismissesStaleReviews
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
reviewThreads(first: 100, after: $after) {
|
|
21
|
-
nodes {
|
|
22
|
-
id isResolved isOutdated viewerCanResolve viewerCanUnresolve
|
|
23
|
-
path line originalLine startLine originalStartLine diffSide startDiffSide
|
|
24
|
-
comments(first: 100) {
|
|
25
|
-
nodes {
|
|
26
|
-
id databaseId body createdAt updatedAt url
|
|
27
|
-
author { __typename login }
|
|
28
|
-
replyTo { databaseId }
|
|
29
|
-
}
|
|
30
|
-
pageInfo { hasNextPage }
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
pageInfo { hasNextPage endCursor }
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}`;function tt(e){return e.kind==="read"||e.kind==="pr_review_context"}var wt=["inspect_project","fs.read","fs.write","fs.search","fs.watch","fs.upload","fs.export","fs.import","fs.download","exec.run","exec.full","process.run.v1","process.full.v1","pty.start","pty.input","pty.resize","pty.close","git.run","process.list","process.signal","ports.list","tunnel.open","tunnel.close","env.discover","setup.run","mcp.discover","mcp.start","mcp.proxy","browser.snapshot","browser.navigate","browser.act","computer.snapshot","computer.act","computer.use","browser.use","browser.recording.v1","browser.pr-proof.v1","hands.connect","jobs.control","environment.install","github.local.v1","inference.ollama.v1","inference.custom.v1","delegate.devin.copy.v1","delegate.cursor.copy.v1","display.stream.v1","automation.call.v1","preview.serve.v1","workspace.setup.v1","simulator.call.v1","simulator.stream.v1"];var rt=2,N="/app/local-runtime",Te=262144,Ks="x-reason-relay-host-alias",Js="v1";function l(e,r){return{path:`${N}${e}`,routerPath:e,auth:r}}function O(e,r){return{...l(e,"device_proof"),forOperation(i){return l(`/operations/${encodeURIComponent(i)}${r}`,"device_proof")}}}var Zs={register:l("/register","registration_bearer"),enroll:l("/enroll","none"),authChallenge:l("/auth/challenge","none"),identity:l("/identity","device_proof"),heartbeat:l("/heartbeat","device_proof"),rootsSync:l("/roots/sync","device_proof"),disconnect:l("/disconnect","device_proof"),lifecycle:l("/lifecycle","device_proof"),localSubscription:l("/local-subscription","device_proof"),ownerWorkspaces:l("/owner-workspaces","device_proof"),ownerWorkspaceEnrollment:l("/owner-workspaces/enrollment","device_proof"),sessionWorktrees:l("/session-worktrees","device_proof"),operationClaim:l("/operations/claim","device_proof"),operationHeartbeat:O("/operations/:operationId/heartbeat","/heartbeat"),operationEvents:O("/operations/:operationId/events","/events"),operationComplete:O("/operations/:operationId/complete","/complete"),operationEnvironment:O("/operations/:operationId/environment","/environment"),operationEnvironmentAck:O("/operations/:operationId/environment-ack","/environment-ack"),operationCustomEndpointCredential:O("/operations/:operationId/custom-endpoint-credential","/custom-endpoint-credential")},ii=`${N}/session`;var W=[/^\/app\/local-runtime\/heartbeat$/,/^\/app\/local-runtime\/operations\/claim$/,/^\/app\/local-runtime\/operations\/[0-9a-fA-F-]{36}\/(?:heartbeat|events|complete|environment|environment-ack)$/];function Xs(e){return W.some((r)=>r.test(e))}var rn=60000;var oi="hands_control_v1",bt="environment.deliver",si="vm_hands_workspace_deferred",ai="vm_hands.workspace_grant",ci="hands.unbind_unverified",li="claim_v1",ui="environment_at_claim",di="ready_v1",pi="workspace_check",hi="rebind_v1",fi="resident_rebind",mi="hands.rebind",gi="snapshot_v1",_i="cloud_access",yi="playwright_v1",wi="headless_browser",bi="v1",vi="job_env_large_values",pe="srt_root_v1",Y="hands_confinement",Re="gid_v1",q="model_jobs_egress",Si="setpriv_v1",Ei="jobs_user",xi="spawning_attempt_v1",Q="hands_session_group";var ki="session_cap",Ci="none",Ai="same_launch_v1",Pi="exit_v1",Ti="start_wait",vt="user_chrome",Ri="cloud_sessions";function v(e){if(!a(e)||Object.keys(e).length!==5||e.version!==1)return!1;let r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["boot_generation","recording_operation_id","recording_attempt_id"].every((i)=>typeof e[i]==="string"&&r.test(e[i]))&&typeof e.root_version==="string"&&/^[0-9]{1,20}(?:\.[0-9]{1,6})?$/.test(e.root_version)}function A(e){if(!a(e)||Object.keys(e).length!==6)return!1;let r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return typeof e.device_id==="string"&&r.test(e.device_id)&&(e.binding==="workspace_source"||e.binding==="mcp_control")&&Number.isSafeInteger(e.target_revision)&&Number(e.target_revision)>=0&&Number.isSafeInteger(e.root_grant_revision)&&Number(e.root_grant_revision)>0&&Number.isSafeInteger(e.target_generation)&&Number(e.target_generation)>0&&typeof e.target_fence_id==="string"&&r.test(e.target_fence_id)}var Ys=["lock_acquired","enrollment_started","enrollment_completed","readiness_started","readiness_completed","inventory_completed","control_ready"],or=86400000;var K=["production","staging"];function P(e){if(!a(e)||Object.keys(e).length!==3)return!1;let r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return["organization_id","user_id","device_id"].every((i)=>Object.hasOwn(e,i)&&typeof e[i]==="string"&&r.test(e[i])&&e[i]!=="00000000-0000-0000-0000-000000000000")}var Z="DEVICE-PROOF-V2";function Oi(e,r=Z){let i=e.method.toUpperCase();if(!/^[A-Z]+$/.test(i)||!e.pathAndQuery.startsWith(`${N}/`)||e.pathAndQuery.includes(`
|
|
38
|
-
`)||!/^[0-9]{1,20}$/.test(e.timestamp)||!/^[A-Za-z0-9_-]{22,43}$/.test(e.nonce)||e.challenge.length<16||e.challenge.length>1024||e.challenge.includes(`
|
|
39
|
-
`)||!/^[a-f0-9]{64}$/.test(e.bodySha256))throw Error("Invalid Reason Device proof input.");return Buffer.from([r,i,e.pathAndQuery,e.timestamp,e.nonce,e.challenge,e.bodySha256].join(`
|
|
40
|
-
`),"utf8")}function a(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}function X(e,r){return typeof e==="string"&&r.some((i)=>i===e)}function H(e){return a(e)&&typeof e.id==="string"&&typeof e.label==="string"&&typeof e.path_fingerprint==="string"}function te(e){return a(e)&&Number.isInteger(e.seq)&&Number(e.seq)>=0&&typeof e.kind==="string"&&/^[A-Za-z0-9._:-]{1,64}$/.test(e.kind)&&a(e.payload)}function m(e){throw Error(e)}function Qs(e,r){let i=a(e)?e:{},_=typeof i.error==="string"?i.error:`http_${r}`,R=typeof i.detail==="string"?i.detail:typeof i.message==="string"?i.message:`Reason Device request failed (${r})`;return{code:_,message:R}}function ss(e){if(!a(e)||typeof e.challenge!=="string"||e.challenge.length<16||e.challenge.length>1024||e.challenge.includes(`
|
|
41
|
-
`)||typeof e.expires_at!=="string"||!Number.isFinite(Date.parse(e.expires_at)))m("Reason returned an invalid Device proof challenge.");return{challenge:e.challenge,expires_at:e.expires_at}}function M(e,r){if(!a(e)||typeof e.device_id!=="string"||e.auth_scheme!=="p256"||e.organization_id!==void 0&&typeof e.organization_id!=="string"||e.protocol_version!==rt||!Array.isArray(e.roots)||!e.roots.every(H)||r&&typeof e.organization_id!=="string"||e.device_credential!==void 0)m(r?"Reason returned an invalid Device enrollment.":"Reason returned an invalid Device registration.");return{...{device_id:e.device_id,...typeof e.organization_id==="string"?{organization_id:e.organization_id}:{},protocol_version:rt,roots:e.roots},auth_scheme:"p256"}}function ea(e){return M(e,!1)}function ta(e){let r=M(e,!0);if(typeof r.organization_id!=="string")return m("Reason returned an invalid Device enrollment.");return{...r,organization_id:r.organization_id}}function ra(e){if(!a(e)||typeof e.server_time!=="string"||typeof e.drain!=="boolean")return m("Reason returned an invalid Device heartbeat.");return{server_time:e.server_time,drain:e.drain,...U(e),...typeof e.update_policy==="string"||e.update_policy===null?{update_policy:e.update_policy}:{},...typeof e.supported_protocol_version==="number"?{supported_protocol_version:e.supported_protocol_version}:{},...re(e.latest_cli_versions),...e.hands_prespawn===!0?{hands_prespawn:!0}:{}}}var ne=["account_root_metadata_supported","workspace_root_metadata_supported","account_root_path_supported","home_contained_roots_supported","root_paths_supported","startup_supported"];function U(e){return Object.fromEntries(ne.filter((r)=>e[r]===!0).map((r)=>[r,!0]))}function na(e){if(!a(e))return;try{return{...ss(e),...U(e)}}catch{return}}function re(e){if(!a(e))return{};let r={};for(let i of K){let _=e[i];if(typeof _==="string"&&/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/.test(_))r[i]=_}return Object.keys(r).length>0?{latest_cli_versions:r}:{}}function ia(e){if(!a(e)||!Array.isArray(e.roots)||!e.roots.every(H))return m("Reason returned an invalid Device root sync.");return{roots:e.roots}}function oa(e){if(!a(e)||e.user_id!==void 0&&typeof e.user_id!=="string"||typeof e.organization_id!=="string"||typeof e.organization_name!=="string"||typeof e.organization_slug!=="string")return m("Reason returned an invalid Device identity.");return{...typeof e.user_id==="string"?{user_id:e.user_id}:{},organization_id:e.organization_id,organization_name:e.organization_name,organization_slug:e.organization_slug}}function sa(e){if(!a(e)||e.disconnected!==!0)return m("Reason did not disconnect this Device.");let r=e.sessions_moved;return typeof r==="number"&&Number.isSafeInteger(r)&&r>=0?{disconnected:!0,sessions_moved:r}:{disconnected:!0}}function aa(e){if(a(e)&&e.ok===!0&&typeof e.expires==="number")return{ok:!0,expires:e.expires};if(a(e)&&e.ok===!1&&typeof e.error==="string")return{ok:!1,error:e.error};return m("Reason did not answer the local login hand-over.")}function ca(e){if(!a(e)||e.accepted!==!0)return m("Reason did not accept the Device lifecycle event.");return{accepted:!0}}function ie(e){return Buffer.byteLength(JSON.stringify(e),"utf8")}function la(e,r=wt){if(!a(e)||typeof e.operation_id!=="string"||typeof e.attempt_id!=="string"||typeof e.attempt_token!=="string"||!/^(?:reason|ara)_attempt_/.test(e.attempt_token)||typeof e.lease_until!=="string"||typeof e.run_id!=="string"||typeof e.root_id!=="string"||e.owner!==void 0&&!P(e.owner)||!X(e.capability,r)||!a(e.payload)||e.protocol_version!==rt||ie(e.payload)>Te||e.authority!==void 0&&!A(e.authority)||e.local_github_authority!==void 0&&!oe.safeParse(e.local_github_authority).success||e.capability==="github.local.v1"&&!oe.safeParse(e.local_github_authority).success||e.recording_authority!==void 0&&!v(e.recording_authority)||e.capability==="browser.recording.v1"&&(!v(e.recording_authority)||!P(e.owner))||e.capability!=="browser.recording.v1"&&e.recording_authority!==void 0)return m("Reason returned an invalid Device operation claim.");let i={operation_id:e.operation_id,attempt_id:e.attempt_id,attempt_token:e.attempt_token,lease_until:e.lease_until,run_id:e.run_id,root_id:e.root_id,capability:e.capability,payload:e.payload,...A(e.authority)?{authority:e.authority}:{},...v(e.recording_authority)?{recording_authority:Object.freeze({...e.recording_authority})}:{},...e.local_github_authority!==void 0?{local_github_authority:oe.parse(e.local_github_authority)}:{},...e.capability==="hands.connect"&&a(e.environment)&&a(e.environment.payload)&&A(e.environment.authority)?{environment:{payload:e.environment.payload,authority:e.environment.authority}}:{},protocol_version:rt};if(e.owner!==void 0)i.owner=Object.freeze({...e.owner});return i}function ua(e){if(!a(e)||typeof e.lease_until!=="string"||!Array.isArray(e.controls)||!e.controls.every(te)||!Number.isInteger(e.next_control_seq)||Number(e.next_control_seq)<0)return m("Reason returned an invalid Device operation heartbeat.");return{lease_until:e.lease_until,controls:e.controls,next_control_seq:Number(e.next_control_seq)}}function da(e){if(!a(e)||!Number.isInteger(e.next_event_seq)||Number(e.next_event_seq)<0||typeof e.duplicate!=="boolean"||!Number.isInteger(e.accepted_count)||Number(e.accepted_count)<0)return m("Reason returned an invalid Device operation event result.");return{next_event_seq:Number(e.next_event_seq),duplicate:e.duplicate,accepted_count:Number(e.accepted_count)}}function pa(e){if(!a(e)||!a(e.payload)||!A(e.authority))return m("Reason returned an invalid Device environment delivery.");return{payload:e.payload,authority:e.authority}}function ae(e){return e==="succeeded"||e==="failed"||e==="cancelled"||e==="expired"}function ha(e){if(!a(e)||!ae(e.status)||typeof e.idempotent!=="boolean")return m("Reason returned an invalid Device operation completion.");return{status:e.status,idempotent:e.idempotent}}
|
|
42
|
-
export{Pe,ir,ni,yt,Bo,oe,Fo,jo,tt,wt,rt,Te,Ks,Js,Zs,ii,Xs,rn,oi,bt,si,ai,ci,li,ui,di,pi,hi,fi,mi,gi,_i,yi,wi,bi,vi,pe,Y,Re,q,Si,Ei,xi,Q,ki,Ci,Ai,Pi,Ti,vt,Ri,Ys,or,Oi,Qs,ss,ea,ta,ra,na,ia,oa,sa,aa,ca,la,ua,da,pa,ha};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{t,o,i,W,ee,s,n}from"./vm-hands-entry-lite-gvjffc5t.js";var lt=32768,Lt=67108864,Cr=16384,E=204800,kn=600000,_=["content-type","anthropic-version","user-agent"],m=s(["openai-completions","openai-responses","anthropic-messages"]),f=new Set(_),C=ee(t(),t().max(2048)).refine((e)=>Object.keys(e).every((r)=>f.has(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)),"Only non-secret custom endpoint request headers are permitted");function u(e){try{let r=new URL(e);return["http:","https:"].includes(r.protocol)&&!r.username&&!r.password&&!r.search&&!r.hash?r:null}catch{return null}}function Ar(e,r){let c=u(e.baseUrl),l=u(r.baseUrl),a=u(e.url);if(!c||!l||!a||e.method!=="POST"||r.execution!=="device")return!1;let d=(p)=>p.origin+p.pathname.replace(/\/+$/,"");if(d(c)!==d(l)||a.origin!==c.origin)return!1;let h=r.api==="openai-completions"?"/chat/completions":r.api==="openai-responses"?"/responses":"/v1/messages";return a.pathname===c.pathname.replace(/\/+$/,"")+h}var Cn=i({baseUrl:t().max(2048),url:t().max(4096),method:n("POST"),body:t().refine((e)=>new TextEncoder().encode(e).byteLength<=E).optional(),headers:C,credentialOrganizationId:t().uuid(),accountKey:t().min(1).max(256).optional()}).strict().refine((e)=>m.options.some((r)=>Ar(e,{baseUrl:e.baseUrl,api:r,execution:"device"})),"Invalid custom endpoint inference URL"),x=i({status:o().int().min(200).max(599),statusText:t().max(256).refine((e)=>!/[\r\n\0]/.test(e)),headers:ee(t(),t().max(4096)).refine((e)=>Object.keys(e).every((r)=>["content-type","retry-after","x-request-id","request-id"].includes(r))&&Object.values(e).every((r)=>!/[\r\n\0]/.test(r)))}).strict(),D=W([i({eof:n(!0)}).strict(),i({eof:n(!1),data:t().max(Math.ceil(lt/3)*4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).refine((e)=>e.length>0&&e.length*3/4-(e.endsWith("==")?2:e.endsWith("=")?1:0)<=lt)}).strict()]),y=i({bytes:o().int().min(0).max(Lt),chunks:o().int().min(0).max(Cr)}).strict(),An=i({apiKey:t().min(1).max(16384).refine((e)=>!/[\r\n\0]/.test(e)),api:m}).strict(),S=["custom_endpoint_host_not_found","custom_endpoint_connection_failed","custom_endpoint_tls_failed"];function Pn(e){return typeof e==="string"&&S.includes(e)}var O="Ollama listens only on 127.0.0.1 unless it is started with OLLAMA_HOST=0.0.0.0.",g={custom_endpoint_host_not_found:"Your computer couldn't resolve your model server's hostname. Check the hostname in the Base URL, and that this computer is on the network or tailnet that resolves it.",custom_endpoint_connection_failed:`Your computer's connection to your model server was refused or timed out. Check that the server is running and listening on the Base URL's address and port. ${O}`,custom_endpoint_tls_failed:"Your computer couldn't make a secure (TLS) connection to your model server. Check the server's https certificate, or use an http:// Base URL for a server on your computer or private network.",401:"Your model server refused the request (HTTP 401). Check the API key saved for it in Models.",403:"Your model server refused the request (HTTP 403). Ollama refuses requests addressed to a hostname other than localhost, such as a *.ts.net name from tailscale serve or funnel: restart it with OLLAMA_HOST=0.0.0.0, or use http://localhost:11434/v1 when it runs on the session's computer. For another server, check the API key and its access rules.",404:"Your model server answered HTTP 404 (not found). Check that the Base URL is the API root (for Ollama, http://localhost:11434/v1) and that each model ID is one the server lists."};var I=new Set(Object.values(g));export{lt,Lt,Cr,kn,Ar,Cn,An,Pn};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{Do}from"./vm-hands-entry-lite-nqdstx24.js";import{Fe,an,Tt,cn}from"./vm-hands-entry-lite-f62fvme8.js";import{Qn}from"./vm-hands-entry-lite-kz26rfcv.js";import{t,o,d,u,i,cs,W,g,s,n}from"./vm-hands-entry-lite-gvjffc5t.js";var M=/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/;function k(e){let r=typeof e==="string"?M.exec(e):null;return r?{major:Number(r[1]),minor:Number(r[2])}:null}var E=25,v=1e5,L=/^[0-9a-f]{64}$/,N=i({day:t().regex(/^\d{4}-\d{2}-\d{2}$/),sent:o().int().min(0).max(v),received:o().int().min(0).max(v)}),xe=i({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(E).optional(),message_counts:u(N).max(14).optional().catch(void 0),endpoint:t().regex(L).optional().catch(void 0)}),D=g("kind",[i({id:t(),kind:n("who"),all:d().optional()}),i({id:t(),kind:n("send"),to:t(),body:t(),from_name:t(),from_agent:t(),wake:d(),reply_to:t().max(100).optional(),notify:d().optional()})]),P=i({job:D.nullable(),retry_after_seconds:o().optional()}),H=i({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()}),B=i({person:t(),machine:t(),online:d()}),F=i({team:t().nullable(),sessions:u(H).max(2000),machines:u(B).max(500),all:d().optional()}),J=i({address:t().max(300),state:t().max(40),note:t().max(500)}),Ie=W([i({who:F}),i({sent:i({ids:u(t().max(100)).max(500),recipients:u(t().max(300)).max(500),from:t().max(300),deliveries:u(J).max(500).optional()})}),i({error:t().min(1).max(2000)})]),G=i({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()}),Ce=i({messages:u(G).max(100),team:t().min(1).max(200).optional(),team_id:t().min(1).max(200).optional(),workspace:d().optional()});var x=["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 Be=x.filter((e)=>e!=="network:read"&&e!=="network:write");class R extends Error{oauthCode;constructor(e,r=null){super(e);this.oauthCode=r;this.name="LoginError"}}function Q(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 R(l,a)}async function K(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 Q(m,`OAuth token request failed (${c.status})`);return m}var V=1e4;async function Y(e,r={}){let a=r.fetchImpl??fetch,l=await K(e.apiOrigin,new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken}),a,AbortSignal.timeout(V)).catch((m)=>{if(m instanceof Error&&m.name==="TimeoutError")throw new R("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 R("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 an(c,r.path??Fe()),c}var b=new Map,X=2000,Z=100;function C(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 Pt(e={}){let r=e.path??Fe(),a=Tt(r);if(!a)return null;let l=e.apiOrigin??T(process.env,"REASON_API_URL")?.trim();if(l&&!Do(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=b.get(m);if(p)return C(p,e.signal);let f;return f=Y(a,{fetchImpl:e.fetchImpl,path:r}).catch(async(y)=>{if(!(y instanceof R)||y.oauthCode!=="invalid_grant"&&y.oauthCode!=="invalid_client")throw y;let S=(_)=>_!==null&&(y.oauthCode==="invalid_client"?_.clientId!==a.clientId:_.refreshToken!==a.refreshToken),z=Date.now()+X;while(!S(Tt(r))&&Date.now()<z)await new Promise((_)=>setTimeout(_,Z));if(S(Tt(r)))return Pt({fetchImpl:e.fetchImpl,path:r});return cn(r),null}).finally(()=>{if(b.get(m)===f)b.delete(m)}),b.set(m,f),C(f,e.signal)}var ee=i({label:t(),used_percent:o().min(0).max(100).nullable(),resets_at:t().nullable(),exhausted:d().nullable()}),ne=i({groups:u(i({selectable:d().optional(),accounts:u(i({source_id:t().min(1),model_ids:u(t().min(1)).optional()}))}))});function te(e){let r=ne.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 I extends Error{status;code;suggestedModel;retryAfterMs;resolutionReason;constructor(e,r,a,l,c,m){super(a);this.status=e;this.code=r;this.suggestedModel=l;this.retryAfterMs=c;this.resolutionReason=m;this.name="ApiError"}static rateLimitDelayMs(e,r){if(!(e instanceof I)||e.status!==429)return null;return Math.min(60000,Math.max(r,e.retryAfterMs??0))}}var se=["minimal","low","medium","high","xhigh","max"],oe=i({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(i({id:t().min(1),label:t()}))}),re=i({devices:u(oe),end_cursor:t().nullish(),has_next_page:d().optional()}),ie=i({id:t().min(1),name:t()}),ae=i({items:u(ie)}),le=i({id:t().min(1),name:t(),main:d(),mine:d(),session_id:t().nullish(),appearance:i({color:t().nullish()}).nullish().catch(null)}),ce=i({items:u(le)}),de=i({skill_id:t().min(1),name:t(),description:t().nullish(),activation_keywords:u(t()).default([]),is_enabled:d().default(!0)}),me=i({items:u(de).default([])}),ue=i({id:t().min(1),kind:t(),enabled:d(),schedule:i({expression:t().nullish(),every_seconds:o().nullish(),next_run_at:t().nullish()}).nullish(),github:i({event:t().nullish(),action:t().nullish(),repo:t().nullish()}).nullish(),last_fired_at:t().nullish()}),U=i({id:t().min(1),name:t().nullish(),instructions:t().nullish(),enabled:d(),triggers:u(ue).default([])}),ge=i({items:u(U).default([]),end_cursor:t().nullish(),has_next_page:d().optional()}),he=i({id:t().min(1),slug:t().nullish(),name:t(),description:t().nullish(),transport:t().nullish(),url:t().nullish(),enabled:d()}),pe=i({items:u(he).default([])}),fe=i({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()}),A=i({tags:u(t()).default([])}),ye=s(["linux","macos"]),q=i({id:t().min(1),name:t().min(1),platform:ye.nullable(),workers:i({total:o().int(),online:o().int(),busy:o().int(),idle:o().int()}),sessions:i({queued:o().int(),running:o().int()})}),_e=i({machines:u(q)}),Re=i({machine:q}),be=i({deleted:n(!0),revoked_workers:o().int(),revoked_tokens:o().int()}),we=i({token:i({id:t().min(1),machine_id:t().min(1),token_prefix:t()}),secret:t().startsWith("rmt_")}),O=cs({machine_id:t().min(1),machine_name:t().min(1)}),Se=O.extend({organization_id:t().min(1)}),Ye=i({id:t().min(1),name:t().min(1),state:s(["waiting","placed"]),queue_position:o().int().nullable()});var Xe=W([i({kind:n("cloud")}),i({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 I(502,a,"Reason returned an unexpected response.");return l.data}var ke=i({error:i({type:t(),message:t()})});function w(e,r,a){let l=ke.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 I(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)}async function bs(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 w(r.status,a,r.headers.get("retry-after"));return h(Se,a,"invalid_machine_ticket")}class Ko{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 w(a,c,l.get("retry-after"));return c}async exchange(e,r={},a=!1){let l=this.options.fetchImpl??fetch,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 Pt({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}}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 I&&(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(_e,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(Re,r,"invalid_machine").machine}async deleteMachine(e){let r=await this.request(this.machinePath(e),{method:"DELETE"});return h(be,r,"invalid_machine_deletion")}async createMachineToken(e){let r=await this.request(this.machinePath(e,"/tokens"),{method:"POST",body:{}});return h(we,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(){return this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-network`,{signal:AbortSignal.timeout(30000)})}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=ae.safeParse(e);if(!r.success)throw new I(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(ce,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(i({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(me,e,"invalid_skill_list").items}catch(e){if(e instanceof I&&(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=re.safeParse(l);if(!c.success)throw new I(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:se.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 I&&(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 k(r.reason_version)?r.reason_version:null}catch{return null}}async getUsageQuota(){try{let e=ee.safeParse(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/usage/quota`));if(!e.success)return null;let r;try{r=te(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/agent-auth/models`))}catch{}return{...e.data,own_inference:r}}catch(e){if(e instanceof I&&(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 w(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 I)||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 I&&(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(A,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(A,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(fe,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(ge,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(U,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(i({transcript:t()}),a,"invalid_transcript").transcript}async listMcpServers(){let e=await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/mcp-servers`);return h(pe,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{Pt,I,bs,Ko};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{de,et,O}from"./vm-hands-entry-lite-38g65s5x.js";import{execFileSync as p}from"child_process";import{existsSync as s,realpathSync as c}from"fs";import{userInfo as l}from"os";import{isAbsolute as u,join as t,normalize as f,parse as d}from"path";function a(){let r=f(l().homedir);if(!u(r)||r===d(r).root)throw Error("Could not resolve the canonical user home.");return r}function ie(r,n,e=a()){let i=O(n);if(n.kind==="managed"&&n.base){let o=c(e);return{anchor:o,boundary:t(o,n.base),path:t(o,i)}}if(n.kind==="root"&&et(n.path)){let o=c(e);return{anchor:o,boundary:t(o,de),path:t(o,i)}}return{anchor:r,boundary:r,path:t(r,i)}}function tr(r=a()){return t(r,".config")}function Mo(){if(process.platform!=="darwin")return null;try{let r=p("/usr/bin/getconf",["DARWIN_USER_DIR"],{encoding:"utf8",timeout:5000}).trim();return u(r)?c(r):null}catch{return null}}function $o(r=a()){let n=t(r,"Library","Application Support","Ara"),e=t(r,"Library","Application Support","Reason");return s(n)&&!s(e)?n:e}
|
|
3
|
-
export{a,ie,tr,Mo,$o};
|