@suifei/dsh-ai-team 0.3.22 → 0.3.24
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 +10 -0
- package/index.js +1 -1
- package/lib/host/member-tools.js +18 -0
- package/lib/host/service.js +61 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.24 — 2026-11-10
|
|
4
|
+
|
|
5
|
+
- 修复 member `team` 工具 accept 未透传 `checks` 的缺口:agent QA 带 checklist 验收不再 E_INVALID_STATE;
|
|
6
|
+
- 增加 `checks` schema,并覆盖 QA agent 带清单验收测试。
|
|
7
|
+
|
|
8
|
+
## 0.3.23 — 2026-11-10
|
|
9
|
+
|
|
10
|
+
- 报告六问只生成一个结构化收件箱项,不再按每条 Thread mention 重复;
|
|
11
|
+
- 在现有项目账本副本上验证:1 个决策项、6 个问题、未读。
|
|
12
|
+
|
|
3
13
|
## 0.3.22 — 2026-11-10
|
|
4
14
|
|
|
5
15
|
- 报告路径提取只接受无空格的绝对路径,避免把 Thread 叙述当成报告路径;
|
package/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export const name = 'ai-team';
|
|
|
34
34
|
/** The workbench only makes sense where the Web carrier exists. */
|
|
35
35
|
export const inject = ['webServer', 'permissionPresets', 'sandboxPolicy'];
|
|
36
36
|
|
|
37
|
-
const VERSION = '0.3.
|
|
37
|
+
const VERSION = '0.3.24';
|
|
38
38
|
const PROJECT_ID = 'prj_main';
|
|
39
39
|
const HUMAN_ID = 'mem_human';
|
|
40
40
|
|
package/lib/host/member-tools.js
CHANGED
|
@@ -72,6 +72,18 @@ export function createTeamTool(options) {
|
|
|
72
72
|
assigneeId: { type: 'string', description: 'Optional assignee id from members for create.' },
|
|
73
73
|
qaRequired: { type: 'boolean', description: 'Require a QA member to accept this task.' },
|
|
74
74
|
qaChecklist: { type: 'array', items: { type: 'string' }, description: 'QA checklist items; all must pass before acceptance.' },
|
|
75
|
+
checks: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
description: 'Acceptance checks for accept; include every qaChecklist item with passed=true/false.',
|
|
78
|
+
items: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
item: { type: 'string', description: 'Exact qaChecklist item.' },
|
|
82
|
+
passed: { type: 'boolean' },
|
|
83
|
+
},
|
|
84
|
+
required: ['item', 'passed'],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
75
87
|
questions: {
|
|
76
88
|
type: 'array',
|
|
77
89
|
description: 'Human decision questions for askHuman; include every question instead of pointing at a report.',
|
|
@@ -258,6 +270,12 @@ export function createTeamTool(options) {
|
|
|
258
270
|
payload.evidence = evidence.map((value) => ({ kind: 'text', value }));
|
|
259
271
|
}
|
|
260
272
|
if (args.action === 'accept' || args.action === 'requestChanges') payload.note = typeof args.note === 'string' ? args.note : '';
|
|
273
|
+
if (args.action === 'accept') {
|
|
274
|
+
const checks = Array.isArray(args.checks)
|
|
275
|
+
? args.checks.filter((check) => typeof check?.item === 'string' && check.item !== '' && typeof check.passed === 'boolean')
|
|
276
|
+
: [];
|
|
277
|
+
if (checks.length > 0) payload.checks = checks;
|
|
278
|
+
}
|
|
261
279
|
const type = args.action === 'requestChanges' ? 'task.request_changes' : `task.${args.action}`;
|
|
262
280
|
const result = await command(type, payload);
|
|
263
281
|
return { ok: true, task: taskCard(options.getState(), result.task), event: result.event?.type ?? null };
|
package/lib/host/service.js
CHANGED
|
@@ -168,39 +168,75 @@ export class TeamService {
|
|
|
168
168
|
reportQuestions = parseDecisionQuestions(readFileSync(reportPath, 'utf8'));
|
|
169
169
|
} catch { /* report may be unavailable; keep the Thread fallback */ }
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
const candidates = [];
|
|
172
172
|
for (const task of Object.values(this.state.tasks ?? {})) {
|
|
173
173
|
if (task.tombstone === true) continue;
|
|
174
174
|
for (const entry of this.state.threads?.[task.id]?.entries ?? []) {
|
|
175
175
|
const author = this.state.members?.[entry.authorId];
|
|
176
176
|
if (author?.kind !== 'agent' || !mentionsHuman(entry.body)) continue;
|
|
177
177
|
const key = `${task.id}:${entry.seq}`;
|
|
178
|
-
if (existing.has(key)) continue;
|
|
179
|
-
|
|
180
|
-
const useQuestions = reportQuestions.length > 0;
|
|
181
|
-
const item = createInboxItem({
|
|
182
|
-
memberId: humanId,
|
|
183
|
-
type: 'decision_required',
|
|
184
|
-
ref: {
|
|
185
|
-
taskId: task.id,
|
|
186
|
-
entrySeq: entry.seq,
|
|
187
|
-
memberId: entry.authorId,
|
|
188
|
-
category: 'thread_mention',
|
|
189
|
-
title: useQuestions ? `需 Human 决策 · ${reportQuestions.length} 问` : String(entry.body).slice(0, 180),
|
|
190
|
-
...(useQuestions ? { questions: reportQuestions, source: reportPath } : {}),
|
|
191
|
-
},
|
|
192
|
-
requiresDecision: true,
|
|
193
|
-
}, { at: this.now() });
|
|
194
|
-
await this.ledger.append({
|
|
195
|
-
type: 'inbox/item-created',
|
|
196
|
-
payload: { itemId: item.id, ...item },
|
|
197
|
-
actor: { kind: 'system' },
|
|
198
|
-
projectId,
|
|
199
|
-
at: this.now(),
|
|
200
|
-
});
|
|
201
|
-
created += 1;
|
|
178
|
+
if (existing.has(key) && reportQuestions.length === 0) continue;
|
|
179
|
+
candidates.push({ task, entry, key });
|
|
202
180
|
}
|
|
203
181
|
}
|
|
182
|
+
if (reportQuestions.length > 0 && candidates.length > 0) {
|
|
183
|
+
const alreadyStructured = Object.values(this.state.inbox ?? {}).some((item) =>
|
|
184
|
+
item.memberId === humanId
|
|
185
|
+
&& item.ref?.source === reportPath
|
|
186
|
+
&& Array.isArray(item.ref?.questions)
|
|
187
|
+
&& item.ref.questions.length > 0
|
|
188
|
+
&& !['resolved', 'dismissed', 'superseded'].includes(item.state));
|
|
189
|
+
if (alreadyStructured) return 0;
|
|
190
|
+
const chosen = candidates.find((candidate) => /§6|六问/.test(candidate.entry.body))
|
|
191
|
+
?? candidates.sort((left, right) => (right.entry.seq ?? 0) - (left.entry.seq ?? 0))[0];
|
|
192
|
+
const item = createInboxItem({
|
|
193
|
+
memberId: humanId,
|
|
194
|
+
type: 'decision_required',
|
|
195
|
+
ref: {
|
|
196
|
+
taskId: chosen.task.id,
|
|
197
|
+
entrySeq: chosen.entry.seq,
|
|
198
|
+
memberId: chosen.entry.authorId,
|
|
199
|
+
category: 'thread_mention',
|
|
200
|
+
title: `需 Human 决策 · ${reportQuestions.length} 问`,
|
|
201
|
+
questions: reportQuestions,
|
|
202
|
+
source: reportPath,
|
|
203
|
+
},
|
|
204
|
+
requiresDecision: true,
|
|
205
|
+
}, { at: this.now() });
|
|
206
|
+
await this.ledger.append({
|
|
207
|
+
type: 'inbox/item-created',
|
|
208
|
+
payload: { itemId: item.id, ...item },
|
|
209
|
+
actor: { kind: 'system' },
|
|
210
|
+
projectId,
|
|
211
|
+
at: this.now(),
|
|
212
|
+
});
|
|
213
|
+
return 1;
|
|
214
|
+
}
|
|
215
|
+
let created = 0;
|
|
216
|
+
for (const candidate of candidates) {
|
|
217
|
+
const { task, entry } = candidate;
|
|
218
|
+
existing.add(candidate.key);
|
|
219
|
+
const item = createInboxItem({
|
|
220
|
+
memberId: humanId,
|
|
221
|
+
type: 'decision_required',
|
|
222
|
+
ref: {
|
|
223
|
+
taskId: task.id,
|
|
224
|
+
entrySeq: entry.seq,
|
|
225
|
+
memberId: entry.authorId,
|
|
226
|
+
category: 'thread_mention',
|
|
227
|
+
title: String(entry.body).slice(0, 180),
|
|
228
|
+
},
|
|
229
|
+
requiresDecision: true,
|
|
230
|
+
}, { at: this.now() });
|
|
231
|
+
await this.ledger.append({
|
|
232
|
+
type: 'inbox/item-created',
|
|
233
|
+
payload: { itemId: item.id, ...item },
|
|
234
|
+
actor: { kind: 'system' },
|
|
235
|
+
projectId,
|
|
236
|
+
at: this.now(),
|
|
237
|
+
});
|
|
238
|
+
created += 1;
|
|
239
|
+
}
|
|
204
240
|
return created;
|
|
205
241
|
}
|
|
206
242
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
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",
|