Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f172d22
docs: phase 3 workspace capability + pluggable backends design spec
blove May 20, 2026
4261af5
docs: implementation plan for phase 3 workspace + backends
blove May 20, 2026
4600d80
scaffold(workspace): empty @dawn-ai/workspace package
blove May 21, 2026
69eaa39
feat(workspace): type interfaces for filesystem + exec backends
blove May 21, 2026
be80c3e
feat(workspace): localFilesystem default backend
blove May 21, 2026
980a682
feat(workspace): localExec default backend
blove May 21, 2026
c6d053c
feat(workspace): compose() middleware helper
blove May 21, 2026
f3a7cd3
feat(workspace): withFilesystemLogging + withExecLogging middlewares
blove May 21, 2026
9cb6157
feat(core): switch dawn.config.ts loader from hand-rolled parser to t…
blove May 21, 2026
1f6307c
feat(core): add backends field to DawnConfig + CapabilityMarkerContext
blove May 21, 2026
65f2c13
feat(core): createWorkspaceMarker capability
blove May 21, 2026
8d371f0
feat(cli): support overridable capability tools
blove May 21, 2026
281e70d
style: biome auto-fixes (import order) on workspace marker + tests
blove May 21, 2026
563952b
feat(cli): register workspace capability + thread backends from dawn.…
blove May 21, 2026
3b89c0c
feat(cli): typegen surfaces workspace tools for routes with workspace/
blove May 21, 2026
7eff501
refactor(examples/chat): migrate to workspace capability
blove May 21, 2026
6b54c61
fix(core,cli): workspace capability uses cwd-relative root, matching …
blove May 21, 2026
cf3273f
docs(examples/chat): update prompt + README for workspace capability
blove May 21, 2026
e66860f
feat: phase 3 — HITL permissions (sub-project 4.5) (#171)
blove May 21, 2026
20f36ea
style(langchain): rename escape→escaped + biome auto-format
blove May 21, 2026
5bad7f8
test(harness): pack @dawn-ai/workspace + @dawn-ai/permissions in fram…
blove May 21, 2026
a110279
test(harness): pack workspace + permissions in runtime contract verify
blove May 21, 2026
3bbbb80
test(harness): pack workspace + permissions in runtime smoke verify
blove May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,005 changes: 2,005 additions & 0 deletions docs/superpowers/plans/2026-05-20-phase3-workspace-backends.md

Large diffs are not rendered by default.

1,953 changes: 1,953 additions & 0 deletions docs/superpowers/plans/2026-05-21-phase3-permissions.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

347 changes: 347 additions & 0 deletions docs/superpowers/specs/2026-05-21-phase3-permissions-design.md

Large diffs are not rendered by default.

45 changes: 30 additions & 15 deletions examples/chat/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Chat — canonical Dawn harness example

> **Status:** foundational harness primitives (filesystem + bash) + the **planning** and
> **skills** capabilities. Subagents, sandbox isolation, and auto-summarization are still
> deferred — see "Deferred" below.
> **Status:** foundational harness primitives (filesystem + bash) plus the **planning**,
> **skills**, **subagents**, and **workspace** capabilities. Pluggable backend
> implementations (in-memory, remote sandbox) are available — see `dawn.config.ts`. HITL
> permission gating and auto-summarization are still deferred — see "Deferred" below.

## What this shows

- Dawn route discovery and the `tools/` convention
- Filesystem tools (read/write/list) + bash, path-jailed to `./workspace`
- **Workspace capability** — when a route's working directory contains `workspace/`, Dawn
auto-contributes `readFile`/`writeFile`/`listDir`/`runBash` tools wired through pluggable
backends. The filesystem and exec backends default to local node:fs / child_process; swap
them in `dawn.config.ts` for in-memory storage, remote sandboxes, etc.
- `AGENTS.md` memory autoload — Dawn auto-injects `workspace/AGENTS.md` into the system prompt on every turn; the agent updates it via `writeFile`
- **Planning** — `plan.md` in the route directory opts the agent into the built-in
`writeTodos` tool, a `todos` state channel, and a `plan_update` SSE event. Open the
Expand All @@ -17,6 +21,10 @@
the agent's system prompt (name + description). The agent calls
`readSkill({ name })` to load a skill's full body on demand. Two example
skills ship with the demo: `workspace-conventions` and `recover-from-failure`.
- **Subagents** — `/coordinator` dispatches to specialist subagents (`research`,
`summarizer`) via an auto-generated `task({ subagent, input })` tool. Subagent runs
bubble `subagent.*` SSE events with `call_id` correlation. Pick the `/coordinator` route
in the smoke client to drive it.
- End-to-end streaming from a Next.js client over SSE

## Model choice
Expand All @@ -39,17 +47,24 @@ pnpm dev

```
examples/chat/
├── server/ # @dawn-example/chat-server (Dawn route + tools)
│ └── src/app/chat/
│ ├── index.ts # agent({ model, systemPrompt })
│ ├── state.ts
│ ├── system-prompt.ts
│ ├── workspace-path.ts
│ ├── plan.md # presence enables planning; seeds initial todos
│ └── tools/ # listDir, readFile, writeFile, runBash
├── server/ # @dawn-example/chat-server (Dawn routes)
│ ├── dawn.config.ts # appDir + optional backends config
│ ├── workspace/ # shared workspace (AGENTS.md lives here)
│ └── src/app/
│ ├── chat/ # /chat route
│ │ ├── index.ts # agent({ model, systemPrompt })
│ │ ├── state.ts
│ │ ├── system-prompt.ts
│ │ ├── plan.md # presence enables planning
│ │ └── skills/ # SKILL.md files per skill
│ └── coordinator/ # /coordinator route + subagents
│ ├── index.ts
│ └── subagents/
│ ├── research/index.ts
│ └── summarizer/index.ts
└── web/ # @dawn-example/chat-web (Next.js smoke client)
└── app/
├── page.tsx # textarea + Send + raw event log
├── page.tsx # route picker + textarea + Send + raw event log
└── api/chat/route.ts # SSE proxy
```

Expand All @@ -63,8 +78,8 @@ shell expansion — all possible. Do not point untrusted users at this example.

These v1 deferrals are the explicit forcing function for Dawn's opinionated harness work:

- Subagent delegation (`task`-style tool) — needs first-class subagent declarations
- Real sandbox isolation for `runBash` — needs pluggable execution backends
- HITL permission gating — interrupt the run when a path is outside the workspace or a
command is high-risk, ask the user, persist the decision
- Tool-output offloading and context summarization — needs lifecycle hooks
- Nested-object tool inputs (e.g., `edit_file({ edits: [{ old, new }] })`) — typegen extension
- Polished web UI — wait for harness primitives to stabilize
15 changes: 14 additions & 1 deletion examples/chat/server/dawn.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
export default {}
export default {
appDir: "src/app",
permissions: {
// Default mode (omitted) is "interactive" — the demo shows the permission flow.
// Seed a few obviously-safe commands so prompt fatigue is reasonable on first run.
allow: {
bash: ["ls", "pwd", "cat", "echo", "head", "tail", "wc"],
},
// Block obviously-destructive patterns even when interactive.
deny: {
bash: ["rm -rf", "sudo", "chmod 777"],
},
},
}
2 changes: 1 addition & 1 deletion examples/chat/server/src/app/chat/system-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You operate in a sandboxed \`workspace/\` directory. You have four tools:
- \`listDir({ path })\` — list directory contents. Pass "." for the workspace root.
- \`readFile({ path })\` — read a UTF-8 text file (max 256 KiB).
- \`writeFile({ path, content })\` — create or overwrite a text file.
- \`runBash({ command, timeoutSeconds })\` — run a shell command in the workspace. Use \`timeoutSeconds: 30\` unless the task clearly needs longer (max 120).
- \`runBash({ command })\` — run a shell command in the workspace. Returns \`{ stdout, stderr, exitCode }\`. Commands time out after 30 seconds by default.

Memory convention: when you complete meaningful work, update \`AGENTS.md\` (via \`writeFile\`) so future-you remembers what mattered. Dawn auto-injects the current contents of \`workspace/AGENTS.md\` into your system prompt on every turn under the "# Memory" heading — you don't need to read or list it manually.

Expand Down
16 changes: 0 additions & 16 deletions examples/chat/server/src/app/chat/tools/listDir.ts

This file was deleted.

16 changes: 0 additions & 16 deletions examples/chat/server/src/app/chat/tools/readFile.ts

This file was deleted.

37 changes: 0 additions & 37 deletions examples/chat/server/src/app/chat/tools/runBash.ts

This file was deleted.

17 changes: 0 additions & 17 deletions examples/chat/server/src/app/chat/tools/writeFile.ts

This file was deleted.

54 changes: 0 additions & 54 deletions examples/chat/server/src/app/chat/workspace-path.test.ts

This file was deleted.

49 changes: 0 additions & 49 deletions examples/chat/server/src/app/chat/workspace-path.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading