@rivet-dev/agentos-core 0.0.0-agentos-dylib-plugin.bbfdf95 → 0.0.0-integrate-dylib-into-main.815fcda

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
@@ -1,4 +1,4 @@
1
- # @rivet-dev/agent-os-core
1
+ # @rivet-dev/agentos-core
2
2
 
3
3
  A high-level SDK for running coding agents in isolated VMs. agentOS manages the full lifecycle of virtual machines -- from filesystem setup and process management to launching AI agents via the Agent Communication Protocol (ACP).
4
4
 
@@ -19,13 +19,13 @@ 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/agent-os-core
22
+ npm install @rivet-dev/agentos-core
23
23
  # Install an agent adapter + its underlying agent
24
- npm install @rivet-dev/agent-os-pi @mariozechner/pi-coding-agent
24
+ npm install @rivet-dev/agentos-pi @mariozechner/pi-coding-agent
25
25
  ```
26
26
 
27
27
  ```typescript
28
- import { AgentOs } from "@rivet-dev/agent-os-core";
28
+ import { AgentOs } from "@rivet-dev/agentos-core";
29
29
 
30
30
  // 1. Create a VM
31
31
  const vm = await AgentOs.create();
@@ -194,11 +194,19 @@ 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.,
197
- * registry packages like @agent-os-pkgs/coreutils) is treated
197
+ * registry packages like @agentos-software/coreutils) is treated
198
198
  * as a WASM command source automatically. Arrays are flattened, so
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;
202
210
  /** Loopback ports to exempt from SSRF checks (for testing with host-side mock servers). */
203
211
  loopbackExemptPorts?: number[];
204
212
  /**
@@ -210,6 +218,11 @@ export interface AgentOsOptions {
210
218
  rootFilesystem?: RootFilesystemConfig;
211
219
  /** Filesystems to mount at boot time. */
212
220
  mounts?: MountConfig[];
221
+ /**
222
+ * @deprecated Use `mounts: [nodeModulesMount(path)]` instead.
223
+ * Compatibility alias for mounting `<moduleAccessCwd>/node_modules` at `/root/node_modules`.
224
+ */
225
+ moduleAccessCwd?: string;
213
226
  /** Additional instructions appended to the base OS system prompt injected at session start. */
214
227
  additionalInstructions?: string;
215
228
  /** Custom schedule driver for cron jobs. Defaults to TimerScheduleDriver. */
