dsh-workbuddy-connect 0.6.4 → 0.7.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/README.en.md CHANGED
@@ -56,16 +56,19 @@ For models without declared levels, Web and Desktop instead use user-authorized,
56
56
 
57
57
  Prerequisite: the WorkBuddy desktop app is installed and signed in. The plugin reuses the app's sign-in state and follows account switches automatically; the same applies to the international WorkBuddy AI app, and the two do not affect each other.
58
58
 
59
- **Match the plugin version to your DSH core** — from **`0.6.0`** on, one plugin version spans both core generations, removing the per-version pairing; earlier releases still pair one-to-one, and a mismatched combination fails to start DSH:
59
+ **Match the plugin version to your DSH core** — from **`0.6.0`** on, one plugin version spans both core generations, removing the per-version pairing; earlier releases still pair one-to-one, and a mismatched combination fails to start DSH. **From `0.7.0` the plugin targets `0.2.0` cores only; `0.1.x` users should stay on `0.6.5`**:
60
60
 
61
61
  | Plugin | Required DSH core | Desktop app |
62
62
  |---|---|---|
63
- | **0.6.0 (dual-UI adaptive)** | `0.1.5-rc.1` / `rc.2` / `rc.3`; the `0.1.6-alpha` line (incl. `alpha.1` / `alpha.2`) and `0.1.6` stable; verified against `0.1.7-alpha.1` (`0.1.7` stable is inside the range too). **Newer prereleases (e.g. `0.1.8-alpha.x`) are NOT covered automatically** — the plugin must extend its peer range first | `2.0.7`+ works today; desktop builds bundling `0.1.6+` will work too |
63
+ | **0.7.0 (the 0.2.0 era)** | **supports `0.2.0-rc.1` / `0.2.0-rc.2` only** (`0.1.5` / `0.1.6` / `0.1.7` are no longer covered — those users should stay on `0.6.5`), verified on a real `0.2.0-rc.2` host (web: loading, both CN and international catalogs, encrypted credentials, status routes all fine). This is the release that adapts to DSH `0.2.0`'s settings-service rework — `0.2.0` replaced the service with a Config-derived form facade that no longer installs sections, so earlier releases lose their settings there | desktop builds bundling the `0.2.0` core (preview / nightly) |
64
+ | **0.6.0 (dual-UI adaptive)** | `0.1.5-rc.1` / `rc.2` / `rc.3`; the `0.1.6-alpha` line (incl. `alpha.1` / `alpha.2`) and `0.1.6` stable; verified against `0.1.7-alpha.1` (`0.1.7` stable is inside the range too). **Subsequent `0.1.x` prereleases (e.g. `0.1.8-alpha.x`) DO fall inside the `^0.1.7-alpha.1` arm** — the host's compatibility check resolves peer ranges with includePrerelease semantics (our earlier "not covered" claim was wrong; corrected here); prereleases crossing into `0.2.0` are the ones that need an explicit peer-range extension | `2.0.7`+ works today; desktop builds bundling `0.1.6+` will work too |
65
+ | **0.6.5 (final release of the `0.1.x` line)** | adds `0.2.0-rc.1` on top of the `0.6.0` surface (`0.1.5` / `0.1.6` / `0.1.7` / `0.2.0-rc.1`), verified on a real `0.2.0-rc.1` host (web: loading, catalogs, encrypted credentials, chat & image round-trips all fine). Releases up to and including `0.6.4` do not carry that range and are skipped wholesale by DSH `0.2.0-rc.1` (see [#63](https://github.com/corrinehu/dsh-workbuddy-connect/issues/63)) | desktop builds bundling `0.1.x` cores (incl. the released `2.0.7`+ line); `0.2.0-rc.1` works too (verified on web; desktop not yet verified) |
64
66
  | **0.3.2 – 0.5.4** (international support since `0.5.0`) | the `0.1.5-rc.1` line only (no `0.1.6+`; see [#41](https://github.com/corrinehu/dsh-workbuddy-connect/issues/41)) | `2.0.7`+ (bundled core `0.1.5-rc.1`) |
65
67
  | **0.3.0 – 0.3.1** | `0.1.2-rc.1` | `2.0.5` |
66
68
  | **0.2.6** | `0.1.1-rc.2` (older line) | `2.0.3` / `2.0.4` |
67
69
 
68
70
  - **`0.6.0` does not require upgrading to DSH `0.1.6` just to install WorkBuddy Connect**: the plugin adapts to whichever configuration surface the host actually provides at load time — `0.1.5` and `0.1.6+` each get their own UI, independently.
71
+ - **DSH `0.2.0` reworked the settings service**: from `0.2.0` it is a Config-derived form facade exposing only `.volatile()` fields, with no section-installation API. The plugin adapts to what the host actually offers: on `0.1.5` / `0.1.6` both sections install as before (so `authFile` / `authFileAI` stay readable from `settings.yaml` and the TUI `/settings`), while on `0.1.7`+ / `0.2.0` it degrades to a settings-less provider — models, the picker, model visibility, and the context rows all keep working; only the "use the upstream's declared maximum context window" preference stops being persistable, and the card renders no switch it could not save.
69
72
  - **Where the cards live depends on the DSH version** — each generation has its own place:
70
73
 
71
74
  ```text
@@ -92,10 +95,11 @@ Prerequisite: the WorkBuddy desktop app is installed and signed in. The plugin r
92
95
  ```
93
96
 
94
97
  - From `0.6.0` on, the Models settings page no longer shows the non-editable WorkBuddy / WorkBuddy AI cards (consistent across both core generations); the model picker, `/model`, and chat calls are unaffected.
95
- - On DSH `0.1.5` / `0.1.6` / `0.1.7`, just install the latest: `dsh plugin --profile web add dsh-workbuddy-connect`
98
+ - On DSH `0.2.0-rc.1` / `0.2.0-rc.2`, just install the latest: `dsh plugin --profile web add dsh-workbuddy-connect`
99
+ - Still on DSH `0.1.5` / `0.1.6` / `0.1.7`? Stay on `0.6.5`: `dsh plugin --profile web add dsh-workbuddy-connect@0.6.5`
96
100
  - Still on DSH `0.1.2-rc.1`? Stay on `0.3.1`: `dsh plugin --profile web add dsh-workbuddy-connect@0.3.1`
97
101
  - Still on DSH `0.1.1-rc.2`? Stay on the older release: `dsh plugin --profile web add dsh-workbuddy-connect@0.2.6`
98
- - The desktop app has bundled `0.1.5-rc.1` since `2.0.7`, so it can use the latest plugin directly; `2.0.5` and earlier apps (bundled `0.1.2-rc.1`) should stay on `0.3.1`
102
+ - Pick the desktop plugin version by the **bundled core**: desktop builds bundling `0.1.x` cores (incl. the released `2.0.7`+ line) should use `dsh-workbuddy-connect@0.6.5`; desktop builds bundling the `0.2.0` core (preview / nightly) should use the latest; `2.0.5` and earlier apps (bundled `0.1.2-rc.1`) should stay on `0.3.1`
99
103
 
100
104
  The plugin runs under all three DSH interfaces: **Web**, **Desktop**, and **TUI**. Pick the install command that matches the profile you use.
101
105
 
package/README.md CHANGED
@@ -66,16 +66,19 @@ WorkBuddy 中模型的推理档位信息目前分散在上游接口与客户端
66
66
 
67
67
  前置:已安装并登录 WorkBuddy 桌面 App。插件复用 App 的登录状态,账号切换自动跟随;装了国际版 WorkBuddy AI 的同样适用,两版互不影响。
68
68
 
69
- **版本对应(重要)**:自 **`0.6.0`** 起,同一个插件版本横跨两代 DSH 核心,安装时无需再逐版本对照;更早的已发布版本仍与核心一一对应,不可混用——不匹配的组合会导致 DSH 启动失败:
69
+ **版本对应(重要)**:自 **`0.6.0`** 起,同一个插件版本横跨两代 DSH 核心,安装时无需再逐版本对照;更早的已发布版本仍与核心一一对应,不可混用——不匹配的组合会导致 DSH 启动失败。**自 `0.7.0` 起插件仅面向 `0.2.0` 内核,`0.1.x` 用户请停留在 `0.6.5`**:
70
70
 
71
71
  | 插件版本 | 要求的 DSH 核心 | 桌面 App |
72
72
  |---|---|---|
73
- | **0.6.0(双界面自适应)** | `0.1.5-rc.1` / `rc.2` / `rc.3`;`0.1.6-alpha` 系列(含 `alpha.1` / `alpha.2`)与 `0.1.6` 正式版;已实测 `0.1.7-alpha.1`(`0.1.7` 正式版同样在范围内)。**更新的 prerelease(如 `0.1.8-alpha.x`)不自动覆盖**,需插件显式跟进 peer range 后才支持 | `2.0.7`+ 可直接使用;搭载 `0.1.6+` 核心的桌面版发布后同样适用 |
73
+ | **0.7.0(0.2.0 世代)** | **仅支持 `0.2.0-rc.1` / `0.2.0-rc.2`**(`0.1.5` / `0.1.6` / `0.1.7` 不再支持,用户请停留在 `0.6.5`),已在 `0.2.0-rc.2` 真机实测(web 端:加载、国内版与国际版目录、加密凭据、状态路由正常)。这是适配 DSH `0.2.0` 设置服务改造的版本——`0.2.0` 把设置服务换成了 Config 表单门面,移除了旧的 `installSection` 接口,早期版本在上面会丢失设置项 | 内置 `0.2.0` 内核的桌面版(预览 / nightly) |
74
+ | **0.6.0(双界面自适应)** | `0.1.5-rc.1` / `rc.2` / `rc.3`;`0.1.6-alpha` 系列(含 `alpha.1` / `alpha.2`)与 `0.1.6` 正式版;已实测 `0.1.7-alpha.1`(`0.1.7` 正式版同样在范围内)。**后续 `0.1.x` prerelease(如 `0.1.8-alpha.x`)同样落在 `^0.1.7-alpha.1` 区间内**——宿主兼容判定按 includePrerelease 语义解析 peer range(早先「不自动覆盖」的说法有误,已更正);跨入 `0.2.0` 的 prerelease 才需要插件显式扩展 peer range | `2.0.7`+ 可直接使用;搭载 `0.1.6+` 核心的桌面版发布后同样适用 |
75
+ | **0.6.5(`0.1.x` 线最终版)** | 在 `0.6.0` 的支持面上追加 `0.2.0-rc.1`(`0.1.5` / `0.1.6` / `0.1.7` / `0.2.0-rc.1`),已在 `0.2.0-rc.1` 真机实测(web 端:加载、目录、加密凭据、对话与图片往返正常)。已发布的 `0.6.4` 及更早版本不含该区间,在 DSH `0.2.0-rc.1` 上会被宿主整体跳过(见 [#63](https://github.com/corrinehu/dsh-workbuddy-connect/issues/63)) | 内置 `0.1.x` 内核的桌面版(含 `2.0.7` 起的已发布正式版);`0.2.0-rc.1` 亦可(web 已实测,桌面版待实测) |
74
76
  | **0.3.2 – 0.5.4**(国际版支持自 `0.5.0`) | `0.1.5-rc.1` 系列(不支持 `0.1.6+`,见 [#41](https://github.com/corrinehu/dsh-workbuddy-connect/issues/41)) | `2.0.7`+(内置核心已跟进 `0.1.5-rc.1`) |
75
77
  | **0.3.0 – 0.3.1** | `0.1.2-rc.1` | `2.0.5` |
76
78
  | **0.2.6** | `0.1.1-rc.2`(旧线) | `2.0.3` / `2.0.4` |
77
79
 
78
80
  - **计划中的 `0.6.0` 不要求为了安装 WorkBuddy Connect 强制升级到 DSH `0.1.6`**:插件在加载时按宿主实际提供的配置入口自适应,`0.1.5` 与 `0.1.6+` 各自走各自的界面,互不干扰。
81
+ - **DSH `0.2.0` 的设置服务改造**:`0.2.0` 起设置服务改为 Config 派生的表单门面(只暴露 `.volatile()` 字段),不再提供安装设置分区的接口。插件按宿主实际能力自适应:在 `0.1.5` / `0.1.6` 上照旧安装两个分区(`authFile` / `authFileAI` 等仍可从 `settings.yaml` 与 TUI `/settings` 读写),在 `0.1.7`+ / `0.2.0` 上降级为无设置项的 provider——模型、选择器、模型显隐与上下文窗口照常工作,只是「使用上游声明的最大上下文窗口」这一偏好不再可持久化,卡片也不会渲染无法保存的开关。
79
82
  - **配置入口随 DSH 版本不同**,两代各就各位:
80
83
 
81
84
  ```text
@@ -101,10 +104,11 @@ WorkBuddy 中模型的推理档位信息目前分散在上游接口与客户端
101
104
  ```
102
105
 
103
106
  - 自 `0.6.0` 起,Models 设置页不再显示 WorkBuddy / WorkBuddy AI 的不可编辑卡片(两代核心行为一致);模型选择器、`/model` 与对话调用不受影响。
104
- - DSH `0.1.5` / `0.1.6` / `0.1.7` 的用户,安装最新版即可:`dsh plugin --profile web add dsh-workbuddy-connect`
107
+ - DSH `0.2.0-rc.1` / `0.2.0-rc.2` 的用户,安装最新版即可:`dsh plugin --profile web add dsh-workbuddy-connect`
108
+ - 还在用 DSH `0.1.5` / `0.1.6` / `0.1.7` 的用户,请停留在 `0.6.5`:`dsh plugin --profile web add dsh-workbuddy-connect@0.6.5`
105
109
  - 还在用 DSH `0.1.2-rc.1` 的用户,请停留在 `0.3.1`:`dsh plugin --profile web add dsh-workbuddy-connect@0.3.1`
106
110
  - 还在用 DSH `0.1.1-rc.2` 的用户,请停留在 `0.2.6`:`dsh plugin --profile web add dsh-workbuddy-connect@0.2.6`
107
- - 桌面 App 自 `2.0.7` 起内置核心已是 `0.1.5-rc.1`,可直接使用最新版插件;`2.0.5` 及更早的 App(内置 `0.1.2-rc.1`)请继续使用 `0.3.1`
111
+ - 桌面版按**内置核心**选择插件版本:内置 `0.1.x` 内核的桌面版(含 `2.0.7` 起的已发布正式版)用 `dsh-workbuddy-connect@0.6.5`;内置 `0.2.0` 内核的桌面版(预览 / nightly)用最新版;`2.0.5` 及更早(内置 `0.1.2-rc.1`)请继续使用 `0.3.1`
108
112
 
109
113
  插件在三种 DSH 界面下均可运行:**Web**、**Desktop**、**TUI**。根据你使用的 profile 选对应命令安装。
110
114
 
package/lib/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as WORKBUDDY_VARIANTS, O as WorkBuddyUpstreamClient, S as CN_VARIANT, Z as resolveAppVersion, a as readHostHeartbeat, b as atRestKeyProviderFor, c as WORKBUDDY_CONNECT_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, w as variantFor } from "./host-heartbeat-D9DvyLWz.js";
2
+ import { C as WORKBUDDY_VARIANTS, O as WorkBuddyUpstreamClient, S as CN_VARIANT, Z as resolveAppVersion, a as readHostHeartbeat, b as atRestKeyProviderFor, c as WORKBUDDY_CONNECT_VERSION, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, o as workbuddyHostHeartbeatPath, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, w as variantFor } from "./host-heartbeat-d_lBAk8t.js";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  //#region src/bin.ts
package/lib/client.js CHANGED
@@ -156,12 +156,12 @@ window.__ModuleLoader__.load({
156
156
  * The Agent assist block for a path failure: what is wrong, one copyable
157
157
  * request, and a re-check. Rendered only for the codes above.
158
158
  */
159
- function AssistBlock({ t, variant, code, busy, onRecheck }) {
159
+ function AssistBlock({ t, variant, failureSummary, busy, onRecheck }) {
160
160
  const [copied, setCopied] = (0, react.useState)(false);
161
161
  const [copyFailed, setCopyFailed] = (0, react.useState)(false);
162
162
  const prompt = t("assistantPrompt", {
163
163
  appName: variant.appName,
164
- failureSummary: t(assistSummaryKey(code, variant))
164
+ failureSummary
165
165
  });
166
166
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
167
167
  style: assistStyle,
@@ -1376,7 +1376,7 @@ window.__ModuleLoader__.load({
1376
1376
  }), assistCode === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssistBlock, {
1377
1377
  t,
1378
1378
  variant,
1379
- code: assistCode,
1379
+ failureSummary: status.reason ?? t(assistSummaryKey(assistCode, variant)),
1380
1380
  busy,
1381
1381
  onRecheck: () => {
1382
1382
  manualRefresh();
@@ -2561,7 +2561,7 @@ window.__ModuleLoader__.load({
2561
2561
  };
2562
2562
  //#endregion
2563
2563
  //#region src/version.ts
2564
- const WORKBUDDY_CONNECT_VERSION = "0.6.4";
2564
+ const WORKBUDDY_CONNECT_VERSION = "0.7.0";
2565
2565
  //#endregion
2566
2566
  //#region src/client/WorkBuddyConfigPage.tsx
2567
2567
  /**
@@ -5,7 +5,7 @@ import { withFileLock, writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
5
5
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
6
6
  import { createDecipheriv, createHash, randomBytes } from "node:crypto";
7
7
  import { execFile, execFileSync } from "node:child_process";
8
- import { accessSync, constants, readFileSync, realpathSync, statSync } from "node:fs";
8
+ import { accessSync, constants, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
9
9
  //#region src/app-version.ts
10
10
  /**
11
11
  * The international desktop app's version, used as the `/v3/config` UA.
@@ -2198,13 +2198,17 @@ function workBuddyWindowsDiscoveryTools() {
2198
2198
  unresolved ||= parsed.incomplete;
2199
2199
  }
2200
2200
  const seen = /* @__PURE__ */ new Map();
2201
+ const rejected = [];
2201
2202
  for (const candidate of new Set(candidates)) {
2202
2203
  const inspection = inspectWindowsElectronCandidate(candidate, this.platform, this.product.windows.exeBasename);
2203
2204
  if (inspection === "unresolved") {
2204
2205
  unresolved = true;
2205
2206
  continue;
2206
2207
  }
2207
- if (inspection === void 0) continue;
2208
+ if (inspection === void 0) {
2209
+ rejected.push(candidate);
2210
+ continue;
2211
+ }
2208
2212
  seen.set(inspection.identity, inspection.electronPath);
2209
2213
  }
2210
2214
  if (unresolved) throw discoveryIncomplete(this.product.productName, "some registry entries or candidates could not be checked");
@@ -2212,7 +2216,7 @@ function workBuddyWindowsDiscoveryTools() {
2212
2216
  const listed = [...seen.values()].map((path) => ` - ${path}`).join("\n");
2213
2217
  throw new WorkBuddyElectronPathError("electron-binary-ambiguous", `more than one ${this.product.productName} application was found, so none was chosen:\n${listed}\n set ${this.product.envVar} to the one to use`);
2214
2218
  }
2215
- if (seen.size === 0) throw new WorkBuddyElectronPathError("electron-binary-not-found", `no usable ${this.product.productName} Electron binary was found in the default location or Windows uninstall records; set ${this.product.envVar} to the app's Electron binary`);
2219
+ if (seen.size === 0) throw new WorkBuddyElectronPathError("electron-binary-not-found", rejected.length === 0 ? `no usable ${this.product.productName} Electron binary was found in the default location or Windows uninstall records; set ${this.product.envVar} to the app's Electron binary` : `Windows uninstall records found ${rejected.length} ${this.product.productName} candidate${rejected.length > 1 ? "s" : ""}, but ${rejected.length > 1 ? "none" : "it"} did not match the expected app layout (the app's exe beside a version file and resources\\app.asar); set ${this.product.envVar} to the installed app's executable to use it`);
2216
2220
  return [...seen.values()][0];
2217
2221
  } finally {
2218
2222
  clearTimeout(timer);
@@ -2338,13 +2342,11 @@ function inspectWindowsElectronCandidate(electronPath, platform, exeBasename) {
2338
2342
  return isENOENT$1(error) ? void 0 : "unresolved";
2339
2343
  }
2340
2344
  if (!WINDOWS_ELECTRON_VERSION_PATTERN.test(version)) return void 0;
2341
- let resourcesStat;
2342
2345
  try {
2343
- resourcesStat = statSync(join(installRoot, "resources", "app.asar"));
2346
+ if (!readdirSync(join(installRoot, "resources")).includes("app.asar")) return void 0;
2344
2347
  } catch (error) {
2345
2348
  return isENOENT$1(error) ? void 0 : "unresolved";
2346
2349
  }
2347
- if (!resourcesStat.isFile()) return void 0;
2348
2350
  let identity;
2349
2351
  try {
2350
2352
  identity = realpathSync(electronPath);
@@ -3609,7 +3611,7 @@ var WorkBuddyCatalog = class {
3609
3611
  };
3610
3612
  //#endregion
3611
3613
  //#region src/version.ts
3612
- const WORKBUDDY_CONNECT_VERSION = "0.6.4";
3614
+ const WORKBUDDY_CONNECT_VERSION = "0.7.0";
3613
3615
  //#endregion
3614
3616
  //#region src/host-heartbeat.ts
3615
3617
  /**
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as extractDisplayErrorMessage, B as CN_APP_VERSION_FILENAME, C as WORKBUDDY_VARIANTS, D as WORKBUDDY_UPDATE_PATH, F as prepareInternationalChatBody, G as resolveChatIdentity, H as chatUserAgent, I as regionOf, J as appUserAgent, K as validCliVersion, L as PROBE_EFFORT_CANDIDATES, M as normalizeCredits, N as parseModelCatalog, O as WorkBuddyUpstreamClient, P as prepareChatBody, Q as validAppVersion, R as probeModel, S as CN_VARIANT, U as fallbackChatIdentity, V as FALLBACK_CN_APP_VERSION, W as readCliVersion, X as readBundleVersion, Y as installedAppVersion, Z as resolveAppVersion, _ as desktopAuthCandidatesFor, a as readHostHeartbeat, b as atRestKeyProviderFor, c as WORKBUDDY_CONNECT_VERSION, d as WorkBuddyCatalog, f as WORKBUDDY_AUTH_FILENAME, g as defaultDesktopAuthPath, h as defaultDesktopAuthCandidates, i as processStartTimeMs, j as modelWithCurrentPromotion, k as classifyUpstreamError, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as WORKBUDDY_AUTH_FILE_ENV, q as WORKBUDDY_APP_VERSION_FILENAME, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as FALLBACK_WORKBUDDY_MODELS, v as parseWorkBuddyAuth, w as variantFor, x as AI_VARIANT, y as workbuddyOwnAuthPath, z as randomSentinel } from "./host-heartbeat-D9DvyLWz.js";
1
+ import { A as extractDisplayErrorMessage, B as CN_APP_VERSION_FILENAME, C as WORKBUDDY_VARIANTS, D as WORKBUDDY_UPDATE_PATH, F as prepareInternationalChatBody, G as resolveChatIdentity, H as chatUserAgent, I as regionOf, J as appUserAgent, K as validCliVersion, L as PROBE_EFFORT_CANDIDATES, M as normalizeCredits, N as parseModelCatalog, O as WorkBuddyUpstreamClient, P as prepareChatBody, Q as validAppVersion, R as probeModel, S as CN_VARIANT, U as fallbackChatIdentity, V as FALLBACK_CN_APP_VERSION, W as readCliVersion, X as readBundleVersion, Y as installedAppVersion, Z as resolveAppVersion, _ as desktopAuthCandidatesFor, a as readHostHeartbeat, b as atRestKeyProviderFor, c as WORKBUDDY_CONNECT_VERSION, d as WorkBuddyCatalog, f as WORKBUDDY_AUTH_FILENAME, g as defaultDesktopAuthPath, h as defaultDesktopAuthCandidates, i as processStartTimeMs, j as modelWithCurrentPromotion, k as classifyUpstreamError, l as FALLBACK_WORKBUDDY_AI_MODELS, m as WorkBuddyCredentialStore, n as clearHostHeartbeat, o as workbuddyHostHeartbeatPath, p as WORKBUDDY_AUTH_FILE_ENV, q as WORKBUDDY_APP_VERSION_FILENAME, r as isHeartbeatProcessAlive, s as writeHostHeartbeat, t as WORKBUDDY_HOST_HEARTBEAT_FILENAME, u as FALLBACK_WORKBUDDY_MODELS, v as parseWorkBuddyAuth, w as variantFor, x as AI_VARIANT, y as workbuddyOwnAuthPath, z as randomSentinel } from "./host-heartbeat-d_lBAk8t.js";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { resolveImageAttachmentAccess, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
4
4
  import { dirname, join, resolve } from "node:path";
@@ -1754,6 +1754,27 @@ function registerWorkBuddyProbeRoute(ctx, deps, key) {
1754
1754
  }, "dsh-workbuddy-connect: probe control route");
1755
1755
  }
1756
1756
  //#endregion
1757
+ //#region src/legacy-settings.ts
1758
+ /**
1759
+ * Narrow one host settings service to the legacy section API, or `undefined`
1760
+ * when this host's generation does not carry it.
1761
+ *
1762
+ * Both members are required: a service with only `installSection` would let
1763
+ * this plugin install a section whose edits it could never persist, and the
1764
+ * maximum-context preference is written through `update`. A host that ships
1765
+ * neither is reported as `undefined` so the caller degrades in one place.
1766
+ *
1767
+ * @param settings - the host settings service, whose shape is generation-dependent.
1768
+ * @returns the legacy API when present, otherwise `undefined`.
1769
+ */
1770
+ function legacySettingsOf(settings) {
1771
+ if (typeof settings !== "object" || settings === null) return void 0;
1772
+ const candidate = settings;
1773
+ if (typeof candidate.installSection !== "function") return void 0;
1774
+ if (typeof candidate.update !== "function") return void 0;
1775
+ return settings;
1776
+ }
1777
+ //#endregion
1757
1778
  //#region src/index.ts
1758
1779
  /** Stable Cordis plugin name. */
1759
1780
  const name = "llm-workbuddy";
@@ -2236,7 +2257,8 @@ function apply(ctx, config) {
2236
2257
  }
2237
2258
  });
2238
2259
  ctx.inject(["settings"], (settingsCtx) => {
2239
- if (typeof settingsCtx.settings.installSection !== "function") {
2260
+ const legacy = legacySettingsOf(settingsCtx.settings);
2261
+ if (legacy === void 0) {
2240
2262
  ctx.logger.warn("dsh-workbuddy-connect: host settings service has no installSection API; per-variant settings and the maximum-context preference are unavailable");
2241
2263
  return;
2242
2264
  }
@@ -2262,14 +2284,14 @@ function apply(ctx, config) {
2262
2284
  applyMaximumContextWindow(next);
2263
2285
  for (const runtime of runtimes) runtime.store.setDesktopPath(configuredAuthFile(next, runtime.variant));
2264
2286
  };
2265
- settingsCtx.settings.installSection(ctx, WORKBUDDY_SETTINGS_NS, CN_SECTION, config, {
2287
+ legacy.installSection(ctx, WORKBUDDY_SETTINGS_NS, CN_SECTION, config, {
2266
2288
  setSource(source) {
2267
2289
  sources.cn = source;
2268
2290
  current = merged;
2269
2291
  },
2270
2292
  onChange: repointStores
2271
2293
  });
2272
- settingsCtx.settings.installSection(ctx, WORKBUDDY_AI_SETTINGS_NS, AI_SECTION, config, {
2294
+ legacy.installSection(ctx, WORKBUDDY_AI_SETTINGS_NS, AI_SECTION, config, {
2273
2295
  setSource(source) {
2274
2296
  sources.ai = source;
2275
2297
  current = merged;
@@ -2277,7 +2299,7 @@ function apply(ctx, config) {
2277
2299
  onChange: repointStores
2278
2300
  });
2279
2301
  setMaximumContextWindow = async (enabled) => {
2280
- await settingsCtx.settings.update(WORKBUDDY_AI_SETTINGS_NS, { useMaximumContextWindow: enabled });
2302
+ await legacy.update(WORKBUDDY_AI_SETTINGS_NS, { useMaximumContextWindow: enabled });
2281
2303
  return { state: "updated" };
2282
2304
  };
2283
2305
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-workbuddy-connect",
3
3
  "displayName": "DSH WorkBuddy Connect",
4
4
  "description": "将 WorkBuddy 桌面 App 包含的模型自动接入 DeepSeek Harness — bring WorkBuddy desktop app models into DeepSeek Harness with zero configuration.",
5
- "version": "0.6.4",
5
+ "version": "0.7.0",
6
6
  "author": "corrinehu",
7
7
  "keywords": [
8
8
  "dsh-plugin",
@@ -68,36 +68,39 @@
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@deepseek-ai/cordis": "^4.0.2",
71
- "@deepseek-ai/dsh-atomic-write": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
72
- "@deepseek-ai/dsh-attachment": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
73
- "@deepseek-ai/dsh-home-paths": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
74
- "@deepseek-ai/dsh-host-webserver": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
75
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
76
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
77
- "@deepseek-ai/dsh-settings": "^0.1.5-rc.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1",
71
+ "@deepseek-ai/dsh-atomic-write": "0.2.0-rc.1 || 0.2.0-rc.2",
72
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.1 || 0.2.0-rc.2",
73
+ "@deepseek-ai/dsh-home-paths": "0.2.0-rc.1 || 0.2.0-rc.2",
74
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.1 || 0.2.0-rc.2",
75
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.1 || 0.2.0-rc.2",
76
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.1 || 0.2.0-rc.2",
77
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.1 || 0.2.0-rc.2",
78
78
  "@deepseek-ai/schemastery": "^3.18.2",
79
- "@earendil-works/pi-ai": "^0.85.1",
79
+ "@earendil-works/pi-ai": "^0.85.1 || ^0.87.1",
80
80
  "react": "^18.2.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@deepseek-ai/cordis": "^4.0.2",
84
- "@deepseek-ai/dsh-atomic-write": "^0.1.6-alpha.2",
85
- "@deepseek-ai/dsh-attachment": "^0.1.6-alpha.2",
86
- "@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
87
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.6-alpha.2",
88
- "@deepseek-ai/dsh-client-ui-model-selection": "0.1.6-alpha.2",
89
- "@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.6-alpha.2",
90
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-rc.2",
91
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
92
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
93
- "@deepseek-ai/dsh-credentials": "^0.1.6-alpha.2",
94
- "@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.2",
95
- "@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.2",
96
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
97
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.6-alpha.2",
98
- "@deepseek-ai/dsh-settings": "^0.1.6-alpha.2",
83
+ "@deepseek-ai/cordis": "^4.0.4",
84
+ "@deepseek-ai/dsh-atomic-write": "0.2.0-rc.2",
85
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
86
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
87
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.2",
88
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.2.0-rc.2",
89
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2",
90
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.2.0-rc.2",
91
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
93
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
94
+ "@deepseek-ai/dsh-authorization": "0.2.0-rc.2",
95
+ "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
96
+ "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2",
97
+ "@deepseek-ai/dsh-home-paths": "0.2.0-rc.2",
98
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
99
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
100
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
101
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
99
102
  "@deepseek-ai/schemastery": "^3.18.2",
100
- "@earendil-works/pi-ai": "^0.85.1",
103
+ "@earendil-works/pi-ai": "^0.87.1",
101
104
  "@types/node": "^22.20.0",
102
105
  "@types/react": "~18.3.1",
103
106
  "@types/react-test-renderer": "^18.3.1",