Skip to content

v0.4.0 — 把 WorkBuddy2API 网关的模型目录自动同步进 DeepSeek Harness

Choose a tag to compare

@che246 che246 released this 19 Oct 13:14
· 3 commits to main since this release

v0.4.0

面板上可以选模型了:每条路由卡里多一个「模型选择」,勾选哪些模型要接进 DSH。

新增:模型选择

  • 每张路由卡里一个可折叠的 「模型选择(启用 N / 共 M)」,展开后逐个列出网关返回的模型
  • 勾选 = 启用;行尾标出要点:上下文 / 思考档 / 可关思考 / 图片 / 倍率
  • 全选 / 全不选,以及关键字过滤(模型多时按 id 或名字搜)
  • 未勾选的模型进宿主的 exclude 列表,不注册进 DSH;一个都没勾会给出「分组会是空的」警告
  • 保存即热重注册,不需要重启

设计取舍:用排除(exclude)而不是白名单。网关新增模型时默认可用,不会被一份过期的白名单挡在外面;想全启用就是全部勾上(等价 exclude: [])。

宿主侧

  • GET /status 每条路由新增 catalog(逐条模型的 id / contextWindow / maxTokens / reasoning /
    efforts / off / images / rate)与 exclude / enabled;models 仍是总数,旧界面不受影响
  • exclude 清洗加固:去重、丢弃非字符串 / 空串 / 超过 200 字符 / 含换行的项,上限 2000 条
  • 过滤发生在 piModels() 里,即注册给 pi-ai 的模型表本身就少了那些条目——不是只在界面上隐藏

验证

node test/verify.mjs → 122/122(新增 22 项):

  • status 带完整清单、条目含上下文与思考档、默认 exclude 为空
  • 存 exclude 后 enabled 减少、exclude 已去重并丢掉脏数据
  • 反向验证适配器:adapter.listModels('workbuddy2apicn') 注入 21 个(原本 22 个),被排除的那个确实不在列表里
  • 清空 exclude 后恢复 22 个
  • 界面:标题计数、展开列出全部模型、默认全勾、取消勾选后计数变化、保存体带上 exclude、
    全选 / 全不选、关键字过滤、无清单时的指引文案

node test/verify.mjs --offline → 28/28。

安装

桌面版

桌面版的 desktop profile 由 App 独占管理(独立 CLI 的 --dump-config 之类会被拒绝),但装包这条路是通的。

建议手工改两处再 install——dsh plugin add 会重写 dsh.profile.bundles,实测会把其它第三方 bundle 从列表里挤掉(本机丢过 dsh-workbuddy-connect 与 @eghrhegpe/dsh-connect-qoder);而 install 只装依赖、不动配置。

# 0) 附件地址:https://github.com/che246/dsh-workbuddy2api-connect/releases/download/v0.4.0/dsh-workbuddy2api-connect-0.4.0.tgz
copy dsh-workbuddy2api-connect-0.4.0.tgz "$env:USERPROFILE\.dsh\local-plugins\"

然后编辑 %USERPROFILE%\.dsh\profiles\desktop\package.json 两处:

  • dependencies 里加 "dsh-workbuddy2api-connect": "file:C:/Users/<你>/.dsh/local-plugins/dsh-workbuddy2api-connect-0.4.0.tgz"
  • dsh.profile.bundles 里追加 "dsh-workbuddy2api-connect"
cd "$env:USERPROFILE\.dsh\profiles\desktop"
$dsh = "D:\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"   # 换成你的安装目录
& $dsh plugin --profile desktop install

也可以用 & $dsh plugin --profile desktop add "<附件路径>"(自动写依赖与 bundles),但装完务必核对 dsh.profile.bundles,少了别的插件就补回去。

Web / TUI

dsh plugin --profile web add https://github.com/che246/dsh-workbuddy2api-connect/releases/download/v0.4.0/dsh-workbuddy2api-connect-0.4.0.tgz

两种方式装完都要重启一次 DSH:provider 路由与浏览器卡片都在 boot 时装配。重启后「插件」页出现本插件的配置卡片,模型选择器出现配置好的分组。