Skip to content

An open-source, faster Devin alternative

TypeScript

docs(agent-sessions): add Artifacts & previews coming-soon page

Igor Zalutskibb592492bf03
diff --git a/docs/agent-sessions/artifacts.mdx b/docs/agent-sessions/artifacts.mdx
new file mode 100644
index 00000000..fb442bdf
--- /dev/null
+++ b/docs/agent-sessions/artifacts.mdx
@@ -0,0 +1,41 @@
+---
+title: "Artifacts & previews"
+description: "A session's published outputs — live previews and durable files (coming soon)"
+---
+
+<Note>**Coming soon.** This page is our current thinking, not a shipped contract — names and shapes may change. What works *today*: large event bodies already spill to a [`content_ref`](/agent-sessions/events) you can fetch, and events can carry forward [`refs.artifacts[]`](/agent-sessions/events). The first-class collection below is what comes next.</Note>
+
+A session does its work in a private scratch sandbox. **Artifacts** are the subset it deliberately *publishes* for you and your UI to consume — a durable, session-scoped collection that survives reconnects and page reloads, so a "preview" or "outputs" panel can be rebuilt at any time, not just caught live. A **preview** is one kind of artifact: a live URL to something the agent is running (a dev server, a built app).
+
+## Two kinds, two lifetimes
+
+The split is what lets a panel survive a refresh:
+
+- **`file` / `link` — durable.** Snapshotted to storage at publish; fetchable forever, even after the session's machine is gone. (Reports, build outputs, screenshots, diffs.)
+- **`preview` — live.** A URL into the running session machine. The *entry* is durable (you always get it back on reload), but the served app is bound to a warm machine, so it carries a `status` (`live` / `cold`) and can be resumed.
+
+## How the agent publishes
+
+The runtime would get two tools alongside `bash`/`read`/`write`:
+
+- `oc.preview(port)` — expose a port of the session's machine as a preview URL.
+- `oc.publish(path)` — snapshot a file as a durable artifact.
+
+Each publish appends a `user`-level event and upserts the artifact, so it reaches your UI the moment it happens — the agent builds, then *shows* you.
+
+## How your app would consume it
+
+The same snapshot-plus-stream pattern as [events](/agent-sessions/events): list on load, subscribe for changes.
+
+```
+GET /v3/sessions/:id/artifacts → [Artifact] # the panel on load (survives refresh)
+GET /v3/sessions/:id/artifacts/:key/content # durable file bytes
+events: artifact.published | artifact.updated | artifact.removed (level: user)
+
+Artifact = { key, kind: "preview" | "file" | "link", title?, status?, url?,
+ content_type?, bytes?, created_at, updated_at }
+```
+
+A preview URL is a public capability — the browser loads it directly; a [client token](/agent-sessions/authentication#client-tokens) only gates *learning* the URL (via the user-level event), so you can stream the whole build *and* embed the running app from the same front-end.
+
+<Note>Actively being designed — if you have a shape in mind or want it sooner, tell us how you'd use it.</Note>
diff --git a/docs/agent-sessions/events.mdx b/docs/agent-sessions/events.mdx
index 2f8512bd..4f6f5987 100644
--- a/docs/agent-sessions/events.mdx
+++ b/docs/agent-sessions/events.mdx
@@ -40,7 +40,7 @@ The stable contract is the top-level **`type`** — **switch on it, don't parse
**Correlate a steer to its turn.** Steers coalesce — one turn can pick up several — so [`POST /messages`](/agent-sessions/messaging) returns the *event* `seq`, not a turn. The turn that consumes your steer emits `turn.started` with `input_from_seq ≤ your_seq ≤ input_to_seq`; await its `turn.completed`, then `GET …/events?turn_id=` for everything it produced.
-**Large output.** A large `body` is offloaded to a `content_ref`; fetch the bytes with `GET /sessions/:id/events/:eventId/content` (e.g. full `exec.completed` output). Richer **artifacts** (named files, diffs, screenshots, reports) ride a forward `refs.artifacts[]`, with a first-class artifacts API **coming soon**. `refs` also carries optional correlation/evidence keys (`trace_id`, `sources[]`).
+**Large output.** A large `body` is offloaded to a `content_ref`; fetch the bytes with `GET /sessions/:id/events/:eventId/content` (e.g. full `exec.completed` output). Richer **artifacts** (named files, diffs, screenshots, reports) ride a forward `refs.artifacts[]`, with a first-class [artifacts & previews API](/agent-sessions/artifacts) **coming soon**. `refs` also carries optional correlation/evidence keys (`trace_id`, `sources[]`).
## Levels
diff --git a/docs/docs.json b/docs/docs.json
index 1e6d647c..87da24f4 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -73,6 +73,7 @@
"agent-sessions/webhooks",
"agent-sessions/runtimes",
"agent-sessions/runtime-tools",
+ "agent-sessions/artifacts",
"agent-sessions/api-reference"
]
},