dsh-connect-workbuddy 5.24.11 → 5.24.14

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 CHANGED
@@ -1,5 +1,100 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.24.14 (2026-11-17)
4
+
5
+ > 版本号是 **patch**:只在工具 schema 的发送前改写链里增加一种形状,默认行为、出站字节、
6
+ > 既有开关与池子排序一律未动;无破坏性改动。来自 issue #274。
7
+
8
+ ### 修复:启用 REA MCP 后的 400 / 11129——`pattern` 里的 UTF-16 代理区转义
9
+
10
+ 报告者开启 REA MCP server 后,在 `deepseek-v4.1-flash` 上发任意消息都稳定得到
11
+ `400 / code 11129`,关掉该 server、保留其它能力后同一句话立刻通过。他按插件报错提示
12
+ 做了对照,并把 REA 导出的**全部 260 个工具**的 `inputSchema` 原样贴出——这是定位的关键。
13
+
14
+ 与 issue #253 的第二次报告一样,这些 schema 对插件已覆盖的每一种改写都是干净的:把它们
15
+ 逐字节送过 `prepareChatBody`,**260 个全部原样输出**,没有任何一处命中五类 draft-4 遗留
16
+ 写法或关键字值类型错误。所以被拒的是一种此前没人查过的形状:
17
+
18
+ ```
19
+ "allOf": [{ "pattern": "^[^\\uD800-\\uDFFF]*$" }]
20
+ ```
21
+
22
+ REA 用这条正则禁止文件系统路径里出现 UTF-16 代理码元。上游的 schema 解析器读不了
23
+ `\uXXXX` 形式的**代理区转义**,于是整个工具定义被拒。逐条真实实测(`deepseek-v4.1-flash`,
24
+ CN 网关,每次只改一处)确认:
25
+
26
+ - 带这条转义的两个工具(`close_binary`、`binary_session`)单独发就是 11129,另三个暴露的
27
+ 工具单独发都是 200;
28
+ - 只删掉那个 `allOf` 成员即通过,改删 NUL / 斜杠两个成员则仍 11129——是这条转义,不是
29
+ `allOf` 或字符类本身;
30
+ - 边界精确:`\uD7FF` 与 `\uE000` 通过,D800–DFFF 区间内每个转义都 11129(十六进制大小写
31
+ 不敏感);
32
+ - 拒绝**只针对 `pattern`**:同样的字面量放进 `description` / `title` / `const` / `enum` /
33
+ `default` / `format` 都是 200;
34
+ - 其它转义都通过:`\u0000`–`\uFFFF`、`\x00`、`\d`、ASCII 十六进制区间,乃至真实 emoji
35
+ (JSON 里的真代理对)。被拒的只是代理码元的 `\uXXXX` **写法**。
36
+
37
+ 改法是发送前改写链里加一条:`pattern` 字符串若含 `\uD800`–`\uDFFF` 的转义(大小写不敏感),
38
+ 就删掉这个 `pattern`。它与 #253 的既有规则同源——只动上游读不了的值、保留工具可用性、
39
+ 不猜写一个等价字符类、正确 schema 保持字节不变(缓存前缀稳定)。这条 `pattern` 是展示层的
40
+ 注解约束,REA 服务端仍对完整规范输入做校验,删掉它不会让非法路径真正通过。
41
+
42
+ 守护测试在 `tests/issue274-pattern-surrogate-escape.spec.ts`:正例(各类代理转义被删、递归
43
+ 到任意深度)与反例(边界外转义、其它关键字里的同款字面量、真实 emoji 一律不动)共 10 项。
44
+ 双向变异验证都做实:关掉修复 → 5 项正例变红;把匹配放宽到任意 `pattern` → 4 项反例变红。
45
+ 端到端复核:用**本报告原始 schema**、经真实 `prepareChatBody`(未手工修补)发送,精简 5 工具
46
+ 与完整 255 工具目录均从 11129 变为 **200 OK**,且只有那两个工具的输出发生变化。
47
+
48
+ 报错文案 `toolSchemaRejectAdvice()` 同步列入这条新改写,避免读者看到存活的 11129 时被
49
+ 告知插件只试过旧形状——那是 #253 留下过一次的「自信但错」的答复。
50
+
51
+ ## 5.24.13 (2026-11-17)
52
+
53
+ > 版本号是 **patch**:只改一处显示名回退顺序与一句错误文案;默认行为、出站字节、
54
+ > 开关与池子排序一律未动。
55
+
56
+ ### 改进:没有昵称时用登录名兜底,而不是显示「未命名账号」
57
+
58
+ `preferred_username` 一直从 JWT 里读出来了,却只当作 `nickname` 的同级候选。上游
59
+ 有些令牌**根本不带 `nickname`**,于是显示名落空、卡片退成「未命名账号」——那正是
60
+ #268 的观感。
61
+
62
+ 现在显示名有明确的三级顺序:**资料里的昵称 → JWT 的 `nickname` → `preferred_username`**。
63
+ 最后一级是登录名,在本上游通常是手机号;显示它不好看,但它是真的,也比一个不告诉用户
64
+ 任何信息的占位符好。`uid` 依旧绝不参与显示名——不透明 id 不是名字。
65
+
66
+ ### 顺带:拒绝的文案改准确
67
+
68
+ 身份全空时的那句错误原先写「请更新插件后重试」,这是错的:插件已经读遍它知道的每个
69
+ 来源,更新并不是解法。现在说明真实原因(上游没返回资料、令牌里也没有身份),并区分
70
+ 两种情况——接口临时异常(稍后重试)与登录方式本身不再提供身份信息。
71
+
72
+ 守护测试:昵称优先于登录名;没有昵称时用登录名而不是留空。变异验证两项都会红——去掉
73
+ `preferred_username` 这一级、把顺序颠倒。
74
+
75
+ ## 5.24.12 (2026-11-17)
76
+
77
+ > 版本号是 **patch**:只在一处「身份彻底为空」的边界上改为拒绝,默认行为、出站字节、
78
+ > 开关与池子排序一律未动;无破坏性改动。补的是 5.24.11 的同一条链。
79
+
80
+ ### 修复:身份全空的登录不再写出一个会覆盖别人的账号
81
+
82
+ 5.24.11 那条链有三层(新端点 → 拒绝空资料 → JWT 兜底),但还有一条更窄的路没堵:
83
+ **访问令牌不是 JWT**(上游没发 JWT 时不带 `.` 分段)**且两个资料端点都回 12151** 时,
84
+ `jwtIdentityOf` 按设计返回全空,`uid` 因此是**空字符串**。
85
+
86
+ `workbuddyAccountId` 用 `uin ?? uid ?? nickname` 求稳定值,而**空串不是 nullish**,
87
+ `''` 会穿过这条链,于是每个这样的账号都哈希到同一个常量——第二次登录覆盖第一次的文件。
88
+ 实测:两次不透明令牌登录都得到同一个 id。现象与 #267/#268/#269 报的覆盖完全一致。
89
+
90
+ 改法是一条判断:`uid` 为空时**不写 vault,直接以错误结束登录**,卡片显示可读的原因。
91
+ 没有编造身份、没有随机盐——一个说不出自己是谁的账号,不该被当成某个账号存下来;
92
+ 拒绝保存至少让上一个账号完好无损。
93
+
94
+ 守护测试 `refuses a login whose identity is empty everywhere, instead of overwriting`
95
+ 走完整链路(`oauthStart` → `oauthPoll`,stub 掉 fetch),断言结束在 `error` 而非
96
+ `account`。变异验证两项都会红:去掉这条判断、或把它弱化成只拦 `undefined`。
97
+
3
98
  ## 5.24.11 (2026-11-17)
