dsh-sansheng-liubu/README.md

71 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 三省六部
> 2026-11-10 收敛:只保留两个子包——`sansheng/`(治理插件)与 `ds-bot/`(团队底座)。
> 旧方案(「上朝」preset、右侧十席面板、独立工作台 v0.1)已删除,历史仍在 Git 里(`git log --all`)。
## 结构
| 目录 | 包名 | 作用 |
|---|---|---|
| `sansheng/` | `dsh-sansheng-sansheng` | 三角色(丞相 / 尚书 / 工部)绑定、目标门禁、审查与派发记录、右栏三卡 |
| `ds-bot/` | `ds-bot` | 长驻 Bot 团队、Bot 间消息与群聊(Fei2411/DS-Bot 的 vendored 副本,本地改动见 `ds-bot/PATCHES.md`) |
| `docs/` | — | [DSBot 开发方案](docs/DSBot-三省六部开发方案.md) 与 P0 / P1 / P2–P4 / P5 证据 |
## 能做什么
| 入口 | 说明 |
| --- | --- |
| `sansheng_provision` | 创建一个项目:丞相 / 尚书 / 工部三个 Bot + 项目群(尚书是管理员) |
| `sansheng_bind` | 把已有群绑成三省六部项目(校验三角色齐全、管理员是尚书) |
| `sansheng_status` | 项目、群、角色、模型、目标阶段、返工预算、待核实派发 |
| `sansheng_review` | 尚书记阶段通过/驳回,丞相记目标验收;`group_goal` 用它做门禁 |
| `sansheng_reconcile` | 重启后核对"结果未知"的派发(不重发、不假装成功) |
| 右栏「角色」页签 | 纵向三张卡片:丞相 / 尚书 / 工部,读 `/sansheng/state`,4 秒刷新 |
`group_goal` 仍是阶段进度的唯一权威;尚书是唯一操作者,丞相只验收,工部只执行。
根目录 `package.json` 只是工作区清单(`workspaces: sansheng, ds-bot`),本身不是 DSH 插件,也不进 `dsh.profile.bundles`。
## 装进 DSH
两个子包都以 `link:` 依赖挂进 `~/.dsh/profiles/desktop`,并写进 `dsh.profile.bundles`:
```json
"ds-bot": "link:C:/Users/qyh15/三省六部/ds-bot",
"dsh-sansheng-sansheng": "link:C:/Users/qyh15/三省六部/sansheng"
```
```json
"bundles": [ ..., "dsh-sansheng-sansheng", "ds-bot" ]
```
改完 profile 必须彻底重启 DSH 才生效。
## 验证
```sh
cd sansheng && npm test # 56 tests:门禁、指纹、存储、派发回执、返工、状态接口、客户端渲染、provision 流程
node --check sansheng/client.js && node --check sansheng/index.js
```
Node >= 22。
重启后自检:
1. `sansheng_status()` 能列出「示例项目」三角色与模型。
2. 对话右上「角色」→ 右栏三张卡片。
3. `curl http://127.0.0.1:<port>/sansheng/state` 返回项目 JSON。
## 历史
- 第一代(11-07 ~ 11-09):`dsh-sansheng-liubu-mode`(上朝 Agent Preset)+ `dsh-sansheng-liubu-panel`(右侧十席面板)。
- 第二代(11-10 上午):`dsh-sansheng-liubu-workbench`(自建数据层 / Host 服务 / HTTP / 前端的独立工作台 v0.1),同日 12:19 被 DS Bot 方案取代。
- 当前(11-10 起):`ds-bot` + `sansheng`。
删除的内容都能从 Git 取回,例如:
```sh
git log --all --oneline -- panel
git show <sha>:panel/lib/client.js
```