dsh-connect-workbuddy-go 6.1.0 → 6.1.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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.1.1 (2026-11-23)
4
+
5
+ > 修复:面板里的模型区只显示已启用的那几个,未启用的模型没出现,也就无法启用。
6
+
7
+ - **根因**:`workBuddyWebStatus()` 的 `models` 是合并后的目录——已启用的行在前,只在设置里保存过、尚未启用的行在后;6.1.0 把这份目录塞进协议上限 8 项的 `options` 并按前 8 项截断。已启用模型一多,未启用的整段就被截在屏幕外。
8
+ - **改法**:模型区改用可点按的原生 `list`(上限 50 行),整份目录一行一个模型:行尾写 `已启用` / `未启用`,点一下切换、再点一下切回;标题显示 `国内版 · 3/12 已启用`。列表不再按启用状态截断,未启用的模型始终可达。
9
+ - **写入语义不变**:单次点按仍以完整保存值为底(空选择 = 整个目录),结果按目录顺序回写,并拒绝写空——「至少保留一个模型」。区域仍是 `options` 多选,只写真正变化的区域。
10
+ - **测试**:新增回归用例——12 个模型、3 个启用时,尾部 9 行必须是可点的「未启用」行;另覆盖 50 行上限、逐行切换与「空选择 = 全目录」的起点。视图断言改为 `data.modelRows`,且不再出现 `id: "models"`。
11
+
3
12
  ## 6.1.0 (2026-11-22)
4
13
 
5
14
  > dsh-Go 面板从「只读看板」改成「顺手能拨的控制面板」:区域与模型两个原生开关,写入走宿主设置;只在桌面成立的附属物不再出现。
package/README.en.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  A [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) bundle plugin that connects locally signed-in WorkBuddy models to the DSH model picker — **both the CN app and the international WorkBuddy AI app are supported** — with an account pool, selectable model management, and a set of read-only capabilities built around credits: **every catalog refresh reads each model's credit multiplier from upstream** (the `x0.79` figure comes entirely from the upstream catalog; the plugin neither hard-codes it nor guesses), image input is toggled per model, multiple accounts can be switched or fail over automatically through the pool, and daily check-in plus read-only credit overviews shown as compact pills on the card and in the composer. **The CN and international sides are two parallel providers (`workbuddy` / `workbuddy-global`) that can be used at the same time**; the settings page separates them with tabs for convenient management. All it needs is a WorkBuddy sign-in on this machine — or **one sign-in from the browser**.
20
20
 
21
- > **This is a community fork.** Upstream is [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy) by LaoDing, published under MIT. This fork is maintained by **sheng-888**; the package name and plugin id are both `dsh-connect-workbuddy-go`, so it can coexist with the original but the two do not share settings. Compared with upstream it adds a native dsh-Go (Android / HarmonyOS / iOS) status strip and an interactive panel — region and model switches backed by the same settings as the web card — and reports platform capability honestly. See [LICENSE](LICENSE) and [CHANGELOG.md](CHANGELOG.md) for upstream copyright and full history.
21
+ > **This is a community fork.** Upstream is [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy) by LaoDing, published under MIT. This fork is maintained by **sheng-888**; the package name and plugin id are both `dsh-connect-workbuddy-go`, so it can coexist with the original but the two do not share settings. Compared with upstream it adds a native dsh-Go (Android / HarmonyOS / iOS) status strip and an interactive panel — region switches plus a tap-to-toggle model list backed by the same settings as the web card — and reports platform capability honestly. See [LICENSE](LICENSE) and [CHANGELOG.md](CHANGELOG.md) for upstream copyright and full history.
22
22
 
23
23
  ### Icon style
24
24
 
package/README.md CHANGED
@@ -440,7 +440,7 @@ dsh plugin --profile desktop exec dsh-connect-workbuddy-go doctor # 第一行
440
440
 
441
441
  ### 手机版 dsh-Go(Android / HarmonyOS / iOS)
442
442
 
