feat: fold the Code Mode demos into demo:code-mode with a UI argument

Code Mode is the point; the UI is just the surface it happens to wear.
demo:code and demo:acp-code collapse into one dispatcher
(scripts/demo-code-mode.mjs): `pnpm run demo:code-mode [repl|acp]` —
repl (default) boots the stdio REPL over examples/code-agent, acp
serves examples/acp-agent's code-mode overlay; each UI runs the exact
node invocation its standalone script ran, and an unknown argument
fails loud with usage. All nine references across READMEs, the RFC,
the overlay header, and the keyless-smoke comment renamed. Smoked all
three paths: usage exit 2, ACP initialize handshake, REPL boot + EOF.
This commit is contained in:
Tianyi Cui
2026-07-09 12:16:37 +08:00
parent 1be9baeb7b
commit bc7da642d4
9 changed files with 37 additions and 11 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
The [Code Mode](../../docs/rfc/implemented/feature/2026-06-15-code-mode.md) form of the coding agent: instead of one native tool call per step, the model is offered exactly ONE wire tool — `run_code` — plus a generated TypeScript SDK section declaring every other registered tool (`bash`, `read`, `write`, `edit`, `todo_write`). The model composes tools by writing a program; the program runs in a fresh worker thread (`@deepseek-ai/dsh-code-runtime-worker`), its tool calls bridge back through the ordinary `tools/pre-execute`/`post-execute` pipeline one at a time, each is logged as a `tool/code-dispatch` session event, and ONLY what the program prints or returns re-enters the model's context.
```sh
pnpm run demo:code # needs DEEPSEEK_API_KEY (repo-root .env works)
pnpm run demo:code-mode # needs DEEPSEEK_API_KEY (repo-root .env works)
```
Try a task that spans several tool calls, e.g.:
@@ -42,7 +42,7 @@ async function bootAndEof(): Promise<{ stdout: string; code: number }> {
return new Promise((resolve, reject) => {
const proc = spawn(
process.execPath,
// --expose-internals: cordis.yml loads the HMR plugin (mirrors demo:code).
// --expose-internals: cordis.yml loads the HMR plugin (mirrors demo:code-mode).
['--expose-internals', '--import', tsxLoader, binScript, configPath],
{
cwd,