@rivet-dev/agentos-core 0.0.0-integrate-dylib-into-main.815fcda → 0.0.0-nathan-binding-workspace.dd41c31

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 CHANGED
@@ -25,10 +25,10 @@ npm install @rivet-dev/agentos-pi @mariozechner/pi-coding-agent
25
25
  ```
26
26
 
27
27
  ```typescript
28
- import { AgentOs } from "@rivet-dev/agentos-core";
28
+ import { AgentOS } from "@rivet-dev/agentos-core";
29
29
 
30
30
  // 1. Create a VM
31
- const vm = await AgentOs.create();
31
+ const vm = await AgentOS.create();
32
32
 
33
33
  // 2. Create an agent session
34
34
  const { sessionId } = await vm.createSession("pi");
@@ -47,17 +47,17 @@ await vm.dispose();
47
47
 
48
48
  | Method | Signature | Description |
49
49
  |--------|-----------|-------------|
50
- | `create` | `static create(options?: AgentOsOptions): Promise<AgentOs>` | Create and boot a new VM |
51
- | `getSharedSidecar` | `static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>` | Get or create a shared sidecar handle for a pool |
52
- | `createSidecar` | `static createSidecar(options?: AgentOsCreateSidecarOptions): Promise<AgentOsSidecar>` | Create an explicit sidecar handle |
50
+ | `create` | `static create(options?: AgentOSOptions): Promise<AgentOS>` | Create and boot a new VM |
51
+ | `getSharedSidecar` | `static getSharedSidecar(options?: AgentOSSharedSidecarOptions): Promise<AgentOSSidecar>` | Get or create a shared sidecar handle for a pool |
52
+ | `createSidecar` | `static createSidecar(options?: AgentOSCreateSidecarOptions): Promise<AgentOSSidecar>` | Create an explicit sidecar handle |
53
53
  | `dispose` | `dispose(): Promise<void>` | Shut down the VM and all sessions |
54
54
 
55
55
  ### Sidecars
56
56
 
57
57
  | Surface | Signature | Description |
58
58
  |--------|-----------|-------------|
59
- | `sidecar` | `AgentOsSidecar` | Sidecar handle backing the VM |
60
- | `describe` | `sidecar.describe(): AgentOsSidecarDescription` | Inspect sidecar placement, state, and active VM count |
59
+ | `sidecar` | `AgentOSSidecar` | Sidecar handle backing the VM |
60
+ | `describe` | `sidecar.describe(): AgentOSSidecarDescription` | Inspect sidecar placement, state, and active VM count |
61
61
  | `dispose` | `sidecar.dispose(): Promise<void>` | Dispose the sidecar handle and any active VMs leased from it |
62
62
 
63
63
  ### Filesystem
@@ -142,14 +142,14 @@ await vm.dispose();
142
142
  ### Exported Types
143
143
 
144
144
  **VM & Options**
145
- - `AgentOsOptions` — VM creation options (commandDirs, loopbackExemptPorts, mounts, additionalInstructions). Use `nodeModulesMount(...)` in `mounts` to expose a host `node_modules` tree at `/root/node_modules`.
146
- - `AgentOsSidecarConfig` — shared-pool or explicit-handle sidecar selection for VM creation
147
- - `AgentOsSharedSidecarOptions` — shared sidecar pool selection
148
- - `AgentOsCreateSidecarOptions` — explicit sidecar handle creation options
145
+ - `AgentOSOptions` — VM creation options (commandDirs, loopbackExemptPorts, mounts, additionalInstructions). Use `nodeModulesMount(...)` in `mounts` to expose a host `node_modules` tree at `/root/node_modules`.
146
+ - `AgentOSSidecarConfig` — shared-pool or explicit-handle sidecar selection for VM creation
147
+ - `AgentOSSharedSidecarOptions` — shared sidecar pool selection
148
+ - `AgentOSCreateSidecarOptions` — explicit sidecar handle creation options
149
149
  - `CreateSessionOptions` — Session options (cwd, env, mcpServers, skipOsInstructions, additionalInstructions)
150
150
 
151
151
  **Sidecar**
152
- - `AgentOsSidecarDescription` — Sidecar identity, placement, lifecycle state, and active VM count
152
+ - `AgentOSSidecarDescription` — Sidecar identity, placement, lifecycle state, and active VM count
153
153
 
154
154
  **Mount Configurations**
155
155
  - `MountConfig` — Union of all mount types
@@ -1,6 +1,6 @@
1
1
  import type { NativeMountPluginDescriptor } from "@secure-exec/core/descriptors";