443
- 插件带一份 `dshGo` 原生界面:输入框上方的状态条显示 `WorkBuddy · 账号名`,点开是「全部功能 › WorkBuddy」面板。面板按手机的信息密度重排:顶部一句状态,下面两行区域(账号、模型数、积分),然后是「启用的区域」与「模型」两个原生开关——点按即写入宿主设置,与 Web 卡片是同一份配置,卡片会随广播同步;模型开关只列前 8 个,且至少保留一个(上游把空选择理解为「整个目录」,面板不会把它发出去)。账号、登录与图片输入这些低频操作仍在插件设置里,面板底部的「设置」按钮直接把人送过去。没有 dsh-Go 桥接的宿主看不到这两个位置,其余行为不变。
443
+ 插件带一份 `dshGo` 原生界面:输入框上方的状态条显示 `WorkBuddy · 账号名`,点开是「全部功能 › WorkBuddy」面板。面板按手机的信息密度重排:顶部一句状态,下面两行区域(账号、模型数、积分),然后是「启用的区域」多选与整份模型目录——两者点按即写入宿主设置,与 Web 卡片是同一份配置,卡片会随广播同步。模型一行一个,行尾写明「已启用 / 未启用」,点一下切换、再点一下切回,标题里的 `3/12 已启用` 是当前启用的数量;整个目录都会列出,未启用的模型不会被截在屏幕外。至少保留一个模型(上游把空选择理解为「整个目录」,面板不会把它发出去)。账号、登录与图片输入这些低频操作仍在插件设置里,面板底部的「设置」按钮直接把人送过去。没有 dsh-Go 桥接的宿主看不到这两个位置,其余行为不变。
444
444
 
445
445
  - **登录**:手机上没有 WorkBuddy 桌面端,请用卡片里的「扫码登录 / 网页登录」完成 OAuth。不要依赖扫描桌面 auth 文件、`$wbEncrypted` 解密或 `WORKBUDDY_APP_EXECUTABLE`——这些在 Android PRoot 与 HarmonyOS 上都没有可读的桌面 App。
