@suifei/dsh-ai-team 0.3.77 → 0.3.79
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/index.js +3 -1
- package/lib/host/service.js +8 -1
- package/lib/runtime/member-runtime.js +10 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.79 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
- **Human 直聊门接入项目开关**:成员会话 header 的 parentSession 现在由项目 chatGate 决定——open(默认)不带 parentSession(宿主放行 Human 在 DSH 主界面直接输入);closed 带 parentSession(宿主按 subagent-owned 拒绝)。门只对新建/重建会话生效(header 不可变),切换开关时命令返回明确说明(已有成员需「重置会话」)。2 项映射测试(open/closed 两种 header 断言)。
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## 0.3.78 - 2026-11-12
|
|
9
|
+
|
|
10
|
+
- **【关键】成员会话对 Human 只读的根因修复**:宿主 hasApiSessionSubagentOwner 除 origin=subagent 外,对「header 带 parentSession 且 parent 拥有该 agent」的会话同样判定为 subagent-owned 并拒绝 Human 输入。插件 direct 模式创建成员会话时恰好设置了 meta.parentSession,导致所有成员会话被拒。现移除该 header 字段(驱动改用 agents.resume 的 parentAgent,不依赖 header)——新激活/重置后的成员会话可在 DSH 主界面直接输入。
|
|
11
|
+
- 已存在成员需执行一次「重置会话」(reseat)使新 header 生效。
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## 0.3.77 - 2026-11-12
|
|
4
15
|
|
|
5
16
|
- **Human 对话入口直达**:主对话流成员消息头新增「私信」按钮(此前需点名字→资料面板→私信三步);私信直达该成员会话写入通道。
|
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ export const name = 'ai-team';
|
|
|
41
41
|
/** The workbench only makes sense where the Web carrier exists. */
|
|
42
42
|
export const inject = ['webServer', 'permissionPresets', 'sandboxPolicy'];
|
|
43
43
|
|
|
44
|
-
const VERSION = '0.3.
|
|
44
|
+
const VERSION = '0.3.79';
|
|
45
45
|
const PROJECT_ID = 'prj_main';
|
|
46
46
|
const HUMAN_ID = 'mem_human';
|
|
47
47
|
|
|
@@ -455,6 +455,7 @@ export function apply(ctx, config = {}) {
|
|
|
455
455
|
agents: ctx.get('agents'),
|
|
456
456
|
agentPresets: ctx.get('agentPresets'),
|
|
457
457
|
direct: true,
|
|
458
|
+
allowHumanWrite: projectRuntime.service.state.projects?.[projectRuntime.id]?.chatGate !== 'closed',
|
|
458
459
|
parent: parentInfo.agent,
|
|
459
460
|
provider: providers[0],
|
|
460
461
|
preset: 'standard',
|
|
@@ -859,6 +860,7 @@ export function apply(ctx, config = {}) {
|
|
|
859
860
|
agents: ctx.get('agents'),
|
|
860
861
|
agentPresets: ctx.get('agentPresets'),
|
|
861
862
|
direct: true,
|
|
863
|
+
allowHumanWrite: projectRuntime.service.state.projects?.[projectRuntime.id]?.chatGate !== 'closed',
|
|
862
864
|
parent: parentInfo.agent,
|
|
863
865
|
provider: providers[0],
|
|
864
866
|
preset: 'standard',
|
package/lib/host/service.js
CHANGED
|
@@ -469,7 +469,14 @@ export class TeamService {
|
|
|
469
469
|
if (gate !== 'open' && gate !== 'closed') fail(ERRORS.INVALID_ARGUMENT, 'gate must be open or closed');
|
|
470
470
|
if (command.actor.kind !== 'human') fail(ERRORS.UNAUTHORIZED, 'only Human may change the chat gate');
|
|
471
471
|
await this.append(command, 'project/chat-gate', { projectId, gate, reason: payload.reason ?? '' });
|
|
472
|
-
|
|
472
|
+
// 直聊门只对新建/重建的成员会话生效(session header 不可变):
|
|
473
|
+
// 已存在的成员会话需「重置会话」(reseat)后应用新门状态。
|
|
474
|
+
return {
|
|
475
|
+
project: { ...project, chatGate: gate },
|
|
476
|
+
note: gate === 'closed'
|
|
477
|
+
? '已关闭 Human 直聊:新建会话生效;已有成员会话需重置会话后生效。'
|
|
478
|
+
: '已开启 Human 直聊:新建会话生效;已有成员会话需重置会话后生效。',
|
|
479
|
+
};
|
|
473
480
|
}
|
|
474
481
|
|
|
475
482
|
// P4:项目归档(软删)——账本 append-only 纪律下不可物理删除;archived
|
|
@@ -98,6 +98,11 @@ export class MemberRuntime {
|
|
|
98
98
|
this.preset = options.preset ?? null;
|
|
99
99
|
this.agentPresets = options.agentPresets ?? null;
|
|
100
100
|
this.direct = options.direct === true;
|
|
101
|
+
// chatGate 门:Human 对话开启时成员会话不带 parentSession(宿主放行
|
|
102
|
+
// Human 直聊);关闭时带 parentSession(宿主 hasApiSessionSubagentOwner
|
|
103
|
+
// 判定 subagent-owned → 拒绝 Human 输入)。仅对**新建**会话生效,
|
|
104
|
+
// 已存在会话的 header 不可变,需重置会话(reseat)后应用新门状态。
|
|
105
|
+
this.allowHumanWrite = options.allowHumanWrite === true;
|
|
101
106
|
// Cold resumes produce AgentHandles the caller does not store; the owner
|
|
102
107
|
// tracks them here so teardown can dispose every member activation.
|
|
103
108
|
this.trackHandle = typeof options.trackHandle === 'function' ? options.trackHandle : null;
|
|
@@ -184,9 +189,11 @@ export class MemberRuntime {
|
|
|
184
189
|
parentAgent: this.parent,
|
|
185
190
|
meta: {
|
|
186
191
|
cwd: member.workspace ?? this.cwd,
|
|
187
|
-
parentSession
|
|
188
|
-
//
|
|
189
|
-
//
|
|
192
|
+
// Human 对话门:open 时不带 parentSession(宿主放行 Human 直聊);
|
|
193
|
+
// closed 时带 parentSession(hasApiSessionSubagentOwner 判定
|
|
194
|
+
// subagent-owned → Human 输入被 session/agent-busy 拒绝)。
|
|
195
|
+
// 驱动仍靠 agents.resume(parentAgent),不依赖该 header。
|
|
196
|
+
...(this.allowHumanWrite ? {} : { parentSession: this.parent.id }),
|
|
190
197
|
delegationDepth: 1,
|
|
191
198
|
...(preset ? { agentPreset: preset } : {}),
|
|
192
199
|
},
|
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.79",
|
|
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",
|