@suifei/dsh-ai-team 0.3.3 → 0.3.4

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.4 — 2026-11-09
4
+
5
+ - README 精装修:品牌、快速开始、能力地图、架构图、API、验证证据、文档索引;
6
+ - 发布到 npm / GitHub Releases,补充 repository / homepage / keywords / LICENSE;
7
+ - desktop profile 改为从 npm 安装。
8
+
3
9
  ## 0.3.3 — 2026-11-09
4
10
 
5
11
  - 产品显示名改为「文渊阁」(Wenyuan Pavilion),取藏修、校勘、纂辑之意;
package/README.md CHANGED
@@ -1,39 +1,227 @@
1
- # 文渊阁 · @suifei/dsh-ai-team
1
+ <p align="center">
2
+ <img src="./icon.svg" width="88" height="88" alt="文渊阁" />
3
+ </p>
2
4
 
3
- > 文渊阁:藏修、校勘、纂辑。AI Team mode for DeepSeek Harness:
5
+ <h1 align="center">文渊阁</h1>
4
6
 
5
- AI Team mode for DeepSeek Harness: **projects, owned tasks, threads, inbox and an append-only team ledger** — one Human sentence, a team of named persistent agents keeps going, and only direction / trust / irreversible steps come back.
7
+ <p align="center">
8
+ <strong>把工作交给一支 AI 团队:它们把事做到底,你定方向、把关键的关。</strong>
9
+ </p>
6
10
 
