tearslee/dsh-workbuddy2api

DeepSeek Harness (dsh) plugin: supervise a workbuddy2api gateway process and auto-register its models as an LLM provider

Project Overview项目介绍

This is a native DeepSeek Harness (DSH) plugin that integrates the third-party WorkBuddy2api LLM gateway into DSH. It handles all process lifecycle management for the gateway automatically: it spins up the gateway when DSH starts, cleans up the gateway process when DSH exits, and reuses any existing healthy running gateway instance on the configured port instead of spawning a duplicate or killing unrelated processes. It also automatically fetches and syncs the full model list from the gateway’s OpenAI-compatible endpoint, eliminating the need for users to manually write model metadata in DSH’s settings file.

After installing the plugin to your DSH instance, you only need to run the /wb2api-setup command inside DSH to complete the entire setup flow. This command automatically downloads the gateway executable, verifies its SHA256 checksum, prepares the runtime directory, guides you through WorkBuddy account login, starts the gateway, and syncs the model list all in one go. You do not need to install Go, Python, or any other runtime dependencies to use this plugin, and it is ideal for any DSH user who wants to access WorkBuddy-hosted LLMs directly from DSH.

This plugin requires that you have already installed a correct global version of DSH between >=0.1.2-rc.1 <0.2.0-0, and that you have a valid WorkBuddy account. The plugin itself is released under the open-source MIT license, and it is not affiliated with the upstream WorkBuddy2api project, which has its own valid license terms that you must agree to before use. There are three supported installation methods, and the recommended method is to use the DSH plugin CLI to add the plugin directly from the official pre-built published release tarball URL.

这是一个专为 DeepSeek Harness (DSH) 开发的原生插件,用于将 WorkBuddy2api LLM 网关接入 DSH。它会自动管理网关的进程生命周期:DSH 启动时拉起网关,退出时回收网关,如果端口已有健康运行的网关实例则直接复用,不会重复创建也不会终止其他用户进程。同时它会自动同步网关的模型列表,无需用户手动配置模型元数据。

用户安装插件后,只需在 DSH 中执行 /wb2api-setup 命令,即可完成网关可执行文件下载、SHA256 校验、运行目录准备、账号登录引导、网关启动和模型同步全流程,无需额外安装 Go、Python 或 Bash 环境。插件本身只做协议适配和生命周期管理,账号管理、熔断等逻辑都保留在网关侧,适合需要在 DSH 中使用 WorkBuddy 提供的 LLM 服务的用户。

本插件要求用户预先全局安装 DSH 版本 0.1.2-rc.1 到 0.2.0-0 之间,同时需要用户拥有一个可用的 WorkBuddy 账号。插件以 MIT 许可证开源发布,和上游 WorkBuddy2api 无隶属关系,WorkBuddy2api 的许可条款由其自身项目约束。用户可通过三种方式安装,推荐使用 DSH 插件命令直接添加发布包链接。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add https://github.com/tearslee/dsh-workbuddy2api/releases/download/v0.3.2/dsh-workbuddy2api-0.3.2.tgz

把 tearslee/dsh-workbuddy2api 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-workbuddy2api

把 workbuddy2api 网关接进 DeepSeek Harness(dsh) 的插件。

装上之后:

  • dsh 启动时自动拉起网关,退出时自动回收;端口上已有健康网关在跑则直接复用,不重复拉起,也不会去杀别人的进程。
  • 模型目录自动同步 —— 模型列表、上下文窗口、输出上限、思考档位全部从网关 GET /v1/models 实时读取,不必再手写 settings.yaml 里的模型元数据。
  • 6 条管理命令:/wb2api-setup · /wb2api-status · /wb2api-start · /wb2api-restart · /wb2api-login · /wb2api-account。
  • 一条命令完成安装:/wb2api-setup 会取回网关可执行文件(校验 SHA256)、准备运行目录、引导登录、启动网关并同步模型 —— 不需要装 Go,也不需要 python3 / bash。

插件本身很薄:协议适配、账号池、加权选号、分级熔断、定时任务、登录与 token 刷新全部留在 Go 网关侧。它只负责两件事 —— 进程生命周期,和模型目录自动化。


它解决什么

直接用手工配置把 workbuddy2api 接进 dsh(在 ~/.dsh/settings.yaml 里写 llm-pi-ai.providers.workbuddy2api)也能用,但有几处手工负担:

问题 手工接法 本插件
模型元数据 每个模型的 contextWindow / maxTokens / reasoningEfforts / input 全手抄;网关增删模型必须手改文件 运行时读 /v1/models 自动映射
进程管理 dsh 启动前必须另行常驻 wb2a-server.exe,退出也不联动 插件托管子进程,生命周期绑定 dsh
获取网关二进制 装 Go 工具链 → git clone 上游 → go build /wb2api-setup 自动下载 + SHA256 校验
账号登录 上游 login.sh 需要 bash + python3(Windows 上基本劝退) 插件内置同款 OAuth 流程,纯 Node 实现
可分发 配置只存在于本机,别人拿不到 一个 npm 包,装上即可用

字段映射

网关的 /v1/models 已经透出全部模型元数据(internal/server/handler.go 的 modelList(),对应上游 issue #84),因此插件无需内置静态兜底表:

网关 /v1/models dsh LlmResolvedModelInfo 说明
context_length context.contextWindow 网关保证有值(四级查找链,见下)
max_output_tokens defaultMaxTokens 网关未收录时不下发该键,插件随之不声明
supports_images inputModalities 缺席即仅 ['text']
reasoning_supported_efforts reasoning.efforts 空则不声明整个 reasoning
reasoning_default_effort reasoning.defaultEffort 插件先校验它确实包含于 efforts 内

内置的 openai-completions 栈不认这些非标准字段 —— 这正是当初必须手写元数据的根因,也是本插件的核心价值。

网关侧对 context_length / max_output_tokens 走四级查找链:上游动态值 → 静态种子表 → model.json 缓存 → models.dev 按需拉取;全未命中时窗口兜底 1M、输出上限省略。cn: 与 global: 两域同口径。

为什么不破坏上游的「按轮聚合」

本插件的请求序列化有两条硬约束:工具结果必须发成 role:"tool"、用户消息的内容与顺序在轮内逐字不变。破坏任一条,上游按对话轮聚合 RequestID 的兜底键就会在每个 step 漂移,用量明细重新碎片化 —— 且是静默的(网关照常回包)。

原理、实测截图与端到端证据:docs/turn-level-aggregation.md。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-side-chat 下一个 Next dsh-jev-prune →