@rivet-dev/agentos 0.2.22 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/assets/inspector-tabs-app/assets/{agentos-hero-logo-E3fapwXM.svg → agentos-hero-logo-BL8gBiZH.svg} +1 -1
  2. package/assets/inspector-tabs-app/assets/{sed-BwsOyU9v.svg → coreutils-CQXb6ysD.svg} +1 -1
  3. package/assets/inspector-tabs-app/assets/filesystem-C9Z7HA3k.js +1 -0
  4. package/assets/inspector-tabs-app/assets/{hooks-DU8a-cwM.js → hooks-DaKa0v02.js} +1 -1
  5. package/assets/inspector-tabs-app/assets/index-BQ48yGn7.css +1 -0
  6. package/assets/inspector-tabs-app/assets/index-bwUfaXzS.js +126 -0
  7. package/assets/inspector-tabs-app/assets/processes-CZ6M0f6m.js +4 -0
  8. package/assets/inspector-tabs-app/assets/scroll-area-BN1MPKEE.js +1 -0
  9. package/assets/inspector-tabs-app/assets/system-CXd1uvC-.js +1 -0
  10. package/assets/inspector-tabs-app/assets/terminal-yincB5PP.js +13 -0
  11. package/assets/inspector-tabs-app/assets/useMutation-CmlocRNE.js +1 -0
  12. package/assets/inspector-tabs-app/assets/vm-status-badges-C7eIpgyG.js +1 -0
  13. package/assets/inspector-tabs-app/index.html +2 -2
  14. package/dist/index.d.ts +2861 -448
  15. package/dist/index.js +33 -1924
  16. package/dist/index.js.map +1 -1
  17. package/package.json +60 -114
  18. package/assets/inspector-tabs-app/assets/filesystem-C-x0K5sy.js +0 -1
  19. package/assets/inspector-tabs-app/assets/index-7G_DbdZ6.js +0 -110
  20. package/assets/inspector-tabs-app/assets/index-DG_s1YoH.css +0 -1
  21. package/assets/inspector-tabs-app/assets/scroll-area-kPbv4IGy.js +0 -1
  22. package/assets/inspector-tabs-app/assets/system-D98yBhMj.js +0 -2
  23. package/assets/inspector-tabs-app/assets/terminal-Bv9GKv4q.js +0 -13
  24. package/assets/inspector-tabs-app/assets/transcript-kMbm_tF8.js +0 -1
  25. package/assets/inspector-tabs-app/assets/useSuspenseQuery-ChN8rnBd.js +0 -1
  26. package/assets/inspector-tabs-app/assets/vm-boot-gate-rpuO0b5W.js +0 -1
  27. package/assets/inspector-tabs-app/assets/vm-status-badges-09qyfN_A.js +0 -5
  28. package/dist/chunk-V6TY7KAL.js +0 -8
  29. package/dist/chunk-V6TY7KAL.js.map +0 -1
  30. package/dist/client.d.ts +0 -2
  31. package/dist/client.js +0 -3
  32. package/dist/client.js.map +0 -1
  33. package/dist/node.d.ts +0 -67
  34. package/dist/node.js +0 -275
  35. package/dist/node.js.map +0 -1
  36. package/dist/react.d.ts +0 -1
  37. package/dist/react.js +0 -3
  38. package/dist/react.js.map +0 -1
