dsh-claude-project-ui 0.0.0-stage → 0.2.1
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.
- package/CHANGELOG.md +62 -0
- package/LICENSE +21 -0
- package/README.md +518 -2
- package/cordis.patch.yml +6 -0
- package/package.json +60 -4
- package/src/board.js +227 -0
- package/src/client.js +248 -0
- package/src/command.js +236 -0
- package/src/config.js +41 -0
- package/src/digest.js +120 -0
- package/src/index.js +344 -0
- package/src/kb.js +163 -0
- package/src/project.js +197 -0
- package/src/prompts.js +33 -0
- package/src/store.js +48 -0
- package/src/tools.js +266 -0
- package/src/util.js +42 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1 — 2026-11-18
|
|
4
|
+
|
|
5
|
+
代码行为与 0.2.0 一致(`src/` 未改);这一版只为把仓库里的文档同步到 npm 页面,并给发布加一道门禁。
|
|
6
|
+
|
|
7
|
+
- 文档:README 补「快速开始(3 步)」「配置项表(字段 / 默认值 / 影响)」「License」三节,中英各一份;
|
|
8
|
+
修两处 heading 前缺空行、英文看板段多出来的一行 `right:`。
|
|
9
|
+
- `package.json` 加 `prepublishOnly` 门禁:`node test/harness.mjs && node test/spec-check.mjs`,
|
|
10
|
+
以后 `npm publish` 前必过测试与 schema 校验。
|
|
11
|
+
- `INSTALL-LOCAL.md` removed from the public repo: the local install notes (machine-specific absolute paths and backup-directory names) now live in a private folder outside this repository. The file was never shipped in the npm package.
|
|
12
|
+
- GitHub 仓库主页 homepage 指向 npm 包页:<https://www.npmjs.com/package/dsh-claude-project-ui>
|
|
13
|
+
|
|
14
|
+
## 0.2.0 — 2026-11-17(npm 首发)
|
|
15
|
+
|
|
16
|
+
- 改名:`dsh-project-hub` → `dsh-claude-project-ui`(仓库、npm 包名、插件 id 一并改;仓库改名后旧地址仍重定向)。
|
|
17
|
+
- 新增**看板面板**(浏览器半):侧栏页脚多一个「▤ 看板」按钮,点开是右侧浮层面板,
|
|
18
|
+
按项目列出进行中的讨论串和全部任务,支持手动刷新。数据来自宿主半新注册的
|
|
19
|
+
`POST /project-hub/board`(只读 JSON)。
|
|
20
|
+
- 客户端半按 DSH 的 `window.__ModuleLoader__` 约定手写,不依赖构建步骤;
|
|
21
|
+
`package.json` 增加 `exports["./client"]` 与 `dsh.client`。
|
|
22
|
+
- 面板在没有 `webServer` 的 profile(tui / headless)里自动退化:宿主不注册路由,
|
|
23
|
+
客户端不加载,`/hub board` 与 `board_list` 照常可用。
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 0.1.3
|
|
27
|
+
|
|
28
|
+
- 修复:进展摘要读的是 `report.files`,而 dsh-threads 实际写 `lastReport.changedFiles`——
|
|
29
|
+
「文件: …」一段以前永远不会出现。现在会显示。
|
|
30
|
+
- 看板新增隐藏规则:默认不显示**已解决 / 已归档**的讨论串(`hideResolvedThreads`,默认 `true`);
|
|
31
|
+
`board_list all=true` 或 `/hub board --all` 可看全部,底部会提示隐藏了几个。
|
|
32
|
+
- 看板新增**自动汇总**:讨论串回报会幂等地汇总成看板任务(`autoConvergeReports`,默认 `true`),
|
|
33
|
+
以 `threadId` 为键,重复刷新不会重复建任务,手工任务不受影响。
|
|
34
|
+
- 新增命令:`/hub task <标题>`、`/hub done <b-N>`、`/hub rm <b-N>`、`/hub doctor`(自检数据目录、
|
|
35
|
+
讨论串存储、知识库容量和每轮注入字符数)。
|
|
36
|
+
- 并发安全:同一项目的看板写入串行化(`load → modify → write` 不再互相覆盖)。
|
|
37
|
+
- 测试:测试框架的 `check()` 之前不 await,异步断言其实是假 PASS;改成串行 await 后修好受影响的用例。
|
|
38
|
+
用例从 12 项增加到 19 项,覆盖 changedFiles、隐藏规则、汇总幂等、删除任务和 `/hub doctor`。
|
|
39
|
+
- 文档:修正安装说明——`dsh plugin --profile desktop add` 会被无条件拒绝,桌面端只能走 App 内插件市场
|
|
40
|
+
或手工装进 `node_modules` + 补 `dsh.profile.bundles`。
|
|
41
|
+
## 0.1.2
|
|
42
|
+
|
|
43
|
+
- 注入瘦身:知识库索引从「全量文档」改为「最多 `kbIndexMaxDocs`(默认 3)条 + 一条溢出提示」,字符上限 900 → 280;
|
|
44
|
+
标题从「项目知识库」改为「项目短约定」,长文档明确交给 `dsh-knowledge` 的 `knowledge_search`。
|
|
45
|
+
多文档场景下每轮约省 600 字符的重复提示词。
|
|
46
|
+
- 新增测试:8 篇文档时索引 ≤ 300 字符、≤ 6 行,并出现「另有 N 条」。
|
|
47
|
+
|
|
48
|
+
## 0.1.1
|
|
49
|
+
|
|
50
|
+
- 防御性改进:`agent/created` 时**同步**预热提示词缓存,不再依赖随后的异步刷新。
|
|
51
|
+
早先的判断「讨论串首步缺看板」已被日志证伪——知识库走 `systemPrompt.section`(写入持久化的 system message),
|
|
52
|
+
看板/进展走 `systemPrompt.context`(随 user turn 注入,记录在 `user/message` 里),
|
|
53
|
+
按 system message 判断会误以为丢了。预热仍然有价值:即便刷新慢一拍,首步也有内容。
|
|
54
|
+
- 新增测试:`agent/created` 之后无需等待即可读到看板与进展文本。
|
|
55
|
+
|
|
56
|
+
## 0.1.0
|
|
57
|
+
|
|
58
|
+
- 项目知识库:`kb_add` / `kb_list` / `kb_search` / `kb_get` / `kb_remove`,索引自动注入项目会话。
|
|
59
|
+
- 跨讨论串看板:自动读取 dsh-threads 的讨论串状态,叠加 `board_add` / `board_update` / `board_list` 手动任务。
|
|
60
|
+
- 上下文接续:`context_brief` 生成可粘贴的项目简报;讨论串自动收到看板与最近进展。
|
|
61
|
+
- `/hub` 命令(status / board / kb / brief / note / add)。
|
|
62
|
+
- 只读 dsh-threads 存储,不修改、不 import 它的模块;卸载任一方互不影响。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lanechen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,519 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-claude-project-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**简体中文** · [English](#english)
|
|
4
|
+
|
|
5
|
+
把 **Claude Code 的 Projects + Threads 体验**搬进 DeepSeek Harness —— 在
|
|
6
|
+
[@kyf-eng/dsh-threads](https://github.com/Kyf-eng/dsh-threads) 之上,补出 Claude 用户熟悉的那套
|
|
7
|
+
项目界面、交互方式和上下文逻辑。
|
|
8
|
+
|
|
9
|
+
> 一句话:dsh-threads 给出「项目 + 讨论串」的骨架;本插件补上 Claude 用户习惯的四件事——
|
|
10
|
+
> **每个讨论串都懂的项目说明**、**一眼看完的看板面板**、**开新讨论串时的自动简报**、
|
|
11
|
+
> **跨会话的上下文接续**。
|
|
12
|
+
|
|
13
|
+
## 强化了 lead 与 thread 的分工
|
|
14
|
+
|
|
15
|
+
不只是补功能,还把这套分工调到位——**主对话当 lead,讨论串当手**:
|
|
16
|
+
|
|
17
|
+
- **主对话会主动开 thread**:默认不再先弹确认卡(`offerApproval: "open"`),判断该派活就直接派,
|
|
18
|
+
开完立刻回来陪你,不等、不轮询
|
|
19
|
+
- **回报自动汇总**:讨论串每轮回报自动变成看板任务(按 `threadId` 幂等去重),不用手工记账
|
|
20
|
+
- **上下文自动交互**:项目说明、看板快照、其它讨论串的进展,每个新 thread 第一步就带上
|
|
21
|
+
- **并发上限 6 个讨论串**(dsh-threads 默认 3 个,满了会回「或者这件事在主对话里做」)
|
|
22
|
+
- 目标是把 **Claude Code(Opus 5.5 一代)**那套项目体验尽量搬过来:项目 → 讨论串 → 汇报 → 继续派活
|
|
23
|
+
|
|
24
|
+
### 让这套分工生效的两行配置
|
|
25
|
+
|
|
26
|
+
本插件不改 dsh-threads 的提示词;分工效果来自 dsh-threads 自己的 dispatcher prompt + 下面两个开关:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
- id: dsh-threads
|
|
30
|
+
name: '@kyf-eng/dsh-threads'
|
|
31
|
+
config:
|
|
32
|
+
offerApproval: "open" # 用户点名任务但没明说开 thread 时,直接开、不弹确认卡
|
|
33
|
+
maxRunning: 6 # 同时最多 6 个讨论串(默认 3)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
改完完全退出 DSH 再启动。
|
|
37
|
+
|
|
38
|
+
## 和 dsh-threads 的关系:补强,不是替代
|
|
39
|
+
|
|
40
|
+
| 能力 | `@kyf-eng/dsh-threads` | 本插件 `dsh-claude-project-ui` |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| 项目 / 讨论串的创建与生命周期 | ✅ 拥有 | 只读识别,绝不写它的数据 |
|
|
43
|
+
| 主对话当 lead、主动开 thread | ✅ 提示词 + `thread_open` | — |
|
|
44
|
+
| 项目级说明(每个 thread 都看到) | ❌ 只有主对话自己的 instructions | ✅ 短约定注入主对话和所有讨论串 |
|
|
45
|
+
| 跨 thread 的看板 | ❌ | ✅ 侧栏面板 + `/hub board` 命令 + `board_list` 工具 |
|
|
46
|
+
| 开 thread 时的上下文简报 | 手写 `task` 文本 | ✅ `context_brief` 一键拼好 |
|
|
47
|
+
| 讨论串回报汇聚成任务 | ❌ | ✅ 幂等自动汇总(按 `threadId` 去重) |
|
|
48
|
+
| 讨论串建好时的启动上下文 | — | ✅ 自动注入项目说明 + 看板 + 他人进展 |
|
|
49
|
+
|
|
50
|
+
两个插件通过**只读存储文件**解耦:本插件不 import dsh-threads 的模块,也不写它的存储。
|
|
51
|
+
任何一个卸载,另一个照常工作;dsh-threads 换存储格式时本插件静默降级为「不注入」,不会报错。
|
|
52
|
+
|
|
53
|
+
## 功能
|
|
54
|
+
|
|
55
|
+
### 知识库
|
|
56
|
+
|
|
57
|
+
| 工具 | 作用 |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `kb_add` | 加一篇文档(同标题=替换);正文可内联,也可给 `path` 读文件 |
|
|
60
|
+
| `kb_list` | 列出 id、标题、字数、标签 |
|
|
61
|
+
| `kb_search` | 中英混合检索(CJK 二元组 + 英文词),返回片段和文档 id |
|
|
62
|
+
| `kb_get` | 按 id 读全文,可分页(`offset`/`limit`) |
|
|
63
|
+
| `kb_remove` | 删除一篇 |
|
|
64
|
+
|
|
65
|
+
上限:每项目 200 篇 / 400 万字 / 单篇 40 万字(可在配置里调)。
|
|
66
|
+
|
|
67
|
+
### 看板
|
|
68
|
+
|
|
69
|
+
讨论串状态由 dsh-threads 持有,本插件只读:`#3 补文档 — 待决策 · dsh-threads/3-ab12cd`。
|
|
70
|
+
手动任务独立存放(`b-<n>`),可改状态 pending / doing / blocked / done。
|
|
71
|
+
|
|
72
|
+
| 工具 | 作用 |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `board_add` / `board_update` | 增/改手动任务(讨论串也可以用来报自己的进度) |
|
|
75
|
+
| `board_list` | 合并视图:讨论串实时状态 + 手动任务 |
|
|
76
|
+
| `hub_note` | 记一条项目级上下文(决策、约束),所有会话可见 |
|
|
77
|
+
|
|
78
|
+
### 上下文
|
|
79
|
+
|
|
80
|
+
| 入口 | 作用 |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `context_brief` 工具 / `/hub brief` | 生成项目简报,粘进 `thread_open.task` |
|
|
83
|
+
| 自动注入 | 每个项目会话(主对话 + 讨论串)都会收到:知识库索引、看板快照、最近进展(含其它讨论串的回报) |
|
|
84
|
+
|
|
85
|
+
### 命令
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
/hub status 我在哪个项目、多少知识/任务
|
|
89
|
+
/hub board [--all] 看板(默认隐藏已解决/已归档的讨论串)
|
|
90
|
+
/hub task <标题> 加一条手动任务
|
|
91
|
+
/hub done <b-N> 把任务标记为完成
|
|
92
|
+
/hub rm <b-N> 删除任务
|
|
93
|
+
/hub doctor 自检:数据目录、讨论串存储、注入预算
|
|
94
|
+
/hub kb [关键词] 知识库列表或检索
|
|
95
|
+
/hub brief 项目简报
|
|
96
|
+
/hub note <文本> 记一条项目级上下文
|
|
97
|
+
/hub add <标题> | <正文> 加一篇知识库文档(正文可省略)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
一次粘多行也可以:每条以 `/hub` 开头(或只是首行带 `/hub`),逐行执行、逐条汇报。
|
|
101
|
+
行尾的 `→ 说明` 会被当作注释丢掉。
|
|
102
|
+
|
|
103
|
+
## 看板面板(侧栏)
|
|
104
|
+
|
|
105
|
+
浏览器半会往**右侧栏**加一个「项目看板」页签,和 dsh-threads 的「讨论串」并列(会话头部还有一个「▤ 项目看板」按钮可以一键打开):
|
|
106
|
+
|
|
107
|
+
- 按项目分组,列出**进行中的讨论串**(编号、标题、状态、worktree 分支)
|
|
108
|
+
- 列出**任务**(编号、标题、状态、负责人),含自动汇总的讨论串任务
|
|
109
|
+
- 默认隐藏已解决/已归档的讨论串,只提示「另有 N 个」
|
|
110
|
+
- 「刷新」按钮重新拉取;数据来自宿主半的 `POST /project-hub/board`,**只读**
|
|
111
|
+
|
|
112
|
+
面板只在 Web GUI(`desktop` / `web` profile)出现;`tui` / headless 没有侧栏,
|
|
113
|
+
退化成 `/hub board` 命令和 `board_list` 工具。
|
|
114
|
+
|
|
115
|
+
## 安装
|
|
116
|
+
|
|
117
|
+
需要 DeepSeek Harness 0.2.1-rc.2 到 0.3.0。
|
|
118
|
+
|
|
119
|
+
### 桌面 App(`desktop` profile)
|
|
120
|
+
|
|
121
|
+
**不要**用 `dsh plugin --profile desktop ...`:`desktop` profile 由 Electron 独占,命令行会被
|
|
122
|
+
无条件拒绝(`profile "desktop" is managed exclusively by the Electron application`),
|
|
123
|
+
和 App 有没有在运行无关。
|
|
124
|
+
|
|
125
|
+
两条可用路径:
|
|
126
|
+
|
|
127
|
+
1. **设置 → 插件 → 市场**,搜索 `dsh-claude-project-ui` 安装,然后重启。
|
|
128
|
+
2. **手工安装**(离线或私发 tarball 时):
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
# 解到 profile 的 node_modules
|
|
132
|
+
mkdir -p ~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui
|
|
133
|
+
tar xzf dsh-claude-project-ui-0.2.0.tgz -C /tmp/pkg
|
|
134
|
+
cp -R /tmp/pkg/package/. ~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
然后编辑 `~/.dsh/profiles/desktop/package.json`:`dependencies` 里加
|
|
138
|
+
`"dsh-claude-project-ui": "^0.2.0"`,`dsh.profile.bundles` 数组里追加 `"dsh-claude-project-ui"`,
|
|
139
|
+
最后完全退出 DSH(⌘Q)再启动。
|
|
140
|
+
|
|
141
|
+
> 只加依赖、不加 `dsh.profile.bundles` 不会加载——DSH 只从 bundles 层挂载插件。
|
|
142
|
+
|
|
143
|
+
### 其他 profile(`web` / `tui` / 自建)
|
|
144
|
+
|
|
145
|
+
这些 profile 由 CLI 启动,可以正常用插件管理器:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
dsh plugin --profile web add dsh-claude-project-ui
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 卸载
|
|
152
|
+
|
|
153
|
+
桌面 App:从 `dependencies` 和 `dsh.profile.bundles` 里删掉,再删
|
|
154
|
+
`~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui`,重启。
|
|
155
|
+
其他 profile:`dsh plugin --profile web remove dsh-claude-project-ui`。
|
|
156
|
+
|
|
157
|
+
数据留在 `~/.dsh/project-hub/`,卸载不会删;要彻底清掉就删这个目录。
|
|
158
|
+
|
|
159
|
+
## 快速开始(3 步)
|
|
160
|
+
|
|
161
|
+
装好并**完全退出 DSH 再启动**之后:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
/hub status 我在哪个项目、多少知识 / 任务
|
|
165
|
+
/hub note 发布前必须跑 node test/harness.mjs
|
|
166
|
+
/hub add 发布清单 | 1) 跑测试 2) npm pack 3) gh release
|
|
167
|
+
/hub brief 粘进 thread_open.task 的项目简报
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
右侧栏「▤ 项目看板」页签里应该能看到刚加的任务和讨论串状态;`tui` / headless 没有侧栏,用 `/hub board`。
|
|
171
|
+
开新讨论串时它第一步就会带上项目说明、看板快照和最近进展,不用你复制粘贴。
|
|
172
|
+
|
|
173
|
+
## 配置
|
|
174
|
+
|
|
175
|
+
在 profile 的 `cordis.patch.yml` 里覆盖:
|
|
176
|
+
|
|
177
|
+
```yaml
|
|
178
|
+
- id: dsh-claude-project-ui
|
|
179
|
+
name: "dsh-claude-project-ui"
|
|
180
|
+
config:
|
|
181
|
+
dataDir: "" # 默认 ~/.dsh/project-hub
|
|
182
|
+
threadsStorage: "" # 默认 ~/.dsh/storages/dsh_threads.json
|
|
183
|
+
knowledgeIndexMaxChars: 280
|
|
184
|
+
kbIndexMaxDocs: 3
|
|
185
|
+
boardContextMaxChars: 700
|
|
186
|
+
digestContextMaxChars: 700
|
|
187
|
+
briefMaxChars: 4000
|
|
188
|
+
maxNotes: 200
|
|
189
|
+
maxDocs: 200
|
|
190
|
+
maxKnowledgeChars: 4000000
|
|
191
|
+
hideResolvedThreads: true # 看板与注入里隐藏已解决/已归档的讨论串
|
|
192
|
+
autoConvergeReports: true # 把讨论串回报自动汇总成看板任务(幂等)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
| 字段 | 默认值 | 影响 |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| `dataDir` | `~/.dsh/project-hub` | 知识库 / 任务 / 笔记的根目录;换掉就是另一套项目数据 |
|
|
198
|
+
| `threadsStorage` | `~/.dsh/storages/dsh_threads.json` | 只读;用来识别「哪些会话属于哪个项目」,格式变了会静默降级为不注入 |
|
|
199
|
+
| `knowledgeIndexMaxChars` | `280` | 注入的知识库索引字符上限;调大占提示词预算,调小了只列更少文档 |
|
|
200
|
+
| `kbIndexMaxDocs` | `3` | 索引里最多列几篇文档,其余提示用 `kb_search` 检索 |
|
|
201
|
+
| `boardContextMaxChars` | `700` | 注入的看板快照字符上限 |
|
|
202
|
+
| `digestContextMaxChars` | `700` | 注入的「最近进展」字符上限 |
|
|
203
|
+
| `briefMaxChars` | `4000` | `context_brief` / `/hub brief` 的单次输出上限 |
|
|
204
|
+
| `maxNotes` | `200` | 每个项目保留多少条 `hub_note` 进展笔记 |
|
|
205
|
+
| `maxDocs` | `200` | 每个项目允许的知识库文档数 |
|
|
206
|
+
| `maxKnowledgeChars` | `4000000` | 每个项目知识库总字符数上限 |
|
|
207
|
+
| `hideResolvedThreads` | `true` | 看板与注入里隐藏已解决 / 已归档讨论串;`board_list all=true` 可看全部 |
|
|
208
|
+
| `autoConvergeReports` | `true` | 讨论串回报自动汇总成看板任务(按 `threadId` 幂等) |
|
|
209
|
+
|
|
210
|
+
## 数据
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
~/.dsh/project-hub/projects/<projectId>/
|
|
214
|
+
knowledge.json 知识库文档
|
|
215
|
+
board.json 手动任务
|
|
216
|
+
notes.json 项目上下文笔记
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
全部是普通 JSON,原子写入(临时文件 + rename),可以手工备份或编辑。
|
|
220
|
+
|
|
221
|
+
## 已知限制
|
|
222
|
+
|
|
223
|
+
- 只读识别 dsh-threads 的存储文件;它的存储格式若改变,项目识别会失效(插件会静默降级为「不注入」而不是报错)。
|
|
224
|
+
- 知识库是**词法检索**(CJK 二元组 + 英文词 + 词频归一化),没有向量检索,也没有 LLM 摘要;文档要自己写清楚标题和关键词。
|
|
225
|
+
- 摘要不是模型生成的:自动部分来自 dsh-threads 的 `lastReport`,手动部分来自 `hub_note`。主对话自己没回报过的东西不会出现。
|
|
226
|
+
- 注入内容按字符截断(每段默认 700-900 字),不是按 token 精确计量。
|
|
227
|
+
- 面板是只读的:建/改/删任务目前只能用 `board_add` / `board_update` / `/hub task|done|rm`。
|
|
228
|
+
- 轮询刷新:每 10 秒 + agent 状态变化时刷新提示词快照,最坏情况看到的是 10 秒前的看板。
|
|
229
|
+
- 看板默认隐藏已解决/已归档的讨论串;想全看用 `board_list all=true` 或 `/hub board --all`。
|
|
230
|
+
|
|
231
|
+
## 验收记录(2026-11-18,本机 desktop profile)
|
|
232
|
+
|
|
233
|
+
| 层 | 结论 | 证据 |
|
|
234
|
+
|---|---|---|
|
|
235
|
+
| 命令 | 通过 | 会话日志 `command/run` + `command/done`;多行 5 条、`add \| 正文` 均生效;`knowledge.json` 落盘 |
|
|
236
|
+
| 工具 | 通过 | 项目主对话里模型经 PTC 调用 `tools.kb_search({query:"release"})`,返回 `[k-1] 发布清单 score=0.343` |
|
|
237
|
+
| 注入 | 通过(知识库) | 真实 system prompt 中出现:`本项目共享知识库(主对话和每个讨论串都会收到这份索引)。\n## 项目知识库(1 篇…)` |
|
|
238
|
+
| 注入(看板/进展) | 通过 | 讨论串 #2 的请求体(`user/message` 记录,12.7KB)里逐字包含 `## 项目看板`、两行讨论串状态、`## 项目进展` 段;KB 则在 `system/message` 里(section vs context 两种注入通道) |
|
|
239
|
+
| schema 兼容 | 通过 | `node test/spec-check.mjs` 对照宿主 DSL 校验 10 个工具定义 |
|
|
240
|
+
| 逻辑 | 通过 | `node test/harness.mjs` 19 项(含 changedFiles、隐藏规则、汇总幂等、/hub doctor) |
|
|
241
|
+
|
|
242
|
+
## 与 Team 模式的关系
|
|
243
|
+
|
|
244
|
+
Team 模式的任务板属于**单个会话的 subagent 树**;本插件的看板属于**一个 dsh-threads 项目**(主对话 + 它的所有讨论串)。两者互补,不会互相写入。
|
|
245
|
+
|
|
246
|
+
## License
|
|
247
|
+
|
|
248
|
+
MIT(见 [LICENSE](LICENSE))。
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
<a id="english"></a>
|
|
253
|
+
|
|
254
|
+
# dsh-claude-project-ui (English)
|
|
255
|
+
|
|
256
|
+
Bring the **Claude Code Projects + Threads experience** to DeepSeek Harness. On top of
|
|
257
|
+
[@kyf-eng/dsh-threads](https://github.com/Kyf-eng/dsh-threads), this plugin adds the project UI,
|
|
258
|
+
the interaction model and the context logic Claude users expect.
|
|
259
|
+
|
|
260
|
+
> In one line: dsh-threads provides the "project + thread" skeleton; this plugin adds the four
|
|
261
|
+
> things Claude users are used to — **a project brief every thread can see**, **a board you can
|
|
262
|
+
> read at a glance**, **an automatic brief when a thread is opened**, and **context that carries
|
|
263
|
+
> over between sessions**.
|
|
264
|
+
|
|
265
|
+
## A sharper lead / thread split
|
|
266
|
+
|
|
267
|
+
This is not only extra features — it tightens the division of labour so the **main conversation leads and
|
|
268
|
+
threads do the hands-on work**:
|
|
269
|
+
|
|
270
|
+
- **The main conversation opens threads on its own**: with `offerApproval: "open"` it no longer asks for
|
|
271
|
+
confirmation first, delegates when it judges the work belongs in a thread, and returns to you immediately
|
|
272
|
+
without waiting or polling
|
|
273
|
+
- **Reports roll up automatically**: each thread report becomes a board task (idempotent, keyed by
|
|
274
|
+
`threadId`) — no manual bookkeeping
|
|
275
|
+
- **Context flows without you**: project brief, board snapshot and other threads' progress are attached to
|
|
276
|
+
every new thread from its first step
|
|
277
|
+
- **Up to 6 concurrent threads** (dsh-threads defaults to 3, and at the cap it answers "or do the work in the
|
|
278
|
+
main conversation")
|
|
279
|
+
- The goal is to bring the **Claude Code (the Opus 5.5 generation)** project experience over as closely as
|
|
280
|
+
possible: project → threads → reports → keep delegating
|
|
281
|
+
|
|
282
|
+
### The two settings that make it behave this way
|
|
283
|
+
|
|
284
|
+
This plugin does not touch dsh-threads' prompt; the behaviour comes from that plugin's own dispatcher prompt
|
|
285
|
+
plus these two switches:
|
|
286
|
+
|
|
287
|
+
```yaml
|
|
288
|
+
- id: dsh-threads
|
|
289
|
+
name: '@kyf-eng/dsh-threads'
|
|
290
|
+
config:
|
|
291
|
+
offerApproval: "open" # open the thread right away instead of asking first
|
|
292
|
+
maxRunning: 6 # up to 6 concurrent threads (default 3)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Quit DSH completely and start it again after editing.
|
|
296
|
+
## Relationship to dsh-threads: a complement, not a replacement
|
|
297
|
+
|
|
298
|
+
| Capability | `@kyf-eng/dsh-threads` | This plugin `dsh-claude-project-ui` |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| Project / thread creation and lifecycle | ✅ owned there | Read-only detection, never writes its data |
|
|
301
|
+
| Main conversation as lead, opening threads | ✅ prompt + `thread_open` | — |
|
|
302
|
+
| Project-level instructions every thread sees | ❌ main conversation only | ✅ short rules injected into the main conversation and every thread |
|
|
303
|
+
| Cross-thread board | ❌ | ✅ sidebar panel + `/hub board` + `board_list` tool |
|
|
304
|
+
| Brief when opening a thread | hand-written `task` text | ✅ `context_brief` assembles it |
|
|
305
|
+
| Thread reports rolled up as tasks | ❌ | ✅ idempotent rollup keyed by `threadId` |
|
|
306
|
+
| Startup context for a new thread | — | ✅ project brief + board + other threads' progress |
|
|
307
|
+
|
|
308
|
+
The two plugins are decoupled through a **read-only storage file**: this plugin never imports
|
|
309
|
+
dsh-threads modules and never writes its storage. Uninstalling either leaves the other working; if
|
|
310
|
+
dsh-threads changes its storage format, this plugin silently degrades to "no injection" instead of
|
|
311
|
+
throwing.
|
|
312
|
+
|
|
313
|
+
## Features
|
|
314
|
+
|
|
315
|
+
### Knowledge base
|
|
316
|
+
|
|
317
|
+
| Tool | Purpose |
|
|
318
|
+
|---|---|
|
|
319
|
+
| `kb_add` | Add a document (same title = replace); inline body, or a `path` to read from disk |
|
|
320
|
+
| `kb_list` | List id, title, size and tags |
|
|
321
|
+
| `kb_search` | Mixed Chinese/English retrieval (CJK bigrams + English words); returns snippets and document ids |
|
|
322
|
+
| `kb_get` | Read one document by id, paginated (`offset` / `limit`) |
|
|
323
|
+
| `kb_remove` | Delete a document |
|
|
324
|
+
|
|
325
|
+
Limits: 200 documents, 4M characters and 400k characters per document, per project (configurable).
|
|
326
|
+
|
|
327
|
+
### Board
|
|
328
|
+
|
|
329
|
+
Thread state is owned by dsh-threads and read-only here:
|
|
330
|
+
`#3 write docs — needs decision · dsh-threads/3-ab12cd`. Manual tasks live separately
|
|
331
|
+
(`b-<n>`) with statuses pending / doing / blocked / done.
|
|
332
|
+
|
|
333
|
+
| Tool | Purpose |
|
|
334
|
+
|---|---|
|
|
335
|
+
| `board_add` / `board_update` | Create or update a manual task (threads can use it to report their own progress) |
|
|
336
|
+
| `board_list` | Merged view: live thread state plus manual tasks |
|
|
337
|
+
| `hub_note` | Record one line of project context (a decision, a constraint) visible to every session |
|
|
338
|
+
|
|
339
|
+
### Context
|
|
340
|
+
|
|
341
|
+
| Entry point | Purpose |
|
|
342
|
+
|---|---|
|
|
343
|
+
| `context_brief` tool / `/hub brief` | Compose the project brief and paste it into `thread_open.task` |
|
|
344
|
+
| Automatic injection | Every project session (main conversation and each thread) receives: the knowledge index, a board snapshot and recent progress from other threads |
|
|
345
|
+
|
|
346
|
+
### Commands
|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
/hub status Which project am I in, how much knowledge / how many tasks
|
|
350
|
+
/hub board [--all] The board (resolved/archived threads hidden by default)
|
|
351
|
+
/hub task <title> Add a manual task
|
|
352
|
+
/hub done <b-N> Mark a task done
|
|
353
|
+
/hub rm <b-N> Delete a task
|
|
354
|
+
/hub doctor Self-check: data dir, thread storage, injection budget
|
|
355
|
+
/hub kb [query] List the knowledge base, or search it
|
|
356
|
+
/hub brief Project brief
|
|
357
|
+
/hub note <text> Record one line of project context
|
|
358
|
+
/hub add <title> | <body> Add a knowledge document (body optional)
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
You can paste several lines at once: each line starts with `/hub` (or only the first line does),
|
|
362
|
+
and they run in order with a per-line report. A trailing `→ note` is treated as a comment.
|
|
363
|
+
|
|
364
|
+
## Board panel (sidebar)
|
|
365
|
+
|
|
366
|
+
The browser half registers a "项目看板" tab in the **right-hand sidebar pane**, next to dsh-threads' "讨论串" tab (the session header also gets a "▤ 项目看板" button that opens it):
|
|
367
|
+
|
|
368
|
+
- Projects grouped, each listing **live threads** (number, title, state, worktree branch)
|
|
369
|
+
- **Tasks** (id, title, status, owner), including the automatically rolled-up thread tasks
|
|
370
|
+
- Resolved and archived threads are hidden by default, with a "N more" note
|
|
371
|
+
- A "Refresh" button; data comes from the host half's `POST /project-hub/board` and is **read-only**
|
|
372
|
+
|
|
373
|
+
The panel only exists in the Web GUI (`desktop` / `web` profiles). `tui` and headless have no
|
|
374
|
+
sidebar and fall back to the `/hub board` command and the `board_list` tool.
|
|
375
|
+
|
|
376
|
+
## Install
|
|
377
|
+
|
|
378
|
+
Requires DeepSeek Harness 0.2.1-rc.2 through 0.3.0.
|
|
379
|
+
|
|
380
|
+
### Desktop app (`desktop` profile)
|
|
381
|
+
|
|
382
|
+
**Do not** use `dsh plugin --profile desktop ...`: that profile is owned exclusively by the
|
|
383
|
+
Electron app, and the CLI refuses unconditionally
|
|
384
|
+
(`profile "desktop" is managed exclusively by the Electron application`) whether or not the app is
|
|
385
|
+
running.
|
|
386
|
+
|
|
387
|
+
Two working paths:
|
|
388
|
+
|
|
389
|
+
1. **Settings → Plugins → Marketplace**, search `dsh-claude-project-ui`, install, restart.
|
|
390
|
+
2. **Manual install** (offline, or when handing over a tarball):
|
|
391
|
+
|
|
392
|
+
```sh
|
|
393
|
+
mkdir -p ~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui
|
|
394
|
+
tar xzf dsh-claude-project-ui-0.2.0.tgz -C /tmp/pkg
|
|
395
|
+
cp -R /tmp/pkg/package/. ~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui/
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
Then edit `~/.dsh/profiles/desktop/package.json`: add
|
|
399
|
+
`"dsh-claude-project-ui": "^0.2.0"` to `dependencies` and append `"dsh-claude-project-ui"` to
|
|
400
|
+
`dsh.profile.bundles`, then quit DSH completely (⌘Q) and start it again.
|
|
401
|
+
|
|
402
|
+
> Adding the dependency without the `dsh.profile.bundles` entry does not load the plugin — DSH
|
|
403
|
+
> only mounts plugins from the bundles layer.
|
|
404
|
+
|
|
405
|
+
### Other profiles (`web` / `tui` / custom)
|
|
406
|
+
|
|
407
|
+
Those are started from the CLI, so the plugin manager works normally:
|
|
408
|
+
|
|
409
|
+
```sh
|
|
410
|
+
dsh plugin --profile web add dsh-claude-project-ui
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Uninstall
|
|
414
|
+
|
|
415
|
+
Desktop app: remove it from `dependencies` and `dsh.profile.bundles`, delete
|
|
416
|
+
`~/.dsh/profiles/desktop/node_modules/dsh-claude-project-ui`, restart.
|
|
417
|
+
Other profiles: `dsh plugin --profile web remove dsh-claude-project-ui`.
|
|
418
|
+
|
|
419
|
+
Data stays in `~/.dsh/project-hub/`; uninstalling does not delete it.
|
|
420
|
+
|
|
421
|
+
## Quick start (3 steps)
|
|
422
|
+
|
|
423
|
+
After installing and **quitting DSH completely and starting it again**:
|
|
424
|
+
|
|
425
|
+
```text
|
|
426
|
+
/hub status which project am I in, how much knowledge / how many tasks
|
|
427
|
+
/hub note release gate is node test/harness.mjs
|
|
428
|
+
/hub add release checklist | 1) run tests 2) npm pack 3) gh release
|
|
429
|
+
/hub brief a project brief to paste into thread_open.task
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
The "▤ 项目看板" tab in the right pane should now show the task and thread state you just added; `tui` / headless
|
|
433
|
+
have no sidebar, so use `/hub board` there. When you open a new thread it starts with the project brief, the board
|
|
434
|
+
snapshot and recent progress already attached.
|
|
435
|
+
|
|
436
|
+
## Configuration
|
|
437
|
+
|
|
438
|
+
Override in the profile's `cordis.patch.yml`:
|
|
439
|
+
|
|
440
|
+
```yaml
|
|
441
|
+
- id: dsh-claude-project-ui
|
|
442
|
+
name: "dsh-claude-project-ui"
|
|
443
|
+
config:
|
|
444
|
+
dataDir: "" # default ~/.dsh/project-hub
|
|
445
|
+
threadsStorage: "" # default ~/.dsh/storages/dsh_threads.json
|
|
446
|
+
knowledgeIndexMaxChars: 280
|
|
447
|
+
kbIndexMaxDocs: 3
|
|
448
|
+
boardContextMaxChars: 700
|
|
449
|
+
digestContextMaxChars: 700
|
|
450
|
+
briefMaxChars: 4000
|
|
451
|
+
maxNotes: 200
|
|
452
|
+
maxDocs: 200
|
|
453
|
+
maxKnowledgeChars: 4000000
|
|
454
|
+
hideResolvedThreads: true # hide resolved/archived threads in the board and injection
|
|
455
|
+
autoConvergeReports: true # roll thread reports up into board tasks (idempotent)
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
| Field | Default | Effect |
|
|
459
|
+
|---|---|---|
|
|
460
|
+
| `dataDir` | `~/.dsh/project-hub` | Root for knowledge, tasks and notes; pointing it elsewhere gives you a separate set of projects |
|
|
461
|
+
| `threadsStorage` | `~/.dsh/storages/dsh_threads.json` | Read-only; used to tell which sessions belong to a project. A format change degrades to "no injection" |
|
|
462
|
+
| `knowledgeIndexMaxChars` | `280` | Character cap for the injected knowledge index |
|
|
463
|
+
| `kbIndexMaxDocs` | `3` | How many documents the index lists before pointing at `kb_search` |
|
|
464
|
+
| `boardContextMaxChars` | `700` | Character cap for the injected board snapshot |
|
|
465
|
+
| `digestContextMaxChars` | `700` | Character cap for the injected recent-progress digest |
|
|
466
|
+
| `briefMaxChars` | `4000` | Cap for one `context_brief` / `/hub brief` result |
|
|
467
|
+
| `maxNotes` | `200` | Progress notes kept per project |
|
|
468
|
+
| `maxDocs` | `200` | Knowledge documents allowed per project |
|
|
469
|
+
| `maxKnowledgeChars` | `4000000` | Total knowledge characters allowed per project |
|
|
470
|
+
| `hideResolvedThreads` | `true` | Hide resolved / archived threads from the board and injection; `board_list all=true` shows everything |
|
|
471
|
+
| `autoConvergeReports` | `true` | Mirror thread reports onto the board as tasks (idempotent by `threadId`) |
|
|
472
|
+
|
|
473
|
+
## Data
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
~/.dsh/project-hub/projects/<projectId>/
|
|
477
|
+
knowledge.json knowledge documents
|
|
478
|
+
board.json manual tasks
|
|
479
|
+
notes.json project context notes
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
Plain JSON, written atomically (temp file + rename); safe to back up or edit by hand.
|
|
483
|
+
|
|
484
|
+
## Known limitations
|
|
485
|
+
|
|
486
|
+
- Project detection reads dsh-threads' storage file. If that format changes, detection breaks and
|
|
487
|
+
the plugin silently degrades to "no injection" rather than erroring.
|
|
488
|
+
- Retrieval is **lexical** (CJK bigrams + English words + term-frequency normalisation): no vector
|
|
489
|
+
search and no LLM summarisation, so write clear titles and keywords.
|
|
490
|
+
- Summaries are not model-generated: the automatic part comes from dsh-threads' `lastReport`, the
|
|
491
|
+
manual part from `hub_note`. Nothing the main conversation never reported will show up.
|
|
492
|
+
- Injection is truncated by characters (700–900 per section by default), not by tokens.
|
|
493
|
+
- The panel is read-only: creating, changing or deleting tasks today means `board_add` /
|
|
494
|
+
`board_update` / `/hub task|done|rm`.
|
|
495
|
+
- Refreshes are polled: every 10 seconds plus on agent status changes, so a snapshot can be up to
|
|
496
|
+
10 seconds stale.
|
|
497
|
+
- The board hides resolved/archived threads by default; use `board_list all=true` or
|
|
498
|
+
`/hub board --all` to see everything.
|
|
499
|
+
|
|
500
|
+
## Verification record (2026-11-18, local desktop profile)
|
|
501
|
+
|
|
502
|
+
| Layer | Result | Evidence |
|
|
503
|
+
|---|---|---|
|
|
504
|
+
| Commands | Pass | Session log `command/run` + `command/done`; a 5-line paste and `add \| body` both worked; `knowledge.json` written |
|
|
505
|
+
| Tools | Pass | In the project's main conversation the model called `tools.kb_search({query:"release"})` through PTC; returned `[k-1] release checklist score=0.343` |
|
|
506
|
+
| Injection (knowledge) | Pass | Real system prompt contained the shared-knowledge section |
|
|
507
|
+
| Injection (board/progress) | Pass | Thread #2's request body (`user/message`, 12.7 KB) contained `## 项目看板`, two thread rows and `## 项目进展` verbatim; knowledge rode in `system/message` (section vs context channels) |
|
|
508
|
+
| Schema compatibility | Pass | `node test/spec-check.mjs` validates all 10 tool definitions against the host DSL |
|
|
509
|
+
| Logic | Pass | `node test/harness.mjs`, 19 checks (changedFiles, hiding rules, rollup idempotency, `/hub doctor`) |
|
|
510
|
+
|
|
511
|
+
## Relationship to Team mode
|
|
512
|
+
|
|
513
|
+
A Team-mode task board belongs to **one session's subagent tree**; this plugin's board belongs to
|
|
514
|
+
**one dsh-threads project** (main conversation plus all of its threads). They complement each other
|
|
515
|
+
and never write to the same place.
|
|
516
|
+
|
|
517
|
+
## License
|
|
518
|
+
|
|
519
|
+
MIT — see [LICENSE](LICENSE).
|
package/cordis.patch.yml
ADDED