@nanmicoder/dsh-agent-teams 0.1.13 → 0.1.14

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.
@@ -11,8 +11,51 @@
11
11
  export type TaskStatus = 'pending' | 'claimed' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
12
12
  /** Statuses after which a task can no longer be claimed or worked on. */
13
13
  export declare const TERMINAL_TASK_STATUSES: readonly TaskStatus[];
14
+ /** Structured quality-gate kind. Absent / unknown values are treated as `work`. */
15
+ export type TaskKind = 'requirements' | 'implementation' | 'verification' | 'review' | 'repair' | 'integration' | 'work';
16
+ export declare const TASK_KINDS: readonly TaskKind[];
17
+ /** Review / requirements conclusion. Only `pass` may complete those kinds. */
18
+ export type ReviewVerdict = 'pass' | 'needs_revision' | 'reject';
19
+ export declare const REVIEW_VERDICTS: readonly ReviewVerdict[];
20
+ /** Finding severity used by review / requirements output. */
21
+ export type FindingSeverity = 'low' | 'medium' | 'high' | 'blocker';
22
+ export declare const FINDING_SEVERITIES: readonly FindingSeverity[];
23
+ /** One structured review finding. */
24
+ export interface ReviewFinding {
25
+ /** Stable id, for example `SEC-001`. */
26
+ id: string;
27
+ severity: FindingSeverity;
28
+ file?: string;
29
+ line?: number;
30
+ problem: string;
31
+ requiredFix: string;
32
+ resolved?: boolean;
33
+ }
34
+ /** One acceptance criterion result recorded at completion. */
35
+ export interface AcceptanceResult {
36
+ criterion: string;
37
+ status: 'passed' | 'failed';
38
+ evidence?: string;
39
+ }
40
+ /** One verification command result recorded at completion. */
41
+ export interface CommandResult {
42
+ command: string;
43
+ status: 'passed' | 'failed';
44
+ exitCode?: number;
45
+ evidence?: string;
46
+ }
47
+ /** Profile / team review-loop limits. */
48
+ export interface ReviewPolicy {
49
+ requirementsMinRounds?: number;
50
+ requirementsMaxRounds?: number;
51
+ codeMaxRounds?: number;
52
+ maxRepairAttempts?: number;
53
+ requiredReviewers?: string[];
54
+ }
14
55
  /** One task of a team's task list. */
