From 1be9baeb7bc9def875be4fe97397755d15685f27 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Thu, 9 Jul 2026 11:44:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20demo:acp-code=20=E2=80=94=20the?= =?UTF-8?q?=20ACP=20demo=20in=20Code=20Mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boots the acp-agent example through the existing code-mode.cordis.yml overlay (tool surface collapses to run_code + the generated TypeScript SDK, dispatching through the worker-thread runtime), mirroring how demo:code relates to demo:repl on the stdio side. The overlay header and both READMEs now name the demo as a consumer. Smoke: the server answers an ACP initialize handshake with a clean frame on stdout. --- examples/README.md | 2 +- examples/acp-agent/README.md | 3 ++- examples/acp-agent/code-mode.cordis.yml | 11 ++++++----- package.json | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/README.md b/examples/README.md index 1b9cdf080e..d42144ec9a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -29,4 +29,4 @@ Run with: `pnpm run demo:code` (needs `DEEPSEEK_API_KEY`). See [code-agent/READM An agent demo exposed as an **Agent Client Protocol (ACP)** server over JSON-RPC stdio, via the [`@deepseek-ai/dsh-acp-agent`](../packages/ui/acp-agent) app — drive it from Zed or any other ACP client. Also the home of the keyless snapshot tests. -Run with: `pnpm run demo:acp` (needs `DEEPSEEK_API_KEY`). See [acp-agent/README.md](acp-agent/README.md) for the Zed setup and the snapshot-test design. +Run with: `pnpm run demo:acp` (needs `DEEPSEEK_API_KEY`); `pnpm run demo:acp-code` boots the same server in Code Mode via the `code-mode.cordis.yml` overlay. See [acp-agent/README.md](acp-agent/README.md) for the Zed setup and the snapshot-test design. diff --git a/examples/acp-agent/README.md b/examples/acp-agent/README.md index a1f6e818ab..b00604a056 100644 --- a/examples/acp-agent/README.md +++ b/examples/acp-agent/README.md @@ -4,9 +4,10 @@ The DeepSeek Harness SDK agent demo exposed as an **Agent Client Protocol (ACP)* ```sh pnpm run demo:acp # needs DEEPSEEK_API_KEY (repo-root .env or env) +pnpm run demo:acp-code # the same server in Code Mode: one wire tool, run_code ``` -This example is just a leaf `cordis.yml`: it loads the [`@deepseek-ai/dsh-acp-agent`](../../packages/ui/acp-agent) app (which bundles the [`@deepseek-ai/dsh-agent-core`](../../packages/core/agent-core) spine, JSONL session persistence, and the `@deepseek-ai/dsh-acp` bridge — with **no pre-created agents**, since ACP `session/new` creates them on demand), the swappable DeepSeek, bash, and filesystem backends, the model-facing `read`/`write`/`edit`/`subagent`/`subagent_fork`/`todo_write` tool entries, and the advisory `repeat-tool-guard` loop-hygiene plugin. The app package bakes in the no-stdout-logger cluster, so a leaf has no logger entry to get wrong by default — keeping stdout pure for JSON-RPC. +This example is just a leaf `cordis.yml`: it loads the [`@deepseek-ai/dsh-acp-agent`](../../packages/ui/acp-agent) app (which bundles the [`@deepseek-ai/dsh-agent-core`](../../packages/core/agent-core) spine, JSONL session persistence, and the `@deepseek-ai/dsh-acp` bridge — with **no pre-created agents**, since ACP `session/new` creates them on demand), the swappable DeepSeek, bash, and filesystem backends, the model-facing `read`/`write`/`edit`/`subagent`/`subagent_fork`/`todo_write` tool entries, and the advisory `repeat-tool-guard` loop-hygiene plugin. The app package bakes in the no-stdout-logger cluster, so a leaf has no logger entry to get wrong by default — keeping stdout pure for JSON-RPC. `demo:acp-code` boots the same tree through the [`code-mode.cordis.yml`](code-mode.cordis.yml) overlay — the tool surface collapses to `run_code` + the generated TypeScript SDK, dispatching through the worker-thread code runtime (see the [dsh-tools Code Mode section](../../packages/core/tools/README.md#code-mode)). ## stdout is the protocol diff --git a/examples/acp-agent/code-mode.cordis.yml b/examples/acp-agent/code-mode.cordis.yml index 244cad9209..0dfbd73d26 100644 --- a/examples/acp-agent/code-mode.cordis.yml +++ b/examples/acp-agent/code-mode.cordis.yml @@ -1,11 +1,12 @@ -# Code Mode RECORD overlay: the live acp-agent tree (./cordis.yml) with two +# Code Mode overlay: the live acp-agent tree (./cordis.yml) with two # load-time patches — the app entry's config gains `tools: { mode: code }` # (the registry offers exactly one wire tool, run_code, plus the generated # TypeScript SDK prompt section) and the worker-thread code runtime joins the -# tree as `ctx.codeRuntime`. The dsh-acp-agent bin boots this file when the -# snapshot harness records the code-mode scenarios; DSH_SNAPSHOT=replay swaps -# it for the sibling code-mode.cordis.snapshot.yml. A config patch REPLACES -# the entry's whole config, so the base entry's fields are restated verbatim. +# tree as `ctx.codeRuntime`. The dsh-acp-agent bin boots this file for +# `pnpm run demo:acp-code` and when the snapshot harness records the +# code-mode scenarios; DSH_SNAPSHOT=replay swaps it for the sibling +# code-mode.cordis.snapshot.yml. A config patch REPLACES the entry's whole +# config, so the base entry's fields are restated verbatim. - id: base name: '@cordisjs/plugin-include' config: diff --git a/package.json b/package.json index 4fce3dad57..4ed429f1d0 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "demo:repl": "node --expose-internals --import tsx packages/ui/stdio-agent/src/bin.ts examples/coding-agent/cordis.yml", "demo:code": "node --expose-internals --import tsx packages/ui/stdio-agent/src/bin.ts examples/code-agent/cordis.yml", "demo:acp": "node --import tsx packages/ui/acp-agent/src/bin.ts examples/acp-agent/cordis.yml", + "demo:acp-code": "node --import tsx packages/ui/acp-agent/src/bin.ts examples/acp-agent/code-mode.cordis.yml", "postinstall": "node scripts/install-lefthook.mjs" }, "devDependencies": {