dsh-subagent-default-model 1.1.1 → 1.2.0

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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 (2026-09-01)
4
+
5
+ ### Features
6
+
7
+ - **适配 DSH 0.1.2 客户端模型目录接口**:设置卡模型目录从已移除的 `connection.api.llm.models()` 迁移到 `remote.session.modelCatalog()`,继续支持供应商、模型与推理强度下拉选择。
8
+ - **设置卡正常路径回归测试**:新增真实 Client bundle 沙箱测试,验证 `settings.plugin.item` 注册、`subagent-default-model` key、Client inject 声明以及 `modelCatalog()` 成功响应解析。
9
+
10
+ ### Fixes
11
+
12
+ - **恢复插件设置卡显示**:补齐 Client bundle 依赖声明,并将设置卡的运行时服务依赖调整为 `remote.session`,避免旧 API 导致 Plugins 标签页渲染失败。
13
+ - **设置注册不再等待 subagents 服务**:Host 设置 namespace 独立注册;`subagents` 服务出现后再安装默认模型包装器,避免服务挂载顺序导致设置卡消失。
14
+ - **刷新设置 namespace 目录**:Client 卡片注册后主动刷新 `settingsScope.describe()`,避免社区插件晚注册时被设置页初次读取遗漏。
15
+ - **适配 `uiConversation` 服务名**:轨迹和对话模型提示改用 DSH 0.1.2 的 `uiConversation.events` 注册入口。
16
+
17
+ ### Compatibility
18
+
19
+ - 扩展 `@deepseek-ai/*` peer 范围以覆盖 DSH `0.1.2-alpha.1`,Client peer 均保持 optional,不阻塞独立安装。
20
+
3
21
  ## 1.1.1 (2026-08-31)
4
22
 
5
23
  ### Changed
