dsh-model-health 0.2.2 → 0.2.5

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/README.md CHANGED
@@ -23,7 +23,7 @@ dsh plugin --profile web add dsh-model-health
23
23
  git clone https://github.com/oxlyn/dsh-model-health.git
24
24
  cd dsh-model-health
25
25
  pnpm install
26
- pnpm run build # tsc → dist/index.js (pure ESM) + dist/client.js
26
+ pnpm run build # tsdown → dist/index.js (ESM) + dist/client.js (IIFE)
27
27
 
28
28
  # 在插件的父目录执行(dsh plugin add 的相对路径锚定调用目录):
29
29
  cd ..
@@ -47,7 +47,7 @@ dsh --profile web --dump-config | grep dsh-model-health # 配置层含本行
47
47
  | # | 形式 | 入口 | 说明 |
48
48
  |---|------|------|------|
49
49
  | 1 | 「模型健康」面板 | Web UI → 设置 → 模型健康 | React 表格:Provider / 模型 ID / 名称 / 上下文窗口 / 最大输出 / 输入模态 / API 协议 / BaseURL,可选列可切换显示 |
50
- | 2 | 测试全部 | 面板内「测试全部」按钮 | 并发(上限 6)对每个模型发一次 `max_tokens=1` 的最小 chat completions 请求,10s 超时;逐行显示 可用 / 不可用 / 跳过 / 延迟,失败原因悬停查看,结果持久化到 localStorage |
50
+ | 2 | 测试全部 | 面板内「测试全部」按钮 | 并发(上限 6)对每个模型发一次 `max_tokens=1` 的最小 chat completions 请求,10s 超时;逐行显示 可用 / 不可用 / 跳过 / 延迟,失败原因悬停查看,结果持久化到 localStorage。已出结果的徽章可点击,单独重测该模型(悬停显示下划线) |
51
51
  | 3 | Tool 插件 `list_models` | 对话中调用 | 返回 Markdown 表格,供模型在对话中查看模型清单 |
52
52
 
53
53
  **特性一览:**
@@ -56,6 +56,7 @@ dsh --profile web --dump-config | grep dsh-model-health # 配置层含本行
56
56
  - 可用性测试支持 `openai-completions` 与 `deepseek` 协议,其余协议自动标记「跳过」
57
57
  - API Key 通过 DSH credential service(`ctx.credentials.resolve`)解析,密钥不会输出到浏览器
58
58
  - 测试结果(状态/延迟/错误)持久化到 localStorage,刷新页面后仍可见
59
+ - 状态列的 可用 / 不可用 / 跳过 徽章随时可点击,对单个模型重新测试,原地刷新状态与延迟
59
60
 
60
61
  ## 实现方式 / How it works
61
62
 
@@ -70,7 +71,7 @@ dsh --profile web --dump-config | grep dsh-model-health # 配置层含本行
70
71
  │ - 解析 DSH credential service 获取 API Key │
71
72
  └──────────────────────────────────────────────────────────────────┘
72
73
  │ fetch
73
- ┌─ client 侧 src/client.js(浏览器端模块)──────────────────────────┐
74
+ ┌─ client 侧 src/client.tsx(TSX,浏览器端模块)────────────────────┐
74
75
  │ - 通过 settings.section slot 注入「模型健康」面板 │
75
76
  │ - React(宿主提供)渲染表格 + 状态徽章 + hover 错误提示 │
76
77
  │ - 「测试全部」:worker pool 限并发 6,逐个更新行状态 │
@@ -96,10 +97,14 @@ pnpm run build # 构建 dist/
96
97
 
97
98
  ```
98
99
  dsh-model-health/
99
- ├── src/index.ts # host 侧:tool + HTTP 路由
100
- ├── src/client.js # client 侧:设置页面板(浏览器模块)
101
- ├── cordis.patch.yml # bundle 层声明(id/name 走包名解析)
102
- └── dist/ # 构建产物(发布包含在 files 字段中)
100
+ ├── src/index.ts # host 入口:tool + HTTP 路由接线
101
+ ├── src/host/ # host 实现:config / models / markdown / http / model-test
102
+ ├── src/client.tsx # client 入口壳:注入 React,装配插件导出
103
+ ├── src/client/ # client 实现:types / runtime / i18n / storage / api /
104
+ │ # styles / columns / use-test-results / apply
105
+ │ └── components/ # ModelListSection / StatusCell / ErrorTooltip
106
+ ├── cordis.patch.yml # bundle 层声明(id/name 走包名解析)
107
+ └── dist/ # 构建产物(发布包含在 files 字段中)
103
108
  ```
104
109
 
105
110
  ## 依赖锁定 / Dependencies