@rivet-dev/agentos-core 0.0.0-abc-fixes-1.d8c4d95 → 0.0.0-agent-acp-codex-session-benchmark.62b1f46

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 (128) hide show
  1. package/README.md +48 -48
  2. package/dist/agent-os.d.ts +215 -161
  3. package/dist/agent-os.js +1300 -2576
  4. package/dist/agentos-package.d.ts +27 -0
  5. package/dist/agentos-package.js +21 -0
  6. package/dist/base-filesystem.d.ts +1 -16
  7. package/dist/base-filesystem.js +1 -173
  8. package/dist/cron/cron-manager.d.ts +39 -14
  9. package/dist/cron/cron-manager.js +289 -128
  10. package/dist/cron/errors.d.ts +8 -0
  11. package/dist/cron/errors.js +16 -0
  12. package/dist/cron/index.d.ts +1 -3
  13. package/dist/cron/index.js +1 -2
  14. package/dist/cron/types.d.ts +2 -2
  15. package/dist/default-software.d.ts +8 -0
  16. package/dist/default-software.js +10 -0
  17. package/dist/filesystem-snapshot.d.ts +1 -1
  18. package/dist/filesystem-snapshot.js +1 -1
  19. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  20. package/dist/generated/AcpLimitsConfig.js +2 -0
  21. package/dist/generated/CreateVmConfig.d.ts +29 -0
  22. package/dist/generated/FsPermissionRule.d.ts +6 -0
  23. package/dist/generated/FsPermissionRule.js +1 -0
  24. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  25. package/dist/generated/FsPermissionRuleSet.js +1 -0
  26. package/dist/generated/FsPermissionScope.d.ts +3 -0
  27. package/dist/generated/FsPermissionScope.js +1 -0
  28. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  29. package/dist/generated/HttpLimitsConfig.js +2 -0
  30. package/dist/generated/JsModuleResolution.d.ts +1 -0
  31. package/dist/generated/JsModuleResolution.js +2 -0
  32. package/dist/generated/JsRuntimeConfig.d.ts +31 -0
  33. package/dist/generated/JsRuntimeConfig.js +1 -0
  34. package/dist/generated/JsRuntimeLimitsConfig.d.ts +8 -0
  35. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  36. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  37. package/dist/generated/JsRuntimePlatform.js +2 -0
  38. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  39. package/dist/generated/MountPluginDescriptor.js +2 -0
  40. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  41. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  42. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  43. package/dist/generated/PatternPermissionRule.js +1 -0
  44. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  45. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  46. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  47. package/dist/generated/PatternPermissionScope.js +1 -0
  48. package/dist/generated/PermissionMode.d.ts +1 -0
  49. package/dist/generated/PermissionMode.js +2 -0
  50. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  51. package/dist/generated/PermissionsPolicy.js +1 -0
  52. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  53. package/dist/generated/PluginLimitsConfig.js +2 -0
  54. package/dist/generated/PythonLimitsConfig.d.ts +6 -0
  55. package/dist/generated/PythonLimitsConfig.js +2 -0
  56. package/dist/generated/ResourceLimitsConfig.d.ts +25 -0
  57. package/dist/generated/ResourceLimitsConfig.js +2 -0
  58. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  59. package/dist/generated/RootFilesystemConfig.js +1 -0
  60. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  61. package/dist/generated/RootFilesystemEntry.js +1 -0
  62. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  63. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  64. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  65. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  66. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  67. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  68. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  69. package/dist/generated/RootFilesystemMode.js +2 -0
  70. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  71. package/dist/generated/ToolLimitsConfig.js +2 -0
  72. package/dist/generated/VmDnsConfig.d.ts +6 -0
  73. package/dist/generated/VmDnsConfig.js +2 -0
  74. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  75. package/dist/generated/VmLimitsConfig.js +1 -0
  76. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  77. package/dist/generated/VmListenPolicyConfig.js +2 -0
  78. package/dist/generated/WasmLimitsConfig.d.ts +7 -0
  79. package/dist/generated/WasmLimitsConfig.js +2 -0
  80. package/dist/host-dir-mount.d.ts +5 -5
  81. package/dist/host-dir-mount.js +4 -4
  82. package/dist/host-tools-zod.js +27 -7
  83. package/dist/host-tools.d.ts +2 -9
  84. package/dist/host-tools.js +0 -18
  85. package/dist/index.d.ts +7 -4
  86. package/dist/index.js +6 -4
  87. package/dist/layers.d.ts +3 -3
  88. package/dist/layers.js +19 -10
  89. package/dist/memory-filesystem.d.ts +39 -0
  90. package/dist/memory-filesystem.js +375 -0
  91. package/dist/options-schema.d.ts +452 -0
  92. package/dist/options-schema.js +269 -0
  93. package/dist/overlay-filesystem.d.ts +1 -1
  94. package/dist/overlay-filesystem.js +3 -3
  95. package/dist/packages.d.ts +10 -123
  96. package/dist/packages.js +3 -329
  97. package/dist/runtime.d.ts +41 -184
  98. package/dist/sidecar/agentos-protocol.d.ts +232 -29
  99. package/dist/sidecar/agentos-protocol.js +456 -120
  100. package/dist/sidecar/binary.d.ts +2 -2
  101. package/dist/sidecar/binary.js +2 -2
  102. package/dist/sidecar/native-process-client.d.ts +5 -3
  103. package/dist/sidecar/native-process-client.js +5 -3
  104. package/dist/sidecar/permissions.d.ts +4 -3
  105. package/dist/sidecar/permissions.js +6 -23
  106. package/dist/sidecar/rpc-client.d.ts +74 -86
  107. package/dist/sidecar/rpc-client.js +422 -1418
  108. package/dist/test/file-system.d.ts +1 -1
  109. package/dist/test/file-system.js +3 -1
  110. package/dist/test/runtime.d.ts +2 -3
  111. package/dist/test/runtime.js +1 -1
  112. package/dist/test/terminal-harness.d.ts +5 -4
  113. package/dist/test/terminal-harness.js +12 -7
  114. package/dist/types.d.ts +12 -5
  115. package/package.json +37 -41
  116. package/dist/agents.d.ts +0 -63
  117. package/dist/agents.js +0 -42
  118. package/dist/cron/parse-schedule.d.ts +0 -25
  119. package/dist/cron/parse-schedule.js +0 -66
  120. package/dist/cron/schedule-driver.d.ts +0 -19
  121. package/dist/cron/timer-driver.d.ts +0 -17
  122. package/dist/cron/timer-driver.js +0 -61
  123. package/dist/runtime-compat.d.ts +0 -475
  124. package/dist/runtime-compat.js +0 -2010
  125. package/dist/sidecar/cargo.d.ts +0 -2
  126. package/dist/sidecar/cargo.js +0 -142
  127. package/fixtures/AGENTOS_SYSTEM_PROMPT.md +0 -21
  128. /package/dist/{cron/schedule-driver.js → generated/CreateVmConfig.js} +0 -0
