给 DSH Web 界面新增「聚焦对话」标签页,将每轮助手的工具调用与思考折叠成可展开的单行摘要,便于快速回看对话进展。
- 语言
- TypeScript
- 分支
- main
安装
$ dsh plugin --profile web add @dingyi222666/dsh-focus-chat在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 dingyi222666/dsh-focus-chat:先查看仓库 https://github.com/dingyi222666/dsh-focus-chat 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
一句话定位
给 DSH Web GUI 加一个「聚焦对话」标签页,把每轮助手的工具调用和思考折叠成一句可展开的摘要(比如「思考了 36 秒,运行了 2 个命令,编辑了 8 个文件」),方便快速回看一轮对话到底做了什么。
核心能力
- 在 Web 对话界面新增「聚焦对话」标签页,与原聊天视图并列显示
- 把同一轮助手连续的工具调用合并成一行摘要,展示命令数、文件编辑数、读取数、目录列出数、思考时长等关键指标
- 任意摘要行可点击展开,工具卡片、思考内容、上下文注入、生成的文件等细节与聊天视图同款渲染
- 整轮助手回合可进一步折叠为一行
工作了 X 分 Y 秒(用户中途停止则显示用户在 X 后停止) - 用户中途插话会自动把折叠按段切开,每段带各自的工作时长
- 后台任务结算通知(如
bash pnpm install [status: completed])会归入摘要行的后台任务 N 个段,而不是作为上下文注入罗列 - 切换会话时滚动位置在内存中保留,下次切回仍在原阅读位置(不会写入磁盘)
技术实现
- 语言: TypeScript + React 18
- 关键依赖: @deepseek-ai/cordis(插件注入与上下文合并)、@deepseek-ai/dsh-client-ui-conversation(对话视图槽位与节点类型)、@deepseek-ai/dsh-client-runtime(会话 / 上下文 / 调度基础类型)、react / react-dom(视图渲染)
- 架构模式: 纯消费型客户端插件;通过 cordis 的
inject列表声明依赖slots / sessions / workspaces / connection / locale五个服务,并在conversation.view列表槽位注册一个名为focus的视图条目,由宿主渲染 - 入口文件: src/index.ts(宿主加载侧,空壳)、src/client/index.ts(浏览器侧总入口,重导出 apply 与 inject)
适用场景
当用户在 DSH Web 端完成了一段较长的多工具调用对话,想快速判断「这一轮到底干了什么、耗时多少、是否成功」时,切到聚焦标签页可以一眼看完。比起聊天视图里一步步盯着思考、命令、文件改动,聚焦视图更适合做事后回看、汇报、或者定位「刚才那一步改的是哪个文件」。
前置依赖与兼容性
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DSH | >= 0.1.0-rc.6 | 仅支持 Web 端的 dsh web GUI,不适用于 Node CLI 端 |
| Node | 未声明 | 插件本身不依赖任何 Node 特性 |
| 平台 | Web | package.json 中 dsh.client.platform 显式声明为 web |
| 原生模块 | 无 | 纯 TypeScript / React 实现,不依赖 node-pty、sqlite 等原生模块 |
安装方式
dsh plugin --profile web add github:dingyi222666/dsh-focus-chat
配置项
本插件无需额外配置。安装并重启 dsh web 后,对话界面会自动出现「聚焦对话」标签页。
常见问题
Q: 安装后需要做什么额外配置吗?
A: 不需要。插件通过 cordis.patch.yml 在 Web profile 里挂载一个 bundle,重启 dsh web 后会自带「聚焦对话」标签页,整个插件没有任何配置项。
Q: 它会不会改动原本的聊天视图?
A: 不会。插件刻意只在自己的标签页内渲染,不修改聊天视图本身,也不触碰 DSH 的源码 —— 因为聊天视图的内部对第三方插件是封闭的(槽位由聊天入口独占声明,跨 bundle 导入也被禁止)。
Q: 它会发模型请求或影响 KV 缓存吗?
A: 不会。该视图完全基于浏览器侧已经记录的对话快照做派生,不会发起任何模型请求,也不会影响 KV 缓存行为。
Q: 支持 Node CLI 端的 DSH 吗?
A: 不支持。package.json 中 dsh.client.platform 显式声明为 web,插件只面向浏览器端的 Web GUI,Node CLI 不会加载它。
Q: 其他插件加在聊天视图里的工具卡片扩展会出现在聚焦视图里吗?
A: 不会出现。聚焦视图用内置的卡片渲染器渲染工具内容,不会渲染第三方插件扩展的卡片,但工具原本要展示的内容仍会正常展开。
Q: 折叠粒度是怎样的?两段之间的可见内容会不会被吞掉?
A: 折叠是按连续的工具轮次进行的。如果两轮之间出现任何可见内容(助手回复、命令输出、你的插话),它们会保持分开,不会被合并。
Q: 滚动位置会持久化吗?
A: 不会。滚动位置仅保存在内存中(同一会话内切换标签页时仍能保持阅读位置),重启或更换会话后会重置。
上手难度
入门 — 安装一行命令、重启 dsh web 即可看到新标签页,零配置、零概念负担。
已知问题与限制
- 工具卡片没有「跳转到详情面板」的入口(依赖聊天视图的内部机制,第三方插件够不到)
- 第三方插件为聊天视图扩展的工具卡片在聚焦视图不渲染,统一使用内置卡片
- 折叠按连续工具轮次进行,两段之间若有可见内容(回复、命令、用户插话)保持分开
- 行内文件链接依赖可选的
chatFileMentions服务(与聊天视图共用同一个开关),未配置时不渲染 - 摘要行中「编辑 N 个文件」「读取 N 个文件」等文件操作不携带失败计数(只统计结果数),命令和其他工具才会标注失败次数
English | 中文
A plugin for the dsh web GUI that adds a focus chat tab — a condensed, Claude Code–style way to read a conversation.
Screenshots
| Off — the normal chat view | On — the focus chat view |
|---|---|
![]() | ![]() |
Instead of watching every step live, one assistant turn collapses into a single summary line:
Thought for 36s, loaded 3 context items, ran 2 shell commands, edited 8 files, read 17 files, listed 18 directories
…and the whole turn can fold into one Worked for Xm Ys line. Click any line to expand the full detail — tool cards, thinking, context injections, produced files, copy/fork actions — all drawn the same way as the normal chat rows. Your mid-turn interjections split the fold into per-stretch lines, each carrying its own duration, and a stopped turn reads Stopped after X instead of "worked". A background-task settlement — a tool-jobs notice injection like bash pnpm install [status: completed] — classifies into the summary line's N background jobs segment instead of riding it as a verbatim injected … account; expanding the line still shows the full notice body. File operations (edits / reads) never carry a failure tally on the summary line — edited N files reads the outcome — only command execution and other tools annotate failures.
Switch to it whenever you want the "what happened?" view, and flip back for the full transcript.
Install
# Install from npm (requires dsh >= 0.1.0-rc.6)
dsh plugin --profile web add @dingyi222666/dsh-focus-chat
# Restart dsh web; the tab mounts automatically
dsh web
Then open the Focus chat tab in any conversation.
Notes:
dsh pluginbehaves like adding a dependency to your web profile. A bundle plugin is loaded once its full package name appears in the profile'sdsh.profile.bundleslist (adds automatically on recent dsh builds; add it manually if your build does not); the bundle patch applies on the next boot.- With the repo source-launched CLI, run the args through the bin directly (
node --import tsx/esm apps/cli/src/bin.ts ...).
Why a separate tab, and not a patch into the chat view?
Short answer: the chat view's internals aren't open to third-party plugins — by design — and this plugin deliberately never touches dsh's own source. Concretely:
- Keyed slots are owned, not shared. The chat's rows render through slots like
conversation.chat.node,tool.call.toolview, andconversation.chat.turnTail. Those slots are declared by the chat entries themselves, and the slot system rejects a second declaration at load time — the conflict is the design speaking. A plugin cannot insert its own rows into the chat transcript, and cannot even declare the chat's own slots. - Plugins can't reuse the chat's renderer code. Importing values from another plugin package across the bundle boundary is forbidden (the bundle purity gate), so there's no way to borrow the chat's components — every row has to be drawn from the shared primitives and the public snapshot.
- The only legal insertion point is the
conversation.viewlist slot — the whole message surface. That's why the plugin ships its own complete view instead of changing how the chat view displays.
If you want the chat view itself to behave differently, that's an in-repo change to the chat package — exactly what this plugin avoids.
What's missing
Focus chat is a faithful reading surface, not a second chat view:
- No Inspect / details-panel deep links. The chat's Inspect affordance needs internals plugins can't touch. The tool cards render the same content, just without the jump-to-details button.
- Third-party tool-card extensions don't render here. Cards that other plugins add to the chat view won't appear in the focus view; the built-in card renderers are used instead.
- Folding is per consecutive tool-run. Any visible content between two runs (a reply, a command, your interjection) keeps them separate.
- Inline file links need the optional file-mentions service — the same off switch the chat view uses.
Development
yarn run build— builds the browser bundle and the Node half.src/client/focus-model.ts— the pure logic (folding, merging, row models);src/client/FocusView.tsx— the view.yarn test— behavior tests;yarn run typecheck— type gate.- A
--devdsh webserver hot-reloads rebuilt bundles —yarn run buildalone is usually enough to see changes.
Model Experience
None. The view is a pure client derivation over the already-logged conversation snapshot; nothing here reaches a model request.
KV Cache effect
None; this package neither assembles nor sends provider requests.
查看使用指南 →
该插件的安装步骤、关键要点、FAQ 与兼容性说明(基于已收录字段派生)。
收录徽章
[](https://deepseek-plugin.org/plugins/dingyi222666/dsh-focus-chat)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。