4
99
 
5
100
  > 版本号是 **patch**:只纠正一处 OAuth 账号资料采集,默认行为、出站字节(仅登录成功那一刻)、
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-BWUu5KWc.js";
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-Bd-w0eby.js";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { dirname, join } from "node:path";
5
5
  import { realpathSync } from "node:fs";
@@ -3944,7 +3944,7 @@ function isToolSchemaRejectBody(body) {
3944
3944
  * function exists to replace. When `normalizeMetaSchemaTypes` learns a new
3945
3945
  * family, this string has to learn it too.
3946
3946
  */
3947
- const TOOL_SCHEMA_REWRITTEN_KEYWORDS = "元组式 `items`、布尔 `exclusiveMinimum`/`exclusiveMaximum`、`required` 非数组或含重复项、外部 `$ref`,以及关键字的值类型写错(如 `title: 1`、`minimum: \"0\"`、`allOf: {}`、`type: []`、`enum`/`examples` 写成标量)";
3947
+ const TOOL_SCHEMA_REWRITTEN_KEYWORDS = "元组式 `items`、布尔 `exclusiveMinimum`/`exclusiveMaximum`、`required` 非数组或含重复项、外部 `$ref`,以及关键字的值类型写错(如 `title: 1`、`minimum: \"0\"`、`allOf: {}`、`type: []`、`enum`/`examples` 写成标量),以及 `pattern` 里的 UTF-16 代理区转义 `\\uD800`–`\\uDFFF`";
3948
3948
  /**
3949
3949
  * One actionable sentence for a `11129` refusal, naming what was already fixed
3950
3950
  * and what the user can still do.
@@ -6023,6 +6023,7 @@ function normalizeToolChoice(obj) {
6023
6023
  * | `required` as a STRING instead of an array | 11129 | one-element array |
6024
6024
  * | `required` containing DUPLICATES | 11129 | de-duplicated |
6025
6025
  * | an EXTERNAL `$ref` (`https://…`, `//host/…`) | 11129 | the reference object removed |
6026
+ * | a `pattern` with a `\uD800`–`\uDFFF` surrogate escape (issue #274) | 11129 | the offending `pattern` dropped |
6026
6027
  *
6027
6028
  * WHAT IS DELIBERATELY NOT TOUCHED.
6028
6029
  *
@@ -6080,6 +6081,7 @@ function normalizeSchemaNode(node, depth = 0) {
6080
6081
  normalizeRequired(schema);
6081
6082
  dropExternalRef(schema);
6082
6083
  normalizeMetaSchemaTypes(schema);
6084
+ normalizePatternSurrogates(schema);
6083
6085
  for (const key of SCHEMA_CHILD_MAPS) {
6084
6086
  const child = schema[key];
6085
6087
  if (typeof child !== "object" || child === null || Array.isArray(child)) continue;
@@ -6207,6 +6209,63 @@ function normalizeMetaSchemaTypes(schema) {
6207
6209
  normalizeTypeKeyword(schema);
6208
6210
  }
6209
6211
  /**
6212
+ * Drop a `pattern` whose regex contains a UTF-16 SURROGATE escape (issue #274).
6213
+ *
6214
+ * THE REPORT. A user enabled the REA MCP server and every message answered
6215
+ * `400 / 11129` on `deepseek-v4.1-flash`; turning the server off made the same
6216
+ * sentence pass. The reporter pasted all 260 tool schemas — and, as with the
6217
+ * second #253 report, their value was the METHOD: the definitions were clean of
6218
+ * every rewrite this module already owns (fed through `prepareChatBody`, all 260
6219
+ * came out BYTE-IDENTICAL), so the refusal had to be a shape nobody had looked
6220
+ * for. The one construct no other tool shared was a regex escape for the
6221
+ * surrogate code-unit range:
6222
+ *
6223
+ * "allOf": [{ "pattern": "^[^\\uD800-\\uDFFF]*$" }]
6224
+ *
6225
+ * MEASURED, one body at a time on the real CN gateway, `deepseek-v4.1-flash`:
6226
+ *
6227
+ * - the two tools carrying that escape (`close_binary`, `binary_session`)
6228
+ * answer 11129 alone; the other three exposed tools answer 200;
6229
+ * - removing ONLY that `allOf` member makes the tool pass (removing the NUL
6230
+ * and slash members instead does not) — it is this escape, not `allOf`
6231
+ * or the regex class around it;
6232
+ * - the boundary is exact: `\uD7FF` and `\uE000` answer 200, every escape in
6233
+ * `\uD800`–`\uDFFF` answers 11129 (upper/lower/mixed hex digits alike);
6234
+ * - the rejection is SPECIFIC TO `pattern`: the same literal in `description`,
6235
+ * `title`, `const`, `enum`, `default` and `format` all answer 200;
6236
+ * - other escapes are fine — `\u0000`–`\uFFFF`, `\x00`, `\d`, an ASCII hex
6237
+ * range, even a literal emoji (a real surrogate pair in the JSON) all pass.
6238
+ * It is specifically the `\uXXXX` SPELLING of a surrogate code unit that
6239
+ * the upstream's schema parser cannot take.
6240
+ *
6241
+ * WHY DROP THE PATTERN, NOT THE TOOL OR THE ESCAPE. The pattern is an ANNOTATION
6242
+ * constraint — REA used it to reject lone surrogates in a filesystem path. The
6243
+ * MCP server still validates complete canonical inputs on its side, so removing
6244
+ * the display copy cannot let an invalid path through. Rewriting `\uD800` into
6245
+ * an equivalent character class would be a guess about the upstream parser the
6246
+ * evidence does not support; dropping one member's constraint keeps the tool
6247
+ * callable and matches the "repair, never silently remove a capability" rule
6248
+ * from {@link normalizeMetaSchemaTypes}. The member left `{}` is harmless:
6249
+ * `allOf: [{}]` was measured at 200, and an `allOf` emptied entirely is already
6250
+ * dropped by `normalizeMetaSchemaTypes` (an absent constraint means what an
6251
+ * empty one says). So the drop is all that is needed — no pruning pass, no
6252
+ * change to the schema's structure.
6253
+ *
6254
+ * A correct schema — no surrogate escape — leaves this function byte-identical,
6255
+ * so the prompt prefix stays stable for caching.
6256
+ */
6257
+ function normalizePatternSurrogates(schema) {
6258
+ const pattern = schema["pattern"];
6259
+ if (typeof pattern !== "string" || !SURROGATE_ESCAPE_RE.test(pattern)) return;
6260
+ delete schema["pattern"];
6261
+ }
6262
+ /**
6263
+ * A `\u` escape whose four hex digits name a UTF-16 surrogate code unit
6264
+ * (D800–DFFF). Case-insensitive on the hex digits: `\ud800` and `\uDaFf` are
6265
+ * refused just like the uppercase spelling (measured).
6266
+ */
6267
+ const SURROGATE_ESCAPE_RE = /\\u[dD][89aAbBfF][0-9a-fA-F]{2}/u;
6268
+ /**
6210
6269
  * Repair `type`, keeping every member the upstream would have taken (issue #253).
6211
6270
  *
6212
6271
  * Measured: `type: ["string","null"]` is ACCEPTED as sent, and so is
@@ -11267,7 +11326,7 @@ function describeRosterSeenPayload(raw) {
11267
11326
  //#endregion
11268
11327
  //#region src/version.ts
11269
11328
  /** The npm package version this build was produced from. */
11270
- const WORKBUDDY_CONNECT_VERSION = "5.24.11";
11329
+ const WORKBUDDY_CONNECT_VERSION = "5.24.14";
11271
11330
  //#endregion
11272
11331
  //#region src/host-heartbeat.ts
11273
11332
  /**
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-BWUu5KWc.js";
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-Bd-w0eby.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";
@@ -11019,12 +11019,12 @@ async function collectAccount(session, accessToken, tokenData, doFetch) {
11019
11019
  "userId",
11020
11020
  "UserID"
11021
11021
  ]) || jwt.sub;
11022
+ if (uid === "") throw new Error("无法识别这个账号:上游没有返回账号资料,登录令牌里也没有可用的身份信息。这通常是上游资料接口临时异常,请稍后重新登录;如果一直这样,说明这种登录方式不再提供身份信息。");
11022
11023
  const nickname = optionalString(profile, [
11023
11024
  "nickname",
11024
11025
  "NickName",
11025
- "nickname",
11026
11026
  "ScreenName"
11027
- ]) ?? optionalString(jwt, ["nickname", "preferredUsername"]);
11027
+ ]) ?? optionalString(jwt, ["nickname"]) ?? optionalString(jwt, ["preferredUsername"]);
11028
11028
  const uin = optionalString(profile, ["uin", "Uin"]) ?? optionalString(jwt, ["uin"]);
11029
11029
  const enterpriseId = optionalString(profile, ["enterpriseId", "EnterpriseId"]);
11030
11030
  const expiresAtMs = expiryMs(tokenData, ["expiresAt", "expires_at"], ["expiresIn", "expires_in"]) ?? 0;
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.24.11",
5
+ "version": "5.24.14",
6
6
  "author": "dingminhua",
7
7
  "copyright": "Copyright (c) 2026 LaoDing",
8
8
  "license": "MIT",