446
446
  - **真实设备值**:真实值档需要桌面端 SDK 签发设备 token;手机端没有这条取链,插件会把该档如实标成「暂不可用」,虚拟值档(含逐账号设备参数)正常工作。设备 SDK 分区、CLI bridge 与桌面可执行文件扫描同样只适用于桌面。
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-DPSsbTAl.js";
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-Bb9YyCEo.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 = "6.1.0";
11610
+ const WORKBUDDY_CONNECT_VERSION = "6.1.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-DPSsbTAl.js";
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-Bb9YyCEo.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";
@@ -13893,8 +13893,8 @@ function registerWorkBuddyStatusRoute(ctx, deps) {
13893
13893
  const WORKBUDDY_DSH_GO_PANEL = "workbuddy";
13894
13894
  const WORKBUDDY_DSH_GO_STRIP = "status";
13895
13895
  const REGIONS = ["cn", "global"];
13896
- /** The protocol caps one `options` component at eight entries. */
13897
- const MODEL_OPTION_LIMIT = 8;
13896
+ /** The protocol caps one `list` at fifty rows; rosters are far shorter in practice. */
13897
+ const MODEL_ROW_LIMIT = 50;
13898
13898
  const ZH = {
13899
13899
  brand: "WorkBuddy",
13900
13900
  signedIn: "已连接",
@@ -13920,8 +13920,10 @@ const ZH = {
13920
13920
  saveFailed: "保存失败",
13921
13921
  readOnly: "这台主机不能修改设置",
13922
13922
  keepOne: "至少保留一个模型",
13923
+ on: "已启用",
13924
+ off: "未启用",
13923
13925
  regionName: (region) => region === "cn" ? "国内版" : "国际版",
13924
- modelsTitle: (label, count, capped) => `${label} · ${count} 个模型${capped ? `(前 ${MODEL_OPTION_LIMIT} 个)` : ""}`,
13926
+ modelsTitle: (label, enabled, total, capped) => `${label} · ${enabled}/${total} 已启用${capped ? `(列前 ${MODEL_ROW_LIMIT} 个)` : ""}`,
13925
13927
  modelCount: (count) => `${count} 个模型`
13926
13928
  };
13927
13929
  const EN = {
@@ -13949,8 +13951,10 @@ const EN = {
13949
13951
  saveFailed: "Could not save",
13950
13952
  readOnly: "Settings are read-only on this host",
13951
13953
  keepOne: "Keep at least one model",
13954
+ on: "On",
13955
+ off: "Off",
13952
13956
  regionName: (region) => region === "cn" ? "CN" : "Global",
13953
- modelsTitle: (label, count, capped) => `${label} · ${count} models${capped ? ` (first ${MODEL_OPTION_LIMIT})` : ""}`,
13957
+ modelsTitle: (label, enabled, total, capped) => `${label} · ${enabled}/${total} enabled${capped ? ` (first ${MODEL_ROW_LIMIT} shown)` : ""}`,
13954
13958
  modelCount: (count) => `${count} models`
13955
13959
  };
13956
13960
  function words(locale) {
@@ -14050,30 +14054,33 @@ function regionRow(snapshot, w) {
14050
14054
  };
14051
14055
  }
14052
14056
  /**
14053
- * The model switch's two faces for one region: every roster row the protocol
14054
- * lets us show, plus which of them are currently on.
14057
+ * One region's model roster as tappable rows — every model, enabled or not.
14055
14058
  *
14056
14059
  * An EMPTY saved selection means "serve the whole directory", so every row
14057
- * reads as selected — the switch must not paint a never-configured region as
14058
- * "nothing enabled".
14060
+ * reads as enabled — the list must not paint a never-configured region as
14061
+ * "nothing on". The count and the rows come from the same predicate so the
14062
+ * header and the list never disagree.
14059
14063
  */
14060
- function modelSelectionOf(snapshot) {
14061
- const shown = snapshot.models.slice(0, MODEL_OPTION_LIMIT);
14062
- const enabled = new Set(snapshot.enabledModelIds);
14064
+ function modelRowsOf(snapshot, w) {
14065
+ const saved = new Set(snapshot.enabledModelIds);
14066
+ const isOn = (id) => saved.size === 0 || saved.has(id);
14063
14067
  return {
14064
- options: shown.map((model) => {
14068
+ rows: snapshot.models.slice(0, MODEL_ROW_LIMIT).map((model) => {
14065
14069
  const name = model.name.trim() === "" ? model.id : model.name;
14066
- return model.id === name ? {
14067
- label: name,
14068
- value: model.id
14069
- } : {
14070
- label: name,
14071
- description: model.id,
14072
- value: model.id
14070
+ const row = {
14071
+ title: name,
14072
+ trailing: isOn(model.id) ? w.on : w.off,
14073
+ tone: isOn(model.id) ? "good" : "muted",
14074
+ action: {
14075
+ id: "toggleModel",
14076
+ args: { id: model.id }
14077
+ }
14073
14078
  };
14079
+ if (name !== model.id) row.subtitle = model.id;
14080
+ return row;
14074
14081
  }),
14075
- selected: shown.filter((model) => enabled.size === 0 || enabled.has(model.id)).map((model) => model.id),
14076
- capped: snapshot.models.length > MODEL_OPTION_LIMIT
14082
+ enabled: snapshot.models.filter((model) => isOn(model.id)).length,
14083
+ capped: snapshot.models.length > MODEL_ROW_LIMIT
14077
14084
  };
14078
14085
  }
14079
14086
  /** The panel's data model. Every label is resolved here, once, for the app's locale. */
@@ -14084,7 +14091,7 @@ function dshGoPanelData(snapshots, locale) {
14084
14091
  const allClosed = snapshots.length > 0 && snapshots.every((snapshot) => !snapshot.enabled);
14085
14092
  const headline = live !== void 0 ? w.ready : allClosed ? w.allClosed : anyBad ? w.notReady : w.notLoggedIn;
14086
14093
  const tone = live !== void 0 ? "good" : allClosed ? "info" : anyBad ? "bad" : "warn";
14087
- const models = live === void 0 ? void 0 : modelSelectionOf(live);
14094
+ const models = live === void 0 ? void 0 : modelRowsOf(live, w);
14088
14095
  const note = snapshots.map((snapshot) => snapshot.message).find((message) => message !== void 0);
14089
14096
  return {
14090
14097
  headline,
@@ -14096,9 +14103,8 @@ function dshGoPanelData(snapshots, locale) {
14096
14103
  value: region
14097
14104
  })),
14098
14105
  selectedRegions: snapshots.filter((snapshot) => snapshot.enabled).map((snapshot) => snapshot.region),
14099
- modelsLabel: live === void 0 ? w.noModels : w.modelsTitle(w.regionName(live.region), live.models.length, models?.capped === true),
14100
- modelOptions: models?.options ?? [],
14101
- selectedModels: models?.selected ?? [],
14106
+ modelsLabel: live === void 0 || live.models.length === 0 ? w.noModels : w.modelsTitle(w.regionName(live.region), models?.enabled ?? 0, live.models.length, models?.capped === true),
14107
+ modelRows: models?.rows ?? [],
14102
14108
  footer: note === void 0 ? w.footer : `${w.footer} · ${note}`
14103
14109
  };
14104
14110
  }
@@ -14135,8 +14141,9 @@ function dshGoStripData(snapshots, locale) {
14135
14141
  *
14136
14142
  * Three blocks, in reading order: what is happening (headline + one row per
14137
14143
  * region), which region is offered to DSH, and which models that region puts
14138
- * in the picker. The two switches are the only writes a phone should make
14139
- * without a keyboard; everything else is one tap away in plugin settings.
14144
+ * in the picker. Region toggles and per-model taps are the only writes a phone
14145
+ * should make without a keyboard; everything else is one tap away in plugin
14146
+ * settings.
14140
14147
  */
14141
14148
  function dshGoPanelView(locale) {
14142
14149
  const w = words(locale);
@@ -14170,11 +14177,8 @@ function dshGoPanelView(locale) {
14170
14177
  tone: "muted"
14171
14178
  },
14172
14179
  {
14173
- type: "options",
14174
- id: "models",
14175
- multi: true,
14176
- options: { $: "data.modelOptions" },
14177
- selected: { $: "data.selectedModels" }
14180
+ type: "list",
14181
+ items: { $: "data.modelRows" }
14178
14182
  },
14179
14183
  {
14180
14184
  type: "actions",
@@ -14205,12 +14209,18 @@ function optionValues(event) {
14205
14209
  if (!Array.isArray(values)) return void 0;
14206
14210
  return values.filter((entry) => typeof entry === "string");
14207
14211
  }
14212
+ /** The `args` a list row's action carries, or undefined for junk. */
14213
+ function actionArgs(event) {
14214
+ const value = event?.value;
14215
+ if (typeof value !== "object" || value === null) return void 0;
14216
+ return value;
14217
+ }
14208
14218
  function registerWorkBuddyDshGo(ctx, source) {
14209
14219
  ctx.inject(["dshGo"], (dshCtx) => {
14210
14220
  const bridge = dshCtx.dshGo;
14211
14221
  if (bridge === void 0) return;
14212
14222
  let latestSnapshots = [];
14213
- /** Re-read and re-emit after a write, so the switch shows what landed. */
14223
+ /** Re-read and re-emit after a write, so the panel shows what landed. */
14214
14224
  let repush;
14215
14225
  const readAll = async (detail) => Promise.all(REGIONS.map(async (region) => {
14216
14226
  try {
@@ -14283,25 +14293,29 @@ function registerWorkBuddyDshGo(ctx, source) {
14283
14293
  }
14284
14294
  },
14285
14295
  /**
14286
- * Toggle models for the region the panel is showing.
14296
+ * Flip one model for the region the panel is showing.
14287
14297
  *
14288
- * The press carries only the eight rows on screen, so the next set is
14289
- * computed against the FULL saved selection — ids that the protocol did
14290
- * not show must survive a toggle. An empty saved selection means "the
14291
- * whole directory", which is why the effective set starts from the
14292
- * roster in that case.
14298
+ * The press names a single id, so the next set is computed against the
14299
+ * FULL saved selection — ids other rows show must survive the tap. An
14300
+ * empty saved selection means "the whole directory", which is why the
14301
+ * effective set starts from the roster in that case. The result is
14302
+ * roster-ordered and roster-bounded: an id upstream no longer publishes
14303
+ * cannot be served, so it is not carried forward.
14293
14304
  */
14294
- models: async (_scope, event) => {
14305
+ toggleModel: async (_scope, event) => {
14295
14306
  const w = words(event?.locale);
14296
- const values = optionValues(event);
14307
+ const id = actionArgs(event)?.id;
14297
14308
  const live = latestSnapshots.find((entry) => entry.enabled && entry.state === "signed-in");
14298
- if (values === void 0 || live === void 0) return { toast: w.saveFailed };
14309
+ if (typeof id !== "string" || live === void 0) return { toast: w.saveFailed };
14299
14310
  if (source.setModelsEnabled === void 0) return { toast: w.readOnly };
14311
+ if (!live.models.some((model) => model.id === id)) {
14312
+ repush?.();
14313
+ return { toast: w.saveFailed };
14314
+ }
14300
14315
  const saved = new Set(live.enabledModelIds);
14301
14316
  const next = new Set(saved.size === 0 ? live.models.map((model) => model.id) : [...saved]);
14302
- const picked = new Set(values);
14303
- for (const model of live.models.slice(0, MODEL_OPTION_LIMIT)) if (picked.has(model.id)) next.add(model.id);
14304
- else next.delete(model.id);
14317
+ if (next.has(id)) next.delete(id);
14318
+ else next.add(id);
14305
14319
  const ids = live.models.filter((model) => next.has(model.id)).map((model) => model.id);
14306
14320
  if (ids.length === 0) return { toast: w.keepOne };
14307
14321
  try {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-connect-workbuddy-go",
3
3
  "displayName": "DSH Connect WorkBuddy Go",
4
4
  "description": "把本机登录的 WorkBuddy 模型(国内版与国际版)接入 DeepSeek Harness:每次刷新按上游目录自动读取每个模型的积分倍率,支持逐模型图片输入开关、多账号切换与账号池自动换号,并提供每日签到、卡片与输入框里的胶囊积分读数等只读积分概览。社区分支,新增 dsh-Go 手机原生状态条与可操作面板。",
5
- "version": "6.1.0",
5
+ "version": "6.1.1",
6
6
  "author": "sheng-888",
7
7
  "copyright": "Copyright (c) 2026 sheng-888. Based on dsh-connect-workbuddy by LaoDing (MIT).",
8
8
  "license": "MIT",