@suifei/dsh-ai-team 0.4.45 → 0.4.46

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.46 - 2026-11-12
4
+
5
+ **SDK 符合性核对(用 cordis_inspect 读运行时契约)+ 修复预设名解析**
6
+
7
+ 用 `cordis_inspect` 直接读宿主服务签名(比文档更权威),逐个核对了插件最近改动里用到的 API:
8
+
9
+ | 调用 | 契约 | 结论 |
10
+ |---|---|---|
11
+ | `subagents.startActivation({ provider, label, request: { cwd, agentPreset, prompt, parent, agentOptions }, signal, delivery })` | `SubagentActivationSpec` / `SubagentStartRequest` | ✅ 一致 |
12
+ | `subagents.sendMessage(parent, sessionId, content, { signal })` | `content: ContentBlock[]` | ✅ 一致(`wake` 里已构造内容块数组) |
13
+ | `agents.resume({ resumeSessionId, parentAgent, setup? })` | `ResumeAgentOptions` | ✅ 一致 |
14
+ | 冷恢复后 `handle.agent.followup(message)` | loop 的 `followup(input)` → `send(input,'next-turn',true)` | ✅ 存在(且已用 `typeof` 守卫) |
15
+ | `workspace.attachSession(sessionId)` | `Workspace` 方法 | ✅ 一致 |
16
+ | `workspaceRegistry.resolveByPath / create` | 同名方法 | ✅ 一致 |
17
+ | `skills.registerProvider(factory)` → disposer | 返回 disposer,无 invalidate | ✅ 一致(0.4.36 已按此收敛) |
18
+ | **`permissionPresets.list()`** | **不存在**;目录是 `catalog()` → `{ options: [{ value, name }] }` | ❌ **0.4.30 的「预设名可配置」实际从未生效** |
19
+
20
+ 修复:`resolveTeamPreset` 改读 `catalog().options[].value`(`list()` 仅作兼容回退)。此前一直走回退分支,部署方把 `danger-full-access` 改名时仍然会抛错、guard 仍会拒绝成员的每次工具调用。
21
+
22
+ - 测试:`node --test` **244 通过 / 1 跳过**;`permission-guard` 的夹具同步改为真实 `catalog()` 契约。
23
+
3
24
  ## 0.4.45 - 2026-11-12
4
25
 
5
26
  **批 13:退役与激活并发、job 列表回读**
@@ -17,10 +17,21 @@ export function resolveTeamPreset(permissionPresets) {
17
17
  try { return permissionPresets?.resolve?.(name)?.sandbox ?? null; } catch { return null; }
18
18
  };
19
19
  if (sandboxOf(TEAM_PERMISSION) === TEAM_PERMISSION) return TEAM_PERMISSION;
20
- let entries = [];
21
- try { entries = permissionPresets?.list?.() ?? []; } catch { entries = []; }
22
- for (const entry of Array.isArray(entries) ? entries : []) {
23
- const name = typeof entry === 'string' ? entry : (entry?.name ?? entry?.id);
20
+ // 真实契约里没有 `list()`(用 cordis_inspect 核对过 service 签名):
21
+ // 目录是 `catalog()` → `{ options: PresetOption[], defaultOptions, defaultPreset }`,
22
+ // 每个 option 的 key 在 `value` 上。按 `list()` 读会永远拿不到候选,
23
+ // 于是「预设名可配置」这条修复静默失效。
24
+ let options = [];
25
+ try {
26
+ options = permissionPresets?.catalog?.()?.options ?? [];
27
+ } catch {
28
+ options = [];
29
+ }
30
+ if (!Array.isArray(options) || options.length === 0) {
31
+ try { options = permissionPresets?.list?.() ?? []; } catch { options = []; }
32
+ }
33
+ for (const entry of Array.isArray(options) ? options : []) {
34
+ const name = typeof entry === 'string' ? entry : (entry?.value ?? entry?.name ?? entry?.id);
24
35
  if (typeof name !== 'string' || name === '') continue;
25
36
  if (sandboxOf(name) === TEAM_PERMISSION) return name;
26
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.4.45",
3
+ "version": "0.4.46",
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",