@deepseek-harness-tui/dsh-tui 0.11.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +21 -5
  2. package/bin/dsh-tui.js +30 -3
  3. package/cordis.patch.yml +24 -5
  4. package/guide/dsh-tui-guide/SKILL.md +37 -0
  5. package/guide/dsh-tui-guide/configuration.en.md +410 -0
  6. package/guide/dsh-tui-guide/configuration.md +349 -0
  7. package/guide/dsh-tui-guide/getting-started.en.md +398 -0
  8. package/guide/dsh-tui-guide/getting-started.md +397 -0
  9. package/guide/dsh-tui-guide/interaction.en.md +674 -0
  10. package/guide/dsh-tui-guide/interaction.md +747 -0
  11. package/guide/dsh-tui-guide/migrate.en.md +166 -0
  12. package/guide/dsh-tui-guide/migrate.md +132 -0
  13. package/guide/dsh-tui-guide/plugins.en.md +68 -0
  14. package/guide/dsh-tui-guide/plugins.md +56 -0
  15. package/guide/dsh-tui-guide/themes.en.md +192 -0
  16. package/guide/dsh-tui-guide/themes.md +185 -0
  17. package/guide/dsh-tui-guide/user-guide.en.md +608 -0
  18. package/guide/dsh-tui-guide/user-guide.md +586 -0
  19. package/guide/dsh-tui-guide/vscode.en.md +301 -0
  20. package/guide/dsh-tui-guide/vscode.md +272 -0
  21. package/lib/settings.json +5 -5
  22. package/lib/types/adapter/channel/ui-policy.d.ts +3 -2
  23. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  24. package/lib/types/adapter/channel/ui-policy.js +4 -0
  25. package/lib/types/adapter/ports/channel-settings.d.ts +2 -1
  26. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  27. package/lib/types/adapter/ports/channel-ui.d.ts +29 -2
  28. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  29. package/lib/types/adapter/ports/channel-view.d.ts +43 -9
  30. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  31. package/lib/types/components/Chat/JobCard.d.ts +9 -0
  32. package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
  33. package/lib/types/components/Chat/JobCard.js +42 -15
  34. package/lib/types/components/Chat/SubagentMessage.js +6 -6
  35. package/lib/types/components/JobsPanel.d.ts.map +1 -1
  36. package/lib/types/components/JobsPanel.js +80 -33
  37. package/lib/types/components/MessageList.js +3 -3
  38. package/lib/types/components/PresetPicker.d.ts +4 -0
  39. package/lib/types/components/PresetPicker.d.ts.map +1 -1
  40. package/lib/types/components/PresetPicker.js +5 -1
  41. package/lib/types/components/PromptInput.d.ts.map +1 -1
  42. package/lib/types/components/PromptInput.js +12 -1
  43. package/lib/types/components/StarPrompt.d.ts +6 -0
  44. package/lib/types/components/StarPrompt.d.ts.map +1 -1
  45. package/lib/types/components/StarPrompt.js +45 -0
  46. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  47. package/lib/types/components/SubagentCard.js +8 -8
  48. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  49. package/lib/types/components/SubagentDetailScene.js +108 -10
  50. package/lib/types/components/WhaleGirl.d.ts +6 -0
  51. package/lib/types/components/WhaleGirl.d.ts.map +1 -1
  52. package/lib/types/components/WhaleGirl.js +18 -0
  53. package/lib/types/components/messages/AssistantThinkingMessage.js +4 -4
  54. package/lib/types/components/trajectory/MiniWake.d.ts +11 -1
  55. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  56. package/lib/types/components/trajectory/MiniWake.js +9 -3
  57. package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -1
  58. package/lib/types/dsh-adapter/channel/external-commands.js +8 -2
  59. package/lib/types/dsh-adapter/channel/job-projection.d.ts +1 -0
  60. package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
  61. package/lib/types/dsh-adapter/channel/job-projection.js +88 -3
  62. package/lib/types/dsh-adapter/channel/mode-actions.d.ts +13 -0
  63. package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
  64. package/lib/types/dsh-adapter/channel/mode-actions.js +48 -7
  65. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
  66. package/lib/types/dsh-adapter/channel/mode-permission-actions.js +25 -9
  67. package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
  68. package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
  69. package/lib/types/dsh-adapter/channel/preferences.js +17 -7
  70. package/lib/types/dsh-adapter/channel/state.d.ts +4 -2
  71. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  72. package/lib/types/dsh-adapter/channel/state.js +1 -1
  73. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  74. package/lib/types/dsh-adapter/channel/subagent-projection.js +5 -0
  75. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  76. package/lib/types/dsh-adapter/channel.js +16 -1
  77. package/lib/types/dsh-adapter/contract.d.ts +5 -4
  78. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  79. package/lib/types/dsh-adapter/contract.js +9 -3
  80. package/lib/types/dsh-adapter/jobs.d.ts +82 -16
  81. package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
  82. package/lib/types/dsh-adapter/jobs.js +104 -9
  83. package/lib/types/dsh-adapter/oauth/bonus.d.ts +27 -0
  84. package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -0
  85. package/lib/types/dsh-adapter/oauth/bonus.js +69 -0
  86. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.d.ts +2 -1
  87. package/lib/types/dsh-adapter/oauth/command.d.ts.map +1 -0
  88. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.js +7 -4
  89. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.d.ts +13 -10
  90. package/lib/types/dsh-adapter/oauth/credentials.d.ts.map +1 -0
  91. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.js +61 -23
  92. package/lib/types/dsh-adapter/oauth/deepseek.d.ts +39 -0
  93. package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -0
  94. package/lib/types/dsh-adapter/oauth/deepseek.js +189 -0
  95. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.d.ts +24 -16
  96. package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -0
  97. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.js +34 -20
  98. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/interaction.d.ts +14 -12
  99. package/lib/types/dsh-adapter/oauth/interaction.d.ts.map +1 -0
  100. package/lib/types/dsh-adapter/oauth/interaction.js +283 -0
  101. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.d.ts +2 -1
  102. package/lib/types/dsh-adapter/oauth/opener.d.ts.map +1 -0
  103. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.js +1 -1
  104. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.d.ts +10 -3
  105. package/lib/types/dsh-adapter/oauth/pi-ai.d.ts.map +1 -0
  106. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.js +8 -3
  107. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.d.ts +6 -3
  108. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -0
  109. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.js +11 -3
  110. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.d.ts +14 -7
  111. package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -0
  112. package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.js +82 -17
  113. package/lib/types/dsh-adapter/plugin.d.ts +8 -1
  114. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/plugin.js +72 -12
  116. package/lib/types/dsh-adapter/presets.d.ts +6 -4
  117. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/presets.js +6 -4
  119. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  120. package/lib/types/dsh-adapter/providerWizard.js +6 -2
  121. package/lib/types/dsh-adapter/subagents.d.ts +1 -0
  122. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  123. package/lib/types/dsh-adapter/subagents.js +10 -1
  124. package/lib/types/i18n.d.ts +174 -18
  125. package/lib/types/i18n.d.ts.map +1 -1
  126. package/lib/types/i18n.js +53 -11
  127. package/lib/types/ink/components/App.d.ts.map +1 -1
  128. package/lib/types/ink/components/App.js +10 -1
  129. package/lib/types/ink/parse-keypress.d.ts +35 -0
  130. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  131. package/lib/types/ink/parse-keypress.js +611 -83
  132. package/lib/types/ink/terminal-querier.d.ts +25 -0
  133. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  134. package/lib/types/ink/terminal-querier.js +42 -0
  135. package/lib/types/ink/update-overflow-guard.d.ts +24 -0
  136. package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
  137. package/lib/types/ink/update-overflow-guard.js +25 -3
  138. package/lib/types/minimalUiMode.d.ts +19 -0
  139. package/lib/types/minimalUiMode.d.ts.map +1 -0
  140. package/lib/types/minimalUiMode.js +23 -0
  141. package/lib/types/oauth.d.ts +5 -10
  142. package/lib/types/oauth.d.ts.map +1 -1
  143. package/lib/types/oauth.js +5 -10
  144. package/lib/types/screens/Chat.d.ts +4 -1
  145. package/lib/types/screens/Chat.d.ts.map +1 -1
  146. package/lib/types/screens/Chat.js +27 -7
  147. package/lib/types/screens/StatusLine.d.ts +4 -0
  148. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  149. package/lib/types/screens/StatusLine.js +12 -12
  150. package/lib/types/settings/definitions.js +4 -4
  151. package/lib/types/tips.d.ts.map +1 -1
  152. package/lib/types/tips.js +10 -4
  153. package/lib/types/update.js +2 -2
  154. package/lib/types/utils/pastedImagePath.d.ts +8 -0
  155. package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
  156. package/lib/types/utils/pastedImagePath.js +29 -5
  157. package/package.json +111 -100
  158. package/presets/liangshen/agent.cordis.yml +4 -1
  159. package/presets/liangshen/preset.yml +1 -1
  160. package/lib/types/minimalMode.d.ts +0 -13
  161. package/lib/types/minimalMode.d.ts.map +0 -1
  162. package/lib/types/minimalMode.js +0 -17
  163. package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +0 -21
  164. package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +0 -143
  165. package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +0 -11
  166. package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +0 -44
  167. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +0 -193
  168. package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +0 -69
