Skip to content

Commit d4f27fe

Browse files
authored
Organize and ship package-owned docs
1 parent f327605 commit d4f27fe

95 files changed

Lines changed: 472 additions & 300 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/soft-docs-ship.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"agents": patch
3+
"@cloudflare/codemode": patch
4+
"@cloudflare/shell": patch
5+
"@cloudflare/think": patch
6+
"@cloudflare/voice": patch
7+
---
8+
9+
Include each package's documentation in its published package.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ out
9191
.nuxt
9292
dist
9393

94+
# Generated package documentation (source lives in /docs)
95+
packages/*/docs
96+
9497
# Gatsby files
9598
.cache/
9699
# Comment in the public line in if your project uses Gatsby and not Next.js

design/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The goal is to give contributors (and future-us) a quick way to understand _why_
1212
| [think-durable-submissions.md](./think-durable-submissions.md) | Think durable submissions — async programmatic turns, recovery, idempotency |
1313
| [visuals.md](./visuals.md) | UI component library choice, Kumo usage, custom patterns |
1414
| [readonly-connections.md](./readonly-connections.md) | Readonly connection enforcement, storage, tradeoffs, and caveats |
15-
| [workspace.md](./workspace.md) | Workspace — hybrid SQLite+R2 filesystem, bash, symlinks |
15+
| [workspace.md](./shell/index.md) | Workspace — hybrid SQLite+R2 filesystem, bash, symlinks |
1616
| [agent-tools.md](./agent-tools.md) | Agent tools — chat sub-agent orchestration, parent registry, replay |
1717
| [sub-agent-routing.md](./sub-agent-routing.md) | Sub-agent routing as shipped — facets, nested URLs, registry, parent lookup |
1818
| [rfc-sub-agents.md](./rfc-sub-agents.md) | RFC: Sub-agents — child DOs via facets, typed stubs, mixin API |

design/think-durable-submissions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Related:
1010
- [think.md](./think.md) — overall Think architecture
1111
- [think-sessions.md](./think-sessions.md) — Session-backed message storage
1212
- [docs/think/programmatic-submissions.md](../docs/think/programmatic-submissions.md) — user-facing API guide
13-
- [server-driven-messages.md](../docs/server-driven-messages.md) — lighter-weight server message patterns
14-
- [workflows.md](../docs/workflows.md) — durable multi-step orchestration
13+
- [server-driven-messages.md](../docs/agents/server-driven-messages.md) — lighter-weight server message patterns
14+
- [workflows.md](../docs/agents/workflows.md) — durable multi-step orchestration
1515

1616
## Problem
1717

design/think-roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The implementation plan for `@cloudflare/think` — an opinionated chat agent base class built on Session for conversation storage and the Agents SDK for execution.
44

5-
> This roadmap is retained as a historical implementation record. All phases are complete, and current recovery behavior is documented in [`docs/think/index.md`](../docs/think/index.md) and [`docs/chat-agents.md#stream-recovery`](../docs/chat-agents.md#stream-recovery).
5+
> This roadmap is retained as a historical implementation record. All phases are complete, and current recovery behavior is documented in [`docs/think/index.md`](../docs/think/index.md) and [`docs/agents/chat-agents.md#stream-recovery`](../docs/agents/chat-agents.md#stream-recovery).
66
77
This document synthesizes four prior analyses:
88

design/think.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ An opinionated Agent base class for AI assistants. Handles the chat lifecycle
77
> This is a historical design note. For current user-facing API behavior, see
88
> [`docs/think/index.md`](../docs/think/index.md),
99
> [`docs/think/lifecycle-hooks.md`](../docs/think/lifecycle-hooks.md), and
10-
> [`docs/chat-agents.md#stream-recovery`](../docs/chat-agents.md#stream-recovery).
10+
> [`docs/agents/chat-agents.md#stream-recovery`](../docs/agents/chat-agents.md#stream-recovery).
1111
1212
## Problem
1313

@@ -544,4 +544,4 @@ Think's design — skills, extensions, tree-structured sessions, compaction, and
544544
- [chat-shared-layer.md](./chat-shared-layer.md) — shared streaming, sanitization, and protocol primitives (Think uses `StreamAccumulator`, `sanitizeMessage`, `enforceRowSizeLimit`, `CHAT_MESSAGE_TYPES`, `TurnQueue`, `ResumableStream`, `ContinuationState` from `agents/chat`)
545545
- [rfc-sub-agents.md](./rfc-sub-agents.md) — sub-agents via facets (Think's `subAgent()` is built on this)
546546
- [loopback.md](./loopback.md) — cross-boundary RPC pattern (used by extension host bridge)
547-
- [workspace.md](./workspace.md) — Workspace design (Think's file tools are backed by this)
547+
- [workspace.md](./shell/index.md) — Workspace design (Think's file tools are backed by this)

design/voice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Voice Pipeline — Design (Experimental)
22

3-
> **Status: experimental.** The voice API is in `@cloudflare/voice` and will break between releases. See `docs/voice.md` for user-facing docs.
3+
> **Status: experimental.** The voice API is in `@cloudflare/voice` and will break between releases. See `docs/voice/index.md` for user-facing docs.
44
55
How the voice pipeline works and why it is built this way.
66

@@ -35,7 +35,7 @@ What you give up:
3535
- WebRTC-grade network resilience (TCP head-of-line blocking on bad networks)
3636
- Tightly coupled echo cancellation (browser AEC via `getUserMedia` constraints still works)
3737

38-
SFU integration is documented as an advanced option in `docs/voice.md`.
38+
SFU integration is documented as an advanced option in `docs/voice/index.md`.
3939

4040
## Two mixins
4141

docs/AGENTS.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AGENTS.md — docs/
22

3-
User-facing documentation for the Agents SDK. These markdown files are manually synced to [developers.cloudflare.com/agents/](https://developers.cloudflare.com/agents/).
3+
User-facing documentation for the Agents SDK monorepo. Each package owns the directory under `docs/` matching its unscoped package name. These markdown files are manually synced to [developers.cloudflare.com/agents/](https://developers.cloudflare.com/agents/) where applicable.
44

55
## Diátaxis framework
66

@@ -31,14 +31,15 @@ There is no automated sync workflow. Changes here must be manually ported to `cl
3131
- Be concrete: code snippets over prose, real examples over abstract descriptions
3232
- No contractions (Cloudflare style guide requirement — "do not" not "don't")
3333
- Use TypeScript for all code examples
34-
- Link to related docs within this folder using relative paths (`./state.md`)
34+
- Link within a package directory using relative paths (`./state.md`)
35+
- Link across package directories with an absolute repository URL, and name the installed package path in prose when relevant
3536

3637
## Adding a new doc
3738

38-
1. Write the markdown file in this folder
39-
2. Add it to `index.md` in the appropriate section
39+
1. Write the markdown file in the directory owned by its package
40+
2. Add it to that package's `index.md`
4041
3. If it documents a design decision, consider whether a companion entry in `/design` is warranted
4142

4243
## TODO backlog
4344

44-
`index.md` has ~15 entries marked `TODO` — these are known gaps. When filling one, remove the TODO marker and follow the steps above.
45+
`agents/index.md` has entries marked `TODO` — these are known gaps. When filling one, remove the TODO marker and follow the steps above.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ An important note is that `Server` **does NOT persist to the DO storage** so you
112112

113113
`partyserver` exposes helper to address your DOs instead of manually through your bindings. This allows `partyserver` to implement several improvements, including a unique URL routing scheme for your DOs (e.g. `<your-worker>/servers/:durableClass/:durableName`).
114114

115-
Compare this to the DO addressing [example above](#RPC).
115+
Compare this to the DO addressing [example above](#rpc).
116116

117117
```ts
118118
// Note the await here!

0 commit comments

Comments
 (0)