@rivet-dev/agentos 0.2.16-rc.1 → 0.2.16-rc.2

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 (24) hide show
  1. package/assets/inspector-tabs-app/assets/__vite-browser-external-2447137e-BIHI7g3E.js +1 -0
  2. package/assets/inspector-tabs-app/assets/filesystem-DQPPvVO9.js +1 -0
  3. package/assets/inspector-tabs-app/assets/hooks-CdZ_23e1.js +1 -0
  4. package/assets/inspector-tabs-app/assets/index-CvS46tYl.js +110 -0
  5. package/assets/inspector-tabs-app/assets/index-DG_s1YoH.css +1 -0
  6. package/assets/inspector-tabs-app/assets/scroll-area-D0TYc2jF.js +1 -0
  7. package/assets/inspector-tabs-app/assets/system-C1DTBU1d.js +2 -0
  8. package/assets/inspector-tabs-app/assets/terminal-DhW76lRS.js +13 -0
  9. package/assets/inspector-tabs-app/assets/transcript-OolSpSiF.js +1 -0
  10. package/assets/inspector-tabs-app/assets/{useSuspenseQuery-BXmNSEVQ.js → useSuspenseQuery-j2bgzu1R.js} +1 -1
  11. package/assets/inspector-tabs-app/assets/vm-boot-gate-DG5U7SkD.js +1 -0
  12. package/assets/inspector-tabs-app/assets/vm-status-badges-CKabwPpS.js +5 -0
  13. package/assets/inspector-tabs-app/index.html +2 -2
  14. package/dist/index.d.ts +45 -2
  15. package/dist/index.js +335 -18
  16. package/dist/index.js.map +1 -1
  17. package/package.json +5 -4
  18. package/assets/inspector-tabs-app/assets/filesystem-Ce_1E-AG.js +0 -1
  19. package/assets/inspector-tabs-app/assets/index-AMqbzdhN.js +0 -126
  20. package/assets/inspector-tabs-app/assets/index-tcfmhW06.css +0 -1
  21. package/assets/inspector-tabs-app/assets/system-AIh54aFR.js +0 -2
  22. package/assets/inspector-tabs-app/assets/transcript-D07sAUKE.js +0 -1
  23. package/assets/inspector-tabs-app/assets/vm-boot-gate-CzDOFOZU.js +0 -1
  24. package/assets/inspector-tabs-app/assets/vm-status-badges-CnUikLsX.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos",
3
- "version": "0.2.16-rc.1",
3
+ "version": "0.2.16-rc.2",
4
4
  "description": "The AgentOS actor and orchestration SDK.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -65,9 +65,10 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@agentclientprotocol/sdk": "0.16.1",
68
- "@agentos-software/common": "0.2.16-rc.1",
69
- "@rivet-dev/agentos-core": "0.2.16-rc.1",
68
+ "@agentos-software/common": "0.2.16-rc.2",
69
+ "@rivet-dev/agentos-core": "0.2.16-rc.2",
70
70
  "@rivetkit/react": "2.3.9",
71
+ "ghostty-web": "^0.4.0",
71
72
  "rivetkit": "2.3.9",
72
73
  "zod": "^4.1.11"
73
74
  },
@@ -85,9 +86,9 @@
85
86
  },
