dsh-cindy-host 0.1.20 → 0.1.21

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
@@ -3,6 +3,20 @@
3
3
  本文件记录**用户可见**的变化与**每次发布验证过的 DSH 版本**。格式遵循
4
4
  [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。
5
5
 
6
+ ## [0.1.21] - 2026-10-02
7
+
8
+ ### Fixed
9
+
10
+ - 修复桌面供应商目录上线后手机模型选择器为空:`maker:provider:list` 为每个已广告的 DSH agent 别名补齐 `routing[agent]: {}` 可用性标记。仍只由 DSH catalog 决定 connected 和模型清单,不发送 endpoint、认证信息或 headers,不臆造 wireProtocol。
11
+ - 补充投影/通道回归与可选的真实 Cindy registry、分段列表、统一选择器跨仓契约测试;设置 `CINDY_SOURCE_ROOT` 后运行 `node --test test/host-models-cindy-contract.test.js`(需支持 registerHooks/TypeScript stripping 的 Node)。覆盖旧响应复现空列表、新建/已有会话、多来源、不可连接/禁用 runtime 和目录读取失败。
12
+ - 运行期补证:当前 DSH `buildModelCatalog` 不输出 `contextWindow`,旧投影把所有缺失窗口的模型丢弃,导致能力列表有模型而 provider 列表为空。缺失/无效窗口现在以 `0` 表示未知展示容量,不作为模型准入条件;跨仓测试改为真实的无窗口目录结构。
13
+
14
+ ### 验证
15
+
16
+ - 完整单元与契约测试:**759 通过 / 1 跳过 / 0 失败**,包含真实 Cindy 消费端及无 contextWindow 的 DSH 目录结构。
17
+ - 运行中的 desktop Host 返回 **2 个供应商 / 7 个模型**;真实 HTTP 响应经过 Cindy 新建/已有会话筛选均得到 7 个可选项。用户已确认手机端模型列表恢复。
18
+ - 保留桌面供应商目录和真实 DSH 模型路由;不增加客户端专用模型表。
19
+
6
20
  ## [0.1.20] - 2026-10-01
7
21
 
8
22
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cindy-host",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "private": false,
5
5
  "description": "Cindy 手机客户端连接 DSH 的 Host 侧插件:会话/消息/审批/todo/goal 的手机通道,以及配套的设置卡片",
6
6
  "license": "MIT",
@@ -160,7 +160,7 @@ export function toPermissionOptions(names) {
160
160
  }
161
161
 
162
162
  /**
163
- * Project DSH's provider-grouped catalog into Cindy desktop's ProviderView wire shape.
163
+ * Project DSH's provider-grouped catalog into Cindy desktop/mobile ProviderView wire shape.
164
164
  * Routing credentials never cross this boundary; every Cindy harness alias reaches the
165
165
  * same DSH catalog, so each provider exposes the same models under all aliases.
166
166
  */
@@ -173,8 +173,11 @@ export function toProviderList(catalog, agentKinds = []) {
173
173
  const models = [];
174
174
  for (const model of Array.isArray(group.models) ? group.models : []) {
175
175
  if (typeof model?.id !== 'string' || model.id === '') continue;
176
- const contextWindow = Number(model.contextWindow);
177
- if (!Number.isFinite(contextWindow) || contextWindow <= 0) continue;
176
+ // Current DSH catalogs omit contextWindow. It is display metadata, not
177
+ // route eligibility: 0 means unknown in Cindy and hides the capacity label.
178
+ // Never discard a routable model or invent a positive capacity for it.
179
+ const window = Number(model.contextWindow);
180
+ const contextWindow = Number.isFinite(window) && window > 0 ? window : 0;
178
181
  const efforts = Array.isArray(model?.reasoning?.efforts)
179
182
  ? model.reasoning.efforts.map((effort) => effort?.id).filter((id) => typeof id === 'string' && id !== '')
180
183
  : [];
@@ -198,6 +201,10 @@ export function toProviderList(catalog, agentKinds = []) {
198
201
  name: typeof group.name === 'string' && group.name !== '' ? group.name : group.id,
199
202
  agents,
200
203
  connected: routable.has(group.id),
204
+ // Cindy registry requires routing[agent] to exist before a runtime is selectable.
205
+ // Empty markers advertise our aliases without inventing a wire protocol or
206
+ // exposing DSH execution details (endpoints, credentials, or headers).
207
+ routing: Object.fromEntries(agents.map((agent) => [agent, {}])),
201
208
  models: Object.fromEntries(agents.map((agent) => [agent, models.map((model) => ({ ...model }))])),
202
209
  });
203
210
  }