dsh-workbuddy-bridge 0.3.0 → 0.4.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/README.md +17 -14
- package/README_en.md +22 -19
- package/lib/bin.js +8 -7
- package/lib/client.js +669 -408
- package/lib/{variants-3SmUZ0e_.js → heartbeat-CP6YM98x.js} +137 -104
- package/lib/index.d.ts +12 -3
- package/lib/index.js +90 -10
- package/package.json +14 -13
- package/locale/README.md +0 -10
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<img src="icon.svg" alt="dsh-workbuddy-bridge" width="80" height="80">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
7
|
-
</p>
|
|
5
|
+
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
8
6
|
|
|
9
7
|
<div align="center">
|
|
10
8
|
<p><strong>把 WorkBuddy 桌面 App 的模型接进 DSH 对话窗口</strong></p>
|
|
@@ -46,16 +44,18 @@
|
|
|
46
44
|
- **开箱即用** —— 装完启用,模型分组自己出现。
|
|
47
45
|
- **两版隔离** —— 国内版与国际版各自分组,模型、账号、积分互不混用,只跟随各自 App 的登录状态。
|
|
48
46
|
- **推理档位** —— 上游声明了档位的模型直接可选;没声明的可在插件页**手动检测**。
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
- **推理档位** —— 上游声明了档位的模型直接可选;没声明的可在插件页**手动检测**。
|
|
48
|
+
灯泡表示能切档位;上游已声明的模型也亮着,只是不需要检测。
|
|
49
|
+
能切档位的模型会带一个**默认档位**(上游声明了就按声明,否则取 `high`),因此选择器里不再出现「Default」这一项。
|
|
50
|
+
- **积分可见** —— 每条回复下方显示本次消耗,模型选择器旁常驻剩余积分。拿不到数字时不显示。
|
|
51
51
|
- **模型显隐** —— 卡片「模型」标签里勾选哪些模型出现在选择器里,按登录账号分别保存。
|
|
52
52
|
- **图片输入** —— 多数模型可直接粘贴或拖入图片;纯文字模型会明确说明。
|
|
53
53
|
- **三种界面** —— Web / Desktop / TUI;仅 TUI 无手动检测。
|
|
54
54
|
|
|
55
55
|
<p align="center">
|
|
56
|
-
<img src="assets/composer-row.png" alt="
|
|
56
|
+
<img src="assets/composer-row.png" alt="输入区那一行:币图标与余额、推理档位灯泡、模型名,从左到右一行" width="560">
|
|
57
57
|
<br>
|
|
58
|
-
<em
|
|
58
|
+
<em>对话窗口里每天看到的样子:币图标与余额、推理档位灯泡,再往右是模型名——都排在同一行。</em>
|
|
59
59
|
</p>
|
|
60
60
|
|
|
61
61
|
<p align="center">
|
|
@@ -73,8 +73,8 @@ dsh plugin --profile web add dsh-workbuddy-bridge
|
|
|
73
73
|
dsh web
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
Desktop 与 TUI 把 `--profile web` 换成 `desktop` / `dsh-tui`(TUI
|
|
77
|
-
`@deepseek-harness-tui/dsh-tui
|
|
76
|
+
Desktop 与 TUI 把 `--profile web` 换成 `desktop` / `dsh-tui`(TUI 需较新版本的终端插件
|
|
77
|
+
`@deepseek-harness-tui/dsh-tui`,版本要求见其文档)。
|
|
78
78
|
|
|
79
79
|
也可以从源码安装:
|
|
80
80
|
|
|
@@ -85,6 +85,9 @@ pnpm install && pnpm build
|
|
|
85
85
|
dsh plugin --profile web add "$PWD"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
⚠️ 上面那步 `pnpm install` 不能省:按路径挂载时依赖要由仓库自己装好(见[本地开发装法](docs/PUBLISHING.md)),
|
|
89
|
+
漏装则插件显示「未运行」(`ERR_MODULE_NOT_FOUND`)。
|
|
90
|
+
|
|
88
91
|
## 插件页
|
|
89
92
|
|
|
90
93
|
侧边栏 **插件(Plugins)** → 已安装 → 点 **DSH WorkBuddy Bridge**。配置区在描述下面,保存即生效:
|
|
@@ -100,14 +103,14 @@ dsh plugin --profile web add "$PWD"
|
|
|
100
103
|
|
|
101
104
|
<p align="center">
|
|
102
105
|
<img src="assets/detection-tab.png" alt="检测标签:每个推理模型一行" width="300">
|
|
103
|
-
<img src="assets/credits-tab.png" alt="
|
|
106
|
+
<img src="assets/credits-tab.png" alt="积分标签:总余额与各套餐余量条" width="300">
|
|
104
107
|
<br>
|
|
105
|
-
<em
|
|
108
|
+
<em>左「检测」:每个推理模型一行,点按钮确认它接受哪些推理档位;右「积分」:总余额,下面是各套餐的余量条。</em>
|
|
106
109
|
</p>
|
|
107
110
|
|
|
108
111
|
## 为什么是手动检测
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
WorkBuddy 接口不保证档位信息可靠——有的模型**接受** `reasoning_effort` 却忽略未知值。
|
|
111
114
|
所以插件不猜:按需对单个模型发少量真实请求确认;结果只表示**上游当前接受该档位**,
|
|
112
115
|
不承诺它改变推理行为。已声明档位的模型跳过这一步,直接用声明值。
|
|
113
116
|
机制与取舍见 [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)。
|
|
@@ -120,7 +123,7 @@ dsh plugin --profile web add "$PWD"
|
|
|
120
123
|
|
|
121
124
|
## 兼容与限制
|
|
122
125
|
|
|
123
|
-
|
|
126
|
+
无凭据的分组不显示。宿主版本下限、平台支持、模型清单从哪来与已知缺口
|
|
124
127
|
→ [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
|
|
125
128
|
|
|
126
129
|
设计取舍 → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md);发版流程 → [docs/PUBLISHING.md](docs/PUBLISHING.md);
|
|
@@ -128,7 +131,7 @@ dsh plugin --profile web add "$PWD"
|
|
|
128
131
|
|
|
129
132
|
## 免责声明
|
|
130
133
|
|
|
131
|
-
- 本项目**仅供个人学习和研究使用**,仅驱动使用者自己的 WorkBuddy
|
|
134
|
+
- 本项目**仅供个人学习和研究使用**,仅驱动使用者自己的 WorkBuddy 账号在本机调用,请勿用于商业用途。
|
|
132
135
|
- 使用者需遵守 WorkBuddy 的服务条款;因使用本项目产生的任何后果,由使用者自行承担。
|
|
133
136
|
- 本项目与腾讯、WorkBuddy、DeepSeek 均无关联,未获其授权或认可;文中出现的名称仅用于描述兼容关系,其商标权利归各自所有。
|
|
134
137
|
|
package/README_en.md
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
<img src="icon.svg" alt="dsh-workbuddy-bridge" width="80" height="80">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
7
|
-
</p>
|
|
5
|
+
<h1 align="center">dsh-workbuddy-bridge</h1>
|
|
8
6
|
|
|
9
7
|
<div align="center">
|
|
10
8
|
<p><strong>WorkBuddy desktop models in DeepSeek Harness</strong></p>
|
|
9
|
+
<p><em>把 WorkBuddy 桌面 App 的模型接进 DSH 对话窗口</em></p>
|
|
11
10
|
|
|
12
11
|
<p>
|
|
13
12
|
<a href="https://www.npmjs.com/package/dsh-workbuddy-bridge"><img src="https://img.shields.io/npm/v/dsh-workbuddy-bridge?style=flat" alt="npm"></a>
|
|
@@ -29,8 +28,7 @@
|
|
|
29
28
|
|
|
30
29
|
> [!NOTE]
|
|
31
30
|
> **Credentials never leave this machine**: sign-in state is read from the WorkBuddy desktop app's own
|
|
32
|
-
> credential file and kept as one encrypted local copy; the browser half never sees a token, and none
|
|
33
|
-
> ever appears in the UI.
|
|
31
|
+
> credential file and kept as one encrypted local copy; the browser half never sees a token, and none ever appears in the UI.
|
|
34
32
|
|
|
35
33
|
The CN **WorkBuddy** and the international **WorkBuddy AI** coexist: install one app and its model group
|
|
36
34
|
appears; install both and the two groups sit side by side, each with its own account and credit. The
|
|
@@ -49,20 +47,21 @@ models appear directly in the DSH model picker — no separate provider to confi
|
|
|
49
47
|
- **Two isolated versions** — "WorkBuddy" (CN) and "WorkBuddy AI" (international) each form their own group;
|
|
50
48
|
models, accounts and credit never mix, and each follows only its own app's sign-in.
|
|
51
49
|
- **Reasoning levels** — models that declare levels expose them directly; the rest can be **checked manually**
|
|
52
|
-
on the plugin page. The bulb means "this model can switch levels"
|
|
53
|
-
model
|
|
50
|
+
on the plugin page. The bulb means "this model can switch levels"; a declared model shows it too, it just
|
|
51
|
+
has nothing to detect. A switchable model also carries a **default level** (the upstream's own declaration
|
|
52
|
+
when it has one, otherwise `high`), so the picker no longer offers "Default".
|
|
54
53
|
- **Credit in view** — each reply shows what it consumed, and remaining credit sits beside the model picker.
|
|
55
|
-
Nothing renders when a figure
|
|
54
|
+
Nothing renders when a figure is unavailable.
|
|
56
55
|
- **Model visibility** — tick which models appear in the picker on the card's "Models" tab, saved per
|
|
57
56
|
signed-in account.
|
|
58
57
|
- **Image input** — most models accept pasted or dropped images; text-only models say so explicitly.
|
|
59
58
|
- **Three surfaces** — Web, Desktop and TUI; only the TUI lacks manual detection.
|
|
60
59
|
|
|
61
60
|
<p align="center">
|
|
62
|
-
<img src="assets/composer-row.png" alt="The composer row:
|
|
61
|
+
<img src="assets/composer-row.png" alt="The composer row: the coin and balance, the reasoning-level bulb and the model name in one line" width="560">
|
|
63
62
|
<br>
|
|
64
|
-
<em>The everyday view in the conversation window:
|
|
65
|
-
|
|
63
|
+
<em>The everyday view in the conversation window: the coin and its balance, the reasoning-level bulb, then the
|
|
64
|
+
model name — one row, left to right.</em>
|
|
66
65
|
</p>
|
|
67
66
|
|
|
68
67
|
<p align="center">
|
|
@@ -81,8 +80,8 @@ dsh plugin --profile web add dsh-workbuddy-bridge
|
|
|
81
80
|
dsh web
|
|
82
81
|
```
|
|
83
82
|
|
|
84
|
-
For Desktop and TUI swap `--profile web` for `desktop` / `dsh-tui` (the TUI needs
|
|
85
|
-
`@deepseek-harness-tui/dsh-tui`
|
|
83
|
+
For Desktop and TUI swap `--profile web` for `desktop` / `dsh-tui` (the TUI needs a recent version of
|
|
84
|
+
the terminal plugin `@deepseek-harness-tui/dsh-tui` — see its docs).
|
|
86
85
|
|
|
87
86
|
Or from source:
|
|
88
87
|
|
|
@@ -93,6 +92,10 @@ pnpm install && pnpm build
|
|
|
93
92
|
dsh plugin --profile web add "$PWD"
|
|
94
93
|
```
|
|
95
94
|
|
|
95
|
+
⚠️ The `pnpm install` above is not optional: under a path install the repository has to supply
|
|
96
|
+
its own dependencies (see [local development setup](docs/PUBLISHING.md)) — skip it and the
|
|
97
|
+
plugin shows as "not running" (`ERR_MODULE_NOT_FOUND`).
|
|
98
|
+
|
|
96
99
|
## The plugin page
|
|
97
100
|
|
|
98
101
|
Sidebar **Plugins** → installed → click **DSH WorkBuddy Bridge**. The configuration area sits right under
|
|
@@ -109,15 +112,15 @@ the description and takes effect on save:
|
|
|
109
112
|
|
|
110
113
|
<p align="center">
|
|
111
114
|
<img src="assets/detection-tab.png" alt="Detection tab: one row per reasoning model" width="300">
|
|
112
|
-
<img src="assets/credits-tab.png" alt="Credits tab: total and per-package allowances" width="300">
|
|
115
|
+
<img src="assets/credits-tab.png" alt="Credits tab: the total balance and per-package allowances" width="300">
|
|
113
116
|
<br>
|
|
114
117
|
<em>Left, "Detection": one row per reasoning model — press the button to confirm which reasoning levels it
|
|
115
|
-
accepts. Right, "Credits": the total
|
|
118
|
+
accepts. Right, "Credits": the total balance, each package's allowance as a row below.</em>
|
|
116
119
|
</p>
|
|
117
120
|
|
|
118
121
|
## Why detection is manual
|
|
119
122
|
|
|
120
|
-
The
|
|
123
|
+
The WorkBuddy API does not guarantee that level information is reliable — some models were observed to
|
|
121
124
|
**accept** `reasoning_effort` while silently ignoring unknown values. So the plugin does not guess: it
|
|
122
125
|
confirms one model at a time with a few real requests on demand, and a result only means **the upstream
|
|
123
126
|
currently accepts that level** — it does not promise any change in behaviour. Models that declare their
|
|
@@ -132,8 +135,8 @@ Mechanism and trade-offs in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
|
132
135
|
|
|
133
136
|
## Compatibility and limits
|
|
134
137
|
|
|
135
|
-
A group without credentials does not appear. The host version floor, platform support,
|
|
136
|
-
known gaps
|
|
138
|
+
A group without credentials does not appear. The host version floor, platform support, where the model
|
|
139
|
+
catalog comes from and known gaps
|
|
137
140
|
→ [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
|
|
138
141
|
|
|
139
142
|
Design notes → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md); release process → [docs/PUBLISHING.md](docs/PUBLISHING.md);
|
|
@@ -142,7 +145,7 @@ maintainer map → [AGENTS.md](AGENTS.md).
|
|
|
142
145
|
## Disclaimer
|
|
143
146
|
|
|
144
147
|
- This project is **for personal study and research only**; it drives your own WorkBuddy account on your own
|
|
145
|
-
machine. Do not use it commercially
|
|
148
|
+
machine. Do not use it commercially.
|
|
146
149
|
- You must comply with WorkBuddy's terms of service; any consequences are your own responsibility.
|
|
147
150
|
- Not affiliated with, nor endorsed by, Tencent, WorkBuddy, or DeepSeek; names appear only to describe
|
|
148
151
|
compatibility, and trademarks belong to their owners.
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { C as variantFor, D as WorkBuddyUpstreamClient, S as WORKBUDDY_VARIANTS, Y as resolveAppVersion, a as readHostHeartbeat, c as WORKBUDDY_BRIDGE_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, x as CN_VARIANT } from "./heartbeat-CP6YM98x.js";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
//#region src/cli/bin.ts
|
|
@@ -29,17 +29,18 @@ function printJson(value) {
|
|
|
29
29
|
/**
|
|
30
30
|
* One variant's store plus the client that performs its refreshes.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* No key provider is injected, and that is now correct rather than a trap: the
|
|
33
|
+
* store's own default runs the discovery its variant may use
|
|
34
|
+
* (`atRestDiscoveryFor`, see `src/credential/store.ts`). This file used to spell
|
|
35
|
+
* that choice out per call site because the provider's no-arg default is
|
|
36
|
+
* `discovery: 'none'` — which left every caller that forgot it, including
|
|
37
|
+
* `scripts/live-e2e.mjs`, unable to open an encrypted credential at all.
|
|
36
38
|
*/
|
|
37
39
|
function makeStore(variant) {
|
|
38
40
|
const client = new WorkBuddyUpstreamClient();
|
|
39
41
|
return new WorkBuddyCredentialStore({
|
|
40
42
|
variant,
|
|
41
|
-
refresh: (credential) => client.refreshToken(credential)
|
|
42
|
-
keyProvider: new WorkBuddyAtRestKeyProvider({ discovery: variant.id === CN_VARIANT.id ? cnAppDiscovery() : "none" })
|
|
43
|
+
refresh: (credential) => client.refreshToken(credential)
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
/** The plugin-owned credential copy for one variant, for display. */
|