2
2
  import type { AgentCapabilities, AgentInfo, PermissionReply, PermissionRequestHandler, SessionConfigOption, SessionEventHandler, SessionModeState } from "./agent-session-types.js";
3
- import { type ToolKit } from "./host-tools.js";
3
+ import { type Bindings } from "./bindings.js";
4
4
  import type { JsonRpcResponse } from "./json-rpc.js";
5
5
  import type { ConnectTerminalOptions, Kernel, KernelExecOptions, KernelExecResult, ProcessInfo as KernelProcessInfo, KernelSpawnOptions, OpenShellOptions, Permissions, VirtualFileSystem, VirtualStat } from "./runtime-compat.js";
6
6
  export type { MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountPluginDescriptor, } from "@secure-exec/core/descriptors";
@@ -55,23 +55,23 @@ import type { ScheduleDriver } from "./cron/schedule-driver.js";
55
55
  import type { CronEventHandler, CronJob, CronJobInfo, CronJobOptions } from "./cron/types.js";
56
56
  import { type LayerStore, type OverlayFilesystemMode, type RootSnapshotExport, type SnapshotLayerHandle } from "./layers.js";
57
57
  import { type SoftwareInput } from "./packages.js";
58
- import { type AgentOsSidecarPlacement } from "./sidecar/rpc-client.js";
59
- export interface AgentOsSharedSidecarOptions {
58
+ import { type AgentOSSidecarPlacement } from "./sidecar/rpc-client.js";
59
+ export interface AgentOSSharedSidecarOptions {
60
60
  pool?: string;
61
61
  }
62
- export interface AgentOsCreateSidecarOptions {
62
+ export interface AgentOSCreateSidecarOptions {
63
63
  sidecarId?: string;
64
64
  }
65
- export type AgentOsSidecarConfig = {
65
+ export type AgentOSSidecarConfig = {
66
66
  kind: "shared";
67
67
  pool?: string;
68
68
  } | {
69
69
  kind: "explicit";
70
- handle: AgentOsSidecar;
70
+ handle: AgentOSSidecar;
71
71
  };
72
- export interface AgentOsSidecarDescription {
72
+ export interface AgentOSSidecarDescription {
73
73
  sidecarId: string;
74
- placement: AgentOsSidecarPlacement;
74
+ placement: AgentOSSidecarPlacement;
75
75
  state: "ready" | "disposing" | "disposed";
76
76
  activeVmCount: number;
77
77
  }
@@ -119,7 +119,7 @@ export type MountConfig = PlainMountConfig | NativeMountConfig | OverlayMountCon
119
119
  * forwarded to the native sidecar in the typed create-VM JSON config. Unknown, negative, or
120
120
  * non-integer values are rejected by the sidecar before VM construction.
121
121
  */
122
- export interface AgentOsLimits {
122
+ export interface AgentOSLimits {
123
123
  /** Kernel resource limits (processes, FDs, sockets, filesystem bytes, WASM caps, etc.). */
124
124
  resources?: {
125
125
  cpuCount?: number;
@@ -190,7 +190,7 @@ export interface AgentOsLimits {
190
190
  syncReadLimitBytes?: number;
191
191
  };
192
192
  }
193
- export interface AgentOsOptions {
193
+ export interface AgentOSOptions {
194
194
  /**
195
195
  * Software to install in the VM. Each entry provides agents, tools,
196
196
  * or WASM commands. Any object with a `commandDir` property (e.g.,
@@ -199,14 +199,6 @@ export interface AgentOsOptions {
199
199
  * meta-packages that export arrays of sub-packages work directly.
200
200
  */
201
201
  software?: SoftwareInput[];
202
- /**
203
- * Whether to auto-include the default software bundle (`@agentos-software/common`
204
- * — `sh` + coreutils + the standard CLI tools agents rely on) in addition to
205
- * any `software` you pass. Defaults to `true`; set `false` for a bare VM with
206
- * only the software you list explicitly. Entries already present in `software`
207
- * are not duplicated.
208
- */
209
- defaultSoftware?: boolean;
210
202
  /** Loopback ports to exempt from SSRF checks (for testing with host-side mock servers). */
211
203
  loopbackExemptPorts?: number[];
212
204
  /**
@@ -227,8 +219,8 @@ export interface AgentOsOptions {
227
219
  additionalInstructions?: string;
228
220
  /** Custom schedule driver for cron jobs. Defaults to TimerScheduleDriver. */
229
221
  scheduleDriver?: ScheduleDriver;
230
- /** Host-side toolkits available to agents inside the VM. */
231
- toolKits?: ToolKit[];
222
+ /** Host-side bindings available to agents inside the VM. */
223
+ bindings?: Bindings[];
232
224
  /**
233
225
  * Custom permission policy for the kernel. Controls access to filesystem,
234
226
  * network, child process, and environment operations. Defaults to allowAll.
@@ -238,12 +230,12 @@ export interface AgentOsOptions {
238
230
  * Sidecar placement for the VM. Defaults to the shared `default` pool.
239
231
  * Pass an explicit sidecar handle to pin the VM to a caller-managed sidecar.
240
232
  */
241
- sidecar?: AgentOsSidecarConfig;
233
+ sidecar?: AgentOSSidecarConfig;
242
234
  /**
243
235
  * Operator-tunable runtime limits. Unset fields use built-in defaults that match the
244
236
  * runtime's historical constants, so omitting this leaves behavior unchanged.
245
237
  */
246
- limits?: AgentOsLimits;
238
+ limits?: AgentOSLimits;
247
239
  }
248
240
  /** Configuration for a local MCP server (spawned as a child process). */
249
241
  export interface McpServerConfigLocal {
@@ -264,11 +256,11 @@ export interface McpServerConfigRemote {
264
256
  headers?: Record<string, string>;
265
257
  }
266
258
  export type McpServerConfig = McpServerConfigLocal | McpServerConfigRemote;
267
- export interface AgentOsRuntimeAdmin {
259
+ export interface AgentOSRuntimeAdmin {
268
260
  kernel: Kernel;
269
261
  rootView: VirtualFileSystem;
270
262
  env: Record<string, string>;
271
- sidecar: AgentOsSidecar;
263
+ sidecar: AgentOSSidecar;
272
264
  }
273
265
  export interface CreateSessionOptions {
274
266
  /** Working directory for the agent session inside the VM. */
@@ -282,49 +274,18 @@ export interface CreateSessionOptions {
282
274
  /** Additional instructions appended to the base OS instructions. */
283
275
  additionalInstructions?: string;
284
276
  }
285
- /**
286
- * Options for {@link AgentOs.resumeSession}.
287
- *
288
- * Resume depends on a durable root: after a Rivet actor sleeps (VM destroyed) and
289
- * wakes (fresh VM, actor SQLite intact) the caller can keep prompting an existing
290
- * session. On a non-durable (default in-memory) root there is no surviving store,
291
- * so the sidecar's universal fallback tier always runs and the transcript pointer
292
- * is the only continuity mechanism.
293
- */
294
- export interface ResumeSessionOptions {
295
- /**
296
- * Guest-readable path to the reconstructed transcript. When present, the
297
- * fallback tier arms a continuation preamble pointing the agent at it.
298
- */
299
- transcriptPath?: string;
300
- /** Working directory for the resumed agent session (default `/home/user`). */
301
- cwd?: string;
302
- /** Environment variables to pass to the resumed agent process. */
303
- env?: Record<string, string>;
304
- }
305
- /** Result from {@link AgentOs.resumeSession}. */
306
- export interface ResumeSessionResult {
307
- /**
308
- * The live ACP session id in the fresh VM: equal to the requested id for
309
- * native loads, or a freshly assigned id for the fallback tier — the caller
310
- * remaps `external -> live`.
311
- */
312
- sessionId: string;
313
- /** `"native"` (session/load|resume) or `"fallback"` (session/new + preamble). */
314
- mode: string;
315
- }
316
277
  export interface SessionInfo {
317
278
  sessionId: string;
318
279
  agentType: string;
319
280
  }
320
- /** Result from AgentOs.prompt(). */
281
+ /** Result from AgentOS.prompt(). */
321
282
  export interface PromptResult {
322
283
  /** Raw JSON-RPC response from the ACP adapter. */
323
284
  response: JsonRpcResponse;
324
285
  /** Accumulated agent text output from streamed message chunks. */
325
286
  text: string;
326
287
  }
327
- /** Information about a process spawned via AgentOs.spawn(). */
288
+ /** Information about a process spawned via AgentOS.spawn(). */
328
289
  export interface SpawnedProcessInfo {
329
290
  pid: number;
330
291
  command: string;
@@ -332,9 +293,9 @@ export interface SpawnedProcessInfo {
332
293
  running: boolean;
333
294
  exitCode: number | null;
334
295
  }
335
- export declare class AgentOs {
296
+ export declare class AgentOS {
336
297
  #private;
337
- readonly sidecar: AgentOsSidecar;
298
+ readonly sidecar: AgentOSSidecar;
338
299
  private _sessions;
339
300
  private _closedSessionIds;
340
301
  private _sessionClosePromises;
@@ -349,7 +310,7 @@ export declare class AgentOs {
349
310
  private _softwareRoots;
350
311
  private _softwareAgentConfigs;
351
312
  private _cronManager;
352
- private _toolKits;
313
+ private _bindings;
353
314
  private _toolReference;
354
315
  private _permissions;
355
316
  private _hostMounts;
@@ -361,9 +322,9 @@ export declare class AgentOs {
361
322
  private readonly _sidecarVm;
362
323
  private readonly _disposeSidecarEventListener;
363
324
  private constructor();
364
- static createSidecar(options?: AgentOsCreateSidecarOptions): Promise<AgentOsSidecar>;
365
- static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>;
366
- static create(options?: AgentOsOptions): Promise<AgentOs>;
325
+ static createSidecar(options?: AgentOSCreateSidecarOptions): Promise<AgentOSSidecar>;
326
+ static getSharedSidecar(options?: AgentOSSharedSidecarOptions): Promise<AgentOSSidecar>;
327
+ static create(options?: AgentOSOptions): Promise<AgentOS>;
367
328
  exec(command: string, options?: KernelExecOptions): Promise<KernelExecResult>;
368
329
  execArgv(command: string, args?: readonly string[], options?: KernelExecOptions): Promise<KernelExecResult>;
369
330
  private _trackProcess;
@@ -462,22 +423,6 @@ export declare class AgentOs {
462
423
  createSession(agentType: AgentType | string, options?: CreateSessionOptions): Promise<{
463
424
  sessionId: string;
464
425
  }>;
465
- /**
466
- * Resume a session that exists in durable storage but is not live in this VM
467
- * (e.g. after a Rivet actor slept and woke with a fresh VM). Thin forwarder:
468
- * resolves the agent config + adapter entrypoint exactly as {@link createSession}
469
- * does, then forwards a single `AcpResumeSessionRequest` to the sidecar, which
470
- * owns the resume state machine (native `session/load` when the agent supports
471
- * it, else `session/new` + a transcript-continuation preamble). The returned
472
- * `sessionId` is the live id in this VM (equal to the requested id for native
473
- * loads, freshly assigned for the fallback); the caller remaps `external -> live`.
474
- * The new live session is registered + hydrated locally so subsequent prompts
475
- * route to it.
476
- *
477
- * Resume depends on a durable root; on a non-durable (default in-memory) root
478
- * there is no surviving store and the fallback tier always runs.
479
- */
480
- resumeSession(sessionId: string, agentType: AgentType | string, options?: ResumeSessionOptions): Promise<ResumeSessionResult>;
481
426
  /**
482
427
  * Resolve the VM bin entry point of an ACP adapter package.
483
428
  * Reads from the host filesystem since kernel.readFile() resolves through
@@ -557,17 +502,17 @@ export declare class AgentOs {
557
502
  onCronEvent(handler: CronEventHandler): void;
558
503
  dispose(): Promise<void>;
559
504
  }
560
- export declare function getAgentOsRuntimeAdmin(vm: AgentOs): AgentOsRuntimeAdmin;
561
- export declare function getAgentOsKernel(vm: AgentOs): Kernel;
562
- export declare class AgentOsSidecar {
563
- constructor(sidecarId: string, placement: AgentOsSidecarPlacement, sharedPool?: string);
564
- describe(): AgentOsSidecarDescription;
505
+ export declare function getAgentOSRuntimeAdmin(vm: AgentOS): AgentOSRuntimeAdmin;
506
+ export declare function getAgentOSKernel(vm: AgentOS): Kernel;
507
+ export declare class AgentOSSidecar {
508
+ constructor(sidecarId: string, placement: AgentOSSidecarPlacement, sharedPool?: string);
509
+ describe(): AgentOSSidecarDescription;
565
510
  dispose(): Promise<void>;
566
511
  }
567
512
  /**
568
513
  * Test-only escape hatch: dispose every cached shared sidecar so vitest
569
514
  * workers can exit cleanly. The shared sidecar is normally process-global and
570
- * keeps its native subprocess alive across `AgentOs.create()` calls; without
515
+ * keeps its native subprocess alive across `AgentOS.create()` calls; without
571
516
  * this hook the vitest worker can hold open piped stdio handles after the
572
517
  * test suite finishes and stall `pnpm test` indefinitely.
573
518
  */