@suifei/dsh-ai-team 0.4.78 → 0.4.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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * SubagentRuntime 的 provider 注册探测。
3
+ *
4
+ * 实机事故(issue #1 借楼报):桌面 DSH 0.2.2-rc.2 的 SubagentRuntime 移除了
5
+ * `list()`(rc.1 还有,返回 providers.keys()),插件用
6
+ * `typeof subagents.list === 'function' ? subagents.list() : []` 判空,把
7
+ * **能力缺失当成了状态为空**——成员激活恒 503、唤醒静默 return,日志里什么都不留。
8
+ *
9
+ * 泛化规则:探测型代码不得把「问不到」当成「没有」。问不到时放行,让真正的调用
10
+ * (startActivation)产生带原因的失败,再记录它。
11
+ */
12
+
13
+ /**
14
+ * @returns {'no-service'|'unknown'|'empty'|'ready'}
15
+ * no-service — subagents 服务本身不存在(调用方自会走既有的 E_RUNTIME_UNAVAILABLE);
16
+ * unknown — 宿主没有 list() 这个自省方法(rc.2+),无法判断,视为放行;
17
+ * empty — 确认还没有 provider 注册;
18
+ * ready — 至少一个 provider。
19
+ */
20
+ export function probeProviderRegistration(subagents) {
21
+ if (subagents === undefined || subagents === null) return 'no-service';
22
+ if (typeof subagents.list !== 'function') return 'unknown';
23
+ let providers;
24
+ try {
25
+ providers = subagents.list();
26
+ } catch {
27
+ return 'unknown';
28
+ }
29
+ return Array.isArray(providers) && providers.length > 0 ? 'ready' : 'empty';
30
+ }
31
+
32
+ /** 探测结果是否应挡住激活/唤醒(只有确认 empty 才挡)。 */
33
+ export function blocksActivation(state) {
34
+ return state === 'empty';
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.4.78",
3
+ "version": "0.4.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",