@suifei/dsh-ai-team 0.3.80 → 0.3.82

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.
@@ -98,11 +98,6 @@ 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;
106
101
  // Cold resumes produce AgentHandles the caller does not store; the owner
107
102
  // tracks them here so teardown can dispose every member activation.
108
103
  this.trackHandle = typeof options.trackHandle === 'function' ? options.trackHandle : null;
@@ -189,11 +184,7 @@ export class MemberRuntime {
189
184
  parentAgent: this.parent,
190
185
  meta: {
191
186
  cwd: member.workspace ?? this.cwd,
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 }),
187
+ parentSession: this.parent.id,
197
188
  delegationDepth: 1,
198
189
  ...(preset ? { agentPreset: preset } : {}),
199
190
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.3.80",
3
+ "version": "0.3.82",
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",
@@ -1,38 +0,0 @@
1
- /**
2
- * chatGate 自动收敛规划(纯函数,便于测试):
3
- * 项目「Human 对话」开关变更后,成员会话的 header(是否带 parentSession)
4
- * 在创建时固定,必须重建会话才能让新门状态生效。本函数决定本轮应该重建
5
- * 哪些成员:
6
- * - 只挑**空闲**成员(live agent 状态不是 running / 或会话已冷)——绝不打断
7
- * 进行中的回合;
8
- * - 每轮最多 `limit` 个,渐进收敛,避免 6 个成员同时激活造成回合风暴;
9
- * - 忙碌成员不出现在 reseat 列表里,调用方保持「未收敛」状态,下轮再试。
10
- *
11
- * @param {Array<{id:string, sessionId:string|null, status?:string}>} members
12
- * @param {(sessionId:string) => string|null} liveAgentStatus 宿主 agent 状态查询(null=冷会话/已释放)
13
- * @param {{limit?:number}} [options]
14
- * @returns {{reseat: Array, busy: Array, cold: Array}}
15
- */
16
- export function planChatGateReseats(members, liveAgentStatus, options = {}) {
17
- const limit = Math.max(1, Number.isSafeInteger(options.limit) ? options.limit : 2);
18
- const reseat = [];
19
- const busy = [];
20
- const cold = [];
21
- for (const member of members) {
22
- if (member === null || member === undefined) continue;
23
- if (member.status === 'retired') continue;
24
- const sessionId = typeof member.sessionId === 'string' && member.sessionId !== '' ? member.sessionId : null;
25
- if (sessionId === null) {
26
- // 从未激活:下次激活自然读当前门状态,无需重建。
27
- cold.push(member.id);
28
- continue;
29
- }
30
- const live = liveAgentStatus(sessionId);
31
- if (live === 'running') {
32
- busy.push(member.id);
33
- continue;
34
- }
35
- reseat.push(member.id);
36
- }
37
- return { reseat: reseat.slice(0, limit), busy, cold };
38
- }