@@ -1 +0,0 @@
1
- import{a as f,u as te,r as l,l as ne,b as Y,c as re,m as oe,j as e,I as F,S as ae,P as ie,A as le,d as K,e as P,C as ce,f as de,g as H,h as U,i as W,k as ue,n as pe}from"./index-7G_DbdZ6.js";import{u as xe}from"./useSuspenseQuery-ChN8rnBd.js";import{S as G}from"./scroll-area-kPbv4IGy.js";import{V as me}from"./vm-status-badges-09qyfN_A.js";function fe({event:n}){var r,u;switch(n.kind){case"user":return e.jsx("div",{className:"flex justify-end",children:e.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap rounded-2xl rounded-br-md bg-muted px-3.5 py-2 text-sm",children:n.text||"—"})});case"assistant":return e.jsx("div",{className:"flex",children:e.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap text-sm leading-relaxed",children:n.text||"—"})});case"thinking":return e.jsx("div",{className:"flex",children:e.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap text-xs italic leading-relaxed text-muted-foreground/70",children:n.text||"—"})});case"tool":{const a=n.input!==void 0||n.output!==void 0||!!((r=n.locations)!=null&&r.length),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-mono",children:n.tool}),n.status?e.jsx("span",{className:"rounded-full border px-1.5 py-px text-[10px]",children:n.status}):null]});return a?e.jsxs("details",{className:"group rounded-lg border border-foreground/10 bg-muted/20 text-xs text-muted-foreground",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-2.5 py-1.5 [&::-webkit-details-marker]:hidden",children:[e.jsx(W,{className:"size-3 shrink-0 transition-transform group-open:rotate-90"}),o]}),e.jsxs("div",{className:"flex flex-col gap-2 border-t border-foreground/10 px-2.5 py-2",children:[n.input!==void 0?e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-[10px] text-muted-foreground/70",children:"Input"}),e.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 font-mono text-[11px] leading-relaxed",children:JSON.stringify(n.input,null,2)})]}):null,n.output!==void 0?e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-[10px] text-muted-foreground/70",children:"Output"}),e.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 font-mono text-[11px] leading-relaxed",children:n.output})]}):null,(u=n.locations)!=null&&u.length?e.jsx("div",{className:"font-mono text-[11px] text-muted-foreground/70",children:n.locations.join(" ")}):null]})]}):e.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:o})}case"plan":return e.jsxs("div",{className:"rounded-lg border border-foreground/10 bg-muted/20 px-2.5 py-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"mb-1 text-[10px] text-muted-foreground/70",children:"Plan"}),e.jsx("ul",{className:"flex flex-col gap-1",children:n.entries.map((a,o)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(P,{color:a.status==="completed"?"green":a.status==="in_progress"?"amber":"muted",className:"mt-1"}),e.jsx("span",{className:H("min-w-0 flex-1",a.status==="completed"&&"text-muted-foreground/60 line-through"),children:a.content})]},`${o}-${a.content.slice(0,24)}`))})]});case"notice":return e.jsx("div",{className:"text-center text-[11px] text-muted-foreground/60",children:n.text});case"permission":return e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/5 px-2.5 py-1.5 text-xs text-amber-500/90",children:[e.jsx(P,{color:"amber",className:"size-1.5"}),n.text]});case"error":return e.jsx("div",{className:"whitespace-pre-wrap text-sm text-destructive",children:n.text});default:return e.jsxs("details",{className:"group text-xs text-muted-foreground/70",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 [&::-webkit-details-marker]:hidden",children:[e.jsx(W,{className:"size-3 shrink-0 transition-transform group-open:rotate-90"}),e.jsx("span",{className:"font-mono",children:n.label})]}),e.jsx("pre",{className:"mt-1.5 max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 font-mono text-[11px] leading-relaxed",children:JSON.stringify(n.json,null,2)})]})}}function he({count:n}){const r=l.useRef(null),u=l.useRef(!0);return l.useEffect(()=>{const a=r.current,o=a==null?void 0:a.closest("[data-radix-scroll-area-viewport]");if(!a||!o)return;const c=new IntersectionObserver(([x])=>{u.current=x.isIntersecting},{root:o,rootMargin:"0px 0px 96px 0px"});return c.observe(a),()=>c.disconnect()},[]),l.useEffect(()=>{var a;u.current&&((a=r.current)==null||a.scrollIntoView({block:"end"}))},[n]),e.jsx("div",{ref:r,className:"h-px"})}function ge(n){const r=[],u=new Map;let a=null;for(const o of n){const c=r[r.length-1];if((o.kind==="user"||o.kind==="assistant"||o.kind==="thinking")&&(c==null?void 0:c.kind)===o.kind){r[r.length-1]={...c,text:c.text+o.text};continue}if(o.kind==="tool"&&o.toolCallId){const x=u.get(o.toolCallId);if(x!==void 0){const p=r[x];r[x]={...p,tool:o.tool!==o.toolCallId?o.tool:p.tool,status:o.status??p.status,input:o.input??p.input,output:o.output??p.output,locations:o.locations??p.locations};continue}u.set(o.toolCallId,r.length)}if(o.kind==="plan"){if(a!==null){r[a]={...r[a],entries:o.entries};continue}a=r.length}r.push(o)}return r}function ye(){return e.jsx("div",{className:"flex items-center gap-1 px-1 py-0.5","aria-label":"Turn in progress",children:[0,1,2].map(n=>e.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-muted-foreground/50",style:{animationDelay:`${n*200}ms`}},n))})}const D="agentos-inspector:composer-agent-type",L="agentos-inspector:composer-env",J=n=>`agentos-inspector:transcript:${n}`,X=JSON.stringify({ANTHROPIC_API_KEY:"",OPENCODE_CONFIG_CONTENT:JSON.stringify({model:"anthropic/claude-haiku-4-5-20251001"})},null,2);function ve(){const n=(localStorage.getItem(D)??"opencode").trim()||"opencode",r=localStorage.getItem(L)??X;let u;try{u=JSON.parse(r)}catch(a){throw new Error(`Session env is not valid JSON: ${a.message}`)}return{agentType:n,env:u}}function Ne({actorId:n,sessionId:r,sessionStatus:u,onSessionCreated:a,onErrorEvent:o,onBusyChange:c}){const[x,p]=l.useState(""),[g,R]=l.useState(!1),S=i=>{R(i),c==null||c(i)},[v,N]=l.useState(!1),[j,k]=l.useState(!1),[C,O]=l.useState(()=>localStorage.getItem(D)??"opencode"),[b,A]=l.useState(()=>localStorage.getItem(L)??X),E=l.useRef(null),T=(Y({...f.softwareQueryOptions(n),enabled:j}).data??[]).filter(i=>i.name.endsWith("· agent")).map(i=>{var d;return((d=i.name.split(" · ")[0])==null?void 0:d.split("/").pop())??""}).filter(Boolean),w=async()=>{const i=x.trim();if(!(!i||g)){S(!0),p("");try{let d=r;if(!d){let h;try{h=JSON.parse(b)}catch(_){throw new Error(`Session env is not valid JSON: ${_.message}`)}d=await f.createSession(C.trim()||"opencode",{env:h}),a(d)}E.current=d,await f.sendPrompt(d,i)}catch(d){let h=ue(d)?` — ${d.hint}`:"";r&&u!=="running"&&(h=" — this session is idle (not live in the current VM boot). Send without a selection to start a fresh session, or resume it from a client."),o(`${d instanceof Error?d.message:String(d)}${h}`)}finally{E.current=null,S(!1)}}},I=async()=>{const i=E.current??r;if(i)try{await pe(i)||(N(!0),o("Stop is not supported by this runtime (no cancelPrompt action)."))}catch(d){o(d instanceof Error?d.message:String(d))}};return e.jsx("div",{className:"shrink-0",children:e.jsxs("div",{className:"mx-auto w-full max-w-3xl px-3 pb-3",children:[j&&!r?e.jsxs("div",{className:"mb-2 flex flex-col gap-2 rounded-xl border bg-muted/30 p-3 text-xs",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-24 shrink-0 text-muted-foreground",children:"Agent type"}),e.jsx("input",{value:C,onChange:i=>{O(i.target.value),localStorage.setItem(D,i.target.value)},list:"agentos-composer-agent-types",className:"flex-1 rounded border bg-background px-2 py-1 font-mono"}),e.jsx("datalist",{id:"agentos-composer-agent-types",children:T.map(i=>e.jsx("option",{value:i},i))})]}),e.jsxs("label",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"w-24 shrink-0 pt-1 text-muted-foreground",children:"Session env"}),e.jsx("textarea",{value:b,onChange:i=>{A(i.target.value),localStorage.setItem(L,i.target.value)},rows:4,spellCheck:!1,className:"flex-1 resize-y rounded border bg-background px-2 py-1 font-mono"})]}),e.jsx("div",{className:"text-muted-foreground/70",children:"Used when sending without a session: creates one with these options. Values stay in this browser."})]}):null,e.jsxs("div",{className:"rounded-2xl border bg-muted/40 transition-colors focus-within:border-ring/60",children:[e.jsx("textarea",{value:x,onChange:i=>p(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),w())},placeholder:r?"Prompt this session…":"Prompt a new session…",rows:2,className:"max-h-48 min-h-[3.25rem] w-full resize-none bg-transparent px-4 pt-3 text-sm placeholder:text-muted-foreground/50 focus:outline-none"}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 pb-2.5",children:[r?null:e.jsxs("button",{type:"button",onClick:()=>k(i=>!i),title:"New-session options (agent, env)",className:"inline-flex items-center gap-1 rounded px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[e.jsx("span",{"aria-hidden":"true",className:"text-sm leading-none",children:"+"}),"Options"]}),e.jsx("span",{className:"ml-auto"}),g?e.jsx("button",{type:"button",onClick:()=>void I(),disabled:v,title:v?"This runtime has no cancelPrompt action":"Stop the running turn",className:"inline-flex size-8 items-center justify-center rounded-md bg-foreground/90 text-background transition-opacity hover:opacity-80 disabled:opacity-40",children:e.jsx("span",{"aria-hidden":"true",className:"block size-2.5 rounded-[2px] bg-current"})}):e.jsx("button",{type:"button",onClick:()=>void w(),disabled:!x.trim(),title:"Send (⏎)",className:"inline-flex size-8 items-center justify-center rounded-md bg-primary text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-40",children:e.jsx("svg",{viewBox:"0 0 16 16",className:"size-4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M8 13V3M4 7l4-4 4 4"})})})]})]})]})})}function Ce({actorId:n}){var V;const{data:r}=xe(f.sessionsQueryOptions(n)),u=te(),[a,o]=l.useState(()=>{try{const s=sessionStorage.getItem(J(n));if(!s)return;const t=JSON.parse(s);return t.selected===null||typeof t.selected=="string"?t.selected:void 0}catch{return}});l.useEffect(()=>{try{a===void 0?sessionStorage.removeItem(J(n)):sessionStorage.setItem(J(n),JSON.stringify({selected:a}))}catch(s){console.warn("agentos inspector: failed to persist transcript state",s)}},[n,a]);const c=a===void 0||typeof a=="string"&&!r.some(s=>s.sessionId===a)?((V=r[0])==null?void 0:V.sessionId)??null:a,x=l.useMemo(()=>ne(r),[r]),p=s=>x.has(s.sessionId),{data:g=[]}=Y(f.transcriptQueryOptions(n,c)),S=re().useEvent,[v,N]=l.useState([]),j=l.useRef(0),k=l.useRef(c);k.current=c,l.useEffect(()=>{N([])},[c]),S("sessionEvent",s=>{const t=s,y=k.current;if(!y||!(t!=null&&t.sessionId)||t.sessionId!==y)return;let m=oe(t);t.type==="permission_request"&&m.kind==="permission"&&(m={...m,text:`${m.text} (answer in the banner above)`});const q=j.current++;N(B=>{if(t.durability==="durable"){const se=t.type==="agent_message_chunk"||t.type==="agent_thought_chunk";return[...B.filter($=>$.seq!==m.seq&&!(se&&$.kind===m.kind&&!Number.isInteger($.seq)&&$.seq<m.seq)),{...m,liveKey:q}]}return[...B,{...m,liveKey:q}]})}),S("agentExit",s=>{const t=s,y=k.current;if(!y||(t==null?void 0:t.sessionId)!==y)return;const m=j.current++;N(q=>[...q,{kind:"error",seq:-1-m,liveKey:m,text:`Agent crashed (exit ${t.exitCode??"?"}) — restart: ${t.restart}${t.restartCount?` (attempt ${t.restartCount})`:""}`}])});const C=s=>{const t=j.current++;N(y=>[...y,{kind:"error",seq:-1-t,liveKey:t,text:s}])},O=s=>{o(s),u.invalidateQueries({queryKey:f.sessionsQueryOptions(n).queryKey})},[b,A]=l.useState(!1),[E,z]=l.useState(!1),[T,w]=l.useState(""),I=T.trim().toLowerCase(),i=I?r.filter(s=>s.sessionId.toLowerCase().includes(I)||s.agent.toLowerCase().includes(I)):r,[d,h]=l.useState(null),_=async()=>{if(!b){A(!0),h(null);try{const{agentType:s,env:t}=ve();O(await f.createSession(s,{env:t}))}catch(s){h(s)}finally{A(!1)}}},[M,Z]=l.useState(!1),ee=async s=>{try{await f.closeSession(s)}catch(t){C(t instanceof Error?t.message:String(t))}o(void 0),u.invalidateQueries({queryKey:f.sessionsQueryOptions(n).queryKey})},Q=l.useMemo(()=>{const s=new Set(g.map(t=>t.seq));return ge([...g.map(t=>({...t,key:`b-${t.seq}`})),...v.filter(t=>!s.has(t.seq)).map(t=>({...t,key:`l-${t.liveKey}`}))])},[g,v]);return e.jsxs("div",{className:"flex h-full min-h-0",children:[e.jsxs("div",{className:"flex h-full w-64 shrink-0 flex-col border-r",children:[e.jsxs("div",{className:"flex items-center px-3 pb-1 pt-2.5",children:[e.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Sessions",x.size>0?` · ${x.size} live`:""]}),e.jsx("span",{className:"ml-auto"}),e.jsx(F,{title:"Search sessions by id",onClick:()=>z(s=>(s&&w(""),!s)),className:"mr-1",children:e.jsx(ae,{className:"size-3.5"})}),e.jsx(F,{title:b?"Creating session…":"New session",onClick:()=>void _(),disabled:b,children:e.jsx(ie,{className:"size-3.5"})})]}),E?e.jsx("div",{className:"px-3 pb-1.5",children:e.jsx("input",{value:T,onChange:s=>w(s.target.value),onKeyDown:s=>{s.key==="Escape"&&(w(""),z(!1))},spellCheck:!1,autoFocus:!0,"aria-label":"Search sessions",placeholder:"session id or agent",className:"w-full rounded border bg-background px-2 py-1 font-mono text-xs focus:outline-none"})}):null,d?e.jsx(le,{error:d,className:"border-b py-2"}):null,r.length===0?e.jsx(K,{children:"No sessions yet."}):e.jsx(G,{className:"min-h-0 flex-1",children:e.jsxs("div",{className:"p-1.5",children:[i.length===0?e.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No sessions match."}):null,i.map(s=>e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(s.sessionId),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&o(s.sessionId)},className:H("group flex w-full cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-left",s.sessionId===c?"bg-muted":"hover:bg-muted/50"),children:[e.jsx(P,{color:p(s)?"green":"muted"}),e.jsxs("div",{className:"min-w-0 flex-1",title:p(s)?"Live in the current VM":"Idle — persisted, not loaded in the current VM",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsxs("span",{className:"truncate font-mono",children:["…",s.sessionId.slice(-12)]}),e.jsx(ce,{value:s.sessionId,className:"opacity-0 focus:opacity-100 group-hover:opacity-100"})]}),e.jsxs("div",{className:"truncate text-[10px] text-muted-foreground/60",children:[s.agent," · ",de(Date.parse(s.createdAt))]})]}),p(s)?e.jsx("button",{type:"button",onClick:t=>{t.stopPropagation(),ee(s.sessionId)},title:"End the live agent process; the transcript stays","aria-label":"Close session",className:"text-muted-foreground/40 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 group-hover:opacity-100",children:e.jsx("svg",{viewBox:"0 0 12 12",className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:e.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}):null]},s.sessionId))]})})]}),e.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:"absolute right-3 top-2 z-10",children:e.jsx(me,{actorId:n})}),c?e.jsx(e.Fragment,{children:Q.length===0&&!M?e.jsx(K,{children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx(U,{className:"w-44"}),e.jsx("span",{children:"No activity yet — send a prompt below."})]})}):e.jsx(G,{className:"min-h-0 flex-1",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-4 py-4",children:[Q.map(s=>e.jsx(fe,{event:s},s.key)),M?e.jsx(ye,{}):null,e.jsx(he,{count:g.length+v.length})]})})}):e.jsx(K,{children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx(U,{className:"w-44"}),e.jsx("span",{children:"No session selected — press + or send a prompt below to start one."})]})}),e.jsx(Ne,{actorId:n,sessionId:c,sessionStatus:c?(()=>{const s=r.find(t=>t.sessionId===c);return s&&p(s)?"running":"idle"})():void 0,onSessionCreated:O,onErrorEvent:C,onBusyChange:Z})]})]})}export{Ce as TranscriptTabConnected};
@@ -1 +0,0 @@
1
- import{Y as r,Q as u,N as s}from"./index-7G_DbdZ6.js";function t(e,a){return r({...e,enabled:!0,suspense:!0,throwOnError:s,placeholderData:void 0},u)}export{t as u};
@@ -1 +0,0 @@
1
- var K=e=>{throw TypeError(e)};var E=(e,t,s)=>t.has(e)||K("Cannot "+s);var r=(e,t,s)=>(E(e,t,"read from private field"),s?s.call(e):t.get(e)),y=(e,t,s)=>t.has(e)?K("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),f=(e,t,s,i)=>(E(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),v=(e,t,s)=>(E(e,t,"access private method"),s);import{v as A,x as N,a0 as R,a1 as Q,w as k,u as U,r as x,J as q,a2 as L,b as V,a3 as B,j as m,d as D,h as F}from"./index-7G_DbdZ6.js";var n,l,o,h,u,C,M,P,G=(P=class extends A{constructor(t,s){super();y(this,u);y(this,n);y(this,l);y(this,o);y(this,h);f(this,n,t),this.setOptions(s),this.bindMethods(),v(this,u,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const s=this.options;this.options=r(this,n).defaultMutationOptions(t),N(this.options,s)||r(this,n).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((i=r(this,o))==null?void 0:i.state.status)==="pending"&&r(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){v(this,u,C).call(this),v(this,u,M).call(this,t)}getCurrentResult(){return r(this,l)}reset(){var t;(t=r(this,o))==null||t.removeObserver(this),f(this,o,void 0),v(this,u,C).call(this),v(this,u,M).call(this)}mutate(t,s){var i;return f(this,h,s),(i=r(this,o))==null||i.removeObserver(this),f(this,o,r(this,n).getMutationCache().build(r(this,n),this.options)),r(this,o).addObserver(this),r(this,o).execute(t)}},n=new WeakMap,l=new WeakMap,o=new WeakMap,h=new WeakMap,u=new WeakSet,C=function(){var s;const t=((s=r(this,o))==null?void 0:s.state)??Q();f(this,l,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},M=function(t){k.batch(()=>{var s,i,a,p,c,g,S,w;if(r(this,h)&&this.hasListeners()){const b=r(this,l).variables,O=r(this,l).context,j={client:r(this,n),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(s=r(this,h)).onSuccess)==null||i.call(s,t.data,b,O,j)}catch(d){Promise.reject(d)}try{(p=(a=r(this,h)).onSettled)==null||p.call(a,t.data,null,b,O,j)}catch(d){Promise.reject(d)}}else if((t==null?void 0:t.type)==="error"){try{(g=(c=r(this,h)).onError)==null||g.call(c,t.error,b,O,j)}catch(d){Promise.reject(d)}try{(w=(S=r(this,h)).onSettled)==null||w.call(S,void 0,t.error,b,O,j)}catch(d){Promise.reject(d)}}}this.listeners.forEach(b=>{b(r(this,l))})})},P);function T(e,t){const s=U(),[i]=x.useState(()=>new G(s,e));x.useEffect(()=>{i.setOptions(e)},[i,e]);const a=x.useSyncExternalStore(x.useCallback(c=>i.subscribe(k.batchCalls(c)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),p=x.useCallback((c,g)=>{i.mutate(c,g).catch(q)},[i]);if(a.error&&L(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:p,mutateAsync:a.mutate}}function W({actorId:e,note:t,actionLabel:s,children:i}){const a=V(B(e)),[p,c]=x.useState(!1);return a.data&&!a.data.booted&&!p?m.jsx(D,{children:m.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-2",children:[m.jsx(F,{className:"mb-3 w-44"}),m.jsx("span",{children:t}),m.jsx("button",{type:"button",onClick:()=>c(!0),className:"rounded-md border px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:s})]})}):m.jsx(m.Fragment,{children:i})}export{W as V,T as u};
@@ -1,5 +0,0 @@
1
- import{k as h,b,a3 as j,r as x,c as v,j as t,e as $,g as N,i as w,C as d,f as g}from"./index-7G_DbdZ6.js";function k(s){return h(s)&&s.layer==="contract"}function C(s,r){if((r==null?void 0:r.kind)==="shutdown"){const a=r.reason??"unknown";return a==="error"?{tone:"red",label:"VM shut down after an error"}:{tone:"muted",label:`VM shut down (${a})`}}return s?s.sidecar&&s.sidecar.state!=="ready"?{tone:"red",label:`sidecar ${s.sidecar.state}`}:!s.booted&&(r==null?void 0:r.kind)!=="booted"?{tone:"muted",label:"VM not booted"}:null:null}function S({actorId:s,align:r="right"}){const a=b(j(s)),[p,c]=x.useState(null),[u,f]=x.useState(!1),m=v().useEvent;if(m("vmBooted",()=>{c({kind:"booted"}),a.refetch()}),m("vmShutdown",e=>{c({kind:"shutdown",reason:e==null?void 0:e.reason}),a.refetch()}),a.error&&k(a.error))return null;const n=a.data,o=a.error?{tone:"muted",label:"health unavailable"}:C(n,p),i=((n==null?void 0:n.warnings.length)??0)+((n==null?void 0:n.agentExits.length)??0);return!o&&i===0?null:t.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs",children:[o?t.jsxs("span",{className:N("inline-flex items-center gap-1.5 rounded border px-2 py-0.5 text-[11px]",o.tone==="red"?"border-destructive/40 text-destructive":"border-foreground/15 text-muted-foreground"),children:[t.jsx($,{color:o.tone==="red"?"red":"muted"}),o.label]}):null,i>0?t.jsxs("span",{className:"relative",children:[t.jsxs("button",{type:"button",onClick:()=>f(e=>!e),className:"inline-flex items-center gap-1 rounded border border-amber-500/40 px-2 py-0.5 text-[11px] text-amber-500 transition-colors hover:bg-amber-500/10",children:[i," warning",i===1?"":"s",t.jsx(w,{className:`size-2.5 transition-transform ${u?"rotate-90":""}`})]}),u&&n?t.jsxs("div",{className:`absolute top-full z-20 mt-1 max-h-64 w-80 overflow-y-auto rounded-md border bg-background p-2 text-[11px] leading-relaxed shadow-lg ${r==="right"?"right-0":"left-0"}`,children:[n.warnings.length>0?t.jsxs("div",{className:"mb-2",children:[t.jsxs("div",{className:"mb-1 flex items-center gap-1 font-medium text-muted-foreground",children:["Limit warnings",t.jsx(d,{value:n.warnings.map(e=>`${new Date(e.ts).toISOString()} ${e.limit} ${e.observed}/${e.capacity} · ${e.fillPercent}%`).join(`
2
- `)})]}),n.warnings.map((e,l)=>t.jsxs("div",{className:"flex items-center gap-2 font-mono",children:[t.jsxs("span",{children:[e.limit," ",e.observed,"/",e.capacity," · ",e.fillPercent,"%"]}),t.jsx("span",{className:"ml-auto text-muted-foreground",children:g(e.ts)})]},`w-${l}`))]}):null,n.agentExits.length>0?t.jsxs("div",{className:"mb-2",children:[t.jsxs("div",{className:"mb-1 flex items-center gap-1 font-medium text-muted-foreground",children:["Agent exits",t.jsx(d,{value:n.agentExits.map(e=>`${new Date(e.ts).toISOString()} ${e.agentType} session=${e.sessionId} exit=${e.exitCode??"?"} restart=${e.restart} (${e.restartCount})`).join(`
3
- `)})]}),n.agentExits.map((e,l)=>t.jsxs("div",{className:"flex items-center gap-2 font-mono",children:[t.jsxs("span",{children:[e.agentType," exit ",e.exitCode??"?"," · ",e.restart," (",e.restartCount,")"]}),t.jsx("span",{className:"ml-auto text-muted-foreground",children:g(e.ts)})]},`e-${l}`))]}):null,n.stderrTail.length>0?t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1 flex items-center gap-1 font-medium text-muted-foreground",children:["Adapter stderr (tail)",t.jsx(d,{value:n.stderrTail.map(e=>e.line).join(`
4
- `)})]}),t.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-muted-foreground",children:n.stderrTail.map(e=>e.line).join(`
5
- `)})]}):null]}):null]}):null]})}export{S as V};
@@ -1,8 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
-
5
- export {
6
- __publicField
7
- };
8
- //# sourceMappingURL=chunk-V6TY7KAL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/client.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from 'rivetkit/client';
2
- import '@rivetkit/react';
package/dist/client.js DELETED
@@ -1,3 +0,0 @@
1
- // src/client.ts
2
- export * from "rivetkit/client";
3
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/client.ts"],"sourcesContent":["/**\n * Convenience re-export of the unmodified `rivetkit/client` entrypoint.\n *\n * This subpath exists so AgentOS applications only need a direct dependency on\n * `@rivet-dev/agentos`. It must never wrap, proxy, decorate, specialize, or add\n * behavior to RivetKit clients, accessors, handles, connections, actions, or\n * events.\n */\nexport * from \"rivetkit/client\";\n"],"mappings":";AAQA,cAAc;","names":[]}
package/dist/node.d.ts DELETED
@@ -1,67 +0,0 @@
1
- interface NodeShellOpenOptions {
2
- command?: string;
3
- args?: string[];
4
- env?: Record<string, string>;
5
- cwd?: string;
6
- cols?: number;
7
- rows?: number;
8
- }
9
- interface NodeShellConnection {
10
- openShell(options?: NodeShellOpenOptions): Promise<{
11
- shellId: string;
12
- }>;
13
- writeShell(shellId: string, data: string | Uint8Array): Promise<void>;
14
- resizeShell(shellId: string, cols: number, rows: number): Promise<void>;
15
- closeShell(shellId: string): Promise<void>;
16
- waitShell(shellId: string): Promise<number>;
17
- }
18
- interface NodeShellInput {
19
- isTTY?: boolean;
20
- isRaw?: boolean;
21
- setRawMode?(enabled: boolean): unknown;
22
- on(event: "data", listener: (data: string | Uint8Array) => void): unknown;
23
- on(event: "end", listener: () => void): unknown;
24
- on(event: "error", listener: (error: Error) => void): unknown;
25
- removeListener(event: "data", listener: (data: string | Uint8Array) => void): unknown;
26
- removeListener(event: "end", listener: () => void): unknown;
27
- removeListener(event: "error", listener: (error: Error) => void): unknown;
28
- pause(): unknown;
29
- resume(): unknown;
30
- }
31
- interface NodeShellOutput {
32
- isTTY?: boolean;
33
- columns?: number;
34
- rows?: number;
35
- write(data: string | Uint8Array): boolean;
36
- on(event: "resize", listener: () => void): unknown;
37
- removeListener(event: "resize", listener: () => void): unknown;
38
- }
39
- type NodeShellSignal = "SIGINT" | "SIGHUP" | "SIGTERM";
40
- interface AttachShellOptions extends NodeShellOpenOptions {
41
- stdin?: NodeShellInput;
42
- stdout?: NodeShellOutput;
43
- stderr?: NodeShellOutput;
44
- rawMode?: boolean;
45
- resize?: boolean;
46
- signals?: readonly NodeShellSignal[];
47
- maxPendingOutputBytes?: number;
48
- onWarning?: (message: string) => void;
49
- }
50
- declare class NodeShellOutputLimitError extends Error {
51
- readonly limitBytes: number;
52
- readonly pendingBytes: number;
53
- readonly code = "AGENTOS_NODE_SHELL_OUTPUT_LIMIT";
54
- constructor(limitBytes: number, pendingBytes: number);
55
- }
56
- declare class NodeShellCleanupError extends Error {
57
- readonly errors: readonly Error[];
58
- readonly code = "AGENTOS_NODE_SHELL_CLEANUP_FAILED";
59
- constructor(errors: readonly Error[]);
60
- }
61
- /**
62
- * Open an AgentOS PTY shell and attach it to the current Node process terminal.
63
- * The connection must expose AgentOS shell actions and its broadcast `on()` API.
64
- */
65
- declare function attachShell(connection: NodeShellConnection, options?: AttachShellOptions): Promise<number>;
66
-
67
- export { type AttachShellOptions, NodeShellCleanupError, type NodeShellConnection, type NodeShellInput, type NodeShellOpenOptions, type NodeShellOutput, NodeShellOutputLimitError, type NodeShellSignal, attachShell };
package/dist/node.js DELETED
@@ -1,275 +0,0 @@
1
- import {
2
- __publicField
3
- } from "./chunk-V6TY7KAL.js";
4
-
5
- // src/node.ts
6
- import { Buffer } from "buffer";
7
- var DEFAULT_MAX_PENDING_OUTPUT_BYTES = 8 * 1024 * 1024;
8
- var OUTPUT_LIMIT_WARNING_RATIO = 0.8;
9
- var TRAILING_OUTPUT_GRACE_MS = 250;
10
- var NodeShellOutputLimitError = class extends Error {
11
- constructor(limitBytes, pendingBytes) {
12
- super(
13
- `AgentOS Node shell pending output exceeded ${limitBytes} bytes (${pendingBytes} bytes pending); raise AttachShellOptions.maxPendingOutputBytes to allow more`
14
- );
15
- this.limitBytes = limitBytes;
16
- this.pendingBytes = pendingBytes;
17
- __publicField(this, "code", "AGENTOS_NODE_SHELL_OUTPUT_LIMIT");
18
- this.name = "NodeShellOutputLimitError";
19
- }
20
- };
21
- var NodeShellCleanupError = class extends Error {
22
- constructor(errors) {
23
- super("AgentOS Node shell and cleanup both failed");
24
- this.errors = errors;
25
- __publicField(this, "code", "AGENTOS_NODE_SHELL_CLEANUP_FAILED");
26
- this.name = "NodeShellCleanupError";
27
- }
28
- };
29
- async function attachShell(connection, options = {}) {
30
- const stdin = options.stdin ?? process.stdin;
31
- const stdout = options.stdout ?? process.stdout;
32
- const stderr = options.stderr ?? process.stderr;
33
- const events = connection;
34
- if (typeof events.on !== "function") {
35
- throw new TypeError("attachShell requires an AgentOS connection with on()");
36
- }
37
- const maxPendingOutputBytes = options.maxPendingOutputBytes ?? DEFAULT_MAX_PENDING_OUTPUT_BYTES;
38
- if (!Number.isSafeInteger(maxPendingOutputBytes) || maxPendingOutputBytes <= 0) {
39
- throw new RangeError(
40
- "AttachShellOptions.maxPendingOutputBytes must be a positive safe integer"
41
- );
42
- }
43
- const warn = options.onWarning ?? ((message) => stderr.write(`${message}
44
- `));
45
- let shellId;
46
- let shellClosed = false;
47
- let failure;
48
- let resolveFailure;
49
- const failurePromise = new Promise((resolve) => {
50
- resolveFailure = resolve;
51
- });
52
- const fail = (error) => {
53
- if (failure) return;
54
- failure = error;
55
- resolveFailure?.({ kind: "failure", error });
56
- };
57
- const earlyOutput = [];
58
- let earlyOutputBytes = 0;
59
- let earlyOutputWarned = false;
60
- let resolveShellExit;
61
- const shellExitPromise = new Promise((resolve) => {
62
- resolveShellExit = resolve;
63
- });
64
- const onShellData = (payload) => {
65
- routeOutput("stdout", payload);
66
- };
67
- const onShellStderr = (payload) => {
68
- routeOutput("stderr", payload);
69
- };
70
- const onShellExit = (payload) => {
71
- if (shellId && payload.shellId === shellId) resolveShellExit?.();
72
- };
73
- const unsubscribers = [
74
- subscribe(events, "shellData", onShellData),
75
- subscribe(events, "shellStderr", onShellStderr),
76
- subscribe(events, "shellExit", onShellExit)
77
- ];
78
- function routeOutput(stream, payload) {
79
- try {
80
- const bytes = toBytes(payload.data);
81
- if (bytes.byteLength === 0) return;
82
- if (!shellId) {
83
- const nextBytes = earlyOutputBytes + bytes.byteLength;
84
- if (nextBytes > maxPendingOutputBytes) {
85
- fail(new NodeShellOutputLimitError(maxPendingOutputBytes, nextBytes));
86
- return;
87
- }
88
- earlyOutputBytes = nextBytes;
89
- earlyOutput.push({ stream, payload, bytes });
90
- if (!earlyOutputWarned && nextBytes >= Math.floor(maxPendingOutputBytes * OUTPUT_LIMIT_WARNING_RATIO)) {
91
- earlyOutputWarned = true;
92
- warn(
93
- `AgentOS Node shell pending output is near its ${maxPendingOutputBytes}-byte limit (${nextBytes} bytes pending)`
94
- );
95
- }
96
- return;
97
- }
98
- if (payload.shellId !== shellId) return;
99
- (stream === "stdout" ? stdout : stderr).write(bytes);
100
- } catch (error) {
101
- fail(asError(error));
102
- }
103
- }
104
- let inputAttached = false;
105
- let rawModeChanged = false;
106
- let previousRawMode = false;
107
- let inputWrite = Promise.resolve();
108
- let inputEnded = false;
109
- let resizeAttached = false;
110
- let signalOutcomeResolve;
111
- const signalPromise = new Promise((resolve) => {
112
- signalOutcomeResolve = resolve;
113
- });
114
- const signalHandlers = /* @__PURE__ */ new Map();
115
- const onInputData = (data) => {
116
- stdin.pause();
117
- inputWrite = inputWrite.then(async () => {
118
- if (shellId) await connection.writeShell(shellId, data);
119
- }).then(() => {
120
- if (!inputEnded) stdin.resume();
121
- }).catch((error) => fail(asError(error)));
122
- };
123
- const onInputEnd = () => {
124
- inputEnded = true;
125
- stdin.pause();
126
- inputWrite = inputWrite.then(async () => {
127
- if (shellId) await connection.writeShell(shellId, "");
128
- }).catch((error) => fail(asError(error)));
129
- };
130
- const onInputError = (error) => fail(error);
131
- const onResize = () => {
132
- if (!shellId) return;
133
- const cols = stdout.columns;
134
- const rows = stdout.rows;
135
- if (!positiveInteger(cols) || !positiveInteger(rows)) return;
136
- void connection.resizeShell(shellId, cols, rows).catch((error) => {
137
- fail(asError(error));
138
- });
139
- };
140
- try {
141
- const opened = await connection.openShell({
142
- command: options.command,
143
- args: options.args,
144
- env: options.env,
145
- cwd: options.cwd,
146
- cols: options.cols ?? stdout.columns,
147
- rows: options.rows ?? stdout.rows
148
- });
149
- shellId = opened.shellId;
150
- for (const item of earlyOutput) {
151
- if (item.payload.shellId !== shellId) continue;
152
- (item.stream === "stdout" ? stdout : stderr).write(item.bytes);
153
- }
154
- earlyOutput.length = 0;
155
- earlyOutputBytes = 0;
156
- if (failure) throw failure;
157
- previousRawMode = Boolean(stdin.isRaw);
158
- if ((options.rawMode ?? true) && stdin.isTTY && typeof stdin.setRawMode === "function" && !previousRawMode) {
159
- stdin.setRawMode(true);
160
- rawModeChanged = true;
161
- }
162
- stdin.on("data", onInputData);
163
- stdin.on("end", onInputEnd);
164
- stdin.on("error", onInputError);
165
- stdin.resume();
166
- inputAttached = true;
167
- if ((options.resize ?? true) && stdout.isTTY) {
168
- stdout.on("resize", onResize);
169
- resizeAttached = true;
170
- onResize();
171
- }
172
- for (const signal of options.signals ?? ["SIGINT", "SIGHUP", "SIGTERM"]) {
173
- const handler = () => {
174
- signalOutcomeResolve?.({
175
- kind: "signal",
176
- signal,
177
- exitCode: signalExitCode(signal)
178
- });
179
- };
180
- signalHandlers.set(signal, handler);
181
- process.once(signal, handler);
182
- }
183
- const outcome = await Promise.race([
184
- connection.waitShell(shellId).then((exitCode) => ({
185
- kind: "exit",
186
- exitCode
187
- })),
188
- failurePromise,
189
- signalPromise
190
- ]);
191
- if (outcome.kind === "failure") {
192
- await connection.closeShell(shellId);
193
- shellClosed = true;
194
- throw outcome.error;
195
- }
196
- if (outcome.kind === "signal") {
197
- await connection.closeShell(shellId);
198
- shellClosed = true;
199
- return outcome.exitCode;
200
- }
201
- await Promise.race([
202
- shellExitPromise,
203
- new Promise(
204
- (resolve) => setTimeout(resolve, TRAILING_OUTPUT_GRACE_MS)
205
- )
206
- ]);
207
- await inputWrite;
208
- if (failure) throw failure;
209
- return outcome.exitCode;
210
- } catch (error) {
211
- if (shellId && !shellClosed) {
212
- try {
213
- await connection.closeShell(shellId);
214
- shellClosed = true;
215
- } catch (closeError) {
216
- throw new NodeShellCleanupError([asError(error), asError(closeError)]);
217
- }
218
- }
219
- throw error;
220
- } finally {
221
- for (const unsubscribe of unsubscribers) unsubscribe();
222
- if (inputAttached) {
223
- stdin.removeListener("data", onInputData);
224
- stdin.removeListener("end", onInputEnd);
225
- stdin.removeListener("error", onInputError);
226
- stdin.pause();
227
- }
228
- if (resizeAttached) stdout.removeListener("resize", onResize);
229
- if (rawModeChanged) stdin.setRawMode?.(previousRawMode);
230
- for (const [signal, handler] of signalHandlers) {
231
- process.removeListener(signal, handler);
232
- }
233
- }
234
- }
235
- function subscribe(events, event, listener) {
236
- const untypedListener = listener;
237
- const result = events.on(event, untypedListener);
238
- if (typeof result === "function") return result;
239
- return () => {
240
- if (events.off) events.off(event, untypedListener);
241
- else events.removeListener?.(event, untypedListener);
242
- };
243
- }
244
- function toBytes(data) {
245
- if (data instanceof Uint8Array) return data;
246
- if (Array.isArray(data) && data.length === 2 && data[0] === "$Uint8Array" && typeof data[1] === "string") {
247
- return Buffer.from(data[1], "base64");
248
- }
249
- if (typeof data === "string") return Buffer.from(data, "utf8");
250
- throw new TypeError(
251
- `Unsupported AgentOS shell data payload: ${String(data)}`
252
- );
253
- }
254
- function positiveInteger(value) {
255
- return Number.isInteger(value) && (value ?? 0) > 0;
256
- }
257
- function signalExitCode(signal) {
258
- switch (signal) {
259
- case "SIGHUP":
260
- return 129;
261
- case "SIGINT":
262
- return 130;
263
- case "SIGTERM":
264
- return 143;
265
- }
266
- }
267
- function asError(error) {
268
- return error instanceof Error ? error : new Error(String(error));
269
- }
270
- export {
271
- NodeShellCleanupError,
272
- NodeShellOutputLimitError,
273
- attachShell
274
- };
275
- //# sourceMappingURL=node.js.map
package/dist/node.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/node.ts"],"sourcesContent":["import { Buffer } from \"node:buffer\";\n\nconst DEFAULT_MAX_PENDING_OUTPUT_BYTES = 8 * 1024 * 1024;\nconst OUTPUT_LIMIT_WARNING_RATIO = 0.8;\nconst TRAILING_OUTPUT_GRACE_MS = 250;\n\nexport interface NodeShellOpenOptions {\n\tcommand?: string;\n\targs?: string[];\n\tenv?: Record<string, string>;\n\tcwd?: string;\n\tcols?: number;\n\trows?: number;\n}\n\nexport interface NodeShellConnection {\n\topenShell(options?: NodeShellOpenOptions): Promise<{ shellId: string }>;\n\twriteShell(shellId: string, data: string | Uint8Array): Promise<void>;\n\tresizeShell(shellId: string, cols: number, rows: number): Promise<void>;\n\tcloseShell(shellId: string): Promise<void>;\n\twaitShell(shellId: string): Promise<number>;\n}\n\nexport interface NodeShellInput {\n\tisTTY?: boolean;\n\tisRaw?: boolean;\n\tsetRawMode?(enabled: boolean): unknown;\n\ton(event: \"data\", listener: (data: string | Uint8Array) => void): unknown;\n\ton(event: \"end\", listener: () => void): unknown;\n\ton(event: \"error\", listener: (error: Error) => void): unknown;\n\tremoveListener(\n\t\tevent: \"data\",\n\t\tlistener: (data: string | Uint8Array) => void,\n\t): unknown;\n\tremoveListener(event: \"end\", listener: () => void): unknown;\n\tremoveListener(event: \"error\", listener: (error: Error) => void): unknown;\n\tpause(): unknown;\n\tresume(): unknown;\n}\n\nexport interface NodeShellOutput {\n\tisTTY?: boolean;\n\tcolumns?: number;\n\trows?: number;\n\twrite(data: string | Uint8Array): boolean;\n\ton(event: \"resize\", listener: () => void): unknown;\n\tremoveListener(event: \"resize\", listener: () => void): unknown;\n}\n\nexport type NodeShellSignal = \"SIGINT\" | \"SIGHUP\" | \"SIGTERM\";\n\nexport interface AttachShellOptions extends NodeShellOpenOptions {\n\tstdin?: NodeShellInput;\n\tstdout?: NodeShellOutput;\n\tstderr?: NodeShellOutput;\n\trawMode?: boolean;\n\tresize?: boolean;\n\tsignals?: readonly NodeShellSignal[];\n\tmaxPendingOutputBytes?: number;\n\tonWarning?: (message: string) => void;\n}\n\ninterface ShellDataPayload {\n\tshellId: string;\n\tdata: unknown;\n}\n\ninterface ShellExitPayload {\n\tshellId: string;\n\texitCode: number;\n}\n\ninterface ShellEventSource {\n\ton(event: string, listener: (payload: never) => void): unknown;\n\toff?(event: string, listener: (payload: never) => void): unknown;\n\tremoveListener?(event: string, listener: (payload: never) => void): unknown;\n}\n\ntype EarlyOutput = {\n\tstream: \"stdout\" | \"stderr\";\n\tpayload: ShellDataPayload;\n\tbytes: Uint8Array;\n};\n\ntype AttachOutcome =\n\t| { kind: \"exit\"; exitCode: number }\n\t| { kind: \"failure\"; error: Error }\n\t| { kind: \"signal\"; signal: NodeShellSignal; exitCode: number };\n\nexport class NodeShellOutputLimitError extends Error {\n\treadonly code = \"AGENTOS_NODE_SHELL_OUTPUT_LIMIT\";\n\n\tconstructor(\n\t\treadonly limitBytes: number,\n\t\treadonly pendingBytes: number,\n\t) {\n\t\tsuper(\n\t\t\t`AgentOS Node shell pending output exceeded ${limitBytes} bytes ` +\n\t\t\t\t`(${pendingBytes} bytes pending); raise AttachShellOptions.maxPendingOutputBytes to allow more`,\n\t\t);\n\t\tthis.name = \"NodeShellOutputLimitError\";\n\t}\n}\n\nexport class NodeShellCleanupError extends Error {\n\treadonly code = \"AGENTOS_NODE_SHELL_CLEANUP_FAILED\";\n\n\tconstructor(readonly errors: readonly Error[]) {\n\t\tsuper(\"AgentOS Node shell and cleanup both failed\");\n\t\tthis.name = \"NodeShellCleanupError\";\n\t}\n}\n\n/**\n * Open an AgentOS PTY shell and attach it to the current Node process terminal.\n * The connection must expose AgentOS shell actions and its broadcast `on()` API.\n */\nexport async function attachShell(\n\tconnection: NodeShellConnection,\n\toptions: AttachShellOptions = {},\n): Promise<number> {\n\tconst stdin = options.stdin ?? process.stdin;\n\tconst stdout = options.stdout ?? process.stdout;\n\tconst stderr = options.stderr ?? process.stderr;\n\tconst events = connection as unknown as ShellEventSource;\n\tif (typeof events.on !== \"function\") {\n\t\tthrow new TypeError(\"attachShell requires an AgentOS connection with on()\");\n\t}\n\n\tconst maxPendingOutputBytes =\n\t\toptions.maxPendingOutputBytes ?? DEFAULT_MAX_PENDING_OUTPUT_BYTES;\n\tif (\n\t\t!Number.isSafeInteger(maxPendingOutputBytes) ||\n\t\tmaxPendingOutputBytes <= 0\n\t) {\n\t\tthrow new RangeError(\n\t\t\t\"AttachShellOptions.maxPendingOutputBytes must be a positive safe integer\",\n\t\t);\n\t}\n\n\tconst warn =\n\t\toptions.onWarning ?? ((message: string) => stderr.write(`${message}\\n`));\n\tlet shellId: string | undefined;\n\tlet shellClosed = false;\n\tlet failure: Error | undefined;\n\tlet resolveFailure: ((outcome: AttachOutcome) => void) | undefined;\n\tconst failurePromise = new Promise<AttachOutcome>((resolve) => {\n\t\tresolveFailure = resolve;\n\t});\n\tconst fail = (error: Error) => {\n\t\tif (failure) return;\n\t\tfailure = error;\n\t\tresolveFailure?.({ kind: \"failure\", error });\n\t};\n\tconst earlyOutput: EarlyOutput[] = [];\n\tlet earlyOutputBytes = 0;\n\tlet earlyOutputWarned = false;\n\tlet resolveShellExit: (() => void) | undefined;\n\tconst shellExitPromise = new Promise<void>((resolve) => {\n\t\tresolveShellExit = resolve;\n\t});\n\n\tconst onShellData = (payload: ShellDataPayload) => {\n\t\trouteOutput(\"stdout\", payload);\n\t};\n\tconst onShellStderr = (payload: ShellDataPayload) => {\n\t\trouteOutput(\"stderr\", payload);\n\t};\n\tconst onShellExit = (payload: ShellExitPayload) => {\n\t\tif (shellId && payload.shellId === shellId) resolveShellExit?.();\n\t};\n\tconst unsubscribers = [\n\t\tsubscribe(events, \"shellData\", onShellData),\n\t\tsubscribe(events, \"shellStderr\", onShellStderr),\n\t\tsubscribe(events, \"shellExit\", onShellExit),\n\t];\n\n\tfunction routeOutput(\n\t\tstream: \"stdout\" | \"stderr\",\n\t\tpayload: ShellDataPayload,\n\t): void {\n\t\ttry {\n\t\t\tconst bytes = toBytes(payload.data);\n\t\t\tif (bytes.byteLength === 0) return;\n\t\t\tif (!shellId) {\n\t\t\t\tconst nextBytes = earlyOutputBytes + bytes.byteLength;\n\t\t\t\tif (nextBytes > maxPendingOutputBytes) {\n\t\t\t\t\tfail(new NodeShellOutputLimitError(maxPendingOutputBytes, nextBytes));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tearlyOutputBytes = nextBytes;\n\t\t\t\tearlyOutput.push({ stream, payload, bytes });\n\t\t\t\tif (\n\t\t\t\t\t!earlyOutputWarned &&\n\t\t\t\t\tnextBytes >=\n\t\t\t\t\t\tMath.floor(maxPendingOutputBytes * OUTPUT_LIMIT_WARNING_RATIO)\n\t\t\t\t) {\n\t\t\t\t\tearlyOutputWarned = true;\n\t\t\t\t\twarn(\n\t\t\t\t\t\t`AgentOS Node shell pending output is near its ${maxPendingOutputBytes}-byte limit ` +\n\t\t\t\t\t\t\t`(${nextBytes} bytes pending)`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (payload.shellId !== shellId) return;\n\t\t\t(stream === \"stdout\" ? stdout : stderr).write(bytes);\n\t\t} catch (error) {\n\t\t\tfail(asError(error));\n\t\t}\n\t}\n\n\tlet inputAttached = false;\n\tlet rawModeChanged = false;\n\tlet previousRawMode = false;\n\tlet inputWrite = Promise.resolve();\n\tlet inputEnded = false;\n\tlet resizeAttached = false;\n\tlet signalOutcomeResolve: ((outcome: AttachOutcome) => void) | undefined;\n\tconst signalPromise = new Promise<AttachOutcome>((resolve) => {\n\t\tsignalOutcomeResolve = resolve;\n\t});\n\tconst signalHandlers = new Map<NodeShellSignal, () => void>();\n\n\tconst onInputData = (data: string | Uint8Array) => {\n\t\tstdin.pause();\n\t\tinputWrite = inputWrite\n\t\t\t.then(async () => {\n\t\t\t\tif (shellId) await connection.writeShell(shellId, data);\n\t\t\t})\n\t\t\t.then(() => {\n\t\t\t\tif (!inputEnded) stdin.resume();\n\t\t\t})\n\t\t\t.catch((error) => fail(asError(error)));\n\t};\n\tconst onInputEnd = () => {\n\t\tinputEnded = true;\n\t\tstdin.pause();\n\t\tinputWrite = inputWrite\n\t\t\t.then(async () => {\n\t\t\t\tif (shellId) await connection.writeShell(shellId, \"\\u0004\");\n\t\t\t})\n\t\t\t.catch((error) => fail(asError(error)));\n\t};\n\tconst onInputError = (error: Error) => fail(error);\n\tconst onResize = () => {\n\t\tif (!shellId) return;\n\t\tconst cols = stdout.columns;\n\t\tconst rows = stdout.rows;\n\t\tif (!positiveInteger(cols) || !positiveInteger(rows)) return;\n\t\tvoid connection.resizeShell(shellId, cols, rows).catch((error) => {\n\t\t\tfail(asError(error));\n\t\t});\n\t};\n\n\ttry {\n\t\tconst opened = await connection.openShell({\n\t\t\tcommand: options.command,\n\t\t\targs: options.args,\n\t\t\tenv: options.env,\n\t\t\tcwd: options.cwd,\n\t\t\tcols: options.cols ?? stdout.columns,\n\t\t\trows: options.rows ?? stdout.rows,\n\t\t});\n\t\tshellId = opened.shellId;\n\t\tfor (const item of earlyOutput) {\n\t\t\tif (item.payload.shellId !== shellId) continue;\n\t\t\t(item.stream === \"stdout\" ? stdout : stderr).write(item.bytes);\n\t\t}\n\t\tearlyOutput.length = 0;\n\t\tearlyOutputBytes = 0;\n\t\tif (failure) throw failure;\n\n\t\tpreviousRawMode = Boolean(stdin.isRaw);\n\t\tif (\n\t\t\t(options.rawMode ?? true) &&\n\t\t\tstdin.isTTY &&\n\t\t\ttypeof stdin.setRawMode === \"function\" &&\n\t\t\t!previousRawMode\n\t\t) {\n\t\t\tstdin.setRawMode(true);\n\t\t\trawModeChanged = true;\n\t\t}\n\t\tstdin.on(\"data\", onInputData);\n\t\tstdin.on(\"end\", onInputEnd);\n\t\tstdin.on(\"error\", onInputError);\n\t\tstdin.resume();\n\t\tinputAttached = true;\n\n\t\tif ((options.resize ?? true) && stdout.isTTY) {\n\t\t\tstdout.on(\"resize\", onResize);\n\t\t\tresizeAttached = true;\n\t\t\tonResize();\n\t\t}\n\n\t\tfor (const signal of options.signals ?? [\"SIGINT\", \"SIGHUP\", \"SIGTERM\"]) {\n\t\t\tconst handler = () => {\n\t\t\t\tsignalOutcomeResolve?.({\n\t\t\t\t\tkind: \"signal\",\n\t\t\t\t\tsignal,\n\t\t\t\t\texitCode: signalExitCode(signal),\n\t\t\t\t});\n\t\t\t};\n\t\t\tsignalHandlers.set(signal, handler);\n\t\t\tprocess.once(signal, handler);\n\t\t}\n\n\t\tconst outcome = await Promise.race<AttachOutcome>([\n\t\t\tconnection.waitShell(shellId).then((exitCode) => ({\n\t\t\t\tkind: \"exit\" as const,\n\t\t\t\texitCode,\n\t\t\t})),\n\t\t\tfailurePromise,\n\t\t\tsignalPromise,\n\t\t]);\n\t\tif (outcome.kind === \"failure\") {\n\t\t\tawait connection.closeShell(shellId);\n\t\t\tshellClosed = true;\n\t\t\tthrow outcome.error;\n\t\t}\n\t\tif (outcome.kind === \"signal\") {\n\t\t\tawait connection.closeShell(shellId);\n\t\t\tshellClosed = true;\n\t\t\treturn outcome.exitCode;\n\t\t}\n\n\t\tawait Promise.race([\n\t\t\tshellExitPromise,\n\t\t\tnew Promise<void>((resolve) =>\n\t\t\t\tsetTimeout(resolve, TRAILING_OUTPUT_GRACE_MS),\n\t\t\t),\n\t\t]);\n\t\tawait inputWrite;\n\t\tif (failure) throw failure;\n\t\treturn outcome.exitCode;\n\t} catch (error) {\n\t\tif (shellId && !shellClosed) {\n\t\t\ttry {\n\t\t\t\tawait connection.closeShell(shellId);\n\t\t\t\tshellClosed = true;\n\t\t\t} catch (closeError) {\n\t\t\t\tthrow new NodeShellCleanupError([asError(error), asError(closeError)]);\n\t\t\t}\n\t\t}\n\t\tthrow error;\n\t} finally {\n\t\tfor (const unsubscribe of unsubscribers) unsubscribe();\n\t\tif (inputAttached) {\n\t\t\tstdin.removeListener(\"data\", onInputData);\n\t\t\tstdin.removeListener(\"end\", onInputEnd);\n\t\t\tstdin.removeListener(\"error\", onInputError);\n\t\t\tstdin.pause();\n\t\t}\n\t\tif (resizeAttached) stdout.removeListener(\"resize\", onResize);\n\t\tif (rawModeChanged) stdin.setRawMode?.(previousRawMode);\n\t\tfor (const [signal, handler] of signalHandlers) {\n\t\t\tprocess.removeListener(signal, handler);\n\t\t}\n\t}\n}\n\nfunction subscribe<TPayload>(\n\tevents: ShellEventSource,\n\tevent: string,\n\tlistener: (payload: TPayload) => void,\n): () => void {\n\tconst untypedListener = listener as (payload: never) => void;\n\tconst result = events.on(event, untypedListener);\n\tif (typeof result === \"function\") return result as () => void;\n\treturn () => {\n\t\tif (events.off) events.off(event, untypedListener);\n\t\telse events.removeListener?.(event, untypedListener);\n\t};\n}\n\nfunction toBytes(data: unknown): Uint8Array {\n\tif (data instanceof Uint8Array) return data;\n\tif (\n\t\tArray.isArray(data) &&\n\t\tdata.length === 2 &&\n\t\tdata[0] === \"$Uint8Array\" &&\n\t\ttypeof data[1] === \"string\"\n\t) {\n\t\treturn Buffer.from(data[1], \"base64\");\n\t}\n\tif (typeof data === \"string\") return Buffer.from(data, \"utf8\");\n\tthrow new TypeError(\n\t\t`Unsupported AgentOS shell data payload: ${String(data)}`,\n\t);\n}\n\nfunction positiveInteger(value: number | undefined): value is number {\n\treturn Number.isInteger(value) && (value ?? 0) > 0;\n}\n\nfunction signalExitCode(signal: NodeShellSignal): number {\n\tswitch (signal) {\n\t\tcase \"SIGHUP\":\n\t\t\treturn 129;\n\t\tcase \"SIGINT\":\n\t\t\treturn 130;\n\t\tcase \"SIGTERM\":\n\t\t\treturn 143;\n\t}\n}\n\nfunction asError(error: unknown): Error {\n\treturn error instanceof Error ? error : new Error(String(error));\n}\n"],"mappings":";;;;;AAAA,SAAS,cAAc;AAEvB,IAAM,mCAAmC,IAAI,OAAO;AACpD,IAAM,6BAA6B;AACnC,IAAM,2BAA2B;AAqF1B,IAAM,4BAAN,cAAwC,MAAM;AAAA,EAGpD,YACU,YACA,cACR;AACD;AAAA,MACC,8CAA8C,UAAU,WACnD,YAAY;AAAA,IAClB;AANS;AACA;AAJV,wBAAS,QAAO;AAUf,SAAK,OAAO;AAAA,EACb;AACD;AAEO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAGhD,YAAqB,QAA0B;AAC9C,UAAM,4CAA4C;AAD9B;AAFrB,wBAAS,QAAO;AAIf,SAAK,OAAO;AAAA,EACb;AACD;AAMA,eAAsB,YACrB,YACA,UAA8B,CAAC,GACb;AAClB,QAAM,QAAQ,QAAQ,SAAS,QAAQ;AACvC,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DELETED
@@ -1 +0,0 @@
1
- export * from '@rivetkit/react';
package/dist/react.js DELETED
@@ -1,3 +0,0 @@
1
- // src/react.ts
2
- export * from "@rivetkit/react";
3
- //# sourceMappingURL=react.js.map
package/dist/react.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/react.ts"],"sourcesContent":["/**\n * `@rivet-dev/agentos/react` — Agent OS React bindings.\n *\n * Re-exports `@rivetkit/react` (`createRivetKit`, `createRivetKitWithClient`,\n * and the hooks). Kept on its own subpath so neither React nor the client\n * bundle is pulled into server code that imports the root module.\n */\n\nexport * from \"@rivetkit/react\";\n"],"mappings":";AAQA,cAAc;","names":[]}