package/README.md CHANGED
@@ -9,8 +9,8 @@ Agents run inside isolated VMs with their own filesystem, process table, and net
9
9
  - **VM lifecycle** — create, configure, and dispose isolated virtual machines
10
10
  - **Sidecar placement** — reuse the default shared sidecar or inject an explicit sidecar handle
11
11
  - **Agent sessions (ACP)** — launch coding agents (Pi, Pi CLI, OpenCode, Claude) via JSON-RPC over stdio
12
- - **Filesystem operations** — read, write, mkdir, stat, move, delete, recursive listing, batch read/write
13
- - **Process management** — spawn, exec, stop, kill processes; inspect process trees across all runtimes
12
+ - **Filesystem operations** — read, write, mkdir, stat, move, delete, and recursive listing
13
+ - **Process management** — spawn, exec, stop, and kill processes; inspect the kernel process table
14
14
  - **Agent registry** — discover available agents and their installation status
15
15
  - **Networking** — reach services running inside the VM via `fetch()`
16
16
  - **Shell access** — open interactive shells with PTY support
@@ -19,26 +19,37 @@ Agents run inside isolated VMs with their own filesystem, process table, and net
19
19
  ## Quick Start
20
20
 
21
21
  ```bash
22
- npm install @rivet-dev/agentos-core
23
- # Install an agent adapter + its underlying agent
24
- npm install @agentos-software/pi @mariozechner/pi-coding-agent
22
+ npm install @rivet-dev/agentos-core @agentos-software/pi
25
23
  ```
