dsh-connect-workbuddy 5.18.2 → 5.19.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/CHANGELOG.md +150 -0
- package/README.en.md +7 -5
- package/README.md +11 -6
- package/lib/bin.js +1 -1
- package/lib/client.js +547 -216
- package/lib/{host-heartbeat-DFqDsnte.js → host-heartbeat-uMQXkyai.js} +1 -1
- package/lib/index.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,155 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.19.0 (2026-11-06)
|
|
4
|
+
|
|
5
|
+
> **本版有破坏性变更(入口)**:配置界面从「插件市场详情页里的卡片」整体搬到
|
|
6
|
+
> **设置面板左侧导航的独立页面**(`settings.section`)。插件市场里那个 bundle 详情页
|
|
7
|
+
> 不再显示这张卡。按「用户可见的入口迁移走 minor」的惯例升 **5.19.0** 而不是补丁号。
|
|
8
|
+
|
|
9
|
+
### 变更
|
|
10
|
+
|
|
11
|
+
**配置入口迁移到「设置 → WorkBuddy」。** 该页面注册在宿主的 `settings.section` LIST 槽位
|
|
12
|
+
(0.2.1-rc.5 起提供),与「账号与余额 / 通用设置 / 模型 / 插件」等内置页面并列,位置
|
|
13
|
+
`order: 35`(在内置页 20 之后、插件市场 40 之前)。原来的
|
|
14
|
+
`plugins.bundle.config` / `plugins.row.config` 两处 keyed 注册已移除——**同一份配置
|
|
15
|
+
不应有两个编辑入口**。
|
|
16
|
+
|
|
17
|
+
页面结构(自上而下):图标 + 标题 + 一句话简介 → 国内版/国际版 tab →
|
|
18
|
+
账号 / 模型 / 能力 / 诊断 / SDK 五个分栏 → 各自的保存与放弃。内容本身一行没改:
|
|
19
|
+
同一批 store、同一套轮询、同一套草稿语义,只是换了画布。
|
|
20
|
+
|
|
21
|
+
导航图标用插件自有的 LD 品牌标记(不是通用齿轮),与页面**同一个 `inject` 回调**里注册,
|
|
22
|
+
配对关系是结构性的:`settings.section.icon` 由宿主按 `{ only: row.id }` 渲染,id 对不上
|
|
23
|
+
的图标就永远不出现,所以两者共用同一个常量 `WORKBUDDY_SETTINGS_SECTION_ID`。
|
|
24
|
+
|
|
25
|
+
### 修复(顺带消失的一整类缺陷)
|
|
26
|
+
|
|
27
|
+
**「换了个写法就整页空白、且不报错」不再可能发生。** 旧入口是 KEYED 槽位,宿主用
|
|
28
|
+
inventory 的 `pkg.name` 做**精确字符串相等**比较;部署完全可以把同一份代码挂在
|
|
29
|
+
`include:` 前缀的 Loader entry id 下,于是 key 对不上就什么都不渲染——没有区块、没有占位、
|
|
30
|
+
没有报错(issue #55,当年靠「把所有拼写都注册一遍」绕过)。
|
|
31
|
+
`settings.section` 由**本插件自己拥有的 id** 索引,没有别人的名字要对齐,这一整类错配随之消失。
|
|
32
|
+
配套地,`tests/issue55-card-not-registered.spec.ts`(钉住「两种拼写都要注册」的绕过方案)
|
|
33
|
+
被 `tests/settings-section-registration.spec.ts` 取代,而不是改一改继续跑——留着它就等于
|
|
34
|
+
继续钉一个已经不存在的槽位的绕过做法。
|
|
35
|
+
|
|
36
|
+
### 移除
|
|
37
|
+
|
|
38
|
+
**撤销 5.18.3 的 100 字详情文档,插件详情页恢复渲染完整 README。** `locale/zh.json` /
|
|
39
|
+
`locale/en.json` 的 `meta.detail` 两行、`docs/DETAIL.zh.md`、`docs/DETAIL.md` 及其
|
|
40
|
+
4 条守卫单测全部移除,`package.json#files` 从 15 项回到 13 项(**保留 `locale`**——它还承担
|
|
41
|
+
插件市场卡片的标题与描述,与参考项目可以整个删掉 `locale/` 的情形不同)。
|
|
42
|
+
|
|
43
|
+
理由与参考项目 2.1.19 相同:`meta.detail` 依赖「路径正确 + 语言链命中」这类隐式约定,
|
|
44
|
+
失败时静默回落到 README、界面看不出问题;而它唯一的作用只是缩短显示文本。搬到设置页之后
|
|
45
|
+
插件详情页只剩「这是什么」,正文本身就是回答,缩短它反而把唯一的内容删掉了。
|
|
46
|
+
`docs/PLUGIN-DETAIL-GUIDE.md` 保留(它讲的是宿主机制,对其他插件作者仍有效),开头注明本插件不再使用。
|
|
47
|
+
|
|
48
|
+
**旧的两条跳转路径**(`settings-route.ts` 里的 `pluginNavigation.openBundle` 与
|
|
49
|
+
`layout.selectPanel('plugins')`)。它们指向的是插件市场那个 bundle 详情页,而那一页现在不再承载
|
|
50
|
+
配置,所以两条都删了。
|
|
51
|
+
|
|
52
|
+
**「设置」齿轮按钮保留下来,并改了指路。** 中途曾经以为它无法实现:宿主确实**没有**任何公开
|
|
53
|
+
API 能让第三方插件「打开设置面板并定位到我的 section」——`settings.section` 的 owner props 只给
|
|
54
|
+
`close`,`openSection(id)` 只发给 `settings.onboarding` 的注册者,`settings.launcher` 则是
|
|
55
|
+
**替换**侧边栏那个全局 Settings 按钮。但它在**同一个已有面板(自己的整页)**上是成立的,所以按钮
|
|
56
|
+
改走 `layout.selectPanel(<本插件 main key>)` 打开整页版——那个页面正是这套配置需要的宽布局。
|
|
57
|
+
|
|
58
|
+
这次也确认了一个坑并写进代码注释:`inject` 闭包在读一个「稍后才赋值」的变量时,会永久拿到
|
|
59
|
+
`undefined`。渲染器把 `inject()` 的结果按 entry 身份 `useMemo` 掉,事后没有任何东西会纠正它。
|
|
60
|
+
所以跳转回调必须是 `apply` 一开始就确定的值,而不是等某个宿主服务到货再赋值(参考项目
|
|
61
|
+
`dsh-connect-qoder` 1.18.0 在同一个位置丢过同一颗按钮)。
|
|
62
|
+
|
|
63
|
+
### 修复(搬进设置面板后暴露的四处布局缺陷)
|
|
64
|
+
|
|
65
|
+
这三处都不是新代码写坏的,而是**同一份内容第一次被放进 564px 宽的列**之后才显形。旧入口
|
|
66
|
+
(插件市场详情页里的卡片)从不窄于 ~800px,所以这些规则从来没被触发过。
|
|
67
|
+
|
|
68
|
+
**1. 账号表在窄列里被压成 2×2 混排(#209 的观感面)。** 断点原本是
|
|
69
|
+
`@media (max-width:760px)`,量的是**视口**:设置面板里视口 1400px、内容列只有 564px,那个分支
|
|
70
|
+
永远不成立,于是五列表被硬塞进 564px。改成 `container-type: inline-size` + `@container`,量
|
|
71
|
+
**表格自己**的宽度,并把窄形态从「重新分栏」改成**堆叠成卡片**(账号一行、三个事实一行、操作一行)。
|
|
72
|
+
不再用两档阈值:564px 恰好落在原 720/560 两档中间,读者拿到的是格子和表头对不齐的 2×2。
|
|
73
|
+
|
|
74
|
+
**2. 模型名被自己的徽章吃掉。** 一行里是「名字 + 倍率 + 促销徽章 + 新标记 + 三个开关 + 三档窗口 +
|
|
75
|
+
两个按钮」,所有徽章都是 `flex:none`(半截胶囊看起来像渲染错误),于是**唯一能收缩的就是名字**,
|
|
76
|
+
而它恰好是读者唯一需要的东西——`GLM-5.` 后面什么都不剩。给名字 9em 下限并让它独占伸缩权,徽章
|
|
77
|
+
在行内自行换行。同时给模型区头部加 `flex-wrap`:四个中文长按钮(一键测速启用模型)不让位时,
|
|
78
|
+
「已启用 3 个」会被挤成两行。
|
|
79
|
+
|
|
80
|
+
**3. 壁纸下整片内容直接压在图片上(issue #209)。** 这些表面原本假设外壳那一列是**不透明**的,
|
|
81
|
+
所以内容区与页头都没有自己的底色;换上个性化壁纸后外壳的列是半透明的,壁纸便整片透过
|
|
82
|
+
`账号池`、说明段落与标签栏。修复是给内容区与页头各补一层外壳自己的 layer 色——实底主题上与原来看
|
|
83
|
+
不出差别,用真实构建产物 + 高饱和壁纸在 Chrome 里逐元素审计确认透出的元素归零。
|
|
84
|
+
|
|
85
|
+
**4. 两处双重留白。** `.dsm-workbuddy-usage` 是带 `gap` 的 flex 列,子元素之间的间距已经由它
|
|
86
|
+
提供;但标签栏又加了 `margin-top:16px`、面板加了 `margin-top:12px`、账号池加了 `padding-top:16px`,
|
|
87
|
+
叠出 32px 与 44px 两条空带。全部归零,让 `gap` 成为唯一间距来源(实测两处都回到 16px)。
|
|
88
|
+
|
|
89
|
+
### 变更(文案位置)
|
|
90
|
+
|
|
91
|
+
**「免费模型并非无限量」这句话跟着区域说明走。** 它原本在账号面板里,于是与它上面那句
|
|
92
|
+
「每个 tab 是一个独立供应商」被分栏和一条分割线隔开——两句回答的其实是同一个问题(这是什么、
|
|
93
|
+
它的边界在哪)。移到区域说明正下方、分栏之上,并去掉那条分割线;顺带的好处是五个分栏都能看到它,
|
|
94
|
+
而 ×0 档位恰好出现在「模型」栏。
|
|
95
|
+
|
|
96
|
+
### 保留
|
|
97
|
+
|
|
98
|
+
**侧边栏整页版(`sidebarPanel`,默认关闭)原样保留。** 它占的是所有插件共用的全局侧边栏座位、
|
|
99
|
+
由「能力」栏里自己的开关控制,与这次入口迁移是两件事。同一个组件现在画三种面
|
|
100
|
+
(`surface: 'card' | 'page' | 'settings'`):差异只在**外壳**——`card` 有折叠头、`page` 有返回按钮、
|
|
101
|
+
`settings` 两者都没有(标题与关闭由设置面板自己提供)。
|
|
102
|
+
|
|
103
|
+
### Tests
|
|
104
|
+
|
|
105
|
+
`3116/3116`(3082 → 3090 → 移除 4 条详情文档守卫后 3086 → 补布局与跳转守卫后 3116),`skip 2`。
|
|
106
|
+
|
|
107
|
+
- `tests/settings-section-registration.spec.ts`(7 条):只注册一个 section + 一个 icon 且 id 相同、
|
|
108
|
+
顺序落在内置页之后与市场之前、**设置镜像永不出现时也要注册**(issue #55 的后半段)、
|
|
109
|
+
没有 `configForms` 的宿主仍要有页面、rebind 是替换而非追加。
|
|
110
|
+
- `tests/card-settings-surface.spec.tsx`(8 条):设置面不渲染折叠头与返回按钮、不渲染 `<li>`、
|
|
111
|
+
顶部有标题与简介、**分栏与整页版逐项相同**、整页版的返回按钮没被这次改动碰坏,
|
|
112
|
+
以及三条样式契约(不抢整高、不沿用 860px 居中上限、内容块自己要有实底)。
|
|
113
|
+
- `tests/settings-jump.spec.tsx`(6 条,jsdom):面板已开时不再点触发器(那一下会把它关掉)、
|
|
114
|
+
没有触发器时交给退路、**只在重试耗尽后才降级**(刚挂载还没渲染是正常的一帧)、任何外壳形状都不抛、
|
|
115
|
+
空标签不匹配任何行。两条经变异验证。
|
|
116
|
+
- `tests/pool-card-render.spec.tsx` 新增 12 条:区域说明与警示句的位置关系、**壁纸下每个内容面
|
|
117
|
+
都必须有实底**、账号表按表格自身宽度而非视口收起、模型名有下限且徽章可换行、模型区头部可换行、
|
|
118
|
+
以及「间距只由 gap 提供」(标签栏 `margin:0` 但保留 `border-bottom`)。三条经变异验证。
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## 5.18.3 (2026-11-06)
|
|
122
|
+
|
|
123
|
+
### 改进
|
|
124
|
+
|
|
125
|
+
- **插件详情页不再把整篇 README 塞进 560px 滚动框(DSH 0.2.2+)**:宿主 0.2.2 新增「组合包详细介绍文档」,
|
|
126
|
+
找不到 `locale/<语言>.json` 的 `meta.detail` 时**回落渲染包内 README 全文**——本仓库的
|
|
127
|
+
`README.md` 有 743 行,于是插件页出现一大段带反引号、issue 编号与内部路径的长文。本版给
|
|
128
|
+
`locale/zh.json` / `locale/en.json` 各补一个 `meta.detail`,分别指向新建的
|
|
129
|
+
[`docs/DETAIL.zh.md`](docs/DETAIL.zh.md) 与 [`docs/DETAIL.md`](docs/DETAIL.md)(**92 / 96 字符**,
|
|
130
|
+
均 ≤100),只讲用户能感知的能力,不含实现细节;两份文件加入 `package.json` 的 `files` 白名单。
|
|
131
|
+
README 继续保持完整,npm / GitHub / 市场索引不受影响;宿主没有开关可关掉这个区块,详情页必须靠
|
|
132
|
+
`meta.detail` 接管。做法与完整坑位见 [`docs/PLUGIN-DETAIL-GUIDE.md`](docs/PLUGIN-DETAIL-GUIDE.md)
|
|
133
|
+
(可转发给其他插件作者照做)。
|
|
134
|
+
- **新增 [`tests/locale-meta.spec.ts`](tests/locale-meta.spec.ts) 的 4 条守卫**:每个 locale 都有
|
|
135
|
+
`meta.detail`(`en.json` 是语言链最终兜底,必须写)、路径合法且指向的文件真实存在、文件在
|
|
136
|
+
`files` 白名单内、正文按字符总数 ≤100。任一漂移都会让详情页静默退回 README 全文或显示
|
|
137
|
+
「错误 + 重试」,所以钉成测试而不是文档约定。
|
|
138
|
+
|
|
139
|
+
### Docs
|
|
140
|
+
|
|
141
|
+
- **新增 [`docs/DSH-0.2.2-RC1-FOLLOWUP.md`](docs/DSH-0.2.2-RC1-FOLLOWUP.md)**:0.2.1-rc.5 → 0.2.2-rc.1
|
|
142
|
+
的完整兼容复核(2623 个提交、vendor 全线升版)。结论是 **0.2.2-rc.1 无需改动代码**:本机实测
|
|
143
|
+
8 个槽位里 6 处在位、16 条 Web 路由 200/405 符合预期,`doctor` 认出宿主 bundle 在跑。记录在案的
|
|
144
|
+
三件事:`sessionProjections.stateOf(session, key)` 已弃用(仍返回值,只多一条一次性告警,建议下个
|
|
145
|
+
功能版换成 `snapshot(session, ['workingDirectory'])`)、`ResolvedPiAiProviderProfile` 新增两个必填
|
|
146
|
+
字段(运行时容忍缺省,只有升 devDeps 到 0.2.2 线时才会编译报错)、以及 `LlmModelInfo.badge` /
|
|
147
|
+
`llm/models-updated` 两个可选增强面。
|
|
148
|
+
- **新增 [`docs/PLUGIN-DETAIL-GUIDE.md`](docs/PLUGIN-DETAIL-GUIDE.md)**:给其他 DSH 插件作者照做的
|
|
149
|
+
100 字以内详情页写法(现象原因、5 步操作、字数算法、5 个坑、核对清单)。
|
|
150
|
+
- **[`tests/host-slot-surface.spec.ts`](tests/host-slot-surface.spec.ts) 补 1 条策略守卫**,钉住
|
|
151
|
+
`docs/DSH-0.2.2-RC1-FOLLOWUP.md` 仍可达、仍写着 `stateOf` 与 `maxRequestImages`。
|
|
152
|
+
|
|
3
153
|
## 5.18.2 (2026-11-05)
|
|
4
154
|
|
|
5
155
|
> **本版有破坏性变更**:`workbuddy_draw_image` 的 `size` 从可选改成**必填**,`image` 从
|
package/README.en.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
[English](README.en.md) | 中文
|
|
19
19
|
|
|
20
|
-
A [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) bundle plugin that connects locally signed-in WorkBuddy models to the DSH model picker — **both the CN app and the international WorkBuddy AI app are supported** — with an account pool, selectable model management, and a set of read-only capabilities built around credits: **every catalog refresh reads each model's credit multiplier from upstream** (the `x0.79` figure comes entirely from the upstream catalog; the plugin neither hard-codes it nor guesses), image input is toggled per model, multiple accounts can be switched or fail over automatically through the pool, and daily check-in plus read-only credit overviews shown as compact pills on the card and in the composer. **The CN and international sides are two parallel providers (`workbuddy` / `workbuddy-global`) that can be used at the same time**; the settings
|
|
20
|
+
A [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) bundle plugin that connects locally signed-in WorkBuddy models to the DSH model picker — **both the CN app and the international WorkBuddy AI app are supported** — with an account pool, selectable model management, and a set of read-only capabilities built around credits: **every catalog refresh reads each model's credit multiplier from upstream** (the `x0.79` figure comes entirely from the upstream catalog; the plugin neither hard-codes it nor guesses), image input is toggled per model, multiple accounts can be switched or fail over automatically through the pool, and daily check-in plus read-only credit overviews shown as compact pills on the card and in the composer. **The CN and international sides are two parallel providers (`workbuddy` / `workbuddy-global`) that can be used at the same time**; the settings page separates them with tabs for convenient management. All it needs is a WorkBuddy sign-in on this machine — or **one sign-in from the browser**.
|
|
21
21
|
|
|
22
22
|
## Risk notice
|
|
23
23
|
|
|
@@ -29,8 +29,8 @@ It depends on the WorkBuddy client's own endpoints (not a public API), so the pl
|
|
|
29
29
|
|
|
30
30
|
## Features
|
|
31
31
|
|
|
32
|
-
- **Dual parallel providers (CN + international)** — the CN side registers as the `workbuddy` provider (`GLM-5.3`, `DeepSeek-V4-Pro`, `Kimi-K3`, `MiniMax-M3`, `Hy3`, etc.), the international side as `workbuddy-global` (`GPT-5.6`, `Gemini-3.5-Flash`, `GLM-5.3`, `Kimi-K3`, etc.). **A region's models appear in the DSH model picker when that region has an account**: with accounts on both sides, both rosters are selectable at once, and different sessions can each pick a side without interfering. **A region with no local sign-in lists no models** — it cannot serve a single request, so listing them would offer nothing but failures. Sign in once for that region and its models come back on "detect accounts again" or after a restart; the provider itself stays registered either way, because its settings
|
|
33
|
-
- **Tabbed settings
|
|
32
|
+
- **Dual parallel providers (CN + international)** — the CN side registers as the `workbuddy` provider (`GLM-5.3`, `DeepSeek-V4-Pro`, `Kimi-K3`, `MiniMax-M3`, `Hy3`, etc.), the international side as `workbuddy-global` (`GPT-5.6`, `Gemini-3.5-Flash`, `GLM-5.3`, `Kimi-K3`, etc.). **A region's models appear in the DSH model picker when that region has an account**: with accounts on both sides, both rosters are selectable at once, and different sessions can each pick a side without interfering. **A region with no local sign-in lists no models** — it cannot serve a single request, so listing them would offer nothing but failures. Sign in once for that region and its models come back on "detect accounts again" or after a restart; the provider itself stays registered either way, because its settings page is how you sign in (re-detection lives in the pool block). Model names carry the upstream credit multiplier (e.g. `GLM-5.3 · x0.79`), matching WorkBuddy's own model menu.
|
|
33
|
+
- **Tabbed settings page** — the page's top carries a "Domestic / Global" tab bar; each tab holds its own account pool and model management. Account, directory, selection, and unsaved drafts are fully isolated per tab — switching accounts or refreshing models on one tab never touches the other side's runtime catalog or sessions.
|
|
34
34
|
- **Switch either provider off on its own** — each tab carries an on/off checkbox (both checked by default). Unchecking one **withdraws that provider from DSH's model picker entirely** (it is not merely a hidden tab): its adapter route and its "Settings → Models" directory entry are both pulled, and startup no longer sends pointless requests for it. Account, credits, directory, and selection are all kept, and re-checking restores everything. The typical use is "I have no use for the international side" — switch it off and keep the picker clean. Note: a session that had already selected a model from the switched-off provider will report `NO_ADAPTER` on its next call; the card states this plainly on the switched-off tab instead of failing silently.
|
|
35
35
|
- **Model management** — refresh the full catalog from upstream and enable or disable each model individually; **your ticks are a draft that only takes effect on save, but the directory and its prices are not** (issue #214). A refresh records what it just read and applies it immediately, because a price is not an edit — the upstream changes those rates whenever it likes, and hiding a new one in a draft is what made the card show a stale figure while `/models/refresh` reported the fresh one (the reporter measured `glm-5.3` arriving as 0.69 from the refresh while the card still drew 0.79). **Your selection, context budgets, image ticks and default reasoning tiers** are still committed only by Save; a refresh never writes unsaved edits of those for you. Upstream also reports credit multiplier, context/output limits, and reasoning efforts; **every model row carries a "default reasoning" picker** (issue #179): which tier that model uses when a request names none — new conversations, compaction summaries and session titles are all such requests. The options are exactly the tiers that model declares (across one roster `deepseek`/`glm-5.3` say `low/high/max`, `glm-5.2` says `high/xhigh`, `space-bunny` has five), so this can only be chosen per model and not once for the route, and the first option names the tier that will actually be used — the level WorkBuddy declares for that model, or (when it declares none) that model’s own middle tier, never its weakest one, so an unset choice cannot quietly turn thinking down. **This picker also replaces the old read-only "Reasoning: …" line** — it already lists every tier, so saying it twice adds nothing. **"Turn thinking off" is not here**: that stays the job of the `off` checkbox below. **image input is decided by a verified table**: a refresh pre-checks only models the table records as natively multimodal, leaves documented text-only models unchecked, and treats any id without a source as unverified and unchecked rather than guessing. The table carries two evidence tiers — vendor documentation (13 entries) and **the upstream catalog's own description** (2 entries: `space-bunny` and `minimax-m3.1-flash`, whose descriptions say “native multimodal”) — while a NEW id still needs a vendor source; see the “Image input” section of [docs/DESIGN.md](docs/DESIGN.md). Upstream's `supportsImages` is a *platform* declaration, not the model's capability, so it does not drive that decision at all. You can still tick any box by hand, and your selection is kept locally. **Every model row also carries a “Can disable” (`off`) checkbox**: it decides whether that model gets the “turn thinking off entirely” level. The default comes from a reviewed built-in table (the 9 models that claim the capability but answer HTTP 400 for it start unticked), and you can change it per model — **untick** for a model you do not need the level on. **The 9 tabled models cannot be ticked at all** (their row is marked "refuses off" with an explanatory tooltip): the level is not merely an extra option — pi-ai uses it as the DEFAULT for every request that names no tier, and a compaction summary is exactly such a request, so one tick made every `/compact` for that model fail with HTTP 400 / code 11133 (issue #83). Models outside the table are still decided entirely by your selection and their own declaration; your ticks are saved on first save and recomputed no further.
|
|
36
36
|
|
|
@@ -38,8 +38,8 @@ It depends on the WorkBuddy client's own endpoints (not a public API), so the pl
|
|
|
38
38
|
- **Campaign badges on model rows** — the upstream model catalog carries campaign information (free trials, night discounts, limited-time free use, subscription-only tiers, and the like). The plugin adds **no extra request** (it reuses the catalog configuration it already fetches when refreshing models) and draws a pill badge right on the model row: the upstream supplies both the colour and the wording, and hovering shows the upstream's campaign text, its start/end dates, and its daily window (e.g. “night 23:00–7:50”). **A badge is a function of the current moment**: it shows only inside the window the upstream declares and disappears on its own when that window closes; a window that crosses midnight is judged in the timezone the upstream declared; when several campaigns hit the same model, only the highest-priority one is drawn. A benefit marker without an end date (such as “subscription only”) stays until upstream withdraws it. **The multiplier shown is the price you actually pay**: while a “night discount” is running, the card and the picker both show the discounted `x0.06` instead of the catalog figure, and both go back on their own when the window closes — no restart needed (issue #120). **A badge is a hint, not behaviour** — it reports the campaign and discount upstream currently advertises, and makes no choice for you. **The same badge now appears in the DSH model picker**: every menu row draws the identical pill after the model name and before the load icon — menu rows use the upstream's short wording ("night", "free"), the composer trigger beside the input uses the full one ("night discount", "exclusive free"); judged from the same data at the same clock, because the screen where the model is chosen is exactly where "is it free right now" matters most. (Both regions' catalogs ship the campaign fields: read as the app, the CN `/v3/config` carries 8 promotions + 1 tier badge and the global one carries 5 + 1; the evidence and the decision rules are written up in [docs/PROMO_BADGE.md](docs/PROMO_BADGE.md).)
|
|
39
39
|
- **Model load on model rows (CN only)** — the upstream answers "how busy is this model right now" from a separate read-only probe (`POST /v2/chat/busy`, up to 50 ids per call, free, no account state touched). The plugin asks it once per catalog refresh and draws the level as a small figure beside the model name: **the number of people = how many are queueing** (healthy `normal` = one yellow figure, `busy` = two orange ones, `congested` = three red ones), while **idle is a green rocket** (nobody is queueing = full speed ahead) — idle is deliberately *not* drawn as "one green person", because at 12px "nobody is waiting" and "one person is waiting" have to be distinguishable at a glance; **unavailable** is a crossed-out figure. The probe's own `unknown` **draws nothing**: **"we were told nothing" is never reported as "all good"**. Colours follow the theme and the `title` tooltip ("极度拥堵") is still there. **The level is not persisted**: the catalog is a fact that survives a restart, a load level is a fact about that minute, so it is stamped onto the runtime catalog only and dies with the process; a failed probe logs one warning and never blocks the refresh. Measured on the CN gateway: the probe answers byte-identically under the CLI and the app identity, the 50-id ceiling is real (62 ids → HTTP 400), and 19 models come back in 186 ms. **The international region shows no load badge, because the international gateway simply does not have this endpoint** — measured, `www.workbuddy.ai` answers **404** for `/v2/chat/busy` (and for the neighbouring `/v3/chat/busy`, `/v2/models/busy` and friends), while the very same credential reads its `/v3/config` fine (28 models) and that document carries **no load or queue field at all**. This is not something the plugin left unimplemented, and it is not a configuration or permission problem: **upstream has never published this data for the international region**. So the international region shows the model name and campaign badges only; the failed probe degrades quietly to "no badge", never blocking the model list, and the plugin never guesses a load level from latency or credits.
|
|
40
40
|
- **Queueing tells you your position** — upstream expresses a queue with three business codes (`6020` waiting, `6021` queue full, `6022` this user already at the maximum). Instead of passing along a raw upstream error, the plugin says "模型排队中:你排在第 8777 位,队列共 9021 个请求;约 7 秒后自动重试". **A queue does not trigger failover**: the line is shared platform-wide and bound to the model, so another account is handed the same position — no account-pool rotation, no extra requests burned. (The upstream's `/v2/chat/queue/status` returns an i18n KEY rather than a sentence, so the plugin never relays its `message` and always uses its own wording.) **The "resend once it is your turn" half is not implemented** — that needs the queue answer's real envelope on the OpenAI-compatible channel, and writing it unmeasured would mean code that never runs.
|
|
41
|
-
- **Tabbed settings
|
|
42
|
-
- **Optional: a sidebar entry (`sidebarPanel`, OFF by default)** — adds a WorkBuddy row to the DSH sidebar that opens **this card as a full page** (with a "back to conversation" link in the top left). Squeezed into
|
|
41
|
+
- **Tabbed settings page (accounts / models / capabilities / diagnostics)** — the page used to be a single 3,500-pixel column that mixed two things with completely different commit semantics: **operating accounts** (who is serving, how much is left, switch order, check-in log) and **editing the catalog** (ticking models, context budgets, reasoning tiers, turning thinking off). An account change takes effect on the click; a catalog change is a draft that needs Save — so the Save button often sat three screens away from the thing it saves. Now each tab does one thing, and **switching tabs neither refetches nor drops an unsaved draft** (inactive panels stay mounted and are merely `hidden`, so they also leave the accessibility tree). The third tab, Capabilities, holds the **grants**: let the plugin drive the local CodeBuddy CLI, let the model buy an image on its own, where the credit readout is drawn. Each takes effect on the click and never passes through Save, and each is expected to grow sub-options of its own (a working directory for the CLI route, a size or price cap for the image tool) — which is why they no longer share one thin strip above the account table. The fourth tab, Diagnostics, is a read-only fact table: current region, upstream host, the account actually serving (by NAME, never by id), sign-in validity, how many models the catalog holds, how many are enabled, the pool switch, and the **raw text** of the upstream's most recent error (quoted, never translated or summarised) — its only reason to exist is to be pasted into a bug report, so it contains no control that changes a setting.
|
|
42
|
+
- **Optional: a sidebar entry (`sidebarPanel`, OFF by default)** — adds a WorkBuddy row to the DSH sidebar that opens **this card as a full page** (with a "back to conversation" link in the top left). Squeezed into tabs inside the settings panel's 800 px, the account table, model catalog and diagnostics text each get half a screen; the full page gives them the whole column. **Off by default**: that row occupies a **global sidebar slot shared by every installed plugin**, and Settings → WorkBuddy already opens the same page — an upgrade should not take that seat on the user's behalf. The switch lives on the Capabilities tab and **takes effect on the click — no Save** — like every other grant there.
|
|
43
43
|
- **Turning it off unregisters, it does not render an empty component.** A sidebar nav row is assembled from the slot entry's **metadata** (`label` plus icon), so a component that returns `null` yields a **blank but still clickable** button. The decision therefore belongs in `apply` (`src/client/panel-switch.ts` is the seam between card and entry), and switching off means `dispose`.
|
|
44
44
|
- **The first-screen state asks the host, not the browser's settings mirror.** That mirror is stale on some 0.1.7 builds and `whileServed` fires on the namespace **edge** only, never on a **value change** — a stale `false` would hide the row for the whole session with no event ever correcting it. So the seed reads the host's own answer (the `sidebarPanelEnabled` field of the usage document).
|
|
45
45
|
- **Switching it off while the page is open returns you to the conversation by itself** (`ui-layout` drops an `activePanelId` whose key no longer exists), so the plugin never navigates. The macOS run is recorded in [docs/MAC-VERIFY-PR188-REPORT.md](docs/MAC-VERIFY-PR188-REPORT.md); the checklist is [docs/MAC-VERIFY-PR188.md](docs/MAC-VERIFY-PR188.md).
|
|
@@ -235,6 +235,8 @@ npm install dsh-connect-workbuddy
|
|
|
235
235
|
|
|
236
236
|
Restart the DSH process after install/update/uninstall.
|
|
237
237
|
|
|
238
|
+
Once installed, the configuration lives in the **WorkBuddy page of the Settings panel's left-hand navigation** (beside "Account & balance", "General", "Models" and "Plugins"). As of 5.19.0 the bundle detail page in the plugin marketplace **no longer shows a configuration card** — one configuration keeps exactly one editing entry. The "Settings" control at the foot of the sidebar opens that same panel.
|
|
239
|
+
|
|
238
240
|
> ⚠️ **Pin an EXACT version for a fresh release; do not rely on a floating range.** pnpm enforces a release-age window (`minimumReleaseAge`, 24h by default), so shortly after a version ships a floating range is **silently resolved back to the previous one**: `^4.4.2` still resolves to `4.4.2`, while an exact `4.4.3` gets `4.4.3` immediately. Both spellings "install successfully", so the symptom is *"the upgrade command finished and the version did not change"* — easily misread as a failed release. Measured twice (isolated directory, `--lockfile-only`, touching nothing of the user's environment):
|
|
239
241
|
>
|
|
240
242
|
> First run, pnpm 12.3.4 (the 4.4.x era):
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<a href="https://dshfind.com/plugins/dingminhua/dsh-connect-workbuddy"><img src="https://dshfind.com/api/badge/dingminhua/dsh-connect-workbuddy" alt="dshfind plugin"></a>
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
|
-
一个独立的 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) bundle 插件。它把本机已登录的 WorkBuddy 账号(**国内版与国际版 WorkBuddy AI 均支持**)接到 DSH 的模型选择器,同时提供账号池、可勾选的模型管理,以及一套围绕积分的只读能力:**每次刷新按上游目录自动读取每个模型的积分倍率**(`x0.79` 这种,倍率完全由上游给出,插件不写死也不猜)、逐模型开关图片输入、多账号切换与账号池自动换号、每日签到、以及卡片与输入框里胶囊式的只读积分读数。**国内版与国际版是两个并行的供应商(`workbuddy` / `workbuddy-global
|
|
27
|
+
一个独立的 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) bundle 插件。它把本机已登录的 WorkBuddy 账号(**国内版与国际版 WorkBuddy AI 均支持**)接到 DSH 的模型选择器,同时提供账号池、可勾选的模型管理,以及一套围绕积分的只读能力:**每次刷新按上游目录自动读取每个模型的积分倍率**(`x0.79` 这种,倍率完全由上游给出,插件不写死也不猜)、逐模型开关图片输入、多账号切换与账号池自动换号、每日签到、以及卡片与输入框里胶囊式的只读积分读数。**国内版与国际版是两个并行的供应商(`workbuddy` / `workbuddy-global`),可同时使用**;插件设置页以 tab 区分两者,方便统一管理。只需本机 WorkBuddy 的登录态,**或在浏览器里登录一次**即可。
|
|
28
28
|
|
|
29
29
|
## 风险提示
|
|
30
30
|
|
|
@@ -36,11 +36,12 @@
|
|
|
36
36
|
|
|
37
37
|
## 功能特性
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
39
|
+
- **配置在「设置 → WorkBuddy」** —— 设置面板左侧导航里与「账号与余额 / 通用设置 / 模型 / 插件」并列的一页。5.19.0 起**插件市场里那个 bundle 详情页不再显示配置卡片**:同一份配置只留这一个编辑入口。页面顶部是图标、标题与一句话简介,往下依次是国内版 / 国际版两个 tab、五个分栏,以及各自的保存与放弃。
|
|
40
|
+
- **双供应商并行接入(国内版 + 国际版)** —— 国内版注册为 `workbuddy` provider(`GLM-5.3`、`DeepSeek-V4-Pro`、`Kimi-K3`、`MiniMax-M3`、`Hy3` 等),国际版注册为 `workbuddy-global` provider(`GPT-5.6`、`Gemini-3.5-Flash`、`GLM-5.3`、`Kimi-K3` 等)。**有账号的区域其模型会出现在 DSH 模型选择器里**:两边都有账号时两组同时可选,不同会话可以各选一边,互不干扰。**本机没有账号的区域不列出任何模型**(该区域一个请求也发不出去,列出来只会点到就失败);只要在该区域登录一次,「重新检测账号」或重启后模型就会自动出现——provider 本身始终注册着,因为它的设置页正是登录的入口(重新检测在账号池区块里)。模型名内嵌上游积分倍率(如 `GLM-5.3 · x0.79`),与 WorkBuddy 自身模型菜单一致;**活动时段显示的是折后价**——「夜间折扣」开着的时候,卡片与选择器上的数字一起变成 `x0.06`,活动一过自动回到原价,不需要重启(#120)。
|
|
41
|
+
- **设置页 tab 切换** —— 设置页顶部为「国内版 / 国际版」两个 tab,各含独立的账号池与模型管理;每个 tab 的账号、目录、勾选与未保存草稿完全隔离——在一个 tab 里切账号或刷新模型,不会触碰另一边的运行时目录与会话。
|
|
41
42
|
- **可单独关闭任一版本供应商** —— 每个 tab 右侧有一个勾选框(默认都勾选)。**取消勾选即把该供应商从 DSH 模型选择器里彻底撤掉**(不是只藏起 tab):它的路由与「设置 → 模型」页的目录条目一并摘除,启动时也不再为它发无用请求。账号、积分、目录与勾选**全部保留**,重新勾选即完整恢复。典型用法是「我根本用不到国际版」——关掉它,让选择器干净。注意:若某会话此前选中的正是被关闭供应商的模型,该会话再调用会报 `NO_ADAPTER`,卡片会在关闭态的 tab 上明确提示这一点,不会静默失败。
|
|
42
|
-
-
|
|
43
|
-
- **可选:侧边栏入口(`sidebarPanel`,默认关闭)** —— 在 DSH 侧边栏加一行 WorkBuddy
|
|
43
|
+
- **设置页分栏:账号 / 模型 / 能力 / 诊断** —— 原来这一页是一列 3000 多像素的长页,把两类互不相干的事情混排在一起:**运维账号**(谁在服务、还剩多少、切换顺序、签到日志)与**编辑目录**(勾模型、上下文预算、推理档、关闭思考)。它们连提交语义都不同——账号改动点一下即生效,目录改动是草稿、必须点保存——所以「保存」按钮常常离它要保存的东西隔着三屏。现在分栏,一栏只做一件事;**切栏既不会重新拉取,也不会丢掉未保存的目录草稿**(非活动栏留在页面里,只是通过 `hidden` 不可见,因此也不进入无障碍树)。第三栏「能力」放的是**授权类开关**——允许调用本机 CodeBuddy CLI、允许模型自主生图、积分读数显示在哪——它们点一下即生效、从不经过保存,而且每一个都留着长自己子选项的位置(CLI 的工作目录、生图的尺寸或价格上限),所以不挤在账号表格上方那一小条里。第四栏「诊断」是只读的事实表:当前区域、上游域名、真正在服务的账号名、登录有效期、目录里共几个模型、启用了几个、账号池开关,以及上游最近一次错误的**原文**(原样引用,不翻译、不概括)——这一栏存在的唯一理由就是能被整段贴进问题反馈,所以里面没有任何会改设置的控件。
|
|
44
|
+
- **可选:侧边栏入口(`sidebarPanel`,默认关闭)** —— 在 DSH 侧边栏加一行 WorkBuddy,点开就是**这张卡片的整页版**(左上有「返回会话」)。分栏挤在设置面板那 800px 里时,账号表格、模型目录与诊断原文都只有半屏宽;整页版把同一批东西摊到整栏。**默认关闭**:这一行占的是**所有已安装插件共用的全局侧边栏座位**,而「设置 → WorkBuddy」本来就能打开同一页,一次升级不该替用户占这个位置。开关在「能力」栏,**勾上即出现、取消即消失,不走保存**——与这一栏其它授权类开关一致。
|
|
44
45
|
- **关掉时是把注册注销,不是渲染空组件**:侧边栏导航行是用槽位**条目元数据**(`label` + 图标)拼的,组件返回 `null` 只会得到一颗**空白但仍可点**的按钮。所以决策点在 `apply`(`src/client/panel-switch.ts` 是卡片与入口之间的接缝),关掉即 `dispose`。
|
|
45
46
|
- **首屏状态问宿主,不问浏览器里的设置镜像**:那份镜像在部分 0.1.7 上是陈的,且只在命名空间**边缘**触发、不在**值变化**时触发——一份陈的 `false` 会让这一行整个会话都不出现,且没有任何事件来纠正它。所以种子读宿主自己的答案(usage 文档的 `sidebarPanelEnabled`)。
|
|
46
47
|
- **开着面板时关掉,中间栏自己回对话**(`ui-layout` 丢掉已不存在的 `activePanelId`),不需要插件去导航。macOS 实测记录见 [docs/MAC-VERIFY-PR188-REPORT.md](docs/MAC-VERIFY-PR188-REPORT.md),验证清单见 [docs/MAC-VERIFY-PR188.md](docs/MAC-VERIFY-PR188.md)。
|
|
@@ -247,6 +248,10 @@ npm install dsh-connect-workbuddy
|
|
|
247
248
|
|
|
248
249
|
安装、更新或卸载 bundle 后,需要重启对应的 DSH 进程。
|
|
249
250
|
|
|
251
|
+
安装完成后的配置入口在**设置面板左侧导航的「WorkBuddy」**(与「账号与余额 / 通用设置 /
|
|
252
|
+
模型 / 插件」等页面并列)。插件市场里那个 bundle 详情页从 5.19.0 起**不再显示配置卡片**——
|
|
253
|
+
同一份配置只留一个编辑入口。侧边栏底部那个「设置」入口打开的就是这个面板。
|
|
254
|
+
|
|
250
255
|
> ⚠️ **刚发布的版本请写「精确版本号」,不要依赖浮动范围。** pnpm 有**新版本等待期**(`minimumReleaseAge`,默认 24 小时),所以一个版本刚发布不久时,浮动范围会被**静默压回上一个版本**:声明 `^4.4.2` 时它仍解析到 `4.4.2`,而写精确的 `4.4.3` 则立即拿到 `4.4.3`。由于**两种写法都「安装成功」**,表现是「升级命令跑完了、版本却没变」,很容易被误判成发布失败。已实测两轮(隔离目录、`--lockfile-only`,未触碰用户环境):
|
|
251
256
|
>
|
|
252
257
|
> 第一轮 pnpm 12.3.4(4.4.x 当时):
|
|
@@ -726,7 +731,7 @@ else { await envelope.response.text() /* 或者按 SSE 消费 */ }
|
|
|
726
731
|
|
|
727
732
|
### 插件呈现与结构的基线
|
|
728
733
|
|
|
729
|
-
- [dingminhua/dsh-connect-trae](https://github.com/dingminhua/dsh-connect-trae)(MIT,Copyright (c) 2026 LaoDing)—
|
|
734
|
+
- [dingminhua/dsh-connect-trae](https://github.com/dingminhua/dsh-connect-trae)(MIT,Copyright (c) 2026 LaoDing)— 插件的呈现方式与其保持一致:设置页的结构与交互、模型管理(刷新 → 勾选 → 保存)与账号选择模型、只读的 host↔client 路由形态,以及 npm 发布工程。
|
|
730
735
|
- [dingminhua/dsh-subagent-default-model](https://github.com/dingminhua/dsh-subagent-default-model)(MIT,Copyright (c) 2026 LaoDing)— `dsm-*` 卡片风格体系、`row.*` 双语文案键约定与品牌图标的来源,经 `dsh-connect-trae` 转引。
|
|
731
736
|
- [franksong2702/dsh-codex-connect](https://github.com/franksong2702/dsh-codex-connect)(Apache-2.0)— DSH 插件结构与 provider 注册的参照,经 `dsh-workbuddy-connect` 转引;其 Apache-2.0 义务在 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) 中单独履行。
|
|
732
737
|
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $t as ensureDeviceSalt, C as FALLBACK_WORKBUDDY_MODELS_GLOBAL, H as legacyWorkbuddyOwnAuthPath, I as defaultDesktopAuthCandidates, J as APP_VERSION, K as workbuddyOwnAuthPath, L as defaultDesktopAuthDirs, M as WORKBUDDY_VAULT_DIRNAME, N as WorkBuddyCredentialStore, Qt as readDeviceTokenFile, S as FALLBACK_WORKBUDDY_MODELS, Z as DEFAULT_WIRE_PROFILE, Zt as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, a as readHostHeartbeat, an as WORKBUDDY_APP_EXECUTABLE_ENV, bn as resolveDshHome, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as findWorkbuddyAppExecutableWithSource, en as readDeviceSalt, et as WorkBuddyUpstreamClient, f as piAiRuntimeInfo, in as protectCredentialDirectory, it as describeRequestHeaderNames, j as WORKBUDDY_AUTH_FILE_ENV, m as createTuringSdk, o as workbuddyHostHeartbeatPath, q as workbuddyVaultDir, r as isHeartbeatProcessAlive, rn as inspectCredentialDirectory, tn as deriveDeviceId, u as describeRosterSeenPayload, v as readDeviceSettings, yn as hostPeersInfo } from "./host-heartbeat-
|
|
2
|
+
import { $t as ensureDeviceSalt, C as FALLBACK_WORKBUDDY_MODELS_GLOBAL, H as legacyWorkbuddyOwnAuthPath, I as defaultDesktopAuthCandidates, J as APP_VERSION, K as workbuddyOwnAuthPath, L as defaultDesktopAuthDirs, M as WORKBUDDY_VAULT_DIRNAME, N as WorkBuddyCredentialStore, Qt as readDeviceTokenFile, S as FALLBACK_WORKBUDDY_MODELS, Z as DEFAULT_WIRE_PROFILE, Zt as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, a as readHostHeartbeat, an as WORKBUDDY_APP_EXECUTABLE_ENV, bn as resolveDshHome, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as findWorkbuddyAppExecutableWithSource, en as readDeviceSalt, et as WorkBuddyUpstreamClient, f as piAiRuntimeInfo, in as protectCredentialDirectory, it as describeRequestHeaderNames, j as WORKBUDDY_AUTH_FILE_ENV, m as createTuringSdk, o as workbuddyHostHeartbeatPath, q as workbuddyVaultDir, r as isHeartbeatProcessAlive, rn as inspectCredentialDirectory, tn as deriveDeviceId, u as describeRosterSeenPayload, v as readDeviceSettings, yn as hostPeersInfo } from "./host-heartbeat-uMQXkyai.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { realpathSync } from "node:fs";
|