7
- > M1/M2 status: the package mounts a **three-pane workbench** (left projects + agents, center `主对话 / 看板 / 态势`, right thread). The app ledger, task/thread/inbox domain and `TeamService` are implemented and covered by `node --test` (82 tests); `bootstrap`, `POST .../commands`, `GET .../board`, `GET .../quadrants` and the event-driven `GET .../events` SSE are wired to a real default-project ledger. The profile patch enforces `danger-full-access`, and the Host refuses to boot a weaker profile; `member.activate` now creates a real continuable child through the Team Host Agent, binds the session, sets/verifies `danger-full-access`, and records it in the ledger. Real activation and `member.config.update` were verified on the ai-team profile; the Host subscribes to `agent/request-error` for classification/retry/fallback (auth/billing fail closed) and to `session/event` for recovery/reset; the member row shows effective model/context/version/last failure. A member-only `team` tool exposes tasks/inbox/claim/submit/thread/reply/review through `TeamService`; the Waker delivers wake messages and records `wake/delivered`/`wake/failed`. The direct `agents.create + followup` path now completes a real two-Agent loop: 沈舟 claimed Task #1, replied in the Thread and submitted; 林岚 independently accepted it (`reviewerId=a2`, `selfExecuted=false`), leaving the task `done`. A follow-up probe wrote one Human sentence into the Main stream; Lead a1 created Task #1 itself, claimed/executed/submitted it, and a2 independently accepted it. The workbench Composer is wired to the real `stream.post` / `task.create` commands, and the Agents “+” opens an Add Member form that creates, configures, activates and optionally promotes the member to Project owner. A headless-Edge E2E opened 文渊阁, added 沈舟 as owner through the form, sent one sentence, and saw Task #1 appear on the board and in Q1. A second form submission added 林岚3 as reviewer with an explicit accept instruction; the board then showed `Done 2` / `To accept 0`. Host now broadcasts SSE on every ledger append, including member `team` tool calls. M2.5 adds versioned member profiles (name/role/personality), Agent self-evolution via `team.evolve`, a talent pool with leave/rejoin, leftover-task takeover, and QA-first automatic reviewer wake; a real QA member accepted a submitted Task with no manual reviewer instruction. The profile/talent-pool UI was verified in a real browser: saving a new name/personality bumped `profileVersion`, then leaving the team with a successor moved the member to the talent pool and transferred the leftover Task (`taken-over`) to the successor. Acceptance also schedules a reflection wake; a real Agent then called `team.evolve` itself and wrote `member/distilled`, with the new personality visible on the member. Members can add durable notes/skills (`team.note`/`team.skill`); skill bodies are read from `<dataDir>/skills/<name>/SKILL.md` (bounded, traversal-safe) and injected into activation/wake prompts. Activation/wake also injects a bounded DSH `skills` catalog (name/description/when-to-use, max 12) so members can load a full skill through their own `skill` tool. Members now mount an agent preset in `agents.create` setup; a real member used `pwsh` and then `skill` to load `diagnose-windows-sandbox-acl` and wrote the result to a file. The profile drawer can choose `standard / ptc / minimal / cordis` (default `standard`). All four were exercised end-to-end: PTC used `run_code`, minimal and cordis used `pwsh`, standard used `pwsh` + `skill`. `team.recall` searches their own notes/skills/tasks/threads; a Lead can inspect a colleague (`team.member`) and call `team.distill`. Host now has a narrow single-step distillation path: `member.distill(mode:'model')` feeds the member's profile, notes, skills and recent tasks to `llm.stream` with no tools, requires JSON output, then records `member/distilled`. A real run produced a new personality from the old one plus a missed-gate note. Free-form Lead-driven distillation can still drift; the Host path is the product entry. Restart persistence was verified: the same member/session resumed from 63 persisted events (31 zstd frames), and a post-restart Task was claimed and submitted without re-onboarding. The archived-host gate was fixed by not marking members as `origin:'subagent'`. A real 401 also produces `member/llm-failed(auth)`, member `failed`, a Human `decision_required`, and leaves the task pending without retry. See `docs/reports/M2-真实闭环验收.md`. The workbench Thread now sends real `thread.post`, `task.accept` and `task.request_changes`; the task action row also drives `task.cancel`, `task.reopen`, `task.delete` and `task.reassign` (the “demo only” tag is gone). A headless-Edge run accepted a pending Task to `done` from the UI. A Human can DM one member from the profile drawer (`member.message`), which writes to the ledger and wakes only that member; a headless-Edge run sent a DM and verified the member session advanced. The first profile-drawer E2E also exposed and fixed a white-screen bug (`selectedTask` referenced across an early return / null `data`). The Inbox page lists real `data.inbox` decisions and acknowledges them through `inbox.ack`. Follow/unfollow is persisted through `task.follow`; accepting a followed Task creates one `followed_task_update` report for each still-following member. A headless-Edge failure-recovery run used a bad provider to produce a Human decision, acknowledged it, edited the member's provider/maxTokens in the profile drawer, and retried the member back to `running` (`member/recovered`). The latest regression re-ran one sentence → Lead opens a card → QA auto-accept → owner reflection/self-evolution with one wake per stage (20 ledger events, no duplicate human/reflection wakes). On Host startup, unfinished Tasks are woken once via a `team/startup` event (no timers). A real restart test resumed a pending Task: `wake/delivered reason=startup_resume`, then claim → Thread → submit to pending acceptance (15 ledger events; tail repair recorded). The profile drawer now edits provider/model/maxTokens, adds notes/skills, and retries failed members. Task creation can mark `qaRequired` and a `qaChecklist`; non-QA Agents are rejected on accept, the Waker only offers the task to QA, and QA must pass every checklist item before acceptance. M3 adds a test-only `ai-team-fault` LLM adapter for real billing/network failure injection, cross-project Inbox (including opening a task from another project), and a filesystem SkillProvider for installed skills. SSE buckets were verified with two real providers (DeepSeek and Zhipu) producing events in two Projects. Microsoft SkillOpt's seven tools, Python engine and `skillopt-sleep` skill are bundled inside this plugin, not installed into the user's DSH. Version 0.3.3 (文渊阁 / Wenyuan Pavilion; concurrent Projects + cross-project inbox + V-10 guard E2E + billing/network injection + bundled SkillOpt; health reports 0.3.3). Install/uninstall was exercised on a throwaway `ai-team-smoke` profile: health 200 after install, 404 after removal, config clean. — see `CHANGELOG.md`, `docs/05-项目启动与执行计划.md`, `docs/08-异常恢复与模型治理.md` and `docs/reports/M1-验收矩阵.md`.
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@suifei/dsh-ai-team"><img alt="npm" src="https://img.shields.io/npm/v/@suifei/dsh-ai-team?color=2f6feb&label=npm"></a>
13
+ <a href="https://github.com/suifei/dsh-ai-team/releases"><img alt="release" src="https://img.shields.io/github/v/release/suifei/dsh-ai-team?color=2f6feb"></a>
14
+ <a href="./LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-2f6feb"></a>
15
+ <img alt="tests" src="https://img.shields.io/badge/tests-82%20passing-2ea043">
16
+ <img alt="dsh" src="https://img.shields.io/badge/DeepSeek%20Harness-plugin-6f42c1">
17
+ </p>
8
18
 