26
24
 
27
25
  ```typescript
26
+ import pi from "@agentos-software/pi";
28
27
  import { AgentOs } from "@rivet-dev/agentos-core";
29
28
 
30
- // 1. Create a VM
31
- const vm = await AgentOs.create();
32
-
33
- // 2. Create an agent session
34
- const { sessionId } = await vm.createSession("pi");
35
-
36
- // 3. Send a prompt
37
- const response = await vm.prompt(sessionId, "Write a hello world in TypeScript");
38
-
39
- // 4. Clean up
40
- vm.closeSession(sessionId);
41
- await vm.dispose();
29
+ const apiKey = process.env.ANTHROPIC_API_KEY;
30
+ if (!apiKey) {
31
+ throw new Error("ANTHROPIC_API_KEY is required");
32
+ }
33
+
34
+ const vm = await AgentOs.create({ software: [pi] });
35
+
36
+ try {
37
+ const { sessionId } = await vm.createSession("pi", {
38
+ env: { ANTHROPIC_API_KEY: apiKey },
39
+ });
40
+
41
+ try {
42
+ const { text } = await vm.prompt(
43
+ sessionId,
44
+ "Write a hello world in TypeScript",
45
+ );
46
+ console.log(text);
47
+ } finally {
48
+ await vm.closeSession(sessionId);
49
+ }
50
+ } finally {
51
+ await vm.dispose();
52
+ }
42
53
  ```
43
54
 
44
55
  ## API Reference
@@ -66,8 +77,6 @@ await vm.dispose();
66
77
  |--------|-----------|-------------|
67
78
  | `readFile` | `readFile(path: string): Promise<Uint8Array>` | Read a file |
68
79
  | `writeFile` | `writeFile(path: string, content: string \| Uint8Array): Promise<void>` | Write a file |
69
- | `readFiles` | `readFiles(paths: string[]): Promise<BatchReadResult[]>` | Batch read multiple files |
70
- | `writeFiles` | `writeFiles(entries: BatchWriteEntry[]): Promise<BatchWriteResult[]>` | Batch write multiple files (creates parent dirs) |
71
80
  | `mkdir` | `mkdir(path: string): Promise<void>` | Create a directory |
72
81
  | `readdir` | `readdir(path: string): Promise<string[]>` | List directory entries |
73
82
  | `readdirRecursive` | `readdirRecursive(path: string, options?: ReaddirRecursiveOptions): Promise<DirEntry[]>` | Recursively list directory contents with metadata |
@@ -83,13 +92,12 @@ await vm.dispose();
83
92
  | Method | Signature | Description |
84
93
  |--------|-----------|-------------|
85
94
  | `exec` | `exec(command: string, options?: ExecOptions): Promise<ExecResult>` | Execute a shell command and wait for completion |
86
- | `spawn` | `spawn(command: string, args: string[], options?: SpawnOptions): { pid: number }` | Spawn a long-running process |
87
- | `listProcesses` | `listProcesses(): SpawnedProcessInfo[]` | List processes started via `spawn()` |
88
- | `allProcesses` | `allProcesses(): ProcessInfo[]` | List all kernel processes across all runtimes |
89
- | `processTree` | `processTree(): ProcessTreeNode[]` | Get processes organized as a parent-child tree |
90
- | `getProcess` | `getProcess(pid: number): SpawnedProcessInfo` | Get info about a specific spawned process |
91
- | `stopProcess` | `stopProcess(pid: number): void` | Send SIGTERM to a process |
92
- | `killProcess` | `killProcess(pid: number): void` | Send SIGKILL to a process |
95
+ | `spawn` | `spawn(command: string, args: string[], options?: SpawnOptions): Promise<{ pid: number }>` | Spawn a long-running process and return its kernel PID |
96
+ | `listProcesses` | `listProcesses(): Promise<SpawnedProcessInfo[]>` | List processes started via `spawn()` from a fresh sidecar snapshot |
97
+ | `allProcesses` | `allProcesses(): Promise<ProcessInfo[]>` | List all kernel processes across all runtimes |
98
+ | `getProcess` | `getProcess(pid: number): Promise<SpawnedProcessInfo>` | Get sidecar-authoritative info about a specific spawned process |
99
+ | `stopProcess` | `stopProcess(pid: number): Promise<void>` | Send SIGTERM and await the sidecar result |
100
+ | `killProcess` | `killProcess(pid: number): Promise<void>` | Send SIGKILL and await the sidecar result |
93
101
 
