refactor(cli)!: one shared base config with per-surface overlays

`dsh` shipped two config trees that were 43 rows the same: apps/cli/cordis.yml
composed web as 74 flat rows, while the TUI booted examples/tui-agent/cordis.yml
whose single `@deepseek-ai/dsh-tui-demo` row mounted twelve plugins behind a
twenty-key pass-through Config. Neither file was what its location claimed —
apps/cli hardcoded the "example" as the product default and the "demo" bundle
was the application — and every capability change had to be made twice.

- apps/cli/base.cordis.yml holds the 43 shared rows; tui.cordis.yml and
  web.cordis.yml are patch lists stating only what differs per surface
- overlays apply as SIBLING patch lists at one include level, because include
  patches never cross an include boundary. Precedence: base < surface <
  (--config | personal ~/.dsh/config.yaml) < launcher flag/profile patches
- `--config` now applies an overlay INSTEAD OF the personal one, so a demo or
  test tree never inherits the user's route; new `--config-replace` boots a file
  as the entire tree (the old `--config` behaviour). Both survive /resume
- vendor/include: index each `insert`ed row as it is added so a later patch can
  configure or disable it. Upstream built the id index once before the patch
  loop, leaving every surface-only row — the whole TUI front door — silently
  unpatchable from user config. Logged as local modification 8
- session identity moves to dsh-agent-loop's CONFIGURED_AGENT_IDENTITIES_KEY;
  dsh-tui's MAIN_SESSION_ID_KEY is deleted (only the bundle read it)
- delete examples/tui-agent, examples/cordis-agent, packages/examples/tui-demo;
  TUI tests → apps/cli/tests, cordis e2e → packages/cordis/tool-cordis/tests,
  examples/code-mode survives as an overlay leaf
- `dsh web` gains --config, threaded into AppCLIEntry as an extra overlay

Three latent defects surfaced and are fixed here: the TUI captured the optional
sessionQuery service once at construction and could permanently disable /resume
when it won the mount race; the session-store root silently reverted to a
project-local ./.sessions; --config-replace was dropped by the resume handoff.

Verified by booting each tree through the real Loader (TUI 55 entries, web 75,
zero unsettled) rather than reading YAML. All eight terminal snapshots replay
byte-identically; 14/14 PTY smoke, 112/112 snapshots, 25/25 doc-sync, hygiene
and lint clean.
This commit is contained in:
Turtle
2026-07-29 13:58:21 +08:00
parent e7c0a5b794
commit f290a8b851
182 changed files with 1659 additions and 2400 deletions

View File

@@ -1,6 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
llm-adapter.md: 3bf005647d3e7908f1d1553374266c1d6c12c2e6
llm-adapter.zh.md: b967d112ed6879b11486ab7aedf64653089d93de
# pnpm run verify-translation-pairing --write docs/user/develop/practice/llm-adapter.md
llm-adapter.md: 7445688530c1ba61e5c065f9f5e49db6498da5b1
llm-adapter.zh.md: c30200314a01f7a61d48e3f47288013c31e5aef4

View File

@@ -133,10 +133,12 @@ The first argument lists the model names handled by the adapter. If `cordis.yml`
- my-model-v1
- my-model-v2
- id: tui-agent
name: '@deepseek-ai/dsh-tui-demo'
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: my-llm
agents:
- id: main
provider: my-llm
model: my-model-v1 # References the model registered above.
workspaceContext: false
```

View File

@@ -133,10 +133,12 @@ ctx.llm.registerAdapter(['model-name-1', 'model-name-2'], adapter)
- my-model-v1
- my-model-v2
- id: tui-agent
name: '@deepseek-ai/dsh-tui-demo'
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: my-llm
agents:
- id: main
provider: my-llm
model: my-model-v1 # References the model registered above.
workspaceContext: false
```

View File

@@ -1,6 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
config.md: a884cb9c2ec31bd4b12a31cce6290df1d134cf9a
config.zh.md: 3fb9ce69e5f7cb6b92f055ef18595e5ff07d9bbf
# pnpm run verify-translation-pairing --write docs/user/guide/config.md
config.md: c9c760cbdb9650e608809fee4498b7f884b339dc
config.zh.md: b80e31c6f77f51d013aaebe5c4e9e43f5819e33f

View File

