Skip to content

Commit cdcbc5b

Browse files
committed
docs(foundation): rewrite AgentWorkspace section as agent-as-artifact SPI
The old text described a read/write/list/materialize adapter, but the actual SPI is `AgentWorkspace` with `supports(Path)` / `load(Path)` / `name()` / `priority()` and returns an `AgentDefinition`. Enumerates the two in-tree adapters (OpenClaw + AtmosphereNative), notes that writes go through `FileSystemAgentState`, and corrects the personal-assistant sample path to `src/main/resources/agent-workspace/`.
1 parent 672b654 commit cdcbc5b

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

docs/src/content/docs/tutorial/26-foundation-primitives.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,28 @@ impl is zero-dep.
3333

3434
## 2. AgentWorkspace
3535

36-
Adapter over an external workspace convention — OpenClaw, SWE-bench,
37-
or a plain file tree. Exposes `read`, `write`, `list`, `materialize`
38-
without exposing the underlying implementation.
39-
40-
- **Consumer**`AgentProcessor.buildFoundationPrimitives` +
41-
`CoordinatorProcessor.wireFoundationPrimitives`. Discovered via
42-
`AgentWorkspaceLoader` (ServiceLoader).
36+
Agent-as-artifact SPI. Adapters parse a directory on disk into an
37+
`AgentDefinition` (identity / persona / user profile / operating rules
38+
/ skills / composed system prompt). In-tree today:
39+
40+
- `OpenClawWorkspaceAdapter` — canonical OpenClaw layout (`AGENTS.md`
41+
+ `SOUL.md` + `USER.md` + `IDENTITY.md` + `MEMORY.md` + `skills/`)
42+
plus Atmosphere-only extension files (`CHANNELS.md`, `MCP.md`,
43+
`RUNTIME.md`, `PERMISSIONS.md`, `SKILLS.md`) that OpenClaw ignores.
44+
- `AtmosphereNativeWorkspaceAdapter` — fallback that accepts any
45+
directory, reading `README.md` as operating rules when present.
46+
47+
Third-party adapters ship via `META-INF/services/`. The SPI surface
48+
is `supports(Path)` / `load(Path)` / `name()` / `priority()`; the
49+
adapter does not directly expose read/write APIs — writes go through
50+
`FileSystemAgentState`.
51+
52+
- **Consumer**`AgentProcessor.buildFoundationPrimitives` picks the
53+
highest-priority adapter whose `supports()` accepts the workspace
54+
root, via `AgentWorkspaceLoader` (ServiceLoader).
4355
- **Sample** — personal-assistant ships a classpath-rooted workspace
44-
at `agent-workspace/` that the `@Prompt` body reads through.
56+
at `src/main/resources/agent-workspace/` that the adapter loads at
57+
startup.
4558

4659
## 3. ProtocolBridge
4760

0 commit comments

Comments
 (0)