package/lib/client.js CHANGED
@@ -408,10 +408,20 @@ window.__ModuleLoader__.load({
408
408
  }
409
409
 
410
410
  // ── apply: inject settings row ───────────────────────────────────────
411
- var inject = ["sessions", "connection", "slots", "locale", "settingsScope", "remote", "conversationEvents"];
411
+ var inject = ["slots", "locale", "settingsScope", "remote", "remote.session", "uiConversation"];
412
412
 
413
413
  function apply(ctx) {
414
- var api = ctx.connection.api;
414
+ // The old `connection.api.llm.models()` seat no longer exists. Resolve
415
+ // the current model-catalog remote defensively so a missing/changed seat
416
+ // degrades to an empty selector instead of crashing the Plugins tab.
417
+ var sessionRemote = typeof ctx.get === "function" ? ctx.get("remote.session") : undefined;
418
+ var loadCatalog = function () {
419
+ if (!sessionRemote || typeof sessionRemote.modelCatalog !== "function") return Promise.resolve([]);
420
+ return sessionRemote.modelCatalog().then(function (response) {
421
+ if (!response || !response.ok) return [];
422
+ return (response.value && response.value.groups) || [];
423
+ }).catch(function () { return []; });
424
+ };
415
425
 
416
426
  // Register locale for this component
417
427
  ctx.locale.register(SUBAGENT_ROW_LOCALE, "zh", SUBAGENT_ROW_ZH);
@@ -422,7 +432,7 @@ window.__ModuleLoader__.load({
422
432
  // the provider or model changes — failover switches trigger it with zero
423
433
  // host changes. Register a trajectory definition that renders that frame
424
434
  // as a compact "Current provider/model" row inside the subagent's trajectory view.
425
- if (ctx.conversationEvents && typeof ctx.conversationEvents.register === "function") {
435
+ if (ctx.uiConversation && ctx.uiConversation.events && typeof ctx.uiConversation.events.register === "function") {
426
436
  var trajectoryT = ctx.locale.bind(SUBAGENT_ROW_LOCALE);
427
437
  var modelContextDefinition = {
428
438
  kind: "trajectory-subagent-model",
@@ -456,7 +466,7 @@ window.__ModuleLoader__.load({
456
466
  };
457
467
  }
458
468
  };
459
- ctx.conversationEvents.register(modelContextDefinition);
469
+ ctx.uiConversation.events.register(modelContextDefinition);
460
470
 
461
471
  // ── chat: surface the subagent model in the conversation view ──
462
472
  // agent-loop writes a `request/header` frame with a `reason` the first
@@ -509,19 +519,14 @@ window.__ModuleLoader__.load({
509
519
  };
510
520
  }
511
521
  };
512
- ctx.conversationEvents.register(chatModelDefinition);
522
+ ctx.uiConversation.events.register(chatModelDefinition);
513
523
  }
514
524
 
515
525
  var subagentScope = ctx.settingsScope.bind({ namespace: SUBAGENT_MODEL_SETTINGS_NS });
516
526
  var subagentRowInjected = function () {
517
527
  return {
518
528
  settingsScope: subagentScope,
519
- loadCatalog: function () {
520
- return api.llm.models({}).then(function (r) {
521
- if (!r.result.ok) throw new Error("llm.models failed: " + r.result.error.code);
522
- return r.result.value.groups || [];
523
- });
524
- },
529
+ loadCatalog: loadCatalog,
525
530
  write: function (value) {
526
531
  return persistDefaultModels(subagentScope, value);
527
532
  }
@@ -536,6 +541,12 @@ window.__ModuleLoader__.load({
536
541
  inject: subagentRowInjected
537
542
  }, SubagentModelCard);
538
543
  });
544
+
545
+ // The Plugins tab renders the intersection of registered cards and the
546
+ // Host settings namespace directory. Community Host plugins can finish
547
+ // registration after the core mirror's first read; force one fresh read
548
+ // after claiming our card so `subagent-default-model` becomes active.
549
+ ctx.settingsScope.describe().load();
539
550
  }
540
551
 
541
552
  return { apply: apply, inject: inject };
package/lib/index.js CHANGED
@@ -38,7 +38,9 @@ import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-sett
38
38
  */
39
39
 
40
40
  export const name = "dsh-subagent-default-model";
41
- export const inject = ["subagents"];
41
+ // Do not hard-inject `subagents` at the plugin root: DSH 0.1.2 may mount that
42
+ // service after this row. The settings section must become available
43
+ // independently; `apply()` attaches the service wrapper through `ctx.inject()`.
42
44
 
43
45
  /** Settings namespace: default model route for subagent runs without an explicit `agentOptions`. */
44
46
  const SUBAGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE = settingsNamespace("subagent-default-model");
@@ -246,29 +248,7 @@ function installFailover(ctx, state) {
246
248
  }, "dsh-subagent-default-model: failover listeners");
247
249
  }
248
250
 
249
- export function apply(ctx) {
250
- const state = {
251
- settingsSource: void 0,
252
- rrCursor: 0
253
- };
254
-
255
- // The settings seam owns its own injected lifecycle and provides a live
256
- // source thunk. Register it unconditionally so the web settings row
257
- // (`subagent-default-model` namespace) is available even when the host
258
- // `subagents` service is not yet mounted or a previous fiber already wrapped
259
- // it — the service-method guard below must never gate settings registration.
260
- installSettingsSection(ctx, SUBAGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE, SUBAGENT_DEFAULT_MODEL_SETTINGS_SCHEMA, {}, {
261
- setSource: (current) => {
262
- state.settingsSource = current;
263
- },
264
- onChange: () => {}
265
- });
266
-
267
- // Subagent-only failover hooks the agent loop, not the subagents service,
268
- // so it is installed unconditionally: listeners no-op when the `failover`
269
- // section is absent/disabled or when the failing agent is the main loop.
270
- installFailover(ctx, state);
271
-
251
+ function installSubagentWrapper(ctx, state) {
272
252
  // `ctx.subagents` is a per-call Cordis traceable proxy, so reach the raw
273
253
  // service object behind it for a stable handle and to install own methods.
274
254
  const raw = ctx.subagents?.[Symbol.for("cordis.original")] ?? ctx.subagents;
@@ -300,6 +280,38 @@ export function apply(ctx) {
300
280
  if (wrappedStart !== void 0 && raw.start === wrappedStart) raw.start = originalStart;
301
281
  if (wrappedStartContinuable !== void 0 && raw.startContinuable === wrappedStartContinuable) raw.startContinuable = originalStartContinuable;
302
282
  if (raw[WRAPPED] === state) delete raw[WRAPPED];
283
+ });
284
+ }
285
+
286
+ export function apply(ctx) {
287
+ const state = {
288
+ settingsSource: void 0,
289
+ rrCursor: 0
290
+ };
291
+
292
+ // Register settings independently from the `subagents` service lifecycle.
293
+ // DSH 0.1.2 can mount that service later or in a different service wave; a
294
+ // root-level hard inject would otherwise keep this whole plugin waiting and
295
+ // hide its settings card even though the Client half is already registered.
296
+ installSettingsSection(ctx, SUBAGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE, SUBAGENT_DEFAULT_MODEL_SETTINGS_SCHEMA, {}, {
297
+ setSource: (current) => {
298
+ state.settingsSource = current;
299
+ },
300
+ onChange: () => {}
301
+ });
302
+
303
+ // Subagent-only failover hooks the agent loop, not the subagents service,
304
+ // so it is installed unconditionally: listeners no-op when the `failover`
305
+ // section is absent/disabled or when the failing agent is the main loop.
306
+ installFailover(ctx, state);
307
+
308
+ // Attach the method wrapper only while the service exists. Cordis re-runs
309
+ // this child fiber if the provider is replaced, while settings stay served.
310
+ ctx.inject(["subagents"], (subagentCtx) => {
311
+ installSubagentWrapper(subagentCtx, state);
312
+ });
313
+
314
+ ctx.effect(() => () => {
303
315
  state.settingsSource = void 0;
304
316
  state.rrCursor = 0;
305
317
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-default-model",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Configure default model routes for DeepSeek Harness subagents, with single-model, round-robin, random, and per-route reasoning-effort options.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -55,7 +55,12 @@
55
55
  "client": {
56
56
  "platform": "web",
57
57
  "inject": [
58
- "@deepseek-ai/dsh-client-ui-primitives"
58
+ "@deepseek-ai/dsh-client-connection",
59
+ "@deepseek-ai/dsh-client-locale",
60
+ "@deepseek-ai/dsh-client-ui-slots",
61
+ "@deepseek-ai/dsh-client-ui-primitives",
62
+ "@deepseek-ai/dsh-client-ui-conversation",
63
+ "@deepseek-ai/dsh-client-ui-settings"
59
64
  ]
60
65
  }
61
66
  },
@@ -63,13 +68,33 @@
63
68
  "@deepseek-ai/schemastery": "^3.18.1"
64
69
  },
65
70
  "peerDependencies": {
66
- "@deepseek-ai/dsh-settings": "0.1.0-rc.6",
67
- "@deepseek-ai/dsh-subagent": "0.1.0-rc.6",
68
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6"
71
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
72
+ "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
73
+ "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
74
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
75
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
76
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
77
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0",
78
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0"
69
79
  },
70
80
  "peerDependenciesMeta": {
81
+ "@deepseek-ai/dsh-client-connection": {
82
+ "optional": true
83
+ },
84
+ "@deepseek-ai/dsh-client-locale": {
85
+ "optional": true
86
+ },
87
+ "@deepseek-ai/dsh-client-ui-slots": {
88
+ "optional": true
89
+ },
71
90
  "@deepseek-ai/dsh-client-ui-primitives": {
72
91
  "optional": true
92
+ },
93
+ "@deepseek-ai/dsh-client-ui-conversation": {
94
+ "optional": true
95
+ },
96
+ "@deepseek-ai/dsh-client-ui-settings": {
97
+ "optional": true
73
98
  }
74
99
  },
75
100
  "devDependencies": {