# dsh-deliverables-accordion > **English**: [README.en.md](README.en.md) | **中文**: [README.md](README.md) An **accordion plugin** for the DSH Web GUI's "Produced" row (a standard Cordis external plugin package). It replaces the shipped produced-files row with a header that is **collapsed by default**; expanding it lists each produced file on its own row (type badge / filename / relative path / +N/-M), each with **Review** and **Open** actions. Review opens a modal that builds a git-style line diff from the **host session log** — every change of that file in that turn with the complete old→new fragments (no character truncation; historical turns are complete too). ![Deliverables accordion](1.png) *The produced-files accordion (collapsed row by default; click to expand the per-file list)* ![Review modal expanded](2.png) *Clicking **Review**: per-change accordion blocks expanded, git-style line diff (whole-file writes show the complete content)* ## Architecture - **Host half** (`src/index.ts`): registers the `/deliverables-accordion/*` HTTP routes; reads the session's raw event log via `ctx.sessions`, folds a turn's produced-file summaries, and reconstructs a file's full change stream on demand. - **Client half** (`src/client/`): registers a `conversation.chat.turnTail` chain entry (priority -10, ahead of shipped) and folds a **lightweight index** through `uiConversation` (only `seq`/`callId`/`path`/`op`/line stats — **no content text**); Review fetches the complete fragments from the host route. Opening a file uses the owner's `openFile` (host capability). - Copy goes through zh/en dictionaries; colors use `--dsw-alias-*` tokens with fallbacks; the style baseline is a 14.5px diff font. ## Install (into the web profile) ```bash pnpm build # produces lib/index.js + lib/client.js pnpm pack # produces dsh-deliverables-accordion-0.1.0.tgz dsh plugin --profile web add ./dsh-deliverables-accordion-0.1.0.tgz # restart dsh web for it to take effect (browser half is discovered via the # dsh.client manifest) ``` Equivalent manual wiring (the same pattern as dsh-mcp-settings / dsh-commandcode-usage): add the tarball as a dependency in `~/.dsh/profiles/web/package.json` under `dsh.profile.bundles`, together with this package's `cordis.patch.yml` (an `insert` row for `deliverables-accordion`). ## Development ```bash pnpm install pnpm build # tsdown dual output (node + browser) npx tsc --noEmit # type check ``` ## Data contract (no abandoned fields) - The conversation turn data (key `deliverablesAccordion`) publishes only a **lightweight index**: `{ files: [{ path, ops: [{ seq, callId, op, added, deleted, applied? }] }] }` — there is **no `oldText`/`newText`/truncated**; full content is always read from the host session log at review time. - The shipped `deliverables` key is never touched; for turns without produced files the selector returns `null`, so the shipped row (or nothing) takes over naturally. - +N/-M matches the message flow: per applied hunk, every `oldText` line and every `newText` line is counted (context lines appear on both sides — the same counting as shipped `DiffBlock`'s `diffTotals`). - **Authoritative fragments come from the host `tool/result`'s `meta.diffs`** (`write`/`edit` attach per-hunk old/new fragments with ±3 context lines on every success). The host fold and the client index resolve it when the result arrives: an old side present marks the change `applied` (a real changed region — the review renders a true line diff and stats include the deletion side); no `meta.diffs` (a genuine whole-file create, or an identical overwrite) falls back to a full-file add labeled **Full write**. - Badges: `create` = New; a `write` with an applied old side (the host really replaced existing content) = Overwritten; a `write` without an old side is Overwritten only when this session already wrote the path strictly earlier (a change never counts itself as its own prior), else New; everything else = Modified. ## Known limitations - Whole-file `write` over previously unknown content cannot show a deletion side when the host `meta.diffs` is absent (an identical overwrite, or a third-party tool without result metadata); the review shows the complete new content labeled **Full write**. The new/modify/overwrite badge relies on the session-observable mutation sequence (cross-turn memory lives for the page lifetime); the host review's `applied` old side is authoritative for the actual first write.