9
- ## Install (dedicated profile)
19
+ > 文渊阁,藏修、校勘、纂辑之地。
20
+ > 在这里,Human 不在环里逐条调度,而是在环上定方向、守信任、做最后那一步。
10
21
 
11
- ```sh
12
- dsh --profile ai-team --from-default-profile web --dump-config # create the profile from the web template
13
- dsh plugin --profile ai-team add @suifei/dsh-ai-team # install from npm
14
- # or from a checkout:
15
- # dsh plugin --profile ai-team add E:/works/dsh-ai-team
16
- dsh --profile ai-team --no-open --port 0 # boot
22
+ `@suifei/dsh-ai-team` 是 DeepSeek Harness 的按需启用插件:装进专用 `ai-team` profile 后,DSH 里出现一个三栏工作台——左侧 Project 与成员,中间主对话 / 看板 / 态势,右侧 Thread。Agent 自己认领 Task、互相交接,由做的人以外的成员验收;Human 只处理方向、信任和不可撤回的决定。
23
+
24
+ ---
25
+
26
+ ## 为什么是「文渊阁」
27
+
28
+ - **成员是持久的。** 每个 Agent 有名字、角色、personality、notes、skills 和 session;DSH 重启、上下文压缩、换代之后,它还是它。
29
+ - **每个结果都有 owner。** Project 有具名 owner;Task 有唯一 accountable owner,由它推到验收。
30
+ - **做的人不验收。** Agent 只能验收已进入待验收、且自己从未认领过的 Task;QA Task 只有 QA 成员能验收。
31
+ - **房间是为 Agent 设计的。** 成员从自己的 inbox 拉取消息,而不是被每条消息推着走;对着已经变化的 Thread 写的回复会被退回,并附上变化摘要。
32
+ - **一切有记录。** Main stream、Thread、Task、收件箱都是同一本 append-only 账本的视图。
33
+ - **没有定时器。** Agent 只由 Team 事件(消息、@、交接、验收请求)唤醒;团队完全安静时不会自己醒来。
34
+
35
+ ---
36
+
37
+ ## 快速开始
38
+
39
+ ### 1. 建专用 profile
40
+
41
+ ```powershell
42
+ dsh --profile ai-team --from-default-profile web --dump-config
43
+ ```
44
+
45
+ ### 2. 从 npm 安装
46
+
47
+ ```powershell
48
+ dsh plugin --profile ai-team add @suifei/dsh-ai-team
17
49
  ```
18
50
 
19
- The plugin is designed for a dedicated `ai-team` profile; normal `desktop`/`web` sessions keep their preset roster unless explicitly installed. This machine also has it in `desktop` for UI preview. Multi-Project is concurrent: every Project owns its ledger and runtime, each has its own Waker/SSE/tool routing, and `activeProjectId` only selects the UI default. Full install / uninstall / upgrade steps, data locations and profile-isolation checks: [docs/10-安装卸载升级.md](docs/10-安装卸载升级.md).
51
+ 或从 checkout 安装:
52
+
53
+ ```powershell
54
+ dsh plugin --profile ai-team add E:/works/dsh-ai-team
55
+ ```
56
+
57
+ ### 3. 启动
58
+
59
+ ```powershell
60
+ dsh --profile ai-team --no-open --port 33271
61
+ ```
62
+
63
+ 打开终端输出的 URL,点侧栏 **文渊阁**。
64
+
65
+ > 插件只应安装在可信机器 / 可信 Workspace:成员以 `danger-full-access` 运行,且 profile patch 会把 sandbox / approval / permission 固定为 `danger-full-access / never`。普通 `desktop`/`web` profile 不安装时保持原有 preset roster。
66
+
67
+ ---
68
+
69
+ ## 界面
70
+
71
+ ```text
72
+ ┌ 文渊阁 ───────────────────────────────────────────────────────────┐
73
+ │ Projects │ Main stream / Board / Situation │ Thread │
74
+ │ # 我的项目 │ 主对话:一句话开工 │ 回复 │
75
+ │ # UI 项目 │ 看板:待处理 / 进行中 / 待验收 / 完成│ 验收 / 退回 │
76
+ │ │ 态势:需要你 / 团队在做 / 等待受阻 / 最近完成 │ 任务动作 │
77
+ │ Agents │ │ │
78
+ │ 沈舟 (Lead) │ │ │
79
+ │ 林岚 (QA) │ │ │
80
+ └─────────────────┴────────────────────────────────────┴─────────────┘
81
+ ```
82
+
83
+ - **主对话**:Human 的一句话进入 Main stream,Project owner 拆 Task;Composer 支持讨论 / 任务模式。
84
+ - **看板**:四列;进行中的卡片显示 accountable owner 与执行者;数量只统计 active Task。
85
+ - **态势**:四象限——需要你、团队在做、等待受阻、最近完成。点击条目打开对应 Task 的 Thread。
86
+ - **收件箱**:跨 Project 聚合;失败决策、需要你决定、关注 Task 的完成报告都在这里。
87
+ - **成员资料**:改名、职责、personality、provider/model、运行配方、notes、skills、re-distill、离队/人才库。
88
+
89
+ ---
90
+
91
+ ## 能力地图
92
+
93
+ | 能力 | 说明 |
94
+ |---|---|
95
+ | Project | 具名 owner;并发 runtime;每 Project 独立账本、Waker、SSE |
96
+ | Task | 唯一 accountable owner;pending / in_progress / pending_acceptance / done / cancelled |
97
+ | Thread | append-only;回复带 `baseSeq`,旧基线会被拒并说明变化 |
98
+ | 验收 | maker 不能验收;QA 硬门禁;`qaChecklist` 逐项通过 |
99
+ | 收件箱 | Human/Agent 各自拉取;跨 Project 聚合与项目内 ack |
100
+ | 关注 | 关注 Task;完成后收到 `followed_task_update` |
101
+ | 成员 | 持久 session;名字/角色/personality/notes/skills |
102
+ | 进化 | `team.evolve` 只改自己的 personality;验收后 reflection wake |
103
+ | 人才库 | leave/rejoin;遗留 Task 可被接管(taken-over) |
104
+ | 运行配方 | `standard` / `ptc` / `minimal` / `cordis` |
105
+ | 技能 | DSH `skill` 工具真实加载;SkillOpt 7 工具内置 |
106
+ | 重启恢复 | `team/startup` 恢复未完成 Task,无定时器 |
107
+ | 安全 | 每次成员工具调用前守卫 `danger-full-access` |
108
+
109
+ ---
110
+
111
+ ## 架构
112
+
113
+ ```mermaid
114
+ flowchart TB
115
+ H[Human] --> UI[文渊阁 Workbench]
116
+ UI --> HOST[Host /ai-team/api]
117
+ HOST --> R1[ProjectRuntime prj_main]
118
+ HOST --> R2[ProjectRuntime prj_ui]
119
+ R1 --> L1[(append-only ledger)]
120
+ R2 --> L2[(append-only ledger)]
121
+ R1 --> S1[TeamService]
122
+ R2 --> S2[TeamService]
123
+ S1 --> M1[Member sessions]
124
+ S2 --> M2[Member sessions]
125
+ L1 -. Waker / SSE .-> M1
126
+ L2 -. Waker / SSE .-> M2
127
+ ```
128
+
129
+ - **Host**:路由、命令、SSE、Waker、成员 runtime、权限守卫。
130
+ - **ProjectRuntime**:一个 Project 一个 ledger + TeamService;启动时全部打开。
131
+ - **Ledger**:JSONL + SHA-256 hash chain + checkpoint + 纯函数 fold。
132
+ - **MemberRuntime**:真实 DSH Agent session,直接 `agents.create` / `followup`,没有模拟执行。
133
+ - **Waker**:只从账本 append / HTTP 命令结果计划唤醒;没有 heartbeat/timer。
134
+
135
+ ### API 速览
136
+
137
+ ```text
138
+ GET /ai-team/api/health
139
+ GET /ai-team/api/bootstrap?project=<id>
140
+ GET /ai-team/api/projects/<id>/board
141
+ GET /ai-team/api/projects/<id>/quadrants
142
+ GET /ai-team/api/projects/<id>/events # SSE
143
+ POST /ai-team/api/projects/<id>/commands
144
+ ```
145
+
146
+ 命令覆盖 `task.create/claim/submit/accept/request_changes/cancel/reopen/delete/reassign`、`member.add/activate/config.update/profile.update/message/leave/rejoin/takeover`、`project.create/activate`、`inbox.ack` 等。
147
+
148
+ ---
149
+
150
+ ## 技能与 SkillOpt
151
+
152
+ - 成员资料可追加 notes / skills,activation / wake prompt 会注入有界技能目录;
153
+ - 完整技能正文由成员自己的 `skill` 工具加载;
154
+ - `ai-team-files` provider 会读取:
155
+ - `<DSH_HOME>/skills`
156
+ - `<cwd>/.dsh/skills`
157
+ - `<cwd>/.agents/skills`
158
+ - **Microsoft SkillOpt 已内置**:7 个 `skillopt_*` 工具、Python engine bootstrap、`skillopt-sleep` 技能随插件分发,不需要单独安装 `dsh-skillopt`。
159
+
160
+ ---
161
+
162
+ ## 验证
163
+
164
+ - `node --test`:**82 / 82**
165
+ - 文档 QA:`node .ptc/tools/docs_check.mjs` → **0 problems**
166
+ - 真实 E2E 覆盖:
167
+ - 两 Agent claim → Thread → 独立验收;
168
+ - 一句话 → Lead 开卡 → QA 自动验收 → owner 自进化;
169
+ - 强停重启 → `startup_resume` → 继续 Task;
170
+ - 真实浏览器私信成员;
171
+ - 四运行配方分别执行 `run_code` / `pwsh`;
172
+ - 并发 Project + 跨 Project 收件箱;
173
+ - DeepSeek + Zhipu 双订阅 SSE 分桶;
174
+ - V-10 turn 中途权限降级后工具前修复;
175
+ - billing 402 / ECONNRESET 三次重试与恢复;
176
+ - 从 npm 安装后在独立 profile 启动 health 200。
177
+
178
+ 证据目录(本机 `.ptc/rounds/`,不随 npm 发布):
179
+
180
+ ```text
181
+ round-02 两 Agent 独立验收
182
+ round-06 验收后 self-evolve
183
+ round-09 重启 startup_resume
184
+ round-10 资料抽屉私信
185
+ round-11 多 Project 新建/切换
186
+ round-12 成员工具链 + skill 加载
187
+ round-13 四种运行配方
188
+ round-14 安装/卸载 smoke
189
+ round-15 并发/收件箱/V-10/billing
190
+ round-16 四技能安装
191
+ round-17 SkillOpt 内置 + 冷恢复
192
+ round-18 跨 Project 打开 Task + SSE 分桶
193
+ round-19 DeepSeek + Zhipu 双 provider
194
+ ```
195
+
196
+ ---
197
+
198
+ ## 文档
20
199
 
21
- ## Layout
200
+ - [需求研究](docs/01-需求研究报告.md)
201
+ - [PRD](docs/02-产品需求文档-PRD.md)
202
+ - [架构设计](docs/03-架构设计报告.md)
203
+ - [UI/UX/UE 研究](docs/04-UI-UX-UE研究报告.md)
204
+ - [启动与执行计划](docs/05-项目启动与执行计划.md)
205
+ - [会议纪要](docs/06-会议纪要.md)
206
+ - [四象限设计](docs/07-四象限视图研究与设计.md)
207
+ - [异常恢复与模型治理](docs/08-异常恢复与模型治理.md)
208
+ - [团队进化与人才库](docs/09-团队进化与人才库.md)
209
+ - [安装、卸载与升级](docs/10-安装卸载升级.md)
210
+ - [M3 并发多项目与边界补齐](docs/reports/M3-并发多项目与边界补齐.md)
22
211
 
23
- - `index.js` — Host entry: same-origin `/ai-team/api/health`, `/ai-team/api/bootstrap`, and `POST /ai-team/api/projects/:id/commands` backed by the default-project ledger.
24
- - `client.js` — Client entry: `sidebar.panellist` icon + `main` key `ai-team` three-pane workbench.
25
- - `cordis.patch.yml` — bundle row.
26
- - `lib/` — append-only ledger (`ledger/*`), task/thread/inbox domain (`domain/*`) and the host `TeamService` (`host/service.js`).
27
- - `test/` — `node --test`: bundle smoke, ledger/fold/checkpoint, domain rules, and a real-ledger service integration.
212
+ ---
28
213
 
29
- The bundled SkillOpt integration is derived from Microsoft SkillOpt (`plugins/dsh`, MIT); its license is kept at `lib/vendor/skillopt/LICENSE`.
214
+ ## 当前边界
30
215
 
31
- ## Rules
216
+ - 单机、单 Human;不支持多 Human 共享 Team;
217
+ - billing/网络注入是测试 adapter,不是物理断网;
218
+ - SSE 分桶用两个真实 provider 的独立订阅端验证,不是两个浏览器窗口;
219
+ - nuwa / distilly / darwin 不内置,有则用、无则不用;
220
+ - desktop profile 由插件 patch 固定为 `danger-full-access / never`,只应在可信机器使用。
32
221
 
33
- - Only `--dsw-alias-*` tokens for UI chrome; the Loop Mark is the only artwork with its own color.
34
- - No timer / no background wake; M1 will add event-driven wake.
35
- - A′ (native session + tool view) is only the fallback when the workbench is unavailable.
222
+ ---
36
223
 
37
- ## Docs
224
+ ## License
38
225
 
39
- The phase-1 research, PRD, architecture, UX and execution plan live in the repository's `docs/` directory (index: `docs/README.md`).
226
+ MIT。
227
+ Bundled SkillOpt integration derives from [Microsoft SkillOpt](https://github.com/microsoft/SkillOpt) `plugins/dsh` (MIT); its license lives at `lib/vendor/skillopt/LICENSE`.
package/index.js CHANGED
@@ -32,7 +32,7 @@ export const name = 'ai-team';
32
32
  /** The workbench only makes sense where the Web carrier exists. */
33
33
  export const inject = ['webServer', 'permissionPresets', 'sandboxPolicy'];
34
34
 
35
- const VERSION = '0.3.3';
35
+ const VERSION = '0.3.4';
36
36
  const PROJECT_ID = 'prj_main';
37
37
  const HUMAN_ID = 'mem_human';
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "文渊阁 (Wenyuan Pavilion) — AI Team mode for DeepSeek Harness: concurrent projects, owned tasks, threads, inbox and an append-only team ledger",
6
6
  "license": "MIT",