@reason-machines/cli-linux-x64 0.2.460 → 0.2.465
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 +2 -2
- package/bin/reason +1 -1
- package/bin/runtime/srt/sandbox-runtime.mjs +40 -40
- package/bin/runtime/srt/vendor/seccomp/x64/apply-seccomp +0 -0
- package/bin/vm-hands/api-7xy672j8.js +2 -0
- package/bin/vm-hands/api-credentials-bbmmmkwx.js +2 -0
- package/bin/vm-hands/connect-cli-8dkfky9c.js +2 -0
- package/bin/vm-hands/credentials-gr9jn270.js +2 -0
- package/bin/vm-hands/{custom-endpoint-device-v3rkzm7q.js → custom-endpoint-device-r2nn1xj9.js} +1 -1
- package/bin/vm-hands/desktop-account-3cc0bhw8.js +2 -0
- package/bin/vm-hands/{device-workspace-vaqjetag.js → device-workspace-s50q53sz.js} +1 -1
- package/bin/vm-hands/hands-worker-source-k8v5kmmw.js +2 -0
- package/bin/vm-hands/{index-ww1zq4h9.js → index-d5n50g8b.js} +1 -1
- package/bin/vm-hands/install-receipt-gvdzhm17.js +2 -0
- package/bin/vm-hands/local-automation-wgz2tb2k.js +2 -0
- package/bin/vm-hands/local-capabilities-yd7gd8xx.js +2 -0
- package/bin/vm-hands/local-desktop-users-qskbh51j.js +2 -0
- package/bin/vm-hands/{local-display-mac-49yz00hp.js → local-display-mac-m77mftqy.js} +1 -1
- package/bin/vm-hands/local-display-session-dcdgqbbn.js +2 -0
- package/bin/vm-hands/local-display-video-h8s6j6da.js +2 -0
- package/bin/vm-hands/local-managed-process-d5wytn3p.js +2 -0
- package/bin/vm-hands/local-pty-session-k6kab3tc.js +2 -0
- package/bin/vm-hands/managed-runtime-hhz38khe.js +2 -0
- package/bin/vm-hands/{network-contract-g1jewvb5.js → network-contract-y2eybfhn.js} +1 -1
- package/bin/vm-hands/permissions-c9b4e1ty.js +2 -0
- package/bin/vm-hands/{reason-hands-protocol-cebk43jj.js → reason-hands-protocol-r3wtcjed.js} +1 -1
- package/bin/vm-hands/{serve-service-ddds922x.js → serve-service-07hzxt2s.js} +1 -1
- package/bin/vm-hands/{status-q3by8hq6.js → status-5tpz7fbb.js} +2 -2
- package/bin/vm-hands/version-5wy4za0j.js +2 -0
- package/bin/vm-hands/{vm-hands-entry-lite-1f25jgyr.js → vm-hands-entry-lite-03d1fhxv.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-z599genq.js → vm-hands-entry-lite-1f0v3jb4.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-vsm90vke.js → vm-hands-entry-lite-3krzmhkk.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-3pxmmb7z.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-99y4caf9.js → vm-hands-entry-lite-44qha2rt.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-43v0ccsr.js → vm-hands-entry-lite-52x189kf.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-eya4kgw8.js → vm-hands-entry-lite-5zdybh8s.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-168m1q57.js → vm-hands-entry-lite-7h9qm2fq.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-8x5znjnm.js → vm-hands-entry-lite-7ja63pfz.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-6zzn5qbb.js → vm-hands-entry-lite-84rnx3zq.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-qh6hnhtr.js → vm-hands-entry-lite-8qvsnkvv.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-r3s4j28z.js → vm-hands-entry-lite-abfb6nms.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-26w5ejds.js → vm-hands-entry-lite-b139fhbg.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-wsspeegr.js → vm-hands-entry-lite-b8yapqfn.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-cmm2ybdr.js → vm-hands-entry-lite-bnbbc1kv.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-mdqdbhk1.js → vm-hands-entry-lite-cf1x5cbr.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite-cz06vft0.js +2 -0
- package/bin/vm-hands/vm-hands-entry-lite-d1dpe6qv.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-pj4vv7c3.js → vm-hands-entry-lite-db0wxha5.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-75y8022r.js → vm-hands-entry-lite-dzcj8q9b.js} +9 -9
- package/bin/vm-hands/{vm-hands-entry-lite-rseyh0ej.js → vm-hands-entry-lite-eafbye2d.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-6ccgnrgg.js → vm-hands-entry-lite-egax7vw4.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-e7mr44v7.js → vm-hands-entry-lite-enbnd910.js} +15 -15
- package/bin/vm-hands/{vm-hands-entry-lite-8402gdx0.js → vm-hands-entry-lite-f2qthva9.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-kgknanhj.js → vm-hands-entry-lite-h6rhk6h1.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-rgwm9y7f.js → vm-hands-entry-lite-hrsbhjkm.js} +7 -7
- package/bin/vm-hands/{vm-hands-entry-lite-76xb3wgd.js → vm-hands-entry-lite-hzh8fdxx.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-p2zjx5cn.js → vm-hands-entry-lite-jyvmw8b7.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-pry1an8k.js → vm-hands-entry-lite-k00wf8mr.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-t7zr2tea.js → vm-hands-entry-lite-k83rkcys.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-2mm1b4qj.js → vm-hands-entry-lite-kz48x6p0.js} +8 -8
- package/bin/vm-hands/{vm-hands-entry-lite-r17x4n1w.js → vm-hands-entry-lite-n1k1njzh.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-9apjqd3s.js → vm-hands-entry-lite-np07qyeq.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-te16hx2y.js → vm-hands-entry-lite-qq6mxm5m.js} +3 -3
- package/bin/vm-hands/{vm-hands-entry-lite-38qt915d.js → vm-hands-entry-lite-r3yp6cr9.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-ffn3k8a5.js → vm-hands-entry-lite-rfz60hb3.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-8fqrpycx.js → vm-hands-entry-lite-rmkvwhwy.js} +4 -4
- package/bin/vm-hands/{vm-hands-entry-lite-n8gng724.js → vm-hands-entry-lite-tn8v3yfj.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-zw5stc7m.js → vm-hands-entry-lite-txd50spx.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-mvsdn8xd.js → vm-hands-entry-lite-vdhgwmmp.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-1ts6q468.js → vm-hands-entry-lite-wrvz9jxy.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +2 -2
- package/bin/vm-hands/{vm-hands-executor-t04rk1xy.js → vm-hands-executor-qt8a9qa6.js} +3 -3
- package/bin/vm-hands/{vm-hands-op-runner-tatf8me7.js → vm-hands-op-runner-x96m7zxd.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-zx8s6rs7.js → vm-hands-runtime-kzek1t9p.js} +3 -3
- package/bin/vm-hands/worker-preview-readiness-6hzzjnk7.js +2 -0
- package/bin/vm-hands/worker-sandbox-1g7jheqm.js +2 -0
- package/package.json +1 -1
- package/bin/vm-hands/api-7aqwa709.js +0 -2
- package/bin/vm-hands/api-credentials-fh34tvkh.js +0 -2
- package/bin/vm-hands/connect-cli-8vkhdyn7.js +0 -2
- package/bin/vm-hands/credentials-31d5svns.js +0 -2
- package/bin/vm-hands/desktop-account-1k06r449.js +0 -2
- package/bin/vm-hands/hands-worker-source-1y3ffkre.js +0 -2
- package/bin/vm-hands/install-receipt-g4xmdyrg.js +0 -2
- package/bin/vm-hands/local-automation-khtqsw27.js +0 -2
- package/bin/vm-hands/local-capabilities-0v1tmead.js +0 -2
- package/bin/vm-hands/local-desktop-users-xk05xr6n.js +0 -2
- package/bin/vm-hands/local-display-session-ae33d049.js +0 -2
- package/bin/vm-hands/local-display-video-b3hyaefy.js +0 -2
- package/bin/vm-hands/local-managed-process-pnd72aaw.js +0 -2
- package/bin/vm-hands/local-pty-session-hcpz5scq.js +0 -2
- package/bin/vm-hands/managed-runtime-e6ev22c7.js +0 -2
- package/bin/vm-hands/permissions-a7rcytp4.js +0 -2
- package/bin/vm-hands/version-e55vkeaw.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-9h4bfd4w.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-c4jj2s7a.js +0 -3
- package/bin/vm-hands/vm-hands-entry-lite-rkvhw41t.js +0 -3
- package/bin/vm-hands/worker-preview-readiness-10ex5n3a.js +0 -2
- package/bin/vm-hands/worker-sandbox-wjyfgj98.js +0 -2
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{T}from"./vm-hands-entry-lite-fcvf8md1.js";import{Oo}from"./vm-hands-entry-lite-t7zr2tea.js";import{Fe,an,lr,cn}from"./vm-hands-entry-lite-26w5ejds.js";import{t,o,d,u,i,os,W,g,s,n}from"./vm-hands-entry-lite-5agyspqp.js";var z=/^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$/;function w(e){let r=typeof e==="string"?z.exec(e):null;return r?{major:Number(r[1]),minor:Number(r[2])}:null}var M=25,Re=i({machine:t().min(1).max(200),person:t().min(1).max(200),team:t().min(1).max(200),version:t().max(64).optional(),wait_seconds:o().int().min(0).max(M).optional()}),j=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()})]),k=i({job:j.nullable(),retry_after_seconds:o().optional()}),E=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()}),L=i({person:t(),machine:t(),online:d()}),D=i({team:t().nullable(),sessions:u(E).max(2000),machines:u(L).max(500),all:d().optional()}),H=i({address:t().max(300),state:t().max(40),note:t().max(500)}),we=W([i({who:D}),i({sent:i({ids:u(t().max(100)).max(500),recipients:u(t().max(300)).max(500),from:t().max(300),deliveries:u(H).max(500).optional()})}),i({error:t().min(1).max(2000)})]),N=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()}),ke=i({messages:u(N).max(100)});var S=["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 je=S.filter((e)=>e!=="network:read"&&e!=="network:write");class _ extends Error{oauthCode;constructor(e,r=null){super(e);this.oauthCode=r;this.name="LoginError"}}function B(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 _(l,a)}async function F(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 B(m,`OAuth token request failed (${c.status})`);return m}var J=1e4;async function Q(e,r={}){let a=r.fetchImpl??fetch,l=await F(e.apiOrigin,new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken}),a,AbortSignal.timeout(J)).catch((m)=>{if(m instanceof Error&&m.name==="TimeoutError")throw new _("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 _("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;function v(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=lr(r);if(!a)return null;let l=e.apiOrigin??T(process.env,"REASON_API_URL")?.trim();if(l&&!Oo(a.apiOrigin,new URL(l).origin))return null;let c=Date.parse(a.expiresAt)<=Date.now()+60000;if(!e.forceRefresh&&!c)return a;let m=[r,a.apiOrigin,a.clientId,a.refreshToken].join("\x00"),p=b.get(m);if(p)return v(p,e.signal);let f;return f=Q(a,{fetchImpl:e.fetchImpl,path:r}).catch(async(y)=>{if(!(y instanceof _)||y.oauthCode!=="invalid_grant"&&y.oauthCode!=="invalid_client")throw y;let R=lr(r),q=y.oauthCode==="invalid_client"?R?.clientId!==a.clientId:R?.refreshToken!==a.refreshToken;if(R&&q)return Pt({fetchImpl:e.fetchImpl,path:r});return cn(r),null}).finally(()=>{if(b.get(m)===f)b.delete(m)}),b.set(m,f),v(f,e.signal)}var G=i({label:t(),used_percent:o().min(0).max(100).nullable(),resets_at:t().nullable(),exhausted:d().nullable()}),K=i({groups:u(i({selectable:d().optional(),accounts:u(i({source_id:t().min(1),model_ids:u(t().min(1)).optional()}))}))});function V(e){let r=K.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 Y=["minimal","low","medium","high","xhigh","max"],Z=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()}))}),X=i({devices:u(Z),end_cursor:t().nullish(),has_next_page:d().optional()}),ee=i({id:t().min(1),name:t()}),ne=i({items:u(ee)}),te=i({id:t().min(1),name:t(),main:d(),mine:d(),session_id:t().nullish(),appearance:i({color:t().nullish()}).nullish().catch(null)}),se=i({items:u(te)}),oe=i({skill_id:t().min(1),name:t(),description:t().nullish(),activation_keywords:u(t()).default([]),is_enabled:d().default(!0)}),re=i({items:u(oe).default([])}),ie=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()}),x=i({id:t().min(1),name:t().nullish(),instructions:t().nullish(),enabled:d(),triggers:u(ie).default([])}),ae=i({items:u(x).default([]),end_cursor:t().nullish(),has_next_page:d().optional()}),le=i({id:t().min(1),slug:t().nullish(),name:t(),description:t().nullish(),transport:t().nullish(),url:t().nullish(),enabled:d()}),ce=i({items:u(le).default([])}),de=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()}),P=i({tags:u(t()).default([])}),me=s(["linux","macos"]),C=i({id:t().min(1),name:t().min(1),platform:me.nullable(),workers:i({total:o().int(),online:o().int(),busy:o().int(),idle:o().int()}),sessions:i({queued:o().int(),running:o().int()})}),ue=i({machines:u(C)}),ge=i({machine:C}),he=i({deleted:n(!0),revoked_workers:o().int(),revoked_tokens:o().int()}),pe=i({token:i({id:t().min(1),machine_id:t().min(1),token_prefix:t()}),secret:t().startsWith("rmt_")}),U=os({machine_id:t().min(1),machine_name:t().min(1)}),fe=U.extend({organization_id:t().min(1)}),Be=i({id:t().min(1),name:t().min(1),state:s(["waiting","placed"]),queue_position:o().int().nullable()});var Je=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 ye=i({error:i({type:t(),message:t()})});function A(e,r,a){let l=ye.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 gs(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 A(r.status,a,r.headers.get("retry-after"));return h(fe,a,"invalid_machine_ticket")}class Vo{options;credentials;constructor(e,r={}){this.options=r;this.credentials=e}trackEvent(e,r={}){}async request(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":"reason-cli","x-reason-agent":"Reason CLI",...r.raw?{"content-type":r.raw.contentType}:r.body===void 0?{}:{"content-type":"application/json"},...r.headers},body:r.raw?r.raw.bytes:r.body===void 0?void 0:JSON.stringify(r.body),signal:r.signal,redirect:"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,signal:r.signal});if(p)return this.credentials=p,this.request(e,r,!0)}if(!c.ok)throw A(c.status,m,c.headers.get("retry-after"));return 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(ue,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(ge,r,"invalid_machine").machine}async deleteMachine(e){let r=await this.request(this.machinePath(e),{method:"DELETE"});return h(he,r,"invalid_machine_deletion")}async createMachineToken(e){let r=await this.request(this.machinePath(e,"/tokens"),{method:"POST",body:{}});return h(pe,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(U,a,"invalid_machine_ticket")}self(e){return this.request("/self",{signal:e})}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(k,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:{messages: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=ne.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(se,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(re,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=X.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:Y.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 w(r.reason_version)?r.reason_version:null}catch{return null}}async getUsageQuota(){try{let e=G.safeParse(await this.request(`/organizations/${encodeURIComponent(this.credentials.orgId)}/usage/quota`));if(!e.success)return null;let r;try{r=V(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 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(P,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(P,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(de,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(ae,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(x,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(ce,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,gs,Vo};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var Yt={name:"github-native-engineer-device-worker-production",version:"0.2.460",private:!0,type:"module",engines:{node:">=22",bun:">=1.3.0"},workspaces:["../../packages/runtime-distribution"],dependencies:{"@anthropic-ai/sandbox-runtime":"^0.0.73","@earendil-works/pi-tui":"1.0.0","@modelcontextprotocol/sdk":"^1.29.0","@reason/runtime-distribution":"workspace:*","playwright-core":"1.60.0",zod:"^4.4.3"},overrides:{"@hono/node-server":"^1.19.15","@earendil-works/pi-agent-core":"1.0.0","@earendil-works/pi-ai":"1.0.0","@earendil-works/pi-coding-agent":"1.0.0","@earendil-works/chord":"1.0.0","@earendil-works/pi-codemode":"1.0.0","@earendil-works/pi-mcp":"1.0.0","@earendil-works/pi-telemetry":"1.0.0","@earendil-works/pi-tui":"1.0.0","brace-expansion":"2.1.7",axios:"^1.20.0","basic-ftp":"^6.2.1","@grpc/grpc-js":"^1.14.5",browserslist:"^4.28.8","engine.io":"^6.6.7","fast-uri":"^3.1.8",hono:"^4.13.7","ip-address":"^10.7.1",nanoid:"^3.3.18",dompurify:"^3.4.17",postcss:"^8.5.23",qs:"^6.16.0","shell-quote":"^1.11.0","socket.io-parser":"^4.2.7",tmp:"^0.2.7",toml:"^4.2.0",undici:"^8.10.2",ws:"^8.21.0","js-yaml":"^4.3.2","@modelcontextprotocol/sdk":"^1.31.0","proxy-addr":"^2.0.8","source-map-js":"^1.2.2"}};
|
|
3
|
-
export{Yt};
|