@suifei/dsh-ai-team 0.4.122 → 0.4.123
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 +11 -0
- package/lib/domain/rich-message.js +14 -0
- package/lib/host/member-tools.js +5 -2
- package/lib/host/waker.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.123 - 2026-11-17
|
|
4
|
+
|
|
5
|
+
**被 @ 的成员可以在主对话直接回一条**
|
|
6
|
+
|
|
7
|
+
- il2c 11-17 21:44 实机:Human 在「文渊阁·PMO」里「@tony老师 hi」,tony 老师被直接叫醒、也看到了图,
|
|
8
|
+
可唤醒提示让他「用 team action=say 在主对话回复」,而 `say` 只许负责人用,被 `E_UNAUTHORIZED` 拒,只能请墨渊代发;
|
|
9
|
+
- 规则改为:Human 每 @ 一次,被 @ 的成员可在主对话回一条(`unansweredMention`),回完发言权收回;
|
|
10
|
+
其余时候仍只有负责人在主对话说话;team 工具说明与点名唤醒提示同步改写;
|
|
11
|
+
- 测试:`test/pmo-voice.test.js` 补一例(回一次、再说被拒、未点名不给、下次点名再给、负责人照常);
|
|
12
|
+
实机 E2E(rc.1 / rc.3):宿主会话 @青岚 → 青岚在主对话回「到」,无拒绝记录。
|
|
13
|
+
|
|
3
14
|
## 0.4.122 - 2026-11-17
|
|
4
15
|
|
|
5
16
|
**DSH 标准会话里的 @ 也能点名成员**
|
|
@@ -120,3 +120,17 @@ export function messageContent(text, attachments) {
|
|
|
120
120
|
const list = normalizeAttachments(attachments);
|
|
121
121
|
return list.length === 0 ? text : [{ type: 'text', text }, ...list];
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Human 在主对话 @ 了这个成员、而成员还没在主对话回过话时,返回那条点名消息;否则 null。
|
|
125
|
+
* 主对话平时只有负责人发言;被点名的成员可以直接回这一次(il2c 11-17 21:44:tony 老师被 @ 后 say 被拒,只能请墨渊代发)。
|
|
126
|
+
* 每次点名只换一次发言:成员在点名之后发过一条,这次点名就算答过了。
|
|
127
|
+
*/
|
|
128
|
+
export function unansweredMention(stream, memberId, projectId) {
|
|
129
|
+
const entries = (Array.isArray(stream) ? stream : []).filter((entry) => projectId === undefined || projectId === null || entry.projectId === undefined || entry.projectId === projectId);
|
|
130
|
+
let mention = null;
|
|
131
|
+
for (const entry of entries) {
|
|
132
|
+
if (entry.kind === 'human_message' && Array.isArray(entry.mentions) && entry.mentions.includes(memberId)) mention = entry;
|
|
133
|
+
else if (mention !== null && entry.authorId === memberId && entry.seq > mention.seq) mention = null;
|
|
134
|
+
}
|
|
135
|
+
return mention;
|
|
136
|
+
}
|
package/lib/host/member-tools.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { taskCard } from './views.js';
|
|
11
11
|
import { isQaMember } from '../domain/member-profile.js';
|
|
12
|
+
import { unansweredMention } from '../domain/rich-message.js';
|
|
12
13
|
|
|
13
14
|
const ACTIONS = ['tasks', 'members', 'inbox', 'recall', 'create', 'askHuman', 'member', 'evolve', 'distill', 'note', 'skill', 'claim', 'submit', 'thread', 'reply', 'accept', 'requestChanges', 'say'];
|
|
14
15
|
|
|
@@ -56,7 +57,7 @@ function rosterText(state) {
|
|
|
56
57
|
export function createTeamTool(options) {
|
|
57
58
|
return {
|
|
58
59
|
name: 'team',
|
|
59
|
-
description: 'Read and act on the AI Team board. The Project owner (the PMO)
|
|
60
|
+
description: 'Read and act on the AI Team board. The Project owner (the PMO) speaks to Human in the Main stream with action=say (optionally listing taskIds); a member whom Human @-mentioned there may answer that mention once with action=say; everyone else talks in Task Threads. The Project owner can create tasks with action=create and must set resultDefinition and ownerId. Use members for the exact roster id/name/role; use tasks for ids/revisions. When Human must decide something, call askHuman with every question and options—do not bury questions in a report. Use recall to search your notes/skills and your past Tasks/Threads. Claim before working; read a Thread before replying; submit evidence before acceptance.',
|
|
60
61
|
parameters: {
|
|
61
62
|
type: 'object',
|
|
62
63
|
properties: {
|
|
@@ -314,7 +315,9 @@ export function createTeamTool(options) {
|
|
|
314
315
|
if (args.action === 'say') {
|
|
315
316
|
// 核心模型:只有项目 PMO 面向 Human 说话(主对话);成员在各自 Task Thread 里协作。
|
|
316
317
|
const ownerId = state.projects?.[pid]?.ownerMemberId ?? state.projects?.[pid]?.ownerId;
|
|
317
|
-
|
|
318
|
+
// #65:Human @ 了谁,谁就能在主对话直接回这一次点名(回完即收回);其余时候只有负责人说话。
|
|
319
|
+
const mentioned = ownerId === member.id ? null : unansweredMention(state.stream, member.id, pid);
|
|
320
|
+
if (ownerId !== member.id && mentioned === null) return failure({ code: 'E_UNAUTHORIZED', message: 'only the Project owner (PMO) speaks in the Main stream, or a member answering the Human message that @-mentioned it; use reply in the Task Thread instead' });
|
|
318
321
|
if (typeof args.body !== 'string' || args.body.trim() === '') return failure({ code: 'E_INVALID_ARGUMENT', message: 'body is required' });
|
|
319
322
|
const taskIds = Array.isArray(args.taskIds) ? args.taskIds.filter((id) => typeof id === 'string' && id !== '') : [];
|
|
320
323
|
const result = await command('stream.post', { body: args.body, taskIds });
|
package/lib/host/waker.js
CHANGED
|
@@ -269,7 +269,7 @@ export function planWakes(state, result, actor = {}, options = {}) {
|
|
|
269
269
|
null,
|
|
270
270
|
'human_mention',
|
|
271
271
|
`human_mention:${event.seq ?? event.payload?.seq}`,
|
|
272
|
-
`Human 在主对话点名你:“${body.slice(0, 2000)}”。${attachmentNote}项目负责人(${ownerName})也收到了这句话并统筹安排。先读 tasks
|
|
272
|
+
`Human 在主对话点名你:“${body.slice(0, 2000)}”。${attachmentNote}项目负责人(${ownerName})也收到了这句话并统筹安排。先读 tasks 与主对话,再从你的岗位回应:用 team action=say 在主对话直接回复 Human(这次点名你可以回一条,回完发言权收回,想清楚再写全);需要建卡、改派的交给负责人,不要自己另开一摊。`,
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
for (const plan of targets.values()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.123",
|
|
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",
|