86
87
  "devDependencies": {
87
88
  "@agentos-software/coreutils": "0.3.4",
88
- "@rivet-dev/agentos-test-harness": "0.2.16-rc.1",
89
89
  "@radix-ui/react-collapsible": "^1.1.2",
90
90
  "@radix-ui/react-scroll-area": "^1.2.2",
91
+ "@rivet-dev/agentos-test-harness": "0.2.16-rc.2",
91
92
  "@tanstack/react-query": "^5.87.1",
92
93
  "@types/node": "^22.19.15",
93
94
  "@types/react": "^19.0.0",
@@ -1 +0,0 @@
1
- import{j as e,r as w,u as V,b as R,a as j,I as h,R as Q,F as T,U as K,o as M,A as z,d as k,p as U,i as W,g as P,q as C,h as _,f as q,D as G,s as J,t as X,T as H}from"./index-AMqbzdhN.js";import{V as Y,u as Z,a as A,b as ee,c as te}from"./vm-boot-gate-CzDOFOZU.js";import{S as B,V as se}from"./vm-status-badges-CnUikLsX.js";const re=/\.(png|jpe?g|gif|webp|svg|ico|bmp|avif)$/i;function I({actorId:s,entry:t,depth:n,selectedPath:l,onSelect:p,openPaths:d,onToggle:f}){const o=d.has(t.path),u=t.path===l,a=t.dir&&!t.virtual,x=R(j.listDirQueryOptions(s,t.path,a&&o));return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",style:{paddingLeft:`${n*12}px`},children:[e.jsx("button",{type:"button",onClick:()=>a&&f(t.path),className:P("flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-muted/50",!a&&"pointer-events-none opacity-0"),disabled:!a,children:e.jsx(W,{className:P("size-3 transition-transform",o&&"rotate-90")})}),e.jsxs("button",{type:"button",onClick:()=>{a&&f(t.path),p(t)},className:P("flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1 text-left text-sm",u?"bg-muted text-foreground":"hover:bg-muted/50"),children:[e.jsx(U,{dir:t.dir,className:"size-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"flex-1 truncate",children:t.name}),t.symlink?e.jsx("span",{title:"Symbolic link (not followed)",className:"shrink-0 font-mono text-[10px] text-muted-foreground/50",children:"→"}):null,!t.dir&&t.size!=null?e.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-muted-foreground/60",children:C(t.size)}):null]})]}),a&&o?(x.data??[]).map(y=>e.jsx(I,{actorId:s,entry:y,depth:n+1,selectedPath:l,onSelect:p,openPaths:d,onToggle:f},y.path)):null]})}function ne(s,t){const n=URL.createObjectURL(new Blob([s])),l=document.createElement("a");l.href=n,l.download=t,l.click(),URL.revokeObjectURL(n)}const E=s=>({path:s,force:!1,renameDraft:null,error:null});function ae({actorId:s,path:t,onMutated:n,onDeleted:l,onRenamed:p}){const[d,f]=w.useState(()=>E(t));d.path!==t&&f(E(t));const o=d.path===t?d:E(t),u=c=>f(r=>({...r,...c})),{data:a,error:x}=R(j.fileContentQueryOptions(s,t,o.force)),y=!!(a!=null&&a.bytes)&&a.text===null&&re.test(a.path),b=ee(y?a==null?void 0:a.bytes:null),{armed:g,confirm:m}=te({resetKey:t});if(!t)return e.jsx(k,{children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx(_,{className:"w-44"}),e.jsx("span",{children:"Select a file to view its contents."})]})});if(x)return e.jsx(z,{error:x,className:"items-center justify-center text-center"});if(!a)return e.jsxs(k,{children:["Loading ",t,"…"]});const N=a.path.split("/").pop()??a.path,D=async()=>{var r;const c=(r=o.renameDraft)==null?void 0:r.trim();if(!c||c===a.path){u({renameDraft:null});return}u({error:null});try{await j.moveEntry(a.path,c),u({renameDraft:null}),p(c),n()}catch(i){u({error:i})}},v=async()=>{u({error:null});try{await j.deleteFile(a.path,{}),l(),n()}catch(c){u({error:c})}};return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-2.5",children:[o.renameDraft!==null?e.jsx("input",{value:o.renameDraft,onChange:c=>u({renameDraft:c.target.value}),onKeyDown:c=>{c.key==="Enter"&&D(),c.key==="Escape"&&u({renameDraft:null})},spellCheck:!1,autoFocus:!0,"aria-label":"New path",className:"min-w-0 flex-1 rounded border bg-background px-2 py-1 font-mono text-xs focus:outline-none"}):e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:a.path}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:C(a.sizeBytes)}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:q(a.mtimeMs)}),e.jsx(h,{title:a.bytes?"Download this file":"Load the file first",disabled:!a.bytes,onClick:()=>a.bytes&&ne(a.bytes,N),children:e.jsx(G,{className:"size-3.5"})}),e.jsx(h,{title:o.renameDraft!==null?"Save new name":"Rename this file",onClick:()=>o.renameDraft!==null?void D():u({renameDraft:a.path}),children:o.renameDraft!==null?e.jsx(J,{className:"size-3.5"}):e.jsx(X,{className:"size-3.5"})}),g==="delete"?e.jsx("button",{type:"button",onClick:()=>m("delete",()=>void v()),className:"shrink-0 rounded border border-destructive/50 px-2 py-1 text-xs text-destructive transition-colors hover:bg-destructive/10",children:"Confirm delete?"}):e.jsx(h,{title:"Delete this file",destructive:!0,onClick:()=>m("delete",()=>void v()),children:e.jsx(H,{className:"size-3.5"})})]}),o.error?e.jsx(z,{error:o.error,className:"border-b py-2"}):null,e.jsx(B,{className:"min-h-0 flex-1",children:a.special?e.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center text-sm text-muted-foreground",children:"Device or stream — no readable contents."}):a.oversize?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center text-sm text-muted-foreground",children:[e.jsxs("span",{children:["Large file (",C(a.sizeBytes),") — preview skipped to avoid dragging it through the gateway."]}),e.jsx("button",{type:"button",onClick:()=>u({force:!0}),className:"rounded border px-2.5 py-1 text-xs transition-colors hover:bg-muted hover:text-foreground",children:"Load anyway"})]}):a.text===null?b?e.jsx("div",{className:"flex items-start justify-center p-4",children:e.jsx("img",{src:b,alt:N,className:"max-w-full rounded border"})}):e.jsxs("div",{className:"flex h-full items-center justify-center p-8 text-center text-sm text-muted-foreground",children:["Binary file (",C(a.sizeBytes),") — use Download to save it."]}):e.jsx("pre",{className:"whitespace-pre-wrap break-words p-4 font-mono text-xs leading-relaxed",children:a.text})})]})}function F(s){const t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function S(s){let t=s.trim();return t===""?"/":(t.startsWith("/")||(t=`/${t}`),t=t.replace(/\/+/g,"/"),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t)}const L=(s,t)=>s==="/"?`/${t}`:`${s}/${t}`;function me({actorId:s}){return e.jsx(Y,{actorId:s,note:"VM not booted.",actionLabel:"Boot the VM and browse files",children:e.jsx(ce,{actorId:s})})}const $=s=>`agentos-inspector:fs:${s}`,oe=200;function le(s){try{const t=sessionStorage.getItem($(s));if(t){const n=JSON.parse(t);return{root:typeof n.root=="string"?n.root:"/",selectedPath:typeof n.selectedPath=="string"?n.selectedPath:null,openPaths:Array.isArray(n.openPaths)?n.openPaths.filter(l=>typeof l=="string"):[]}}}catch{}return{root:"/",selectedPath:null,openPaths:[]}}function ie(s,t){switch(t.type){case"type":return{...s,draft:t.value};case"commitDraft":{const n=S(s.draft);return n===s.root&&n===s.draft?s:{...s,root:n,draft:n}}case"commitDebounced":{const n=S(s.draft);return n===s.root?s:{...s,root:n}}case"goUp":{const n=F(S(s.draft));return{...s,root:n,draft:n}}case"openDir":return{...s,draft:t.path};case"selectFile":return{...s,selectedPath:t.path,draft:F(t.path)};case"reselect":return{...s,selectedPath:t.path};case"toggleOpen":{const n=new Set(s.openPaths);if(n.has(t.path))n.delete(t.path);else if(n.add(t.path),n.size>oe){const l=n.values().next().value;l!==void 0&&n.delete(l)}return{...s,openPaths:n}}}}function ce({actorId:s}){const[{root:t,draft:n,selectedPath:l,openPaths:p},d]=w.useReducer(ie,s,r=>{const i=le(r);return{root:i.root,draft:i.root,selectedPath:i.selectedPath,openPaths:new Set(i.openPaths)}});w.useEffect(()=>{try{sessionStorage.setItem($(s),JSON.stringify({root:t,selectedPath:l,openPaths:[...p]}))}catch(r){console.warn("agentos inspector: failed to persist filesystem state",r)}},[s,t,l,p]);const[f,o]=w.useState(null),u=w.useRef(null),a=V(),x=R(j.listDirQueryOptions(s,t)),y=x.data===null,b=x.data??[];Z(n,500,()=>d({type:"commitDebounced"}));const g=()=>a.invalidateQueries({queryKey:["agent-os",s,"dir"]}),m=S(n),N=A({mutationFn:r=>j.mkdir(r.startsWith("/")?r:L(m,r)),onSuccess:async()=>{o(null),await g()}}),D=()=>{const r=f==null?void 0:f.trim();if(!r){o(null);return}N.mutate(r)},v=A({mutationFn:async r=>{const i=new Uint8Array(await r.arrayBuffer());await j.writeFile(L(m,r.name),i)},onSuccess:()=>g()}),c=N.error??v.error;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 gap-1 px-3 pb-1 pt-2.5",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Files"}),e.jsx("span",{className:"ml-auto"}),e.jsx(h,{title:"Refresh the tree",onClick:()=>void g(),children:e.jsx(Q,{className:"size-3.5"})}),e.jsx(h,{title:`New folder under ${m}`,onClick:()=>o(r=>r===null?"":null),children:e.jsx(T,{className:"size-3.5"})}),e.jsx(h,{title:`Upload a file into ${m}`,onClick:()=>{var r;return(r=u.current)==null?void 0:r.click()},children:e.jsx(K,{className:"size-3.5"})}),e.jsx("input",{ref:u,type:"file",className:"hidden",onChange:r=>{var O;const i=(O=r.target.files)==null?void 0:O[0];r.target.value="",i&&v.mutate(i)}})]}),e.jsxs("div",{className:"flex items-center gap-1 border-b px-3 pb-1.5",children:[e.jsx(h,{title:m==="/"?"Already at the root":`Up to ${F(m)}`,disabled:m==="/",onClick:()=>d({type:"goUp"}),className:"size-5",children:e.jsx(M,{className:"size-3.5"})}),e.jsx("input",{value:n,onChange:r=>d({type:"type",value:r.target.value}),onKeyDown:r=>{r.key==="Enter"&&d({type:"commitDraft"})},spellCheck:!1,autoComplete:"off","aria-label":"Root directory",placeholder:"/",className:"w-full bg-transparent font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:text-foreground"})]}),f!==null?e.jsx("div",{className:"border-b px-3 py-1.5",children:e.jsx("input",{value:f,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&D(),r.key==="Escape"&&o(null)},spellCheck:!1,autoFocus:!0,"aria-label":"New folder name",placeholder:`folder name (created under ${m})`,className:"w-full rounded border bg-background px-2 py-1 font-mono text-xs focus:outline-none"})}):null,c?e.jsx(z,{error:c,className:"border-b py-2"}):null,e.jsx(B,{className:"min-h-0 flex-1 p-2",children:x.isLoading?e.jsxs(k,{children:["Loading ",t,"…"]}):x.error?e.jsx(z,{error:x.error}):y?e.jsxs(k,{children:["Not a directory, or does not exist: ",t]}):b.length===0?e.jsx(k,{children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(U,{dir:!0,className:"size-8 text-muted-foreground/40"}),e.jsx("span",{children:"Empty directory."})]})}):b.map(r=>e.jsx(I,{actorId:s,entry:r,depth:0,selectedPath:l,onSelect:i=>d(i.dir?{type:"openDir",path:i.path}:{type:"selectFile",path:i.path}),openPaths:p,onToggle:i=>d({type:"toggleOpen",path:i})},r.path))})]}),e.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1",children:[e.jsx("div",{className:"absolute right-3 top-11 z-10",children:e.jsx(se,{actorId:s})}),e.jsx(ae,{actorId:s,path:l,onMutated:()=>void g(),onDeleted:()=>d({type:"reselect",path:null}),onRenamed:r=>d({type:"reselect",path:r})})]})]})}export{me as FilesystemTabConnected};