@@ -8,7 +8,7 @@ Harness uses `cordis.yml` to describe which plugins an agent loads and the confi
The repository examples are runnable configurations and the most reliable starting points for a new project:
- [tui-agent](../../../examples/tui-agent/cordis.yml) combines the DeepSeek model, Bash, filesystem, compaction, subagents, workflows, and the interactive TUI.
- [the shared `dsh` base](../../../apps/cli/base.cordis.yml) plus the [`tui.cordis.yml`](../../../apps/cli/tui.cordis.yml) overlay combines the DeepSeek model, Bash, filesystem, compaction, subagents, workflows, and the interactive TUI.
- [headless-agent](../../../examples/headless-agent/cordis.yml) exposes the coding composition as a one-shot task.
- [acp-agent](../../../examples/acp-agent/cordis.yml) exposes fresh sessions to programmatic ACP clients.
@@ -25,12 +25,13 @@ A minimal configuration is a list of plugin entries:
- id: bash
name: '@deepseek-ai/dsh-bash-local'
- id: tui-agent
name: '@deepseek-ai/dsh-tui-demo'
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: deepseek
model: deepseek-v4-flash
workspaceContext: false
agents:
- id: main
provider: deepseek
model: deepseek-v4-flash
```
## Plugin entries

View File

@@ -8,7 +8,7 @@ Harness 使用 `cordis.yml` 描述 Agent 加载哪些插件以及每个插件的
仓库中的示例就是可以运行的配置,也是新项目最可靠的起点:
- [tui-agent](../../../examples/tui-agent/cordis.yml) 组合 DeepSeek 模型、Bash、文件系统、压缩、子代理、工作流和交互式 TUI。
- [共享的 `dsh` base](../../../apps/cli/base.cordis.yml) 叠加 [`tui.cordis.yml`](../../../apps/cli/tui.cordis.yml) overlay组合 DeepSeek 模型、Bash、文件系统、压缩、子代理、工作流和交互式 TUI。
- [headless-agent](../../../examples/headless-agent/cordis.yml) 以单次任务形式暴露 coding 组装。
- [acp-agent](../../../examples/acp-agent/cordis.yml) 向程序化 ACPAgent Client Protocol客户端提供全新会话。
@@ -25,12 +25,13 @@ Harness 使用 `cordis.yml` 描述 Agent 加载哪些插件以及每个插件的
- id: bash
name: '@deepseek-ai/dsh-bash-local'
- id: tui-agent
name: '@deepseek-ai/dsh-tui-demo'
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: deepseek
model: deepseek-v4-flash
workspaceContext: false
agents:
- id: main
provider: deepseek
model: deepseek-v4-flash
```
## 插件条目

View File

@@ -1,6 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
index.md: b698b8aeee6cebff374e20ca0f76ddc9e75213c0
index.zh.md: 337d246baa12ccf6d7a9656d1ea3b06002554c13
# pnpm run verify-translation-pairing --write docs/user/guide/index.md
index.md: 72d822f6377089f56abda4383f393eed30a6709a
index.zh.md: 442cda48072c3f6bf9579e880c0ab381b799966f

View File

@@ -14,12 +14,17 @@ Harness implements every capability an AI agent needs—including LLM calls, too
config:
apiKey: !!js process.env.DEEPSEEK_API_KEY
# Select the interactive application
- name: '@deepseek-ai/dsh-tui-demo'
# Select the agent the interactive front door drives
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: deepseek
model: deepseek-v4-flash
workspaceContext: false
agents:
- id: main
provider: deepseek
model: deepseek-v4-flash
# Select the interactive front door
- name: '@deepseek-ai/dsh-tui'
```
## Who it is for

View File

@@ -14,12 +14,17 @@ Harness 将一个 AI Agent智能体 所需要的所有能力——LLM 调
config:
apiKey: !!js process.env.DEEPSEEK_API_KEY
# Select the interactive application
- name: '@deepseek-ai/dsh-tui-demo'
# Select the agent the interactive front door drives
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
provider: deepseek
model: deepseek-v4-flash
workspaceContext: false
agents:
- id: main
provider: deepseek
model: deepseek-v4-flash
# Select the interactive front door
- name: '@deepseek-ai/dsh-tui'
```
## 适合谁

View File

@@ -1,6 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
quickstart.md: 25ce51ee3d010d2eb800071b9697fc62857dace1
quickstart.zh.md: e2e023670a999566e273d8893c42103dc273e7b1
# pnpm run verify-translation-pairing --write docs/user/guide/quickstart.md
quickstart.md: 75c0d7096f09092106aca46a5a078673708040e7
quickstart.zh.md: 0beadb65f32f21d18bb4550eda967ed2b275b10f

View File

@@ -52,7 +52,7 @@ The full-screen agent can read and write files, run commands, delegate subtasks,
## What happened
headless-agent uses the `@deepseek-ai/dsh-cli-demo` app; tui-agent uses the interactive `@deepseek-ai/dsh-tui-demo` app. Both load the same providerless agent spine, while their `cordis.yml` files select the DeepSeek model and capability plugins appropriate to each surface.
headless-agent uses the `@deepseek-ai/dsh-cli-demo` app; the interactive `dsh` surface instead composes [`apps/cli/base.cordis.yml`](../../../apps/cli/base.cordis.yml) with the `tui.cordis.yml` overlay and no app bundle. Both load the same providerless agent spine, while their `cordis.yml` files select the DeepSeek model and capability plugins appropriate to each surface.
## Next steps

View File

@@ -52,7 +52,7 @@ pnpm run demo:tui
## 回头看
headless-agent 使用 `@deepseek-ai/dsh-cli-demo` apptui-agent 使用交互式 `@deepseek-ai/dsh-tui-demo` app。二者加载同一个 providerless agent spine并通过各自的 `cordis.yml` 为对应 surface 选择 DeepSeek 模型和能力插件。
headless-agent 使用 `@deepseek-ai/dsh-cli-demo` app;交互式 `dsh` surface 则以 [`apps/cli/base.cordis.yml`](../../../apps/cli/base.cordis.yml) 叠加 `tui.cordis.yml` overlay 组合而成,不使用 app 组合包。二者加载同一个 providerless agent spine并通过各自的 `cordis.yml` 为对应 surface 选择 DeepSeek 模型和能力插件。
## 下一步