dsh-tokenlens 1.3.5 → 1.3.6

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
@@ -4,14 +4,17 @@
4
4
 
5
5
  **版本记录约定**:同一发布日只保留一个章节,标题取当日**最后一个**已发布版本号;当日多次发布的改动合并到该章节,并在标题下注明当日实际发布过的版本号(npm 上仍可安装这些独立版本)。若当日已有发布,后续小改动不再单独增加版本号,而是并入下一篇日志。这样日志按天规整、不出现同日多个小版本。
6
6
 
7
- ## 1.3.5 — 2026-11-02
7
+ ## 1.3.6 — 2026-11-02
8
+
9
+ (当日已发布版本:v1.3.5 / v1.3.6)
8
10
 
9
11
  - feat(ui): 供应商管理页可为 **Open Design** 填写「工作区 ID」并持久化到插件配置——此前 workspaceId 只能在 profile patch 或 `OPENDESIGN_WORKSPACE_ID` 里设置,用推理 Key 配好供应商后额度卡片仍报错却无处可改
10
12
  - feat(ui): Open Design 额度失败时的引导——详情弹窗的错误条说明「额度查询需要工作区 ID 与 Control Key(不是推理 Key)」,并提供「去配置」按钮直接跳到供应商管理页
11
- - feat(host): Host 侧错误文案更具体(distinguish 缺 workspaceId / 缺 Control Key,并指向管理页);`providerUpdate` 接受 `workspaceId`,校验为 1–120 位标识符字符(字母、数字、`. _ : @ -`),路径穿越/空格/超长一律拒绝
13
+ - feat(host): Host 侧错误文案更具体(区分缺 workspaceId / 缺 Control Key,并指向管理页);`providerUpdate` 接受 `workspaceId`,校验为 1–120 位标识符字符(字母、数字、`. _ : @ -`),路径穿越/空格/超长一律拒绝
12
14
  - feat(wire): `providers[]` 仅对声明了 workspace 的适配器(Open Design)下发 `workspaceId` 字段;其余供应商不下发,客户端据此决定是否渲染输入框(旧 Host 无此字段 ⇒ 不渲染,自然降级)
13
15
  - feat(ui): Open Design 缺配置时 chip 不再按 `missing-key` 静默隐藏,而是显示「待配置」并可点进详情看引导——否则用户既看不到提示也没有入口
14
- - 测试:280 → 285(workspace ID 校验/持久化/清空、管理页字段渲染与保存、缺 workspaceId 的 Host 报错与引导按钮、待配置 chip)
16
+ - fix(tool): Agent 工具 `tokenlens_usage` 的 `updateCheck` 动作此前虽在枚举里却会落到用量读取分支,返回当前供应商的用量或错误;现在正确执行更新检查并返回 `UpdateInfo`
17
+ - 测试:280 → 286(workspace ID 校验/持久化/清空、管理页字段渲染与保存、缺 workspaceId 的 Host 报错与引导按钮、待配置 chip、工具 updateCheck 分发)
15
18
 
16
19
  ## 1.3.4 — 2026-11-01
17
20
 
package/README.md CHANGED
@@ -393,7 +393,7 @@ Host 半注册 `tokenlens_usage`,参数 `action`(默认 `snapshot`)与可
393
393
 
394
394
  ## 验证
395
395
 
396
- - `node --test`:**285 个自动化用例**,覆盖 Host 数据层、供应商适配器、统计折叠、各 harness 读取、插件集成与浏览器端渲染 / 交互。
396
+ - `node --test`:**286 个自动化用例**,覆盖 Host 数据层、供应商适配器、统计折叠、各 harness 读取、插件集成与浏览器端渲染 / 交互。
397
397
  - 在真实环境中验证过 **5 个 harness** 的数据源;本机统计与独立的 SQLite 查询、独立的日志解析逐项对账(差额为 0),跨 harness 合并与供应商映射算术自洽。
398
398
  - 供应商接口按各官方文档与参考客户端行为验证;未配置凭据时 chip 静默隐藏,接口异常时按可重试错误降级。
399
399
 
package/index.js CHANGED
@@ -76,7 +76,7 @@ export const inject = []
76
76
  export const PLUGIN_NAME = 'dsh-tokenlens'
77
77
 
78
78
  /** Plugin version; mirrors package.json (kept here so diagnostics need no fs read). */
79
- export const PLUGIN_VERSION = '1.3.5'
79
+ export const PLUGIN_VERSION = '1.3.6'
80
80
 
81
81
  /** Documented defaults; every field of the raw row config is optional. */
82
82
  const DEFAULTS = {
@@ -1861,6 +1861,10 @@ export function apply(ctx, rawConfig) {
1861
1861
  : activeProviderId()
1862
1862
  if (action === 'diagnostics') return jsonSafe({ ok: true, diagnostics: diagnostics() })
1863
1863
  if (action === 'stats') return jsonSafe(await getStats())
1864
+ // v1.3.5 fix: `updateCheck` is in TOOL_ACTIONS, so it must dispatch to
1865
+ // the registry check instead of falling through to a usage read (which
1866
+ // used to answer the active provider's error instead of UpdateInfo).
1867
+ if (action === 'updateCheck') return jsonSafe({ ok: true, update: await runUpdateCheck() })
1864
1868
  if (action === 'refresh') return jsonSafe(await get(providerId, { force: true }))
1865
1869
  return jsonSafe(await get(providerId))
1866
1870
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenlens",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "type": "module",
5
5
  "description": "dsh-TokenLens (词元透镜) — provider-aware plan capacity plus local token statistics (today/7d/30d/all-time, by harness/provider/model/workspace) for DSH.",
6
6
  "license": "MIT",