前言¶
在 DSH WebUI 中,一次回答往往不是只有一段最终文本。模型过程中会出现 thinking、notes、commands 和 tool calls,也可能带有 context injection。随着 turn 变长,这些 Agent activity 会挤占对话空间,也让最终答复不容易快速定位。
dsh-turn-fold 要解决的是这个界面层面的问题:它把已完成 turn 的 Agent activity 折叠成摘要栏,并让最终答复保持可见。
这是什么¶
@ch4acko3/dsh-turn-fold 是一个 DSH WebUI 插件,由 CH4ACKO3 维护,分类为 ui,许可证为 MIT。
它的核心价值是:为 DSH WebUI 对话添加 Codex-Desktop 风格的 turn 折叠,将每个已完成 turn 的 Agent activity 折叠成摘要栏,最终答复保持可见。
核心功能¶
下面介绍已核实的能力:
- 为 DSH WebUI 对话添加 Codex-Desktop 风格的 turn 折叠。
- 折叠期间摘要栏保持可见,原生 thinking、notes、commands 和 tool calls 继续流式显示。
- 将已知 Agent activity,包括 context injection,移入最终答复前的一个 disclosure。
- 最终答复通过
turn-tail.closing.finalNode定位,而不是finish_reason或 DOM position。 - 对 completed、stopped 和 interrupted turns 折叠,并显示不同状态标签。
- 在 DSH 标记 closing branch unavailable、closing answer 后有节点、焦点/文本选择内、failed、max-token、closing-less 或 open 时保持展开。
- 展开时复用原始终生节点渲染器,保留 tool details、copy 和 file links。
- 通过 DSH 原生 locale service 注册英文和中文词典。
- 以内存中 Source Patches 运行,不修改已安装 DSH 文件。
- 可配置指标默认为 wall time、tool-call count 和 input/output tokens。
安装与启用¶
先安装插件,再检查补丁状态。
dsh plugin --profile web add github:CH4ACKO3/dsh-turn-fold
dsh harmony status --profile web # all three patches must be `bound`
第一条命令将插件添加到 web profile;第二条命令用于确认相关 Source Patches 已绑定。看到三个 patches 都为 bound 时,说明插件已按预期启用。
典型用法¶
1、在 DSH WebUI 中完成一个 turn,查看已完成 turn 的摘要栏。
2、需要复查过程时展开 disclosure,查看折叠前的 Agent activity。
3、本地仓库中运行测试:
node test/run.cjs
经过上面的步骤,可以分别查看折叠、展开、状态标签和本地化表现。
适用场景与注意¶
- 适合使用 DSH WebUI,并希望压缩已完成 turn 中过程性信息的开发者。
- 适用于
@deepseek-ai/dsh-client-ui-conversation从0.1.0-rc.8到0.2.0prerelease line,不包括0.2.0。 - Node 要求为
^22.22.3 || >=24.11.1。 - 插件以当前
dsh进程权限运行,安装前建议检查源码和许可证;本项目许可证为 MIT。 - 它以内存中 Source Patches 运行,不修改已安装 DSH 文件。
- 选择器必须恰好匹配一次;不兼容编译形态会 fail closed。
- 发布通过 Trusted Publishing (OIDC),不使用长期 npm token。
结尾¶
dsh-turn-fold 的价值在于把已完成 turn 的 Agent activity 收进摘要栏,同时保留最终答复、原生流式内容和展开后的原始渲染细节。它适合关注 DSH WebUI 对话体验的场景,也适合作为 DSH 插件生态中的 UI 类插件使用。
目录页链接未包含在已核实资料中。GitHub 地址:https://github.com/CH4ACKO3/dsh-turn-fold