@@ -0,0 +1,397 @@
1
+ # 安装与快速开始
2
+
3
+ [文档索引](README.md) · [English](getting-started.en.md)
4
+
5
+ ## 前置条件
6
+
7
+ - Node.js `^22.19 || >=24`。CI 使用 Node 24。
8
+ - 官方 DeepSeek Harness CLI:`@deepseek-ai/dsh`。
9
+ - `pnpm` **10 或更高**(CI 使用 11)。`dsh plugin` 把 profile 内的包安装
10
+ 交给 pnpm;pnpm 9 的传递依赖提升行为不同,会让 `dsh-working-activity`
11
+ 解析不到,表现为启动后立刻退出且几乎无报错(issue #60,见下方常见问题)。
12
+ - 支持交互输入的终端 TTY。`dsh-tui` 不支持把 stdout 重定向后启动。
13
+ - `deepseek-official` 模型路由需要 `DEEPSEEK_API_KEY`;DSH 0.2.0-rc.1+ 的标准 profile 也可通过 `/auth login deepseek-account` 登录独立的 DeepSeek 账号路由。其他支持的账号可用 `/provider` 或 `/auth` 登录。自定义兼容端点还可设置 `DEEPSEEK_BASE_URL`。
14
+
15
+ macOS/Linux:
16
+
17
+ ```sh
18
+ export DEEPSEEK_API_KEY='your-key'
19
+ ```
20
+
21
+ PowerShell:
22
+
23
+ ```powershell
24
+ $env:DEEPSEEK_API_KEY = 'your-key'
25
+ ```
26
+
27
+ 不要把真实密钥提交到仓库。正常的 profile 启动直接读取环境变量。
28
+
29
+ ## 安装
30
+
31
+ 最快路径(全局安装后自带 `dsh-tui` 直达命令):
32
+
33
+ ```sh
34
+ # 官方 CLI + 本插件
35
+ npm install -g @deepseek-ai/dsh @deepseek-harness-tui/dsh-tui
36
+
37
+ # pnpm 未安装时任选一种方式(首次启动自动初始化 profile 时需要)
38
+ npm install -g pnpm
39
+ # 或:corepack enable pnpm
40
+
41
+ # 启动:首次运行自动执行 dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@<版本>
42
+ dsh-tui
43
+ ```
44
+
45
+ 手工分步(等价):
46
+
47
+ ```sh
48
+ npm install -g @deepseek-ai/dsh
49
+
50
+ # pnpm 未安装时任选一种方式
51
+ npm install -g pnpm
52
+ # 或:corepack enable pnpm
53
+
54
+ dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui
55
+ dsh --profile dsh-tui # 或 dsh-tui
56
+ ```
57
+
58
+ 从仓库检出运行时,也可以执行:
59
+
60
+ ```sh
61
+ sh install.sh
62
+ ```
63
+
64
+ `install.sh` 只封装 profile 插件命令并检查 `dsh`、`pnpm` 是否可用;它不会
65
+ 复制源码,也不需要本地构建。
66
+
67
+ ## 从旧包迁移
68
+
69
+ 早期版本使用无 scope 包 `dsh-cc-tui` 和 `cc-tui` profile:
70
+
71
+ - 环境变量前缀为 `CC_TUI_*`/`DSH_CC_*`。
72
+ - 数据目录为 `~/.dsh-cc`。
73
+
74
+ 新版本统一为组织包 `@deepseek-harness-tui/dsh-tui` 与 `dsh-tui` profile。
75
+ 执行以下命令创建新 profile:
76
+
77
+ ```sh
78
+ dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui
79
+ dsh --profile dsh-tui
80
+ ```
81
+
82
+ 新版本只使用 `DSH_TUI_*` 环境变量与 `~/.dsh-tui` 数据目录,旧名不再被读取,
83
+ 也不自动迁移数据。首次启动后,请把旧数据目录(`~/.dsh-cc` 等)中的主题、
84
+ 配置与历史文件自行复制到 `~/.dsh-tui`。
85
+
86
+ 确认新 profile 正常后:
87
+
88
+ - 旧的 `$DSH_HOME/profiles/cc-tui` 与旧数据目录残留可按需删除。
89
+ - 不要把旧包和新包同时添加到同一个 profile。
90
+
91
+ ## 安装命令做了什么
92
+
93
+ 首次执行 `dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui` 时,
94
+ 官方 CLI 会:
95
+
96
+ 1. 在 `$DSH_HOME/profiles/dsh-tui/` 初始化 profile。未设置 `DSH_HOME` 时,
97
+ 默认根目录通常是 `~/.dsh`。
98
+ 2. 让 profile 的第一层 bundle 使用 `@deepseek-ai/dsh-base`。
99
+ 3. 在 profile 内通过 pnpm 安装 `@deepseek-harness-tui/dsh-tui`。
100
+ 4. 读取包内 `dsh.bundle.patch` 元数据,将 `cordis.patch.yml` 追加为组合层。
101
+
102
+ 启动时的主要顺序是:
103
+
104
+ ```text
105
+ dsh-base -> 其他 bundle -> @deepseek-harness-tui/dsh-tui patch -> 用户 profile patch
106
+ ```
107
+
108
+ - base 提供 Agent、模型、会话、文件、Shell、策略和注册表等服务。
109
+ - 本插件的 patch 覆盖或插入 TUI、Agent preset 名册、SQLite 会话持久化与
110
+ 工作状态行。
111
+
112
+ `dsh-working-activity` 已经是本包依赖,并由 `dsh-tui` 的 patch 自动插入。
113
+ 不要对同一个 profile 再单独执行 `add dsh-working-activity`,否则可能出现重复行。
114
+
115
+ ## 启动
116
+
117
+ ```sh
118
+ dsh --profile dsh-tui
119
+ ```
120
+
121
+ 命令从当前目录启动,因此 Agent 的默认工作区也是当前目录。进入目标项目目录后再
122
+ 启动即可。
123
+
124
+ Windows 仓库检出还提供:
125
+
126
+ ```bat
127
+ dsh-tui.cmd
128
+ dsh-tui.cmd --resume
129
+ ```
130
+
131
+ - `--resume` 会读取 `%USERPROFILE%\.dsh-tui\resume.txt`,恢复 TUI 最近选择的
132
+ 会话。
133
+ - 设置 `DSH_TUI_WORKSPACE` 可以覆盖批处理启动器采用的工作目录。
134
+
135
+ ## CLI 子命令
136
+
137
+ `dsh-tui help`(或 `dst help`)打印完整用法,`dst` 别名接受相同命令:
138
+
139
+ | 命令 | 作用 |
140
+ | --- | --- |
141
+ | `dsh-tui update` | 更新 profile 到最新版本并对齐启动器(与 TUI 内 `/update` 同一安装逻辑,不进入 TUI) |
142
+ | `dsh-tui doctor` | 环境检查:dsh/pnpm、profile 安装与版本对齐、API key 是否设置(只报状态不读值)、配置文件存在性;与 TUI 内 `/doctor` 会话诊断互补 |
143
+ | `dsh-tui safe` | 安全模式:只读诊断、插件清单与修复指引(`safe --rescue` 还会创建/校验干净的救援 profile) |
144
+ | `dsh-tui version` | 显示启动器与 profile 版本(`--version`/`-v` 等价) |
145
+ | `dsh-tui help` | 显示用法(`--help`/`-h` 等价) |
146
+
147
+ `help`/`version` 在 dsh 缺失或 profile 未初始化时也能用;其余参数原样转发给
148
+ `dsh --profile dsh-tui`。
149
+
150
+ ## 安全模式(`dsh-tui safe`)
151
+
152
+ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件清单与修复指引。
153
+
154
+ - **两个入口**:手动运行 `dsh-tui safe`;或 dsh 非零退出后按提示进入。
155
+ - 提示仅出现在交互终端;脚本/管道只加一行提示、退出码不变。
156
+ - 只覆盖最终 dsh 子进程的非零退出码,不含启动挂起(启动失败按退出码 1)。
157
+ - **只读边界**:诊断/清单/指引不改状态。两个例外:
158
+ - 重试正常启动;若 `~/.dsh-tui/resume.txt` 里有指针则一并带上
159
+ (`DSH_TUI_RESUME_SESSION`),崩溃后重试会回到当时所在会话而不是新空会话。
160
+ - 创建/复用救援 profile,只写 `$DSH_HOME/profiles/dsh-tui-safe/`。
161
+ 注:每次 dsh 启动仍会写 `$DSH_HOME/profiles/node_modules` 回退链接与
162
+ pnpm 全局 store(非安全模式引入)。
163
+ - **救援 profile 必须干净,证不出就拒绝**。逐条校验,任一不成立即拒绝:
164
+ - 候选目录已存在,但不是可识别的 profile。
165
+ - 既有 profile 的根 manifest 声明了第三方插件。
166
+ - `$DSH_HOME/cordis.patch.yml`(home 层)**存在即拒绝**。
167
+ - `dsh-tui-safe/cordis.patch.yml`(profile 层)**有条目即拒绝**;dsh 默认
168
+ 生成的「注释 + `[]`」不算条目。
169
+ 删除/重建救援 profile 前会**按名字与形态核对顶层条目**,发现别的名字或
170
+ 形态不符就拒绝并列出,**不会静默删你的文件**。
171
+ - **非交互**:`dsh-tui safe --rescue` 跑同一套门禁与创建/复用,只报结论
172
+ (就绪退出 0,拒绝退出 1)。
173
+ - **旧全局启动器**:profile 副本不可读或过旧时,先升级:
174
+ `npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@<版本>`。
175
+ - **修复命令需自行执行**(安全模式只列出):
176
+ - `dsh plugin --profile dsh-tui remove <第三方插件>` 逐个移除可疑插件;
177
+ - `dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@<版本>`
178
+ 重装对齐;
179
+ - `dsh-tui doctor` 环境诊断。
180
+
181
+ ## 在 VS Code / Herdr 中运行
182
+
183
+ - **VS Code**:可在集成终端直接运行,或用已上架 Marketplace 的 companion 扩展
184
+ `dsh-tui-vscode`(真实终端会话、会话历史、指定会话恢复、IDE 选区通道)。
185
+ 见 [VS Code 使用指南](vscode.md)。
186
+ - **Herdr**:直接在 [Herdr](https://herdr.dev) 窗格中运行 `dsh-tui`,无需额外
187
+ 配置;dsh-TUI 经 Herdr 本地集成 API 报告 `idle` / `working` / `blocked`
188
+ (问卷与工具审批记为 `blocked`),在 Herdr 之外不做任何事。
189
+
190
+ ## 更新到最新版本
191
+
192
+ 项目迭代很快,更新复用安装命令,显式指定 `@latest`:
193
+
194
+ ```sh
195
+ # 更新 Profile runtime(TUI 内 /update 做的就是这件事)
196
+ dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest
197
+ ```
198
+
199
+ 通过全局 `dsh-tui` 命令启动时,还需要让 Launcher 对齐(TUI 内的
200
+ `/update` 只更新 profile,不会动全局安装):
201
+
202
+ ```sh
203
+ npm install -g @deepseek-harness-tui/dsh-tui@latest
204
+ # 或(原本用 pnpm 全局安装时)
205
+ pnpm add -g @deepseek-harness-tui/dsh-tui@latest
206
+ ```
207
+
208
+ - 不带 `@latest` 时 pnpm 会按 profile `package.json` 里已记录的版本范围
209
+ (如 `^0.1.4`)就地解析,可能停留在旧的主线上——这是"重复执行安装命令
210
+ 但版本没变"的常见原因。
211
+ - 修复"版本不一致"时,优先使用启动器打印的"精确版本"命令(例如
212
+ `npm install -g @deepseek-harness-tui/dsh-tui@0.8.3`);日常主动升级才
213
+ 使用 `@latest`。
214
+ - 确认生效:启动横幅右上角显示当前版本(`✦ dsh-TUI vX.Y.Z`)。
215
+ - 用户覆盖层 `cordis.patch.yml` 在更新中原样保留。
216
+ - 会话数据的存放位置可能随版本变化(如 0.3.7 起 `/resume` 改用与 dsh web
217
+ 共享的 JSONL 会话库),跨大版本更新后旧会话不在列表属预期,原数据不会被删除。
218
+
219
+ ### pnpm 安装脚本拦截与异平台原生包
220
+
221
+ 若 `dsh plugin` 安装时报 `ERR_PNPM_IGNORED_BUILDS`(pnpm ≥11 默认阻止带
222
+ 安装脚本的依赖,如 `@google/genai`、`protobufjs`——这些脚本运行时不需要,
223
+ 忽略即可),在 profile 的 `pnpm-workspace.yaml` 里加入:
224
+
225
+ ```yaml
226
+ allowBuilds:
227
+ '@google/genai': false
228
+ protobufjs: false
229
+ ```
230
+
231
+ `/update` 与 `dsh-tui update` 会自动写入这份配置,无需手工处理。
232
+
233
+ 更新时还会维护 `ignoredOptionalDependencies`(忽略异平台的 `@img/sharp-*`
234
+ 原生包):
235
+
236
+ - sharp 以全平台可选依赖分发,不处理时 `pnpm update` 会把各平台二进制一起
237
+ 下载(实测约 200MB)。
238
+ - 名单每次更新按当前平台重算,异平台原生包不再下载(当前平台原生包与无平台
239
+ 归属的 wasm 回退包保留)。
240
+ - 把 profile 搬到别的平台或 musl 容器后,在那台机器上跑一次更新即可刷新。
241
+ - 老 profile 的 lockfile 里仍写着全平台条目,第一次更新会照旧下载一遍,之后
242
+ 才被忽略。
243
+ - 块内不属于这两张平台表的条目(`fsevents`、自己写的 `@img/sharp-wasm32`
244
+ 豁免)原样保留;需要 pnpm 支持该键,不认识的版本不会因此报错,只失去这项
245
+ 收益。
246
+
247
+ ## Profile 配置
248
+
249
+ 用户覆盖文件位于:
250
+
251
+ ```text
252
+ $DSH_HOME/profiles/dsh-tui/cordis.patch.yml
253
+ ```
254
+
255
+ 配置一个节点时,`config` 块是整段替换,不是逐字段深合并。复制示例时需要保留
256
+ 仍然有效的字段。完整说明见[配置参考](configuration.md)。
257
+
258
+ 仓库根目录的 `cordis.yml` 是裸组合示例;正常的 npm/profile 安装以
259
+ `cordis.patch.yml` 为准,不需要把根配置复制到 profile。
260
+
261
+ ## 从源码开发
262
+
263
+ ```sh
264
+ git clone --recurse-submodules https://github.com/ccch1mneyyy/dsh-TUI.git
265
+ cd dsh-TUI
266
+ pnpm install --frozen-lockfile
267
+ pnpm build
268
+ pnpm smoke
269
+ ```
270
+
271
+ 本仓库有两个子模块,其中安装必需的是 `vendor/dsh-std`:
272
+
273
+ - `vendor/dsh-std`:`pnpm-workspace.yaml` 把 `vendor/dsh-std/packages/*` 列为
274
+ workspace 包。
275
+ - `dsh-ecosystem-spec`:生态适配规范,供契约检查使用。
276
+
277
+ 漏掉 `--recurse-submodules` 会让这些目录为空,
278
+ `pnpm install --frozen-lockfile` 直接失败。已经克隆过的检出补一条:
279
+
280
+ ```sh
281
+ git submodule update --init --recursive
282
+ ```
283
+
284
+ `pnpm build` 会清理忽略入库的 `lib/`,把 `src/` 编译到 `lib/types/`,再运行
285
+ 构建门禁。
286
+
287
+ - **Git URL 安装不受支持**(workspace 依赖/子模块/pnpm ≥11 prepare 白名单
288
+ 三重阻断)。
289
+ - 发布 workflow 也会在打包前显式执行干净编译和包面验证。
290
+
291
+ 真实测试当前源码时,首次使用或正式模型/密钥配置变化后运行:
292
+
293
+ ```sh
294
+ pnpm dev:copy-config
295
+ ```
296
+
297
+ 以后每次修改源码后,一条命令构建、打包、隔离安装并启动:
298
+
299
+ ```sh
300
+ pnpm dev
301
+ ```
302
+
303
+ `pnpm dev:copy-config` 只复制 `~/.dsh/settings.yaml` 与
304
+ `~/.dsh/.credentials.yaml`。Unix 上文件权限设为 `0600`;Windows 使用系统管理的
305
+ 文件 ACL。
306
+
307
+ `pnpm dev` 使用独立的 `HOME`、`DSH_HOME` 和会话目录,不覆盖正式
308
+ `~/.dsh/profiles/dsh-tui`、`~/.dsh-tui` 或正式会话。默认测试目录:
309
+
310
+ - Unix:`$XDG_CACHE_HOME/dsh-tui-dev`(未设置时为 `~/.cache/dsh-tui-dev`)。
311
+ - Windows:`%LOCALAPPDATA%\dsh-tui-dev`。
312
+ - 可通过 `DSH_TUI_DEV_ROOT` 覆盖。
313
+
314
+ 不启动 TUI、只验证构建、打包和安装流程时运行:
315
+
316
+ ```sh
317
+ pnpm dev:test
318
+ ```
319
+
320
+ CI 还会运行三条渲染回归:
321
+
322
+ ```sh
323
+ node --import tsx/esm scripts/repro-askpanel.tsx
324
+ node --import tsx/esm scripts/verify-askpanel-layout.tsx
325
+ node --import tsx/esm scripts/repro-toolcards.tsx
326
+ ```
327
+
328
+ `pnpm tui` 调用的 `scripts/run.ts` 直接组合 DeepSeek Harness 源码 patch,默认
329
+ 假设包位于 Harness monorepo 的 `packages/*` 布局中;独立 checkout 需要另外
330
+ 设置 `DSH_TUI_DEV_WORKSPACE` 指向 Harness 根目录。只测试本仓库当前源码时,
331
+ 优先使用上述 `pnpm dev`,它会走与用户安装一致的 profile 路径。
332
+
333
+ ## 常见问题
334
+
335
+ ### Git URL 安装报错
336
+
337
+ Git URL(如 `https://github.com/ccch1mneyyy/dsh-TUI`)安装不受支持,报以下错误码:
338
+
339
+ - `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`
340
+ - `ERR_PNPM_WORKSPACE_PKG_NOT_FOUND`
341
+
342
+ 三重阻断:
343
+
344
+ - 源 manifest 的 `@dsh-std/*` 是 workspace 依赖(git tarball 原样保留,
345
+ profile 内无法解析)。
346
+ - `vendor/dsh-std` 是 git 子模块(依赖抓取不带子模块内容,编译必败)。
347
+ - pnpm ≥11 默认拒绝 git 依赖执行 `prepare` 构建脚本。
348
+
349
+ 请安装 registry 包:
350
+
351
+ ```sh
352
+ dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui
353
+ ```
354
+
355
+ ### `dsh-tui requires an interactive terminal`
356
+
357
+ stdout 不是 TTY。请直接在终端中启动,不要把主进程输出管道到文件或其他命令。
358
+
359
+ 如果 dsh-tui 只是装在某个 profile 里、而实际由 Web / Tauri / GUI 等非终端
360
+ 宿主启动 DSH,dsh-tui 会检测到 stdout 不是 TTY 且并非由 `dsh-tui` launcher
361
+ 启动,自动跳过 TUI 前端(不报错、不影响宿主启动)。
362
+
363
+ 只有显式执行 `dsh-tui`(含 standalone 便携版)却没有 TTY 时,才会报上面的
364
+ 错误。
365
+
366
+ ### 找不到 `dsh` 或 `pnpm`
367
+
368
+ 确认全局 npm bin 目录在 `PATH` 中,并重新打开终端。`install.sh` 会在安装前
369
+ 检查这两个命令。
370
+
371
+ ### 启动后立刻退回 shell,几乎没有报错(pnpm 9)
372
+
373
+ pnpm 9 安装的 profile 里,传递依赖 `dsh-working-activity` 不会被提升到
374
+ loader 可解析的位置,模块解析失败导致整棵插件树被回收,TUI 打印 resume
375
+ 提示后直接退出(issue #60)。升级 pnpm 到 10+ 后重装即可:
376
+
377
+ ```sh
378
+ npm install -g pnpm@latest
379
+ dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest
380
+ ```
381
+
382
+ ### 模型启动失败或提示没有凭证
383
+
384
+ 若使用 `deepseek-official`,确认启动 `dsh` 的同一个 Shell 中存在 `DEEPSEEK_API_KEY`;
385
+ 自定义端点同时检查 `DEEPSEEK_BASE_URL`。若使用 `deepseek-account` 或订阅模型,
386
+ 用 `/auth status` 检查登录状态,必要时重新运行 `/auth login <provider>`。
387
+
388
+ ### 工作状态行重复
389
+
390
+ 检查 profile 是否曾单独添加 `dsh-working-activity`。保留本包 patch 自动插入的
391
+ `working-activity` 行,移除重复 bundle 配置。
392
+
393
+ ### TUI 显示错位或终端退出后状态异常
394
+
395
+ 先运行 `/doctor`,记录终端类型和模式,再参考[交互文档](interaction.md)与
396
+ [架构文档](architecture.md)。渲染问题可使用 `DSH_TUI_RENDER_LOG` 采集原始帧,
397
+ 但日志可能包含会话可见内容,应妥善处理。