Files
deepseek-harness/packages/client
Turtle f290a8b851 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.
2026-07-29 21:15:42 +08:00
..
2026-07-29 17:46:06 +08:00

client/ — web-GUI browser half

English | 中文

The browser side of the dsh web GUI: shell kernel, module system, wire consumer, React-free object services, the slot system, and the ui-* feature-plugin roster. Authoring rules live in AGENTS.md; the host half is host/. All product packages, named @deepseek-ai/dsh-client-<name>.

Package Role ctx key / slot
web/ Shell kernel: AppWebEntry runs the two-stage boot over the host-pushed entry graph (boots the tree)
modules/ Client module system: browser peer of Node's ESM loader as a lazy CJS table under the vendored cordis Loader (module face)
web-react/ Shell-side React glue: createSlotRenderer + SessionProvider render seats (renderer install)
connection/ Wire consumer both ends: browser ctx.connection (shared api client + stream loop) and the node half mounting the /api route with its browser-trust fence ctx.connection
runtime/ Client cordis boot and React-free object services: slots, Sessions, Workspaces, per-session bindings ctx.slots ctx.sessions ctx.workspaces
hmr/ Dev-only hot reload for fetch-arrival client plugins (--dev graphs) (dev entry)
locale/ Browser locale preference (zh/en) plus the ns×locale dictionary registry ctx.locale
ui-slots/ Slot registry pure core: SlotMap merging, single register API, the four-share props family (types + core)
ui-theme/ Theme preference over the --dsw-* token stylesheets (light/dark/system) ctx.theme
ui-primitives/ Pure React atoms: icons, Button/Pill/Menu/Modal/Input, markdown family (component library)
ui-layout/ Shell three-column AppFrame; declares sidebar / conversation / details / conversation.empty ctx.layout
ui-sidebar/ Sidebar shell: Workspace/session rail, search, collapse; declares sidebar.workspaces (slot host)
ui-workspace/ Shared Workspace picker: browser region + hero picker over the same creation flow (fills sidebar.workspaces, conversation.hero.workspace)
ui-conversation/ Conversation domain: skeleton, chat view, input dock, per-tool row slots (slot host)
ui-trajectory/ Trajectory/Waterfall view tabs; the minimal pure-consumer plugin exemplar (fills conversation.view)
ui-command/ Command surface: session-keyed directory cache, / source, three-kind dispatch ctx.command
ui-slash/ Input trigger pipeline: / and @ detection, grouped candidate menu, source roster ctx.slash
ui-skill/ /-trigger skill reference source over the skill.list RPC (registers into ctx.slash)
ui-subagent/ @-trigger subagent reference source over the sessions snapshot (registers into ctx.slash)
ui-model/ Model selection: /model popupSelect + the composer model seat over ModelService ctx.models
ui-question/ Web ask_user_question: host half mounts the tool, browser half fills the composer seat (fills conversation.composer)
ui-settings/ Settings shell: trigger chrome + modal panel; declares the settings.* slots (slot host)
ui-settings-general/ Settings ownerless copy: chrome content + General section skeleton (fills settings.*)
ui-models/ Models settings nav entry (content column lands in a later phase) (fills settings.section)

Feature UI composes only through the slot system (ctx.slots.register) — the slot system standard is the definitive model; the web client architecture note owns the loading chain and object layer.