15
56
  export interface TeamTask {
57
+ /** Stable task id from the profile template; absent for ad-hoc tasks. */
58
+ profileSeedId?: string;
16
59
  /** Stable task id within the team (`t1`, `t2`, …). */
17
60
  id: string;
18
61
  /** Brief title for the task. */
@@ -34,6 +77,29 @@ export interface TeamTask {
34
77
  handoffId?: string;
35
78
  /** A handoff is quiescing the old owner; the scheduler must not dispatch it yet. */
36
79
  reassigning?: boolean;
80
+ /** Quality-gate kind. Missing values are treated as `work`. */
81
+ kind?: TaskKind;
82
+ /** Review / requirements / repair loop index, 1-based when present. */
83
+ round?: number;
84
+ verdict?: ReviewVerdict;
85
+ findings?: ReviewFinding[];
86
+ objective?: string;
87
+ inScope?: string[];
88
+ outOfScope?: string[];
89
+ acceptance?: string[];
90
+ verify?: string[];
91
+ deliverables?: string[];
92
+ nonGoals?: string[];
93
+ changedPaths?: string[];
94
+ acceptanceResults?: AcceptanceResult[];
95
+ commandsRun?: CommandResult[];
96
+ reviewedTaskId?: string;
97
+ reviewedAttempt?: number;
98
+ /** Repair source: the implementation / previous successful artifact. */
99
+ sourceTaskId?: string;
100
+ sourceFindingIds?: string[];
101
+ /** User-constraint / goal items this task claims to cover. */
102
+ coverageOf?: string[];
37
103
  createdAt: number;
38
104
  updatedAt: number;
39
105
  }
@@ -53,6 +119,15 @@ export interface TeamMember {
53
119
  model?: string;
54
120
  /** Resolved reasoning effort captured from the captain or target model default. */
55
121
  reasoningEffort?: string;
122
+ /** Prompt specific to this member's execution turns. */
123
+ executionPrompt?: string;
124
+ /** Configured second-choice route. */
125
+ fallback?: TeamModelFallback;
126
+ /** Active route after fallback, without changing the primary descriptor route. */
127
+ activeProvider?: string;
128
+ activeModel?: string;
129
+ /** Whether the fallback route is currently active. */
130
+ fallbackActive?: boolean;
56
131
  joinedAt: number;
57
132
  status: MemberStatus;
58
133
  }
@@ -72,6 +147,22 @@ export interface TeamMessage {
72
147
  /** Set once the recipient has consumed or been shown the durable fallback. */
73
148
  readAt?: number;
74
149
  }
150
+ /** Snapshot of the named profile used to seed a team. */
151
+ export interface TeamModelFallback {
152
+ provider: string;
153
+ model: string;
154
+ }
155
+ export interface TeamProfileSnapshot {
156
+ name: string;
157
+ description?: string;
158
+ protocol?: string;
159
+ executionPrompt?: string;
160
+ fallback?: TeamModelFallback;
161
+ /** Frozen planning mode: captain plans the graph; seed keeps template tasks. */
162
+ taskPlanning?: 'captain' | 'seed';
163
+ /** Frozen review-loop policy from the creating profile. */
164
+ reviewPolicy?: ReviewPolicy;
165
+ }
75
166
  /** The full durable team record. */
76
167
  export interface TeamState {
77
168
  /** Original team name. */
@@ -80,6 +171,8 @@ export interface TeamState {
80
171
  id: string;
81
172
  /** Team purpose/goal. */
82
173
  description?: string;
174
+ /** Immutable named profile snapshot, when created from a profile. */
175
+ profile?: TeamProfileSnapshot;
83
176
  /** Session id of the captain agent that owns this team. */
84
177
  captainSessionId: string;
85
178
  createdAt: number;
@@ -88,4 +181,29 @@ export interface TeamState {
88
181
  tasks: TeamTask[];
89
182
  /** Monotonic task id counter. */
90
183
  taskSeq: number;
184
+ /**
185
+ * Two-phase execution lifecycle. Missing means `running` for durable
186
+ * compatibility with teams created before staging existed.
187
+ */
188
+ phase?: 'staged' | 'running';
189
+ /**
190
+ * Human-facing review sub-state while `phase` is `staged`. Missing staged
191
+ * records are treated as `awaiting_review` for backward compatibility.
192
+ * `awaiting_feedback` means the user returned to chat and the Captain must
193
+ * ask what should change before editing this same draft.
194
+ */
195
+ planReviewState?: 'awaiting_review' | 'awaiting_feedback';
196
+ /** Timestamp written only after a staged plan is explicitly approved. */
197
+ approvedAt?: number;
198
+ /**
199
+ * Human halt from the captain chat. The team remains on disk, members stay
200
+ * available, and unfinished work is cancelled until the captain resumes.
201
+ */
202
+ halted?: boolean;
203
+ /** Timestamp of the latest human halt, when present. */
204
+ haltedAt?: number;
205
+ /** Review-loop policy snapshot copied from the creating profile, when present. */
206
+ reviewPolicy?: ReviewPolicy;
207
+ /** Set when an automatic review/repair loop hits its configured ceiling. */
208
+ escalated?: boolean;
91
209
  }
package/lib/types.js CHANGED
@@ -9,3 +9,14 @@
9
9
  */
10
10
  /** Statuses after which a task can no longer be claimed or worked on. */
11
11
  export const TERMINAL_TASK_STATUSES = ['completed', 'failed', 'cancelled'];
12
+ export const TASK_KINDS = [
13
+ 'requirements',
14
+ 'implementation',
15
+ 'verification',
16
+ 'review',
17
+ 'repair',
18
+ 'integration',
19
+ 'work',
20
+ ];
21
+ export const REVIEW_VERDICTS = ['pass', 'needs_revision', 'reject'];
22
+ export const FINDING_SEVERITIES = ['low', 'medium', 'high', 'blocker'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanmicoder/dsh-agent-teams",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "AgentTeams for DeepSeek Harness: multi-agent team collaboration (captain, members, tasks with dependencies, messaging) driven by natural language, with a tree monitor in the web GUI",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -67,17 +67,18 @@
67
67
  "@deepseek-ai/dsh-client-locale",
68
68
  "@deepseek-ai/dsh-client-runtime",
69
69
  "@deepseek-ai/dsh-client-ui-conversation",
70
- "@deepseek-ai/dsh-client-ui-layout"
70
+ "@deepseek-ai/dsh-client-ui-layout",
71
+ "@deepseek-ai/dsh-client-ui-model-selection"
71
72
  ],
72
73
  "platform": "web"
73
74
  }
74
75
  },
75
76
  "scripts": {
76
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && tsdown",
77
+ "build": "node scripts/clean-build.mjs && tsc -p tsconfig.json && tsc -p tsconfig.client.json && tsdown",
77
78
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
78
79
  "sync:skill": "node scripts/sync-skill.mjs",
79
80
  "verify:skill": "node scripts/sync-skill.mjs --check",
80
- "verify": "node scripts/verify.mjs && node scripts/lifecycle-verify.mjs && node scripts/stress-verify.mjs && pnpm verify:skill",
81
+ "verify": "node scripts/verify.mjs && node scripts/fallback-tdd.mjs && node scripts/quality-gates-tdd.mjs && node scripts/lifecycle-verify.mjs && node scripts/stress-verify.mjs && pnpm verify:skill",
81
82
  "prepublishOnly": "pnpm build && pnpm verify"
82
83
  },
83
84
  "peerDependencies": {
@@ -87,6 +88,7 @@
87
88
  "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
88
89
  "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
89
90
  "@deepseek-ai/dsh-client-ui-layout": "^0.1.0-rc.6",
91
+ "@deepseek-ai/dsh-client-ui-model-selection": "^0.1.0-rc.8",
90
92
  "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
91
93
  "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
92
94
  "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
@@ -117,6 +119,9 @@
117
119
  "@deepseek-ai/dsh-client-ui-layout": {
118
120
  "optional": true
119
121
  },
122
+ "@deepseek-ai/dsh-client-ui-model-selection": {
123
+ "optional": true
124
+ },
120
125
  "@deepseek-ai/dsh-client-ui-primitives": {
121
126
  "optional": true
122
127
  },
@@ -155,6 +160,7 @@
155
160
  "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.8",
156
161
  "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.8",
157
162
  "@deepseek-ai/dsh-client-ui-layout": "0.1.0-rc.8",
163
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.1.0-rc.8",
158
164
  "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8",
159
165
  "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
160
166
  "@deepseek-ai/dsh-commands": "0.1.0-rc.8",
@@ -0,0 +1,68 @@
1
+ # AgentTeams v0.1.14
2
+
3
+ This release adds a review-first team workflow, stronger delivery gates, and safer controls for long-running AgentTeams sessions.
4
+
5
+ ## New
6
+
7
+ - **Review plans before execution**: normal `/agent-teams` runs now stage the roster and task DAG without creating members or scheduling work. Reviewers can edit members, prompts, models, reasoning levels, tasks, and dependencies before launch.
8
+ - **Native model routing**: the plan editor uses Harness's provider/model catalog and reasoning metadata instead of maintaining a separate handwritten model list.
9
+ - **Captain-designed teams and stop controls**: profiles can let the Captain design the task graph for the real workspace, while running teams expose a dedicated, confirmed stop action in the activity panel.
10
+ - **Quality delivery gates**: optional requirements, implementation, verification, independent review, repair, re-review, and integration contracts keep downstream work blocked until evidence is accepted.
11
+
12
+ ## Fixed & Improved
13
+
14
+ - **Atomic approval**: every member route is validated before any child session is created, preventing a bad model choice from leaving a partially started team.
15
+ - **Return to chat and revise**: returning from review cancels the planning turn, asks one focused question, and applies the answer to the same draft with one atomic plan edit before requesting review again.
16
+ - **Discard really stops planning**: discarding archives the draft, aborts an active Captain turn, and injects authoritative context that prevents the model from silently recreating the team.
17
+ - **Responsive review actions**: decision controls respond to the activity panel's own width, so approve, revise, and discard remain aligned even when the panel is narrow.
18
+ - **Safer recovery and takeover**: abandoned Captain-owned tasks return to the scheduler without allowing stale attempts to overwrite newer work.
19
+ - **More stable panel state**: restored activity panels preserve their collapsed state and retain complete staged, running, stopped, and archived histories.
20
+
21
+ ## Verification
22
+
23
+ - Passed TypeScript checks, production builds, offline verification, lifecycle verification, quality-gate TDD, the complex stress suite, and package dry-run checks.
24
+ - Exercised the staged-plan workflow in the real Harness Web UI with DeepSeek-V4-Flash / High: native model routing, narrow-panel layout, return-to-chat revision, atomic plan editing, discard cancellation, archive state, and ordinary chat after discard all passed.
25
+ - Verified that discarding while the Captain was still planning stopped the active generation immediately and did not recreate the team.
26
+
27
+ ## Installation
28
+
29
+ ```sh
30
+ dsh plugin --profile web add @nanmicoder/dsh-agent-teams
31
+ ```
32
+
33
+ <details>
34
+ <summary><b>中文版本 / Chinese Version</b></summary>
35
+
36
+ # AgentTeams v0.1.14
37
+
38
+ 本次更新加入执行前审查流程、更强的交付质量门禁,以及更安全的长任务控制。
39
+
40
+ ## 新功能
41
+
42
+ - **执行前审查计划**:普通 `/agent-teams` 会先生成可编辑的成员阵容和任务 DAG,不创建成员、不调度任务。启动前可调整成员、提示词、模型、推理等级、任务和依赖。
43
+ - **复用 Harness 模型路由**:计划编辑器直接使用 Harness 的 Provider、模型目录和推理等级元数据,不再维护另一份手写模型列表。
44
+ - **队长规划与团队停止**:profile 可让队长根据真实 workspace 设计任务图;运行中的团队可从活动面板执行带确认的停止操作。
45
+ - **交付质量门禁**:可选的需求、实现、验证、独立审查、修复、复审和集成合同,会在证据验收前持续阻断下游任务。
46
+
47
+ ## 修复与改进
48
+
49
+ - **原子启动校验**:创建任何子会话之前先校验全部成员模型路由,避免错误模型造成“半支团队”。
50
+ - **返回对话修改**:返回聊天会取消当前规划轮次,只追问一个修改问题;用户回复后通过一次原子计划编辑更新同一份草案,再次等待审查。
51
+ - **放弃后真正停止**:放弃计划会归档草案、中止仍在运行的队长轮次,并注入禁止静默重建团队的权威上下文。
52
+ - **窄面板操作稳定**:操作区根据活动面板自身宽度响应,面板再窄也不会让确认、修改和放弃按钮错位重叠。
53
+ - **更安全的恢复与接管**:被遗留的队长任务会安全回到调度器,旧 attempt 不能覆盖较新的执行结果。
54
+ - **面板状态更稳定**:恢复后的活动面板保持折叠状态,并完整保留待审、运行、停止和归档历史。
55
+
56
+ ## 验证
57
+
58
+ - 通过 TypeScript 检查、生产构建、离线验证、生命周期验证、质量门禁 TDD、复杂压力测试和 npm 包 dry-run。
59
+ - 在真实 Harness Web UI 中使用 DeepSeek-V4-Flash / High 完成执行前计划回归:原生模型路由、窄面板、返回对话、原子修改、放弃取消、归档状态及放弃后的普通聊天均通过。
60
+ - 验证队长仍在规划时放弃:生成立即停止,团队不会被重新创建。
61
+
62
+ ## 安装
63
+
64
+ ```sh
65
+ dsh plugin --profile web add @nanmicoder/dsh-agent-teams
66
+ ```
67
+
68
+ </details>