Repository navigation
Releases
Releases · taxueseek/dsh-models
v0.1.4 — 虚拟化模型列表 + dim 刷新节流
v0.1.4
模型列表虚拟化 + dim 刷新节流,两项都是在本机实测驱动的改进。
性能
- 模型列表虚拟化 — 弹窗只挂载视口附近的行(线上 310 行里 ~13 行),用两个占位 div 撑开保持总高与滚动条精确。线上实测:开门 58.7 → 23.5ms(中位),310 → 13 行挂载,5506 → 1170 DOM 节点;真实浏览器 bench:整轮交互累计渲染 243 → 65ms
- 键盘光标滚动窗口而非 DOM — ensureRowVisible 从布局算目标偏移,与光标移动同 commit 发布,光标行立即挂载
- 电梯不读 DOM — 楼层来自布局预计算偏移,不再每 scroll tick 读 offsetTop
- dim 刷新 60s → 10min — 模型目录以天为单位更新,60s 重跑两个子命令(仅 provider list 就 ~10MB JSON)是浪费。新模型发现从 1 分钟缩短到 10 分钟,宿主每分钟省 ~1.5s CPU
修复
- readPrefsLocal 是唯一未守卫的 localStorage 读取,隐私模式/配额满时会把选择器和设置卡片一起带崩。已包裹
- 零防抖搜索框 通过 effect 提交,每次按键多一次渲染。改为在 change handler 里直接提交
- reasoning.efforts 被假定为一定存在,模型带 reasoning 但无该数组时弹窗崩溃。已守卫
测试
scripts/interaction.mjs:30 → 42 项。新增虚拟列表 section,挂载 288 模型目录,驱动窗口大小、占位数学、钉住组头、电梯高亮、光标跟随 30 次方向键和 End、搜索、子代理弹窗窗口scripts/perf.mjs:MP_VIRTUAL=1 在 jsdom 下跑窗口化路径,本地对比用
安装
curl -fsSL https://raw.githubusercontent.com/taxueseek/dsh-models/main/install.sh | sh重启 dsh web 生效。
兼容性
- Harness ≥ 0.2.0-rc.1(0.2.0-rc.2 实测,0.2.1-alpha.3 在跑)
- Node.js ≥ 22.19
v0.1.4 (English)
Virtualized model list + dim refresh throttle, both driven by live measurement on this machine.
Performance
- Virtualized model list — the popup mounts only the rows around the viewport (~13 of 310 live) and pads the rest with two spacer divs. Measured live: open 58.7 → 23.5ms median, 310 → 13 rows mounted, 5506 → 1170 DOM nodes; real-browser bench: cumulative React render 243 → 65ms
- Keyboard cursor scrolls the window, not the DOM — ensureRowVisible computes the target offset from the layout and publishes it in the same commit as the cursor move
- Elevator reads no DOM — floors come from the layout's precomputed offsets instead of offsetTop per scroll tick
- dim refresh 60s → 10min — a model catalog that turns over in days no longer costs ~1.5s of CPU per minute
Fixed
- readPrefsLocal was the one unguarded localStorage read. Wrapped like the rest
- Zero-debounce search boxes committed through an effect. The commit now happens in the change handler itself
- reasoning.efforts was assumed to exist. Guarded like the other optional reads
Tests
scripts/interaction.mjs: 30 → 42. Adds a virtual-list section that mounts a 288-model directoryscripts/perf.mjs: MP_VIRTUAL=1 stubs the viewport so the windowed path runs under jsdom
Install
curl -fsSL https://raw.githubusercontent.com/taxueseek/dsh-models/main/install.sh | shRestart dsh web to take effect.
Compatibility
- Harness ≥ 0.2.0-rc.1 (0.2.0-rc.2 measured, 0.2.1-alpha.3 running)
- Node.js ≥ 22.19
v0.1.2 — 性能、可靠性与测试
v0.1.2
v0.1.0 之后的两个版本(0.1.1 性能与可靠性、0.1.2 测试与冷启动),一并发布。
性能与可靠性
- 冷启动不阻塞 — 模型目录冷缓存先回快 503,重建放后台跑(实测首次响应 ~3ms,~3 秒内暖到 200);客户端退避重试,价格徽章一落地就出现。暖缓存走 stale-while-revalidate
- 行重渲风暴消除 — 回调稳定化 + 派生列表 memo 化:方向键一次从重渲全部 ~306 行降到 2 行(≈153×),按键过滤从 ~1124 行降到 ~258 行
- 修复一串可靠性问题 — 500「inactive context」僵尸路由、collect 失败风暴(失败 30s 冷却)、子代理路由随会话泄漏、滚动监听报错、子代理选择不落库、双响应未处理 rejection
测试
npm test— 两套纯 Node 测试共 44 项:host-route.mjs驱动真实路由处理器(事实缓存、子代理路由、错误守卫),interaction.mjs在 jsdom 里渲染选择器并驱动打开/搜索/收藏/强度。宿主 peer 依赖缺失时自动 SKIP,任何机器上都是绿的
安装
curl -fsSL https://raw.githubusercontent.com/taxueseek/dsh-models/main/install.sh | sh重启 dsh web 生效。
兼容性
- Harness ≥ 0.2.0-rc.1(0.2.0-rc.2 实测,0.2.1-alpha.3 在跑)
- Node.js ≥ 22.19
v0.1.0 — 首个正式发布
v0.1.0
dsh-models 首个正式发布。从 ttmouse/dsh-model-picker v1.18.0 分支,更名并增强。
新功能
- 三区触发按钮 — 模型名 / 子代理图标 / 推理强度,一个模型座三个弹窗
- 子代理模型路由 — 按会话覆盖 depth ≥ 1 的子代理模型
- 推理层级选择器 — Off / Low / High / Max 四档切换
- dim 目录桥接 — 检测 dim CLI 时自动合并模型目录与价格徽章
- 设置页「模型选择」卡片 — 发现开关、忽略/恢复、隐藏模型管理
- 中英双语 — 界面随 DSH locale 切换
- 自定义背景色 — 支持主题适配
安装
curl -fsSL https://raw.githubusercontent.com/taxueseek/dsh-models/main/install.sh | sh重启 dsh web 生效。
兼容性
- Harness ≥ 0.2.0-rc.1(实测 0.2.0-rc.2)
- Node.js ≥ 22.19
上游
基于 ttmouse/dsh-model-picker v1.18.0 (MIT)。路由与存储键保留上游命名,旧偏好无缝迁移。