dsh-connect-workbuddy 5.24.5 → 5.24.6
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,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.24.6 (2026-11-15)
|
|
4
|
+
|
|
5
|
+
> 版本号是 **patch**:修一处「工具声明被悄悄放宽」的语义丢失,无新增配置项、无接口变化。
|
|
6
|
+
> 来自 PR #259(vb2250158 / 秋雨之忆)。
|
|
7
|
+
|
|
8
|
+
### 修复:显式 `additionalItems: false` 被丢成「接受任意元素」
|
|
9
|
+
|
|
10
|
+
draft-4 的 tuple `items` 转成 2020-12 的 `prefixItems` + `items` 时,尾部约束被一律写成 `items: {}`。
|
|
11
|
+
`{}` 的意思是「什么都可以」,但调用方可能写的是:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{ "type": "array", "items": [{"type": "string"}], "additionalItems": false }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`additionalItems: false` 是一个**显式闭合声明**——「超出这个位置的东西一律不接受」。把它变成 `{}`
|
|
18
|
+
等于把约束**放宽**,工具会接受调用方明确说过不接受的多余元素。
|
|
19
|
+
|
|
20
|
+
这正是本项目在 5.24.2 的注释里写过、却在实现里做反了的事:「硬造一个约束比丢掉一个约束更糟」是对的,
|
|
21
|
+
但**丢掉调用方真实写下的约束同样是错的**,而且更隐蔽——它不报错,只是让声明变得比原来宽松。
|
|
22
|
+
|
|
23
|
+
现在显式的布尔值或 schema 尾部都会被保留:`false` → `items: false`,`true` → `items: true`,
|
|
24
|
+
对象 → `items: <schema>`(并递归归一),缺省 → 继续开放为 `{}`。
|
|
25
|
+
|
|
26
|
+
实测 `items: false` / `items: true` 在 `deepseek-v4.1-flash` 上全部 200,所以保留它们不引入新拒绝。
|
|
27
|
+
|
|
28
|
+
### 评审补充:空 tuple 时不能丢掉调用方自己的 `prefixItems`
|
|
29
|
+
|
|
30
|
+
原实现遇到空 tuple 会无条件 `delete prefixItems`。但「空 tuple」和「调用方写了非空 `prefixItems`」
|
|
31
|
+
是两件事:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "items": [], "prefixItems": [{"type": "string"}], "additionalItems": false }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
实测这个组合**原样发送会被拒**(11129),而**丢掉空 tuple、保留 `prefixItems`** 则 200。
|
|
38
|
+
所以该丢的是空 tuple,不是调用方真实的位置声明——删掉它会重现同一类「声明被放宽」的问题。
|
|
39
|
+
|
|
40
|
+
### 评审补充二:一条名不副实的守卫测试
|
|
41
|
+
|
|
42
|
+
本 PR 删掉了 5.24.5 的一条测试,而那条在当时是有效的变异守卫。恢复后**重新做变异**才发现:
|
|
43
|
+
它其实抓不到「禁用空 tuple 分支」——因为后跑的类型修复也会删掉空 `prefixItems`,两条代码路径的
|
|
44
|
+
可见输出完全相同。原注释写着「this is the mutation that matters」,**这句话是错的**。
|
|
45
|
+
|
|
46
|
+
已改成如实说明:这条测试钉的是最终结果,不是那个分支本身;分支仍然保留,理由是它防的是两遍处理的
|
|
47
|
+
顺序(万一将来类型修复不再删空 `prefixItems`,或跑到前面去,这个分支仍然是兜底)。
|
|
48
|
+
|
|
49
|
+
保留一条抓不住变异的测试是可以的,**但注释不能声称它抓得住**。
|
|
50
|
+
|
|
51
|
+
变异验证:尾部不认布尔 → 红 5 条;空 tuple 无条件删 `prefixItems` → 红 1 条。
|
|
52
|
+
|
|
3
53
|
## 5.24.5 (2026-11-14)
|
|
4
54
|
|
|
5
55
|
> 版本号是 **patch**:只改一句报错文案,外加一条测试。无行为变化。来自 issue #253 的收尾自查。
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Cn as findWorkbuddyAppExecutableWithSource, F as WorkBuddyCredentialStore, J as workbuddyOwnAuthPath, Mn as resolveDshHome, 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 WORKBUDDY_APP_EXECUTABLE_ENV, a as readHostHeartbeat, b as readDeviceSettings, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as ensureDeviceSalt, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, fn as readDeviceSalt, g as createTuringSdk, gn as protectCredentialDirectory, hn as inspectCredentialDirectory, jn as hostPeersInfo, ln as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, m as piAiRuntimeInfo, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as deriveDeviceId, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, st as describeRequestHeaderNames, u as describeRosterSeenPayload, un as readDeviceTokenFile, w as FALLBACK_WORKBUDDY_MODELS, z as defaultDesktopAuthDirs } from "./host-heartbeat-
|
|
2
|
+
import { Cn as findWorkbuddyAppExecutableWithSource, F as WorkBuddyCredentialStore, J as workbuddyOwnAuthPath, Mn as resolveDshHome, 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 WORKBUDDY_APP_EXECUTABLE_ENV, a as readHostHeartbeat, b as readDeviceSettings, c as WORKBUDDY_CONNECT_VERSION, d as rosterSeenPath, dn as ensureDeviceSalt, et as DEFAULT_WIRE_PROFILE, f as WORKBUDDY_CN_BASE_ENV, fn as readDeviceSalt, g as createTuringSdk, gn as protectCredentialDirectory, hn as inspectCredentialDirectory, jn as hostPeersInfo, ln as WORKBUDDY_DEVICE_TOKEN_FILE_ENV, m as piAiRuntimeInfo, o as workbuddyHostHeartbeatPath, p as resolveCnGateway, pn as deriveDeviceId, r as isHeartbeatProcessAlive, rt as WorkBuddyUpstreamClient, st as describeRequestHeaderNames, u as describeRosterSeenPayload, un as readDeviceTokenFile, w as FALLBACK_WORKBUDDY_MODELS, z as defaultDesktopAuthDirs } from "./host-heartbeat-1ytBqhSr.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { realpathSync } from "node:fs";
|
|
@@ -6162,10 +6162,8 @@ const SCHEMA_STRING_LIST_KEYWORDS = [
|
|
|
6162
6162
|
*
|
|
6163
6163
|
* A tuple `items` is a LIST; the modern spec splits it into `prefixItems` (the
|
|
6164
6164
|
* per-position schemas, same order) plus `items` (the schema for everything
|
|
6165
|
-
* past the end).
|
|
6166
|
-
*
|
|
6167
|
-
* correct — inventing `false` would FORBID extra elements, which the original
|
|
6168
|
-
* never said.
|
|
6165
|
+
* past the end). An explicit additionalItems boolean or schema remains the
|
|
6166
|
+
* tail constraint, including an empty tuple. An unspecified tail remains open.
|
|
6169
6167
|
*
|
|
6170
6168
|
* Measured: `prefixItems` + `items: {}` answers 200 on `deepseek-v4.1-flash`,
|
|
6171
6169
|
* `deepseek-v4-pro`, `glm-5.3`, `kimi-k3.1-pro` and `mimo-v2.6-pro` — the five
|
|
@@ -6176,15 +6174,12 @@ function normalizeItems(schema) {
|
|
|
6176
6174
|
const items = schema["items"];
|
|
6177
6175
|
if (!Array.isArray(items)) return;
|
|
6178
6176
|
if (items.length === 0) {
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
delete schema["
|
|
6182
|
-
|
|
6183
|
-
return;
|
|
6184
|
-
}
|
|
6185
|
-
if (schema["prefixItems"] === void 0) schema["prefixItems"] = items;
|
|
6177
|
+
const userPrefix = schema["prefixItems"];
|
|
6178
|
+
if (Array.isArray(userPrefix) && userPrefix.length > 0) schema["prefixItems"] = userPrefix;
|
|
6179
|
+
else delete schema["prefixItems"];
|
|
6180
|
+
} else if (schema["prefixItems"] === void 0) schema["prefixItems"] = items;
|
|
6186
6181
|
const tail = schema["additionalItems"];
|
|
6187
|
-
schema["items"] = typeof tail === "object" && tail !== null && !Array.isArray(tail) ? tail : {};
|
|
6182
|
+
schema["items"] = typeof tail === "boolean" || typeof tail === "object" && tail !== null && !Array.isArray(tail) ? tail : {};
|
|
6188
6183
|
delete schema["additionalItems"];
|
|
6189
6184
|
}
|
|
6190
6185
|
/**
|
|
@@ -11118,7 +11113,7 @@ function describeRosterSeenPayload(raw) {
|
|
|
11118
11113
|
//#endregion
|
|
11119
11114
|
//#region src/version.ts
|
|
11120
11115
|
/** The npm package version this build was produced from. */
|
|
11121
|
-
const WORKBUDDY_CONNECT_VERSION = "5.24.
|
|
11116
|
+
const WORKBUDDY_CONNECT_VERSION = "5.24.6";
|
|
11122
11117
|
//#endregion
|
|
11123
11118
|
//#region src/host-heartbeat.ts
|
|
11124
11119
|
/**
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CREDENTIAL_REJECTED_CODE, $t as isWatermarkFreeImageModel, A as withoutRouters, An as workbuddyAppExecutableCandidates, At as REFUSES_OFF_MODEL_IDS, B as defaultDesktopAuthPath, Bt as parseSupportedSecondsRange, C as setDeviceMode, Ct as regionOf, D as applyContextBudgets, Dn as macosNestedAppBundles, Dt as attachBusyLevels, E as WorkBuddyCatalog, En as macosBundleExecutable, Et as toolSchemaRejectAdvice, F as WorkBuddyCredentialStore, Ft as recordRefusal, G as parseWorkBuddyAuth, Gt as IMAGE_TAG_TEXT_TO_IMAGE, H as isEncryptedCredentialError, Ht as resolveVideoParams, I as WorkBuddyEncryptedCredentialError, It as withEffectiveOff, J as workbuddyOwnAuthPath, Jt as imageDataUrl, K as preferredAccountName, Kt as MAX_INPUT_IMAGE_BYTES, L as authFileName, Lt as VIDEO_TAG_IMAGE_TO_VIDEO, M as WORKBUDDY_AUTH_FILENAME, Mn as resolveDshHome, Mt as lastRefusalFor, N as WORKBUDDY_AUTH_FILE_ENV, Nn as withFileLock, Nt as offDefaultFor, O as deriveCatalog, On as openEncryptedField, Ot as promoBadgeTone, Pn as writeFileAtomic, Pt as offRefused, Q as CONTEXT_OVERFLOW_MARKER, Qt as isBareBase64Image, R as defaultDesktopAuthCandidates, Rt as VIDEO_TAG_TEXT_TO_VIDEO, S as saveDeviceSdkSettings, Sn as findWorkbuddyAppExecutable, St as prepareChatBody, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as isWorkbuddyBundle, Tt as rewriteSessionTitleModel, U as isVaultAccountId, Ut as IMAGE_SIZE_LIMITS_WIDE, V as hasEncryptedCredentialFields, Vt as pickVideoModel, W as legacyWorkbuddyOwnAuthPath, Wt as IMAGE_TAG_IMAGE_TO_IMAGE, X as APP_VERSION, Xt as imageModelChoices, Yt as imageMimeForPath, Z as BODY_OVERSIZE_MARKER, Zt as imageSizeLimitsOf, _ as createDeviceProfileLookup, _n as WORKBUDDY_APP_EXECUTABLE_ENV, _t as openingEvidenceOfBody, a as readHostHeartbeat, an as pruneTempDir, at as classifyUpstreamError, b as readDeviceSettings, bn as deriveAtRestKeyId, bt as parseUpstreamModel, c as WORKBUDDY_CONNECT_VERSION, cn as nativeModalityOf, ct as forceNeutralHead, dt as isConversationIdGateBody, en as parseImageDataUrl, ft as isCredentialRejectedError, g as createTuringSdk, gt as modelIdOfBody, h as createDeviceSdkPort, ht as knownRegionOf, i as processStartTimeMs, in as queueNoticeText, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jt as defaultOffModelIds, k as fallbackModelsFor, kn as readAtRestKey, kt as selectPromoBadge, l as createFileRosterSeenStore, lt as isBodyOversizeRefusal, m as piAiRuntimeInfo, mn as isDeviceId, mt as isToolSchemaRejectBody, n as clearHostHeartbeat, nn as sniffImageMime, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as NATIVE_MODALITY_BY_MODEL_ID, ot as declaredTools, p as resolveCnGateway, pt as isFirstMessageGateBody, q as workbuddyAccountId, qt as WorkBuddyImageError, r as isHeartbeatProcessAlive, rn as parseQueueAnswer, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as imageDefaultFor, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as pickMediaModel, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, ut as isContextTooLongBody, v as describeDerivedDevices, vn as clearAtRestKeyCache, vt as parseCreditMultiplier, w as FALLBACK_WORKBUDDY_MODELS, wn as isEncryptedFieldWrapper, wt as requestEvidenceOf, x as saveDeviceProfile, xn as fetchAtRestKeyPayload, xt as perturbChannelFingerprints, y as isDeviceMode, yn as deriveAtRestKey, yt as parseReasoning, z as defaultDesktopAuthDirs, zt as WorkBuddyVideoError } from "./host-heartbeat-
|
|
1
|
+
import { $ as CREDENTIAL_REJECTED_CODE, $t as isWatermarkFreeImageModel, A as withoutRouters, An as workbuddyAppExecutableCandidates, At as REFUSES_OFF_MODEL_IDS, B as defaultDesktopAuthPath, Bt as parseSupportedSecondsRange, C as setDeviceMode, Ct as regionOf, D as applyContextBudgets, Dn as macosNestedAppBundles, Dt as attachBusyLevels, E as WorkBuddyCatalog, En as macosBundleExecutable, Et as toolSchemaRejectAdvice, F as WorkBuddyCredentialStore, Ft as recordRefusal, G as parseWorkBuddyAuth, Gt as IMAGE_TAG_TEXT_TO_IMAGE, H as isEncryptedCredentialError, Ht as resolveVideoParams, I as WorkBuddyEncryptedCredentialError, It as withEffectiveOff, J as workbuddyOwnAuthPath, Jt as imageDataUrl, K as preferredAccountName, Kt as MAX_INPUT_IMAGE_BYTES, L as authFileName, Lt as VIDEO_TAG_IMAGE_TO_VIDEO, M as WORKBUDDY_AUTH_FILENAME, Mn as resolveDshHome, Mt as lastRefusalFor, N as WORKBUDDY_AUTH_FILE_ENV, Nn as withFileLock, Nt as offDefaultFor, O as deriveCatalog, On as openEncryptedField, Ot as promoBadgeTone, Pn as writeFileAtomic, Pt as offRefused, Q as CONTEXT_OVERFLOW_MARKER, Qt as isBareBase64Image, R as defaultDesktopAuthCandidates, Rt as VIDEO_TAG_TEXT_TO_VIDEO, S as saveDeviceSdkSettings, Sn as findWorkbuddyAppExecutable, St as prepareChatBody, T as FALLBACK_WORKBUDDY_MODELS_GLOBAL, Tn as isWorkbuddyBundle, Tt as rewriteSessionTitleModel, U as isVaultAccountId, Ut as IMAGE_SIZE_LIMITS_WIDE, V as hasEncryptedCredentialFields, Vt as pickVideoModel, W as legacyWorkbuddyOwnAuthPath, Wt as IMAGE_TAG_IMAGE_TO_IMAGE, X as APP_VERSION, Xt as imageModelChoices, Yt as imageMimeForPath, Z as BODY_OVERSIZE_MARKER, Zt as imageSizeLimitsOf, _ as createDeviceProfileLookup, _n as WORKBUDDY_APP_EXECUTABLE_ENV, _t as openingEvidenceOfBody, a as readHostHeartbeat, an as pruneTempDir, at as classifyUpstreamError, b as readDeviceSettings, bn as deriveAtRestKeyId, bt as parseUpstreamModel, c as WORKBUDDY_CONNECT_VERSION, cn as nativeModalityOf, ct as forceNeutralHead, dt as isConversationIdGateBody, en as parseImageDataUrl, ft as isCredentialRejectedError, g as createTuringSdk, gt as modelIdOfBody, h as createDeviceSdkPort, ht as knownRegionOf, i as processStartTimeMs, in as queueNoticeText, it as channelGateMemberOf, j as ENCRYPTED_CREDENTIAL_CODE, jt as defaultOffModelIds, k as fallbackModelsFor, kn as readAtRestKey, kt as selectPromoBadge, l as createFileRosterSeenStore, lt as isBodyOversizeRefusal, m as piAiRuntimeInfo, mn as isDeviceId, mt as isToolSchemaRejectBody, n as clearHostHeartbeat, nn as sniffImageMime, nt as WorkBuddyCredentialRejectedError, o as workbuddyHostHeartbeatPath, on as NATIVE_MODALITY_BY_MODEL_ID, ot as declaredTools, p as resolveCnGateway, pt as isFirstMessageGateBody, q as workbuddyAccountId, qt as WorkBuddyImageError, r as isHeartbeatProcessAlive, rn as parseQueueAnswer, rt as WorkBuddyUpstreamClient, s as writeHostHeartbeat, sn as imageDefaultFor, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, tn as pickMediaModel, tt as WORKBUDDY_FALLBACK_SYSTEM_PROMPT, ut as isContextTooLongBody, v as describeDerivedDevices, vn as clearAtRestKeyCache, vt as parseCreditMultiplier, w as FALLBACK_WORKBUDDY_MODELS, wn as isEncryptedFieldWrapper, wt as requestEvidenceOf, x as saveDeviceProfile, xn as fetchAtRestKeyPayload, xt as perturbChannelFingerprints, y as isDeviceMode, yn as deriveAtRestKey, yt as parseReasoning, z as defaultDesktopAuthDirs, zt as WorkBuddyVideoError } from "./host-heartbeat-1ytBqhSr.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.24.
|
|
5
|
+
"version": "5.24.6",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|