dsh-workbuddy-bridge 0.1.0
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/LICENSE +22 -0
- package/NOTICE +15 -0
- package/README.md +226 -0
- package/README_en.md +249 -0
- package/cordis.patch.yml +6 -0
- package/icon.svg +31 -0
- package/lib/bin.d.ts +6 -0
- package/lib/bin.js +237 -0
- package/lib/client.js +1780 -0
- package/lib/index.d.ts +1642 -0
- package/lib/index.js +2000 -0
- package/lib/variants-CFO_LIBm.js +3807 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +155 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Corrine Hu
|
|
4
|
+
Copyright (c) 2026 zlZayn
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# dsh-workbuddy-bridge — 来源与版权归属
|
|
2
|
+
|
|
3
|
+
本仓是 [corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect) 的重做版本。
|
|
4
|
+
目录结构、命名与提交历史按本仓维护者规范重建,代码在原有基础上继续维护。
|
|
5
|
+
|
|
6
|
+
## 原始作者与版权
|
|
7
|
+
|
|
8
|
+
- Copyright (c) 2026 Corrine Hu
|
|
9
|
+
- 原始分支与提交:`refactor/official-ui-architecture` @ `3dad637`
|
|
10
|
+
- 原 MIT 许可证与版权声明**完整保留**于 [LICENSE](LICENSE)
|
|
11
|
+
|
|
12
|
+
## 本仓维护者
|
|
13
|
+
|
|
14
|
+
- Copyright (c) 2026 zlZayn
|
|
15
|
+
- 仓库:<https://github.com/zlZayn/dsh-workbuddy-bridge>
|
package/README.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
<p><strong>把 WorkBuddy 桌面 App 的模型接进 DSH 对话窗口</strong></p>
|
|
7
|
+
<p><em>WorkBuddy desktop models in DeepSeek Harness</em></p>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/DeepSeek%20Harness-Plugin-4176E6?style=flat" alt="DeepSeek Harness Plugin"></a>
|
|
11
|
+
<a href="https://github.com/zlZayn/dsh-workbuddy-bridge/actions/workflows/ci.yml"><img src="https://github.com/zlZayn/dsh-workbuddy-bridge/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT 许可证"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p>
|
|
16
|
+
<strong><a href="README.md">简体中文</a></strong> · <a href="README_en.md">English</a>
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
> [!NOTE]
|
|
23
|
+
> **凭据不出本机**:登录状态取自 WorkBuddy 桌面 App 自己的凭据文件,插件只在本机留一份加密副本;
|
|
24
|
+
> 浏览器半边拿不到令牌,界面里也永远不出现凭据原文。
|
|
25
|
+
|
|
26
|
+
国内版 **WorkBuddy** 与国际版 **WorkBuddy AI** 并存:装哪个就出现哪个模型分组,两个都装就两组并排,
|
|
27
|
+
各自用自己的账号与积分。模型直接出现在 DSH 的模型选择器里,不必为它单独配一个 provider。
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<img src="assets/1.png" alt="WorkBuddy 模型出现在 DSH 模型选择器中" width="330">
|
|
31
|
+
<br>
|
|
32
|
+
<em>国内版在模型选择器中自成一组(含积分倍率与促销徽章),与 DSH 自带分组并排;装国际版则出现「WorkBuddy AI」组。</em>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## 能力
|
|
36
|
+
|
|
37
|
+
- **开箱即用**:装完启用,模型分组自己出现,没有必填项。
|
|
38
|
+
- **两版互不串号**:国内版是「WorkBuddy」分组、国际版是「WorkBuddy AI」分组,模型、账号与积分互不混用;
|
|
39
|
+
**各自只跟随自己那版 App 的登录状态** —— 退出其中一版,对应分组消失,另一版不受影响。
|
|
40
|
+
- **图片输入**:多数模型可直接粘贴或拖入图片(GLM-5.3-Flash、GLM-5.2、DeepSeek-V4 系列等);
|
|
41
|
+
少数纯文字模型(如 GLM-5.1)会明确说明不支持。
|
|
42
|
+
- **推理档位**:上游声明了档位的模型直接可选(如 GLM-5.3 / GLM-5.3-Flash 的 low / high / max);
|
|
43
|
+
没声明的模型可在 Web 与 Desktop 上**手动检测**(见[为什么是手动检测](#为什么是手动检测))。
|
|
44
|
+
未检测或没有可用档位的模型继续用 WorkBuddy 的默认档位。
|
|
45
|
+
- **模型显隐**:卡片的「模型」标签里勾选哪些模型出现在选择器里;**按登录账号分别保存**,
|
|
46
|
+
切换账号自动切换各自的配置。隐藏只影响可选择性,**已在用该模型的会话照常继续**。
|
|
47
|
+
- **账号与积分**:插件页里看账号、令牌有效期(自动续期)、剩余积分与模型优惠,可手动刷新模型列表,
|
|
48
|
+
并看到当前列表来自上游还是内置兜底。
|
|
49
|
+
- **费率与促销**:模型名后直接跟积分倍率(如 `GLM-5.2 · x0.79`)与促销徽章(限时免费 / 夜间折扣),
|
|
50
|
+
`/model` 弹窗与输入框下拉都能看到。倍率只是显示,不影响请求。
|
|
51
|
+
- **企业账号**:国内版企业账号走企业专用计费接口读周期额度,卡片显示「企业额度」与周期重置时间。
|
|
52
|
+
- **三种界面**:Web / Desktop / TUI 都能跑;只有 TUI 不提供手动检测。
|
|
53
|
+
- **插件页里以显示名出现**:`DSH WorkBuddy Bridge`(中英界面同名),标题下面另有一行代码体写着包名
|
|
54
|
+
`dsh-workbuddy-bridge` —— 两处都要能对上,才不会在插件列表里认错。
|
|
55
|
+
|
|
56
|
+
## 安装
|
|
57
|
+
|
|
58
|
+
### 前置
|
|
59
|
+
|
|
60
|
+
- 已安装并登录 **WorkBuddy 桌面 App**(国际版为 WorkBuddy AI App)。插件复用 App 的登录状态,
|
|
61
|
+
账号切换自动跟随;两版互不影响。
|
|
62
|
+
- DSH 的版本范围以 [package.json](package.json) 的 `engines` 与 `peerDependencies` 为准 —— 本仓只跟 **DSH `0.1.7` 线**。
|
|
63
|
+
- Node 22+(同上,真源是 `engines.node`)。
|
|
64
|
+
|
|
65
|
+
### 从 npm 安装
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
dsh plugin --profile web add dsh-workbuddy-bridge
|
|
69
|
+
dsh web
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 从源码安装
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
git clone https://github.com/zlZayn/dsh-workbuddy-bridge.git
|
|
76
|
+
cd dsh-workbuddy-bridge
|
|
77
|
+
pnpm install && pnpm build
|
|
78
|
+
|
|
79
|
+
dsh plugin --profile web add "$PWD"
|
|
80
|
+
dsh web
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 三种界面
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
# Desktop(DSH Desktop 桌面版)
|
|
87
|
+
dsh plugin --profile desktop add dsh-workbuddy-bridge
|
|
88
|
+
dsh --profile desktop
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
# TUI(终端界面)
|
|
93
|
+
dsh plugin --profile dsh-tui add dsh-workbuddy-bridge
|
|
94
|
+
dsh --profile dsh-tui
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> **TUI 的版本搭配**:终端界面插件 `@deepseek-harness-tui/dsh-tui` 需 **`0.10.0-beta.5` 及以上** ——
|
|
98
|
+
> 更早的版本装了本插件会启动失败,报 `events is not iterable`。先用 TUI 自带的方式把壳升上去,再装本插件。
|
|
99
|
+
|
|
100
|
+
> **TUI 的 pnpm**:`dsh-tui` profile 需用 pnpm 11 安装(PATH 里是其他版本会报 `ERR_PNPM_UNEXPECTED_STORE`,
|
|
101
|
+
> 用 `npx pnpm@11` 即可)。
|
|
102
|
+
|
|
103
|
+
### 发现与安装
|
|
104
|
+
|
|
105
|
+
- **GitHub**:[`zlZayn/dsh-workbuddy-bridge`](https://github.com/zlZayn/dsh-workbuddy-bridge)
|
|
106
|
+
- 仓库带 GitHub topic `dsh-plugin`,插件市场据此自动发现。
|
|
107
|
+
|
|
108
|
+
## 版本兼容
|
|
109
|
+
|
|
110
|
+
- 本仓只支持 **DSH `0.1.7` 线**(实测在 `0.1.7-rc.2` 上通过);下限见 [package.json](package.json) 的 `engines.dsh`,本文不重抄。
|
|
111
|
+
- **不提供跨代兼容**:宿主换线时本仓跟着抬下限,不在一份代码里同时伺候两条线。
|
|
112
|
+
- 本仓**不查宿主版本号**:它按宿主声明的契约注册(槽、服务、配置接缝),没有防御性包装;
|
|
113
|
+
接缝缺席时对应功能静默不出现,不会拖垮界面。
|
|
114
|
+
|
|
115
|
+
## 配置
|
|
116
|
+
|
|
117
|
+
侧边栏 **插件(Plugins)** →「已安装(Installed)」→ 点插件名进详情页 ——
|
|
118
|
+
**配置区就在描述下面,直接可改**,那一行上没有第二个 Configure 步骤:
|
|
119
|
+
|
|
120
|
+
- **配置表单**:`authFile`(国内版登录文件路径)、`authFileAI`(国际版)、**允许推理档位检测**、
|
|
121
|
+
**使用上游声明的最大上下文窗口**。前两项留空即用 App 自己的位置。
|
|
122
|
+
- **两张卡片**:国内版与国际版各一张,各显示自己账号的信息。账号、令牌有效期与模型列表来源常驻展开区顶部,
|
|
123
|
+
下面三个标签按「读者要做什么」划分:
|
|
124
|
+
- **积分**:合计、周期重置与各套餐余量,一处读完。
|
|
125
|
+
- **模型**:完整目录一张表 —— **模型显隐**勾选、上下文窗口、积分倍率与促销徽章。
|
|
126
|
+
- **检测**:推理档位检测,一模型一行;没有可检测的模型时这一页为空。
|
|
127
|
+
|
|
128
|
+
<p align="center">
|
|
129
|
+
<img src="assets/2.png" alt="插件详情页:配置表单与两张状态卡片" width="480">
|
|
130
|
+
<br>
|
|
131
|
+
<em>配置表单与两张卡片上下排列;国内版与国际版各一张,各自跟随自己 App 的登录状态。</em>
|
|
132
|
+
</p>
|
|
133
|
+
|
|
134
|
+
<p align="center">
|
|
135
|
+
<img src="assets/3.png" alt="积分标签:合计与套餐余量" width="420">
|
|
136
|
+
<img src="assets/6.png" alt="模型标签:显隐、窗口、倍率" width="420">
|
|
137
|
+
<img src="assets/7.png" alt="检测标签:推理档位检测" width="420">
|
|
138
|
+
<br>
|
|
139
|
+
<em>卡片展开分三个标签:积分(合计与套餐余量)、模型(显隐、窗口、倍率)、检测(推理档位)。</em>
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
保存即生效。**配置改动不需要重启宿主**(配置是 volatile 引用);**改了插件代码才需要**。
|
|
143
|
+
|
|
144
|
+
> 设置弹窗里的「内置插件」页是**只读清单**(名称与运行状态),没有配置入口 —— 别在那里找配置。
|
|
145
|
+
|
|
146
|
+
## 为什么是手动检测
|
|
147
|
+
|
|
148
|
+
WorkBuddy 的推理档位信息分散在上游接口与客户端私有 UI 逻辑里,且模型目录变化很快。
|
|
149
|
+
若插件按经验给所有未声明模型补齐一套统一档位,就得持续追赶没有稳定契约的未公开逻辑。
|
|
150
|
+
|
|
151
|
+
实测还发现:有些模型**接受** `reasoning_effort` 却忽略未知值、回退到默认行为 ——
|
|
152
|
+
一次请求成功并不能证明某个档位真的可用。
|
|
153
|
+
|
|
154
|
+
<p align="center">
|
|
155
|
+
<img src="assets/4.png" alt="输入框模型选择器旁的「推理等级」检测控件" width="620">
|
|
156
|
+
<br>
|
|
157
|
+
<em>检测控件就在模型选择器旁;结果显示在模型下拉里,也回写到卡片上。</em>
|
|
158
|
+
</p>
|
|
159
|
+
|
|
160
|
+
所以对没有声明档位的模型,Web 与 Desktop 改为**先授权、再按需检测**:先确认上游会校验这个参数,
|
|
161
|
+
再逐项确认哪些规范档位被接受。检测会发送少量请求、可能消耗积分;结果只表示**上游当前接受该档位**,
|
|
162
|
+
不承诺它改变推理效果、速度或积分消耗。
|
|
163
|
+
|
|
164
|
+
## 命令行
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
dsh plugin --profile <web|desktop|dsh-tui> exec dsh-workbuddy-bridge status
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
登录状态与剩余积分;`--json` 输出机器可读格式,另有 `doctor`(诊断)与 `logout`(清理凭据)。
|
|
171
|
+
|
|
172
|
+
默认操作国内版,加 `--provider workbuddy-ai` 操作国际版:
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
dsh plugin --profile web exec dsh-workbuddy-bridge status --provider workbuddy-ai
|
|
176
|
+
dsh plugin --profile web exec dsh-workbuddy-bridge doctor --provider workbuddy-ai
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`logout` 只删除该版插件自留的凭据副本,不动桌面 App 自己的登录,也不承诺模型分组一定消失
|
|
180
|
+
(App 的凭据文件仍在时依然生效)。
|
|
181
|
+
|
|
182
|
+
## 安全与边界
|
|
183
|
+
|
|
184
|
+
- **凭据只在本机**:从 App 的凭据文件读出后,插件自留一份**静态加密**的副本;
|
|
185
|
+
浏览器半边永远拿不到令牌、文件路径或平台事实。
|
|
186
|
+
- **界面里不出现凭据原文**:卡片只报账号与状态。
|
|
187
|
+
- **只访问 WorkBuddy 自己的接口**,不代理、不转发其他流量。
|
|
188
|
+
- 依赖的是 **WorkBuddy 客户端接口(非公开 API)**,上游改动可能使其失效;届时按
|
|
189
|
+
「本账号上次成功目录 → 内置目录」降级,并在卡片上标明来源与失败原因。
|
|
190
|
+
|
|
191
|
+
## 已知限制
|
|
192
|
+
|
|
193
|
+
- 在 macOS 的 DSH Web / Desktop / TUI 下验证通过。Windows 依次探测 Local 与 Roaming AppData;
|
|
194
|
+
WSL 优先从挂载的 Windows 用户目录读取登录凭据。Windows 与 Linux 用户名不同、且 Windows 环境变量
|
|
195
|
+
未传入 WSL 时,用 `WORKBUDDY_AUTH_FILE`(国际版 `WORKBUDDY_AI_AUTH_FILE`)指定实际位置。
|
|
196
|
+
- **国际版的模型目录来自 App 界面接口**:服务端按 User-Agent 分流,属私有实现,改动可能使其失效;
|
|
197
|
+
国内版走官方 CLI 同款接口,不受此影响。
|
|
198
|
+
- **国际版仍未覆盖的环境**:Windows / WSL / Linux 下国际版 App 的版本读取尚未找到可靠来源,
|
|
199
|
+
会退回最近保存的版本或内置值。
|
|
200
|
+
- **无凭据时的行为**:某版 App 从未登录、也没留下插件自留副本时,该版模型分组不再显示
|
|
201
|
+
(此前国内版会显示一份内置兜底列表,但那些模型选了必然报错)。
|
|
202
|
+
- **企业账号积分目前仅覆盖国内版**:国际版企业计费接口尚未验证,仍按个人版接口读取。
|
|
203
|
+
- 手动检测只在 Web 与 Desktop 提供,TUI 没有。
|
|
204
|
+
|
|
205
|
+
## 免责声明
|
|
206
|
+
|
|
207
|
+
- 本项目**仅供个人学习和研究使用**,仅驱动使用者自己的 WorkBuddy 账号在本机调用,请勿用于商业用途或超出个人合理使用的场景。
|
|
208
|
+
- 使用者需遵守 WorkBuddy 的服务条款;因使用本项目产生的任何后果(包括但不限于账号被限制、额度被清空、服务中断),由使用者自行承担。
|
|
209
|
+
- 本项目作者不对任何因使用或滥用本项目产生的直接或间接损失负责。
|
|
210
|
+
- 本项目与腾讯、WorkBuddy、DeepSeek 均无关联,未获其授权或认可;文中出现的名称仅用于描述兼容关系,其商标权利归各自所有。
|
|
211
|
+
|
|
212
|
+
## 致谢
|
|
213
|
+
|
|
214
|
+
- [Sliverkiss/workbuddy2api](https://github.com/Sliverkiss/workbuddy2api)(MIT)— WorkBuddy 上游协议的参照实现。
|
|
215
|
+
- [franksong2702/dsh-codex-connect](https://github.com/franksong2702/dsh-codex-connect)(Apache-2.0)— DSH 插件结构与 provider 注册的参照。
|
|
216
|
+
|
|
217
|
+
## 许可
|
|
218
|
+
|
|
219
|
+
[MIT](LICENSE)。
|
|
220
|
+
|
|
221
|
+
## 贡献
|
|
222
|
+
|
|
223
|
+
报缺陷请附 DSH 版本、插件版本与复现步骤;提功能前先翻 [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) 看设计取舍。
|
|
224
|
+
|
|
225
|
+
设计取向 → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md);发布流程与版本号判定 → [docs/PUBLISHING.md](docs/PUBLISHING.md);
|
|
226
|
+
维护者文档地图 → [AGENTS.md](AGENTS.md)。
|
package/README_en.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
<p><strong>WorkBuddy desktop models in your DSH chat</strong></p>
|
|
7
|
+
<p><em>把 WorkBuddy 桌面 App 的模型接进 DSH 对话窗口</em></p>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/DeepSeek%20Harness-Plugin-4176E6?style=flat" alt="DeepSeek Harness Plugin"></a>
|
|
11
|
+
<a href="https://github.com/zlZayn/dsh-workbuddy-bridge/actions/workflows/ci.yml"><img src="https://github.com/zlZayn/dsh-workbuddy-bridge/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p>
|
|
16
|
+
<a href="README.md">简体中文</a> · <strong><a href="README_en.md">English</a></strong>
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
> [!NOTE]
|
|
23
|
+
> **Credentials never leave your machine**: the sign-in state is read from the WorkBuddy desktop
|
|
24
|
+
> app's own credential file and kept as one encrypted local copy. The browser half never receives
|
|
25
|
+
> the token, and no credential text ever reaches the UI.
|
|
26
|
+
|
|
27
|
+
The CN **WorkBuddy** and the international **WorkBuddy AI** apps live side by side: whichever you
|
|
28
|
+
have installed shows up as its own model group, and both installed shows both groups, each with its
|
|
29
|
+
own account and credit. The models appear directly in the DSH model picker — no separate provider to configure.
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="assets/1.png" alt="WorkBuddy models in the DSH model picker" width="330">
|
|
33
|
+
<br>
|
|
34
|
+
<em>The CN version forms its own group in the model picker (with credit rates and promo badges), beside DSH's
|
|
35
|
+
own groups; installing the international version adds a "WorkBuddy AI" group the same way.</em>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
## Capabilities
|
|
39
|
+
|
|
40
|
+
- **Works out of the box**: install and enable — the model groups appear on their own, with nothing required to fill in.
|
|
41
|
+
- **The two versions never mix**: the CN app is the "WorkBuddy" group and the international one is "WorkBuddy AI";
|
|
42
|
+
models, accounts, and credit stay separate. **Each group follows only its own app's sign-in** — sign out of one
|
|
43
|
+
and that group disappears, leaving the other untouched.
|
|
44
|
+
- **Image input**: most models accept pasted or dropped images (GLM-5.3-Flash, GLM-5.2, the DeepSeek-V4 series, and more);
|
|
45
|
+
the few text-only models (e.g. GLM-5.1) say so explicitly.
|
|
46
|
+
- **Reasoning levels**: models that declare levels expose them directly (low / high / max on GLM-5.3 and GLM-5.3-Flash);
|
|
47
|
+
models that do not can be **checked manually** on Web and Desktop (see [Why detection is manual](#why-detection-is-manual)).
|
|
48
|
+
Models without a check result or usable levels keep WorkBuddy's default.
|
|
49
|
+
- **Model visibility**: the card's "Models" tab selects which models appear in the picker; the choice is
|
|
50
|
+
**saved per signed-in account** and follows account switches. Hiding only affects pickability — **chats already
|
|
51
|
+
using that model keep working**.
|
|
52
|
+
- **Account and credit**: the plugin page shows the account, token validity (auto-renewed), remaining credit, and model
|
|
53
|
+
offers; it can refresh the model list and shows whether the list came from the upstream or the built-in fallback.
|
|
54
|
+
- **Rates and promos**: each model name carries its credit multiplier (e.g. `GLM-5.2 · x0.79`) and promo badges
|
|
55
|
+
(limited-time free / night discount) in both the `/model` popup and the composer dropdown. The rate is display-only.
|
|
56
|
+
- **Enterprise accounts**: CN enterprise accounts read their cycle quota from the enterprise billing endpoint, and the
|
|
57
|
+
card shows an "enterprise quota" row with the reset time.
|
|
58
|
+
- **The plugin page shows a display name**: `DSH WorkBuddy Bridge` (the same in both UI languages), with the
|
|
59
|
+
package name `dsh-workbuddy-bridge` on the code-style line beneath it.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
### Prerequisites
|
|
64
|
+
|
|
65
|
+
- The **WorkBuddy desktop app** is installed and signed in (WorkBuddy AI for the international version). The plugin
|
|
66
|
+
reuses the app's sign-in state and follows account switches; the two versions do not affect each other.
|
|
67
|
+
- The DSH version range is whatever [package.json](package.json) declares in `engines` and `peerDependencies` —
|
|
68
|
+
this repository tracks the **DSH `0.1.7` line** only.
|
|
69
|
+
- Node 22+ (same source: `engines.node`).
|
|
70
|
+
|
|
71
|
+
### From npm
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
dsh plugin --profile web add dsh-workbuddy-bridge
|
|
75
|
+
dsh web
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### From source
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
git clone https://github.com/zlZayn/dsh-workbuddy-bridge.git
|
|
82
|
+
cd dsh-workbuddy-bridge
|
|
83
|
+
pnpm install && pnpm build
|
|
84
|
+
|
|
85
|
+
dsh plugin --profile web add "$PWD"
|
|
86
|
+
dsh web
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Other interfaces
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
# Desktop (the DSH Desktop app)
|
|
93
|
+
dsh plugin --profile desktop add dsh-workbuddy-bridge
|
|
94
|
+
dsh --profile desktop
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
# TUI (terminal UI)
|
|
99
|
+
dsh plugin --profile dsh-tui add dsh-workbuddy-bridge
|
|
100
|
+
dsh --profile dsh-tui
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
> **TUI version pairing**: the terminal UI package `@deepseek-harness-tui/dsh-tui` must be **`0.10.0-beta.5` or newer** —
|
|
104
|
+
> older versions fail at startup with `events is not iterable` once this plugin is installed. Update the shell first.
|
|
105
|
+
|
|
106
|
+
> **TUI and pnpm**: the `dsh-tui` profile needs pnpm 11 (a different pnpm on PATH fails with
|
|
107
|
+
> `ERR_PNPM_UNEXPECTED_STORE` — use `npx pnpm@11`).
|
|
108
|
+
|
|
109
|
+
### Discovery
|
|
110
|
+
|
|
111
|
+
- **GitHub**: [`zlZayn/dsh-workbuddy-bridge`](https://github.com/zlZayn/dsh-workbuddy-bridge)
|
|
112
|
+
- The repository carries the GitHub topic `dsh-plugin`, which the plugin market uses for discovery.
|
|
113
|
+
|
|
114
|
+
## Version compatibility
|
|
115
|
+
|
|
116
|
+
- This repository supports the **DSH `0.1.7` line** only, verified on `0.1.7-rc.2`; the floor lives in
|
|
117
|
+
[package.json](package.json) (`engines.dsh`) and is not copied here.
|
|
118
|
+
- **No cross-generation compatibility**: when the host moves lines, this repository moves its floor with it rather
|
|
119
|
+
than serving two lines from one codebase.
|
|
120
|
+
- The plugin **never probes the host version**: it registers against the contracts the host declares (slots, services,
|
|
121
|
+
the configuration seam) with no defensive wrappers. Where a seam is absent the corresponding feature quietly does not
|
|
122
|
+
appear, and nothing else is dragged down with it.
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
|
|
126
|
+
Sidebar **Plugins** → "Installed" → click the plugin name to open its detail page — **the configuration area sits right
|
|
127
|
+
under the description and is editable in place**, with no second Configure step on that row:
|
|
128
|
+
|
|
129
|
+
- **Configuration form**: `authFile` (CN sign-in file), `authFileAI` (international), **allow reasoning-level detection**,
|
|
130
|
+
and **use the largest context window the upstream declares**. Leave the first two blank to use the app's own location.
|
|
131
|
+
- **Two cards**: one per version, each reporting its own account. The account, token validity and catalog source
|
|
132
|
+
sit above the tabs; the three tabs below split by what a reader came to do:
|
|
133
|
+
- **Credits**: total, cycle reset, and per-package allowances in one place.
|
|
134
|
+
- **Models**: the full catalog in one table — **visibility** checkboxes, context windows, credit rates and badges.
|
|
135
|
+
- **Detection**: reasoning-level detection, one row per model; empty when nothing needs detecting.
|
|
136
|
+
|
|
137
|
+
<p align="center">
|
|
138
|
+
<img src="assets/2.png" alt="Plugin detail page: the configuration form and the two status cards" width="480">
|
|
139
|
+
<br>
|
|
140
|
+
<em>The configuration form sits above the two cards — one per version, each following its own app's sign-in.</em>
|
|
141
|
+
</p>
|
|
142
|
+
|
|
143
|
+
<p align="center">
|
|
144
|
+
<img src="assets/3.png" alt="Credits tab: total and per-package allowances" width="420">
|
|
145
|
+
<img src="assets/6.png" alt="Models tab: visibility, windows, rates" width="420">
|
|
146
|
+
<img src="assets/7.png" alt="Detection tab: reasoning-level detection" width="420">
|
|
147
|
+
<br>
|
|
148
|
+
<em>Expanding a card shows three tabs: Credits (total and per-package), Models (visibility, windows, rates), and Detection (reasoning levels).</em>
|
|
149
|
+
</p>
|
|
150
|
+
|
|
151
|
+
Saving takes effect immediately. **Configuration changes do not need a host restart** (configuration is a volatile
|
|
152
|
+
reference); **changing the plugin's code does**.
|
|
153
|
+
|
|
154
|
+
> The "Built-in Plugins" page in the settings dialog is a **read-only inventory** (name and runtime status) with no
|
|
155
|
+
> configuration entry — do not look for configuration there.
|
|
156
|
+
|
|
157
|
+
## Why detection is manual
|
|
158
|
+
|
|
159
|
+
WorkBuddy's reasoning-level information is split between upstream API responses and private UI logic in the client,
|
|
160
|
+
while the model catalog changes quickly. Filling in one uniform set of levels for every undeclared model would mean
|
|
161
|
+
chasing unpublished product logic with no stable contract.
|
|
162
|
+
|
|
163
|
+
Testing also found that some models **accept** `reasoning_effort` while ignoring unknown values and falling back to
|
|
164
|
+
their default — so one successful request does not prove that a level is actually usable.
|
|
165
|
+
|
|
166
|
+
<p align="center">
|
|
167
|
+
<img src="assets/4.png" alt="The reasoning-level control beside the composer's model picker" width="620">
|
|
168
|
+
<br>
|
|
169
|
+
<em>The control sits next to the model picker; results land in the model dropdown and are written back to the card.</em>
|
|
170
|
+
</p>
|
|
171
|
+
|
|
172
|
+
For models without declared levels, Web and Desktop therefore use **authorize first, then detect on demand**: confirm
|
|
173
|
+
that the upstream validates the parameter, then check which standard levels it accepts. Detection sends a few requests
|
|
174
|
+
and may consume credit; the result means only that **the upstream currently accepts that level** — it does not promise
|
|
175
|
+
a change in reasoning quality, speed, or credit use.
|
|
176
|
+
|
|
177
|
+
## CLI
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
dsh plugin --profile <web|desktop|dsh-tui> exec dsh-workbuddy-bridge status
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Sign-in state and remaining credit; `--json` for machine-readable output, plus `doctor` (diagnostics) and `logout`
|
|
184
|
+
(credential cleanup).
|
|
185
|
+
|
|
186
|
+
Both target the CN version by default; add `--provider workbuddy-ai` for the international one:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
dsh plugin --profile web exec dsh-workbuddy-bridge status --provider workbuddy-ai
|
|
190
|
+
dsh plugin --profile web exec dsh-workbuddy-bridge doctor --provider workbuddy-ai
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`logout` removes only that version's plugin-owned credential copy. It leaves the desktop app's own sign-in alone and
|
|
194
|
+
does not promise the model group will disappear (the app's credential file still supplies one).
|
|
195
|
+
|
|
196
|
+
## Security and boundaries
|
|
197
|
+
|
|
198
|
+
- **Credentials stay local**: read from the app's credential file, then kept as one **encrypted** plugin-owned copy.
|
|
199
|
+
The browser half never receives the token, file paths, or platform facts.
|
|
200
|
+
- **No credential text in the UI**: the cards report the account and status only.
|
|
201
|
+
- **Only WorkBuddy's own endpoints are contacted** — no proxying or forwarding of other traffic.
|
|
202
|
+
- The plugin depends on **WorkBuddy client interfaces (not a public API)**; upstream changes can break it. When that
|
|
203
|
+
happens it degrades to "this account's last successful catalog → built-in roster" and labels the source and failure
|
|
204
|
+
reason on the card.
|
|
205
|
+
|
|
206
|
+
## Known limitations
|
|
207
|
+
|
|
208
|
+
- Verified on macOS with the DSH Web / Desktop / TUI profiles. Windows probes Local and Roaming AppData in order; WSL
|
|
209
|
+
first reads credentials from the mounted Windows user profile. If the Windows and Linux user names differ and Windows
|
|
210
|
+
environment variables are not forwarded into WSL, point `WORKBUDDY_AUTH_FILE` (or `WORKBUDDY_AI_AUTH_FILE`) at the
|
|
211
|
+
actual file.
|
|
212
|
+
- **The international version's catalog comes from the app's own interface**: the service splits it by User-Agent, a
|
|
213
|
+
private implementation detail a server-side change can break. The CN version uses the same interface as the official
|
|
214
|
+
CLI and is unaffected.
|
|
215
|
+
- **International-version environments not yet covered**: on Windows / WSL / Linux no reliable source for the
|
|
216
|
+
international app's version has been located, so the saved value or the built-in default is used.
|
|
217
|
+
- **Behaviour with no credentials**: a version whose app was never signed in — and that left no plugin-owned copy —
|
|
218
|
+
no longer shows a model group. (The CN version used to display a built-in fallback list, but every model on it failed
|
|
219
|
+
when selected.)
|
|
220
|
+
- **The enterprise credit path currently covers the CN product only**: the international enterprise billing interface is
|
|
221
|
+
unverified, so those accounts still read through the personal endpoint.
|
|
222
|
+
- Manual detection is available on Web and Desktop only; TUI has none.
|
|
223
|
+
|
|
224
|
+
## Disclaimer
|
|
225
|
+
|
|
226
|
+
- This project is for **personal learning and research only**, driving your own WorkBuddy account on your own machine.
|
|
227
|
+
Do not use it commercially or beyond reasonable personal use.
|
|
228
|
+
- Users must comply with the WorkBuddy terms of service. Any consequence of using this project (including but not limited
|
|
229
|
+
to account restrictions, depleted credit, or service interruption) is borne by the user.
|
|
230
|
+
- The author is not liable for any direct or indirect loss arising from the use or misuse of this project.
|
|
231
|
+
- This project is not affiliated with, endorsed by, or sponsored by Tencent, WorkBuddy, or DeepSeek. Product names are
|
|
232
|
+
used for compatibility description only; trademarks belong to their respective owners.
|
|
233
|
+
|
|
234
|
+
## Acknowledgements
|
|
235
|
+
|
|
236
|
+
- [Sliverkiss/workbuddy2api](https://github.com/Sliverkiss/workbuddy2api) (MIT) — reference implementation of the WorkBuddy upstream protocol.
|
|
237
|
+
- [franksong2702/dsh-codex-connect](https://github.com/franksong2702/dsh-codex-connect) (Apache-2.0) — reference for the DSH plugin structure and provider registration.
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
[MIT](LICENSE).
|
|
242
|
+
|
|
243
|
+
## Contributing
|
|
244
|
+
|
|
245
|
+
Bug reports should include the DSH version, the plugin version, and reproduction steps. Before proposing a feature, read
|
|
246
|
+
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the design trade-offs.
|
|
247
|
+
|
|
248
|
+
Design → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md); release process and version semantics → [docs/PUBLISHING.md](docs/PUBLISHING.md);
|
|
249
|
+
maintainer doc map → [AGENTS.md](AGENTS.md).
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!--
|
|
3
|
+
dsh-workbuddy-bridge 的插件页图标:与输入区那个「推理档位检测」控件**同一个字形**
|
|
4
|
+
(src/client/probe-control.tsx 用宿主自己的 IconThinkOutlineRegular),放大到官方 36 格。
|
|
5
|
+
|
|
6
|
+
**边距是关键,不是把墨迹拉满格**。量了宿主三个官方图标的内容范围:
|
|
7
|
+
auto-review 上下 6 / 左右 8.5 voice-input 约 7.7 / 7.6 agent-team 上下 8.5–9.4 / 左右 9
|
|
8
|
+
即内容落在离边 6–9 之间。本文件取 7:16 格的墨迹(外接框 0.6233–15.3767)落到 7–29。
|
|
9
|
+
scale = 22 / (15.3767 − 0.6233) = 1.4912
|
|
10
|
+
translate = 7 − 0.6233 × 1.4912 = 6.0706
|
|
11
|
+
原先写的是 translate(2 2) scale(2)(内容 2–34,四周只留 2)—— 看起来就是「太大、太挤」。
|
|
12
|
+
|
|
13
|
+
线宽:组内给 1.5,落到画布约 2.24,与宿主「16 格里 1px」的视觉重量一致(1/16 × 36 = 2.25)。
|
|
14
|
+
|
|
15
|
+
选色:图标是宿主直读的静态资源,**不跟随主题**,所以颜色只能烘死。
|
|
16
|
+
墨迹 #7F8287(亮暗两块主题下都落在宿主中性色附近);圆心那一点 #F59E0B
|
|
17
|
+
(宿主 warn 档语义色,亮暗同值)—— 语义是「正在检测的那一档」。
|
|
18
|
+
取色判据与 dsh-ds-balance 的 icon.svg 同一套。
|
|
19
|
+
|
|
20
|
+
形状真源是宿主:组件直接渲染 IconThinkOutlineRegular,本文件是它按官方边距放大后的副本。
|
|
21
|
+
宿主换字形时这里要同批跟(红线 test/redlines.spec.ts 对着三处路径逐字核)。
|
|
22
|
+
-->
|
|
23
|
+
<g transform="translate(6.0706 6.0706) scale(1.4912)">
|
|
24
|
+
<g stroke="#7F8287" stroke-width="1.5" fill="none">
|
|
25
|
+
<path d="M10.7554 5.24466C13.9891 8.4783 15.3769 12.3333 13.8552 13.8551C12.3335 15.3768 8.4785 13.989 5.24478 10.7553C2.01111 7.52165 0.623307 3.66664 2.14504 2.14491C3.66676 0.623189 7.52178 2.01099 10.7554 5.24466Z" />
|
|
26
|
+
<path d="M10.7554 10.7553C7.52178 13.989 3.66676 15.3768 2.14504 13.8551C0.623307 12.3333 2.01111 8.4783 5.24478 5.24466C8.4785 2.01099 12.3335 0.623189 13.8552 2.14491C15.3769 3.66664 13.9891 7.52165 10.7554 10.7553Z" />
|
|
27
|
+
</g>
|
|
28
|
+
<!-- 圆心那一点:宿主原字形的第三条路径,填色而非描边,所以跟着同一组一起缩放。 -->
|
|
29
|
+
<path d="M8.9587 8.00025C8.9587 8.52835 8.5306 8.95655 8.0024 8.95655C7.47429 8.95655 7.04614 8.52835 7.04614 8.00025C7.04614 7.47209 7.47429 7.04395 8.0024 7.04395C8.5306 7.04395 8.9587 7.47209 8.9587 8.00025Z" fill="#F59E0B" />
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
package/lib/bin.d.ts
ADDED