@@ -352,6 +365,7 @@ export declare class AgentOs {
352
365
  static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>;
353
366
  static create(options?: AgentOsOptions): Promise<AgentOs>;
354
367
  exec(command: string, options?: KernelExecOptions): Promise<KernelExecResult>;
368
+ execArgv(command: string, args?: readonly string[], options?: KernelExecOptions): Promise<KernelExecResult>;
355
369
  private _trackProcess;
356
370
  spawn(command: string, args: string[], options?: KernelSpawnOptions): {
357
371
  pid: number;
package/dist/agent-os.js CHANGED
@@ -50,7 +50,7 @@ import { serializeMountConfigForSidecar, } from "./js-bridge.js";
50
50
  import { createSnapshotExport, } from "./layers.js";
51
51
  import { processSoftware, resolvePackageDir, } from "./packages.js";
52
52
  import { allowAll } from "./runtime-compat.js";
53
- import { AcpRuntimeKind, decodeAcpCallback, decodeAcpEvent, decodeAcpResponse, encodeAcpCallbackResponse, encodeAcpRequest, } from "./sidecar/agent-os-protocol.js";
53
+ import { AcpRuntimeKind, decodeAcpCallback, decodeAcpEvent, decodeAcpResponse, encodeAcpCallbackResponse, encodeAcpRequest, } from "./sidecar/agentos-protocol.js";
54
54
  import { serializePermissionsForSidecar } from "./sidecar/permissions.js";
55
55
  import { createAgentOsSidecarClient, NATIVE_SIDECAR_FRAME_TIMEOUT_MS, NativeSidecarKernelProxy, SidecarProcess, serializeRootFilesystemForSidecar, } from "./sidecar/rpc-client.js";
56
56
  const LEGACY_PERMISSION_METHOD = "request/permission";
@@ -488,7 +488,7 @@ function prepareCommandDirs(commandPackages) {
488
488
  if (aliasEntries.length === 0) {
489
489
  continue;
490
490
  }
491
- const aliasDir = mkdtempSync(join(tmpdir(), "agent-os-command-aliases-"));
491
+ const aliasDir = mkdtempSync(join(tmpdir(), "agentos-command-aliases-"));
492
492
  for (const [aliasName, sourcePath] of aliasEntries) {
493
493
  writeFileSync(join(aliasDir, aliasName), readFileSync(sourcePath));
494
494
  }
@@ -835,7 +835,7 @@ function collectSidecarMountPlan(options) {
835
835
  return { sidecarMounts, hostMounts, hostPathMappings };
836
836
  }
837
837
  function materializeToolShimDir(toolKits) {
838
- const shimDir = mkdtempSync(join(tmpdir(), "agent-os-host-tools-shims-"));
838
+ const shimDir = mkdtempSync(join(tmpdir(), "agentos-host-tools-shims-"));
839
839
  writeFileSync(join(shimDir, "agentos"), KERNEL_COMMAND_STUB, { mode: 0o755 });
840
840
  for (const toolKit of toolKits) {
841
841
  writeFileSync(join(shimDir, `agentos-${toolKit.name}`), KERNEL_COMMAND_STUB, { mode: 0o755 });
@@ -1467,8 +1467,21 @@ export class AgentOs {
1467
1467
  toolShimDir = materializeToolShimDir(toolKits);
1468
1468
  }
1469
1469
  const commandGuestPaths = collectGuestCommandPaths(preparedCommandDirs.commandDirs);
1470
+ const requestedMounts = options?.moduleAccessCwd
1471
+ ? [
1472
+ ...(options.mounts ?? []),
1473
+ {
1474
+ path: "/root/node_modules",
1475
+ plugin: createHostDirBackend({
1476
+ hostPath: join(options.moduleAccessCwd, "node_modules"),
1477
+ readOnly: true,
1478
+ }),
1479
+ readOnly: true,
1480
+ },
1481
+ ]
1482
+ : options?.mounts;
1470
1483
  const { sidecarMounts, hostMounts, hostPathMappings } = collectSidecarMountPlan({
1471
- mounts: options?.mounts,
1484
+ mounts: requestedMounts,
1472
1485
  softwareRoots: processed.softwareRoots,
1473
1486
  commandDirs: preparedCommandDirs.commandDirs,
1474
1487
  shimDir: toolShimDir,
@@ -1605,6 +1618,10 @@ export class AgentOs {
1605
1618
  async exec(command, options) {
1606
1619
  return this.#kernel.exec(command, options);
1607
1620
  }
1621
+ async execArgv(command, args = [], options) {
1622
+ const kernel = this.#kernel;
1623
+ return kernel.execArgv(command, args, options);
1624
+ }
1608
1625
  _trackProcess(proc, command, args, stdoutHandlers, stderrHandlers, exitHandlers) {
1609
1626
  const entry = {
1610
1627
  proc,
@@ -3498,7 +3515,7 @@ function getSharedAgentOsSidecarInternal(options = {}) {
3498
3515
  if (existing && existing.describe().state !== "disposed") {
3499
3516
  return existing;
3500
3517
  }
3501
- const sidecar = new AgentOsSidecar(`agent-os-shared-sidecar:${pool}`, { kind: "shared", ...(pool ? { pool } : {}) }, pool);
3518
+ const sidecar = new AgentOsSidecar(`agentos-shared-sidecar:${pool}`, { kind: "shared", ...(pool ? { pool } : {}) }, pool);
3502
3519
  sharedSidecars.set(pool, sidecar);
3503
3520
  return sidecar;
3504
3521
  }
package/dist/agents.js CHANGED
@@ -20,7 +20,7 @@ export const AGENT_CONFIGS = {
20
20
  acpAdapter: "@rivet-dev/agentos-claude",
21
21
  agentPackage: "@anthropic-ai/claude-agent-sdk",
22
22
  defaultEnv: {
23
- CLAUDE_AGENT_SDK_CLIENT_APP: "@rivet-dev/agent-os",
23
+ CLAUDE_AGENT_SDK_CLIENT_APP: "@rivet-dev/agentos",
24
24
  CLAUDE_CODE_SIMPLE: "1",
25
25
  CLAUDE_CODE_FORCE_AGENT_OS_RIPGREP: "1",
26
26
  CLAUDE_CODE_DEFER_GROWTHBOOK_INIT: "1",
@@ -145,10 +145,7 @@ export class CronManager {
145
145
  break;
146
146
  }
147
147
  case "exec": {
148
- const cmd = action.args?.length
149
- ? `${action.command} ${action.args.join(" ")}`
150
- : action.command;
151
- await this.vm.exec(cmd);
148
+ await this.vm.execArgv(action.command, action.args ?? []);
152
149
  break;
153
150
  }
154
151
  case "callback": {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // @rivet-dev/agent-os
1
+ // @rivet-dev/agentos
2
2
  export { AgentOs, AgentOsSidecar } from "./agent-os.js";
3
3
  export { AGENT_CONFIGS } from "./agents.js";
4
4
  export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
package/dist/layers.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type FilesystemEntry } from "./filesystem-snapshot.js";
3
3
  import type { VirtualFileSystem } from "./runtime-compat.js";
4
4
  export type OverlayFilesystemMode = "ephemeral" | "read-only";
5
5
  export interface FilesystemSnapshotExport {
6
- format: "agent-os-filesystem-snapshot-v1";
6
+ format: "agentos-filesystem-snapshot-v1";
7
7
  filesystem: {
8
8
  entries: FilesystemEntry[];
9
9
  };
package/dist/layers.js CHANGED
@@ -22,7 +22,7 @@ function isFilesystemSnapshotExport(value) {
22
22
  if (!value || typeof value !== "object") {
23
23
  return false;
24
24
  }
25
- if (value.format !== "agent-os-filesystem-snapshot-v1") {
25
+ if (value.format !== "agentos-filesystem-snapshot-v1") {
26
26
  return false;
27
27
  }
28
28
  const filesystem = value.filesystem;
@@ -37,7 +37,7 @@ function normalizeSnapshotExport(source) {
37
37
  throw new Error("Invalid base filesystem artifact");
38
38
  }
39
39
  return {
40
- format: "agent-os-filesystem-snapshot-v1",
40
+ format: "agentos-filesystem-snapshot-v1",
41
41
  filesystem: {
42
42
  entries: source.source.filesystem.entries,
43
43
  },
@@ -52,7 +52,7 @@ export function createSnapshotExport(entries) {
52
52
  return {
53
53
  kind: "snapshot-export",
54
54
  source: {
55
- format: "agent-os-filesystem-snapshot-v1",
55
+ format: "agentos-filesystem-snapshot-v1",
56
56
  filesystem: { entries },
57
57
  },
58
58
  };
@@ -61,7 +61,7 @@ export interface WasmCommandSoftwareDescriptor extends SoftwareDescriptor {
61
61
  }
62
62
  /**
63
63
  * Any object with a commandDir property is treated as a WASM command package.
64
- * This allows registry packages (e.g., @agent-os-pkgs/coreutils) to be
64
+ * This allows registry packages (e.g., @agentos-software/coreutils) to be
65
65
  * passed directly to the `software` option without wrapping.
66
66
  */
67
67
  export interface WasmCommandDirDescriptor {
@@ -304,6 +304,9 @@ export interface BindingTree {
304
304
  [key: string]: BindingFunction | BindingTree;
305
305
  }
306
306
  export type BindingFunction = (...args: unknown[]) => unknown;
307
+ export interface ModuleAccessOptions {
308
+ cwd?: string;
309
+ }
307
310
  export interface NodeDriverOptions {
308
311
  filesystem?: VirtualFileSystem;
309
312
  networkAdapter?: NetworkAdapter;
@@ -311,6 +314,7 @@ export interface NodeDriverOptions {
311
314
  permissions?: Permissions;
312
315
  processConfig?: ProcessConfig;
313
316
  osConfig?: OSConfig;
317
+ moduleAccess?: ModuleAccessOptions;
314
318
  }
315
319
  export interface DefaultNetworkAdapterOptions {
316
320
  loopbackExemptPorts?: number[];
@@ -1,4 +1,4 @@
1
- // @generated - run pnpm --dir packages/core build:agent-os-protocol
1
+ // @generated - run pnpm --dir packages/core build:agentos-protocol
2
2
  import * as bare from "@rivetkit/bare-ts";
3
3
  const DEFAULT_CONFIG = /* @__PURE__ */ bare.Config({});
4
4
  export function readJsonUtf8(bc) {
@@ -71,6 +71,7 @@ export declare class NativeSidecarKernelProxy {
71
71
  registerCommandGuestPaths(commandGuestPaths: ReadonlyMap<string, string>): void;
72
72
  dispose(): Promise<void>;
73
73
  exec(command: string, options?: KernelExecOptions): Promise<KernelExecResult>;
74
+ execArgv(command: string, args?: readonly string[], options?: KernelExecOptions): Promise<KernelExecResult>;
74
75
  spawn(command: string, args: string[], options?: KernelSpawnOptions): ManagedProcess;
75
76
  openShell(options?: OpenShellOptions): ShellHandle;
76
77
  connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
@@ -376,6 +376,51 @@ export class NativeSidecarKernelProxy {
376
376
  });
377
377
  return runAndCapture(proc);
378
378
  }
379
+ async execArgv(command, args = [], options) {
380
+ const stdoutChunks = [];
381
+ const stderrChunks = [];
382
+ const effectiveCwd = options?.cwd ?? this.defaultExecCwd ?? this.cwd;
383
+ const runAndCapture = async (proc) => {
384
+ if (options?.stdin !== undefined) {
385
+ proc.writeStdin(options.stdin);
386
+ }
387
+ proc.closeStdin();
388
+ const waitPromise = proc.wait();
389
+ const exitCode = typeof options?.timeout === "number"
390
+ ? await new Promise((resolve) => {
391
+ const timer = setTimeout(() => {
392
+ proc.kill(9);
393
+ void proc.wait().then(resolve);
394
+ }, options.timeout);
395
+ void waitPromise.then((code) => {
396
+ clearTimeout(timer);
397
+ resolve(code);
398
+ });
399
+ })
400
+ : await waitPromise;
401
+ await drainTrailingProcessOutputTurn();
402
+ return {
403
+ exitCode,
404
+ stdout: Buffer.concat(stdoutChunks.map((chunk) => Buffer.from(chunk))).toString("utf8"),
405
+ stderr: Buffer.concat(stderrChunks.map((chunk) => Buffer.from(chunk))).toString("utf8"),
406
+ };
407
+ };
408
+ if (this.commands.get(command) === "wasmvm") {
409
+ this.onWasmCommandResolved?.(command);
410
+ }
411
+ return runAndCapture(this.spawn(command, [...args], {
412
+ ...options,
413
+ cwd: effectiveCwd,
414
+ onStdout: (chunk) => {
415
+ stdoutChunks.push(chunk);
416
+ options?.onStdout?.(chunk);
417
+ },
418
+ onStderr: (chunk) => {
419
+ stderrChunks.push(chunk);
420
+ options?.onStderr?.(chunk);
421
+ },
422
+ }));
423
+ }
379
424
  spawn(command, args, options) {
380
425
  let spawnCommand = command;
381
426
  let spawnArgs = [...args];
@@ -152,7 +152,7 @@ async function runCommand(request) {
152
152
  });
153
153
  }
154
154
  export async function startMockSandboxAgent() {
155
- const rootDir = await mkdtemp(resolve(tmpdir(), "agent-os-sandbox-agent-"));
155
+ const rootDir = await mkdtemp(resolve(tmpdir(), "agentos-sandbox-agent-"));
156
156
  const processes = new Map();
157
157
  const server = createServer(async (request, response) => {
158
158
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-core",
3
- "version": "0.0.0-agentos-dylib-plugin.bbfdf95",
3
+ "version": "0.0.0-integrate-dylib-into-main.815fcda",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -49,13 +49,13 @@
49
49
  "scripts": {
50
50
  "check-types": "pnpm run build:protocols && tsc --noEmit",
51
51
  "build": "pnpm run build:protocols && tsc",
52
- "build:agent-os-protocol": "node ./scripts/compile-agent-os-protocol.mjs",
53
- "build:protocols": "pnpm run build:agent-os-protocol",
52
+ "build:agentos-protocol": "node ./scripts/compile-agentos-protocol.mjs",
53
+ "build:protocols": "pnpm run build:agentos-protocol",
54
54
  "test": "vitest run --reporter=verbose"
55
55
  },
56
56
  "dependencies": {
57
57
  "@aws-sdk/client-s3": "^3.1019.0",
58
- "@rivet-dev/agentos-sidecar": "0.0.0-agentos-dylib-plugin.bbfdf95",
58
+ "@rivet-dev/agentos-sidecar": "0.0.0-integrate-dylib-into-main.815fcda",
59
59
  "@rivetkit/bare-ts": "^0.6.2",
60
60
  "@secure-exec/core": "0.3.0",
61
61
  "@xterm/headless": "^6.0.0",
@@ -74,32 +74,32 @@
74
74
  "@browserbasehq/sdk": "2.10.0",
75
75
  "@bare-ts/tools": "0.15.0",
76
76
  "@copilotkit/llmock": "^1.6.0",
77
- "@rivet-dev/agentos-sandbox": "link:../agent-os-sandbox",
78
- "@agent-os-pkgs/git": "0.0.0-split-runtime-preview.5d46b14",
77
+ "@rivet-dev/agentos-sandbox": "link:../agentos-sandbox",
78
+ "@agentos-software/git": "0.3.0-rc.2",
79
79
  "@secure-exec/google-drive": "0.3.0",
80
80
  "@secure-exec/s3": "0.3.0",
81
81
  "@mariozechner/pi-coding-agent": "^0.60.0",
82
82
  "@rivet-dev/agentos-claude": "link:../../registry/agent/claude",
83
- "@agent-os-pkgs/codex": "0.0.0-split-runtime-preview.5d46b14",
83
+ "@agentos-software/codex": "0.3.0-rc.2",
84
84
  "@rivet-dev/agentos-codex-agent": "link:../../registry/agent/codex",
85
- "@agent-os-pkgs/coreutils": "0.0.0-split-runtime-preview.5d46b14",
86
- "@agent-os-pkgs/curl": "0.0.0-split-runtime-preview.5d46b14",
87
- "@agent-os-pkgs/diffutils": "0.0.0-split-runtime-preview.5d46b14",
88
- "@agent-os-pkgs/fd": "0.0.0-split-runtime-preview.5d46b14",
89
- "@agent-os-pkgs/file": "0.0.0-split-runtime-preview.5d46b14",
90
- "@agent-os-pkgs/findutils": "0.0.0-split-runtime-preview.5d46b14",
91
- "@agent-os-pkgs/gawk": "0.0.0-split-runtime-preview.5d46b14",
92
- "@agent-os-pkgs/grep": "0.0.0-split-runtime-preview.5d46b14",
93
- "@agent-os-pkgs/gzip": "0.0.0-split-runtime-preview.5d46b14",
94
- "@agent-os-pkgs/jq": "0.0.0-split-runtime-preview.5d46b14",
85
+ "@agentos-software/coreutils": "0.3.0-rc.2",
86
+ "@agentos-software/curl": "0.3.0-rc.2",
87
+ "@agentos-software/diffutils": "0.3.0-rc.2",
88
+ "@agentos-software/fd": "0.3.0-rc.2",
89
+ "@agentos-software/file": "0.3.0-rc.2",
90
+ "@agentos-software/findutils": "0.3.0-rc.2",
91
+ "@agentos-software/gawk": "0.3.0-rc.2",
92
+ "@agentos-software/grep": "0.3.0-rc.2",
93
+ "@agentos-software/gzip": "0.3.0-rc.2",
94
+ "@agentos-software/jq": "0.3.0-rc.2",
95
95
  "@rivet-dev/agentos-opencode": "link:../../registry/agent/opencode",
96
96
  "@rivet-dev/agentos-pi": "link:../../registry/agent/pi",
97
97
  "@rivet-dev/agentos-pi-cli": "link:../../registry/agent/pi-cli",
98
- "@agent-os-pkgs/ripgrep": "0.0.0-split-runtime-preview.5d46b14",
99
- "@agent-os-pkgs/sed": "0.0.0-split-runtime-preview.5d46b14",
100
- "@agent-os-pkgs/tar": "0.0.0-split-runtime-preview.5d46b14",
101
- "@agent-os-pkgs/tree": "0.0.0-split-runtime-preview.5d46b14",
102
- "@agent-os-pkgs/yq": "0.0.0-split-runtime-preview.5d46b14",
98
+ "@agentos-software/ripgrep": "0.3.0-rc.2",
99
+ "@agentos-software/sed": "0.3.0-rc.2",
100
+ "@agentos-software/tar": "0.3.0-rc.2",
101
+ "@agentos-software/tree": "0.3.0-rc.2",
102
+ "@agentos-software/yq": "0.3.0-rc.2",
103
103
  "@types/node": "^22.10.2",
104
104
  "pi-acp": "^0.0.23",
105
105
  "sandbox-agent": "^0.4.2",