94
102
  ### Network
95
103
 
@@ -101,20 +109,19 @@ await vm.dispose();
101
109
 
102
110
  | Method | Signature | Description |
103
111
  |--------|-----------|-------------|
104
- | `connectTerminal` | `connectTerminal(options?: ConnectTerminalOptions): Promise<number>` | Attach a shell directly to the host terminal and wait for exit |
105
- | `openShell` | `openShell(options?: OpenShellOptions): { shellId: string }` | Open an interactive shell with PTY support |
106
- | `writeShell` | `writeShell(shellId: string, data: string \| Uint8Array): void` | Write data to a shell's PTY input |
112
+ | `openShell` | `openShell(options?: OpenShellOptions): Promise<{ shellId: string }>` | Open an interactive shell with PTY support |
113
+ | `writeShell` | `writeShell(shellId: string, data: string \| Uint8Array): Promise<void>` | Write data to a shell's PTY input |
107
114
  | `onShellData` | `onShellData(shellId: string, handler: (data: Uint8Array) => void): () => void` | Subscribe to shell output data |
108
- | `resizeShell` | `resizeShell(shellId: string, cols: number, rows: number): void` | Notify terminal resize |
109
- | `closeShell` | `closeShell(shellId: string): void` | Kill the shell process |
115
+ | `resizeShell` | `resizeShell(shellId: string, cols: number, rows: number): Promise<void>` | Notify terminal resize and await the sidecar response |
116
+ | `closeShell` | `closeShell(shellId: string): Promise<void>` | Kill the shell process and await the sidecar response |
110
117
 
111
118
  ### Agent Sessions
112
119
 
113
120
  | Method | Signature | Description |
114
121
  |--------|-----------|-------------|
115
- | `createSession` | `createSession(agentType: AgentType \| string, options?: CreateSessionOptions): Promise<{ sessionId: string }>` | Launch an agent and return a session ID |
116
- | `listSessions` | `listSessions(): SessionInfo[]` | List active sessions |
117
- | `destroySession` | `destroySession(sessionId: string): Promise<void>` | Gracefully cancel and close a session |
122
+ | `createSession` | `createSession(agentType: AgentType, options?: CreateSessionOptions): Promise<{ sessionId: string }>` | Launch an agent and return a session ID |
123
+ | `listSessions` | `listSessions(): Promise<SessionInfo[]>` | List active sessions |
124
+ | `destroySession` | `destroySession(sessionId: string): Promise<void>` | Ask the sidecar to gracefully close a session |
118
125
 
119
126
  ### Agent Registry
120
127
 
@@ -128,15 +135,15 @@ await vm.dispose();
128
135
  |--------|-----------|-------------|
129
136
  | `prompt` | `prompt(sessionId: string, text: string): Promise<PromptResult>` | Send a prompt and collect the agent text |
130
137
  | `cancelSession` | `cancelSession(sessionId: string): Promise<JsonRpcResponse>` | Cancel ongoing agent work |
131
- | `closeSession` | `closeSession(sessionId: string): void` | Kill the agent process and clean up |
138
+ | `closeSession` | `closeSession(sessionId: string): Promise<void>` | Kill the agent process and clean up |
132
139
  | `onSessionEvent` | `onSessionEvent(sessionId: string, handler: SessionEventHandler): () => void` | Subscribe to session update notifications |
133
140
  | `onPermissionRequest` | `onPermissionRequest(sessionId: string, handler: PermissionRequestHandler): () => void` | Subscribe to permission requests |
