Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/AGENTS.md
125 changes: 125 additions & 0 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Docs Bundle CLAUDE.md

Rules for the docs in this repo. These pages are **not** rendered here — they are
published on [rivet.dev](https://rivet.dev) by the
[rivet-website](https://github.com/rivet-dev/website) repo, which symlinks
this directory in. Everything below exists so a page written here renders
correctly there.

## Layout

```
docs/
sidebar.json navigation for the two tabs
content/
docs/**.mdx -> /{product}/docs/...
tutorials/**.mdx -> /{product}/tutorials/...
```

The website links `docs/content` into its content collection, so **only real
pages belong under `content/`**. Anything else (scripts, fixtures, notes) goes
elsewhere in the repo or it will be published as a docs page.

## Frontmatter

Every page needs `title` and `description`. Both are used for SEO and the
sidebar falls back to `title` when a sidebar entry omits one.

```mdx
---
title: "In-Memory State"
description: "Actors store state in memory for instant reads and writes."
---
```

## sidebar.json

Navigation for this product's Documentation and Tutorials tabs. Icons travel as
Font Awesome **export names**, not objects, so this repo needs no dependency on
the website's icon package.

```json
{
"docs": [
{ "title": "General", "pages": [
{ "title": "Introduction", "href": "/actors/docs", "icon": "faSquareInfo" }
]}
],
"tutorials": []
}
```

- `href` is the full site path, including the product segment.
- Adding a page to `content/` does not add it to the nav. Add it here too.
- The Self-Host tab is **not** in this file. It is generated by the website.

## Code

- **Never inline a fenced TypeScript block.** Real examples live in `examples/`
and are embedded with `<CodeSnippet>`, so they are type-checked and cannot rot.
A snippet that fails to compile fails the website build.
- Snippet paths are relative to **this repo's root**, so the same path works both
here and on rivet.dev:
```mdx
<CodeSnippet file="examples/docs/actors-state/durable-basic.ts" />
```
- Embed part of a file with `region="name"`, delimited in the source by
`// docs:start name` / `// docs:end name`.
- Shell commands, YAML, Dockerfiles, and terminal output **may** be inline fenced
blocks. The no-inline rule exists for type checking, which only applies to
TypeScript.
- Every TypeScript snippet must include its imports and define everything it
references. Use `@nocheck` only for API that does not exist on this branch yet.
- Use `<CodeGroup workspace>` for examples spanning multiple files, with each
file as its own `<CodeSnippet>`.

## What does not belong here

- **Marketing pages.** They live in the website repo.
- **Deploy and self-hosting guides.** They are written once in the website repo
and templated across every product. Do not write a per-product copy.
- **Website components.** Do not import from the website by relative path or
alias; a page must render from the components the site already provides.

## Terminology

Applies to everything published on the website.

- The service that routes, schedules, and persists is the **control plane**.
Never "engine", "server", or "orchestrator".
- A process running user code with the Rivet SDK is a **worker**. Never "envoy",
"runner", "node", "compute", or "data plane".
- **Never use "agent" as a deployment noun.** Rivet ships agentOS and Actors is
"where agents live"; the collision is unrecoverable.
- **"envoy" never appears in docs.** Envoy Proxy is a top-tier CNCF project.
Internal code keeps its own names.
- **"Rivet Compute" is retired.** Where prose must name the managed offering it
is **Rivet Cloud**, and it links to <https://dashboard.rivet.dev>.
- Spell the product `agentOS`, never `AgentOS`. Capitalize **Rivet Actor** as a
proper noun, lowercase generic "actor".
- Always `rivet.dev`, never `rivet.gg`.

## Writing

- Write comments and prose as complete sentences. **Never use em dashes**; use
periods instead.
- Do not document deltas. A reader who never saw the old version gains nothing
from "this was renamed".

## Previewing locally

Clone the website next to this repo and run it. It detects the sibling
automatically and serves this directory's pages live:

```sh
git clone https://github.com/rivet-dev/website
cd rivet-website && pnpm install && pnpm dev
```

`pnpm assemble` prints which checkout each product resolved to. To point at a
different checkout, repoint the symlink; it is gitignored and assemble leaves an
existing one alone:

```sh
ln -sfn /path/to/this/repo/docs/content src/content/docs/<product>
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Use bindings to let agents communicate with each other."
skill: true
---

Agents communicate through [bindings](/docs/bindings). You define a bindings group that lets one agent send work to another, and the agent calls it like any other CLI command.
Agents communicate through [bindings](/agentos/docs/bindings). You define a bindings group that lets one agent send work to another, and the agent calls it like any other CLI command.

## Example: code writer + reviewer

Expand Down Expand Up @@ -34,4 +34,4 @@ Bindings are the natural communication layer between agents because:
## Recommendations

- 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](/docs/workflows) to make multi-agent pipelines durable across restarts.
- Use [Workflows](/agentos/docs/workflows) to make multi-agent pipelines durable across restarts.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ skill: false
<CodeSnippet file="examples/claude/client.ts" title="client.ts" region="quickstart" />
</CodeGroup>

Read [Sessions](/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.
Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.

## Model & credentials

Expand All @@ -25,7 +25,7 @@ Set the relevant variable(s) on the session's `env`, sourced from your server's
- `CLAUDE_CODE_USE_BEDROCK=1` — use Amazon Bedrock (auth via the AWS credential chain: `AWS_REGION`, `AWS_PROFILE`, …).
- `CLAUDE_CODE_USE_VERTEX=1` — use Google Vertex AI (auth via Google Cloud credentials).

See [Models & Credentials](/docs/models-and-credentials), and Claude Code's [environment variables](https://code.claude.com/docs/en/env-vars) for the full list.
See [Models & Credentials](/agentos/docs/models-and-credentials), and Claude Code's [environment variables](https://code.claude.com/docs/en/env-vars) for the full list.

## Skills

Expand All @@ -45,4 +45,4 @@ Expose extra tools to the agent by passing `mcpServers` to `openSession`. Both l

## Customizing the agent

Claude Code is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/docs/agents/custom).
Claude Code is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/agentos/docs/agents/custom).
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ skill: false
<CodeSnippet file="examples/codex/client.ts" region="quickstart" title="client.ts" />
</CodeGroup>

Read [Sessions](/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.
Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.

## Model & credentials

Expand All @@ -21,7 +21,7 @@ Set the relevant variable(s) on the session's `env`, sourced from your server's
- `OPENAI_BASE_URL` — route through a gateway or OpenAI-compatible endpoint.
- Custom providers — defined in `~/.codex/config.toml`; each provider's `env_key` names the variable Codex reads for its key (e.g. `AZURE_OPENAI_API_KEY`, `MISTRAL_API_KEY`).

See [Models & Credentials](/docs/models-and-credentials), and Codex's [config reference](https://developers.openai.com/codex/config-reference) for details.
See [Models & Credentials](/agentos/docs/models-and-credentials), and Codex's [config reference](https://developers.openai.com/codex/config-reference) for details.

## Skills

Expand All @@ -41,4 +41,4 @@ Expose extra tools to the agent by passing `mcpServers` to `openSession`. Both l

## Customizing the agent

Codex is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/docs/agents/custom).
Codex is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/agentos/docs/agents/custom).
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ export const registry = setup({ use: { vm } });
registry.start();
```

See [Sessions](/docs/sessions) for creating and driving sessions. Package your adapter with `agentos-toolchain pack --agent my-agent-acp` so its dependencies are bundled into the self-contained package directory and the `agent` block (naming the `bin/` ACP entrypoint) is written into the package's `agentos-package.json`, rather than shipping it as a loose file.
See [Sessions](/agentos/docs/sessions) for creating and driving sessions. Package your adapter with `agentos-toolchain pack --agent my-agent-acp` so its dependencies are bundled into the self-contained package directory and the `agent` block (naming the `bin/` ACP entrypoint) is written into the package's `agentos-package.json`, rather than shipping it as a loose file.

All built-in agents are defined exactly this way. Browse them for reference on [GitHub](https://github.com/rivet-dev/agentos/tree/main/software).

## Read more

- [Defining software packages](/docs/custom-software/definition): the full descriptor reference, including the `agentos-package.json` schema and every `agent` field (`acpEntrypoint`, `env`, `launchArgs`, `snapshot`).
- [Building binaries](/docs/custom-software/building-wasm): compile WASM command binaries and use the registry.
- [Defining software packages](/agentos/docs/custom-software/definition): the full descriptor reference, including the `agentos-package.json` schema and every `agent` field (`acpEntrypoint`, `env`, `launchArgs`, `snapshot`).
- [Building binaries](/agentos/docs/custom-software/building-wasm): compile WASM command binaries and use the registry.

## Debugging

When a custom agent exits mid-turn or a tool call fails, capture the agent's stderr with the `onAgentStderr` hook on `AgentOs.create()`. The agent uses stdout for ACP, so stderr carries its logs and crash output. See [Debugging](/docs/debugging) for that hook and the runtime (sidecar) logs.
When a custom agent exits mid-turn or a tool call fails, capture the agent's stderr with the `onAgentStderr` hook on `AgentOs.create()`. The agent uses stdout for ACP, so stderr carries its logs and crash output. See [Debugging](/agentos/docs/debugging) for that hook and the runtime (sidecar) logs.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ skill: false
<CodeSnippet file="examples/opencode/client.ts" title="client.ts" region="quickstart" />
</CodeGroup>

Read [Sessions](/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.
Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.

## Model & credentials

Expand All @@ -25,7 +25,7 @@ OpenCode auto-detects a provider when its key is present on the session's `env`,
- `GROQ_API_KEY` — Groq.
- …plus Amazon Bedrock, Azure, Google Vertex, and 70+ providers via [models.dev](https://models.dev).

See [Models & Credentials](/docs/models-and-credentials), and OpenCode's [providers docs](https://opencode.ai/docs/providers/) for the full list.
See [Models & Credentials](/agentos/docs/models-and-credentials), and OpenCode's [providers docs](https://opencode.ai/docs/providers/) for the full list.

## Model configuration

Expand Down Expand Up @@ -76,4 +76,4 @@ Expose extra tools to the agent by passing `mcpServers` to `openSession`. Both l

## Customizing the agent

OpenCode is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/docs/agents/custom).
OpenCode is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked build as a new agent, see [Custom Agents](/agentos/docs/agents/custom).
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ skill: true
<CodeSnippet file="examples/pi/client.ts" region="quick-start" />
</CodeGroup>

Read [Sessions](/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.
Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.

## Model & credentials

Expand All @@ -21,7 +21,7 @@ Set the relevant variable on the session's `env`, sourced from your server's env
- `ANTHROPIC_API_KEY` — Anthropic (Claude), the default.
- Other providers — use the provider-named key (e.g. `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`).

See [Models & Credentials](/docs/models-and-credentials), and Pi's [providers docs](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/providers.md) for the full list.
See [Models & Credentials](/agentos/docs/models-and-credentials), and Pi's [providers docs](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/providers.md) for the full list.

## Skills

Expand Down Expand Up @@ -56,4 +56,4 @@ See the [Pi extension documentation](https://github.com/badlogic/pi-mono/tree/ma

## Customizing the agent

Pi is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked Pi build as a new agent, see [Custom Agents](/docs/agents/custom).
Pi is a built-in agent, but it's just a software package under the hood. To ship your own ACP adapter, swap the underlying agent SDK, or register a tweaked Pi build as a new agent, see [Custom Agents](/agentos/docs/agents/custom).
Loading
Loading