diff --git a/README.md b/README.md index b98b4c6b56..aacd00ef3b 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ const result = await handle.exec("cat /out.txt"); console.log(result.stdout); // "hi" ``` -`@rivet-dev/agentos` runs each VM as a Rivet Actor with built-in persistence, sleep/wake, multiplayer, preview URLs, and orchestration. For direct in-process VM control without the actor runtime, use [`@rivet-dev/agentos-core`](https://agentos-sdk.dev/docs/core) standalone: `AgentOs.create()` boots a VM and returns a handle you call directly. +`@rivet-dev/agentos` runs each VM as a Rivet Actor with built-in persistence, sleep/wake, multiplayer, preview URLs, and orchestration. To embed VM control in an existing Node.js application without the actor runtime, use [`@rivet-dev/agentos-core`](https://agentos-sdk.dev/docs/quickstart-embedded): `AgentOs.create()` boots a VM and returns a handle you call directly. See the [Quickstart guide](https://agentos-sdk.dev/docs/quickstart) for the full walkthrough. agentOS is in preview and the API is subject to change — questions and issues welcome on [Discord](https://rivet.dev/discord). diff --git a/docs-internal/design/execution-api-redesign.md b/docs-internal/design/execution-api-redesign.md index 43d996d461..066b41cf22 100644 --- a/docs-internal/design/execution-api-redesign.md +++ b/docs-internal/design/execution-api-redesign.md @@ -382,7 +382,7 @@ There is no `vm.executions.*` after this change. - `website/src/content/docs/docs/javascript.mdx` - `website/src/content/docs/docs/python.mdx` - `docs/features/typescript.mdx` -- `website/src/content/docs/docs/core.mdx` +- `website/src/content/docs/docs/embedded.mdx` - Add a "Contexts" section; retarget the TS namespace; replace all `executionId` / `createIfMissing` / `detached` call sites with `createContext` / `contextId` / `spawn`. Validate with `pnpm --dir website build`. diff --git a/docs/CLAUDE.md b/docs/CLAUDE.md index 2d6ae04c2c..1e05cf7235 100644 --- a/docs/CLAUDE.md +++ b/docs/CLAUDE.md @@ -105,6 +105,9 @@ Applies to everything published on the website. periods instead. - Do not document deltas. A reader who never saw the old version gains nothing from "this was renamed". +- Every agentOS docs page ends with a concise `## Embedded API` section. Prefer + checked `` examples over prose. End with: `Read more in the + [embedded API quickstart](/agentos/docs/quickstart-embedded).` ## Previewing locally diff --git a/docs/content/docs/agent-to-agent.mdx b/docs/content/docs/agent-to-agent.mdx index 2d4c572c43..eb90359bc7 100644 --- a/docs/content/docs/agent-to-agent.mdx +++ b/docs/content/docs/agent-to-agent.mdx @@ -35,3 +35,12 @@ Bindings are the natural communication layer between agents because: - Each agent has its own isolated VM and filesystem (they share no filesystem). Pass file contents through the binding input, then use `writeFile` in the binding to land them in the other VM. - Use [Workflows](/agentos/docs/workflows) to make multi-agent pipelines durable across restarts. + +## Embedded API + +Create one `AgentOs` handle per agent and call the reviewer from a host binding. +Your application owns both handles and their lifecycle. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/approvals.mdx b/docs/content/docs/approvals.mdx index de28721dd8..b2366b13fe 100644 --- a/docs/content/docs/approvals.mdx +++ b/docs/content/docs/approvals.mdx @@ -39,3 +39,12 @@ For a fully automated session, omit `permissionPolicy` or choose `allow_all` exp For unattended fail-closed work, choose `reject_all` explicitly. ACP approval is advisory; VM filesystem, network, and process permissions remain the security boundary. Automatically handled requests are neither emitted nor persisted. + +## Embedded API + +Approval requests arrive through the embedded VM's process-local +`onSessionEvent()` callback. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/architecture.mdx b/docs/content/docs/architecture.mdx index 741fb466ff..9311a418c5 100644 --- a/docs/content/docs/architecture.mdx +++ b/docs/content/docs/architecture.mdx @@ -307,7 +307,7 @@ An agent (such as [Pi](https://github.com/mariozechner/pi-coding-agent)) is just ## Orchestration (Rivet Actors) -The `agentOS()` actor (from `@rivet-dev/agentos`) wraps the raw VM in a [Rivet Actor](/agentos/docs/core), which adds durable state, scheduling, and orchestration. This is what gives you persistence, cron, and workflows out of the box. It also registers the [inspector](/agentos/docs/inspector) tabs in the Rivet dashboard, so every actor comes with a live view of its transcript, filesystem, and processes. +The `agentOS()` actor (from `@rivet-dev/agentos`) wraps the raw VM in a [Rivet Actor](/actors/docs/), which adds durable state, scheduling, and orchestration. This is what gives you persistence, cron, and workflows out of the box. It also registers inspector tabs in the Rivet dashboard, so every actor comes with a live view of its transcript, filesystem, and processes. diff --git a/docs/content/docs/authentication.mdx b/docs/content/docs/authentication.mdx index 781b08c2ad..6851d3968e 100644 --- a/docs/content/docs/authentication.mdx +++ b/docs/content/docs/authentication.mdx @@ -22,3 +22,12 @@ The server declares the credential shape and validates it in `onBeforeConnect` ( See [Actor Authentication](/actors/docs/authentication) for JWT validation, role-based access control, external auth providers, and token caching. + +## Embedded API + +This layer requires Rivet Actors. An [embedded](/agentos/docs/embedded) VM has no connections, no `params`, and no `onBeforeConnect`, so `AgentOs.create()` authenticates nobody. Your application authenticates its own callers before it touches the VM handle, and decides which caller may reach which VM. + +Session credentials still work through `vm.sessions.open()`; see +[Models & Credentials](/agentos/docs/models-and-credentials#embedded-api). + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/bash.mdx b/docs/content/docs/bash.mdx index a02f2935e5..4347f06f16 100644 --- a/docs/content/docs/bash.mdx +++ b/docs/content/docs/bash.mdx @@ -49,3 +49,10 @@ Every command inherits the VM [permission policy](/agentos/docs/permissions) and [resource limits](/agentos/docs/resource-limits). + +## Embedded API + +The examples above already use `AgentOs.create()`. The host owns `dispose()`, +and filesystem state only outlives the VM when you configure `database`. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/bindings.mdx b/docs/content/docs/bindings.mdx index 7daf0733eb..ce9d0f1c6c 100644 --- a/docs/content/docs/bindings.mdx +++ b/docs/content/docs/bindings.mdx @@ -89,3 +89,12 @@ Use bindings when you want to expose your own JavaScript functions to agents. Us Binding calls from the agent securely invoke your `execute()` functions on the host. Your functions run with full access to the host environment, so you can call databases, APIs, and services directly without proxying credentials into the VM. The agent never sees the credentials, it only sees the binding's input/output contract. Bindings run on the host with full access to the host environment, so do not expose bindings that could compromise the host without appropriate safeguards. + +## Embedded API + +Pass the same binding groups to `AgentOs.create()`. The binding contract and +generated VM commands are unchanged. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/browser.mdx b/docs/content/docs/browser.mdx index f4509c83cc..abff516830 100644 --- a/docs/content/docs/browser.mdx +++ b/docs/content/docs/browser.mdx @@ -67,3 +67,12 @@ browse cloud projects list # list Browserbase projects The [interactive driver mode](https://docs.browserbase.com/integrations/skills/browse-cli) (`browse open`, `browse click`, …) is not supported inside the VM yet ([#1631](https://github.com/rivet-dev/agentos/issues/1631)). For interactive automation, run `browse` inside an external sandbox via [External Sandboxes](/agentos/docs/sandboxes). + +## Embedded API + +Install the same Browserbase software package and pass its credentials through +the embedded session environment. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/core.mdx b/docs/content/docs/core.mdx deleted file mode 100644 index 9c5555fff9..0000000000 --- a/docs/content/docs/core.mdx +++ /dev/null @@ -1,150 +0,0 @@ ---- -title: "Direct VM API" -description: "Use the direct agentOS VM API to create and control isolated execution environments, or compose it inside a Rivet Actor." -skill: true ---- - -`@rivet-dev/agentos` ships both the direct `AgentOs` VM API and the `agentOS()` -actor API. - -## Direct VM vs actor - -| | Direct VM | Actor | -|-|---|---| -| Persistence | In-memory by default (pluggable via [mounts](#mounts)) | Persistent filesystem and sessions | -| Distributed state | Manage yourself | Built-in | -| Stateful VMs | Complex to run yourself | Built into Rivet | -| Sleep/wake | Manual `dispose()` / `create()` | Automatic | -| Events | Direct callbacks | Broadcast to all clients | -| Preview URLs | None | Built-in signed URL server | -| Multiplayer | N/A | Multiple clients per actor | -| Orchestration | N/A | Workflows, queues, cron | -| Agent-to-agent | Custom | Built into [Rivet Actors](/agentos/docs/agent-to-agent) | -| Authentication | Set up yourself | [Docs](/agentos/docs/authentication) | - -- Use [Rivet Actors](/actors/docs/) for persistence, - networking, and orchestration. -- Use `AgentOs.create()` for direct VM control in a Node.js process. -- `agentOS()` returns an ordinary TypeScript Rivet actor definition — VM options - plus normal actor state, actions, events, queues, connection types, and - lifecycle hooks (`onBeforeConnect`). -- AgentOS actions/events merge in automatically; their names are reserved. -- The VM is created lazily on the first AgentOS action after wake, disposed on - sleep — so a connection can subscribe before `vmBooted`. -- Creation input flows through `client.vm.create("key", { input })` and reaches - `createState(c, input)` and `onCreate(c, input)`. - -## Install - -```bash -npm install @rivet-dev/agentos -``` - -## Boot a VM - -`AgentOs.create()` boots the VM in-process and returns a handle you call -directly — no actor runtime, no client/server split. - - - -## Sidecar process - -- Every VM runs inside a **shared sidecar process**, not its own process. -- All VMs default to a single process-global sidecar (the `default` pool); each - extra VM adds only a V8 isolate + its kernel state. -- This keeps per-VM memory in the tens of MB and warm creation in single-digit - ms (see [Performance](/agentos/docs/performance)). -- Automatic for `agentOS()`, `AgentOs.create()`, and Rivet Actors. -- Disposing a VM tears down only that VM; the sidecar is reused for the host - process lifetime. -- Advanced: the direct VM API exposes explicit sidecar handles to isolate a - group of VMs in their own process. - - - -## Filesystem - - - -## Contexts - -Contexts retain JavaScript/TypeScript or Python globals between attached calls. -Create one explicitly, then pass its `contextId`; unknown IDs fail instead of -silently creating fresh state. A context pins to the first inline language used, -although JavaScript and TypeScript intentionally share one isolate. - - - -Contexts live for the VM lifetime. In an actor, sleep disposes the VM and its -contexts, so create a context lazily on the first stateful action after wake -instead of persisting and blindly reusing its ID. - -## Processes - -- `process.spawn()` and language `spawn` methods return a numeric `pid`. -- `onProcessOutput(pid, …)` — unified stdout/stderr stream. -- `onProcessExit(pid, …)` — completion. - - - -## Agent sessions - -- `openSession` negotiates the adapter and resolves without a value. -- Omit `sessionId` → `main`. Call `getSession` only for durable metadata. -- Register `onSessionEvent` **before** prompting for live deltas. -- Native ACP updates and permission request/response share the sequenced - `onSessionEvent` stream. -- Durable entries recover via `readHistory`; ephemeral agent/thought deltas do - not. - - - -## Networking - -`httpRequest({ port, path, ... })` reaches a server inside the VM and returns a -bounded, serializable response DTO. - - - -## Cron jobs - -- Run an `"exec"` command or a `"session"` prompt on a schedule. -- Fired jobs surface through `onCronEvent`. - - - -## Mounts - -- Configure filesystem backends at boot. -- Native mount plugins (host directories, S3, etc.) are passed via `plugin`, - each with an `id` and a `config`. - - - -## Configuration reference - -- All VM config is a single flat object passed to `AgentOs.create()`. -- The [`agentOS()` actor](/agentos/docs/quickstart) accepts the same options and layers - persistence, sleep/wake, and preview URLs on top. - - - -See [Mounts](#mounts) and [Software](/agentos/docs/software). - -### Session events - -- `onSessionEvent` receives a union of exact native ACP `SessionUpdate`, - `RequestPermissionRequest`, and `RequestPermissionResponse` payloads wrapped - with AgentOS durability metadata. -- Register before prompting. -- On reconnect, read durable history after your last sequence and dedup by - `(sessionId, sequence)`. - - - -### Timeouts and sleep - -- Action timeouts and automatic sleep/wake are [`agentOS()` actor](/agentos/docs/quickstart) - features, not the direct VM API. -- A direct VM stays alive until `dispose()`. See - [Persistence & Sleep](/agentos/docs/persistence). diff --git a/docs/content/docs/crash-course.mdx b/docs/content/docs/crash-course.mdx deleted file mode 100644 index ae602e345a..0000000000 --- a/docs/content/docs/crash-course.mdx +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: "Crash Course" -description: "Learn agentOS fundamentals by creating an isolated VM, launching a coding-agent session, sending prompts, and inspecting durable results." -skill: true ---- - - -agentOS is in preview and the API is subject to change. If you run into issues, please [report them on GitHub](https://github.com/rivet-dev/rivet/issues) or [join our Discord](https://rivet.dev/discord). - - -{/* SKILL_OVERVIEW_START */} - -## When to Use agentOS - -- **Coding agents**: Run any coding agent with full OS access, file editing, shell execution, and tool use. -- **Automated pipelines**: CI-like workflows where agents clone repos, fix bugs, run tests, and open PRs. -- **Multi-agent systems**: Coordinators dispatching to specialized agents, review pipelines, planning chains. -- **Scheduled maintenance**: Cron-based agents that audit code, update dependencies, or generate reports. -- **Collaborative workspaces**: Multiple users observing and interacting with the same agent session in realtime. - -## Minimal Project - - - - - - - -After the quickstart, customize your agent with the [Registry](/agentos/registry/). - -## Agents - -### Sessions & Transcripts - -Create agent sessions, send prompts, and stream responses in realtime. Transcripts are persisted automatically across sleep/wake cycles. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/sessions)* - -### Approvals - -Approve or deny agent tool use with human-in-the-loop patterns or auto-approve for trusted workloads. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/approvals)* - -### Bindings - -Expose your JavaScript functions to agents as CLI commands inside the VM. Each binding group becomes a binary at `/usr/local/bin/agentos-{name}`, and each binding becomes a subcommand with flags auto-generated from its Zod input schema. The server below defines a `weather` binding group with a `forecast` binding; the client opens a session and prompts the agent, which calls the binding itself as a shell command. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/bindings) or [Documentation](/agentos/docs/bindings)* - -### Agent-to-Agent - -Let one agent call another through a [binding](/agentos/docs/bindings). The coder gets a `review` binding it invokes itself, which bridges into the reviewer's isolated VM. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/agent-to-agent)* - -### Multiplayer - -Connect multiple clients to the same agent VM. All subscribers see session output, process logs, and shell data in realtime. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/multiplayer)* - -### Workflows & Graphs - -Orchestrate multi-step agent tasks with durable workflows that survive crashes and restarts. - - - -[Documentation](/agentos/docs/workflows) - -## Operating System - -### Filesystem - -Read, write, and manage files inside the VM. The `/home/agentos` directory is persisted automatically across sleep/wake cycles. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/filesystem)* - -### Processes & Shell - -Execute commands, spawn long-running processes, and open interactive shells. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/processes)* - -### Networking & Previews - -Proxy HTTP requests into VMs with `httpRequest`. Create actor-namespaced preview URLs for port forwarding VM services to shareable public URLs. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/networking)* - -### Crons & Loops - -Schedule recurring commands and agent sessions with cron expressions. - - - - - - - -*See [Full Example](https://github.com/rivet-dev/agentos/tree/main/examples/crash-course) or [Documentation](/agentos/docs/cron)* - -### External Sandboxes - -agentOS uses a hybrid model: agents run in a lightweight VM by default and mount a full sandbox on demand for heavy workloads like browsers, compilation, and desktop automation. Sandboxes are powered by [Sandbox Agent](https://sandboxagent.dev), so you can swap providers without changing agent code. Mount the sandbox as a filesystem and expose its process management as bindings. - - - -[Documentation](/agentos/docs/sandboxes) - -{/* SKILL_OVERVIEW_END */} diff --git a/docs/content/docs/cron.mdx b/docs/content/docs/cron.mdx index e274a16994..b72889bc3e 100644 --- a/docs/content/docs/cron.mdx +++ b/docs/content/docs/cron.mdx @@ -72,3 +72,12 @@ Schedule a recurring agent session to periodically check on a task. This is the The agent sleeps between executions and only consumes resources when the cron job fires. + +## Embedded API + +The cron API is identical, but events are process-local. Jobs only run while +the embedded VM is alive, so the host must reschedule them after a restart. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/debugging.mdx b/docs/content/docs/debugging.mdx index 4b8dc3cdef..f54f4cdf77 100644 --- a/docs/content/docs/debugging.mdx +++ b/docs/content/docs/debugging.mdx @@ -3,7 +3,7 @@ title: "Debugging" description: "Diagnose agentOS sessions, tool calls, VM crashes, and runtime failures by collecting coding-agent logs, sidecar logs, and execution context." --- -Before reaching for logs, open the [inspector](/agentos/docs/inspector): it shows the live transcript, pending permission requests (the most common reason an agent looks stuck), and the process tree. +Before reaching for logs, open the actor inspector in the Rivet dashboard. It shows the live transcript, pending permission requests (the most common reason an agent looks stuck), and the process tree. Two log streams help diagnose what's happening inside a VM: the **agent's** own output and the **runtime (sidecar)** logs. @@ -13,22 +13,15 @@ The coding agent (ACP adapter) runs as a process inside the VM and uses **stdout -It's a VM-level option covering every session's agent process; if omitted, chunks are written to the host `process.stderr` by default. See [Sessions → Agent logs](/agentos/docs/sessions#agent-logs). +It's a VM-level option covering every session's agent process; if omitted, +chunks are written to the host `process.stderr` by default. See +[Sessions](/agentos/docs/sessions) for session lifecycle and history. ## Agent crashes (`onAgentExit`) If an adapter exits unexpectedly, the runtime logs the exit, does **not** restart it or replay an uncertain prompt, and fires `onAgentExit`: -```ts -const agentOs = await AgentOs.create({ - software: [pi], - onAgentExit(event) { - // restart is always "not_attempted". A later explicit prompt restores the - // durable session through resume, load, or bounded transcript continuation. - console.warn(`agent exited (code ${event.exitCode}), restart=${event.restart}`); - }, -}); -``` + The durable session and committed SQLite history remain available. The crash *reason* is on the adapter's stderr; the exit event reports that the live runtime disappeared. A later explicit prompt performs restoration. See [Sessions](/agentos/docs/sessions). @@ -60,3 +53,10 @@ Most sidecar log activity is on the session/ACP path. A bare `AgentOs.create()` Use **agent logs** to see what the agent did (tool calls, model errors), and **runtime logs** to see what the sidecar did around it (request timing, DNS, lifecycle). + +## Embedded API + +The examples above already use `AgentOs.create()`. Its callbacks and sidecar +logs are process-local; the actor inspector is not available. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/embedded.mdx b/docs/content/docs/embedded.mdx new file mode 100644 index 0000000000..39fffa7c36 --- /dev/null +++ b/docs/content/docs/embedded.mdx @@ -0,0 +1,84 @@ +--- +title: "Embedded VMs" +description: "Reference for embedding agentOS VMs in an existing Node.js application without Rivet Actors." +skill: true +--- + +Use the embedded API when you already have a Node.js application and want to +control agentOS VMs directly. You manage VM identity, persistence, and lifecycle +yourself instead of using Rivet Actors. + +To create your first embedded VM, start with the +[embedded quickstart](/agentos/docs/quickstart-embedded). + +This page covers only what is different about embedding. Each capability is +documented on its own page, which ends with a short `Embedded API` section. + +## Embedded API vs actor + +| | Embedded API | Actor | +|-|---|---| +| Persistence | In-memory unless you configure `database`, plus [mounts](/agentos/docs/filesystem#mounts) | Actor SQLite injected automatically | +| Distributed state | Manage yourself | Built-in | +| Stateful VMs | Complex to run yourself | Built into Rivet | +| Sleep/wake | Manual `dispose()` / `create()` | Automatic | +| Events | Direct in-process callbacks | Broadcast to every connected client | +| Preview URLs | Serve them from your own application | Built-in signed URL server | +| Multiplayer | Fan out from your own application | Multiple clients per actor | +| Orchestration | VM-local [cron](/agentos/docs/cron) while the VM is alive | Workflows, queues, and cron | +| Agent-to-agent | [Bindings](/agentos/docs/agent-to-agent) between VMs you own | Built into [Rivet Actors](/agentos/docs/agent-to-agent) | +| Authentication | Your application's own | [Docs](/agentos/docs/authentication) | + +- Use [Rivet Actors](/actors/docs/) for persistence, networking, and + orchestration. +- Use `AgentOs.create()` to embed VM control in a Node.js application. +- `agentOS()` returns an ordinary TypeScript Rivet actor definition: VM options + plus normal actor state, actions, events, queues, connection types, and + lifecycle hooks (`onBeforeConnect`). +- agentOS actions/events merge in automatically; their names are reserved. +- The VM is created lazily on the first agentOS action after wake, disposed on + sleep, so a connection can subscribe before `vmBooted`. +- Creation input flows through `client.vm.create("key", { input })` and reaches + `createState(c, input)` and `onCreate(c, input)`. + +## Lifecycle + +- `AgentOs.create()` resolves to a VM handle. There is no actor server, client, + or connection, so your application owns VM identity: there is no actor key, + no `getOrCreate`, and no routing. +- The VM stays alive until you call `dispose()`. Nothing sleeps it for you. +- Action timeouts and automatic sleep/wake are [`agentOS()` actor](/agentos/docs/quickstart) + features. See [Persistence & Sleep](/agentos/docs/persistence) for the actor + behavior the embedded API leaves to you. +- Every `on*` callback is registered on one handle in one process. Nothing is + broadcast to other processes or clients. + +## Configuration reference + +All VM config is a single flat object passed to `AgentOs.create()`. The +[`agentOS()` actor](/agentos/docs/quickstart) accepts the same options and layers +persistence, sleep/wake, and preview URLs on top. + +Durability is the one option you must supply yourself. Actors inject their own +SQLite database; an embedded VM keeps the root filesystem and session catalog +in memory until you pass `database`, and loses both on `dispose()`. + + + +See [Filesystem](/agentos/docs/filesystem#mounts) for mount plugins and +[Software](/agentos/docs/software) for the package list. + +## Sidecar process + +- Every VM runs inside a **shared sidecar process**, not its own process. +- All VMs default to a single process-global sidecar (the `default` pool); each + extra VM adds only a V8 isolate + its kernel state. +- This keeps per-VM memory in the tens of MB and warm creation in single-digit + ms (see [Performance](/agentos/docs/performance)). +- Automatic for `agentOS()`, `AgentOs.create()`, and Rivet Actors. +- Disposing a VM tears down only that VM; the sidecar is reused for the host + process lifetime. +- Advanced: the embedded API exposes explicit sidecar handles to isolate a + group of VMs in their own process. + + diff --git a/docs/content/docs/filesystem.mdx b/docs/content/docs/filesystem.mdx index 00580e23ba..9c3f53bd60 100644 --- a/docs/content/docs/filesystem.mdx +++ b/docs/content/docs/filesystem.mdx @@ -62,7 +62,7 @@ The actor's durable root is handled separately: the sidecar connects directly to ## File operations -These operations are primarily what the agent uses inside the VM, and are also available from the client to seed inputs and read results. For large or read-only inputs (a repo, a dataset), a read-only [host mount](#mounts) is faster than copying files in. Programs that need stdin or live output use exec instead (see the [Direct VM API](/agentos/docs/core)). +These operations are primarily what the agent uses inside the VM, and are also available from the client to seed inputs and read results. For large or read-only inputs (a repo, a dataset), a read-only [host mount](#mounts) is faster than copying files in. Programs that need stdin or live output use exec instead (see [Processes & Shell](/agentos/docs/processes)). ### Read and write @@ -88,16 +88,7 @@ These operations are primarily what the agent uses inside the VM, and are also a Filesystem access is governed by the VM permission policy. The filesystem scope is granted by default; restrict it by path, for example to deny a sensitive directory: -```ts -const vm = agentOS({ - permissions: { - fs: { - default: "allow", - rules: [{ mode: "deny", operations: ["*"], paths: ["/home/agentos/secrets/**"] }], - }, - }, -}); -``` + See [Permissions](/agentos/docs/permissions) for the full configuration. @@ -114,3 +105,15 @@ With no `mounts` configured, every VM boots an Alpine-based root filesystem with - `/etc`, `/lib`, `/opt`, `/root`, `/run`, `/srv`, `/tmp`, `/var`, `/mnt`: standard system paths. It is backed by the VM's own filesystem and persisted across sleep/wake. Nothing comes from or touches the host disk. + +## Embedded API + +Filesystem methods and mount descriptors are identical. Configure `database` +when the root filesystem must survive `dispose()`; mounts persist through their +own backends. + + + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx index 8d5b79ee6f..3f0e9ad5e4 100644 --- a/docs/content/docs/index.mdx +++ b/docs/content/docs/index.mdx @@ -11,8 +11,8 @@ and orchestration built in. Boot a VM and run your first coding agent. - - Learn the core agentOS concepts. + + Run agentOS directly inside an existing Node.js application. Run Pi, Claude Code, Codex, and OpenCode. diff --git a/docs/content/docs/inspector.mdx b/docs/content/docs/inspector.mdx deleted file mode 100644 index 16af4a9243..0000000000 --- a/docs/content/docs/inspector.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "Inspector" -description: "Inspect and control a live agentOS VM from the Rivet dashboard, including transcripts, files, processes, system data, and session actions." ---- - -Every agentOS actor ships a set of tabs for the Rivet dashboard's actor inspector. Open a running VM and you can read the agent's transcript, send it prompts, answer permission requests, browse the filesystem, and watch its processes. Nothing to configure: the tabs register automatically when you use `agentOS()`. - -## Open the inspector - -Any server with an agentOS actor gets the inspector for free: - - - -Start the server, open the dashboard, and click into the actor: - -```bash -npx tsx server.ts -# then open http://localhost:6420/ui -``` - -The stock rivetkit tabs (state, connections, console) are replaced by the agentOS tabs. The tab assets are served by your server process through the actor gateway, so the same tabs work wherever the dashboard can reach the actor, locally or deployed. - -## Transcript - -A chat view of every session on the VM: user and agent messages, thinking, tool calls with their inputs and outputs, and the agent's plan. Plumbing events collapse into expandable rows so they never dominate the pane. - -The composer at the bottom drives the agent directly: pick an agent type, set per-session env vars (such as an API key, which stays in your browser), and send prompts. This is the same data and the same actions your code uses via `openSession`, `prompt`, and the `sessionEvent` stream. See [Sessions](/agentos/docs/sessions). - -## Approvals - -When an agent asks for permission, a banner appears above every tab with the request and its reply options. The agent's turn blocks until someone answers, so an unanswered request is the most common reason an agent looks stuck. See [Approvals](/agentos/docs/approvals). - -## Filesystem - -Browse the VM's filesystem and read files, the same view your code gets through the fs API. Note that the root filesystem is in-memory; files outside persisted mounts do not survive VM restarts. See [Filesystem](/agentos/docs/filesystem). - -## System - -Everything about the machine itself, in one scroll view. When the VM is asleep, the tab says so instead of waking it. - -- **Processes** — the full kernel process tree, refreshed live. Select a process for its details (ppid, cwd, driver, exit code), stop or kill it, and watch a live output tail for processes spawned through the SDK. See [Processes & Shell](/agentos/docs/processes). -- **Software** — installed software bundles with their commands. See [Software](/agentos/docs/software). -- **Mounts** — the configured mounts with their access modes. See [Sandbox Mounting](/agentos/docs/sandboxes). -- **Preview links** — create a signed URL to an HTTP server on a port inside the VM. See [Networking](/agentos/docs/networking). - -Actor identity and lifecycle controls (id, key, runner, sleep, destroy) live in the dashboard's own Metadata tab; the System tab covers only what is inside the VM. - -## VM status badges - -When something needs attention, compact badges appear in each tab's own toolbar: a state note when the VM is asleep, shut down after an error, or the sidecar is unhealthy, and an amber warnings pill (resource-limit warnings and agent crash exits, expandable into a panel). While the VM is simply healthy nothing shows; the live session count sits in the Transcript tab's session list. The health poll behind the badges never wakes a sleeping VM, so leaving the inspector open never boots anything. The warnings are the same data your code receives through `onLimitWarning` and `onAgentExit`; see [Resource Limits](/agentos/docs/resource-limits) and [Debugging](/agentos/docs/debugging). - -## Access control - -The dashboard holds a single per-actor inspector token, and that token authorizes every action the tabs can perform, including sending prompts, answering permission requests, writing files, and killing processes. There is no per-action scoping: treat dashboard access to an actor as operator access to its VM. - -## How it relates to your code - -The inspector is a window onto the same actor actions the SDK exposes; nothing it shows is inspector-only state. Every tab maps to an API you can call from your own code, so anything you find while inspecting (a session to resume, a file to read, a process to kill) is one SDK call away. diff --git a/docs/content/docs/javascript.mdx b/docs/content/docs/javascript.mdx index 4f772b8921..3951977f06 100644 --- a/docs/content/docs/javascript.mdx +++ b/docs/content/docs/javascript.mdx @@ -53,6 +53,10 @@ A context runs one operation at a time — reusing a busy `contextId` fails immediately. Files, npm, Bash, and type checks may pass the same id, but they run in fresh processes and never touch retained memory. +Create the context explicitly before use; an unknown id fails instead of silently +starting fresh state. A context pins to the first inline language that used it, +though JavaScript and TypeScript intentionally share one isolate. + Contexts live for the VM lifetime. They do not survive actor sleep/wake, because the VM is disposed; create them lazily on the first stateful use after wake. @@ -104,3 +108,11 @@ Every operation inherits the VM [permission policy](/agentos/docs/permissions) a [resource limits](/agentos/docs/resource-limits). + +## Embedded API + +The examples above already use `AgentOs.create()`. Contexts remain available +until the host calls `dispose()`; there is no actor sleep cycle to recreate them +after. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/models-and-credentials.mdx b/docs/content/docs/models-and-credentials.mdx index ae5aa45777..4429971e33 100644 --- a/docs/content/docs/models-and-credentials.mdx +++ b/docs/content/docs/models-and-credentials.mdx @@ -37,3 +37,12 @@ Resolve each tenant's key and pass it at session creation: - AgentOS forwards the session environment and preserves the agent's native model behavior — no second model-selection layer. - See your [agent](/agentos/docs/agents/pi) page for supported models and providers. + +## Embedded API + +Pass provider credentials through `env` on `vm.sessions.open()`. The host owns +the mapping between callers and VM handles. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/multiplayer.mdx b/docs/content/docs/multiplayer.mdx index a70db9c102..28511b6204 100644 --- a/docs/content/docs/multiplayer.mdx +++ b/docs/content/docs/multiplayer.mdx @@ -16,3 +16,8 @@ All clients connected to the same actor receive broadcasted events. This enables +## Embedded API + +Multiplayer requires Rivet Actors. An [embedded](/agentos/docs/embedded) VM has no connections and no broadcast: `vm.onSessionEvent()` and the other `on*` callbacks fire only in the process that created the VM. To let several clients watch one agent, either use an actor, or fan those callbacks out over your own application's transport and let it own client identity. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/networking.mdx b/docs/content/docs/networking.mdx index 333acfb21e..69c10125b1 100644 --- a/docs/content/docs/networking.mdx +++ b/docs/content/docs/networking.mdx @@ -63,3 +63,12 @@ const vm = agentOS({ ``` See [Permissions](/agentos/docs/permissions) for the full configuration. + +## Embedded API + +Use `httpRequest()` directly on the VM handle. Preview URLs remain actor-only; +an embedded host must proxy and authenticate browser traffic itself. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/permissions.mdx b/docs/content/docs/permissions.mdx index c7f5e53a8a..9ee78a75fb 100644 --- a/docs/content/docs/permissions.mdx +++ b/docs/content/docs/permissions.mdx @@ -100,3 +100,11 @@ When a scope or matching rule denies an operation, the kernel rejects it with `E ``` EACCES: permission denied, tcp://example.com:80: blocked by network.http policy ``` + +## Embedded API + +Pass the same permission policy to `AgentOs.create()`. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/persistence.mdx b/docs/content/docs/persistence.mdx index 30fb64519e..4d16c55ae7 100644 --- a/docs/content/docs/persistence.mdx +++ b/docs/content/docs/persistence.mdx @@ -73,3 +73,12 @@ Live subscriptions resume only from new events. Ephemeral message deltas that ha The filesystem, core, and TypeScript actor independently own `agentos_fs_schema_version`, `agentos_core_schema_version`, and `agentos_actor_schema_version`. There is no shared schema-version table or global migration sequence. `agentos_actor_preview_tokens`, `agentos_actor_dynamic_mounts`, and `agentos_actor_linked_software` are actor-owned hosting metadata. This per-VM database is trusted plaintext storage. Session environment values, MCP credentials, prompts, messages, and tool or permission payloads may be stored without encryption or redaction so they can survive sleep. Protect database and backup access accordingly. See [Sessions & Persistence](/agentos/docs/architecture/sessions-persistence/) for exact event storage and retention bounds. + +## Embedded API + +Configure a SQLite database, then recreate the VM with the same configuration. +Processes, contexts, subscriptions, and cron jobs remain VM-local. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/processes.mdx b/docs/content/docs/processes.mdx index bab7ae1a8b..278a264251 100644 --- a/docs/content/docs/processes.mdx +++ b/docs/content/docs/processes.mdx @@ -48,3 +48,13 @@ Open an interactive shell with PTY support. Subscribe to native `shellData`, `sh + +## Embedded API + +Process and terminal methods are identical except for actor-only shell listing +and replay. Embedded output and exit callbacks are already scoped to one VM and +one host process. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/python.mdx b/docs/content/docs/python.mdx index bec17df792..577528b356 100644 --- a/docs/content/docs/python.mdx +++ b/docs/content/docs/python.mdx @@ -101,3 +101,11 @@ Every operation inherits the VM [permission policy](/agentos/docs/permissions) a [resource limits](/agentos/docs/resource-limits). + +## Embedded API + +The examples above already use `AgentOs.create()`. Python contexts remain +available until the host calls `dispose()`; there is no actor sleep cycle to +recreate them after. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/quickstart-embedded.mdx b/docs/content/docs/quickstart-embedded.mdx new file mode 100644 index 0000000000..780144ec89 --- /dev/null +++ b/docs/content/docs/quickstart-embedded.mdx @@ -0,0 +1,66 @@ +--- +title: "Quickstart (Embedded)" +description: "Run a coding agent in an embedded agentOS VM from an existing Node.js application." +skill: true +--- + +Use the embedded API when you want to run agentOS directly inside an existing +Node.js application without Rivet Actors. Your application owns VM identity, +persistence, and lifecycle. + +## Choosing between Actors and embedded + +Use [Rivet Actors](/agentos/docs/quickstart) when you want agentOS to manage +persistence, distributed state, sleep and wake, multiplayer, and orchestration. +Use the embedded API when your application needs direct VM control and will own +those responsibilities itself. + +| | Embedded API | Actor | +|-|---|---| +| Persistence | In-memory unless you configure `database`, plus [mounts](/agentos/docs/filesystem#mounts) | Actor SQLite injected automatically | +| Distributed state | Manage yourself | Built-in | +| Stateful VMs | Complex to run yourself | Built into Rivet | +| Sleep/wake | Manual `dispose()` / `create()` | Automatic | +| Events | Direct in-process callbacks | Broadcast to every connected client | +| Preview URLs | Serve them from your own application | Built-in signed URL server | +| Multiplayer | Fan out from your own application | Multiple clients per actor | +| Orchestration | VM-local [cron](/agentos/docs/cron) while the VM is alive | Workflows, queues, and cron | +| Agent-to-agent | [Bindings](/agentos/docs/agent-to-agent) between VMs you own | Built into [Rivet Actors](/agentos/docs/agent-to-agent) | +| Authentication | Your application's own | [Docs](/agentos/docs/authentication) | + + + +1. **Install** + + Install the core VM API and the Pi coding agent: + + ```bash + npm install @rivet-dev/agentos-core @agentos-software/pi + ``` + +2. **Set your model API key** + + ```bash + export ANTHROPIC_API_KEY=your-api-key + ``` + +3. **Create an embedded VM** + + + +4. **Run it** + + ```bash + npx tsx quickstart.ts + ``` + + + +`AgentOs.create()` returns a VM handle directly. There is no actor server or +separate client, and the VM stays alive until you call `dispose()`. + +See [Embedded VMs](/agentos/docs/embedded) for lifecycle, persistence, +configuration, and the shared sidecar, plus links to each capability page's +`Embedded API` section. Use the [actor quickstart](/agentos/docs/quickstart) when +you want built-in persistence, sleep and wake, multiplayer, preview URLs, and +orchestration. diff --git a/docs/content/docs/quickstart.mdx b/docs/content/docs/quickstart.mdx index dd2d8a711c..9989e4a503 100644 --- a/docs/content/docs/quickstart.mdx +++ b/docs/content/docs/quickstart.mdx @@ -98,7 +98,7 @@ import { AGENT_PROMPT } from '@/data/agentPrompt'; npx tsx client.ts ``` - With the server running, open http://localhost:6420/ui to watch the VM in the [inspector](/agentos/docs/inspector): the live transcript, the filesystem, and its processes. + With the server running, open http://localhost:6420/ui to watch the VM in the actor inspector: the live transcript, the filesystem, and its processes. 5. **Customize** @@ -121,9 +121,9 @@ import { AGENT_PROMPT } from '@/data/agentPrompt'; agentOS is in preview and the API is subject to change. If you run into issues, please [report them on GitHub](https://github.com/rivet-dev/rivet/issues) or [join our Discord](https://rivet.dev/discord). -## Direct VM API +## Embedded API -The same `@rivet-dev/agentos` package also exports `AgentOs.create()` for direct -VM control without the actor lifecycle, multiplayer, or orchestration layer. +The `@rivet-dev/agentos-core` package exports `AgentOs.create()` for embedded VM +control without the actor lifecycle, multiplayer, or orchestration layer. -See the [direct VM API documentation](/agentos/docs/core) for reference. +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/resource-limits.mdx b/docs/content/docs/resource-limits.mdx index 98f53eb568..9646c97b7b 100644 --- a/docs/content/docs/resource-limits.mdx +++ b/docs/content/docs/resource-limits.mdx @@ -107,3 +107,11 @@ bounded queues are tracked in a central limit registry that: See [Limits & Observability](/agentos/docs/architecture/limits-and-observability) for the full architecture. + +## Embedded API + +Pass limits and the process-local warning callback to `AgentOs.create()`. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/sandboxes.mdx b/docs/content/docs/sandboxes.mdx index a0ad3ed15a..02c7929c1f 100644 --- a/docs/content/docs/sandboxes.mdx +++ b/docs/content/docs/sandboxes.mdx @@ -136,3 +136,12 @@ ownership to the VM. RivetKit `agentOS()` intentionally rejects the `client` form because one client cannot be shared safely across actor VMs. Pass a `provider` there so every actor VM starts and owns a fresh sandbox. + +## Embedded API + +Pass a provider or an existing Sandbox Agent client to `AgentOs.create()`. +With an existing client, set `dispose` when the VM should own its lifecycle. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/sessions.mdx b/docs/content/docs/sessions.mdx index 6a2e5e4373..a9fd187890 100644 --- a/docs/content/docs/sessions.mdx +++ b/docs/content/docs/sessions.mdx @@ -8,7 +8,7 @@ AgentOS sessions are durable records backed by the VM's SQLite database. - The public session ID is stable across VM sleep and adapter restarts. - The adapter's private ACP session ID stays internal. -- The [inspector](/agentos/docs/inspector)'s Transcript tab renders the same session stream live, with a composer for prompting sessions by hand. +- The Rivet dashboard's Transcript tab renders the same session stream live, with a composer for prompting sessions by hand. ## Open a session @@ -155,3 +155,12 @@ await agent.sessions.respondPermission({ value, then replaces the cached collection. + +## Embedded API + +The session API is identical. Embedded callbacks are process-local, and history +only outlives `dispose()` when the VM has a configured `database`. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/software.mdx b/docs/content/docs/software.mdx index c0242b9515..db10973032 100644 --- a/docs/content/docs/software.mdx +++ b/docs/content/docs/software.mdx @@ -31,3 +31,11 @@ Browse all available software packages on the [Registry](/agentos/registry/). ## Custom Software Package your own agents, command packages, and WASM commands. See [Software Definition](/agentos/docs/custom-software/definition) to define a package, and [Building Binaries](/agentos/docs/custom-software/building-wasm) to compile WASM commands from source in the [agentos registry](https://github.com/rivet-dev/agentos/tree/main/registry). + +## Embedded API + +Pass software packages directly to `AgentOs.create()`. + + + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/docs/workflows.mdx b/docs/content/docs/workflows.mdx index 643aaedbe4..66b62e0a9e 100644 --- a/docs/content/docs/workflows.mdx +++ b/docs/content/docs/workflows.mdx @@ -35,3 +35,9 @@ Output of one agent session feeds into the next. Each session is created and com - Keep `state` changes and other actor-local side effects inside `ctx.step()` callbacks; use non-step workflow code only for orchestration. - Reach the agentOS VM, a separate actor, from inside a step with `ctx.client()`. - See [Workflows](/workflows/docs/) for the full workflow API reference including timers, joins, and races. + +## Embedded API + +Durable workflows require Rivet Actors. `AgentOs.create()` records no steps and replays nothing, so an [embedded](/agentos/docs/embedded) host either drives the VM from its own durable orchestrator or uses an actor. VM state survives a host restart only if you configured a `database`, and the VM itself has to be recreated. + +Read more in the [embedded API quickstart](/agentos/docs/quickstart-embedded). diff --git a/docs/content/integrations/flue.mdx b/docs/content/integrations/flue.mdx index 0fba7a70d8..c28b21ae28 100644 --- a/docs/content/integrations/flue.mdx +++ b/docs/content/integrations/flue.mdx @@ -107,7 +107,7 @@ agentOS persists the VM filesystem, including `/workspace`, to Rivet Actor stora ### Virtual machine -See the `agentOS()` [configuration reference](/agentos/docs/core#configuration-reference) to configure the VM. +See the `agentOS()` [configuration reference](/agentos/docs/embedded#configuration-reference) to configure the VM. ### Flue sandbox diff --git a/docs/content/integrations/rivet.mdx b/docs/content/integrations/rivet-actors.mdx similarity index 99% rename from docs/content/integrations/rivet.mdx rename to docs/content/integrations/rivet-actors.mdx index e8be716637..0a65c09f30 100644 --- a/docs/content/integrations/rivet.mdx +++ b/docs/content/integrations/rivet-actors.mdx @@ -1,5 +1,5 @@ --- -title: "Rivet" +title: "Rivet Actors" description: "Run agentOS natively as Rivet Actors." skill: true --- diff --git a/docs/content/integrations/vercel-eve.mdx b/docs/content/integrations/vercel-eve.mdx index c7387ff14a..b8679a6a3b 100644 --- a/docs/content/integrations/vercel-eve.mdx +++ b/docs/content/integrations/vercel-eve.mdx @@ -123,7 +123,7 @@ agentOS persists the VM filesystem, including `/workspace`, to Rivet Actor stora ### Virtual Machine -See the `agentOS()` [configuration reference](/agentos/docs/core#configuration-reference) to configure the VM. +See the `agentOS()` [configuration reference](/agentos/docs/embedded#configuration-reference) to configure the VM. ### Eve Sandbox Backend diff --git a/docs/sidebar.json b/docs/sidebar.json index 0f9de1cdf7..48488159ba 100644 --- a/docs/sidebar.json +++ b/docs/sidebar.json @@ -14,14 +14,9 @@ "icon": "faForwardFast" }, { - "title": "Crash Course", - "href": "/agentos/docs/crash-course", - "icon": "faLightbulb" - }, - { - "title": "Inspector", - "href": "/agentos/docs/inspector", - "icon": "faMagnifyingGlass" + "title": "Quickstart (Embedded)", + "href": "/agentos/docs/quickstart-embedded", + "icon": "faNodeJs" }, { "title": "agentOS vs Sandbox", @@ -105,10 +100,6 @@ "href": "/agentos/docs/javascript", "icon": "faNodeJs" }, - { - "title": "Node.js Compatibility", - "href": "/agentos/docs/javascript-compatibility" - }, { "title": "Python", "href": "/agentos/docs/python", @@ -241,6 +232,10 @@ "title": "Limitations", "href": "/agentos/docs/limitations" }, + { + "title": "Node.js Compatibility", + "href": "/agentos/docs/javascript-compatibility" + }, { "title": "Advanced", "collapsible": true, @@ -310,8 +305,8 @@ "collapsible": true, "pages": [ { - "title": "Direct VM SDK", - "href": "/agentos/docs/core" + "title": "Embedded VMs", + "href": "/agentos/docs/embedded" }, { "title": "Debugging", @@ -345,8 +340,8 @@ "href": "/agentos/integrations/flue" }, { - "title": "Rivet", - "href": "/agentos/integrations/rivet" + "title": "Rivet Actors", + "href": "/agentos/integrations/rivet-actors" }, { "title": "Vercel Eve", diff --git a/examples/bindings/exec-bash.ts b/examples/bindings/exec-bash.ts index f9f7c5e106..c4ab86abf0 100644 --- a/examples/bindings/exec-bash.ts +++ b/examples/bindings/exec-bash.ts @@ -1,4 +1,4 @@ -import { AgentOs, type Bindings } from "@rivet-dev/agentos"; +import { AgentOs, type Bindings } from "@rivet-dev/agentos-core"; import { z } from "zod"; // The handler runs on the host, so the API key never enters the VM. diff --git a/examples/bindings/exec-javascript.ts b/examples/bindings/exec-javascript.ts index 46ed243c61..cefefd4474 100644 --- a/examples/bindings/exec-javascript.ts +++ b/examples/bindings/exec-javascript.ts @@ -1,4 +1,4 @@ -import { AgentOs, type Bindings } from "@rivet-dev/agentos"; +import { AgentOs, type Bindings } from "@rivet-dev/agentos-core"; import { z } from "zod"; // The handler runs on the host, so the API key never enters the VM. diff --git a/examples/bindings/exec-python.ts b/examples/bindings/exec-python.ts index 27551f4d27..e55998c45c 100644 --- a/examples/bindings/exec-python.ts +++ b/examples/bindings/exec-python.ts @@ -1,4 +1,4 @@ -import { AgentOs, type Bindings } from "@rivet-dev/agentos"; +import { AgentOs, type Bindings } from "@rivet-dev/agentos-core"; import { z } from "zod"; // The handler runs on the host, so the API key never enters the VM. diff --git a/examples/bindings/package.json b/examples/bindings/package.json index 7c395f6f01..56f4e4b91a 100644 --- a/examples/bindings/package.json +++ b/examples/bindings/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,7 +18,6 @@ "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", "rivetkit": "catalog:rivetkit" }, "devDependencies": { diff --git a/examples/bindings/tsconfig.json b/examples/bindings/tsconfig.json index 9b8c9f6a30..b190633e18 100644 --- a/examples/bindings/tsconfig.json +++ b/examples/bindings/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"], "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"], "@agentos-software/common": ["./software/common.ts"] diff --git a/examples/browserbase/embedded.ts b/examples/browserbase/embedded.ts new file mode 100644 index 0000000000..63e42c01ed --- /dev/null +++ b/examples/browserbase/embedded.ts @@ -0,0 +1,32 @@ +import browserbase from "@agentos-software/browserbase"; +import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; + +const { ANTHROPIC_API_KEY, BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID } = + process.env; +if (!ANTHROPIC_API_KEY || !BROWSERBASE_API_KEY || !BROWSERBASE_PROJECT_ID) { + throw new Error("Set the Anthropic and Browserbase environment variables."); +} + +const vm = await AgentOs.create({ software: [pi, browserbase] }); + +try { + await vm.sessions.open({ + agent: "pi", + env: { + ANTHROPIC_API_KEY, + BROWSERBASE_API_KEY, + BROWSERBASE_PROJECT_ID, + }, + }); + await vm.sessions.prompt({ + content: [ + { + type: "text", + text: "Use browse to summarize https://example.com.", + }, + ], + }); +} finally { + await vm.dispose(); +} diff --git a/examples/browserbase/package.json b/examples/browserbase/package.json index 5ea79a991d..cfeb5e2c53 100644 --- a/examples/browserbase/package.json +++ b/examples/browserbase/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "rivetkit": "catalog:rivetkit", "@agentos-software/claude-code": "workspace:*", "@agentos-software/pi": "workspace:*", diff --git a/examples/browserbase/tsconfig.json b/examples/browserbase/tsconfig.json index e793790512..78b4a00b61 100644 --- a/examples/browserbase/tsconfig.json +++ b/examples/browserbase/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"], "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] } diff --git a/examples/core/README.md b/examples/core/README.md deleted file mode 100644 index a5a4be6e07..0000000000 --- a/examples/core/README.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "Core" -description: "Core AgentOs API: exec, config reference, lifecycle events, and mounts." -category: "Reference" -order: 1 ---- - -The core `@rivet-dev/agentos` API surface in one place: boot a VM with -`AgentOs.create()` and drive it directly for exec, filesystem, processes, agent -sessions, networking, and cron — no actor runtime and no client/server split. -Reach for this when you want a reference of what an `AgentOs` instance can do and -how it is configured. - -## How it works - -`AgentOs.create({ ... })` boots a VM in-process with its mounts, software, and -network settings, and returns an `AgentOs` instance. Everything runs through that -instance: `exec`/`spawn` for processes, `readFile`/`writeFiles`/`readdirEntries` -for the filesystem, `openSession`/`prompt` for agents, `httpRequest` for in-VM -servers, and `scheduleCron` for jobs. Portable process, shell, session, adapter, -and cron events use explicit subscription methods. Interactive permission -requests and responses are variants of the generic `onSessionEvent` union. - -- `vm.ts` — boot a VM and every instance capability (exec, filesystem, - processes, sessions, networking, cron). -- `advanced.ts` — pin VMs to a dedicated sidecar process. -- `config-reference.ts` — the full `AgentOs.create()` config surface. -- `hooks.ts` — generic durable session-event observation. -- `mounts.ts` — host-directory and S3 mount descriptors. - -## Run it - -```sh -npm install -npx tsx vm.ts -``` - -## Source - -View the source on GitHub: https://github.com/rivet-dev/agent-os/tree/main/examples/core diff --git a/examples/core/advanced.ts b/examples/core/advanced.ts deleted file mode 100644 index f1cf7f7b03..0000000000 --- a/examples/core/advanced.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AgentOs } from "@rivet-dev/agentos"; - -// One dedicated sidecar process hosting multiple VMs. -const sidecar = await AgentOs.createSidecar(); -const a = await AgentOs.create({ sidecar: { kind: "explicit", handle: sidecar } }); -const b = await AgentOs.create({ sidecar: { kind: "explicit", handle: sidecar } }); - -await a.dispose(); // tears down VM a only -await b.dispose(); -await sidecar.dispose(); // tears down the shared process diff --git a/examples/core/config-reference.ts b/examples/core/config-reference.ts deleted file mode 100644 index df004ffeac..0000000000 --- a/examples/core/config-reference.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos"; -import pi from "@agentos-software/pi"; - -// The full AgentOs.create() configuration surface. The agentOS() actor accepts -// this same options object and layers persistence, sleep/wake, and preview URLs -// on top. -const vm = await AgentOs.create({ - // Filesystems to mount at boot. Use nodeModulesMount() to expose a host - // node_modules tree at /root/node_modules. - mounts: [nodeModulesMount("/path/to/project/node_modules")], - // Software packages to install in the VM (see /docs/software) - software: [pi], - // Also install the default software bundle (sh + coreutils). Defaults to true; - // set false for a bare VM with only the software you list. - defaultSoftware: true, - // Ports exempt from SSRF checks (for testing against host-side mock servers) - loopbackExemptPorts: [3000], - // Sidecar placement — defaults to the shared `default` pool - sidecar: { kind: "shared" }, -}); diff --git a/examples/core/mounts.ts b/examples/core/mounts.ts deleted file mode 100644 index e29a8fd0bb..0000000000 --- a/examples/core/mounts.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AgentOs } from "@rivet-dev/agentos"; - -// Configure filesystem backends at boot. Native mount plugins (host -// directories, S3, etc.) are passed via `plugin`, each identified by an `id` -// and a `config` object. -const vm = await AgentOs.create({ - mounts: [ - // Host directory (read-only) - { - path: "/mnt/code", - plugin: { id: "host_dir", config: { hostPath: "/path/to/repo" } }, - readOnly: true, - }, - // S3 bucket - { - path: "/mnt/data", - plugin: { id: "s3", config: { bucket: "my-bucket", prefix: "agent/" } }, - }, - ], -}); diff --git a/examples/core/tsconfig.json b/examples/core/tsconfig.json deleted file mode 100644 index e793790512..0000000000 --- a/examples/core/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "moduleResolution": "bundler", "noEmit": true, "jsx": "react-jsx", - "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", - "paths": { - "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], - "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], - "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] - } - }, - "include": ["**/*.ts", "**/*.tsx"] -} diff --git a/examples/custom/package.json b/examples/custom/package.json index 36a676d514..a80145a812 100644 --- a/examples/custom/package.json +++ b/examples/custom/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -16,9 +16,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/custom/pi-cli.ts b/examples/custom/pi-cli.ts index c8de4bce15..7791660a97 100644 --- a/examples/custom/pi-cli.ts +++ b/examples/custom/pi-cli.ts @@ -1,6 +1,6 @@ -import { defineSoftware } from "@rivet-dev/agentos"; import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; +import { defineSoftware } from "@rivet-dev/agentos-core"; const packagePath = resolve(dirname(fileURLToPath(import.meta.url)), ".."); diff --git a/examples/custom/tsconfig.json b/examples/custom/tsconfig.json index e793790512..703536a7d8 100644 --- a/examples/custom/tsconfig.json +++ b/examples/custom/tsconfig.json @@ -4,9 +4,7 @@ "moduleResolution": "bundler", "noEmit": true, "jsx": "react-jsx", "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { - "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], - "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], - "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"] } }, "include": ["**/*.ts", "**/*.tsx"] diff --git a/examples/debugging/agent-exit.ts b/examples/debugging/agent-exit.ts new file mode 100644 index 0000000000..c326abc1b4 --- /dev/null +++ b/examples/debugging/agent-exit.ts @@ -0,0 +1,15 @@ +import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; + +const agentOs = await AgentOs.create({ + software: [pi], + onAgentExit(event) { + // A later explicit prompt restores the durable session through resume, + // load, or bounded transcript continuation. + console.warn( + `agent exited (code ${event.exitCode}), restart=${event.restart}`, + ); + }, +}); + +await agentOs.dispose(); diff --git a/examples/debugging/agent-logs.ts b/examples/debugging/agent-logs.ts index 4dc1e0080b..d23bdea7fb 100644 --- a/examples/debugging/agent-logs.ts +++ b/examples/debugging/agent-logs.ts @@ -1,16 +1,16 @@ // Capture the coding agent's stderr at the VM level to diagnose tool calls, // model errors, and crashes mid-turn. -import { AgentOs } from "@rivet-dev/agentos"; import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; const agentOs = await AgentOs.create({ - software: [pi], - onAgentStderr(event) { - // event: { sessionId, agentType, processId, pid, chunk: Uint8Array } - process.stderr.write(`[agent:${event.agentType}] `); - process.stderr.write(event.chunk); - }, + software: [pi], + onAgentStderr(event) { + // event: { sessionId, agentType, processId, pid, chunk: Uint8Array } + process.stderr.write(`[agent:${event.agentType}] `); + process.stderr.write(event.chunk); + }, }); await agentOs.dispose(); diff --git a/examples/debugging/package.json b/examples/debugging/package.json index 2384c39433..6f5968f6ef 100644 --- a/examples/debugging/package.json +++ b/examples/debugging/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -16,9 +16,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/debugging/tsconfig.json b/examples/debugging/tsconfig.json index e793790512..703536a7d8 100644 --- a/examples/debugging/tsconfig.json +++ b/examples/debugging/tsconfig.json @@ -4,9 +4,7 @@ "moduleResolution": "bundler", "noEmit": true, "jsx": "react-jsx", "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { - "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], - "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], - "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"] } }, "include": ["**/*.ts", "**/*.tsx"] diff --git a/examples/embedded/README.md b/examples/embedded/README.md new file mode 100644 index 0000000000..3099140baa --- /dev/null +++ b/examples/embedded/README.md @@ -0,0 +1,49 @@ +--- +title: "Embedded VMs" +description: "Embedded agentOS API: exec, configuration, lifecycle events, and mounts." +category: "Reference" +order: 1 +--- + +The embedded `@rivet-dev/agentos-core` API surface in one place: boot a VM with +`AgentOs.create()` and control it from your application for exec, filesystem, +processes, agent sessions, networking, and cron. There is no actor runtime or +client/server split. Reach for this when you already own the application +lifecycle and want a reference for what an `AgentOs` instance can do and how it +is configured. + +## How it works + +`AgentOs.create({ ... })` boots a VM through a shared sidecar process with its +mounts, software, and network settings, then returns an `AgentOs` instance to +the application. Everything runs through that instance: `exec`/`spawn` for processes, `readFile`/`writeFiles`/`readdirEntries` +for the filesystem, `openSession`/`prompt` for agents, `httpRequest` for in-VM +servers, and `scheduleCron` for jobs. Portable process, shell, session, adapter, +and cron events use explicit subscription methods. Interactive permission +requests and responses are variants of the generic `onSessionEvent` union. + +- `vm.ts`: boot a VM and every instance capability (exec, filesystem, + processes, sessions, networking, cron). +- `quickstart.ts`: run a coding agent directly from a Node.js application. +- `advanced.ts`: pin VMs to a dedicated sidecar process. +- `agent-to-agent.ts`: connect two embedded agents through a binding. +- `bindings.ts`: expose a host function as a command inside the VM. +- `config-reference.ts`: common `AgentOs.create()` configuration. +- `hooks.ts`: generic durable session-event observation. +- `limits.ts`: configure resource limits and receive local warnings. +- `models-and-credentials.ts`: pass provider credentials to a session. +- `mounts.ts`: host-directory and S3 mount descriptors. +- `persistence.ts`: restore filesystem state from a SQLite database. +- `permissions.ts`: apply a kernel permission policy at VM creation. +- `software.ts`: install a software package and run its command. + +## Run it + +```sh +npm install +npx tsx vm.ts +``` + +## Source + +View the source on GitHub: https://github.com/rivet-dev/agentos/tree/main/examples/embedded diff --git a/examples/embedded/advanced.ts b/examples/embedded/advanced.ts new file mode 100644 index 0000000000..c9520211e8 --- /dev/null +++ b/examples/embedded/advanced.ts @@ -0,0 +1,14 @@ +import { AgentOs } from "@rivet-dev/agentos-core"; + +// An embedded application can use one dedicated sidecar process for multiple VMs. +const sidecar = await AgentOs.createSidecar(); +const a = await AgentOs.create({ + sidecar: { kind: "explicit", handle: sidecar }, +}); +const b = await AgentOs.create({ + sidecar: { kind: "explicit", handle: sidecar }, +}); + +await a.dispose(); // tears down VM a only +await b.dispose(); +await sidecar.dispose(); // tears down the shared process diff --git a/examples/embedded/agent-to-agent.ts b/examples/embedded/agent-to-agent.ts new file mode 100644 index 0000000000..e1049e58c5 --- /dev/null +++ b/examples/embedded/agent-to-agent.ts @@ -0,0 +1,56 @@ +import pi from "@agentos-software/pi"; +import { AgentOs, type Bindings } from "@rivet-dev/agentos-core"; +import { z } from "zod"; + +const apiKey = process.env.ANTHROPIC_API_KEY; +if (!apiKey) { + throw new Error("Set ANTHROPIC_API_KEY before running this example."); +} + +const reviewer = await AgentOs.create({ software: [pi] }); +await reviewer.sessions.open({ + agent: "pi", + env: { ANTHROPIC_API_KEY: apiKey }, +}); + +const review: Bindings = { + name: "review", + description: "Ask the reviewer agent for feedback", + bindings: { + draft: { + description: "Review a draft", + inputSchema: z.object({ draft: z.string() }), + execute: async ({ draft }: { draft: string }) => { + const response = await reviewer.sessions.prompt({ + content: [{ type: "text", text: `Review this draft:\n\n${draft}` }], + }); + const feedback = + response.message?.content + .filter((block) => block.type === "text") + .map((block) => block.text) + .join("") ?? ""; + return { feedback }; + }, + }, + }, +}; + +const writer = await AgentOs.create({ software: [pi], bindings: [review] }); + +try { + await writer.sessions.open({ + agent: "pi", + env: { ANTHROPIC_API_KEY: apiKey }, + }); + await writer.sessions.prompt({ + content: [ + { + type: "text", + text: "Draft a release note, then ask the review binding for feedback.", + }, + ], + }); +} finally { + await writer.dispose(); + await reviewer.dispose(); +} diff --git a/examples/embedded/bindings.ts b/examples/embedded/bindings.ts new file mode 100644 index 0000000000..6794f011a8 --- /dev/null +++ b/examples/embedded/bindings.ts @@ -0,0 +1,26 @@ +import { AgentOs, type Bindings } from "@rivet-dev/agentos-core"; +import { z } from "zod"; + +// Binding groups are defined exactly as they are for the actor. Pass them to +// AgentOs.create() and `execute` runs in this host process. +const weather: Bindings = { + name: "weather", + description: "Weather data bindings", + bindings: { + forecast: { + description: "Get the weather forecast for a city", + inputSchema: z.object({ city: z.string().describe("City name") }), + execute: async (input: { city: string }) => ({ + city: input.city, + temperature: 22, + }), + }, + }, +}; + +const vm = await AgentOs.create({ bindings: [weather] }); + +// The agent calls it as `agentos-weather forecast --city Paris`. +const result = await vm.process.exec("agentos-weather forecast --city Paris"); +console.log(result.stdout); +await vm.dispose(); diff --git a/examples/embedded/config-reference.ts b/examples/embedded/config-reference.ts new file mode 100644 index 0000000000..ad93b7e44e --- /dev/null +++ b/examples/embedded/config-reference.ts @@ -0,0 +1,29 @@ +import pi from "@agentos-software/pi"; +import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos-core"; + +// Common embedded AgentOs.create() configuration. The agentOS() actor accepts +// the same options and layers persistence, sleep/wake, and preview URLs on top. +const vm = await AgentOs.create({ + // Durable SQLite storage for the root filesystem and the session catalog. + // Omit it for an in-memory VM that keeps nothing after dispose(). + database: { type: "sqlite_file", path: ".agentos/agentos.sqlite" }, + // Filesystems to mount at boot. Use nodeModulesMount() to expose a host + // node_modules tree at /root/node_modules. + mounts: [nodeModulesMount("/path/to/project/node_modules")], + // Kernel permission policy (see /agentos/docs/permissions) and runtime caps + // (see /agentos/docs/resource-limits) take the same values as the actor. + // `bindings` does too (see /agentos/docs/bindings). + permissions: { network: "allow" }, + limits: { jsRuntime: { v8HeapLimitMb: 128 } }, + // Software packages to install in the VM (see /agentos/docs/software). + software: [pi], + // Also install the default software bundle (sh + coreutils). Defaults to true; + // set false for a bare VM with only the software you list. + defaultSoftware: true, + // Ports exempt from SSRF checks (for testing against host-side mock servers) + loopbackExemptPorts: [3000], + // Sidecar placement defaults to the shared `default` pool. + sidecar: { kind: "shared" }, +}); + +await vm.dispose(); diff --git a/examples/core/hooks.ts b/examples/embedded/hooks.ts similarity index 75% rename from examples/core/hooks.ts rename to examples/embedded/hooks.ts index 0ab2d1392f..e9641b1de4 100644 --- a/examples/core/hooks.ts +++ b/examples/embedded/hooks.ts @@ -1,7 +1,7 @@ -import { AgentOs } from "@rivet-dev/agentos"; import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; -// ACP updates and interactive permission records share one durable event union. +// In the embedded API, ACP updates and permission records share one durable event union. const vm = await AgentOs.create({ software: [pi] }); await vm.sessions.open({ agent: "pi", permissionPolicy: "ask" }); diff --git a/examples/embedded/limits.ts b/examples/embedded/limits.ts new file mode 100644 index 0000000000..14c19c3f3a --- /dev/null +++ b/examples/embedded/limits.ts @@ -0,0 +1,14 @@ +import { AgentOs } from "@rivet-dev/agentos-core"; + +// The same `limits` object the actor takes. `onLimitWarning` is an embedded +// create option rather than a broadcast event, so it fires only in this process. +const vm = await AgentOs.create({ + limits: { + resources: { maxProcesses: 64, maxFilesystemBytes: 256 * 1024 * 1024 }, + jsRuntime: { v8HeapLimitMb: 128, cpuTimeLimitMs: 30_000 }, + }, + onLimitWarning: (warning) => { + console.warn("near limit:", warning); + }, +}); +await vm.dispose(); diff --git a/examples/embedded/models-and-credentials.ts b/examples/embedded/models-and-credentials.ts new file mode 100644 index 0000000000..c1d1046bb9 --- /dev/null +++ b/examples/embedded/models-and-credentials.ts @@ -0,0 +1,18 @@ +import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; + +const apiKey = process.env.ANTHROPIC_API_KEY; +if (!apiKey) { + throw new Error("Set ANTHROPIC_API_KEY before running this example."); +} + +const vm = await AgentOs.create({ software: [pi] }); + +try { + await vm.sessions.open({ + agent: "pi", + env: { ANTHROPIC_API_KEY: apiKey }, + }); +} finally { + await vm.dispose(); +} diff --git a/examples/embedded/mounts.ts b/examples/embedded/mounts.ts new file mode 100644 index 0000000000..69fd96a252 --- /dev/null +++ b/examples/embedded/mounts.ts @@ -0,0 +1,20 @@ +import { AgentOs } from "@rivet-dev/agentos-core"; + +// Embedded applications configure filesystem backends at boot. Native mount plugins (host +// directories, S3, etc.) are passed via `plugin`, each identified by an `id` +// and a `config` object. +const vm = await AgentOs.create({ + mounts: [ + // Host directory (read-only) + { + path: "/mnt/code", + plugin: { id: "host_dir", config: { hostPath: "/path/to/repo" } }, + readOnly: true, + }, + // S3 bucket + { + path: "/mnt/data", + plugin: { id: "s3", config: { bucket: "my-bucket", prefix: "agent/" } }, + }, + ], +}); diff --git a/examples/core/package.json b/examples/embedded/package.json similarity index 75% rename from examples/core/package.json rename to examples/embedded/package.json index a11b15e27f..1d909f3730 100644 --- a/examples/core/package.json +++ b/examples/embedded/package.json @@ -1,5 +1,5 @@ { - "name": "@rivet-dev/agentos-example-core", + "name": "@rivet-dev/agentos-example-embedded", "version": "0.0.1", "private": true, "type": "module", @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -16,9 +16,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/embedded/permissions.ts b/examples/embedded/permissions.ts new file mode 100644 index 0000000000..5d63c993f5 --- /dev/null +++ b/examples/embedded/permissions.ts @@ -0,0 +1,16 @@ +import { AgentOs, type Permissions } from "@rivet-dev/agentos-core"; + +// The kernel permission policy is the same object the actor takes. Pass it to +// AgentOs.create() instead of agentOS(). +const permissions = { + network: { + default: "deny", + rules: [ + { mode: "allow", operations: ["*"], patterns: ["api.example.com"] }, + ], + }, +} satisfies Permissions; + +const vm = await AgentOs.create({ permissions }); + +await vm.dispose(); diff --git a/examples/embedded/persistence.ts b/examples/embedded/persistence.ts new file mode 100644 index 0000000000..0ae2980625 --- /dev/null +++ b/examples/embedded/persistence.ts @@ -0,0 +1,20 @@ +import { mkdirSync } from "node:fs"; +import { resolve } from "node:path"; +import { AgentOs, type AgentOsOptions } from "@rivet-dev/agentos-core"; + +mkdirSync(".agentos", { recursive: true }); +const options = { + database: { + type: "sqlite_file", + path: resolve(".agentos/agentos.sqlite"), + }, +} satisfies AgentOsOptions; + +let vm = await AgentOs.create(options); +await vm.filesystem.writeFile("/home/agentos/result.txt", "persistent"); +await vm.dispose(); + +vm = await AgentOs.create(options); +const result = await vm.filesystem.readFile("/home/agentos/result.txt"); +console.log(new TextDecoder().decode(result)); +await vm.dispose(); diff --git a/examples/embedded/quickstart.ts b/examples/embedded/quickstart.ts new file mode 100644 index 0000000000..c3b6d24253 --- /dev/null +++ b/examples/embedded/quickstart.ts @@ -0,0 +1,30 @@ +import pi from "@agentos-software/pi"; +import { AgentOs } from "@rivet-dev/agentos-core"; + +const apiKey = process.env.ANTHROPIC_API_KEY; +if (!apiKey) { + throw new Error("Set ANTHROPIC_API_KEY before running this example."); +} + +const vm = await AgentOs.create({ software: [pi] }); + +try { + await vm.sessions.open({ + agent: "pi", + env: { ANTHROPIC_API_KEY: apiKey }, + }); + + await vm.sessions.prompt({ + content: [ + { + type: "text", + text: "Create /home/agentos/hello-world.js that prints hello world.", + }, + ], + }); + + const script = await vm.filesystem.readFile("/home/agentos/hello-world.js"); + console.log(new TextDecoder().decode(script)); +} finally { + await vm.dispose(); +} diff --git a/examples/embedded/software.ts b/examples/embedded/software.ts new file mode 100644 index 0000000000..39412307c0 --- /dev/null +++ b/examples/embedded/software.ts @@ -0,0 +1,13 @@ +import git from "@agentos-software/git"; +import { AgentOs } from "@rivet-dev/agentos-core"; + +const vm = await AgentOs.create({ software: [git] }); + +try { + const result = await vm.process.exec("git --version", { + output: { capture: "all" }, + }); + console.log(result.stdout); +} finally { + await vm.dispose(); +} diff --git a/examples/embedded/tsconfig.json b/examples/embedded/tsconfig.json new file mode 100644 index 0000000000..036d670200 --- /dev/null +++ b/examples/embedded/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "moduleResolution": "bundler", + "noEmit": true, + "jsx": "react-jsx", + "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", + "paths": { + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"] + } + }, + "include": ["**/*.ts", "**/*.tsx"] +} diff --git a/examples/core/vm.ts b/examples/embedded/vm.ts similarity index 96% rename from examples/core/vm.ts rename to examples/embedded/vm.ts index 7d7ce95a97..7954877242 100644 --- a/examples/core/vm.ts +++ b/examples/embedded/vm.ts @@ -2,10 +2,10 @@ import { mkdirSync } from "node:fs"; import { resolve } from "node:path"; import pi from "@agentos-software/pi"; -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; -// Create a VM directly with the AgentOS package — no actor runtime, no -// client/server split. `AgentOs.create()` boots the VM in-process. +// Embed a VM with the agentOS package. There is no actor runtime or +// client/server split. `AgentOs.create()` returns a handle to the VM. mkdirSync(".agentos", { recursive: true }); const vm = await AgentOs.create({ database: { diff --git a/examples/filesystem/mount-custom-vfs.ts b/examples/filesystem/mount-custom-vfs.ts index b1f128b81d..43c1501521 100644 --- a/examples/filesystem/mount-custom-vfs.ts +++ b/examples/filesystem/mount-custom-vfs.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create({ defaultSoftware: false }); await vm.filesystem.mount({ diff --git a/examples/filesystem/package.json b/examples/filesystem/package.json index d508193e7a..493da02932 100644 --- a/examples/filesystem/package.json +++ b/examples/filesystem/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,7 +18,6 @@ "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", "rivetkit": "catalog:rivetkit" }, "devDependencies": { diff --git a/examples/filesystem/tsconfig.json b/examples/filesystem/tsconfig.json index e793790512..78b4a00b61 100644 --- a/examples/filesystem/tsconfig.json +++ b/examples/filesystem/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"], "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] } diff --git a/examples/js-ai-agent-code-exec/package.json b/examples/js-ai-agent-code-exec/package.json index a1d7d35c96..c6789ec1f5 100644 --- a/examples/js-ai-agent-code-exec/package.json +++ b/examples/js-ai-agent-code-exec/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-ai-agent-code-exec/src/index.ts b/examples/js-ai-agent-code-exec/src/index.ts index 0c71dc437a..a40ed316a8 100644 --- a/examples/js-ai-agent-code-exec/src/index.ts +++ b/examples/js-ai-agent-code-exec/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; // Imagine this expression came from an AI agent. It executes inside an // isolated AgentOS VM and can only use capabilities granted to that VM. diff --git a/examples/js-child-processes/package.json b/examples/js-child-processes/package.json index 362db83f3d..10bad2f24a 100644 --- a/examples/js-child-processes/package.json +++ b/examples/js-child-processes/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-child-processes/src/index.ts b/examples/js-child-processes/src/index.ts index 07f1d35011..13ae4b5c18 100644 --- a/examples/js-child-processes/src/index.ts +++ b/examples/js-child-processes/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; // Boot a fully virtualized VM. The guest runs inside the kernel isolation // boundary, and any child processes it spawns are themselves kernel-managed diff --git a/examples/js-code-mode/package.json b/examples/js-code-mode/package.json index 6c66507ca3..c38ee39d6f 100644 --- a/examples/js-code-mode/package.json +++ b/examples/js-code-mode/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "zod": "^4.1.11" }, "devDependencies": { diff --git a/examples/js-code-mode/src/index.ts b/examples/js-code-mode/src/index.ts index 2270febdfe..a0326cbb52 100644 --- a/examples/js-code-mode/src/index.ts +++ b/examples/js-code-mode/src/index.ts @@ -1,5 +1,5 @@ // docs:start bindings -import { binding, bindings, AgentOs } from "@rivet-dev/agentos"; +import { AgentOs, binding, bindings } from "@rivet-dev/agentos-core"; import { z } from "zod"; const toolBindings = bindings({ diff --git a/examples/js-dev-servers/package.json b/examples/js-dev-servers/package.json index 672a8ec6f5..16d7cf3440 100644 --- a/examples/js-dev-servers/package.json +++ b/examples/js-dev-servers/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-dev-servers/src/index.ts b/examples/js-dev-servers/src/index.ts index a4be34e19a..ab76963a49 100644 --- a/examples/js-dev-servers/src/index.ts +++ b/examples/js-dev-servers/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const serverSource = ` import http from "node:http"; diff --git a/examples/js-filesystem/package.json b/examples/js-filesystem/package.json index 1eaca26c6c..473c668bd6 100644 --- a/examples/js-filesystem/package.json +++ b/examples/js-filesystem/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-filesystem/src/index.ts b/examples/js-filesystem/src/index.ts index f02deb806d..89a9f00ee3 100644 --- a/examples/js-filesystem/src/index.ts +++ b/examples/js-filesystem/src/index.ts @@ -1,7 +1,7 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; // docs:start virtual-filesystem -import { createHostDirBackend, AgentOs } from "@rivet-dev/agentos"; +import { AgentOs, createHostDirBackend } from "@rivet-dev/agentos-core"; // Boot a fully virtualized VM. The guest filesystem lives entirely inside the // kernel - writes never touch the host disk. diff --git a/examples/js-module-loading/package.json b/examples/js-module-loading/package.json index 36e027ed18..8b7cdfb8ad 100644 --- a/examples/js-module-loading/package.json +++ b/examples/js-module-loading/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-module-loading/src/index.ts b/examples/js-module-loading/src/index.ts index dd3ef65390..3b14cbb0e7 100644 --- a/examples/js-module-loading/src/index.ts +++ b/examples/js-module-loading/src/index.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from "node:url"; -import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos"; +import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos-core"; // docs:start loading-modules // Boot a fully virtualized VM. Module resolution runs entirely inside the diff --git a/examples/js-networking-wasm/package.json b/examples/js-networking-wasm/package.json index 0987e027cf..7bf18360f2 100644 --- a/examples/js-networking-wasm/package.json +++ b/examples/js-networking-wasm/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-networking-wasm/src/index.ts b/examples/js-networking-wasm/src/index.ts index e3d2e8d0f3..9584e152ad 100644 --- a/examples/js-networking-wasm/src/index.ts +++ b/examples/js-networking-wasm/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; // The runtime exposes its underlying VM for advanced shell and WASM workflows. const runtime = await AgentOs.create({ diff --git a/examples/js-networking/package.json b/examples/js-networking/package.json index c3012a66ca..9ef42a50b2 100644 --- a/examples/js-networking/package.json +++ b/examples/js-networking/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-networking/src/index.ts b/examples/js-networking/src/index.ts index 8ef4ddcde2..0ec7ea6f3d 100644 --- a/examples/js-networking/src/index.ts +++ b/examples/js-networking/src/index.ts @@ -20,7 +20,7 @@ import { createServer as createHttpServer } from "node:http"; import type { AddressInfo } from "node:net"; // docs:start vm-network -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; // Guest program: start a loopback HTTP server, then fetch it. Both the listen // and the fetch go through the kernel socket table. diff --git a/examples/js-output-capture/package.json b/examples/js-output-capture/package.json index 8d49a1edb9..0984ff4f7b 100644 --- a/examples/js-output-capture/package.json +++ b/examples/js-output-capture/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-output-capture/src/index.ts b/examples/js-output-capture/src/index.ts index dfab61e1db..b0c2513aa8 100644 --- a/examples/js-output-capture/src/index.ts +++ b/examples/js-output-capture/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const rt = await AgentOs.create(); diff --git a/examples/js-permissions/package.json b/examples/js-permissions/package.json index 5b40af2f6f..7777b75f7a 100644 --- a/examples/js-permissions/package.json +++ b/examples/js-permissions/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-permissions/src/index.ts b/examples/js-permissions/src/index.ts index 5255707b1f..ee5693d3d6 100644 --- a/examples/js-permissions/src/index.ts +++ b/examples/js-permissions/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create({ permissions: { diff --git a/examples/js-plugin-systems/package.json b/examples/js-plugin-systems/package.json index 53adac518b..0b48608abc 100644 --- a/examples/js-plugin-systems/package.json +++ b/examples/js-plugin-systems/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-plugin-systems/src/index.ts b/examples/js-plugin-systems/src/index.ts index 2f56eaf425..706cc155d3 100644 --- a/examples/js-plugin-systems/src/index.ts +++ b/examples/js-plugin-systems/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create({ permissions: { diff --git a/examples/js-process-isolation/package.json b/examples/js-process-isolation/package.json index 12574d45c8..a1a5474eea 100644 --- a/examples/js-process-isolation/package.json +++ b/examples/js-process-isolation/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-process-isolation/src/index.ts b/examples/js-process-isolation/src/index.ts index b117a389da..16eb96735e 100644 --- a/examples/js-process-isolation/src/index.ts +++ b/examples/js-process-isolation/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtimeA = await AgentOs.create(); const runtimeB = await AgentOs.create(); diff --git a/examples/js-quickstart/package.json b/examples/js-quickstart/package.json index 556b0b84bc..0a738eec87 100644 --- a/examples/js-quickstart/package.json +++ b/examples/js-quickstart/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-quickstart/src/index.ts b/examples/js-quickstart/src/index.ts index 486b6fd906..16987aa3a6 100644 --- a/examples/js-quickstart/src/index.ts +++ b/examples/js-quickstart/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-resource-limits/package.json b/examples/js-resource-limits/package.json index d79f3bc8c5..2bf8796fdd 100644 --- a/examples/js-resource-limits/package.json +++ b/examples/js-resource-limits/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-resource-limits/src/index.ts b/examples/js-resource-limits/src/index.ts index 9a48e9cba3..c81a3e96d8 100644 --- a/examples/js-resource-limits/src/index.ts +++ b/examples/js-resource-limits/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const rt = await AgentOs.create(); diff --git a/examples/js-runtime-platform/package.json b/examples/js-runtime-platform/package.json index b8c2d9d69d..f4db8de2db 100644 --- a/examples/js-runtime-platform/package.json +++ b/examples/js-runtime-platform/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-runtime-platform/src/index.ts b/examples/js-runtime-platform/src/index.ts index f42563546d..cf80b61f02 100644 --- a/examples/js-runtime-platform/src/index.ts +++ b/examples/js-runtime-platform/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; // docs:start nodejs const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/package.json b/examples/js-sdk-overview/package.json index 92049a34d8..b15615d5dd 100644 --- a/examples/js-sdk-overview/package.json +++ b/examples/js-sdk-overview/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-sdk-overview/src/contexts.ts b/examples/js-sdk-overview/src/contexts.ts index 13e448b286..469f985843 100644 --- a/examples/js-sdk-overview/src/contexts.ts +++ b/examples/js-sdk-overview/src/contexts.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/src/index.ts b/examples/js-sdk-overview/src/index.ts index 345b7795ef..8b17c951f2 100644 --- a/examples/js-sdk-overview/src/index.ts +++ b/examples/js-sdk-overview/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/src/inputs.ts b/examples/js-sdk-overview/src/inputs.ts index f81bd2b50f..907d699973 100644 --- a/examples/js-sdk-overview/src/inputs.ts +++ b/examples/js-sdk-overview/src/inputs.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/src/limits.ts b/examples/js-sdk-overview/src/limits.ts index 00c9d14ecb..942855a446 100644 --- a/examples/js-sdk-overview/src/limits.ts +++ b/examples/js-sdk-overview/src/limits.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/src/npm.ts b/examples/js-sdk-overview/src/npm.ts index 17094c0791..bf5adabb23 100644 --- a/examples/js-sdk-overview/src/npm.ts +++ b/examples/js-sdk-overview/src/npm.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-sdk-overview/src/platform.ts b/examples/js-sdk-overview/src/platform.ts index 568b00a503..9189d7d88b 100644 --- a/examples/js-sdk-overview/src/platform.ts +++ b/examples/js-sdk-overview/src/platform.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create({ permissions: { network: "allow" } }); diff --git a/examples/js-typescript/package.json b/examples/js-typescript/package.json index 919409abc8..7f73a6e1ba 100644 --- a/examples/js-typescript/package.json +++ b/examples/js-typescript/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "typescript": "^5.7.2" }, "devDependencies": { diff --git a/examples/js-typescript/src/index.ts b/examples/js-typescript/src/index.ts index e8317552d0..afb474e036 100644 --- a/examples/js-typescript/src/index.ts +++ b/examples/js-typescript/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/js-virtual-filesystem/package.json b/examples/js-virtual-filesystem/package.json index 97f207a650..a94a5bd2b8 100644 --- a/examples/js-virtual-filesystem/package.json +++ b/examples/js-virtual-filesystem/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/js-virtual-filesystem/src/index.ts b/examples/js-virtual-filesystem/src/index.ts index 7f6dfe16c1..7fe15ab9d4 100644 --- a/examples/js-virtual-filesystem/src/index.ts +++ b/examples/js-virtual-filesystem/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-quickstart/package.json b/examples/python-quickstart/package.json index 1579189924..4cb62a3ca2 100644 --- a/examples/python-quickstart/package.json +++ b/examples/python-quickstart/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/python-quickstart/src/index.ts b/examples/python-quickstart/src/index.ts index 743e0d8d18..f5f8221acb 100644 --- a/examples/python-quickstart/src/index.ts +++ b/examples/python-quickstart/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/package.json b/examples/python-sdk-overview/package.json index 5df2580067..e3450e271a 100644 --- a/examples/python-sdk-overview/package.json +++ b/examples/python-sdk-overview/package.json @@ -7,7 +7,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/python-sdk-overview/src/contexts.ts b/examples/python-sdk-overview/src/contexts.ts index 31dafd0251..d33e6f144a 100644 --- a/examples/python-sdk-overview/src/contexts.ts +++ b/examples/python-sdk-overview/src/contexts.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/index.ts b/examples/python-sdk-overview/src/index.ts index 9dbd631292..d8b4ac382b 100644 --- a/examples/python-sdk-overview/src/index.ts +++ b/examples/python-sdk-overview/src/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/inputs.ts b/examples/python-sdk-overview/src/inputs.ts index 305a3c4d83..b1af2b6a3f 100644 --- a/examples/python-sdk-overview/src/inputs.ts +++ b/examples/python-sdk-overview/src/inputs.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/limits.ts b/examples/python-sdk-overview/src/limits.ts index c7c13ec4d5..9c9f8f1588 100644 --- a/examples/python-sdk-overview/src/limits.ts +++ b/examples/python-sdk-overview/src/limits.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/modules.ts b/examples/python-sdk-overview/src/modules.ts index 1bcb9266cc..0249278e19 100644 --- a/examples/python-sdk-overview/src/modules.ts +++ b/examples/python-sdk-overview/src/modules.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/packages.ts b/examples/python-sdk-overview/src/packages.ts index 3d4419b5b3..5d15c02b07 100644 --- a/examples/python-sdk-overview/src/packages.ts +++ b/examples/python-sdk-overview/src/packages.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/python-sdk-overview/src/platform.ts b/examples/python-sdk-overview/src/platform.ts index f810ea1c92..6ffdbcb51e 100644 --- a/examples/python-sdk-overview/src/platform.ts +++ b/examples/python-sdk-overview/src/platform.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create({ permissions: { network: "allow" } }); diff --git a/examples/python-sdk-overview/src/spawn.ts b/examples/python-sdk-overview/src/spawn.ts index 3029e4d7f1..48b6f903cf 100644 --- a/examples/python-sdk-overview/src/spawn.ts +++ b/examples/python-sdk-overview/src/spawn.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create({ permissions: { network: "allow" } }); diff --git a/examples/quickstart/agent-session/index.ts b/examples/quickstart/agent-session/index.ts index 25a22ceddb..8491478b5e 100644 --- a/examples/quickstart/agent-session/index.ts +++ b/examples/quickstart/agent-session/index.ts @@ -4,10 +4,10 @@ // agent runtime. It may not complete in all environments. import claude from "@agentos-software/claude-code"; -import type { SoftwareInput } from "@rivet-dev/agentos"; -import { AgentOs } from "@rivet-dev/agentos"; import opencode from "@agentos-software/opencode"; import pi from "@agentos-software/pi"; +import type { SoftwareInput } from "@rivet-dev/agentos-core"; +import { AgentOs } from "@rivet-dev/agentos-core"; const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY; diff --git a/examples/quickstart/agent-session/package.json b/examples/quickstart/agent-session/package.json index 6aa698f771..8d3d54e4e9 100644 --- a/examples/quickstart/agent-session/package.json +++ b/examples/quickstart/agent-session/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/bash/files.ts b/examples/quickstart/bash/files.ts index 17e42d1579..2efdd596c2 100644 --- a/examples/quickstart/bash/files.ts +++ b/examples/quickstart/bash/files.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/quickstart/bash/index.ts b/examples/quickstart/bash/index.ts index 3533a9d2d6..7924e91090 100644 --- a/examples/quickstart/bash/index.ts +++ b/examples/quickstart/bash/index.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/quickstart/bash/limits.ts b/examples/quickstart/bash/limits.ts index b436786daf..b227e86760 100644 --- a/examples/quickstart/bash/limits.ts +++ b/examples/quickstart/bash/limits.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/quickstart/bash/package.json b/examples/quickstart/bash/package.json index c47762b996..61979d592e 100644 --- a/examples/quickstart/bash/package.json +++ b/examples/quickstart/bash/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/bash/spawn.ts b/examples/quickstart/bash/spawn.ts index b9686201a5..d5b8d43c93 100644 --- a/examples/quickstart/bash/spawn.ts +++ b/examples/quickstart/bash/spawn.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const runtime = await AgentOs.create(); diff --git a/examples/quickstart/bindings/index.ts b/examples/quickstart/bindings/index.ts index 04c7ffcbb8..91edbf4bd6 100644 --- a/examples/quickstart/bindings/index.ts +++ b/examples/quickstart/bindings/index.ts @@ -1,4 +1,4 @@ -import { AgentOs, binding, bindings } from "@rivet-dev/agentos"; +import { AgentOs, binding, bindings } from "@rivet-dev/agentos-core"; import { z } from "zod"; const weatherBindings = bindings({ diff --git a/examples/quickstart/bindings/package.json b/examples/quickstart/bindings/package.json index dbcd29586e..6fe9f34e69 100644 --- a/examples/quickstart/bindings/package.json +++ b/examples/quickstart/bindings/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "zod": "^4.1.11" }, "devDependencies": { diff --git a/examples/quickstart/cron/index.ts b/examples/quickstart/cron/index.ts index 250ed5519b..b74d16be50 100644 --- a/examples/quickstart/cron/index.ts +++ b/examples/quickstart/cron/index.ts @@ -1,6 +1,6 @@ // Cron scheduling: schedule recurring commands inside the VM. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); diff --git a/examples/quickstart/cron/package.json b/examples/quickstart/cron/package.json index 9d6f05fe1d..7fdc1ac413 100644 --- a/examples/quickstart/cron/package.json +++ b/examples/quickstart/cron/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/filesystem/index.ts b/examples/quickstart/filesystem/index.ts index 837a01c21f..98ebfad0bb 100644 --- a/examples/quickstart/filesystem/index.ts +++ b/examples/quickstart/filesystem/index.ts @@ -10,7 +10,7 @@ // }], // }); -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); @@ -46,6 +46,9 @@ console.log("docs.md exists:", await vm.filesystem.exists("/project/docs.md")); // Delete a file, then delete directory recursively await vm.filesystem.remove("/project/docs.md"); await vm.filesystem.remove("/project", { recursive: true }); -console.log("project exists after delete:", await vm.filesystem.exists("/project")); +console.log( + "project exists after delete:", + await vm.filesystem.exists("/project"), +); await vm.dispose(); diff --git a/examples/quickstart/filesystem/package.json b/examples/quickstart/filesystem/package.json index 841256ba42..fc54f781aa 100644 --- a/examples/quickstart/filesystem/package.json +++ b/examples/quickstart/filesystem/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/git/index.ts b/examples/quickstart/git/index.ts index dc345dd6cb..06fcda71b2 100644 --- a/examples/quickstart/git/index.ts +++ b/examples/quickstart/git/index.ts @@ -2,8 +2,8 @@ import { createRequire } from "node:module"; import { dirname, resolve } from "node:path"; -import { AgentOs } from "@rivet-dev/agentos"; import git from "@agentos-software/git"; +import { AgentOs } from "@rivet-dev/agentos-core"; type ExecResult = { stdout: string; @@ -13,7 +13,7 @@ type ExecResult = { const require = createRequire(import.meta.url); const MODULE_ACCESS_CWD = resolve( - dirname(require.resolve("@rivet-dev/agentos")), + dirname(require.resolve("@rivet-dev/agentos-core")), "..", ); const GIT_QUICKSTART_PERMISSIONS = { @@ -70,7 +70,10 @@ const defaultBranch = parseCurrentBranch( ); await run("git -C /tmp/origin checkout -b feature"); -await vm.filesystem.writeFile("/tmp/origin/feature.txt", "checked out from feature\n"); +await vm.filesystem.writeFile( + "/tmp/origin/feature.txt", + "checked out from feature\n", +); await run("git -C /tmp/origin add feature.txt"); await run("git -C /tmp/origin commit -m 'add feature file'"); @@ -79,7 +82,9 @@ console.log("origin default branch:", defaultBranch); console.log( "clone HEAD:", parseHeadRef( - new TextDecoder().decode(await vm.filesystem.readFile("/tmp/clone/.git/HEAD")), + new TextDecoder().decode( + await vm.filesystem.readFile("/tmp/clone/.git/HEAD"), + ), ), ); diff --git a/examples/quickstart/git/package.json b/examples/quickstart/git/package.json index 43dbaaffb0..80e4b63ca8 100644 --- a/examples/quickstart/git/package.json +++ b/examples/quickstart/git/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/hello-world/README.md b/examples/quickstart/hello-world/README.md index 547e020ed1..9a139c0053 100644 --- a/examples/quickstart/hello-world/README.md +++ b/examples/quickstart/hello-world/README.md @@ -19,7 +19,7 @@ you are done, `dispose()` tears the VM down and releases its resources. ## Run it ```sh -npm install @rivet-dev/agentos +npm install @rivet-dev/agentos-core npx tsx index.ts ``` diff --git a/examples/quickstart/hello-world/index.ts b/examples/quickstart/hello-world/index.ts index 532e8aa472..180e142312 100644 --- a/examples/quickstart/hello-world/index.ts +++ b/examples/quickstart/hello-world/index.ts @@ -1,6 +1,6 @@ // Minimal agentOS example: create a VM, write a file, read it back. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); diff --git a/examples/quickstart/hello-world/package.json b/examples/quickstart/hello-world/package.json index 9b4d6774a0..dbabf99c92 100644 --- a/examples/quickstart/hello-world/package.json +++ b/examples/quickstart/hello-world/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/network/README.md b/examples/quickstart/network/README.md index 901614656b..bcefd6144d 100644 --- a/examples/quickstart/network/README.md +++ b/examples/quickstart/network/README.md @@ -13,7 +13,7 @@ Run a real HTTP server inside the VM and call it from your host code. Reach for Create a VM with `network` and `childProcess` permissions, then `filesystem.writeFile` a small Node server script into the VM. `vm.process.spawn` launches it, and the server prints its bound port on stdout, which an `onProcessOutput` subscription parses out. With the port in hand, `vm.network.httpRequest({ port, path })` routes a buffered request to that in-VM server over localhost and returns the serializable `HttpResponse` DTO. Cleanup waits briefly on the process and disposes the VM. -> Preview URLs (`agent.createPreviewUrl`) live only in the RivetKit actor wrapper, not the direct VM API — see `examples/networking/`. +> Preview URLs (`agent.createPreviewUrl`) live only in the RivetKit actor wrapper, not the embedded API. See `examples/networking/`. ## Run it diff --git a/examples/quickstart/network/index.ts b/examples/quickstart/network/index.ts index de8ca53a8b..c8b3c4d124 100644 --- a/examples/quickstart/network/index.ts +++ b/examples/quickstart/network/index.ts @@ -2,9 +2,9 @@ // // vm.network.httpRequest() routes HTTP requests to services running inside the VM. // Note: Preview URLs (agent.createPreviewUrl) are only available in the -// RivetKit actor wrapper, not in the direct VM API. See the actor examples for that. +// RivetKit actor wrapper, not in the embedded API. See the actor examples for that. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; function settleWithin(promise: Promise, ms: number): Promise { return Promise.race([ diff --git a/examples/quickstart/network/package.json b/examples/quickstart/network/package.json index 0d869ce28a..d8ac7ae7d5 100644 --- a/examples/quickstart/network/package.json +++ b/examples/quickstart/network/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/nodejs/README.md b/examples/quickstart/nodejs/README.md index 2ae3b1fd2c..ad070f03b0 100644 --- a/examples/quickstart/nodejs/README.md +++ b/examples/quickstart/nodejs/README.md @@ -14,7 +14,7 @@ Create a VM with `AgentOs.create()`, then stage a script onto its filesystem wit ## Run it ```bash -npm install @rivet-dev/agentos +npm install @rivet-dev/agentos-core node index.ts ``` diff --git a/examples/quickstart/nodejs/index.ts b/examples/quickstart/nodejs/index.ts index 1bed0815a9..ddc8d6f35a 100644 --- a/examples/quickstart/nodejs/index.ts +++ b/examples/quickstart/nodejs/index.ts @@ -1,6 +1,6 @@ // Run a Node.js script inside the VM that does filesystem operations. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); diff --git a/examples/quickstart/nodejs/package.json b/examples/quickstart/nodejs/package.json index affdbd0ae8..1feb7bda91 100644 --- a/examples/quickstart/nodejs/package.json +++ b/examples/quickstart/nodejs/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/package.json b/examples/quickstart/package.json index c52e28fa4b..583967faca 100644 --- a/examples/quickstart/package.json +++ b/examples/quickstart/package.json @@ -2,7 +2,7 @@ "name": "@rivet-dev/agentos-quickstart", "version": "0.0.1", "private": true, - "description": "Quickstart examples for Agent OS. The scripts in this package are the supported example entrypoints.", + "description": "Quickstart examples for agentOS. The scripts in this package are the supported example entrypoints.", "type": "module", "scripts": { "check-types": "exit 0", @@ -22,7 +22,7 @@ "pi-extensions": "node --import tsx src/pi-extensions.ts" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -31,9 +31,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/pi-extensions/index.ts b/examples/quickstart/pi-extensions/index.ts index edcbc951a2..46f28dcabf 100644 --- a/examples/quickstart/pi-extensions/index.ts +++ b/examples/quickstart/pi-extensions/index.ts @@ -14,8 +14,8 @@ import { createRequire } from "node:module"; import { dirname, join, resolve } from "node:path"; -import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos"; import pi from "@agentos-software/pi"; +import { AgentOs, nodeModulesMount } from "@rivet-dev/agentos-core"; const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY; const ANTHROPIC_BASE_URL = process.env.ANTHROPIC_BASE_URL; @@ -26,7 +26,7 @@ if (!ANTHROPIC_API_KEY) { const require = createRequire(import.meta.url); const MODULE_ACCESS_CWD = resolve( - dirname(require.resolve("@rivet-dev/agentos")), + dirname(require.resolve("@rivet-dev/agentos-core")), "..", ); const HOME_DIR = "/home/agentos"; @@ -68,7 +68,10 @@ const vm = await AgentOs.create({ const extensionsDir = "/home/agentos/.pi/agent/extensions"; await vm.filesystem.mkdir(extensionsDir, { recursive: true }); await vm.filesystem.mkdir(WORKSPACE_DIR, { recursive: true }); -await vm.filesystem.writeFile(`${extensionsDir}/custom-greeting.js`, extensionSource); +await vm.filesystem.writeFile( + `${extensionsDir}/custom-greeting.js`, + extensionSource, +); if (ANTHROPIC_BASE_URL) { await vm.filesystem.writeFile( diff --git a/examples/quickstart/pi-extensions/package.json b/examples/quickstart/pi-extensions/package.json index 1f5177e6e1..09a53108ed 100644 --- a/examples/quickstart/pi-extensions/package.json +++ b/examples/quickstart/pi-extensions/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/processes/index.ts b/examples/quickstart/processes/index.ts index 9c03b0b15c..9854dc707b 100644 --- a/examples/quickstart/processes/index.ts +++ b/examples/quickstart/processes/index.ts @@ -1,6 +1,6 @@ // Execute commands and manage processes inside the VM. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); diff --git a/examples/quickstart/processes/package.json b/examples/quickstart/processes/package.json index 684303f658..cf1725cd73 100644 --- a/examples/quickstart/processes/package.json +++ b/examples/quickstart/processes/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/python/index.ts b/examples/quickstart/python/index.ts index 1bdc3f74aa..53d7b63f2a 100644 --- a/examples/quickstart/python/index.ts +++ b/examples/quickstart/python/index.ts @@ -1,6 +1,6 @@ // Run a Python program inside an AgentOS VM. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; const vm = await AgentOs.create(); diff --git a/examples/quickstart/python/package.json b/examples/quickstart/python/package.json index 9b76b1630e..b6223c25b7 100644 --- a/examples/quickstart/python/package.json +++ b/examples/quickstart/python/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*" + "@rivet-dev/agentos-core": "workspace:*" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/s3-filesystem/README.md b/examples/quickstart/s3-filesystem/README.md index b8e7b472a3..2d942ea101 100644 --- a/examples/quickstart/s3-filesystem/README.md +++ b/examples/quickstart/s3-filesystem/README.md @@ -9,7 +9,7 @@ Reach for this when you want a VM to read and write files that live in an S3-com ## How it works -A `chunked_s3` mount descriptor (built into `@rivet-dev/agentos`) configures an S3 plugin from a bucket, prefix, region, and credentials. Passing it as a mount at `/mnt/data` makes the VM treat the bucket as a normal directory, so `writeFile`, `readFile`, and `readdir` operate transparently against S3. Configure the real bucket through the `S3_*` environment variables; when they are absent the example boots a strict local S3 harness so the same flow still runs against signed requests. +A `chunked_s3` mount descriptor (built into `@rivet-dev/agentos-core`) configures an S3 plugin from a bucket, prefix, region, and credentials. Passing it as a mount at `/mnt/data` makes the VM treat the bucket as a normal directory, so `writeFile`, `readFile`, and `readdir` operate transparently against S3. Configure the real bucket through the `S3_*` environment variables; when they are absent the example boots a strict local S3 harness so the same flow still runs against signed requests. ## Run it diff --git a/examples/quickstart/s3-filesystem/index.ts b/examples/quickstart/s3-filesystem/index.ts index 20812e5bf1..bae47a989b 100644 --- a/examples/quickstart/s3-filesystem/index.ts +++ b/examples/quickstart/s3-filesystem/index.ts @@ -1,6 +1,6 @@ // S3 File System: mount an S3 bucket and use it like a local filesystem. // -// S3 mounting is built into @rivet-dev/agentos: pass a `chunked_s3` +// S3 mounting is built into @rivet-dev/agentos-core: pass a `chunked_s3` // mount descriptor to AgentOs.create({ mounts }) and the VM treats the bucket // as a normal directory, so writeFile/readFile/readdir operate transparently // against S3. @@ -16,8 +16,8 @@ // S3 harness so `pnpm --dir examples/quickstart/s3-filesystem start` // still exercises the real quickstart flow against signed S3 requests. -import { AgentOs } from "@rivet-dev/agentos"; -import type { MountConfigJsonObject } from "@rivet-dev/agentos"; +import type { MountConfigJsonObject } from "@rivet-dev/agentos-core"; +import { AgentOs } from "@rivet-dev/agentos-core"; import type { MockS3ServerHandle } from "../../../packages/core/src/test/mock-s3.js"; import { startMockS3Server } from "../../../packages/core/src/test/mock-s3.js"; @@ -67,7 +67,9 @@ if (endpoint) { } const vm = await AgentOs.create({ - mounts: [{ path: "/mnt/data", plugin: { id: "chunked_s3", config: s3Config } }], + mounts: [ + { path: "/mnt/data", plugin: { id: "chunked_s3", config: s3Config } }, + ], }); try { diff --git a/examples/quickstart/s3-filesystem/package.json b/examples/quickstart/s3-filesystem/package.json index a4ea464b79..77bfe35e82 100644 --- a/examples/quickstart/s3-filesystem/package.json +++ b/examples/quickstart/s3-filesystem/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/quickstart/sandbox/index.ts b/examples/quickstart/sandbox/index.ts index 9b8473e6ef..cb93c6d767 100644 --- a/examples/quickstart/sandbox/index.ts +++ b/examples/quickstart/sandbox/index.ts @@ -3,7 +3,7 @@ // Requires Docker. Starts a sandbox-agent container, mounts its filesystem // at /mnt/sandbox, and registers sandbox bindings for running commands. -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; import { docker } from "@rivet-dev/agentos-sandbox"; const SANDBOX_QUICKSTART_PERMISSIONS = { @@ -29,7 +29,10 @@ const vm = await AgentOs.create({ try { // Write and read a file through the mounted sandbox filesystem. - await vm.filesystem.writeFile(`${SANDBOX_MOUNT}/hello.txt`, "Hello from agentOS!"); + await vm.filesystem.writeFile( + `${SANDBOX_MOUNT}/hello.txt`, + "Hello from agentOS!", + ); const content = await vm.filesystem.readFile(`${SANDBOX_MOUNT}/hello.txt`); console.log("Read from sandbox mount:", new TextDecoder().decode(content)); diff --git a/examples/quickstart/sandbox/package.json b/examples/quickstart/sandbox/package.json index 8e6556ce75..d369dd9c9f 100644 --- a/examples/quickstart/sandbox/package.json +++ b/examples/quickstart/sandbox/package.json @@ -8,7 +8,7 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,9 +17,7 @@ "@agentos-software/claude-code": "workspace:*", "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", - "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", - "rivetkit": "catalog:rivetkit" + "zod": "^4.1.11" }, "devDependencies": { "@types/node": "^22.10.2", diff --git a/examples/sandbox/existing-client.ts b/examples/sandbox/existing-client.ts index da2a5788e9..62f5b77543 100644 --- a/examples/sandbox/existing-client.ts +++ b/examples/sandbox/existing-client.ts @@ -1,4 +1,4 @@ -import { AgentOs } from "@rivet-dev/agentos"; +import { AgentOs } from "@rivet-dev/agentos-core"; import { SandboxAgent } from "sandbox-agent"; import { docker } from "sandbox-agent/docker"; diff --git a/examples/sandbox/package.json b/examples/sandbox/package.json index b0c1e1e911..d79b3170f3 100644 --- a/examples/sandbox/package.json +++ b/examples/sandbox/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@rivet-dev/agentos": "workspace:*", + "@rivet-dev/agentos-core": "workspace:*", "@rivet-dev/agentos-sandbox": "workspace:*", "sandbox-agent": "^0.4.2", "dockerode": "^4.0.9", @@ -17,7 +18,6 @@ "@agentos-software/opencode": "workspace:*", "@agentos-software/pi": "workspace:*", "zod": "^4.1.11", - "@rivet-dev/agentos": "workspace:*", "rivetkit": "catalog:rivetkit" }, "devDependencies": { diff --git a/examples/sandbox/tsconfig.json b/examples/sandbox/tsconfig.json index e793790512..78b4a00b61 100644 --- a/examples/sandbox/tsconfig.json +++ b/examples/sandbox/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["ESNext", "DOM"], "types": ["node"], "baseUrl": ".", "paths": { "@rivet-dev/agentos": ["../../packages/agentos/src/index.ts"], + "@rivet-dev/agentos-core": ["../../packages/core/src/index.ts"], "@rivet-dev/agentos/client": ["../../packages/agentos/src/client.ts"], "@rivet-dev/agentos/react": ["../../packages/agentos/src/react.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbeb50a7ae..704492fc21 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -443,6 +443,9 @@ importers: '@rivet-dev/agentos': specifier: workspace:* version: link:../../packages/agentos + '@rivet-dev/agentos-core': + specifier: workspace:* + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -550,6 +553,9 @@ importers: '@rivet-dev/agentos': specifier: workspace:* version: link:../../packages/agentos + '@rivet-dev/agentos-core': + specifier: workspace:* + version: link:../../packages/core rivetkit: specifier: catalog:rivetkit version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) @@ -656,7 +662,7 @@ importers: specifier: ^5.7.2 version: 5.9.3 - examples/core: + examples/crash-course: dependencies: '@agentos-software/claude-code': specifier: workspace:* @@ -702,7 +708,7 @@ importers: specifier: ^5.7.2 version: 5.9.3 - examples/crash-course: + examples/cron: dependencies: '@agentos-software/claude-code': specifier: workspace:* @@ -748,7 +754,7 @@ importers: specifier: ^5.7.2 version: 5.9.3 - examples/cron: + examples/custom: dependencies: '@agentos-software/claude-code': specifier: workspace:* @@ -762,9 +768,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -774,9 +780,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -794,7 +797,7 @@ importers: specifier: ^5.7.2 version: 5.9.3 - examples/custom: + examples/debugging: dependencies: '@agentos-software/claude-code': specifier: workspace:* @@ -808,9 +811,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -820,9 +823,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -840,7 +840,7 @@ importers: specifier: ^5.7.2 version: 5.9.3 - examples/debugging: + examples/embedded: dependencies: '@agentos-software/claude-code': specifier: workspace:* @@ -854,9 +854,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -866,9 +866,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -903,6 +900,9 @@ importers: '@rivet-dev/agentos': specifier: workspace:* version: link:../../packages/agentos + '@rivet-dev/agentos-core': + specifier: workspace:* + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -962,9 +962,9 @@ importers: examples/js-ai-agent-code-exec: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -978,9 +978,9 @@ importers: examples/js-child-processes: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -994,9 +994,9 @@ importers: examples/js-code-mode: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core zod: specifier: ^4.1.11 version: 4.3.6 @@ -1013,9 +1013,9 @@ importers: examples/js-dev-servers: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1029,9 +1029,9 @@ importers: examples/js-filesystem: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1045,9 +1045,9 @@ importers: examples/js-module-loading: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1061,9 +1061,9 @@ importers: examples/js-networking: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1077,9 +1077,9 @@ importers: examples/js-networking-wasm: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1093,9 +1093,9 @@ importers: examples/js-output-capture: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1109,9 +1109,9 @@ importers: examples/js-permissions: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1125,9 +1125,9 @@ importers: examples/js-plugin-systems: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1141,9 +1141,9 @@ importers: examples/js-process-isolation: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1157,9 +1157,9 @@ importers: examples/js-quickstart: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1173,9 +1173,9 @@ importers: examples/js-resource-limits: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1235,9 +1235,9 @@ importers: examples/js-runtime-platform: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1251,9 +1251,9 @@ importers: examples/js-sdk-overview: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1267,9 +1267,9 @@ importers: examples/js-typescript: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core typescript: specifier: ^5.7.2 version: 5.9.3 @@ -1283,9 +1283,9 @@ importers: examples/js-virtual-filesystem: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1667,9 +1667,9 @@ importers: examples/python-quickstart: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1683,9 +1683,9 @@ importers: examples/python-sdk-overview: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -1711,9 +1711,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../packages/agentos + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -1723,9 +1723,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -1812,9 +1809,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -1824,9 +1821,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -1858,9 +1852,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -1870,9 +1864,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -1892,9 +1883,9 @@ importers: examples/quickstart/bindings: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core zod: specifier: ^4.1.11 version: 4.3.6 @@ -1923,9 +1914,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -1935,9 +1926,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -1969,9 +1957,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -1981,9 +1969,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2015,9 +2000,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2027,9 +2012,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2061,9 +2043,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2073,9 +2055,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2107,9 +2086,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2119,9 +2098,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2153,9 +2129,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2165,9 +2141,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2199,9 +2172,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2211,9 +2184,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2245,9 +2215,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2257,9 +2227,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2279,9 +2246,9 @@ importers: examples/quickstart/python: dependencies: - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core devDependencies: '@types/node': specifier: ^22.10.2 @@ -2307,9 +2274,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2319,9 +2286,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2353,9 +2317,9 @@ importers: '@agentos-software/pi': specifier: workspace:* version: link:../../../software/pi - '@rivet-dev/agentos': + '@rivet-dev/agentos-core': specifier: workspace:* - version: link:../../../packages/agentos + version: link:../../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../../packages/agentos-sandbox @@ -2365,9 +2329,6 @@ importers: get-port: specifier: ^7.1.0 version: 7.2.0 - rivetkit: - specifier: catalog:rivetkit - version: 2.3.10(@opentelemetry/api@1.9.0)(better-sqlite3@12.8.0)(pyodide@0.28.3(bufferutil@4.1.0))(sql.js@1.14.1)(ws@8.21.0(bufferutil@4.1.0)) sandbox-agent: specifier: ^0.4.2 version: 0.4.2(@vercel/sandbox@2.8.0)(dockerode@4.0.10)(get-port@7.2.0)(zod@4.3.6) @@ -2448,6 +2409,9 @@ importers: '@rivet-dev/agentos': specifier: workspace:* version: link:../../packages/agentos + '@rivet-dev/agentos-core': + specifier: workspace:* + version: link:../../packages/core '@rivet-dev/agentos-sandbox': specifier: workspace:* version: link:../../packages/agentos-sandbox @@ -6847,6 +6811,7 @@ packages: '@rivet-dev/vercel-world@2.3.9': resolution: {integrity: sha512-Yy7zGFx1M11styEFVHOo+jEJwRPbqIxcpDkBFoDHSZPhTbdw82pkBo+2p9z+TbX6wdw3CrlHoayLUsVVXPm01Q==} engines: {node: '>=22.0.0'} + deprecated: Renamed to @rivet-dev/workflow-world. '@rivetkit/bare-ts@0.6.2': resolution: {integrity: sha512-3qndQUQXLdwafMEqfhz24hUtDPcsf1Bu3q52Kb8MqeH8JUh3h6R4HYW3ZJXiQsLcyYyFM68PuIwlLRlg1xDEpg==}