134
141
  | `respondPermission` | `respondPermission(sessionId: string, permissionId: string, reply: PermissionReply): Promise<JsonRpcResponse>` | Reply to a permission request |
135
142
  | `setSessionMode` | `setSessionMode(sessionId: string, modeId: string): Promise<JsonRpcResponse>` | Set the session mode |
136
- | `getSessionModes` | `getSessionModes(sessionId: string): SessionModeState \| null` | Get available modes |
143
+ | `getSessionModes` | `getSessionModes(sessionId: string): Promise<SessionModeState \| null>` | Get available modes from the sidecar |
137
144
  | `setSessionModel` | `setSessionModel(sessionId: string, model: string): Promise<JsonRpcResponse>` | Set the model |
138
145
  | `setSessionThoughtLevel` | `setSessionThoughtLevel(sessionId: string, level: string): Promise<JsonRpcResponse>` | Set reasoning level |
139
- | `getSessionConfigOptions` | `getSessionConfigOptions(sessionId: string): SessionConfigOption[]` | Get available config options |
146
+ | `getSessionConfigOptions` | `getSessionConfigOptions(sessionId: string): Promise<SessionConfigOption[]>` | Get available config options from the sidecar |
140
147
  | `rawSend` | `rawSend(sessionId: string, method: string, params?: Record<string, unknown>): Promise<JsonRpcResponse>` | Send an arbitrary ACP request |
141
148
 
142
149
  ### Exported Types
@@ -157,10 +164,7 @@ await vm.dispose();
157
164
  - `MountConfigCustom` — Caller-provided VirtualFileSystem
158
165
  - `NativeMountConfig` — Declarative sidecar mount plugin configuration
159
166
  - `MountConfigOverlay` — Copy-on-write overlay (lower + upper layers)
160
-
161
- **Companion Filesystem Packages**
162
- - `createGoogleDriveBackend()` — Declarative Google Drive native mount helper from `@secure-exec/google-drive`
163
- - `createS3Backend()` — Declarative S3-compatible native mount helper from `@secure-exec/s3`
167
+ - `chunkedS3MountPlugin()` — Declarative S3-compatible native mount plugin descriptor (from `@rivet-dev/agentos-runtime-core/descriptors`)
164
168
 
165
169
  **MCP Servers**
166
170
  - `McpServerConfig` — Union of local and remote MCP configs
@@ -170,18 +174,14 @@ await vm.dispose();
170
174
  **Process**
171
175
  - `ProcessInfo` — Kernel process info (pid, ppid, pgid, sid, driver, command, args, cwd, status, exitCode, startTime, exitTime)
172
176
  - `SpawnedProcessInfo` — Info for processes created via `spawn()` (pid, command, args, running, exitCode)
173
- - `ProcessTreeNode` — ProcessInfo with `children: ProcessTreeNode[]`
174
177
 
175
178
  **Filesystem**
176
179
  - `DirEntry` — Directory entry (path, type, size)
177
- - `ReaddirRecursiveOptions` — Options for recursive listing (maxDepth, exclude)
178
- - `BatchWriteEntry` — Entry for batch writes (path, content)
179
- - `BatchWriteResult` — Result of a batch write (path, success, error?)
180
- - `BatchReadResult` — Result of a batch read (path, content, error?)
180
+ - `ReaddirRecursiveOptions` — Options for recursive listing (maxDepth)
181
181
 
182
182
  **Agent**
183
- - `AgentType` — `"pi" | "pi-cli" | "opencode" | "claude"`
184
- - `AgentConfig` — Agent configuration (acpAdapter, agentPackage, prepareInstructions)
183
+ - `AgentType` — `string` (a package manifest `name`, e.g. `"pi"`, `"claude"`); agents are resolved dynamically from the configured `/opt/agentos` package manifests, so any manifest `name` is valid
184
+ - `AgentConfig` — Agent configuration (adapterEntrypoint, launchArgs, defaultEnv)
185
185
  - `AgentRegistryEntry` — Registry entry (id, acpAdapter, agentPackage, installed)
186
186
 
187
187
  **Session**