dsh-connect-workbuddy 5.31.0 → 5.31.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
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.31.1 (2026-11-23)
|
|
4
|
+
|
|
5
|
+
> 兼容版:修复 DSH 0.2.3 起贴图失败(`maxImageBytes must be a positive integer` / `INVALID_ATTACHMENT_REF`)。
|
|
6
|
+
|
|
7
|
+
> ⚠️ 本版在 5.31.0 发布之后新增,须单独发布。
|
|
8
|
+
|
|
9
|
+
- **issue #289**:DSH 0.2.3 + `dsh-llm-pi-ai@0.2.3` 起,粘贴任意图片发送都会失败,
|
|
10
|
+
纯文字正常,`INVALID_ATTACHMENT_REF`。
|
|
11
|
+
- **根因(已按 0.2.3 实际源码核实)**:从 0.2.3 起 resolved profile 新增必填字段
|
|
12
|
+
`requestImageBudgetCount`,且把 per-image 上限字段从 `requestImageMaxBytes` 改名成
|
|
13
|
+
`maxImageBytes`(配置侧仍叫 `requestImageMaxBytes`,`resolveProfiles()` 做映射)。本路由
|
|
14
|
+
手工拼 resolved profile、不走宿主的 `resolveProfiles()`,两处默认值都不会替它填:
|
|
15
|
+
- 缺 `requestImageBudgetCount` → `resolveImageRequestBudget()` 里
|
|
16
|
+
`maxRequestImageBytes / undefined / 4` 得 `NaN`,附件层拒收;
|
|
17
|
+
- 只写旧字段名 → 0.2.3 读不到 per-image 上限(退回自己的默认),本路由钉的 1 MiB 失效。
|
|
18
|
+
- **修法一份 profile 兼容两代宿主**:`REQUEST_IMAGE_BUDGETS` 同时写 `requestImageMaxBytes`
|
|
19
|
+
(0.2.2 及以前)与 `maxImageBytes`(0.2.3 起),并补 `requestImageBudgetCount: 14`。
|
|
20
|
+
14 是刻意选的:`floor(20971520 / 14 / 4) * 3 = 1_123_473 > 1 MiB`,于是显式上限仍是
|
|
21
|
+
1 MiB;换成宿主默认 20 会让「均摊份额」降到 786432,悄悄把上限压小(15 更是差 1 字节)。
|
|
22
|
+
新增字段在 0.2.2 上只是resolved profile 上多出的键,按名读取时惰性忽略,两代宿主同一份对象。
|
|
23
|
+
- 测试:新增 `tests/issue289-image-budget.spec.ts`(5 条),从真实 adapter 取 resolved profile,
|
|
24
|
+
逐字复刻 0.2.3 的预算公式断言得到正的 1 MiB 而非 `NaN`,并钉住两个字段名与 0.2.2 字段仍在。
|
|
25
|
+
四处变异验证均变红(去掉 divisor / 去掉新上限名 / 把 divisor 改成 20 / 去掉旧上限名)。
|
|
26
|
+
`pnpm run check` 全过。Host 侧改动,需重启 DSH 加载。
|
|
27
|
+
|
|
3
28
|
## 5.31.0 (2026-11-22)
|
|
4
29
|
|
|
5
30
|
> 修复版:上游限流时,模型目录不再静默缩成一个模型,并且会明说「目录降级」。
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Dn as findWorkbuddyAppExecutableWithSource, F as WorkBuddyCredentialStore, Fn as hostPeersInfo, In as resolveDshHome, J as workbuddyOwnAuthPath, N as WORKBUDDY_AUTH_FILE_ENV, P as WORKBUDDY_VAULT_DIRNAME, R as defaultDesktopAuthCandidates, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, W as legacyWorkbuddyOwnAuthPath, X as APP_VERSION, Y as workbuddyVaultDir, _n as deriveDeviceId, a as readHostHeartbeat, b as readDeviceSettings, bn as protectCredentialDirectory, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, g as createTuringSdk, gn as readDeviceSalt, hn as ensureDeviceSalt, lt as describeRequestHeaderNames, m as piAiRuntimeInfo, mn as readDeviceTokenFile, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, u as describeRosterSeenPayload, w as FALLBACK_WORKBUDDY_MODELS, xn as WORKBUDDY_APP_EXECUTABLE_ENV, yn as inspectCredentialDirectory, z as defaultDesktopAuthDirs } from "./host-heartbeat-
|
|
2
|
+
import { Dn as findWorkbuddyAppExecutableWithSource, F as WorkBuddyCredentialStore, Fn as hostPeersInfo, In as resolveDshHome, J as workbuddyOwnAuthPath, N as WORKBUDDY_AUTH_FILE_ENV, P as WORKBUDDY_VAULT_DIRNAME, R as defaultDesktopAuthCandidates, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, W as legacyWorkbuddyOwnAuthPath, X as APP_VERSION, Y as workbuddyVaultDir, _n as deriveDeviceId, a as readHostHeartbeat, b as readDeviceSettings, bn as protectCredentialDirectory, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, g as createTuringSdk, gn as readDeviceSalt, hn as ensureDeviceSalt, lt as describeRequestHeaderNames, m as piAiRuntimeInfo, mn as readDeviceTokenFile, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, u as describeRosterSeenPayload, w as FALLBACK_WORKBUDDY_MODELS, xn as WORKBUDDY_APP_EXECUTABLE_ENV, yn as inspectCredentialDirectory, z as defaultDesktopAuthDirs } from "./host-heartbeat-C8-jkKZv.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { realpathSync } from "node:fs";
|
|
@@ -11607,7 +11607,7 @@ function describeRosterSeenPayload(raw) {
|
|
|
11607
11607
|
//#endregion
|
|
11608
11608
|
//#region src/version.ts
|
|
11609
11609
|
/** The npm package version this build was produced from. */
|
|
11610
|
-
const WORKBUDDY_CONNECT_VERSION = "5.31.
|
|
11610
|
+
const WORKBUDDY_CONNECT_VERSION = "5.31.1";
|
|
11611
11611
|
//#endregion
|
|
11612
11612
|
//#region src/host-heartbeat.ts
|
|
11613
11613
|
/**
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CREDENTIAL_REJECTED_CODE, $t as imageModelChoices, A as withoutRouters, An as macosBundleExecutable, At as attachBusyLevels, B as defaultDesktopAuthPath, Bt as VIDEO_TAG_IMAGE_TO_VIDEO, C as setDeviceMode, Cn as deriveAtRestKey, Ct as parseUpstreamModel, D as applyContextBudgets, Dt as requestEvidenceOf, E as WorkBuddyCatalog, En as findWorkbuddyAppExecutable, Et as regionOf, F as WorkBuddyCredentialStore, Ft as lastRefusalFor, G as parseWorkBuddyAuth, Gt as resolveVideoParams, H as isEncryptedCredentialError, Ht as WorkBuddyVideoError, I as WorkBuddyEncryptedCredentialError, In as resolveDshHome, It as offDefaultFor, J as workbuddyOwnAuthPath, Jt as IMAGE_TAG_TEXT_TO_IMAGE, K as preferredAccountName, Kt as IMAGE_SIZE_LIMITS_WIDE, L as authFileName, Ln as withFileLock, Lt as offRefused, M as WORKBUDDY_AUTH_FILENAME, Mn as openEncryptedField, Mt as selectPromoBadge, N as WORKBUDDY_AUTH_FILE_ENV, Nn as readAtRestKey, Nt as REFUSES_OFF_MODEL_IDS, O as deriveCatalog, On as isEncryptedFieldWrapper, Ot as rewriteSessionTitleModel, Pn as workbuddyAppExecutableCandidates, Pt as defaultOffModelIds, Q as CONTEXT_OVERFLOW_MARKER, Qt as imageMimeForPath, R as defaultDesktopAuthCandidates, Rn as writeFileAtomic, Rt as recordRefusal, S as saveDeviceSdkSettings, Sn as clearAtRestKeyCache, St as parseReasoning, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as fetchAtRestKeyPayload, Tt as prepareChatBody, U as isVaultAccountId, Ut as parseSupportedSecondsRange, V as hasEncryptedCredentialFields, Vt as VIDEO_TAG_TEXT_TO_VIDEO, W as legacyWorkbuddyOwnAuthPath, Wt as pickVideoModel, X as APP_VERSION, Xt as WorkBuddyImageError, Yt as MAX_INPUT_IMAGE_BYTES, Z as BODY_OVERSIZE_MARKER, Zt as imageDataUrl, _ as createDeviceProfileLookup, _t as isToolSchemaRejectBody, a as readHostHeartbeat, an as sniffImageMime, at as classifyUpstreamError, b as readDeviceSettings, bt as openingEvidenceOfBody, c as WORKBUDDY_CONNECT_VERSION, cn as pruneTempDir, ct as deriveStableConversationId, dn as isRouterModelId, dt as growthHostOf, en as imageSizeLimitsOf, fn as nativeModalityOf, ft as isBodyOversizeRefusal, g as createTuringSdk, gt as isFirstMessageGateBody, h as createDeviceSdkPort, ht as isCredentialRejectedError, i as processStartTimeMs, in as pickMediaModel, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jn as macosNestedAppBundles, jt as promoBadgeTone, k as fallbackModelsFor, kn as isWorkbuddyBundle, kt as toolSchemaRejectAdvice, l as createFileRosterSeenStore, ln as NATIVE_MODALITY_BY_MODEL_ID, m as piAiRuntimeInfo, mt as isConversationIdGateBody, n as clearHostHeartbeat, nn as isWatermarkFreeImageModel, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as parseQueueAnswer, ot as conversationIdFromSessionId, p as resolveCnGateway, pt as isContextTooLongBody, q as workbuddyAccountId, qt as IMAGE_TAG_IMAGE_TO_IMAGE, r as isHeartbeatProcessAlive, rn as parseImageDataUrl, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as queueNoticeText, st as declaredTools, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as isBareBase64Image, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, un as imageDefaultFor, ut as forceNeutralHead, v as describeDerivedDevices, vn as isDeviceId, vt as knownRegionOf, w as FALLBACK_WORKBUDDY_MODELS, wn as deriveAtRestKeyId, wt as perturbChannelFingerprints, x as saveDeviceProfile, xn as WORKBUDDY_APP_EXECUTABLE_ENV, xt as parseCreditMultiplier, y as isDeviceMode, yt as modelIdOfBody, z as defaultDesktopAuthDirs, zt as withEffectiveOff } from "./host-heartbeat-
|
|
1
|
+
import { $ as CREDENTIAL_REJECTED_CODE, $t as imageModelChoices, A as withoutRouters, An as macosBundleExecutable, At as attachBusyLevels, B as defaultDesktopAuthPath, Bt as VIDEO_TAG_IMAGE_TO_VIDEO, C as setDeviceMode, Cn as deriveAtRestKey, Ct as parseUpstreamModel, D as applyContextBudgets, Dt as requestEvidenceOf, E as WorkBuddyCatalog, En as findWorkbuddyAppExecutable, Et as regionOf, F as WorkBuddyCredentialStore, Ft as lastRefusalFor, G as parseWorkBuddyAuth, Gt as resolveVideoParams, H as isEncryptedCredentialError, Ht as WorkBuddyVideoError, I as WorkBuddyEncryptedCredentialError, In as resolveDshHome, It as offDefaultFor, J as workbuddyOwnAuthPath, Jt as IMAGE_TAG_TEXT_TO_IMAGE, K as preferredAccountName, Kt as IMAGE_SIZE_LIMITS_WIDE, L as authFileName, Ln as withFileLock, Lt as offRefused, M as WORKBUDDY_AUTH_FILENAME, Mn as openEncryptedField, Mt as selectPromoBadge, N as WORKBUDDY_AUTH_FILE_ENV, Nn as readAtRestKey, Nt as REFUSES_OFF_MODEL_IDS, O as deriveCatalog, On as isEncryptedFieldWrapper, Ot as rewriteSessionTitleModel, Pn as workbuddyAppExecutableCandidates, Pt as defaultOffModelIds, Q as CONTEXT_OVERFLOW_MARKER, Qt as imageMimeForPath, R as defaultDesktopAuthCandidates, Rn as writeFileAtomic, Rt as recordRefusal, S as saveDeviceSdkSettings, Sn as clearAtRestKeyCache, St as parseReasoning, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as fetchAtRestKeyPayload, Tt as prepareChatBody, U as isVaultAccountId, Ut as parseSupportedSecondsRange, V as hasEncryptedCredentialFields, Vt as VIDEO_TAG_TEXT_TO_VIDEO, W as legacyWorkbuddyOwnAuthPath, Wt as pickVideoModel, X as APP_VERSION, Xt as WorkBuddyImageError, Yt as MAX_INPUT_IMAGE_BYTES, Z as BODY_OVERSIZE_MARKER, Zt as imageDataUrl, _ as createDeviceProfileLookup, _t as isToolSchemaRejectBody, a as readHostHeartbeat, an as sniffImageMime, at as classifyUpstreamError, b as readDeviceSettings, bt as openingEvidenceOfBody, c as WORKBUDDY_CONNECT_VERSION, cn as pruneTempDir, ct as deriveStableConversationId, dn as isRouterModelId, dt as growthHostOf, en as imageSizeLimitsOf, fn as nativeModalityOf, ft as isBodyOversizeRefusal, g as createTuringSdk, gt as isFirstMessageGateBody, h as createDeviceSdkPort, ht as isCredentialRejectedError, i as processStartTimeMs, in as pickMediaModel, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jn as macosNestedAppBundles, jt as promoBadgeTone, k as fallbackModelsFor, kn as isWorkbuddyBundle, kt as toolSchemaRejectAdvice, l as createFileRosterSeenStore, ln as NATIVE_MODALITY_BY_MODEL_ID, m as piAiRuntimeInfo, mt as isConversationIdGateBody, n as clearHostHeartbeat, nn as isWatermarkFreeImageModel, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as parseQueueAnswer, ot as conversationIdFromSessionId, p as resolveCnGateway, pt as isContextTooLongBody, q as workbuddyAccountId, qt as IMAGE_TAG_IMAGE_TO_IMAGE, r as isHeartbeatProcessAlive, rn as parseImageDataUrl, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as queueNoticeText, st as declaredTools, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as isBareBase64Image, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, un as imageDefaultFor, ut as forceNeutralHead, v as describeDerivedDevices, vn as isDeviceId, vt as knownRegionOf, w as FALLBACK_WORKBUDDY_MODELS, wn as deriveAtRestKeyId, wt as perturbChannelFingerprints, x as saveDeviceProfile, xn as WORKBUDDY_APP_EXECUTABLE_ENV, xt as parseCreditMultiplier, y as isDeviceMode, yt as modelIdOfBody, z as defaultDesktopAuthDirs, zt as withEffectiveOff } from "./host-heartbeat-C8-jkKZv.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";
|
|
@@ -1881,13 +1881,42 @@ const WORKBUDDY_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
|
1881
1881
|
* number to put in `maxRequestImages` — with a comment saying where it came
|
|
1882
1882
|
* from. Do not "borrow" the host's 50: it belongs to the host's own pi-ai
|
|
1883
1883
|
* routes, not to WorkBuddy.
|
|
1884
|
+
*
|
|
1885
|
+
* THE PER-IMAGE CAP HAS TWO SPELLINGS, AND BOTH MUST BE STATED (issue #289).
|
|
1886
|
+
* Up to 0.2.2 the RESOLVED profile carried `requestImageMaxBytes`; from 0.2.3
|
|
1887
|
+
* the host renamed that field to `maxImageBytes` on the resolved profile
|
|
1888
|
+
* (`resolveProfiles` maps the CONFIG spelling `requestImageMaxBytes` to the
|
|
1889
|
+
* RESOLVED spelling `maxImageBytes`). This route hand-builds its resolved
|
|
1890
|
+
* profile — it never goes through `resolveProfiles()` — so neither rename can
|
|
1891
|
+
* happen for it. Stating both is what keeps the 1 MiB cap on both host lines:
|
|
1892
|
+
* 0.2.2 reads `requestImageMaxBytes`, 0.2.3 reads `maxImageBytes`.
|
|
1893
|
+
*
|
|
1894
|
+
* `requestImageBudgetCount` is REQUIRED from 0.2.3, where
|
|
1895
|
+
* `resolveImageRequestBudget()` divides the aggregate byte budget by it:
|
|
1896
|
+
*
|
|
1897
|
+
* allocated = floor(maxRequestImageBytes / requestImageBudgetCount / 4) * 3
|
|
1898
|
+
* cap = min(allocated, maxImageBytes ?? catalogBytes ?? 1 MiB)
|
|
1899
|
+
*
|
|
1900
|
+
* A hand-built profile that omitted it produced `division by undefined` →
|
|
1901
|
+
* `NaN`, which the attachment layer rejected as `INVALID_ATTACHMENT_REF` —
|
|
1902
|
+
* the image never reached the model. 14 is the divisor that keeps the equal
|
|
1903
|
+
* share ABOVE 1 MiB (floor(20971520 / 14 / 4) * 3 = 1_123_473), so the
|
|
1904
|
+
* explicit `maxImageBytes` cap below still decides the exact 1 MiB. Divisor
|
|
1905
|
+
* 15 already yields 1_048_575 — one byte short — and 20 yields 786432, so
|
|
1906
|
+
* any larger divisor would make the SHARE the cap and silently narrow it.
|
|
1907
|
+
*
|
|
1908
|
+
* On 0.2.2 these three fields are simply extra keys on a resolved profile the
|
|
1909
|
+
* adapter reads by name; they are inert there, so this one object serves both
|
|
1910
|
+
* host lines without a version branch.
|
|
1884
1911
|
*/
|
|
1885
1912
|
const REQUEST_IMAGE_BUDGETS = {
|
|
1886
1913
|
maxRequestImages: 1e6,
|
|
1887
1914
|
imageOffloadCountQuantum: 1e6,
|
|
1888
1915
|
maxRequestImageBytes: 20971520,
|
|
1889
1916
|
requestImagePixelBudget: 4194304,
|
|
1890
|
-
requestImageMaxBytes: 1048576
|
|
1917
|
+
requestImageMaxBytes: 1048576,
|
|
1918
|
+
maxImageBytes: 1048576,
|
|
1919
|
+
requestImageBudgetCount: 14
|
|
1891
1920
|
};
|
|
1892
1921
|
/**
|
|
1893
1922
|
* Inert pi-ai auth plane. The workbuddy route authenticates only through the
|
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.31.
|
|
5
|
+
"version": "5.31.1",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|