dsh-connect-workbuddy 5.24.16 → 5.25.1
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 +112 -0
- package/README.en.md +4 -2
- package/README.md +4 -2
- package/lib/bin.js +1 -1
- package/lib/client.js +25 -15
- package/lib/{host-heartbeat-Ceo9o82d.js → host-heartbeat-B0CDGEa8.js} +46 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,117 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.25.1 (2026-11-19)
|
|
4
|
+
|
|
5
|
+
> 版本号是 **patch**:只改渠道指纹清洗这一层——给字面表补一层「形态表」。不改模型 id、
|
|
6
|
+
> 路由、凭据、计费规则或任何开关;发往上游的聊天请求体只在命中第三方 CLI 自报家门句时才改写
|
|
7
|
+
> (此前这些请求会 400),其余请求逐字节不变。来自 issue #281。
|
|
8
|
+
|
|
9
|
+
### 修复:渠道改写表覆盖不到第三方 CLI 的「自报家门」句(issue #281)
|
|
10
|
+
|
|
11
|
+
`CHANNEL_GATE_PHRASES` 是字面表,每一行 `from` 用 `includes` 精确匹配,锁死一种措辞。
|
|
12
|
+
第三方编码 CLI(grok / codex / claude 均已实测)把**自己的**身份写进 `system`,插件改不了
|
|
13
|
+
它们的提示,只能在出站前改写;而字面行只要厂商换版本号(`4.6`→`5.0`)、换动词
|
|
14
|
+
(`released`→`built`)、换产品名或换介词就静默漏掉——清洗函数原样返回、请求照发、日志无异常,
|
|
15
|
+
直到一条 `assistant` 历史消息把整个会话永久毒化(400 / 11128)。
|
|
16
|
+
|
|
17
|
+
改法:在字面表之后加一层 `CHANNEL_GATE_PATTERNS` 形态表,锁「身份句 + 创造动词 + 已知厂商」
|
|
18
|
+
的形态而非逐字措辞。两行:一行认带版本号的 Grok + xAI,一行不认产品名只认厂商(换品牌仍兜住)。
|
|
19
|
+
三个实装细节都写进注释并钉进测试:① 版本号里的点必须放行,否则 `Claude 2.1.327` 会在
|
|
20
|
+
`2.1` 处被当句末而整句漏掉;② 必须吃到句末,否则产出 `agent's Claude Agent SDK ...` 残句;
|
|
21
|
+
③ 替换串不带句点,因为尾部 `[^.\n]*` 已经吃掉了原句点,再加一个会打印 `..`。
|
|
22
|
+
形态行锚在行首,普通正文里提到厂商(`The product X released by Y in 2023`)逐字节不动。
|
|
23
|
+
|
|
24
|
+
守护测试(`tests/issue281-channel-gate-shape-patterns.spec.ts`):命中矩阵 13 条、放过矩阵 7 条、
|
|
25
|
+
残句断言、幂等、以及 `prepareChatBody` 在 system/assistant 上生效而 user/tool 不动。
|
|
26
|
+
变异验证:摘掉形态循环 → 4 条红,恢复后全绿;既有 #163/#167/#189/#98 等 118 条渠道测试全过。
|
|
27
|
+
|
|
28
|
+
### 未采纳:国际版同名模型行加 id 后缀(issue #280)
|
|
29
|
+
|
|
30
|
+
#280 报告国际目录里 `deepseek-v4.1-flash`(免费)与 `deepseek-v4.1-flash-sg`(付费)上游显示名
|
|
31
|
+
完全相同,选择器只剩 `x0.00` / `x0.03` 后缀能区分。曾实装一版「同名两行补 `(模型id)` 后缀」,
|
|
32
|
+
但在真实选择器里读作 `Deepseek-V4.1-Flash (deepseek-v4.1-flash) · x0.00`,长到被截断成
|
|
33
|
+
`… H..`,反而更难读。按维护者裁定**撤回**:同名行维持「原名 + 积分倍率」的既有显示,
|
|
34
|
+
不加任何 id 后缀。相关代码与测试已整体移除,本版不含 #280 的显示改动。
|
|
35
|
+
|
|
36
|
+
留待后续的方向(未做,如实登记):要真正区分这两行,需要上游给出不同显示名,或宿主提供
|
|
37
|
+
不占宽度的副标题位;两者都不在本插件可控范围内。
|
|
38
|
+
|
|
39
|
+
## 5.25.0 (2026-11-19)
|
|
40
|
+
|
|
41
|
+
> 版本号是 **minor**:开发依赖栈从 DSH `0.2.2-rc.3` 整块换到 `0.2.2-rc.5`,并把跨 rc.4 / rc.5
|
|
42
|
+
> 的两份升级指南逐面复核登记;不改一行运行时源码,不改任何用户可见行为。逐面复核见
|
|
43
|
+
> [`docs/DSH-0.2.2-RC5-FOLLOWUP.md`](docs/DSH-0.2.2-RC5-FOLLOWUP.md)。
|
|
44
|
+
|
|
45
|
+
### 变更:依赖基线整块跟到 0.2.2-rc.5
|
|
46
|
+
|
|
47
|
+
桌面宿主已升到 `0.2.2-rc.5`。`pnpm-workspace.yaml` 的 `overrides` 把 25 条 `dsh-*`
|
|
48
|
+
由 `0.2.2-rc.3` 整块换成 `0.2.2-rc.5`,lockfile 重生成后 rc.3 残留 0 条、25 条 override
|
|
49
|
+
全部可解析。`cordis 4.1.0`、`schemastery 3.19.0`、`pi-ai 1.3.0` 三个钉不动——rc.5 的
|
|
50
|
+
`dsh-llm-pi-ai` 仍声明 `@earendil-works/pi-ai ^1.3.0`,已核对。
|
|
51
|
+
|
|
52
|
+
`package.json` 的 peer / devDeps 范围**不改**:`>=0.1.7-rc.1 <0.3.0-0` 已放行 rc.5,
|
|
53
|
+
上界 `<0.3.0-0` 仍明确挡住 0.3.0 线。`tests/dsh-line.spec.ts` 的闸门实算通过。
|
|
54
|
+
|
|
55
|
+
### 复核:两份升级指南都不需要本插件适配
|
|
56
|
+
|
|
57
|
+
从 rc.3 到 rc.5 跨两份指南:`v0.2.2-rc.3` 的 `deepseek-refusal-code`
|
|
58
|
+
(`MALFORMED_RESPONSE` → `CONTENT_REFUSED`)与 `v0.2.2-rc.4` 的
|
|
59
|
+
`web-search-deepseek-model-default`(DeepSeek 路由上的搜索改走 Messages 搜索)。
|
|
60
|
+
|
|
61
|
+
两者都与本插件正交:
|
|
62
|
+
|
|
63
|
+
- `CONTENT_REFUSED` 由宿主的 `dsh-llm-deepseek` 在**DeepSeek 官方路由**上产生;
|
|
64
|
+
本插件注册的是 `workbuddy` / `workbuddy-global`,且对 `turn/end` 失败按插件自己写进
|
|
65
|
+
message 的字面量分类(见 `src/channel-continue.ts` 的 `isChannelRejectFailure`),
|
|
66
|
+
不按宿主重分类出的 `LlmFailure.code` 分类——一个内容拒答本就不该触发「自动续发继续」。
|
|
67
|
+
- 搜索默认只在 `deepseek-official` / `deepseek-account` 路由上改变;本插件的模型挂在
|
|
68
|
+
WorkBuddy 路由下,仍走 `deepseek-search-api`,源码里也无任何 `searchProvider` 引用。
|
|
69
|
+
|
|
70
|
+
逐包比对:源码直接 import 的 5 个 `dsh-*` 包,`lib/` 在 rc.3 与 rc.5 之间**逐字节相同**;
|
|
71
|
+
typecheck 0 error 也印证了这一点(动的只有版本号)。没有改动源码。
|
|
72
|
+
|
|
73
|
+
### 收尾:结清 rc.3 复核 §5.1 的偶发超时
|
|
74
|
+
|
|
75
|
+
[`docs/DSH-0.2.2-RC3-FOLLOWUP.md`](docs/DSH-0.2.2-RC3-FOLLOWUP.md) §5.1 记录的
|
|
76
|
+
`tests/pool-e2e.spec.ts` 满并行偶发超时(10s 预算被 CPU 争抢饿到)按该文档给出的方案处理:
|
|
77
|
+
`waitFor` 预算 10s → 30s,与 `vitest.config.ts` 的 `testTimeout` 对齐。这是上限而非固定等待,
|
|
78
|
+
健康 tick 仍约 25ms 返回、真正坏掉的轮询依旧失败。本轮完整 `pnpm run check` 全绿、
|
|
79
|
+
未再超时;但只跑了一次,没有把它写成「已根治」,若 CI 仍偶发则按 rc.3 §5.1 的另一方案
|
|
80
|
+
挪到独立文件。
|
|
81
|
+
|
|
82
|
+
### 验收
|
|
83
|
+
|
|
84
|
+
`pnpm run check`(typecheck → build → check:pii → test)退出码 0:
|
|
85
|
+
215 文件 / 3725 通过 / 2 按平台跳过,`tsc` 两个项目 0 error,`check-pii` 扫描 472 文件(31 随包发布)clean。
|
|
86
|
+
|
|
87
|
+
## 5.24.17 (2026-11-19)
|
|
88
|
+
|
|
89
|
+
> 版本号是 **patch**:只改一处 UI 挂载点——让账号导入导出工具区在「正在加载账号」和账号文档
|
|
90
|
+
> 读取失败两种状态下也渲染;不改后端、不改导入逻辑、不改任何开关语义。来自 issue #279。
|
|
91
|
+
|
|
92
|
+
### 修复:账号导入不该被账号状态挡住——加载中与读取失败时也能导入
|
|
93
|
+
|
|
94
|
+
issue #279 报告:无本机 WorkBuddy 登录时看不到账号导入导出,无法把账号迁移到 Docker / Linux
|
|
95
|
+
部署。核查后发现导入后端与账号状态**本来无关**——`/transfer?action=import` 只是把文件里的凭据
|
|
96
|
+
写进本地 vault,不需要已解码的登录;signed-out(已确认未登录)分支也早就渲染了导入按钮。
|
|
97
|
+
|
|
98
|
+
真正的问题在首屏的 **loading 状态**:账号文档尚未返回时,整个账号工具区(含导入按钮)都不渲染;
|
|
99
|
+
账号文档读取失败(error 状态)时同样不渲染。报告者的截图正好停在「正在加载账号…」,于是表面
|
|
100
|
+
上成了「没账号就导不了」。这条链把「能不能导入」绑到了「账号读取有没有回答」——而对一台全新机器
|
|
101
|
+
来说,导入恰恰是获得第一个账号的**唯一**途径。
|
|
102
|
+
|
|
103
|
+
改法:把已有的 `accountTools`(OAuth 扫码 + 导入导出)在 loading 与 error 两个分支各渲染一份。
|
|
104
|
+
四种账号状态(加载中 / 未登录 / 已登录 / 读取失败)互斥,同一时刻仍只有一份工具区,不会出现两个
|
|
105
|
+
文件 input 抢 ref。signed-in 仍走 `AccountPool` 插槽、signed-out 仍走原分支,位置与顺序不变。
|
|
106
|
+
|
|
107
|
+
**不采纳的部分(issue #279 第 1 条)**:模型列表「刷新时用上游当前列表覆盖 + 保留上游已下架但
|
|
108
|
+
仍在用的模型」是 issue #32 的有意设计——避免刷新打断正在使用的会话;「清空重写」会推翻这条保护。
|
|
109
|
+
目录本身已按国内版 / 国际版分别保存在本地,手动刷新一次即可跟上当前列表。
|
|
110
|
+
|
|
111
|
+
守护测试(`tests/issue77-card-first-paint.spec.tsx`):loading 状态断言导入按钮可见且工具区恰好
|
|
112
|
+
一份;新增 error 状态用例断言同样可见。双向变异验证:摘掉 loading 那份红 1 条、摘掉 error 那份
|
|
113
|
+
红 1 条,恢复后相关 8 条全绿。
|
|
114
|
+
|
|
3
115
|
## 5.24.16 (2026-11-19)
|
|
4
116
|
|
|
5
117
|
> 版本号是 **patch**:只在 `isBodyOversizeRefusal`(长会话 422 救援的第一层入口判定)里补两种
|
package/README.en.md
CHANGED
|
@@ -226,9 +226,11 @@ DSH's shipped gate (`evaluatePluginCompatibility` in `packages/boot/app-boot/src
|
|
|
226
226
|
| `0.3.0-0` and above | ❌ explicitly refused (that line is unverified) |
|
|
227
227
|
| `0.1.6` and earlier | ❌ explicitly refused (0.1.5 users should stay on v2.0.15) |
|
|
228
228
|
|
|
229
|
-
> **`0.2.2-rc.1` / `0.2.2-rc.2` / `0.2.2-rc.3` are verified working** (5.24.0)
|
|
229
|
+
> **`0.2.2-rc.1` / `0.2.2-rc.2` / `0.2.2-rc.3` are verified working** (5.24.0); **`0.2.2-rc.4` /
|
|
230
|
+
> `0.2.2-rc.5` are reviewed as followable** (5.25.0, see
|
|
231
|
+
> [`docs/DSH-0.2.2-RC5-FOLLOWUP.md`](docs/DSH-0.2.2-RC5-FOLLOWUP.md)): each host's shipped gate evaluates the declared
|
|
230
232
|
> range as ADMITTED, the plugin loads completely on a running host (16 routes, 6 of 8 slots, all client modules registered), and this
|
|
231
|
-
> repository's suite is green on the real `0.2.2-rc.
|
|
233
|
+
> repository's suite is green on the real `0.2.2-rc.5` + pi-ai `1.3.0` combination. The "⚠️ outside the declared range" row
|
|
232
234
|
> above still describes **bare semver** evaluation, which is a different question from "does it run" — see the next note.
|
|
233
235
|
|
|
234
236
|
> **On `0.2.x` prereleases (corrected in v4.7.0)**: this table previously listed `0.2.0-rc.1` as "✅ supported". That was **wrong**.
|
package/README.md
CHANGED
|
@@ -243,9 +243,11 @@ DSH 的随包门禁(`packages/boot/app-boot/src/plugin-compatibility.ts` 的 `
|
|
|
243
243
|
| `0.3.0-0` 及以上 | ❌ 明确拒绝(该线尚未验证) |
|
|
244
244
|
| `0.1.6` 及更早 | ❌ 明确拒绝(0.1.5 线请停留在 v2.0.15) |
|
|
245
245
|
|
|
246
|
-
> **`0.2.2-rc.1` / `0.2.2-rc.2` / `0.2.2-rc.3` 已实测可用**(5.24.0
|
|
246
|
+
> **`0.2.2-rc.1` / `0.2.2-rc.2` / `0.2.2-rc.3` 已实测可用**(5.24.0);**`0.2.2-rc.4` /
|
|
247
|
+
> `0.2.2-rc.5` 已复核可跟进**(5.25.0,详见
|
|
248
|
+
> [`docs/DSH-0.2.2-RC5-FOLLOWUP.md`](docs/DSH-0.2.2-RC5-FOLLOWUP.md)):各版的随包门禁都把现声明判为
|
|
247
249
|
> ADMITTED,插件在运行中的宿主上完整加载(16 条路由、8 个槽位里的 6 处、客户端模块全部注册),
|
|
248
|
-
> 本仓库套件也在 `0.2.2-rc.
|
|
250
|
+
> 本仓库套件也在 `0.2.2-rc.5` + pi-ai `1.3.0` 的真实组合上全绿。上表那行「⚠️ 不落在声明范围内」
|
|
249
251
|
> 描述的仍是**裸 semver** 的判定,与「能不能跑」是两件事,原因见下条。
|
|
250
252
|
|
|
251
253
|
> **关于 `0.2.x` 预发布(v4.7.0 更正)**:此前本表把 `0.2.0-rc.1` 写作「✅ 支持」,那是**错的**。
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { F as WorkBuddyCredentialStore, J as workbuddyOwnAuthPath, N as WORKBUDDY_AUTH_FILE_ENV, Nn as hostPeersInfo, P as WORKBUDDY_VAULT_DIRNAME, Pn as resolveDshHome, R as defaultDesktopAuthCandidates, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as findWorkbuddyAppExecutableWithSource, W as legacyWorkbuddyOwnAuthPath, X as APP_VERSION, Y as workbuddyVaultDir, _n as inspectCredentialDirectory, a as readHostHeartbeat, b as readDeviceSettings, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, fn as readDeviceTokenFile, g as createTuringSdk, hn as deriveDeviceId, lt as describeRequestHeaderNames, m as piAiRuntimeInfo, mn as readDeviceSalt, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as ensureDeviceSalt, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, u as describeRosterSeenPayload, vn as protectCredentialDirectory, w as FALLBACK_WORKBUDDY_MODELS, yn as WORKBUDDY_APP_EXECUTABLE_ENV, z as defaultDesktopAuthDirs } from "./host-heartbeat-
|
|
2
|
+
import { F as WorkBuddyCredentialStore, J as workbuddyOwnAuthPath, N as WORKBUDDY_AUTH_FILE_ENV, Nn as hostPeersInfo, P as WORKBUDDY_VAULT_DIRNAME, Pn as resolveDshHome, R as defaultDesktopAuthCandidates, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as findWorkbuddyAppExecutableWithSource, W as legacyWorkbuddyOwnAuthPath, X as APP_VERSION, Y as workbuddyVaultDir, _n as inspectCredentialDirectory, a as readHostHeartbeat, b as readDeviceSettings, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, fn as readDeviceTokenFile, g as createTuringSdk, hn as deriveDeviceId, lt as describeRequestHeaderNames, m as piAiRuntimeInfo, mn as readDeviceSalt, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as ensureDeviceSalt, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, u as describeRosterSeenPayload, vn as protectCredentialDirectory, w as FALLBACK_WORKBUDDY_MODELS, yn as WORKBUDDY_APP_EXECUTABLE_ENV, z as defaultDesktopAuthDirs } from "./host-heartbeat-B0CDGEa8.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { realpathSync } from "node:fs";
|
package/lib/client.js
CHANGED
|
@@ -12904,11 +12904,14 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
|
|
|
12904
12904
|
settingsPath: WORKBUDDY_DEVICE_PROFILE_PATH
|
|
12905
12905
|
}) : null
|
|
12906
12906
|
}),
|
|
12907
|
-
status.status === "signed-out" && loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12907
|
+
status.status === "signed-out" && loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12908
12908
|
className: "dsm-workbuddy-usage-text",
|
|
12909
12909
|
role: "status",
|
|
12910
12910
|
children: t("row.accountsLoading")
|
|
12911
|
-
})
|
|
12911
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
12912
|
+
className: "dsm-workbuddy-pool-tools",
|
|
12913
|
+
children: accountTools
|
|
12914
|
+
})] }) : null,
|
|
12912
12915
|
status.status === "signed-out" && !loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
12913
12916
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12914
12917
|
className: "dsm-workbuddy-usage-text",
|
|
@@ -12960,19 +12963,26 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
|
|
|
12960
12963
|
}),
|
|
12961
12964
|
status.status === "error" && gateRefused === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
12962
12965
|
className: "dsm-workbuddy-usage-error-block",
|
|
12963
|
-
children: [
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12966
|
+
children: [
|
|
12967
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12968
|
+
className: "dsm-workbuddy-usage-error",
|
|
12969
|
+
role: "alert",
|
|
12970
|
+
children: t("row.usageErrorHint", { message: status.message === "" ? t("row.requestFailed") : status.message })
|
|
12971
|
+
}),
|
|
12972
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
12973
|
+
type: "button",
|
|
12974
|
+
className: "dsm-btn dsm-btn-outline",
|
|
12975
|
+
onClick: () => {
|
|
12976
|
+
statusRetries.current = 0;
|
|
12977
|
+
refreshUsage(activeRegion);
|
|
12978
|
+
},
|
|
12979
|
+
children: t("row.usageRetry")
|
|
12980
|
+
}),
|
|
12981
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
12982
|
+
className: "dsm-workbuddy-pool-tools",
|
|
12983
|
+
children: accountTools
|
|
12984
|
+
})
|
|
12985
|
+
]
|
|
12976
12986
|
}) : null
|
|
12977
12987
|
]
|
|
12978
12988
|
})
|
|
@@ -5172,15 +5172,60 @@ const CHANNEL_GATE_PHRASES = [
|
|
|
5172
5172
|
["they mean this GUI.", "the interface described here is meant."]
|
|
5173
5173
|
];
|
|
5174
5174
|
/**
|
|
5175
|
+
* Shape-locked rewrites for THIRD-PARTY coding CLIs' self-introduction lines
|
|
5176
|
+
* (issue #281).
|
|
5177
|
+
*
|
|
5178
|
+
* WHY A SECOND TABLE AT ALL. `CHANNEL_GATE_PHRASES` above is a literal table:
|
|
5179
|
+
* every `from` is matched with `out.includes(from)`, so each row freezes one
|
|
5180
|
+
* exact wording. Third-party CLIs write their OWN identity into `system` (grok,
|
|
5181
|
+
* codex and claude were all captured doing so), and the plugin cannot edit their
|
|
5182
|
+
* prompts — outbound rewriting is the only lever it has. A literal row added
|
|
5183
|
+
* for one captured sentence silently stops matching the moment the vendor
|
|
5184
|
+
* bumps a version (`4.6` → `5.0`), swaps a verb (`released` → `built`),
|
|
5185
|
+
* renames the product or changes a preposition. Worse, the failure is SILENT:
|
|
5186
|
+
* the scrub returns the text unchanged, the request goes out untouched, and
|
|
5187
|
+
* nothing logs — until a session is poisoned again. These regex rows lock the
|
|
5188
|
+
* SHAPE (identity clause + creator verb + known vendor) instead of the exact
|
|
5189
|
+
* words, so those routine changes stay covered.
|
|
5190
|
+
*
|
|
5191
|
+
* WHICH ROLES. This table is applied by the same function as the literal table,
|
|
5192
|
+
* which `prepareChatBody` calls on `system` and `assistant` parts only — the
|
|
5193
|
+
* roles the gate reads (`scansOpening`). Codex writes the line under
|
|
5194
|
+
* `developer`, which `prepareChatBody` renames to `system` before this runs, so
|
|
5195
|
+
* it is covered too.
|
|
5196
|
+
*
|
|
5197
|
+
* TWO ROWS, AND WHY BOTH. The first locks the known xAI product name (Grok) and
|
|
5198
|
+
* tolerates version numbers, optional articles and the creator verb being
|
|
5199
|
+
* omitted. The second ignores the PRODUCT entirely and recognises the creator
|
|
5200
|
+
* alone, so a vendor rename still lands. Both replace the whole sentence through
|
|
5201
|
+
* the trailing `[^.\n]*`: stopping at the vendor name produced broken text like
|
|
5202
|
+
* `You are an autonomous coding agent's Claude Agent SDK is the runtime.` in
|
|
5203
|
+
* the reporter's end-to-end runs. The replacement is idempotent — it no longer
|
|
5204
|
+
* contains "You are" followed by a creator clause — and both patterns are
|
|
5205
|
+
* anchored to a line start (`m` flag on the vendor row, word boundary on the
|
|
5206
|
+
* Grok row) so ordinary prose such as `The product X released by Y in 2023`
|
|
5207
|
+
* passes through byte-for-byte.
|
|
5208
|
+
*
|
|
5209
|
+
* `.` is only allowed INSIDE a version number (followed by a word character or
|
|
5210
|
+
* a digit) in the span patterns, so it can carry `4.6` / `2.1.327` but can never
|
|
5211
|
+
* jump a sentence boundary.
|
|
5212
|
+
*/
|
|
5213
|
+
const CHANNEL_GATE_PATTERNS = [[/\bYou are\s+(?:an?\s+)?(?:the\s+)?Grok\b(?:[^.\n]|\.(?=[\w])){0,60}?\b(?:(?:released|made|built|created|developed|trained|powered)\s+)?(?:by|from)\s+xAI\b[^.\n]*/gi, "You are an autonomous coding agent"], [/^[ \t]*You are\s+(?:[^.\n]|\.(?=\d)){0,120}?\b(?:released|made|built|created|developed|trained|powered)\s+(?:by|on|from)\s+(?:xAI|Anthropic|OpenAI|Google(?:\s+DeepMind)?|Meta|Mistral)\b[^.\n]*/gm, "You are an autonomous coding agent"]];
|
|
5214
|
+
/**
|
|
5175
5215
|
* Rewrite the measured gate phrases in one text part.
|
|
5176
5216
|
*
|
|
5177
5217
|
* Exported for the tests and for callers that build a body themselves. It is
|
|
5178
5218
|
* idempotent: every `to` string is different from its `from` string and no
|
|
5179
5219
|
* rewrite recreates another `from` string, so a second pass is a no-op.
|
|
5220
|
+
*
|
|
5221
|
+
* The literal table runs first (stable, auditable DSH wording), then the shape
|
|
5222
|
+
* table catches third-party CLI identities. Both are idempotent and independent
|
|
5223
|
+
* of each other, so the order is not load-bearing.
|
|
5180
5224
|
*/
|
|
5181
5225
|
function rewriteChannelFingerprintPhrases(text) {
|
|
5182
5226
|
let out = text;
|
|
5183
5227
|
for (const [from, to] of CHANNEL_GATE_PHRASES) if (out.includes(from)) out = out.replaceAll(from, to);
|
|
5228
|
+
for (const [re, to] of CHANNEL_GATE_PATTERNS) out = out.replace(re, to);
|
|
5184
5229
|
return out;
|
|
5185
5230
|
}
|
|
5186
5231
|
/**
|
|
@@ -11338,7 +11383,7 @@ function describeRosterSeenPayload(raw) {
|
|
|
11338
11383
|
//#endregion
|
|
11339
11384
|
//#region src/version.ts
|
|
11340
11385
|
/** The npm package version this build was produced from. */
|
|
11341
|
-
const WORKBUDDY_CONNECT_VERSION = "5.
|
|
11386
|
+
const WORKBUDDY_CONNECT_VERSION = "5.25.1";
|
|
11342
11387
|
//#endregion
|
|
11343
11388
|
//#region src/host-heartbeat.ts
|
|
11344
11389
|
/**
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CREDENTIAL_REJECTED_CODE, $t as imageSizeLimitsOf, A as withoutRouters, An as openEncryptedField, At as promoBadgeTone, B as defaultDesktopAuthPath, Bt as VIDEO_TAG_TEXT_TO_VIDEO, C as setDeviceMode, Cn as fetchAtRestKeyPayload, Ct as perturbChannelFingerprints, D as applyContextBudgets, Dn as isWorkbuddyBundle, Dt as rewriteSessionTitleModel, E as WorkBuddyCatalog, En as isEncryptedFieldWrapper, Et as requestEvidenceOf, F as WorkBuddyCredentialStore, Fn as withFileLock, Ft as offDefaultFor, G as parseWorkBuddyAuth, Gt as IMAGE_SIZE_LIMITS_WIDE, H as isEncryptedCredentialError, Ht as parseSupportedSecondsRange, I as WorkBuddyEncryptedCredentialError, In as writeFileAtomic, It as offRefused, J as workbuddyOwnAuthPath, Jt as MAX_INPUT_IMAGE_BYTES, K as preferredAccountName, Kt as IMAGE_TAG_IMAGE_TO_IMAGE, L as authFileName, Lt as recordRefusal, M as WORKBUDDY_AUTH_FILENAME, Mn as workbuddyAppExecutableCandidates, Mt as REFUSES_OFF_MODEL_IDS, N as WORKBUDDY_AUTH_FILE_ENV, Nt as defaultOffModelIds, O as deriveCatalog, On as macosBundleExecutable, Ot as toolSchemaRejectAdvice, Pn as resolveDshHome, Pt as lastRefusalFor, Q as CONTEXT_OVERFLOW_MARKER, Qt as imageModelChoices, R as defaultDesktopAuthCandidates, Rt as withEffectiveOff, S as saveDeviceSdkSettings, Sn as deriveAtRestKeyId, St as parseUpstreamModel, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tt as regionOf, U as isVaultAccountId, Ut as pickVideoModel, V as hasEncryptedCredentialFields, Vt as WorkBuddyVideoError, W as legacyWorkbuddyOwnAuthPath, Wt as resolveVideoParams, X as APP_VERSION, Xt as imageDataUrl, Yt as WorkBuddyImageError, Z as BODY_OVERSIZE_MARKER, Zt as imageMimeForPath, _ as createDeviceProfileLookup, _t as knownRegionOf, a as readHostHeartbeat, an as parseQueueAnswer, at as classifyUpstreamError, b as readDeviceSettings, bn as clearAtRestKeyCache, bt as parseCreditMultiplier, c as WORKBUDDY_CONNECT_VERSION, cn as NATIVE_MODALITY_BY_MODEL_ID, ct as deriveStableConversationId, dt as isBodyOversizeRefusal, en as isBareBase64Image, ft as isContextTooLongBody, g as createTuringSdk, gn as isDeviceId, gt as isToolSchemaRejectBody, h as createDeviceSdkPort, ht as isFirstMessageGateBody, i as processStartTimeMs, in as sniffImageMime, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jn as readAtRestKey, jt as selectPromoBadge, k as fallbackModelsFor, kn as macosNestedAppBundles, kt as attachBusyLevels, l as createFileRosterSeenStore, ln as imageDefaultFor, m as piAiRuntimeInfo, mt as isCredentialRejectedError, n as clearHostHeartbeat, nn as parseImageDataUrl, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as queueNoticeText, ot as conversationIdFromSessionId, p as resolveCnGateway, pt as isConversationIdGateBody, q as workbuddyAccountId, qt as IMAGE_TAG_TEXT_TO_IMAGE, r as isHeartbeatProcessAlive, rn as pickMediaModel, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as pruneTempDir, st as declaredTools, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as isWatermarkFreeImageModel, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, un as nativeModalityOf, ut as forceNeutralHead, v as describeDerivedDevices, vt as modelIdOfBody, w as FALLBACK_WORKBUDDY_MODELS, wn as findWorkbuddyAppExecutable, wt as prepareChatBody, x as saveDeviceProfile, xn as deriveAtRestKey, xt as parseReasoning, y as isDeviceMode, yn as WORKBUDDY_APP_EXECUTABLE_ENV, yt as openingEvidenceOfBody, z as defaultDesktopAuthDirs, zt as VIDEO_TAG_IMAGE_TO_VIDEO } from "./host-heartbeat-
|
|
1
|
+
import { $ as CREDENTIAL_REJECTED_CODE, $t as imageSizeLimitsOf, A as withoutRouters, An as openEncryptedField, At as promoBadgeTone, B as defaultDesktopAuthPath, Bt as VIDEO_TAG_TEXT_TO_VIDEO, C as setDeviceMode, Cn as fetchAtRestKeyPayload, Ct as perturbChannelFingerprints, D as applyContextBudgets, Dn as isWorkbuddyBundle, Dt as rewriteSessionTitleModel, E as WorkBuddyCatalog, En as isEncryptedFieldWrapper, Et as requestEvidenceOf, F as WorkBuddyCredentialStore, Fn as withFileLock, Ft as offDefaultFor, G as parseWorkBuddyAuth, Gt as IMAGE_SIZE_LIMITS_WIDE, H as isEncryptedCredentialError, Ht as parseSupportedSecondsRange, I as WorkBuddyEncryptedCredentialError, In as writeFileAtomic, It as offRefused, J as workbuddyOwnAuthPath, Jt as MAX_INPUT_IMAGE_BYTES, K as preferredAccountName, Kt as IMAGE_TAG_IMAGE_TO_IMAGE, L as authFileName, Lt as recordRefusal, M as WORKBUDDY_AUTH_FILENAME, Mn as workbuddyAppExecutableCandidates, Mt as REFUSES_OFF_MODEL_IDS, N as WORKBUDDY_AUTH_FILE_ENV, Nt as defaultOffModelIds, O as deriveCatalog, On as macosBundleExecutable, Ot as toolSchemaRejectAdvice, Pn as resolveDshHome, Pt as lastRefusalFor, Q as CONTEXT_OVERFLOW_MARKER, Qt as imageModelChoices, R as defaultDesktopAuthCandidates, Rt as withEffectiveOff, S as saveDeviceSdkSettings, Sn as deriveAtRestKeyId, St as parseUpstreamModel, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tt as regionOf, U as isVaultAccountId, Ut as pickVideoModel, V as hasEncryptedCredentialFields, Vt as WorkBuddyVideoError, W as legacyWorkbuddyOwnAuthPath, Wt as resolveVideoParams, X as APP_VERSION, Xt as imageDataUrl, Yt as WorkBuddyImageError, Z as BODY_OVERSIZE_MARKER, Zt as imageMimeForPath, _ as createDeviceProfileLookup, _t as knownRegionOf, a as readHostHeartbeat, an as parseQueueAnswer, at as classifyUpstreamError, b as readDeviceSettings, bn as clearAtRestKeyCache, bt as parseCreditMultiplier, c as WORKBUDDY_CONNECT_VERSION, cn as NATIVE_MODALITY_BY_MODEL_ID, ct as deriveStableConversationId, dt as isBodyOversizeRefusal, en as isBareBase64Image, ft as isContextTooLongBody, g as createTuringSdk, gn as isDeviceId, gt as isToolSchemaRejectBody, h as createDeviceSdkPort, ht as isFirstMessageGateBody, i as processStartTimeMs, in as sniffImageMime, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jn as readAtRestKey, jt as selectPromoBadge, k as fallbackModelsFor, kn as macosNestedAppBundles, kt as attachBusyLevels, l as createFileRosterSeenStore, ln as imageDefaultFor, m as piAiRuntimeInfo, mt as isCredentialRejectedError, n as clearHostHeartbeat, nn as parseImageDataUrl, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as queueNoticeText, ot as conversationIdFromSessionId, p as resolveCnGateway, pt as isConversationIdGateBody, q as workbuddyAccountId, qt as IMAGE_TAG_TEXT_TO_IMAGE, r as isHeartbeatProcessAlive, rn as pickMediaModel, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as pruneTempDir, st as declaredTools, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as isWatermarkFreeImageModel, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, un as nativeModalityOf, ut as forceNeutralHead, v as describeDerivedDevices, vt as modelIdOfBody, w as FALLBACK_WORKBUDDY_MODELS, wn as findWorkbuddyAppExecutable, wt as prepareChatBody, x as saveDeviceProfile, xn as deriveAtRestKey, xt as parseReasoning, y as isDeviceMode, yn as WORKBUDDY_APP_EXECUTABLE_ENV, yt as openingEvidenceOfBody, z as defaultDesktopAuthDirs, zt as VIDEO_TAG_IMAGE_TO_VIDEO } from "./host-heartbeat-B0CDGEa8.js";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { appendFile, mkdir, open, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
4
4
|
import { randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-workbuddy",
|
|
3
3
|
"displayName": "DSH Connect WorkBuddy",
|
|
4
4
|
"description": "把本机登录的 WorkBuddy 模型(国内版与国际版)接入 DeepSeek Harness:每次刷新按上游目录自动读取每个模型的积分倍率,支持逐模型图片输入开关、多账号切换与账号池自动换号,并提供每日签到、卡片与输入框里的胶囊积分读数等只读积分概览。",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.25.1",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|