@rivet-dev/agentos-core 0.2.8-rc.2 → 0.2.8-rc.4
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/README.md +40 -37
- package/dist/agent-os.d.ts +184 -230
- package/dist/agent-os.js +751 -1158
- package/dist/agentos-package.d.ts +5 -3
- package/dist/agentos-package.js +5 -2
- package/dist/{host-tools-zod.d.ts → bindings-zod.d.ts} +1 -1
- package/dist/{host-tools-zod.js → bindings-zod.js} +27 -20
- package/dist/bindings.d.ts +43 -0
- package/dist/bindings.js +34 -0
- package/dist/cron/cron-manager.js +43 -10
- package/dist/cron/index.d.ts +1 -1
- package/dist/cron/types.d.ts +25 -9
- package/dist/filesystem-snapshot.d.ts +1 -2
- package/dist/filesystem-snapshot.js +0 -43
- package/dist/generated/AcpLimitsConfig.d.ts +16 -0
- package/dist/generated/BindingLimitsConfig.d.ts +10 -0
- package/dist/generated/CreateVmConfig.d.ts +2 -0
- package/dist/generated/ProcessLimitsConfig.d.ts +7 -0
- package/dist/generated/ProcessLimitsConfig.js +2 -0
- package/dist/generated/VmGroupConfig.d.ts +5 -0
- package/dist/generated/VmGroupConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +4 -2
- package/dist/generated/VmUserAccountConfig.d.ts +9 -0
- package/dist/generated/VmUserAccountConfig.js +2 -0
- package/dist/generated/VmUserConfig.d.ts +19 -0
- package/dist/generated/WasmLimitsConfig.d.ts +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -5
- package/dist/layers.d.ts +5 -2
- package/dist/layers.js +0 -185
- package/dist/options-schema.d.ts +133 -31
- package/dist/options-schema.js +143 -26
- package/dist/runtime-compat.d.ts +4 -35
- package/dist/runtime-compat.js +84 -372
- package/dist/runtime.d.ts +3 -1
- package/dist/sandbox.d.ts +4 -4
- package/dist/sandbox.js +4 -4
- package/dist/session-api.d.ts +180 -0
- package/dist/session-api.js +1 -0
- package/dist/sidecar/agentos-protocol.d.ts +429 -29
- package/dist/sidecar/agentos-protocol.js +691 -93
- package/dist/sidecar/rpc-client.d.ts +18 -6
- package/dist/sidecar/rpc-client.js +66 -18
- package/dist/test/runtime.d.ts +2 -1
- package/dist/test/runtime.js +2 -1
- package/dist/types.d.ts +4 -5
- package/package.json +28 -27
- package/dist/agent-session-types.d.ts +0 -67
- package/dist/generated/ToolLimitsConfig.d.ts +0 -10
- package/dist/host-tools.d.ts +0 -45
- package/dist/host-tools.js +0 -35
- package/dist/overlay-filesystem.d.ts +0 -19
- package/dist/overlay-filesystem.js +0 -645
- /package/dist/generated/{ToolLimitsConfig.js → BindingLimitsConfig.js} +0 -0
- /package/dist/{agent-session-types.js → generated/VmUserConfig.js} +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Agents run inside isolated VMs with their own filesystem, process table, and net
|
|
|
8
8
|
|
|
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
|
-
- **Agent sessions (ACP)** — launch coding agents (Pi,
|
|
11
|
+
- **Agent sessions (ACP)** — launch coding agents (Pi, OpenCode, Claude) via JSON-RPC over stdio
|
|
12
12
|
- **Filesystem operations** — read, write, mkdir, stat, move, delete, recursive listing, batch read/write
|
|
13
13
|
- **Process management** — spawn, exec, stop, kill processes; inspect process trees across all runtimes
|
|
14
14
|
- **Agent registry** — discover available agents and their installation status
|
|
@@ -21,7 +21,7 @@ Agents run inside isolated VMs with their own filesystem, process table, and net
|
|
|
21
21
|
```bash
|
|
22
22
|
npm install @rivet-dev/agentos-core
|
|
23
23
|
# Install an agent adapter + its underlying agent
|
|
24
|
-
npm install @agentos-software/pi
|
|
24
|
+
npm install @agentos-software/pi
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
@@ -30,14 +30,16 @@ import { AgentOs } from "@rivet-dev/agentos-core";
|
|
|
30
30
|
// 1. Create a VM
|
|
31
31
|
const vm = await AgentOs.create();
|
|
32
32
|
|
|
33
|
-
// 2. Create
|
|
34
|
-
|
|
33
|
+
// 2. Create the default agent session
|
|
34
|
+
await vm.openSession({ agent: "pi" });
|
|
35
35
|
|
|
36
36
|
// 3. Send a prompt
|
|
37
|
-
const response = await vm.prompt(
|
|
37
|
+
const response = await vm.prompt({
|
|
38
|
+
content: [{ type: "text", text: "Write a hello world in TypeScript" }],
|
|
39
|
+
});
|
|
38
40
|
|
|
39
41
|
// 4. Clean up
|
|
40
|
-
vm.
|
|
42
|
+
await vm.deleteSession();
|
|
41
43
|
await vm.dispose();
|
|
42
44
|
```
|
|
43
45
|
|
|
@@ -70,13 +72,16 @@ await vm.dispose();
|
|
|
70
72
|
| `writeFiles` | `writeFiles(entries: BatchWriteEntry[]): Promise<BatchWriteResult[]>` | Batch write multiple files (creates parent dirs) |
|
|
71
73
|
| `mkdir` | `mkdir(path: string): Promise<void>` | Create a directory |
|
|
72
74
|
| `readdir` | `readdir(path: string): Promise<string[]>` | List directory entries |
|
|
75
|
+
| `readdirEntries` | `readdirEntries(path: string): Promise<ReaddirEntry[]>` | List immediate directory entries and types in one operation |
|
|
73
76
|
| `readdirRecursive` | `readdirRecursive(path: string, options?: ReaddirRecursiveOptions): Promise<DirEntry[]>` | Recursively list directory contents with metadata |
|
|
74
77
|
| `stat` | `stat(path: string): Promise<VirtualStat>` | Get file/directory metadata |
|
|
75
78
|
| `exists` | `exists(path: string): Promise<boolean>` | Check if a path exists |
|
|
76
79
|
| `move` | `move(from: string, to: string): Promise<void>` | Rename/move a file or directory |
|
|
77
|
-
| `
|
|
78
|
-
| `mountFs` | `mountFs(
|
|
79
|
-
| `unmountFs` | `unmountFs(path: string): void
|
|
80
|
+
| `remove` | `remove(path: string, options?: { recursive?: boolean }): Promise<void>` | Remove a file or directory |
|
|
81
|
+
| `mountFs` | `mountFs(descriptor: DynamicMountDescriptor): Promise<void>` | Mount a sidecar-owned filesystem descriptor |
|
|
82
|
+
| `unmountFs` | `unmountFs(path: string): Promise<void>` | Unmount a filesystem |
|
|
83
|
+
| `listMounts` | `listMounts(): Promise<MountInfo[]>` | Read sanitized live mount metadata from the sidecar |
|
|
84
|
+
| `exportRootFilesystem` | `exportRootFilesystem({ maxBytes }): Promise<RootSnapshotExport>` | Export a bounded root-filesystem snapshot |
|
|
80
85
|
|
|
81
86
|
### Process Management
|
|
82
87
|
|
|
@@ -84,6 +89,8 @@ await vm.dispose();
|
|
|
84
89
|
|--------|-----------|-------------|
|
|
85
90
|
| `exec` | `exec(command: string, options?: ExecOptions): Promise<ExecResult>` | Execute a shell command and wait for completion |
|
|
86
91
|
| `spawn` | `spawn(command: string, args: string[], options?: SpawnOptions): { pid: number }` | Spawn a long-running process |
|
|
92
|
+
| `onProcessOutput` | `onProcessOutput(pid, handler): () => void` | Subscribe to unified stdout/stderr DTOs |
|
|
93
|
+
| `onProcessExit` | `onProcessExit(pid, handler): () => void` | Subscribe to process exit DTOs |
|
|
87
94
|
| `listProcesses` | `listProcesses(): SpawnedProcessInfo[]` | List processes started via `spawn()` |
|
|
88
95
|
| `allProcesses` | `allProcesses(): ProcessInfo[]` | List all kernel processes across all runtimes |
|
|
89
96
|
| `processTree` | `processTree(): ProcessTreeNode[]` | Get processes organized as a parent-child tree |
|
|
@@ -95,7 +102,7 @@ await vm.dispose();
|
|
|
95
102
|
|
|
96
103
|
| Method | Signature | Description |
|
|
97
104
|
|--------|-----------|-------------|
|
|
98
|
-
| `
|
|
105
|
+
| `httpRequest` | `httpRequest(request: HttpRequest): Promise<HttpResponse>` | Send a buffered HTTP request to a service running inside the VM |
|
|
99
106
|
|
|
100
107
|
### Shell
|
|
101
108
|
|
|
@@ -112,9 +119,11 @@ await vm.dispose();
|
|
|
112
119
|
|
|
113
120
|
| Method | Signature | Description |
|
|
114
121
|
|--------|-----------|-------------|
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
122
|
+
| `openSession` | `openSession(input: OpenSessionInput): Promise<void>` | Create or restore a durable session with a caller-chosen ID |
|
|
123
|
+
| `getSession` | `getSession(input?: SessionTarget): Promise<SessionInfo>` | Read SQLite metadata without starting an adapter |
|
|
124
|
+
| `listSessions` | `listSessions(input?: ListSessionsInput): Promise<SessionPage>` | Page through SQLite metadata without starting adapters |
|
|
125
|
+
| `unloadSession` | `unloadSession(input?: SessionTarget): Promise<void>` | Stop the adapter while retaining history |
|
|
126
|
+
| `deleteSession` | `deleteSession(input?: SessionTarget): Promise<void>` | Stop the adapter and delete durable state; omitted ID targets main |
|
|
118
127
|
|
|
119
128
|
### Agent Registry
|
|
120
129
|
|
|
@@ -126,27 +135,22 @@ await vm.dispose();
|
|
|
126
135
|
|
|
127
136
|
| Method | Signature | Description |
|
|
128
137
|
|--------|-----------|-------------|
|
|
129
|
-
| `prompt` | `prompt(
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
| `getSessionModes` | `getSessionModes(sessionId: string): SessionModeState \| null` | Get available modes |
|
|
137
|
-
| `setSessionModel` | `setSessionModel(sessionId: string, model: string): Promise<JsonRpcResponse>` | Set the model |
|
|
138
|
-
| `setSessionThoughtLevel` | `setSessionThoughtLevel(sessionId: string, level: string): Promise<JsonRpcResponse>` | Set reasoning level |
|
|
139
|
-
| `getSessionConfigOptions` | `getSessionConfigOptions(sessionId: string): SessionConfigOption[]` | Get available config options |
|
|
140
|
-
| `rawSend` | `rawSend(sessionId: string, method: string, params?: Record<string, unknown>): Promise<JsonRpcResponse>` | Send an arbitrary ACP request |
|
|
138
|
+
| `prompt` | `prompt(input: PromptInput): Promise<PromptResult>` | Send native ACP content blocks and durably commit the turn |
|
|
139
|
+
| `cancelPrompt` | `cancelPrompt(input?: SessionTarget): Promise<CancelPromptResult>` | Cancel active agent work |
|
|
140
|
+
| `onSessionEvent` | `onSessionEvent(sessionId: string, handler: SessionEventHandler): () => void` | Subscribe to native ACP update and permission request/response variants |
|
|
141
|
+
| `respondPermission` | `respondPermission(input: PermissionResponse): Promise<PermissionResponseResult>` | Select an exact adapter-supplied ACP permission option |
|
|
142
|
+
| `getSessionConfig` | `getSessionConfig(input?: SessionTarget): Promise<SessionConfig>` | Read cached native ACP configuration |
|
|
143
|
+
| `setSessionConfigOption` | `setSessionConfigOption(input: SetSessionConfigOptionInput): Promise<SessionConfig>` | Set a native ACP string or boolean option |
|
|
144
|
+
| `readHistory` | `readHistory(input?: ReadHistoryInput): Promise<HistoryPage>` | Read authoritative durable ACP updates and permission events from SQLite |
|
|
141
145
|
|
|
142
146
|
### Exported Types
|
|
143
147
|
|
|
144
148
|
**VM & Options**
|
|
145
|
-
- `AgentOsOptions` — VM creation options (commandDirs, loopbackExemptPorts, mounts
|
|
149
|
+
- `AgentOsOptions` — VM creation options (commandDirs, loopbackExemptPorts, mounts). Use `nodeModulesMount(...)` in `mounts` to expose a host `node_modules` tree at `/root/node_modules`.
|
|
146
150
|
- `AgentOsSidecarConfig` — shared-pool or explicit-handle sidecar selection for VM creation
|
|
147
151
|
- `AgentOsSharedSidecarOptions` — shared sidecar pool selection
|
|
148
152
|
- `AgentOsCreateSidecarOptions` — explicit sidecar handle creation options
|
|
149
|
-
- `
|
|
153
|
+
- `OpenSessionInput` — Durable session identity and creation options (agent, cwd, env, mcpServers, skipOsInstructions, additionalInstructions)
|
|
150
154
|
|
|
151
155
|
**Sidecar**
|
|
152
156
|
- `AgentOsSidecarDescription` — Sidecar identity, placement, lifecycle state, and active VM count
|
|
@@ -182,17 +186,16 @@ await vm.dispose();
|
|
|
182
186
|
- `AgentRegistryEntry` — Registry entry (id, acpAdapter, agentPackage, installed)
|
|
183
187
|
|
|
184
188
|
**Session**
|
|
185
|
-
- `SessionInfo` —
|
|
186
|
-
- `
|
|
187
|
-
- `
|
|
188
|
-
- `
|
|
189
|
+
- `SessionInfo` — Durable session summary and current state
|
|
190
|
+
- `SessionStreamEntry` — Generic live union of durable session updates, permission requests/responses, and ephemeral message deltas
|
|
191
|
+
- `DurableSessionEventEntry` — Durable history/event union keyed by session sequence
|
|
192
|
+
- `HistoryPage` — Cursor-based durable event page returned by `readHistory()`
|
|
189
193
|
- `SessionConfigOption` — A configuration option the agent supports
|
|
190
|
-
- `
|
|
191
|
-
- `
|
|
192
|
-
- `
|
|
193
|
-
- `
|
|
194
|
-
- `
|
|
195
|
-
- `SessionEventHandler` — Handler for live session update events
|
|
194
|
+
- `SessionCapabilities` — Native ACP capabilities cached for a durable session
|
|
195
|
+
- `SessionAgentInfo` — Native ACP adapter identity
|
|
196
|
+
- `PermissionPolicy` — Sidecar-owned `"allow_all" | "reject_all" | "ask"` strategy
|
|
197
|
+
- `PermissionResponse` / `PermissionResponseResult` — Explicit-session native ACP option selection and its accepted/terminal result
|
|
198
|
+
- `SessionEventHandler` — Handler for the generic live session-event union
|
|
196
199
|
|
|
197
200
|
**Protocol**
|
|
198
201
|
- `JsonRpcRequest`, `JsonRpcResponse`, `JsonRpcNotification`, `JsonRpcError`
|