dsh-connect-workbuddy 5.20.2 → 5.20.32

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/lib/client.js CHANGED
@@ -600,6 +600,29 @@ window.__ModuleLoader__.load({
600
600
  });
601
601
  }
602
602
  /**
603
+ * Build the next `regions` settings value for the new-model-segment opt-in.
604
+ *
605
+ * Same merge rule as everything else here: ONLY the target region's flag
606
+ * changes, so the directory, the model selection, the credit switches and the
607
+ * sibling region all survive the write.
608
+ */
609
+ function nextRegionNewModelsShown(value, region, shown) {
610
+ return nextRegionSlots(regionsMapOf(value), region, {
611
+ ...regionSlotOf(value, region),
612
+ showNewModelsInMainUi: shown
613
+ });
614
+ }
615
+ /**
616
+ * Read the new-model-segment opt-in: ON only when explicitly `true`.
617
+ *
618
+ * The mirror image of {@link regionCreditsShownOf}, and deliberately so. That
619
+ * one is opt-OUT (`!== false`), this one is opt-IN (`=== true`), because
620
+ * announcing "N new models" on a fresh install announces the entire roster.
621
+ */
622
+ function regionNewModelsShownOf(value, region) {
623
+ return regionSlotOf(value, region)["showNewModelsInMainUi"] === true;
624
+ }
625
+ /**
603
626
  * Build the next `regions` settings value for the image-tool opt-in.
604
627
  *
605
628
  * Same merge rule: ONLY the target region's flag changes, so the directory,
@@ -969,7 +992,7 @@ window.__ModuleLoader__.load({
969
992
  }
970
993
  if (delivered) {
971
994
  const after = scope.getSnapshot().value;
972
- if (field === "usageIdentity" || field === "keepPromptLast" ? upstreamSwitchOf(after, field) === value : field === "sessionTitle" ? JSON.stringify(sessionTitleOf(after)) === JSON.stringify(value) : field === "channelRejectContinue" ? JSON.stringify(channelRejectContinueOf(after)) === JSON.stringify(value) : JSON.stringify(extraInjectedPrefixesOf(after)) === JSON.stringify([...value])) return;
995
+ if (field === "usageIdentity" || field === "keepPromptLast" || field === "dropAllThinking" ? upstreamSwitchOf(after, field) === value : field === "sessionTitle" ? JSON.stringify(sessionTitleOf(after)) === JSON.stringify(value) : field === "channelRejectContinue" ? JSON.stringify(channelRejectContinueOf(after)) === JSON.stringify(value) : JSON.stringify(extraInjectedPrefixesOf(after)) === JSON.stringify([...value])) return;
973
996
  }
974
997
  throw hostError instanceof Error ? hostError : new WorkBuddySettingsWriteError(field, "neither the Host save endpoint nor the settings scope persisted the value");
975
998
  }
@@ -1410,6 +1433,19 @@ window.__ModuleLoader__.load({
1410
1433
  });
1411
1434
  }
1412
1435
  /**
1436
+ * Write one region's new-model-segment opt-in, verifying it landed.
1437
+ *
1438
+ * Sibling of {@link writeRegionCreditsShown}: same whole-slot merge, same
1439
+ * landed check. The landed check reads `=== shown`, so an explicit `false`
1440
+ * (the default) verifies just as strictly as a `true`.
1441
+ */
1442
+ async function writeRegionNewModelsShown(scope, region, shown, slot) {
1443
+ await writeField(scope, "regions", region, slot, (readBack) => {
1444
+ const stored = readBack;
1445
+ return stored !== null && stored !== void 0 && stored["showNewModelsInMainUi"] === shown;
1446
+ });
1447
+ }
1448
+ /**
1413
1449
  * Write one region's credit SEAT (issue #62), verifying it landed.
1414
1450
  *
1415
1451
  * Sibling of {@link writeRegionCreditsShown}: same whole-slot merge, same
@@ -2024,13 +2060,18 @@ window.__ModuleLoader__.load({
2024
2060
  * measurement and no exclusion is simply unknown, and inventing "可用" for it
2025
2061
  * would be a claim nobody made.
2026
2062
  *
2027
- * The retry wording has three states, matching the card's three:
2028
- * - a stated instant → "被限流 · 10/19 01:32 之后可再用"
2029
- * - no instant but a timed → "被限流 · 未提供恢复时间"
2063
+ * The retry wording has four states, matching the card's four:
2064
+ * - a stated instant still ahead → "被限流 · 10/19 01:32 之后可再用 · 约 6 小时后"
2065
+ * - a stated instant ALREADY past, on a WAIT-AND-SEE cooldown (rate-limited,
2066
+ * model-busy) → NOTHING at all: no verdict (it has expired), no instant (it is
2067
+ * behind us), and no chore for the reader. The dot already answers the
2068
+ * question, and the card re-tests that one account by itself. Other outcomes
2069
+ * that happen to carry a past instant keep their verdict and drop the instant
2070
+ * - no instant but a timed → "被限流 · 未提供恢复时间"
2030
2071
  * exclusion
2031
- * - any other outcome → the bare outcome ("连不上上游")
2072
+ * - any other outcome → the bare outcome ("连不上上游")
2032
2073
  *
2033
- * That third case is deliberate: "未提供恢复时间" beside a credential rejection
2074
+ * That last case is deliberate: "未提供恢复时间" beside a credential rejection
2034
2075
  * would imply waiting helps, when the only fix is signing in again.
2035
2076
  */
2036
2077
  function availabilityLine(t, account, nowMs = Date.now()) {
@@ -2039,8 +2080,9 @@ window.__ModuleLoader__.load({
2039
2080
  if (probe.outcome === "ok") return outcomeText(t, probe.outcome);
2040
2081
  if (probe.retryAtMs !== void 0) {
2041
2082
  const left = remainingText(t, probe.retryAtMs, nowMs);
2083
+ if (left === "") return probe.outcome === "rate-limited" || probe.outcome === "model-busy" ? void 0 : outcomeText(t, probe.outcome);
2042
2084
  const at = t("row.poolRetryAt", { at: formatShortClock(probe.retryAtMs) });
2043
- return `${outcomeText(t, probe.outcome)} · ${at}${left === "" ? "" : ` · ${left}`}`;
2085
+ return `${outcomeText(t, probe.outcome)} · ${at} · ${left}`;
2044
2086
  }
2045
2087
  if (probe.outcome === "rate-limited" || probe.outcome === "model-busy" || probe.outcome === "out-of-credit") return `${outcomeText(t, probe.outcome)} · ${t("row.poolRetryUnknown")}`;
2046
2088
  return outcomeText(t, probe.outcome);
@@ -2068,7 +2110,8 @@ window.__ModuleLoader__.load({
2068
2110
  if (probe.outcome === "ok") return outcomeMarkText(t, probe.outcome);
2069
2111
  if (probe.retryAtMs !== void 0) {
2070
2112
  const left = recoversInText(t, probe.retryAtMs, nowMs);
2071
- return left === "" ? outcomeMarkText(t, probe.outcome) : `${outcomeMarkText(t, probe.outcome)} · ${left}`;
2113
+ if (left !== "") return `${outcomeMarkText(t, probe.outcome)} · ${left}`;
2114
+ return probe.outcome === "rate-limited" || probe.outcome === "model-busy" ? void 0 : outcomeMarkText(t, probe.outcome);
2072
2115
  }
2073
2116
  if (probe.outcome === "rate-limited" || probe.outcome === "model-busy" || probe.outcome === "out-of-credit") return `${outcomeMarkText(t, probe.outcome)} · ${t("row.poolRetryUnknown")}`;
2074
2117
  return outcomeMarkText(t, probe.outcome);
@@ -2102,7 +2145,9 @@ window.__ModuleLoader__.load({
2102
2145
  * `error` is separate from `warn` because the advice differs: one means "wait",
2103
2146
  * the other means "do something".
2104
2147
  */
2105
- function stateTone(account) {
2148
+ function stateTone(account, nowMs = Date.now()) {
2149
+ const probe = account.probe;
2150
+ if (probe !== void 0 && probe.retryAtMs !== void 0 && probe.retryAtMs <= nowMs && (probe.outcome === "rate-limited" || probe.outcome === "model-busy")) return account.excludedBy === void 0 ? "unknown" : "warn";
2106
2151
  if (account.excludedBy !== void 0) return account.excludedBy === "rate-limited" || account.excludedBy === "model-busy" || account.excludedBy === "unavailable" ? "warn" : "error";
2107
2152
  if (account.probe === void 0) return "unknown";
2108
2153
  return outcomeOk(account.probe.outcome) ? "ok" : "warn";
@@ -2115,8 +2160,8 @@ window.__ModuleLoader__.load({
2115
2160
  * edited. The pool table draws a dot from a computed colour, so it needs a value
2116
2161
  * rather than a class name.
2117
2162
  */
2118
- function stateColor(account) {
2119
- switch (stateTone(account)) {
2163
+ function stateColor(account, nowMs = Date.now()) {
2164
+ switch (stateTone(account, nowMs)) {
2120
2165
  case "ok": return "var(--dsw-alias-state-success-primary, #22a06b)";
2121
2166
  case "warn": return "var(--dsw-alias-state-warn-primary, #f59e0b)";
2122
2167
  case "error": return "var(--dsw-alias-state-error-primary, #ef4444)";
@@ -3105,6 +3150,19 @@ window.__ModuleLoader__.load({
3105
3150
  if (running !== void 0) return running;
3106
3151
  return sorted.find((promo) => promo.badge.display !== "activeOnly" && promoWithinAbsoluteWindow(promo, nowMs) && promo.schedule?.dailyUnusable !== true);
3107
3152
  }
3153
+ /**
3154
+ * The chip's colour, when the upstream published a usable one.
3155
+ *
3156
+ * Only a hex colour is accepted: the value reaches an inline style, and the
3157
+ * upstream's feed publishes hex (`#009273`, `#FF0000`). Anything else is
3158
+ * refused rather than passed through, and the card falls back to its own
3159
+ * brand colour.
3160
+ */
3161
+ function promoBadgeColor(promo) {
3162
+ const color = promo.badge.color;
3163
+ if (color === void 0) return void 0;
3164
+ return /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(color) ? color : void 0;
3165
+ }
3108
3166
  "WorkBuddy/5.8.3 WorkBuddy/5.8.3 CLI/2.161.0".match(/WorkBuddy\/([^\s]+)/u)?.[1];
3109
3167
  new RegExp(`^(?:<acp\\b[^>]*>m\\d{1,8}<\\/acp>[ \\t]*\\r?\\n?)*(?:Time sampled while preparing turn \\d+, step \\d+:|Current runtime context\\.|<system-reminder>|\\[Compressed conversation section\\]|This is an efficiency nudge)`, "u");
3110
3168
  //#endregion
@@ -3877,6 +3935,56 @@ window.__ModuleLoader__.load({
3877
3935
  t
3878
3936
  ]);
3879
3937
  /**
3938
+ * RE-TEST THE ONE ACCOUNT WHOSE STATED COOLDOWN HAS RUN OUT — by itself, once.
3939
+ *
3940
+ * The row used to print 「被限流 · 限流时段已过 · 重新测试以确认」: a verdict, a
3941
+ * note that the verdict had expired, and a chore for the reader, in one line
3942
+ * that contradicted itself. The owner's answer was that the plugin should
3943
+ * simply measure that single account rather than write such a sentence, so
3944
+ * this does exactly that: one account, one request, no click.
3945
+ *
3946
+ * WHY AN EFFECT rather than a decision taken while rendering: `runRowTest` is
3947
+ * async and writes state, and a render must never start requests. Running after
3948
+ * the snapshot has been painted means the row first shows the honest
3949
+ * 「恢复时间已到 · 待复核」, which the new measurement then replaces.
3950
+ *
3951
+ * ONCE PER ACCOUNT PER MOUNT. The old record keeps being rendered until the new
3952
+ * one lands, so without `autoRetested` every re-render in that window would
3953
+ * fire another test, and a pool of limited accounts would hammer the upstream.
3954
+ * A FAILED re-test is final too: the row keeps its stale record instead of
3955
+ * looping on a route that is refusing.
3956
+ *
3957
+ * ONE AT A TIME. Any write in flight — a batch, a removal, another row's test —
3958
+ * returns early; the next candidate is picked on the render after the previous
3959
+ * one has flipped its own probe. Firing them together would race the refresh
3960
+ * each of them triggers (the same reason the batch is serialized).
3961
+ */
3962
+ const autoRetested = (0, react.useRef)(/* @__PURE__ */ new Set());
3963
+ (0, react.useEffect)(() => {
3964
+ if (!mounted.current || pool === void 0 || !active.enabled) return;
3965
+ if (rowBusyAccountId !== void 0 || busy !== void 0) return;
3966
+ if (pool.targetModelSource === "none" || pool.targetModelSource === "stale") return;
3967
+ const now = Date.now();
3968
+ for (const account of pool.accounts) {
3969
+ if (!active.memberAccountIds.includes(account.accountId)) continue;
3970
+ const probe = account.probe;
3971
+ if (probe === void 0 || probe.retryAtMs === void 0) continue;
3972
+ if (probe.outcome !== "rate-limited" && probe.outcome !== "model-busy") continue;
3973
+ if (probe.retryAtMs > now) continue;
3974
+ if (autoRetested.current.has(account.accountId)) continue;
3975
+ autoRetested.current.add(account.accountId);
3976
+ runRowTest(account.accountId);
3977
+ return;
3978
+ }
3979
+ }, [
3980
+ active.enabled,
3981
+ active.memberAccountIds,
3982
+ busy,
3983
+ pool,
3984
+ rowBusyAccountId,
3985
+ runRowTest
3986
+ ]);
3987
+ /**
3880
3988
  * Claim ONE benefit on ONE account, from its row (issue #79).
3881
3989
  *
3882
3990
  * Always a single account and a single campaign: there is no batch entry
@@ -4103,7 +4211,7 @@ window.__ModuleLoader__.load({
4103
4211
  visible: true,
4104
4212
  message: t("row.poolSaving"),
4105
4213
  hint: t("row.veilHintList")
4106
- }) : null, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-head" }, (0, react.createElement)("h3", { className: "dsm-workbuddy-pool-title" }, t("row.poolTitle")), manualPicker !== null ? manualPicker : currentName === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-current-badge" }, t("row.poolCurrentHeader", { account: currentName }))), (0, react.createElement)("div", { className: "dsm-workbuddy-pool-settings dsm-workbuddy-pool-modebar" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-modebar-row" }, (0, react.createElement)("label", { className: "sw" }, (0, react.createElement)("input", {
4214
+ }) : null, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-head" }, (0, react.createElement)("h3", { className: "dsm-workbuddy-pool-title" }, t("row.poolTitle")), (0, react.createElement)("p", { className: "dsm-workbuddy-free-quota-warn" }, t("row.tabFreeQuotaWarn")), manualPicker !== null ? manualPicker : currentName === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-current-badge" }, t("row.poolCurrentHeader", { account: currentName }))), (0, react.createElement)("div", { className: "dsm-workbuddy-pool-settings dsm-workbuddy-pool-modebar" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-modebar-row" }, (0, react.createElement)("label", { className: "sw" }, (0, react.createElement)("input", {
4107
4215
  type: "checkbox",
4108
4216
  checked: active.enabled,
4109
4217
  disabled: !canEditPool,
@@ -4181,7 +4289,7 @@ window.__ModuleLoader__.load({
4181
4289
  changeDeviceMode(mode);
4182
4290
  }
4183
4291
  }, t(mode === "virtual" ? "row.deviceModeVirtual" : "row.deviceModeReal"));
4184
- })), (0, react.createElement)("span", { className: "dsm-workbuddy-hint" }, modeHintBlocked ? t("row.deviceModeRealUnsupported") : deviceMode === "real" ? t("row.deviceModeHintReal") : t("row.deviceModeHintVirtual"))), (0, react.createElement)("div", { className: `dsm-workbuddy-pool-table${pool.checkinSupported ? " dsm-workbuddy-pool-table-checkin" : ""}` }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-row dsm-workbuddy-pool-row-head" }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-account" }, t("row.poolColumnAccount")), (0, react.createElement)("span", null, t("row.poolColumnCredits")), (0, react.createElement)("span", null, t("row.poolColumnProbe")), pool.checkinSupported ? (0, react.createElement)("span", null, t("row.poolColumnCheckin")) : null, (0, react.createElement)("span", null)), ...(() => {
4292
+ })), (0, react.createElement)("span", { className: "dsm-workbuddy-hint" }, modeHintBlocked ? t("row.deviceModeRealUnsupported") : deviceMode === "real" ? t("row.deviceModeHintReal") : t("row.deviceModeHintVirtual"))), (0, react.createElement)("div", { className: `dsm-workbuddy-pool-table${pool.checkinSupported ? " dsm-workbuddy-pool-table-checkin" : ""}` }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-row dsm-workbuddy-pool-row-head" }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-account" }, t("row.poolColumnAccount")), (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-credits" }, t("row.poolColumnCredits")), (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-probe" }, t("row.poolColumnProbe")), pool.checkinSupported ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-checkin" }, t("row.poolColumnCheckin")) : null, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-actions" })), ...(() => {
4185
4293
  const ordered = sortAccountsByOrder(pool.accounts, orderIds);
4186
4294
  let memberSeen = 0;
4187
4295
  let memberTotal = 0;
@@ -4329,7 +4437,24 @@ window.__ModuleLoader__.load({
4329
4437
  const name = account.accountName === "" ? t("row.accountUnnamed") : account.accountName;
4330
4438
  const excluded = exclusionText(t, account.excludedBy);
4331
4439
  const probe = account.probe;
4332
- const outcomeLine = availabilityLine(t, account) ?? t("row.poolNeverTested");
4440
+ /**
4441
+ * Would the exclusion label say what line two already says?
4442
+ *
4443
+ * Both facts come from the SAME measurement: `excludedBy` is derived from the
4444
+ * probe, so for every outcome that doubles as an exclusion reason (rate-limited,
4445
+ * model-busy, out-of-credit, credential-rejected, account-restricted,
4446
+ * unavailable, not-found, failed) the label is a second copy of the verdict a
4447
+ * few pixels away. Comparing the REASON CODE, not the translated string: the
4448
+ * string comparison this replaces covered only `rate-limited`, so 「模型繁忙 ·
4449
+ * … · 模型繁忙」 and 「积分用尽 · … · 积分用尽」 still printed the verdict twice —
4450
+ * and it would have silently un-fixed itself on the next wording change.
4451
+ *
4452
+ * With no probe at all the label is not duplicated but REUSED: `availabilityLine`
4453
+ * falls back to exactly this text.
4454
+ */
4455
+ const excludedRepeatsVerdict = excluded === void 0 || probe === void 0 || probe.outcome === account.excludedBy;
4456
+ const measuredButSilent = probe !== void 0 && availabilityLine(t, account) === void 0;
4457
+ const outcomeLine = availabilityLine(t, account) ?? (probe === void 0 ? t("row.poolNeverTested") : void 0);
4333
4458
  const reason = probe === void 0 ? void 0 : inlineProbeReason(probe.outcome, probe.message);
4334
4459
  const age = probe === void 0 ? void 0 : probeAgeText(t, probe.atMs, Date.now());
4335
4460
  const probeLabel = probe === void 0 ? void 0 : probe.source === void 0 ? {
@@ -4375,7 +4500,7 @@ window.__ModuleLoader__.load({
4375
4500
  "aria-label": t("row.poolMoveDownAria", { accountName: name }),
4376
4501
  disabled: moveDownDisabled,
4377
4502
  onClick: onMoveDown
4378
- }, "↓")) : null) : null, account.current ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-current-tag" }, t("row.poolCurrentBadge")) : null, checked ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-not-member" }, t("row.poolNotMember")), excluded === void 0 ? probe === void 0 ? null : (0, react.createElement)("span", null, t("row.poolTestedAt", { at: formatShortClock(probe.atMs) })) : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-excluded" }, excluded))), (0, react.createElement)("span", { className: "dsm-workbuddy-pool-credits" }, account.credits === void 0 ? (0, react.createElement)("span", null, "—") : (0, react.createElement)("b", null, formatNumber$1(account.credits)), account.expiringSoon !== void 0 && account.expiringSoon > 0 ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-soon" }, t("row.poolCreditSoon", { count: formatNumber$1(account.expiringSoon) })) : account.nearestExpiryMs === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-soon-plain" }, t("row.poolCreditNearest", { at: formatShortClock(account.nearestExpiryMs) })), account.enterprise === true || account.benefits === void 0 || account.benefits.length === 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-benefits" }, account.benefits.map((benefit, index) => (0, react.createElement)("span", {
4503
+ }, "↓")) : null) : null, account.current ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-current-tag" }, t("row.poolCurrentBadge")) : null, checked ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-not-member" }, t("row.poolNotMember")))), (0, react.createElement)("span", { className: "dsm-workbuddy-pool-credits" }, account.credits === void 0 ? (0, react.createElement)("span", null, "—") : (0, react.createElement)("b", null, formatNumber$1(account.credits)), account.expiringSoon !== void 0 && account.expiringSoon > 0 ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-soon" }, t("row.poolCreditSoon", { count: formatNumber$1(account.expiringSoon) })) : null, account.enterprise === true || account.benefits === void 0 || account.benefits.length === 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-benefits" }, account.benefits.map((benefit, index) => (0, react.createElement)("span", {
4379
4504
  key: benefit.kind,
4380
4505
  className: benefit.urgent ? "dsm-workbuddy-pool-benefit dsm-workbuddy-pool-benefit-urgent" : "dsm-workbuddy-pool-benefit"
4381
4506
  }, index === 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-sep" }, "·"), (0, react.createElement)("span", { className: "dsm-workbuddy-pool-benefit-tag" }, benefit.urgent ? benefit.daysLeft === void 0 || benefit.daysLeft === 0 ? t("row.poolBenefitDueToday", {
@@ -4401,7 +4526,13 @@ window.__ModuleLoader__.load({
4401
4526
  }, (0, react.createElement)("span", null, claimBusy && rowBusyAction === "claim" ? t("row.poolBenefitClaiming") : t("row.poolBenefitClaim"))))))), (0, react.createElement)("span", {
4402
4527
  className: "dsm-workbuddy-pool-probe",
4403
4528
  ...probe?.message === void 0 ? {} : { title: probe.message }
4404
- }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-main" }, probeLine), probeLabel === void 0 && age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-prov" }, probeLabel === void 0 ? null : (0, react.createElement)("span", { className: probeLabel.className }, probeLabel.text), probeLabel === void 0 || age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-sep" }, "·"), age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-age" }, age), probe !== void 0 && probe.modelId !== poolModelId ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-model" }, probe.modelId === void 0 ? t("row.poolProbeModelUnknown") : t("row.poolProbeModel", { model: probe.modelId })) : null)), checkinSupported ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-checkin" }, account.enterprise === true ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-unknown" }, t("row.poolCheckinEnterprise")) : account.checkedInToday === void 0 ? (0, react.createElement)("span", {
4529
+ }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-line" }, measuredButSilent ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-main" }, probeLine), excludedRepeatsVerdict || excluded === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-sep" }, "·"), excludedRepeatsVerdict ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-excluded" }, excluded), probe === void 0 || measuredButSilent && excludedRepeatsVerdict ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-sep" }, "·"), probe === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-tested-at" }, t("row.poolTestedAt", { at: formatShortClock(probe.atMs) }))), probeLabel === void 0 && age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-probe-prov" }, probeLabel === void 0 ? null : (0, react.createElement)("span", { className: probeLabel.className }, probeLabel.text), probeLabel === void 0 || age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-sep" }, "·"), age === void 0 ? null : (0, react.createElement)("span", { className: "dsm-workbuddy-pool-prov-age" }, age), probe !== void 0 && probe.modelId !== poolModelId ? [(0, react.createElement)("span", {
4530
+ key: "sep",
4531
+ className: "dsm-workbuddy-pool-prov-sep"
4532
+ }, "·"), (0, react.createElement)("span", {
4533
+ key: "model",
4534
+ className: "dsm-workbuddy-pool-prov-model"
4535
+ }, probe.modelId === void 0 ? t("row.poolProbeModelUnknown") : t("row.poolProbeModel", { model: probe.modelId }))] : null)), checkinSupported ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-checkin" }, account.enterprise === true ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-unknown" }, t("row.poolCheckinEnterprise")) : account.checkedInToday === void 0 ? (0, react.createElement)("span", {
4405
4536
  className: "dsm-workbuddy-pool-unknown",
4406
4537
  title: t("row.poolNeverTested")
4407
4538
  }, t("row.poolCheckinUnknown")) : account.checkedInToday ? (0, react.createElement)("span", { className: "dsm-workbuddy-pool-checked" }, t("row.poolCheckedIn")) : t("row.poolNotCheckedIn")) : null, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-row-actions" }, onEditDevice === void 0 ? null : (0, react.createElement)("button", {
@@ -6171,7 +6302,8 @@ window.__ModuleLoader__.load({
6171
6302
  * that run in a plain Node environment, where it does not exist.
6172
6303
  */
6173
6304
  function uiLanguage() {
6174
- return typeof navigator === "undefined" ? "" : navigator.language;
6305
+ if (typeof navigator === "undefined") return "";
6306
+ return navigator.language ?? "";
6175
6307
  }
6176
6308
  /** Whether the given language is an English one. */
6177
6309
  function isEnglish(language) {
@@ -6212,11 +6344,6 @@ window.__ModuleLoader__.load({
6212
6344
  * refused rather than passed through, and the card falls back to its own
6213
6345
  * brand colour.
6214
6346
  */
6215
- function promoBadgeColor(promo) {
6216
- const color = promo.badge.color;
6217
- if (color === void 0) return void 0;
6218
- return /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(color) ? color : void 0;
6219
- }
6220
6347
  /**
6221
6348
  * A calendar day, in the user's own locale — read in the ZONE the upstream
6222
6349
  * wrote the instant in.
@@ -6317,6 +6444,318 @@ window.__ModuleLoader__.load({
6317
6444
  */
6318
6445
  const WORKBUDDY_PLUGIN_ICON = "data:image/png;base64,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";
6319
6446
  //#endregion
6447
+ //#region src/client/plugin-icon.tsx
6448
+ const storageKey = "dsh-connect-workbuddy.icon-style";
6449
+ const changeEvent = storageKey + ".changed";
6450
+ /**
6451
+ * OUR OWN ICON IS THE DEFAULT.
6452
+ *
6453
+ * The visitor who opens the card never asked for a different glyph: the LD mark is
6454
+ * what the sidebar, the page header and the panel drew before this preference
6455
+ * existed, and it is the shape this plugin is recognised by. An alternate skin is
6456
+ * a CHOICE, so it has to be chosen — shipping the alternate as the default would
6457
+ * repaint an identity the user never asked to change, which is the same mistake as
6458
+ * a plugin rewriting another plugin's label.
6459
+ *
6460
+ * `'original'` is therefore also the fallback for a browser that stores nothing
6461
+ * (`getItem` throws behind a blocked-storage policy) and the value the server
6462
+ * snapshot reports, so the first paint and the hydrated paint agree.
6463
+ */
6464
+ const DEFAULT_ICON_STYLE = "original";
6465
+ /** The other one, derived so the default is stated exactly ONCE. */
6466
+ const ALTERNATE_ICON_STYLE = "claude";
6467
+ /**
6468
+ * Appearance is local to this browser; account and provider settings are untouched.
6469
+ *
6470
+ * Everything is derived from {@link DEFAULT_ICON_STYLE} rather than repeating the
6471
+ * literal, and that is not tidiness: an earlier draft compared against the stored
6472
+ * 'claude' and returned 'claude' when storage was empty, so flipping the exported
6473
+ * default changed nothing at all — the constant looked like the decision while the
6474
+ * two literals beside it were. The test that pins the default could not catch it,
6475
+ * which is how the duplicate survived.
6476
+ */
6477
+ function iconStyleSnapshot() {
6478
+ try {
6479
+ return window.localStorage.getItem(storageKey) === ALTERNATE_ICON_STYLE ? ALTERNATE_ICON_STYLE : DEFAULT_ICON_STYLE;
6480
+ } catch {
6481
+ return DEFAULT_ICON_STYLE;
6482
+ }
6483
+ }
6484
+ function subscribe(listener) {
6485
+ const onStorage = (event) => {
6486
+ if (event.key === storageKey || event.key === null) listener();
6487
+ };
6488
+ window.addEventListener(changeEvent, listener);
6489
+ window.addEventListener("storage", onStorage);
6490
+ return () => {
6491
+ window.removeEventListener(changeEvent, listener);
6492
+ window.removeEventListener("storage", onStorage);
6493
+ };
6494
+ }
6495
+ function setIconStyle(value) {
6496
+ window.localStorage.setItem(storageKey, value);
6497
+ window.dispatchEvent(new Event(changeEvent));
6498
+ }
6499
+ function PluginIcon(props) {
6500
+ const saved = (0, react.useSyncExternalStore)(subscribe, iconStyleSnapshot, () => DEFAULT_ICON_STYLE);
6501
+ const variant = props.variant ?? saved;
6502
+ const shared = {
6503
+ className: props.className,
6504
+ width: props.size ?? 16,
6505
+ height: props.size ?? 16,
6506
+ style: {
6507
+ ...props.style,
6508
+ flexShrink: 0
6509
+ },
6510
+ "aria-hidden": true
6511
+ };
6512
+ if (variant === "original") return (0, react.createElement)("img", {
6513
+ ...shared,
6514
+ src: WORKBUDDY_PLUGIN_ICON,
6515
+ alt: ""
6516
+ });
6517
+ return (0, react.createElement)("svg", {
6518
+ ...shared,
6519
+ viewBox: "0 0 24 24",
6520
+ fill: "currentColor",
6521
+ "data-icon-style": "claude",
6522
+ "data-plugin-icon": "workbuddy"
6523
+ }, (0, react.createElement)("path", { d: "M4.5 5.5h3v11h3l3-3v4l-2 2h-7z" }), (0, react.createElement)("path", { d: "M10.5 5.5H15a7 7 0 0 1 0 14h-2v-3h2a4 4 0 0 0 0-8h-1.5v2l-3 3z" }));
6524
+ }
6525
+ /** Each choice previews the real icon and immediately persists its selection. */
6526
+ function IconStylePreference({ t }) {
6527
+ const selected = (0, react.useSyncExternalStore)(subscribe, iconStyleSnapshot, () => DEFAULT_ICON_STYLE);
6528
+ const [error, setError] = (0, react.useState)(false);
6529
+ return (0, react.createElement)("div", { className: "dsm-icon-preference" }, (0, react.createElement)("div", { className: "dsm-icon-preference-copy" }, (0, react.createElement)("b", null, t("row.iconStyleLabel")), (0, react.createElement)("span", null, t("row.iconStyleHint"))), (0, react.createElement)("div", {
6530
+ className: "dsm-icon-choices",
6531
+ role: "radiogroup",
6532
+ "aria-label": t("row.iconStyleLabel")
6533
+ }, ...["original", "claude"].map((variant) => (0, react.createElement)("button", {
6534
+ key: variant,
6535
+ type: "button",
6536
+ role: "radio",
6537
+ "aria-checked": selected === variant,
6538
+ tabIndex: selected === variant ? 0 : -1,
6539
+ onKeyDown: (event) => {
6540
+ if (![
6541
+ "ArrowLeft",
6542
+ "ArrowRight",
6543
+ "ArrowUp",
6544
+ "ArrowDown",
6545
+ "Home",
6546
+ "End"
6547
+ ].includes(event.key)) return;
6548
+ event.preventDefault();
6549
+ const next = event.key === "Home" ? "original" : event.key === "End" ? "claude" : variant === "original" ? "claude" : "original";
6550
+ try {
6551
+ setIconStyle(next);
6552
+ setError(false);
6553
+ (event.currentTarget.parentElement?.querySelectorAll("[role=radio]")[next === "original" ? 0 : 1])?.focus();
6554
+ } catch {
6555
+ setError(true);
6556
+ }
6557
+ },
6558
+ onClick: () => {
6559
+ try {
6560
+ setIconStyle(variant);
6561
+ setError(false);
6562
+ } catch {
6563
+ setError(true);
6564
+ }
6565
+ }
6566
+ }, (0, react.createElement)(PluginIcon, {
6567
+ variant,
6568
+ size: 20
6569
+ }), t(variant === "claude" ? "row.iconStyleClaude" : "row.iconStyleOriginal")))), error ? (0, react.createElement)("p", {
6570
+ role: "alert",
6571
+ className: "dsm-icon-save-error"
6572
+ }, t("row.iconStyleSaveFailed")) : null);
6573
+ }
6574
+ //#endregion
6575
+ //#region src/client/series-layout.ts
6576
+ /** 同系列的公共布局规则。两个桥接插件同步维护此文件,功能专属样式留在 styles.ts。 */
6577
+ function seriesLayoutCss(plugin) {
6578
+ const p = `.dsm-${plugin}`;
6579
+ const u = `${p}-usage`;
6580
+ const members = plugin === "trae" ? `${p}-pool-card` : `${p}-pool-members`;
6581
+ const memberHead = plugin === "trae" ? `${p}-pool-card-head` : `${p}-pool-members-head`;
6582
+ const memberTitle = plugin === "trae" ? `${p}-pool-card-title` : `${p}-pool-members-title`;
6583
+ const memberActions = plugin === "trae" ? `${p}-pool-card-tools` : `${p}-pool-members-actions`;
6584
+ const saveBar = plugin === "trae" ? `${p}-pool-save-row` : `${p}-pool-save-bar`;
6585
+ return `
6586
+ ${p}-page{font-family:inherit;--dsm-series-sticky-top:-28px}
6587
+ /* Doubled selector so this beats the host's own page rule — but NOT at the cost
6588
+ * of the settings surface, which shares the class and overrides its padding to 0
6589
+ * (see styles.ts: the Settings panel column is already padded and already
6590
+ * scrolls, so this page must not add padding of its own).
6591
+ *
6592
+ * The doubled class is (0,2,0) and a bare .dsm-workbuddy-settings is (0,1,0), so
6593
+ * the padding came back and ate 36px off EACH side of the settings column:
6594
+ * measured, the content column went 612px -> 540px, i.e. every card and the
6595
+ * account table were 72px narrower than they should be. The owner saw it before
6596
+ * any test could ("整体宽度变小了"). The :not() keeps the reach of the rule and
6597
+ * gives the settings surface its padding back. */
6598
+ ${p}-page${p}-page:not(${p}-settings){height:calc(100% - 16px);margin-bottom:16px;padding:28px clamp(24px,4vw,48px) 48px;gap:20px}
6599
+ ${u} ${p}-pool-auto-checkin-status{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#777)}
6600
+ ${p}-page-desc{font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary,#999)}
6601
+ ${u} ${p}-pool-auto-checkin{display:flex;flex-direction:column;gap:6px;margin-top:8px}
6602
+ /* 1120px, NOT the 860px the shared series layout shipped with.
6603
+ *
6604
+ * The page's own rule (styles.ts) has always been 1120px, and that is what the
6605
+ * cards, the account table and the settings block were laid out and measured
6606
+ * against. The series file narrowed the container to 860 as part of "unifying
6607
+ * spacing", which does not unify anything for this plugin: it simply made every
6608
+ * block on the page ~23% narrower, took the account table's columns with it, and
6609
+ * the owner saw it immediately ("整体宽度变小了,不行,要用原来的宽度").
6610
+ *
6611
+ * Kept as a SECOND declaration next to the page's own one ON PURPOSE: this file is
6612
+ * loaded after styles.ts (it is concatenated onto the same bundle), so it would
6613
+ * win the cascade. Stating the same 1120 here is what keeps the shared file from
6614
+ * silently re-narrowing the page the next time it is synced from trae. */
6615
+ ${p}-page>*{width:100%;max-width:1120px;min-width:0}
6616
+ ${u}{gap:16px;font-size:13px;line-height:1.5;min-width:0}
6617
+ ${u} .dsm-btn{box-sizing:border-box;font:inherit;font-size:13px;line-height:20px;padding:5px 14px;border-radius:8px;min-height:32px}
6618
+ ${u} .dsm-btn-outline{background:transparent;border-color:var(--dsw-alias-border-l2,#777);color:var(--dsw-alias-label-secondary,#999)}
6619
+ ${u} ${p}-tabs{display:flex;gap:8px}
6620
+ ${u} ${p}-tab-cell{flex:1;min-width:0;padding:8px 12px;border-radius:10px}
6621
+ ${u} ${p}-panels{position:sticky;top:var(--dsm-series-sticky-top,0px);z-index:2;display:flex;gap:2px;margin:0;padding:0;border-bottom:1px solid var(--dsw-alias-border-l1,#777);background:var(--dsw-alias-bg-layer-2,#24262c)}
6622
+ /* 吸顶背景覆盖卡片两侧内边距,顶部偏移抵消滚动容器的顶部内边距。 */
6623
+ ${p}-page-body ${u} ${p}-panels{margin-inline:0;padding:0 0 8px;border:0;border-bottom:1px solid var(--dsw-alias-border-l2,#777);border-radius:0;background:var(--dsw-alias-bg-layer-3,#202126)}
6624
+ ${p}-page[data-tabs-stuck="true"] ${p}-panels{margin-inline:-20px;padding-inline:20px;border-top:1px solid var(--dsw-alias-border-l2,#777);box-shadow:0 3px 6px rgba(0,0,0,.06)}
6625
+ ${u} ${p}-panel-tab{font-size:13px;font-weight:600;line-height:20px;padding:7px 11px}
6626
+ ${u} ${p}-panel{margin-top:0;min-width:0}
6627
+ ${u} ${p}-models-summary,${u} ${p}-panel-note{margin:2px 0 0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}
6628
+ ${u} ${p}-free-quota-warn{font-weight:600}
6629
+ /* 说明段落的间距由容器统一控制,避免与卡片的纵向 gap 叠加。 */
6630
+ ${u} ${p}-region-summary{display:flex;flex-direction:column;gap:2px}
6631
+ ${u} ${p}-region-summary ${p}-models-summary{margin:0}
6632
+ /* 说明与页签之间保留 8px,抵消外层 16px 间隔中多出的部分。 */
6633
+ ${u} ${p}-region-summary+${p}-panels{margin-top:-8px}
6634
+ /* 页签底边已经分隔账号区,不在账号池顶部重复画线。 */
6635
+ ${u} #dsm-${plugin}-panel-accounts ${p}-pool{border-top:0;padding-top:0}
6636
+
6637
+ ${u} ${p}-pool{display:flex;flex-direction:column;gap:12px;margin:0;padding:14px 0 0;border-top:1px solid var(--dsw-alias-border-l2,#777)}
6638
+ ${u} ${p}-pool-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
6639
+ ${u} ${p}-pool-title{margin:0;font-size:13px;font-weight:600;line-height:18px}
6640
+ ${u} ${plugin === "trae" ? `${p}-pool-current` : `${p}-pool-current-badge`}{margin-left:auto;max-width:100%;overflow-wrap:anywhere;white-space:normal;padding:2px 8px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2,#777);font-size:11px;font-weight:500;line-height:16px;background:var(--dsw-alias-bg-layer-2,#24262c);color:var(--dsw-alias-label-secondary,#999)}
6641
+ ${u} ${p}-pool-settings${p}-pool-modebar{padding:12px 14px;gap:8px;border:1px solid var(--dsw-alias-border-l2,#777);border-radius:12px;background:color-mix(in srgb,var(--dsw-alias-brand-primary,#cf795b) 5%,var(--dsw-alias-bg-layer-2,#24262c))}
6642
+ ${u} ${p}-pool-modebar-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:20px}
6643
+ ${u} ${p}-pool-modebar-label{font-size:13px;font-weight:600;line-height:20px}
6644
+ ${u} ${p}-pool-modebar-state{padding:1px 9px;font-size:12px;line-height:18px;border-radius:999px;color:var(--dsw-alias-label-secondary,#999);border:1px solid var(--dsw-alias-border-l2,#777);background:var(--dsw-alias-bg-layer-2,#24262c)}
6645
+ ${u} ${p}-pool-note,${u} ${p}-pool-modebar ${p}-pool-note{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}
6646
+ ${u} ${members}{display:flex;flex-direction:column;gap:0;min-width:0;border:1px solid var(--dsw-alias-border-l2,#777);border-radius:12px;background:var(--dsw-alias-bg-layer-2,#24262c);overflow:hidden}
6647
+ ${u} ${memberHead}{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:14px 14px 12px}
6648
+ ${u} ${memberTitle}{margin:0;font-size:13px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-primary,#eee)}
6649
+ ${u} ${memberHead} ${p}-pool-note{margin-top:4px}
6650
+ ${u} ${memberActions}{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
6651
+ ${u} ${memberActions} .dsm-btn{padding:5px 14px;font-size:13px;line-height:20px}
6652
+ ${u} ${p}-pool-count,${u} ${memberActions} ${p}-pool-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}
6653
+ ${u} ${members} ${p}-pool-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:0 14px 12px}
6654
+ ${u} ${p}-pool-actions-end{margin-left:auto}
6655
+ ${u} ${members} ${p}-pool-action-note{margin:0;padding:0 14px 12px;font-size:12px;line-height:18px}
6656
+ ${u} ${members} ${p}-pool-table{border:0;border-top:1px solid var(--dsw-alias-border-l1,#777);border-radius:0}
6657
+ ${u} ${p}-pool-row{padding:10px 14px;align-items:start;font-size:13px;line-height:18px}
6658
+ ${u} ${p}-pool-row-head{padding:8px 14px;font-size:11px;line-height:16px;align-items:center}
6659
+ ${u} ${p}-pool-row-current{background:color-mix(in srgb,var(--dsw-alias-brand-primary,#cf795b) 5%,var(--dsw-alias-bg-layer-2,#24262c));box-shadow:inset 3px 0 0 var(--dsw-alias-brand-primary,#cf795b)}
6660
+ ${u} ${p}-pool-row-actions .dsm-btn{min-height:26px;padding:2px 10px;font-size:12px;line-height:20px}
6661
+ ${u} ${p}-pool-settings-wrap{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--dsw-alias-border-l2,#777);padding-top:14px}
6662
+ ${u} ${p}-pool-settings{border-radius:12px;gap:0}
6663
+ ${u} ${p}-pool-settings-wrap :is(h3,h4){margin:0;font-size:13px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-primary,#eee)}
6664
+ ${u} ${p}-pool-set-ctl select{box-sizing:border-box;width:240px;min-width:0;max-width:100%}
6665
+ ${u} ${p}-pool-set{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px}
6666
+ ${u} ${p}-pool-set-copy{flex:1;min-width:0;gap:3px}
6667
+ ${u} ${p}-pool-set-copy b{font-size:13px;font-weight:500;line-height:18px}
6668
+ ${u} ${p}-pool-set-copy span{font-size:12px;line-height:18px}
6669
+ /* ONCE THE SETTINGS ROW STACKS, THE CONTROL TAKES THE WHOLE LINE.
6670
+ *
6671
+ * Two rules above do the stacking (this file's .pool-set is the flex row, the
6672
+ * plugin's own @container turns it into a column), and both of the things that
6673
+ * finish that move were being overridden here:
6674
+ *
6675
+ * - width:240px on the select — (0,2,1) beats the plugin's (0,1,0) width:100%,
6676
+ * so the dropdown stayed a 240px stub in a 612px column, sitting alone under its
6677
+ * label with ~180px of dead space on each side. The owner's screenshot:
6678
+ * 「这个应该 100%宽度啊」.
6679
+ * - align-items:center on .pool-set — (0,2,0) beats the @container's
6680
+ * align-items:stretch, so even a width:100% child would have been centred
6681
+ * at its intrinsic width rather than filling.
6682
+ *
6683
+ * Restated here rather than narrowed above, because this is the same direction the
6684
+ * plugin already declares and the file that wins the cascade has to say it too.
6685
+ * Specificity matches the base rules above ((0,2,0)/(0,2,1)) and these come later,
6686
+ * so they win by order. */
6687
+ @container (max-width:620px){
6688
+ ${u} ${p}-pool-set{flex-direction:column;align-items:stretch;gap:8px}
6689
+ ${u} ${p}-pool-set-ctl{flex:1 1 auto;justify-content:flex-start;max-width:100%;min-width:0}
6690
+ ${u} ${p}-pool-set-ctl select{width:100%;max-width:none;min-width:0}
6691
+ }
6692
+ ${u} ${p}-models-title{font-size:13px;line-height:18px;font-weight:600}
6693
+ ${u} ${p}-model-list{border-radius:12px}
6694
+ ${u} ${p}-model{padding:12px 14px;gap:8px}
6695
+ ${u} ${p}-model-name{font-size:13px;line-height:20px}
6696
+ ${u} ${p}-model-actions,${u} ${p}-pool-save-row{gap:12px;padding-top:12px}
6697
+ /* 保存栏以整个账号池为粘附范围,避免被更多设置的短父级截住。 */
6698
+ ${u} ${p}-pool-settings-wrap{display:contents}
6699
+ ${u} ${saveBar}{position:sticky;bottom:0;z-index:2;isolation:isolate;padding-bottom:12px;background:var(--dsw-alias-bg-layer-3,#202126)}
6700
+ /* 滚动容器底部的内边距也属于可见区域,负偏移让背景覆盖到视口底边。 */
6701
+ ${p}-page ${saveBar}{bottom:-48px}
6702
+ ${p}-page ${saveBar}[data-save-stuck="true"]{margin-inline:-20px;padding-inline:20px;border-top:1px solid var(--dsw-alias-border-l2,#777);border-bottom:1px solid var(--dsw-alias-border-l2,#777);border-radius:0;box-shadow:0 -3px 6px rgba(0,0,0,.06)}
6703
+
6704
+ ${u} #dsm-${plugin}-panel-capabilities:not([hidden]){display:flex;flex-direction:column;gap:14px}
6705
+ ${u} ${p}-prefs{gap:14px;padding:0}
6706
+ ${u} ${p}-pref{font-size:13px;line-height:18px;gap:10px}
6707
+ ${u} ${p}-pref-hint{font-size:12px;line-height:18px}
6708
+ ${u} ${p}-draw-image{margin:0;gap:10px;font-size:13px;line-height:18px}
6709
+ ${u} ${p}-draw-image>span{display:flex;flex-direction:column;gap:3px}
6710
+ ${u} ${p}-draw-image-hint{font-size:12px;line-height:18px}
6711
+ ${u} ${p}-pool-table{container-type:inline-size}
6712
+ ${u} ${p}-pool-current-tag{border:1px solid var(--dsw-alias-border-l2,#777);background:var(--dsw-alias-bg-layer-2,#24262c);color:var(--dsw-alias-label-secondary,#999)}
6713
+ /* The ≤700px RE-GRID OF THE POOL ROW IS DELIBERATELY ABSENT.
6714
+ *
6715
+ * The shared series layout used to switch the row to display:flex + flex-wrap:wrap,
6716
+ * hide the header and give the actions their own full-width line here. That is the
6717
+ * stacked form workbuddy REMOVED: the row is three lines at every width (identity +
6718
+ * credits / verdict + timestamp + check-in + buttons / provenance), and its narrow
6719
+ * concession is one detail — dropping the absolute timestamp where it cannot sit
6720
+ * beside the verdict — not a second layout.
6721
+ *
6722
+ * Copied over, those four rules cost the row its whole shape: measured in headless
6723
+ * Chrome at the 564px Settings column, the row went from 80px to 118px, the header
6724
+ * disappeared, and the buttons fell onto a line of their own. The two-class selectors
6725
+ * below would have outranked the row's own single-class rule, so nothing warned.
6726
+ *
6727
+ * The series layout keeps everything that is genuinely shared — sticky tabs, the
6728
+ * save bar, the paddings and control metrics — and leaves each plugin row to
6729
+ * itself. trae still ships its own stacked form in its own stylesheet. */
6730
+ /* 自动签到、设备参数和 SDK 是功能差异;沿用公共间距,不移除控件。 */
6731
+ ${u} ${p}-device-mode{margin:0;padding:0 14px 12px}
6732
+ ${u} ${p}-pool .sw{width:36px;height:20px}
6733
+ ${u} ${p}-pool .sw-track::after{top:2px;left:2px;width:16px;height:16px;background:var(--dsw-alias-bg-layer-3,#fff)}
6734
+ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
6735
+ @media(max-width:600px){
6736
+ ${p}-page${p}-page{padding:20px 16px 32px;--dsm-series-sticky-top:-20px}
6737
+ ${p}-page ${saveBar}{bottom:-32px}
6738
+ ${u} ${memberHead}{align-items:flex-start}
6739
+ ${u} ${memberActions}{flex-wrap:wrap}
6740
+ ${u} ${p}-pool-set{flex-wrap:wrap}
6741
+ ${u} ${p}-pool-set-ctl{max-width:100%;flex-wrap:wrap}
6742
+ ${u} ${p}-pool-set-ctl select{min-width:0;max-width:100%}
6743
+ }
6744
+ `;
6745
+ }
6746
+ /** 根据页签与保存栏的实际吸附位置显示边界。 */
6747
+ function updateStickyTabs(page) {
6748
+ const tabs = page.querySelector("[role=\"tablist\"][class$=\"-panels\"]");
6749
+ const stuck = tabs !== null && page.scrollTop > 0 && tabs.getBoundingClientRect().top <= page.getBoundingClientRect().top + 1;
6750
+ page.dataset.tabsStuck = String(stuck);
6751
+ const viewportBottom = page.getBoundingClientRect().bottom;
6752
+ for (const bar of Array.from(page.querySelectorAll("[class$=\"-pool-save-row\"],[class$=\"-pool-save-bar\"]"))) {
6753
+ const visible = bar.getClientRects().length > 0;
6754
+ const bottom = Number.parseFloat(getComputedStyle(bar).bottom) || 0;
6755
+ bar.dataset.saveStuck = String(visible && Math.abs(bar.getBoundingClientRect().bottom + bottom - viewportBottom) <= 1);
6756
+ }
6757
+ }
6758
+ //#endregion
6320
6759
  //#region src/client/styles.ts
6321
6760
  /**
6322
6761
  * Client styles for the WorkBuddy plugin card.
@@ -6333,6 +6772,16 @@ window.__ModuleLoader__.load({
6333
6772
  * @module dsh-connect-workbuddy/client/styles
6334
6773
  */
6335
6774
  const WORKBUDDY_CARD_CSS = `
6775
+ .dsm-icon-preference{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;color:var(--dsw-alias-label-primary,#e6e6e6)}
6776
+ .dsm-icon-preference-copy{display:flex;flex-direction:column;gap:4px;flex:1;min-width:180px;font-size:13px}
6777
+ .dsm-icon-preference-copy>span{font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary,#999)}
6778
+ .dsm-icon-choices{display:flex;flex-wrap:wrap;gap:6px}
6779
+ .dsm-icon-choices>button{appearance:none;display:inline-flex;align-items:center;gap:8px;font:inherit;font-size:12px;line-height:20px;color:inherit;background:transparent;border:1px solid var(--dsw-alias-border-l2,#777);border-radius:8px;padding:7px 10px;cursor:pointer}
6780
+ .dsm-icon-choices>button[aria-checked="true"]{border-color:var(--dsw-alias-brand-primary,#cf795b);background:var(--dsw-alias-bg-layer-2,#25262b)}
6781
+ .dsm-icon-choices>button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#cf795b);outline-offset:2px}
6782
+ .dsm-icon-save-error{flex-basis:100%;margin:0;color:var(--dsw-alias-state-error-primary,#c33);font-size:12px}
6783
+
6784
+
6336
6785
  .dsm-plugin-card{border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}
6337
6786
  .dsm-plugin-card:hover{border-color:var(--dsw-alias-label-dimmed,#777)}
6338
6787
  .dsm-plugin-card-open{background:var(--dsw-alias-bg-layer-2,#25262b);border-color:var(--dsw-alias-label-dimmed,#777)}
@@ -6602,7 +7051,7 @@ window.__ModuleLoader__.load({
6602
7051
  .dsm-workbuddy-cnbase-error{margin:0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-error-primary,#ef4444)}
6603
7052
  .dsm-workbuddy-cnbase-notice{margin:0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-success-primary,#22a06b)}
6604
7053
  .dsm-workbuddy-cnbase-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
6605
- .dsm-workbuddy-pref-check,.dsm-workbuddy-image-tool-check,.dsm-workbuddy-video-tool-check,.dsm-workbuddy-cli-bridge-check,.dsm-workbuddy-sidebar-panel-check,.dsm-workbuddy-upstream-check,.dsm-workbuddy-channel-continue-check{inline-size:15px;block-size:15px;margin:3px 0 0}
7054
+ .dsm-workbuddy-pref-check,.dsm-workbuddy-image-tool-check,.dsm-workbuddy-video-tool-check,.dsm-workbuddy-cli-bridge-check,.dsm-workbuddy-sidebar-panel-check,.dsm-workbuddy-drop-thinking-check,.dsm-workbuddy-upstream-check,.dsm-workbuddy-channel-continue-check,.dsm-workbuddy-new-models-check{inline-size:15px;block-size:15px;margin:3px 0 0}
6606
7055
  /* The upstream-identity switches are their own group, so they get a divider
6607
7056
  above them instead of relying on spacing alone: they change the request the
6608
7057
  whole plugin sends, not a per-region display choice, and reading them as the
@@ -6776,10 +7225,22 @@ window.__ModuleLoader__.load({
6776
7225
  colour: it has to stand out from the three lines around it WITHOUT reading as
6777
7226
  an error banner, because the fact it states is normal product behaviour
6778
7227
  rather than a failure. Weight is the only signal it needs. */
6779
- /* 这两句现在连在一起读:先说这两个 tab 是什么,再说它们的免费额度有限。
6780
- * 所以两行之间不要段落间距(上一条 .dsm-workbuddy-tab-hint 的下边距已经给
6781
- * 足了),否则会读成两段互不相干的话。 */
6782
- .dsm-workbuddy-free-quota-warn{font-weight:600;margin-top:-10px}
7228
+ /* 这两句仍然连在一起读(先说这两个 tab 是什么,再说额度有限),但不再用负
7229
+ * 外边距把它们压成一坨。
7230
+ *
7231
+ * 上一版是 margin-top:-10px,本意是「不要段落间距」。实测代价是两行底部只隔
7232
+ * 6px,而第二行是加粗的:负外边距把上一行 18px 行高留下的空隙吃掉之后,加粗
7233
+ * 的字面几乎顶到上一行的下缘,读起来像一个被挤住的块,而不是两句话。改成
7234
+ * 4px 的正间距:仍然贴得比普通段落近,但加粗那一行有了自己的呼吸。 */
7235
+ /* Sits ON the pool heading's line now, in the gap between the title and the
7236
+ * serving-account badge. It was a block paragraph (with margins tuned to follow
7237
+ * the region-pair explanation), so it needs a row-appropriate box: no block
7238
+ * margins, and flex:1 so it takes exactly the empty middle and pushes the
7239
+ * badge to the right edge the way the heading row already wanted.
7240
+ *
7241
+ * It may WRAP rather than ellipsize: this is the sentence that stops a ×0 tier
7242
+ * being read as "unlimited", and a truncated caveat is worse than a taller row. */
7243
+ .dsm-workbuddy-free-quota-warn{font-weight:600;flex:1 1 12em;min-width:0;margin:0;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px}
6783
7244
  /* The line that explains the REGION pair, directly under it.
6784
7245
  *
6785
7246
  * It used to be a .dsm-workbuddy-models-summary inside the accounts panel,
@@ -6787,8 +7248,16 @@ window.__ModuleLoader__.load({
6787
7248
  * cells above it, so it gets its own name and its own margin: the summary's
6788
7249
  * margin:2px 0 0 was tuned to sit under a section heading, and here the line
6789
7250
  * follows a row of boxed cells and needs more air, plus it precedes the section
6790
- * tabs whose own top margin would otherwise crowd it. */
6791
- .dsm-workbuddy-tab-hint{margin:10px 0 0;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px}
7251
+ * tabs whose own top margin would otherwise crowd it.
7252
+ *
7253
+ * 最后定成 margin:0,因为这个容器是 flex column 带 gap 的:外边距会**叠在**
7254
+ * gap 之上。10px 时实测空隙 26px(10 + 16),18px 时 34px,而格子的边框让它
7255
+ * 看起来更松。真正需要的只是 gap 本身——这一行本就跟着单元格,属于同一个
7256
+ * 「范围」区块,中间不需要再插一层空气。
7257
+ *
7258
+ * 上一版反过来试过两个极端都算过账:负外边距(压成 6px,加粗那行顶到上一行)、
7259
+ * 18px(34px 的空档)。正解是不加。 */
7260
+ .dsm-workbuddy-tab-hint{margin:0;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px}
6792
7261
  /* Every model is laid out in full — NO inner scroll box.
6793
7262
  *
6794
7263
  * The previous rule capped this at max-height 520px with overflow-y auto, so a
@@ -6825,7 +7294,32 @@ window.__ModuleLoader__.load({
6825
7294
  itself wraps, because its three labels can exceed even a whole narrow line —
6826
7295
  hence the media query below as well, which gives the group the full width on a
6827
7296
  phone so it reads as one deliberate line rather than a scramble. */
7297
+ /* ONE MODEL = TWO LINES (requested; it was three for one release).
7298
+ *
7299
+ * 1. WHAT IT IS + HOW IT BEHAVES — checkbox, name, price, badges, load icon
7300
+ * then the switches and the budget select
7301
+ * 2. WHAT IT COSTS / WHAT YOU CAN DO — window + output + tier, then the buttons
7302
+ *
7303
+ * WHY THE SWITCHES MOVED BACK UP. As three lines the row left the whole right
7304
+ * HALF of line 1 empty — the name is short, and nothing followed it — while
7305
+ * line 2 carried three controls that together are narrower than that empty
7306
+ * space. The row was three lines tall and two-thirds empty per line; two lines
7307
+ * fit the same content in less height, which is what the list is for (reading
7308
+ * a roster, not admiring whitespace).
7309
+ *
7310
+ * Line 1 is a two-part flex: the name label is flex:1 and the switch group is
7311
+ * flex:none, so a long model name shrinks (it already ellipsizes) and the
7312
+ * controls never move. When the column is too narrow for both, the controls
7313
+ * wrap UNDER the name — the same visual as the old three-line layout, decided
7314
+ * by the available width rather than always. */
6828
7315
  .dsm-workbuddy-model-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;row-gap:8px;min-width:0}
7316
+ /* Line 1's right half. flex:none so the switches and the select keep their own
7317
+ width and the NAME is the only thing that gives way. */
7318
+ .dsm-workbuddy-model-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;row-gap:8px;min-width:0;flex:none}
7319
+ /* Line 2: facts left, actions right. Indented to the name (22px = the
7320
+ checkbox box + its 8px gap) so the two lines read as one block rather than
7321
+ as a checkbox with two toppled fragments beside it. */
7322
+ .dsm-workbuddy-model-details{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding-inline-start:22px}
6829
7323
  .dsm-workbuddy-model-enabled{display:flex;align-items:center;gap:8px;min-width:0;cursor:pointer;flex:1}
6830
7324
  .dsm-workbuddy-model-enabled input{margin:0;accent-color:var(--dsw-alias-brand-primary,#5686fe);flex:none}
6831
7325
  .dsm-workbuddy-model-image{display:inline-flex;align-items:center;gap:5px;flex:none;cursor:pointer;color:var(--dsw-alias-label-secondary,#c6c9d0);font-size:11px;line-height:16px}
@@ -6846,7 +7340,20 @@ window.__ModuleLoader__.load({
6846
7340
  * floor. It may still ellipsize — a name longer than the whole row cannot fit —
6847
7341
  * but it never collapses to a stub while a badge sits whole beside it. */
6848
7342
  .dsm-workbuddy-model-copy{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;min-width:0}
6849
- .dsm-workbuddy-model-copy>.dsm-workbuddy-model-name{flex:1 1 auto;min-width:9em}
7343
+ /* THE NAME MUST NOT CLAIM LEFTOVER WIDTH.
7344
+ *
7345
+ * It was flex:1 1 auto; min-width:9em, which made the name box grow to fill
7346
+ * whatever the row had spare — 117px (9em) for "Hy4", whose text is ~30px. The
7347
+ * promo chip therefore sat at the END of that inflated box, and the gap between
7348
+ * the price and the chip read as a stray blank block: it appears ONLY on rows
7349
+ * that have a chip, because that is the only case where anything follows the
7350
+ * name.
7351
+ *
7352
+ * flex:0 1 auto takes the name's own width and allows SHRINKING (so a long
7353
+ * name still ellipsizes and still cannot push the chip out of view). The floor
7354
+ * is gone with it: a minimum of 9em was what turned "do not collapse" into
7355
+ * "always at least 117px". */
7356
+ .dsm-workbuddy-model-copy>.dsm-workbuddy-model-name{flex:0 1 auto;min-width:0}
6850
7357
  /* Below the panel's own width the floor is too greedy: 9em plus two chips is
6851
7358
  wider than the line, and the NAME would force the wrap it is meant to avoid.
6852
7359
  Give it less and let the chips take the second line. */
@@ -6871,13 +7378,26 @@ window.__ModuleLoader__.load({
6871
7378
  "· N 新模型" segment (label-dimmed), but no chip border and one step smaller,
6872
7379
  so it reads as a side note beside the promotion chip rather than a second
6873
7380
  badge competing with the model name. */
7381
+ /* A badge another PROVIDER published for its own model, reproduced in the
7382
+ host's picker so it survives this plugin holding the cell. Geometry and the
7383
+ no-border rule are copied from the host's own Tag.module.css (0.2.2-rc.1) —
7384
+ the chip must be indistinguishable from one the host drew itself, which is
7385
+ also why there is no max-width here: the host does not truncate, and a chip
7386
+ that turned "限时免费" into "限时免…" at the same row width would be the one
7387
+ visible difference. Colours arrive inline per tone. */
7388
+ .dsm-workbuddy-model-label-host-badge{flex:none;display:inline-flex;align-items:center;border-radius:999px;padding:1px 8px;font-size:11px;line-height:17px;font-weight:500;white-space:nowrap}
7389
+ /* A foreign row reuses .dsm-workbuddy-model-label as its flex wrapper so both
7390
+ branches share ONE alignment model (a bare span put the pill on the text
7391
+ baseline, which rode visibly high). That class carries this plugin's own
7392
+ gap:5px, while the host's fallback uses gap:4px; the one-pixel override
7393
+ keeps the host's metric without giving our own rows a second wrapper. */
7394
+ .dsm-workbuddy-model-label-host-row{gap:4px}
6874
7395
  .dsm-workbuddy-model-label-new{flex:none;display:inline-flex;align-items:center;padding:0 5px;border-radius:999px;font-size:10px;line-height:16px;font-weight:600;white-space:nowrap;color:var(--dsw-alias-label-dimmed,rgba(127,127,127,.6))}
6875
7396
  .dsm-workbuddy-busy{flex:none;display:inline-flex;align-items:center;block-size:12px;color:var(--dsm-workbuddy-busy-color);vertical-align:-2px}
6876
7397
  .dsm-workbuddy-busy svg{display:block;block-size:12px;inline-size:auto}
6877
7398
  .dsm-workbuddy-model-promo{flex:none;display:inline-flex;align-items:center;padding:0 7px;border-radius:999px;font-size:10px;line-height:16px;font-weight:600;white-space:nowrap;color:var(--dsm-workbuddy-promo-color,var(--dsw-alias-brand-primary,#5686fe));background:rgba(255,255,255,.08);background:color-mix(in srgb,var(--dsm-workbuddy-promo-color,var(--dsw-alias-brand-primary,#5686fe)) 16%,transparent);border:1px solid transparent;border-color:color-mix(in srgb,var(--dsm-workbuddy-promo-color,var(--dsw-alias-brand-primary,#5686fe)) 40%,transparent)}
6878
7399
  .dsm-workbuddy-model-id{color:var(--dsw-alias-label-tertiary,#999);font-size:11px;line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
6879
7400
  .dsm-workbuddy-model-desc{margin:0;color:var(--dsw-alias-label-tertiary,#9aa0a8);font-size:12px;line-height:18px}
6880
- .dsm-workbuddy-model-details{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
6881
7401
  .dsm-workbuddy-model-meta{display:flex;align-items:center;gap:7px 12px;flex-wrap:wrap;color:var(--dsw-alias-label-tertiary,#999);font-size:11px;line-height:16px}
6882
7402
  .dsm-workbuddy-model-meta-tag{padding:1px 7px;border-radius:999px;font-size:11px;line-height:15px;background:rgba(174,179,187,.11);color:var(--dsw-alias-label-secondary,#c6c9d0)}
6883
7403
  /* The per-model default thinking tier (issue #179). It lives INSIDE the meta row
@@ -7036,11 +7556,102 @@ window.__ModuleLoader__.load({
7036
7556
  * viewport, which is where a full-screen overlay belongs. The table itself
7037
7557
  * contains only the header and member rows — no fixed-position descendants. */
7038
7558
  .dsm-workbuddy-pool-table{container-type:inline-size;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:12px;overflow:hidden;background:var(--dsw-alias-bg-layer-2,#24262c)}
7039
- .dsm-workbuddy-pool-row{display:grid;grid-template-columns:1.6fr 1fr 1.3fr .9fr .8fr;gap:10px;align-items:center;padding:10px 14px;border-top:1px solid var(--dsw-alias-border-l1,#2c2d31);font-size:13px;color:var(--dsw-alias-label-secondary,#c6c9d0)}
7040
- /* No check-in column (the international region): the freed track goes to the actions. */
7041
- .dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{grid-template-columns:1.6fr 1fr 1.3fr 1.7fr}
7559
+ /* THREE LINES AT EVERY WIDTH — the shape the row is meant to have.
7560
+ *
7561
+ * The row used to be five columns on one line when the table was wide, and a
7562
+ * different re-grid when it was not, so its SHAPE depended on how wide the box
7563
+ * around it happened to be: the same account read differently in the composer
7564
+ * card, the full page and the Settings column. Named lines fix the shape once,
7565
+ * whatever width it lands in:
7566
+ * line 1: who it is ...................... credits
7567
+ * line 2: what state it is in ... check-in actions
7568
+ * line 3: how it was measured (provenance)
7569
+ *
7570
+ * TWO ROWS OF AREAS, THREE LINES OF TEXT. The provenance line is the PROBE
7571
+ * CELL's own second line (the -probe-line and -probe-prov spans), so the row
7572
+ * grows to three lines without a third grid row, and the verdict line and the
7573
+ * provenance line keep the same left edge and wrap independently.
7574
+ *
7575
+ * What this replaced: the verdict and 「测试于 …」 were separate sub-rows, so
7576
+ * every row with a measured account was FOUR lines — the last one holding
7577
+ * nothing but a timestamp. The owner asked for those two on one line and for the
7578
+ * whole row to be three.
7579
+ *
7580
+ * NAMED AREAS, not five anonymous tracks. Every cell declares where it goes, so
7581
+ * a cell that is absent — the international region renders no check-in — leaves
7582
+ * its area empty instead of pulling the cells after it into the wrong columns.
7583
+ * That failure is not hypothetical: it is what made the international table
7584
+ * stack (5.20.26), where a template naming five cells over four tracks was
7585
+ * discarded wholesale by the browser. Both variants therefore keep the same
7586
+ * three tracks and the same three cells per line; only the areas differ.
7587
+ *
7588
+ * The first track is minmax(0,1fr) and not a bare 1fr on purpose: a bare 1fr
7589
+ * carries an automatic minimum of the item's min-content width, so a long
7590
+ * account name or verdict would push the row wider than its table instead of
7591
+ * ellipsizing. With a zero minimum the flexible track gives way, which is what
7592
+ * lets the same template serve the ~564px Settings column without a breakpoint.
7593
+ *
7594
+ * The LAST track is fixed px, never auto: the header and the rows are separate
7595
+ * grid containers, so an auto track is sized twice against different contents
7596
+ * and the two disagree. Measured at 820px, the actions track came out at 691 in
7597
+ * the header (it holds one empty span) and 615 in the row (it holds three
7598
+ * buttons), which dragged the check-in track beside it out of place by 76px. See
7599
+ * the credits rule below for the A/B numbers.
7600
+ *
7601
+ * The check-in track is minmax(0,auto) — flexible, so it can hold 「不适用(企业
7602
+ * 版)」 (96px) without overflowing, but with a ZERO minimum so it yields to the
7603
+ * account name instead of widening the row. It is also the one auto track the
7604
+ * header drift cannot reach: every cell in it is justify-self:end, so a header
7605
+ * label 24px wide and a value 36px wide still share their RIGHT edge exactly —
7606
+ * an auto track can move a left edge, and that is all it moves.
7607
+ *
7608
+ * The last track is 160px because that is what the button group needs AT REST in
7609
+ * the widest locale, measured in headless Chrome: ⚙ Test Remove is 156px, ⚙ 测试
7610
+ * 删除 134px. At 132px — the value this briefly shipped with — even the Chinese
7611
+ * resting group wrapped, dropping 删除 onto a line of its own and growing every
7612
+ * row by ~24px at every width. The in-flight labels (Testing… / Removing…,
7613
+ * 194-208px) still wrap, and that is exactly what flex-wrap on the group is for:
7614
+ * a momentary second line while a request is in flight beats a track wide enough
7615
+ * to waste ~48px per row at rest. */
7616
+ .dsm-workbuddy-pool-row{
7617
+ display:grid;
7618
+ grid-template-columns:minmax(0,1fr) minmax(0,auto) 160px;
7619
+ grid-template-areas:
7620
+ "account account credits"
7621
+ "probe checkin actions";
7622
+ column-gap:12px;row-gap:4px;align-items:center;padding:10px 14px;
7623
+ border-top:1px solid var(--dsw-alias-border-l1,#2c2d31);
7624
+ font-size:13px;color:var(--dsw-alias-label-secondary,#c6c9d0);
7625
+ }
7626
+ /* WITHOUT the check-in the verdict takes the freed area, so the actions stay in
7627
+ the last track — the same track, and the same right edge, in both variants.
7628
+ Three cells again: the count never changes, only which area a cell owns. */
7629
+ .dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{
7630
+ grid-template-areas:
7631
+ "account account credits"
7632
+ "probe probe actions";
7633
+ }
7042
7634
  .dsm-workbuddy-pool-row:first-child{border-top:0}
7043
- .dsm-workbuddy-pool-row-head{padding:8px 14px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-tertiary,#999);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
7635
+ .dsm-workbuddy-pool-row-head{padding:8px 14px;row-gap:1px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-tertiary,#999);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
7636
+ /* THE HEADER SPEAKS THE SAME TEMPLATE AS THE ROWS.
7637
+ *
7638
+ * It used to be a five-span row against a five-track template, and the narrow
7639
+ * form hid it because its labels pointed at tracks that no longer existed.
7640
+ * Both templates now name the same AREAS, so the labels line up in both
7641
+ * directions — and a label cannot drift away from the value it names, because
7642
+ * there is no second column definition to keep in step.
7643
+ *
7644
+ * The cells are emitted in reading order (line one, then line two) and the
7645
+ * areas decide where each lands, exactly as in the rows.
7646
+ *
7647
+ * The check-in label is ABSENT where the region has none, exactly as its cell
7648
+ * is: an empty area stays empty, and a label over nothing is worse than none.
7649
+ * The actions cell has no text — the buttons speak — but it still has to exist,
7650
+ * or the area named in the template would have no box to fill. */
7651
+ .dsm-workbuddy-pool-row-head .dsm-workbuddy-pool-col-credits{grid-area:credits;justify-self:end;text-align:right}
7652
+ .dsm-workbuddy-pool-row-head .dsm-workbuddy-pool-col-probe{grid-area:probe}
7653
+ .dsm-workbuddy-pool-row-head .dsm-workbuddy-pool-col-checkin{grid-area:checkin;justify-self:end}
7654
+ .dsm-workbuddy-pool-row-head .dsm-workbuddy-pool-col-actions{grid-area:actions}
7044
7655
  /* WHERE THE LABELED COLUMN ACTUALLY STARTS (learned from dsh-connect-trae, which
7045
7656
  carries the same rule for the same reason).
7046
7657
  *
@@ -7052,27 +7663,34 @@ window.__ModuleLoader__.load({
7052
7663
  * 38px is the checkbox (13px) plus the cell's 8px gap plus the vertical
7053
7664
  * centring slack of an 18px glyph in a 20px label; rounded to the value that
7054
7665
  * measured flush rather than derived, because the two cells do not share a
7055
- * box. The narrow form hides the whole header row, so this offset never has to
7056
- * be re-tuned for the stacked layout. */
7057
- .dsm-workbuddy-pool-col-account{padding-inline-start:38px}
7666
+ * box. The offset holds at every width now that the header is no longer hidden:
7667
+ * the cell keeps the same leading checkbox in both forms. */
7668
+ .dsm-workbuddy-pool-col-account{grid-area:account;padding-inline-start:38px}
7058
7669
  .dsm-workbuddy-pool-row-current{background:rgba(86,134,254,.07)}
7059
7670
  /* The serving row, made findable at a glance: a left accent bar plus the tint.
7060
7671
  The bar is what distinguishes it in a long table, where a 7%-opacity wash
7061
7672
  alone reads as an alternating-row stripe. */
7062
7673
  .dsm-workbuddy-pool-row-current{box-shadow:inset 3px 0 0 var(--dsw-alias-brand-primary,#5686fe)}
7063
- .dsm-workbuddy-pool-account{display:flex;align-items:center;gap:8px;min-width:0}
7064
- .dsm-workbuddy-pool-account-name{display:flex;flex-direction:column;gap:1px;min-width:0}
7065
- .dsm-workbuddy-pool-account-name b{font-weight:500;color:var(--dsw-alias-label-primary,#e6e6e6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
7674
+ .dsm-workbuddy-pool-account{grid-area:account;display:flex;align-items:center;gap:8px;min-width:0}
7675
+ /* The account block WRAPS AMONG ITSELF instead of stacking.
7676
+ *
7677
+ * It was a column — name / rank+arrows / current pill / membership line — which
7678
+ * is what a whole cell per fact needs, but this cell now shares line one with
7679
+ * the credits. Stacked, those four become four lines and the three-line row the
7680
+ * rest of the card promises is a lie on every row. Read as a sentence it is one
7681
+ * line — 「账号A · 第 1 位 · 当前使用」 — so it wraps instead. */
7682
+ .dsm-workbuddy-pool-account-name{display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px;min-width:0}
7683
+ .dsm-workbuddy-pool-account-name b{font-weight:500;color:var(--dsw-alias-label-primary,#e6e6e6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%}
7066
7684
  .dsm-workbuddy-pool-account-name span{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#999)}
7067
7685
  /* Declared AFTER the blanket span rule so it wins: the badge must not inherit
7068
7686
  the muted 11px tertiary treatment the membership line uses. */
7069
- .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:flex-start;margin-top:2px;padding:1px 6px;border-radius:999px;background:var(--dsw-alias-state-success-primary,#22c55e);border:1px solid rgba(34,197,94,.55);color:#fff;font-size:11px;font-weight:600;line-height:16px;white-space:nowrap}
7687
+ .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:center;padding:1px 6px;border-radius:999px;background:var(--dsw-alias-state-success-primary,#22c55e);border:1px solid rgba(34,197,94,.55);color:#fff;font-size:11px;font-weight:600;line-height:16px;white-space:nowrap}
7070
7688
  /* Manual-priority chrome (order badge + up/down arrows). The rank badge is a SPAN,
7071
7689
  not a button: it only DESCRIBES the current order and must not read as a
7072
7690
  control (nor join the row's button list). The solid vs dashed distinction is
7073
7691
  load-bearing — a numeric rank must NOT appear when the credit policy still
7074
7692
  decides the order, so the -auto modifier is the dashed/grey state. */
7075
- .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{display:flex;align-items:center;gap:6px;margin-top:2px;flex-wrap:wrap}
7693
+ .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
7076
7694
  .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-rank{display:inline-flex;align-items:center;border-radius:999px;border:1px solid rgba(86,134,254,.32);background:rgba(86,134,254,.12);color:var(--dsw-alias-brand-primary,#5686fe);font-size:11px;font-weight:600;line-height:16px;padding:1px 6px;white-space:nowrap;cursor:default;font-variant-numeric:tabular-nums}
7077
7695
  .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-rank-auto{border:1px dashed var(--dsw-alias-border-l1,#2c2d31);background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-secondary,#c6c9d0)}
7078
7696
  .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-move{display:inline-flex;align-items:center;gap:2px}
@@ -7109,10 +7727,42 @@ window.__ModuleLoader__.load({
7109
7727
  /* The "why expiring credits win" note is the sentence users push back on, so
7110
7728
  it is tinted rather than buried in the same grey as the eight rules. */
7111
7729
  .dsm-workbuddy-pool-order-rules-why{margin:0;padding:8px 10px;border-radius:8px;border-left:3px solid var(--dsw-alias-state-warn-primary,#f59e0b);background:rgba(245,158,11,.10);font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#c6c9d0)}
7112
- .dsm-workbuddy-pool-credits{display:flex;flex-direction:column;gap:1px;min-width:0;font-variant-numeric:tabular-nums}
7730
+ /* THE CREDITS TRACK IS ITS OWN COLUMN, right-aligned against the row's edge.
7731
+ *
7732
+ * This cell is pinned to its right end (justify-self:end) so one right edge
7733
+ * stands under every row, however wide the number is.
7734
+ *
7735
+ * AUTO IS THE THING THAT FAILED HERE, for the track that follows it. The header
7736
+ * and the data rows are two SEPARATE grid containers, so an auto track is
7737
+ * measured twice, each against its own contents — and it is the ACTIONS track
7738
+ * that differs (one empty span in the header, three buttons in the row). Because
7739
+ * the check-in sits immediately before it, a 76px difference there moves the
7740
+ * check-in label 76px away from the value it names: measured in headless Chrome
7741
+ * at 820px, header 691 vs data 615. jsdom does no layout and cannot see it. Fixed
7742
+ * px on the actions track keeps the two containers in step — the same reason
7743
+ * dsh-connect-qoder pins its trailing tracks.
7744
+ *
7745
+ * The cell is a ROW, not a column, and it is ONE track: the fixed 160px the
7746
+ * actions need (see the row rule). The figure and its warning sit side by side
7747
+ * and share that width — 「1,556」 is 38px and 「300 积分 3 天内过期」 103px, so
7748
+ * together they are 122px and never wrap here. Stacked, as they were, the cell
7749
+ * was 35px instead of 18px: line one grew by 17px on EVERY row, and the
7750
+ * warning's baseline landed between the verdict and the provenance line, so the
7751
+ * right side of the row read as detached from the left. flex-wrap is kept as a
7752
+ * last resort (a 3-digit figure plus a longer locale) rather than a clipped
7753
+ * number.
7754
+ *
7755
+ * THE ONE STATE THAT IS NOT THREE LINES: a claimable-benefit entry (issue #79)
7756
+ * also renders in this cell, and its own min-content is 229px — a full label
7757
+ * plus the claim pill — so inside 160px it wraps to two lines and line one
7758
+ * becomes two lines, i.e. a four-line row. That predates the three-line shape
7759
+ * and is deliberate in the benefit rule below (its tag clamps to two lines so an
7760
+ * unexpectedly long upstream title cannot push the row taller than the pill can
7761
+ * travel). Fitting it would mean moving the claim button OFF line one; the pill
7762
+ * is a seasonal campaign, so the row keeps its honest wrap instead. */
7763
+ .dsm-workbuddy-pool-credits{grid-area:credits;display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:flex-end;gap:0 6px;min-width:0;justify-self:end;text-align:right;font-variant-numeric:tabular-nums}
7113
7764
  .dsm-workbuddy-pool-credits b{color:var(--dsw-alias-label-primary,#e6e6e6);font-weight:600}
7114
7765
  .dsm-workbuddy-pool-soon{font-size:11px;line-height:16px;color:var(--dsw-alias-state-warn-primary,#f59e0b)}
7115
- .dsm-workbuddy-pool-soon-plain{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#999)}
7116
7766
  /* Claimable benefits (issue #79). A quiet line by default — it is an opportunity, not a fault — and loud only when the window is about to close. */
7117
7767
  .dsm-workbuddy-pool-benefits{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#999);min-width:0}
7118
7768
  /* One entry = text + pill, and the text wraps rather than being cut.
@@ -7222,8 +7872,33 @@ window.__ModuleLoader__.load({
7222
7872
  box-shadow:none;
7223
7873
  }
7224
7874
  .dsm-workbuddy-pool-probe,.dsm-workbuddy-pool-checkin{font-size:12px;line-height:17px;color:var(--dsw-alias-label-tertiary,#999);min-width:0;overflow-wrap:anywhere}
7225
- .dsm-workbuddy-pool-probe{display:flex;flex-direction:column;gap:4px}
7226
- .dsm-workbuddy-pool-probe-main{color:var(--dsw-alias-label-secondary,#c6c9d0)}
7875
+ /* The verdict cell: LINE TWO of the row, and two lines of its own.
7876
+ *
7877
+ * The -probe-line span holds the verdict together with the moment it was
7878
+ * measured (see the rule below); -probe-prov is line THREE. A 2px gap is what
7879
+ * keeps those two from reading as one wrapped paragraph: at 4px they looked like
7880
+ * a single block of text that happened to break, which is how the four-line row
7881
+ * it replaced looked. */
7882
+ .dsm-workbuddy-pool-probe{grid-area:probe;display:flex;flex-direction:column;gap:2px;min-width:0}
7883
+ /* VERDICT · TESTED-AT, ONE LINE.
7884
+ *
7885
+ * These were two sub-rows, and every measured account was therefore four lines
7886
+ * tall with a timestamp on the last one. They are one sentence — "被限流 · 11/08
7887
+ * 15:44 之后可再用 · 约 15 小时后 · 测试于 11/07 17:36" — so they wrap together
7888
+ * as a unit, and the measured widths say why that matters: the longest verdict
7889
+ * is 260px and 「测试于 11/07 17:36」 another 102, so the pair needs ~380px. It
7890
+ * fits from ~700px up; below that only the verdict fits, and the block further
7891
+ * down drops the timestamp rather than letting the pair wrap onto a line the row
7892
+ * does not have. */
7893
+ .dsm-workbuddy-pool-probe-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px;min-width:0}
7894
+ .dsm-workbuddy-pool-probe-main{color:var(--dsw-alias-label-secondary,#c6c9d0);min-width:0;overflow-wrap:anywhere}
7895
+ /* The separator belongs to the timestamp it introduces, so a wrapped line can
7896
+ never leave a lone 「·」 hanging at the end of the verdict. */
7897
+ .dsm-workbuddy-pool-probe-sep,.dsm-workbuddy-pool-tested-at{font-size:11px;line-height:15px;color:var(--dsw-alias-label-tertiary,#999);white-space:nowrap}
7898
+ .dsm-workbuddy-pool-probe-sep{color:var(--dsw-alias-label-dimmed,#9aa0a6);opacity:.7}
7899
+ /* WHEN, in the verdict's own sentence but at the weight of a timestamp: at 12px
7900
+ and the verdict's colour it read as a second verdict, and the row looked like
7901
+ two statements fighting for the same line. */
7227
7902
  .dsm-workbuddy-pool-probe-prov{display:flex;align-items:center;gap:5px;font-size:11px;line-height:15px;color:var(--dsw-alias-label-tertiary,#999);min-width:0;flex-wrap:wrap}
7228
7903
  .dsm-workbuddy-pool-prov-tag{padding:1px 6px;border-radius:999px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-tertiary,#999);font-size:10px;font-weight:600;line-height:15px;white-space:nowrap}
7229
7904
  .dsm-workbuddy-pool-prov-live{background:rgba(245,158,11,.16);color:var(--dsw-alias-state-warn-primary,#f59e0b)}
@@ -7249,6 +7924,15 @@ window.__ModuleLoader__.load({
7249
7924
  .dsm-workbuddy-pool-check input{margin:0;cursor:pointer;accent-color:var(--dsw-alias-brand-primary,#5686fe)}
7250
7925
  .dsm-workbuddy-pool-check input:disabled{cursor:default;opacity:.5}
7251
7926
  .dsm-workbuddy-pool-checked{color:var(--dsw-alias-state-success-primary,#22a06b)}
7927
+ /* Line two, middle: the daily claim. Its own AREA so that a region WITHOUT it
7928
+ leaves that slot empty instead of sliding the actions one track left.
7929
+ *
7930
+ * BASELINE-aligned, not centred: line two is two lines tall (verdict above,
7931
+ * provenance below), and a centred cell floats between them — measured, 「已签到」
7932
+ * sat 8px below the verdict's baseline, which read as belonging to neither line.
7933
+ * Sharing the verdict's baseline puts the state on the same line as the verdict
7934
+ * it belongs to. */
7935
+ .dsm-workbuddy-pool-checkin{grid-area:checkin;justify-self:end;align-self:baseline;white-space:nowrap;min-width:0;overflow-wrap:anywhere}
7252
7936
  .dsm-workbuddy-pool-unknown{color:var(--dsw-alias-label-dimmed,#9aa0a6)}
7253
7937
  .dsm-workbuddy-pool-not-member{color:var(--dsw-alias-label-dimmed,#9aa0a6)}
7254
7938
  /* A section break, not just a gap: below this line the page stops showing what
@@ -7368,13 +8052,28 @@ window.__ModuleLoader__.load({
7368
8052
  .dsm-workbuddy-pool-log-error{color:var(--dsw-alias-state-error-primary,#ef4444)}
7369
8053
  .dsm-workbuddy-pool-log-info{color:var(--dsw-alias-label-secondary,#c6c9d0)}
7370
8054
  .dsm-workbuddy-pool-log-empty{padding:14px;font-size:12px;color:var(--dsw-alias-label-tertiary,#999)}
7371
- /* Per-row actions (test / remove), right side of each pool row. */
7372
- /* Per-row actions (test / remove), right side of each pool row.
7373
- The nowrap is NOT cosmetic: a two-character label (测试) belongs on one line,
7374
- and this row's track is a fraction of the table — in a narrow window it let
7375
- the label break into 测 / 试. Clipping is the right failure for a button
7376
- whose label is fixed and tiny. */
7377
- .dsm-workbuddy-pool-row-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex:none}
8055
+ /* Per-row actions (test / device / remove), closing line two.
8056
+ *
8057
+ * Their third resting place. They have been (1) the row's last grid cell of the
8058
+ * old single-line table, where a separate track put them on a line of their own
8059
+ * below the credits; (2) inside the account cell, pushed right by an auto
8060
+ * margin, which on the re-grid put them at the END OF LINE ONE — before the
8061
+ * reader met the facts they act on; and now (3) the row's last cell again,
8062
+ * which with two named lines means the end of line two, right after the verdict
8063
+ * they respond to. The reading order is the point:
8064
+ * who it is → what state it is in → what you can do about it.
8065
+ *
8066
+ * BASELINE-aligned for the same reason as the check-in beside them: line two is
8067
+ * two lines tall, and a centred button group sits in the gap between the verdict
8068
+ * and the provenance line — measured, the buttons' text baseline was 8px below
8069
+ * the verdict's. Sharing that baseline makes the buttons read as the end of the
8070
+ * sentence they act on.
8071
+ *
8072
+ * The nowrap is NOT cosmetic: a two-character label (测试) belongs on one line,
8073
+ * and clipping is the right failure for a button whose label is fixed and tiny.
8074
+ * flex:none is load-bearing: the name may truncate, the buttons may not, and a
8075
+ * shrunken button is unclickable. */
8076
+ .dsm-workbuddy-pool-row-actions{grid-area:actions;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;align-items:center;flex:none;justify-self:end;align-self:baseline;max-width:100%}
7378
8077
  .dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{white-space:nowrap}
7379
8078
  .dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{padding:2px 10px;font-size:12px}
7380
8079
  /* The picker's cap, narrowed on a phone. NOTE this @media measures the VIEWPORT,
@@ -7392,75 +8091,45 @@ window.__ModuleLoader__.load({
7392
8091
  /* The settings rows (target model, probe size) are flex with a content column
7393
8092
  * that grows and a control that does not. In the Settings panel the control was
7394
8093
  * squeezed to a sliver: max-width:260px caps it but nothing gives it a floor,
7395
- * and the copy beside it takes everything else. Stacking is the same move the
7396
- * table makes at this width — one fact per line rather than two columns of
7397
- * clipped text. */
8094
+ * and the copy beside it takes everything else. Stacking gives each one a whole
8095
+ * line, which beats two columns of clipped text.
8096
+ *
8097
+ * NOTE: this is NOT the move the pool table makes. The table is three lines at
8098
+ * every width now (see the grid above), so a narrow column no longer changes
8099
+ * its shape — only these two settings rows still switch. */
7398
8100
  @container (max-width:620px){.dsm-workbuddy-pool-set{flex-direction:column;align-items:stretch;gap:8px}
7399
8101
  .dsm-workbuddy-pool-set-ctl{flex:1 1 auto;justify-content:flex-start}
7400
8102
  .dsm-workbuddy-pool-select{max-width:none;width:100%}}
7401
- /* THE TABLE'S NARROW FORM, measured against the table rather than the window.
8103
+ /* THE ONE THING THAT STILL DEPENDS ON WIDTH — and it is a DETAIL, not a shape.
7402
8104
  *
7403
- * Every breakpoint in this file up to here is a @media query, and those
7404
- * measure the VIEWPORT. The same card now renders in the Settings panel's
7405
- * content column (~564px on a 1400px screen), where a media query never fires:
7406
- * a five-column table was laid into 564px and every cell clipped.
8105
+ * The three-line row above is the same shape at every width, so nothing here
8106
+ * re-arranges cells any more: no second track count, no second set of occupied
8107
+ * cells, no display:none on the header. All three existed because the wide and
8108
+ * narrow forms disagreed about where a cell went; both templates now name the
8109
+ * same areas, so the labels describe the rows at every width.
7407
8110
  *
7408
- * ONE threshold, not two. An earlier revision had a 720px band that merely
7409
- * dropped one track, on the theory that "slightly narrower" still wants a grid
7410
- * — but the Settings column lands at ~564px, i.e. INSIDE that band, so the
7411
- * reader got a 2x2 grid whose cells no longer lined up with their headers and
7412
- * whose rows were twice as tall as the wide ones. A table has no "slightly
7413
- * narrower" form worth having: either there is room for the columns or there
7414
- * is not.
8111
+ * What this block DOES drop is 「测试于 11/07 17:36」, and only where it cannot
8112
+ * fit beside the verdict. Measured in headless Chrome: the longest verdict is
8113
+ * 260px and the timestamp 102px, so the verdict line needs ~380px; at the
8114
+ * Settings column's 564px the probe cell has ~330px in the Chinese table (the
8115
+ * check-in and the 160px button track take the rest). Letting the pair wrap there
8116
+ * is what turns three lines into four — the exact shape the owner rejected — and
8117
+ * the timestamp is the fragment to lose, not the verdict: the provenance line
8118
+ * directly below already dates the same measurement, as 「2 小时前」. Nothing is
8119
+ * hidden that is not said again on the next line, and the absolute moment stays
8120
+ * in the activity log the test wrote.
7415
8121
  *
7416
- * Below the threshold each row becomes a STACKED CARD: the same five facts, in
7417
- * the same order they read left to right when wide, now top to bottom. That is
7418
- * what keeps a narrow row legible instead of merely fitting. */
8122
+ * ONE CASE IS STILL FOUR LINES, and it is left that way on purpose: an ENGLISH
8123
+ * enterprise row in the 564px column, whose check-in cell says 「N/A (enterprise)」
8124
+ * (~96px) while the verdict is the 301px English rate-limit sentence. The probe
8125
+ * cell then has ~262px, so the verdict wraps. The alternative — clipping the
8126
+ * verdict, or ellipsizing the check-in — trades a rare extra line for a lie about
8127
+ * whether the account works, which is the one thing this row exists to say. The
8128
+ * Chinese table in the same state fits (262px for a 260px verdict). */
7419
8129
  @container (max-width:700px){
7420
- /* THREE LINES, not five. A plain flex-direction:column stacked every cell
7421
- onto its own line, which doubled the row height and read as a form rather
7422
- than an account. Wrapping is what keeps the row a CARD: the account and the
7423
- actions own a full line each (they are the identify-it and act-on-it ends),
7424
- while the three facts in between share the middle line and wrap among
7425
- themselves only when they genuinely do not fit. */
7426
- .dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:10px 12px}
7427
- .dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline}
7428
- /* The column headers describe tracks that no longer exist. */
7429
- .dsm-workbuddy-pool-row-head{display:none}
7430
- .dsm-workbuddy-pool-account{flex:1 1 100%;align-items:center}
7431
- /* THE ACCOUNT CELL'S OWN COLUMN, collapsed the same way — and this is the
7432
- rule that actually decides the row height (learned from dsh-connect-trae
7433
- 4.9.0, which shipped the outer half of this fix and measured 138px rows).
7434
- *
7435
- * Collapsing only .dsm-workbuddy-pool-account above is NOT enough: that is
7436
- * just a flex wrapper. The cells that stack are one level deeper, inside
7437
- * .dsm-workbuddy-pool-account-name, which declares flex-direction:column so
7438
- * that the name, the rank badge with its ↑/↓ arrows, the 「当前使用」 pill and
7439
- * the 「测试于 …」 line read as a small card when the table is WIDE.
7440
- *
7441
- * In the Settings column they have no reason to keep one line each: measured
7442
- * at 549px, that block was 81px of the row's 157px — five lines (name, rank +
7443
- * arrows, current badge, tested-at), while the three facts beside it sat on
7444
- * one 18px line. The row therefore read as "one tall account block and three
7445
- * strays", and every extra row cost the reader two thirds of a screen.
7446
- *
7447
- * Read as a sentence it is one line — 「用户7520607992 · 第 1 位 ↑↓ · 当前使用 ·
7448
- * 测试于 11/06, 03:57」 — so it wraps among itself instead of stacking. The
7449
- * margins the wide form needs (2px above the badge, 2px above the current pill)
7450
- * go away with the stacking: in a wrapped row they become uneven leading. */
7451
- .dsm-workbuddy-pool-account-name{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
7452
- .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{margin-top:0}
7453
- .dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:center;margin-top:0}
7454
- /* The name still has to be allowed to SHRINK. The <b> carries nowrap + ellipsis,
7455
- whose whole point is that a long account name ends in "…" rather than
7456
- pushing the line — but as a flex item it defaults to min-width:auto, i.e.
7457
- its content width, and then the ellipsis can never engage. */
7458
- .dsm-workbuddy-pool-account-name b{min-width:0;max-width:100%}
7459
- /* The three middle facts, laid out as one line of the same sentence. */
7460
- .dsm-workbuddy-pool-credits{flex:0 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
7461
- .dsm-workbuddy-pool-probe{flex:1 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
7462
- .dsm-workbuddy-pool-checkin{flex:none}
7463
- .dsm-workbuddy-pool-row-actions{flex:1 1 100%;justify-content:flex-start;padding-top:4px}
8130
+ .dsm-workbuddy-pool-row{column-gap:8px;row-gap:3px;padding:9px 12px}
8131
+ .dsm-workbuddy-pool-row-head{padding:7px 12px}
8132
+ .dsm-workbuddy-pool-probe-sep,.dsm-workbuddy-pool-tested-at{display:none}
7464
8133
  }
7465
8134
 
7466
8135
  /* ISSUE #198, the same breakpoint the pool row already uses. On a phone the model
@@ -7761,7 +8430,7 @@ window.__ModuleLoader__.load({
7761
8430
  border:1px solid var(--dsw-alias-border-l2,#3a3d45);
7762
8431
  }
7763
8432
 
7764
- `;
8433
+ ` + seriesLayoutCss("workbuddy");
7765
8434
  /**
7766
8435
  * Composer credit readout styles, injected by the readout component itself.
7767
8436
  *
@@ -8740,6 +9409,15 @@ window.__ModuleLoader__.load({
8740
9409
  */
8741
9410
  const [togglingCredits, setTogglingCredits] = (0, react.useState)(void 0);
8742
9411
  /**
9412
+ * Which region's new-model-segment flag is being written right now.
9413
+ *
9414
+ * Tracked separately from {@link togglingCredits} for the same reason those
9415
+ * are separate from `togglingRegion`: they are different fields of one region
9416
+ * slot, so one in-flight write must not disable the other control while both
9417
+ * stay serialized against the SAVE writers.
9418
+ */
9419
+ const [togglingNewModels, setTogglingNewModels] = (0, react.useState)(void 0);
9420
+ /**
8743
9421
  * Which video-model pin is being written right now: the tag string, or
8744
9422
  * undefined.
8745
9423
  *
@@ -8806,6 +9484,8 @@ window.__ModuleLoader__.load({
8806
9484
  const [sessionTitleBusy, setSessionTitleBusy] = (0, react.useState)(false);
8807
9485
  const [channelRejectContinueOn, setChannelRejectContinueOn] = (0, react.useState)(void 0);
8808
9486
  const [channelRejectContinueBusy, setChannelRejectContinueBusy] = (0, react.useState)(false);
9487
+ const [dropAllThinkingOn, setDropAllThinkingOn] = (0, react.useState)(void 0);
9488
+ const [dropAllThinkingBusy, setDropAllThinkingBusy] = (0, react.useState)(false);
8809
9489
  /**
8810
9490
  * Probe results, keyed by region then model id.
8811
9491
  *
@@ -9196,6 +9876,20 @@ window.__ModuleLoader__.load({
9196
9876
  return regionCreditsShownOf(settingsScope?.getSnapshot().value, item);
9197
9877
  };
9198
9878
  /**
9879
+ * Whether this region's composer pill may show its "· N 新模型" segment.
9880
+ *
9881
+ * Host answer first, settings mirror second — same measured reason as
9882
+ * {@link creditsShownOn}. Both sources read this flag OPT-IN (`=== true`):
9883
+ * "new" means first seen by THIS machine, so on a fresh install it would
9884
+ * announce the entire roster, and an absent value must not become consent.
9885
+ * See `showNewModelsInMainUi` in the schema.
9886
+ */
9887
+ const newModelsShownOn = (item) => {
9888
+ const usage = statusByRegion[item];
9889
+ if (typeof usage?.showNewModelsInMainUi === "boolean") return usage.showNewModelsInMainUi;
9890
+ return regionNewModelsShownOf(settingsScope?.getSnapshot().value, item);
9891
+ };
9892
+ /**
9199
9893
  * Whether the model may call the image tool in this region.
9200
9894
  *
9201
9895
  * Read off the Host's answer first, like {@link creditsShownOn} and for the
@@ -9310,6 +10004,19 @@ window.__ModuleLoader__.load({
9310
10004
  if (mounted.current) setTogglingCredits(void 0);
9311
10005
  }
9312
10006
  };
10007
+ const toggleNewModels = async (item, shown) => {
10008
+ if (settingsScope === void 0) return;
10009
+ setTogglingNewModels(item);
10010
+ try {
10011
+ const slot = nextRegionNewModelsShown(settingsScope.getSnapshot().value, item, shown)[item];
10012
+ await writeRegionNewModelsShown(settingsScope, item, shown, typeof slot === "object" && slot !== null ? slot : {});
10013
+ await refreshUsage(item);
10014
+ } catch (error) {
10015
+ if (mounted.current) setAccountError(error instanceof Error ? error.message : t("row.requestFailed"));
10016
+ } finally {
10017
+ if (mounted.current) setTogglingNewModels(void 0);
10018
+ }
10019
+ };
9313
10020
  const toggleCredits = async (item, shown) => {
9314
10021
  if (settingsScope === void 0) return;
9315
10022
  setTogglingCredits(item);
@@ -9429,6 +10136,17 @@ window.__ModuleLoader__.load({
9429
10136
  };
9430
10137
  };
9431
10138
  /**
10139
+ * The reasoning-redaction switch (issue #213).
10140
+ *
10141
+ * Same three-level resolution as every other switch: this card's own verified
10142
+ * write, then the committed snapshot. No Host mirror, because this one has no
10143
+ * status-document field — it does not change any number the card displays.
10144
+ */
10145
+ const dropAllThinkingValue = () => {
10146
+ if (dropAllThinkingOn !== void 0) return dropAllThinkingOn;
10147
+ return (settingsScope?.getSnapshot().value)?.["dropAllThinking"] === true;
10148
+ };
10149
+ /**
9432
10150
  * Flip one upstream-identity switch.
9433
10151
  *
9434
10152
  * No `refreshUsage` afterwards, unlike the CLI switch: these change the shape
@@ -9438,8 +10156,8 @@ window.__ModuleLoader__.load({
9438
10156
  */
9439
10157
  const toggleUpstreamSwitch = async (field, enabled) => {
9440
10158
  if (settingsScope === void 0) return;
9441
- const setBusy = field === "usageIdentity" ? setUsageIdentityBusy : field === "keepPromptLast" ? setKeepPromptLastBusy : field === "sessionTitle" ? setSessionTitleBusy : setChannelRejectContinueBusy;
9442
- const setOwn = field === "usageIdentity" ? setUsageIdentityOn : field === "keepPromptLast" ? setKeepPromptLastOn : field === "sessionTitle" ? setSessionTitleOn : setChannelRejectContinueOn;
10159
+ const setBusy = field === "usageIdentity" ? setUsageIdentityBusy : field === "keepPromptLast" ? setKeepPromptLastBusy : field === "sessionTitle" ? setSessionTitleBusy : field === "channelRejectContinue" ? setChannelRejectContinueBusy : setDropAllThinkingBusy;
10160
+ const setOwn = field === "usageIdentity" ? setUsageIdentityOn : field === "keepPromptLast" ? setKeepPromptLastOn : field === "sessionTitle" ? setSessionTitleOn : field === "channelRejectContinue" ? setChannelRejectContinueOn : setDropAllThinkingOn;
9443
10161
  setBusy(true);
9444
10162
  try {
9445
10163
  await writeUpstreamSwitch(settingsScope, field, field === "sessionTitle" ? {
@@ -10071,16 +10789,6 @@ window.__ModuleLoader__.load({
10071
10789
  const sweepTpsEnabledModels = () => {
10072
10790
  measureTpsFor(visibleModels.filter((model) => activeEnabledIds.has(model.id)).map((model) => model.id));
10073
10791
  };
10074
- /**
10075
- * Sweep EVERY model in the region's live catalog, enabled or not.
10076
- *
10077
- * Deliberately the whole VISIBLE catalog and nothing else: those are the ids
10078
- * the host can validate against its own catalog, so this cannot spend credit
10079
- * on an id that only exists in a config file.
10080
- */
10081
- const sweepAllModels = () => {
10082
- sweepModels(visibleModels.map((model) => model.id));
10083
- };
10084
10792
  const saveModels = async () => {
10085
10793
  if (settingsScope === void 0) return;
10086
10794
  if (status.status !== "signed-in") return;
@@ -10836,6 +11544,42 @@ window.__ModuleLoader__.load({
10836
11544
  })]
10837
11545
  })]
10838
11546
  });
11547
+ /**
11548
+ * ISSUE #213: redact past reasoning from the request.
11549
+ *
11550
+ * Its own group rather than a row inside the channel-reject block, because the
11551
+ * two answer different failures: that switch RESENDS after a refusal, this one
11552
+ * removes the text that gets scanned in the first place. Grouping them would
11553
+ * imply they are alternatives of one feature.
11554
+ */
11555
+ const dropAllThinkingPreference = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11556
+ className: "dsm-workbuddy-prefs",
11557
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11558
+ className: "dsm-workbuddy-pref-hint",
11559
+ children: t("row.dropAllThinkingLead")
11560
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11561
+ className: "dsm-workbuddy-pref dsm-workbuddy-upstream-pref",
11562
+ title: t("row.dropAllThinkingHint"),
11563
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11564
+ type: "checkbox",
11565
+ className: "dsm-workbuddy-drop-thinking-check",
11566
+ checked: dropAllThinkingValue(),
11567
+ disabled: !canWrite || saving || poolBusy || dropAllThinkingBusy,
11568
+ onChange: (event) => {
11569
+ toggleUpstreamSwitch("dropAllThinking", event.target.checked);
11570
+ }
11571
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11572
+ className: "dsm-workbuddy-pref-copy",
11573
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11574
+ className: "dsm-workbuddy-pref-label",
11575
+ children: t("row.dropAllThinkingLabel")
11576
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11577
+ className: "dsm-workbuddy-pref-hint",
11578
+ children: t("row.dropAllThinkingHint")
11579
+ })]
11580
+ })]
11581
+ })]
11582
+ });
10839
11583
  const creditPreferences = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10840
11584
  className: "dsm-workbuddy-prefs",
10841
11585
  children: [
@@ -10871,6 +11615,28 @@ window.__ModuleLoader__.load({
10871
11615
  })]
10872
11616
  })]
10873
11617
  }),
11618
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11619
+ className: "dsm-workbuddy-pref",
11620
+ title: t("row.showNewModelsHint"),
11621
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11622
+ type: "checkbox",
11623
+ className: "dsm-workbuddy-new-models-check",
11624
+ checked: activeRegionOn ? newModelsShownOn(activeRegion) : false,
11625
+ disabled: !activeRegionOn || togglingNewModels === activeRegion || !canWrite || saving || poolBusy,
11626
+ onChange: (event) => {
11627
+ toggleNewModels(activeRegion, event.target.checked);
11628
+ }
11629
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11630
+ className: "dsm-workbuddy-pref-copy",
11631
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11632
+ className: "dsm-workbuddy-pref-label",
11633
+ children: t("row.showNewModels")
11634
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11635
+ className: "dsm-workbuddy-pref-hint",
11636
+ children: t("row.showNewModelsHintInline")
11637
+ })]
11638
+ })]
11639
+ }),
10874
11640
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
10875
11641
  className: "dsm-workbuddy-pref dsm-workbuddy-pref-indent",
10876
11642
  title: t("row.creditPositionHint"),
@@ -10921,11 +11687,7 @@ window.__ModuleLoader__.load({
10921
11687
  })
10922
11688
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("nav.back") })]
10923
11689
  }) : null,
10924
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
10925
- className: "dsm-workbuddy-page-icon",
10926
- src: WORKBUDDY_PLUGIN_ICON,
10927
- alt: ""
10928
- }),
11690
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginIcon, { className: "dsm-workbuddy-page-icon" }),
10929
11691
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10930
11692
  className: "dsm-workbuddy-page-title",
10931
11693
  children: title
@@ -10984,10 +11746,6 @@ window.__ModuleLoader__.load({
10984
11746
  className: "dsm-workbuddy-models-summary dsm-workbuddy-tab-hint",
10985
11747
  children: t("row.tabHint")
10986
11748
  }),
10987
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10988
- className: "dsm-workbuddy-models-summary dsm-workbuddy-free-quota-warn",
10989
- children: t("row.tabFreeQuotaWarn")
10990
- }),
10991
11749
  signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10992
11750
  className: "dsm-workbuddy-panels",
10993
11751
  role: "tablist",
@@ -11157,7 +11915,7 @@ window.__ModuleLoader__.load({
11157
11915
  children: [
11158
11916
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11159
11917
  className: "dsm-workbuddy-models-head",
11160
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11918
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11161
11919
  className: "dsm-workbuddy-models-title-row",
11162
11920
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h3", {
11163
11921
  className: "dsm-workbuddy-models-title",
@@ -11166,10 +11924,7 @@ window.__ModuleLoader__.load({
11166
11924
  children: t("row.modelsDirty")
11167
11925
  }) : null]
11168
11926
  })
11169
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11170
- className: "dsm-workbuddy-models-summary",
11171
- children: t("row.modelsSummary", { count: activeEnabledIds.size })
11172
- })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11927
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11173
11928
  className: "dsm-workbuddy-models-head-actions",
11174
11929
  children: [
11175
11930
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -11192,17 +11947,6 @@ window.__ModuleLoader__.load({
11192
11947
  total: sweeping.total
11193
11948
  })
11194
11949
  }),
11195
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11196
- type: "button",
11197
- className: "dsm-btn dsm-btn-outline dsm-workbuddy-models-sweep",
11198
- disabled: busy || sweeping !== void 0 || visibleModels.length === 0,
11199
- title: t("row.modelsTestAllHint"),
11200
- onClick: sweepAllModels,
11201
- children: sweeping === void 0 ? t("row.modelsTestAll") : t("row.modelsTesting", {
11202
- done: sweeping.done,
11203
- total: sweeping.total
11204
- })
11205
- }),
11206
11950
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11207
11951
  type: "button",
11208
11952
  className: "dsm-btn dsm-btn-outline dsm-workbuddy-models-sweep",
@@ -11234,113 +11978,93 @@ window.__ModuleLoader__.load({
11234
11978
  children: [
11235
11979
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11236
11980
  className: "dsm-workbuddy-model-head",
11237
- children: [
11238
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11239
- className: "dsm-workbuddy-model-enabled",
11240
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11241
- type: "checkbox",
11242
- checked: activeEnabledIds.has(model.id),
11243
- disabled: !canWrite || saving,
11244
- onChange: () => {
11245
- toggleModel(model.id);
11246
- }
11247
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11248
- className: "dsm-workbuddy-model-copy",
11249
- children: [
11250
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11251
- className: "dsm-workbuddy-model-name",
11252
- children: [model.name, effectiveRate(model) === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11253
- className: "dsm-workbuddy-model-name-rate",
11254
- children: ["x", effectiveRate(model).toFixed(2)]
11255
- })]
11256
- }),
11257
- promoChip(model),
11258
- busyIcon(busyLevels[model.id], uiLanguage())
11259
- ]
11260
- })]
11261
- }),
11262
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11263
- className: "dsm-workbuddy-model-image",
11264
- title: imageCheckboxHint(model, t),
11265
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11266
- type: "checkbox",
11267
- checked: activeImageIds.has(model.id),
11268
- disabled: !canWrite || saving,
11269
- onChange: () => {
11270
- toggleImage(model.id);
11271
- }
11272
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelImage") })]
11273
- }),
11274
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11275
- className: `dsm-workbuddy-model-off${offBlocked(model) ? " dsm-workbuddy-model-off-blocked" : ""}`,
11276
- title: offBlocked(model) ? t("row.modelOffRefusedHint") : t("row.modelOffHint"),
11981
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11982
+ className: "dsm-workbuddy-model-enabled",
11983
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11984
+ type: "checkbox",
11985
+ checked: activeEnabledIds.has(model.id),
11986
+ disabled: !canWrite || saving,
11987
+ onChange: () => {
11988
+ toggleModel(model.id);
11989
+ }
11990
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11991
+ className: "dsm-workbuddy-model-copy",
11277
11992
  children: [
11278
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11993
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11994
+ className: "dsm-workbuddy-model-name",
11995
+ children: [model.name, effectiveRate(model) === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11996
+ className: "dsm-workbuddy-model-name-rate",
11997
+ children: ["x", effectiveRate(model).toFixed(2)]
11998
+ })]
11999
+ }),
12000
+ promoChip(model),
12001
+ busyIcon(busyLevels[model.id], uiLanguage())
12002
+ ]
12003
+ })]
12004
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12005
+ className: "dsm-workbuddy-model-controls",
12006
+ children: [
12007
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
12008
+ className: "dsm-workbuddy-model-image",
12009
+ title: imageCheckboxHint(model, t),
12010
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
11279
12011
  type: "checkbox",
11280
- checked: activeOffIds.has(model.id),
11281
- disabled: !canWrite || saving || offBlocked(model),
12012
+ checked: activeImageIds.has(model.id),
12013
+ disabled: !canWrite || saving,
11282
12014
  onChange: () => {
11283
- toggleOff(model.id);
12015
+ toggleImage(model.id);
11284
12016
  }
11285
- }),
11286
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelOff") }),
11287
- offBlocked(model) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11288
- className: "dsm-workbuddy-model-off-flag",
11289
- children: t("row.modelOffRefused")
11290
- }) : null
11291
- ]
11292
- }),
11293
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
11294
- className: "dsm-workbuddy-context-budget",
11295
- "aria-label": t("row.contextBudget"),
11296
- value: String(effectiveContextBudget(model.nativeContextWindow, activeContextBudgets[model.id])),
11297
- disabled: !canWrite || saving,
11298
- onChange: (event) => {
11299
- const picked = Number(event.target.value);
11300
- setContextBudget(model.id, picked === model.nativeContextWindow ? void 0 : picked);
11301
- },
11302
- children: [
11303
- model.nativeContextWindow > 2e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11304
- value: 2e5,
11305
- children: "200K"
11306
- }) : null,
11307
- model.nativeContextWindow > 5e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11308
- value: 5e5,
11309
- children: "500K"
11310
- }) : null,
11311
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11312
- value: model.nativeContextWindow,
11313
- children: formatCapacity(model.nativeContextWindow, t("row.modelUnknown"))
11314
- })
11315
- ]
11316
- }),
11317
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11318
- className: "dsm-workbuddy-model-actions-buttons",
11319
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11320
- type: "button",
11321
- className: "dsm-btn dsm-btn-outline dsm-workbuddy-model-probe",
11322
- disabled: probing[model.id] === true || status.status !== "signed-in",
11323
- title: t("row.probeHint"),
11324
- onClick: () => {
11325
- probeModels([model.id]);
11326
- },
11327
- children: probing[model.id] === true ? t("row.probing") : t("row.probe")
11328
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11329
- type: "button",
11330
- className: "dsm-btn dsm-btn-outline dsm-workbuddy-model-probe",
11331
- disabled: tpsProbing[model.id] === true || status.status !== "signed-in",
11332
- title: t("row.tpsHint"),
11333
- onClick: () => {
11334
- measureTpsFor([model.id]);
12017
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelImage") })]
12018
+ }),
12019
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
12020
+ className: `dsm-workbuddy-model-off${offBlocked(model) ? " dsm-workbuddy-model-off-blocked" : ""}`,
12021
+ title: offBlocked(model) ? t("row.modelOffRefusedHint") : t("row.modelOffHint"),
12022
+ children: [
12023
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
12024
+ type: "checkbox",
12025
+ checked: activeOffIds.has(model.id),
12026
+ disabled: !canWrite || saving || offBlocked(model),
12027
+ onChange: () => {
12028
+ toggleOff(model.id);
12029
+ }
12030
+ }),
12031
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelOff") }),
12032
+ offBlocked(model) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12033
+ className: "dsm-workbuddy-model-off-flag",
12034
+ children: t("row.modelOffRefused")
12035
+ }) : null
12036
+ ]
12037
+ }),
12038
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
12039
+ className: "dsm-workbuddy-context-budget",
12040
+ "aria-label": t("row.contextBudget"),
12041
+ value: String(effectiveContextBudget(model.nativeContextWindow, activeContextBudgets[model.id])),
12042
+ disabled: !canWrite || saving,
12043
+ onChange: (event) => {
12044
+ const picked = Number(event.target.value);
12045
+ setContextBudget(model.id, picked === model.nativeContextWindow ? void 0 : picked);
11335
12046
  },
11336
- children: tpsProbing[model.id] === true ? t("row.tpsMeasuring") : t("row.tpsMeasure")
11337
- })]
11338
- })
11339
- ]
12047
+ children: [
12048
+ model.nativeContextWindow > 2e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12049
+ value: 2e5,
12050
+ children: "200K"
12051
+ }) : null,
12052
+ model.nativeContextWindow > 5e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12053
+ value: 5e5,
12054
+ children: "500K"
12055
+ }) : null,
12056
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12057
+ value: model.nativeContextWindow,
12058
+ children: formatCapacity(model.nativeContextWindow, t("row.modelUnknown"))
12059
+ })
12060
+ ]
12061
+ })
12062
+ ]
12063
+ })]
11340
12064
  }),
11341
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12065
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11342
12066
  className: "dsm-workbuddy-model-details",
11343
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12067
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11344
12068
  className: "dsm-workbuddy-model-meta",
11345
12069
  children: [
11346
12070
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelContext", { context: formatCapacity(model.nativeContextWindow, t("row.modelUnknown")) }) }),
@@ -11374,7 +12098,28 @@ window.__ModuleLoader__.load({
11374
12098
  });
11375
12099
  })()
11376
12100
  ]
11377
- })
12101
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12102
+ className: "dsm-workbuddy-model-actions-buttons",
12103
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
12104
+ type: "button",
12105
+ className: "dsm-btn dsm-btn-outline dsm-workbuddy-model-probe",
12106
+ disabled: probing[model.id] === true || status.status !== "signed-in",
12107
+ title: t("row.probeHint"),
12108
+ onClick: () => {
12109
+ probeModels([model.id]);
12110
+ },
12111
+ children: probing[model.id] === true ? t("row.probing") : t("row.probe")
12112
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
12113
+ type: "button",
12114
+ className: "dsm-btn dsm-btn-outline dsm-workbuddy-model-probe",
12115
+ disabled: tpsProbing[model.id] === true || status.status !== "signed-in",
12116
+ title: t("row.tpsHint"),
12117
+ onClick: () => {
12118
+ measureTpsFor([model.id]);
12119
+ },
12120
+ children: tpsProbing[model.id] === true ? t("row.tpsMeasuring") : t("row.tpsMeasure")
12121
+ })]
12122
+ })]
11378
12123
  }),
11379
12124
  (() => {
11380
12125
  const result = probes[activeRegion]?.[model.id];
@@ -11462,7 +12207,15 @@ window.__ModuleLoader__.load({
11462
12207
  creditPreferences,
11463
12208
  upstreamSwitches,
11464
12209
  channelRejectContinuePreference,
11465
- sidebarPanelPreference
12210
+ dropAllThinkingPreference,
12211
+ sidebarPanelPreference,
12212
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12213
+ className: "dsm-workbuddy-prefs",
12214
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12215
+ className: "dsm-workbuddy-pref-hint",
12216
+ children: t("row.iconStyleLead")
12217
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStylePreference, { t })]
12218
+ })
11466
12219
  ]
11467
12220
  }),
11468
12221
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -11648,6 +12401,14 @@ window.__ModuleLoader__.load({
11648
12401
  });
11649
12402
  if (pageSurface || settingsSurface) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11650
12403
  className: settingsSurface ? "dsm-workbuddy-page dsm-workbuddy-settings" : "dsm-workbuddy-page",
12404
+ ref: (page) => {
12405
+ if (page !== null) requestAnimationFrame(() => {
12406
+ updateStickyTabs(page);
12407
+ });
12408
+ },
12409
+ onScroll: (event) => {
12410
+ updateStickyTabs(event.currentTarget);
12411
+ },
11651
12412
  children: [pageHead, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11652
12413
  className: "dsm-workbuddy-page-body",
11653
12414
  children: cardBody
@@ -11664,11 +12425,7 @@ window.__ModuleLoader__.load({
11664
12425
  setCardOpen(!cardOpen);
11665
12426
  },
11666
12427
  children: [
11667
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
11668
- className: "dsm-plugin-card-icon",
11669
- src: WORKBUDDY_PLUGIN_ICON,
11670
- alt: ""
11671
- }),
12428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginIcon, { className: "dsm-plugin-card-icon" }),
11672
12429
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11673
12430
  className: "dsm-plugin-card-head",
11674
12431
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -11985,6 +12742,22 @@ window.__ModuleLoader__.load({
11985
12742
  return typeof value === "boolean" ? value : void 0;
11986
12743
  }
11987
12744
  /**
12745
+ * Whether this region's usage document allows the "· N 新模型" segment.
12746
+ *
12747
+ * OPT-IN, so this is the mirror image of {@link hostCreditsShownOf}: absent
12748
+ * means NO. "New" means first seen by this machine, not newly listed upstream,
12749
+ * so on a fresh install it would announce the entire roster — a number that is
12750
+ * true by construction and reads as a defect. See `showNewModelsInMainUi` in the
12751
+ * schema for the full argument.
12752
+ *
12753
+ * The `error` variant answers `false` rather than `undefined`: with no document
12754
+ * there is no roster, hence no new models, hence nothing to announce anyway.
12755
+ */
12756
+ function hostNewModelsShownOf(usage) {
12757
+ if (usage === void 0 || usage.status === "error") return false;
12758
+ return usage.showNewModelsInMainUi === true;
12759
+ }
12760
+ /**
11988
12761
  * A same-day instant, as the READER's locale writes it.
11989
12762
  *
11990
12763
  * The locale is `undefined` — the reader's, not a fixed one — so an English UI
@@ -12422,9 +13195,10 @@ window.__ModuleLoader__.load({
12422
13195
  const signedOut = usage !== void 0 && usage.status === "signed-out";
12423
13196
  const valueText = total === void 0 ? "—" : formatCredits(total);
12424
13197
  const label = t(activeRegion === "cn" ? "composer.pointsCn" : "composer.pointsGlobal");
12425
- const newModelNames = newModelIdsOf(usage).map((id) => modelNameOf(signedIn?.models ?? [], id));
13198
+ const newModelsShown = hostNewModelsShownOf(usage);
13199
+ const newModelNames = (newModelsShown ? newModelIdsOf(usage) : []).map((id) => modelNameOf(signedIn?.models ?? [], id));
12426
13200
  const newModelTooltip = newModelNames.length === 0 ? void 0 : `${t("composer.newModelsTitle")}${newModelNames.slice(0, 3).join(t("composer.newModelsSep"))}${newModelNames.length > 3 ? "…" : ""}`;
12427
- const rosterSeenNote = signedIn?.rosterSeenVersionNote;
13201
+ const rosterSeenNote = newModelsShown ? signedIn?.rosterSeenVersionNote : void 0;
12428
13202
  /**
12429
13203
  * The table's rows: every account in this region, with its balance.
12430
13204
  *
@@ -12844,16 +13618,25 @@ window.__ModuleLoader__.load({
12844
13618
  * the text and render the addition beside it, so this component returns the
12845
13619
  * name first and never replaces it.
12846
13620
  *
12847
- * FOR A PROVIDER THAT IS NOT OURS IT RENDERS THE PLAIN CATALOG NAME — not
12848
- * nothing. The distinction is not cosmetic: this slot is `kind: "single"`, so
12849
- * whatever registers becomes the cell's only occupant, and an occupant that
12850
- * outputs plain text still occupies it. A previous version of this paragraph
12851
- * said the component "renders nothing at all" for a foreign provider, which
12852
- * made the lost-decoration cost look harmless; issue #138 is what that
12853
- * mis-description looks like from the outside (the host's own 1017 badge
12854
- * disappears on ITS rows while this plugin holds the cell). Returning `null`
12855
- * would not free the cell either — occupancy is decided by registration, never
12856
- * by what the component outputs.
13621
+ * FOR A PROVIDER THAT IS NOT OURS IT RENDERS THE CATALOG NAME PLUS THAT MODEL'S
13622
+ * OWN `badge` — never another plugin's component. The name half is not
13623
+ * cosmetic: this slot is `kind: "single"`, so whatever registers becomes the
13624
+ * cell's only occupant, and an occupant that outputs plain text still occupies
13625
+ * it. A previous version of this paragraph said the component "renders nothing
13626
+ * at all" for a foreign provider, which made the lost-decoration cost look
13627
+ * harmless; issue #138 is what that mis-description looks like from the outside
13628
+ * (the host's own 1017 badge disappears on ITS rows while this plugin holds the
13629
+ * cell). Returning `null` would not free the cell either — occupancy is decided
13630
+ * by registration, never by what the component outputs.
13631
+ *
13632
+ * THE `badge` HALF IS WHAT MAKES SIBLING CHIPS SURVIVE. The host runs its own
13633
+ * badge fallback only when the cell has NO occupant, so once this plugin wins the
13634
+ * cell it must draw a sibling's badge itself or that badge is never drawn
13635
+ * anywhere. The data is `props.model.badge` — the host's catalog field, which
13636
+ * arrives here regardless of who published it — so this is not the coordination
13637
+ * `docs/DESIGN.md` §零 rules out: no ledger is read, no foreign component is
13638
+ * rendered, and the output does not change based on which plugins are installed.
13639
+ * See `HostBadgeChip` and `docs/MODEL-LABEL-SPEC.md`.
12857
13640
  */
12858
13641
  /** The provider ids this plugin registers, and the region each one serves. */
12859
13642
  const PROVIDER_REGIONS = /* @__PURE__ */ new Map([["workbuddy", "cn"], ["workbuddy-global", "global"]]);
@@ -12891,6 +13674,7 @@ window.__ModuleLoader__.load({
12891
13674
  });
12892
13675
  if (!response.ok) return void 0;
12893
13676
  const body = await response.json();
13677
+ const showNewModels = body.showNewModelsInMainUi === true;
12894
13678
  const promos = {};
12895
13679
  const rates = {};
12896
13680
  for (const model of body.models ?? []) {
@@ -12901,7 +13685,7 @@ window.__ModuleLoader__.load({
12901
13685
  levels: body.busyLevels ?? {},
12902
13686
  promos,
12903
13687
  rates,
12904
- newModelIds: normalizeNewModelIds(body.newModelIds)
13688
+ newModelIds: showNewModels ? normalizeNewModelIds(body.newModelIds) : []
12905
13689
  };
12906
13690
  caches.set(region, {
12907
13691
  snapshot,
@@ -12991,6 +13775,120 @@ window.__ModuleLoader__.load({
12991
13775
  });
12992
13776
  }
12993
13777
  /**
13778
+ * The one line a foreign badge shows, in the reader's language.
13779
+ *
13780
+ * Mirrors the host's own resolver (`ctx.locale.resolveText`): a plain string is
13781
+ * used verbatim; a table is looked up by the full lowercase tag, then its base
13782
+ * tag (`de-DE` → `de`), then `en`, which the contract requires. The host treats
13783
+ * an EMPTY string as a translation that exists, so this function deliberately
13784
+ * goes one step further and treats it as absent — a blank chip is a decoration
13785
+ * that says nothing, and this component would rather draw the bare name.
13786
+ *
13787
+ * @param text - The badge's literal or its translation table.
13788
+ * @returns The line to draw, or `undefined` when nothing readable is left.
13789
+ */
13790
+ function resolveHostBadgeText(text) {
13791
+ if (typeof text === "string") return text.trim() === "" ? void 0 : text;
13792
+ if (text === null || typeof text !== "object") return void 0;
13793
+ const language = uiLanguage().toLowerCase();
13794
+ const base = language.split("-")[0] ?? "";
13795
+ const picked = text[language] ?? (base === "" ? void 0 : text[base]) ?? text.en;
13796
+ if (typeof picked !== "string" || picked.trim() === "") return void 0;
13797
+ return picked;
13798
+ }
13799
+ /**
13800
+ * The tone palette, mapped onto the tokens the host's own `Tag` paints.
13801
+ *
13802
+ * WHY THESE EXACT TOKENS. They are read off the host's `Tag.module.css`
13803
+ * (0.2.2-rc.1), not invented: `info` rides `state-business-primary` (NOT
13804
+ * `brand-primary`) and `warning` rides `state-warn-primary` (NOT
13805
+ * `state-warn-secondary`). Getting either wrong leaves two chips in one row
13806
+ * that are supposed to look identical and do not.
13807
+ *
13808
+ * `neutral` is the fallback for an unknown tone: the host's `Tag` would render
13809
+ * such a chip unstyled, which reads as a rendering bug next to a real one.
13810
+ */
13811
+ const HOST_BADGE_TONES = {
13812
+ neutral: {
13813
+ color: "var(--dsw-alias-label-secondary)",
13814
+ background: "var(--dsw-alias-bg-module-platform)"
13815
+ },
13816
+ info: {
13817
+ color: "var(--dsw-alias-state-business-primary)",
13818
+ background: "color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent)"
13819
+ },
13820
+ success: {
13821
+ color: "var(--dsw-alias-state-success-primary)",
13822
+ background: "color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent)"
13823
+ },
13824
+ warning: {
13825
+ color: "var(--dsw-alias-state-warn-primary)",
13826
+ background: "color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent)"
13827
+ }
13828
+ };
13829
+ /**
13830
+ * A badge another provider published for its own model, drawn where the host's
13831
+ * own fallback would have drawn it.
13832
+ *
13833
+ * WHY THIS PLUGIN DRAWS IT AT ALL. `conversation.input.model.label` is a
13834
+ * `single` slot, so this component is called for EVERY provider's rows, not just
13835
+ * its own. The host only runs its own badge fallback when the cell has no
13836
+ * occupant at all, so without this branch a sibling plugin's badge would never
13837
+ * appear anywhere while this plugin holds the cell.
13838
+ *
13839
+ * WHY IT IS NOT INTER-PLUGIN COORDINATION (`docs/DESIGN.md` §零). The data is
13840
+ * `props.model.badge` — the host's catalog field, handed to every occupant of
13841
+ * the cell. This component does not know which plugin filled it, does not read
13842
+ * the slot ledger, does not render another plugin's component, and its output is
13843
+ * identical whether or not any sibling is installed. Data flows one way through
13844
+ * the host; there is no channel between plugins. That is the difference between
13845
+ * this and §零's rejected "copy the host's 1017 badge", which hard-codes one
13846
+ * specific plugin's conditions and styles.
13847
+ *
13848
+ * NOT A FETCH, NOT A TIMER. A picker can show twenty foreign rows at once, so
13849
+ * this must stay a pure function of its props.
13850
+ *
13851
+ * NO `placement` PARAMETER, DELIBERATELY. The chip is always drawn AFTER the
13852
+ * name now, so where it goes is the caller's one-line decision, not something
13853
+ * this function needs to know. It used to take `placement` and ignore it, which
13854
+ * read as though a placement-dependent rule existed inside the chip.
13855
+ *
13856
+ * @param props - The badge to draw.
13857
+ * @returns The chip, or `undefined` when there is nothing readable to draw.
13858
+ */
13859
+ function HostBadgeChip(props) {
13860
+ const badge = props.badge;
13861
+ if (badge === null || typeof badge !== "object") return void 0;
13862
+ const label = resolveHostBadgeText(badge.text);
13863
+ if (label === void 0) return void 0;
13864
+ const tone = Object.hasOwn(HOST_BADGE_TONES, badge.tone) ? HOST_BADGE_TONES[badge.tone] : HOST_BADGE_TONES.neutral;
13865
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
13866
+ className: "dsm-workbuddy-model-label-host-badge",
13867
+ title: label,
13868
+ style: {
13869
+ color: tone.color,
13870
+ background: tone.background
13871
+ },
13872
+ children: label
13873
+ });
13874
+ }
13875
+ /**
13876
+ * Whether a model's badge will actually draw something.
13877
+ *
13878
+ * The caller needs this BEFORE it decides on the separator: `<HostBadgeChip/>`
13879
+ * is always an element, so rendering `{chip} {name}` and then finding the chip
13880
+ * empty leaves a trailing space on the row. Deciding from the text is the only
13881
+ * way to know, which is why the resolution is exported rather than duplicated.
13882
+ *
13883
+ * @param badge - The catalog badge, if any.
13884
+ * @returns Whether a chip will be drawn.
13885
+ */
13886
+ function hasDrawableBadge(badge) {
13887
+ const candidate = badge;
13888
+ if (candidate === null || typeof candidate !== "object") return false;
13889
+ return resolveHostBadgeText(candidate.text) !== void 0;
13890
+ }
13891
+ /**
12994
13892
  * The priority this plugin registers the model-label slot at.
12995
13893
  *
12996
13894
  * WHY A DISTINCT PRIORITY AT ALL. `conversation.input.model.label` is a
@@ -13010,24 +13908,72 @@ window.__ModuleLoader__.load({
13010
13908
  * WHY NOT `-1`. That is `dsh-connect-qoder`'s slot priority, and two plugins on
13011
13909
  * one priority collide for exactly the same reason `0` did.
13012
13910
  *
13013
- * WHY `-0.5` IS SAFE AND SELF-CONTAINED. The value only has to be distinct from
13014
- * whatever else claims the cell; `-0.5` is legal, sorts without collision
13015
- * against both `-1` and `0`, and requires knowing nothing about the other
13016
- * plugins. See the "不做插件联动" invariant in `docs/DESIGN.md`.
13911
+ * WHY `-0.5` WAS TOO HIGH — the measured defect. `-0.5` is legal and collides
13912
+ * with nothing, but "distinct from everyone" is NOT the same as "wins", and this
13913
+ * cell only renders its LOWEST priority. `-0.5` sits ABOVE two contributors that
13914
+ * were present in the same profile:
13915
+ *
13916
+ * dsh-connect-qoder -1
13917
+ * dsh-connect-trae -0.25
13918
+ * this plugin -0.5 ← lost to qoder, so this component never ran
13919
+ *
13920
+ * Losing is silent by construction: the winner renders, the loser is simply not
13921
+ * called. The symptom is exactly "the picker shows no badges", with correct
13922
+ * data, a correct component and no error anywhere — which is what made this cost
13923
+ * several rounds to find. The rows still showed `Hy4 · x0.00` because that
13924
+ * string is the catalog `model.name` the WINNER drew, not our label.
13925
+ *
13926
+ * WHY `-105`. The value has to be BELOW every plausible claimant, not merely
13927
+ * different from the ones visible today. That is the whole lesson: `-0.5` was
13928
+ * chosen to be DISTINCT, was distinct, and still lost. Contributors already
13929
+ * shipped at `-10` (`dsh-model-picker-brand`, a label decorator) and `-1`
13930
+ * (`dsh-connect-qoder`), so anything in the single digits is a value someone
13931
+ * else can step under. `-105` is an ordinary number to the sort (no range is
13932
+ * reserved) and makes the ordering a decision of this plugin rather than a race
13933
+ * it keeps losing.
13934
+ *
13935
+ * WHY NOT `-100` — MEASURED, TWICE. `-100` won for a while, then two other
13936
+ * connectors moved underneath it in the same profile:
13937
+ *
13938
+ * dsh-connect-qoder -1 → -101
13939
+ * dsh-connect-trae -0.25 → -102
13940
+ * this plugin -100 → lost to both
13941
+ *
13942
+ * Both of them wrote THIS constant into their own source comments while doing
13943
+ * it, which is the clearest evidence that the cell is a contest and not a
13944
+ * composed surface: each new connector reads the others' shipped values and
13945
+ * steps under the lowest one. `-105` keeps a small gap below `-102` rather than
13946
+ * a huge one, so the next connector that wants the cell has to say so
13947
+ * explicitly too.
13948
+ *
13949
+ * THE COST, STATED PLAINLY. Winning here is not free: in `single` semantics the
13950
+ * winner draws EVERY row, so trae's and qoder's chips would disappear from the
13951
+ * picker exactly as ours did. What closes that gap is NOT a priority choice — it
13952
+ * is `HostBadgeChip` below: a sibling plugin publishes its badge in ITS
13953
+ * `adapter.listModels()`, the host carries it in the catalog, and this component
13954
+ * reproduces it on that plugin's rows. Every connector that adopts that channel
13955
+ * keeps its chip whichever of them wins the cell (`docs/MODEL-LABEL-SPEC.md`).
13956
+ * This value is still chosen so the users of THIS plugin see its full surface,
13957
+ * not because the arrangement is fair.
13958
+ *
13959
+ * A low priority is also the CORRECT semantic here: this label shows more than
13960
+ * any other contributor (name + price + promotion + load + new-model mark), so
13961
+ * it should be the one that takes the cell when several want it.
13017
13962
  *
13018
13963
  * WHAT THIS PLUGIN DELIBERATELY DOES NOT DO. It does not read the slot ledger,
13019
13964
  * does not look for another plugin's registration, and does not render another
13020
- * plugin's component. Foreign rows get the plain catalog name, which is exactly
13021
- * the slot's documented minimum. Inter-plugin chaining is out of scope by
13965
+ * plugin's component. Foreign rows get the plain catalog name PLUS the model's
13966
+ * own `badge`, when the host's catalog carries one — that badge is host data
13967
+ * (`props.model.badge`), not another plugin's component, and this component
13968
+ * cannot tell which provider wrote it. Inter-plugin chaining is out of scope by
13022
13969
  * project policy (`docs/DESIGN.md` §零) — and that policy is NOT stricter than
13023
13970
  * the Host's own: the shipped `dsh-client-ui-deepseek-model-label-1017` README
13024
13971
  * lists, under "Known Limitations and Deferred Work", that "another model-label
13025
13972
  * plugin at the same priority conflicts; the two presentations do not compose
13026
13973
  * automatically", and the remedy it documents is DISABLING it in the profile
13027
- * patch — a configuration decision, not a runtime negotiation. A consequence is
13028
- * that when this plugin wins the cell, another contributor's decoration on ITS
13029
- * rows is not composed; that is an accepted, documented trade-off rather than
13030
- * something to work around at runtime.
13974
+ * patch — a configuration decision, not a runtime negotiation. Reproducing a
13975
+ * catalog badge is neither of those: nothing here branches on another plugin
13976
+ * being present.
13031
13977
  *
13032
13978
  * WHY WINNING IS THE RIGHT SIDE OF THAT TRADE. 1017 is a TEMPORARY marker
13033
13979
  * (its own package description: "Temporary 1017 release badge …"; its README
@@ -13041,22 +13987,29 @@ window.__ModuleLoader__.load({
13041
13987
  * Exported so the test asserts against the value that actually ships rather
13042
13988
  * than a copy of it.
13043
13989
  */
13044
- const MODEL_LABEL_PRIORITY = -.5;
13990
+ const MODEL_LABEL_PRIORITY = -105;
13045
13991
  /**
13046
13992
  * The label for one model row in the host's picker.
13047
13993
  *
13048
13994
  * Self-contained by design: a model this plugin owns gets the full label, and
13049
- * anything else gets the plain catalog name. There is no forwarding and no
13050
- * consultation of other plugins' registrations — see `MODEL_LABEL_PRIORITY`.
13995
+ * anything else gets the catalog name plus that model's own `badge`, if its
13996
+ * provider published one. There is no forwarding and no consultation of other
13997
+ * plugins' registrations — see `MODEL_LABEL_PRIORITY`.
13051
13998
  *
13052
13999
  * @param props - The host's model identity and the placement of this label.
13053
- * @returns The catalog name, the promotion chip when one holds, and the load
13054
- * badge when the probe reported one.
14000
+ * @returns The catalog name, the promotion chip when one holds, the load badge
14001
+ * when the probe reported one, or a sibling's badge on a foreign row.
13055
14002
  */
13056
14003
  function WorkBuddyModelLabel(props) {
13057
14004
  const { provider, model, placement } = props;
13058
14005
  const region = regionOfProvider(provider.id);
13059
- if (region === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: model.name });
14006
+ if (region === void 0) {
14007
+ if (!hasDrawableBadge(model.badge)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: model.name });
14008
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
14009
+ className: "dsm-workbuddy-model-label dsm-workbuddy-model-label-host-row",
14010
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: model.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HostBadgeChip, { badge: model.badge })]
14011
+ });
14012
+ }
13060
14013
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkBuddyModelLabelInner, {
13061
14014
  modelId: model.id,
13062
14015
  name: model.name,
@@ -13476,6 +14429,12 @@ window.__ModuleLoader__.load({
13476
14429
  */
13477
14430
  const en = {
13478
14431
  "nav.panel": "WorkBuddy",
14432
+ "row.iconStyleLead": "Appearance — what the plugin looks like, not what it may do.",
14433
+ "row.iconStyleLabel": "Icon style",
14434
+ "row.iconStyleHint": "Takes effect on the click in the sidebar, the page header and the panel. The default is this plugin's own icon; the alternative skin follows the theme's text colour. The choice is stored in this browser only.",
14435
+ "row.iconStyleClaude": "Claude style",
14436
+ "row.iconStyleOriginal": "Default icon",
14437
+ "row.iconStyleSaveFailed": "The icon choice could not be saved. Check browser storage permissions.",
13479
14438
  "nav.back": "Back to conversation",
13480
14439
  "row.title": "WorkBuddy credits & models (dsh-connect-workbuddy)",
13481
14440
  "row.desc": "Use WorkBuddy models in DSH: each refresh reads every model's credit multiplier from the upstream catalog, image input is toggled per model, several accounts can be switched or failed over automatically, and daily check-in plus your remaining credits are one click away. The domestic and international sides are two independent providers, each with its own account — use both at the same time.",
@@ -13556,7 +14515,6 @@ window.__ModuleLoader__.load({
13556
14515
  "row.cardCrashed": "The configuration area failed to render.",
13557
14516
  "row.cardCrashedHint": "The model provider itself is unaffected — chat and credits keep working. Quote the line above in a bug report.",
13558
14517
  "row.modelsTitle": "Models",
13559
- "row.modelsSummary": "{count} enabled",
13560
14518
  "row.modelsDirty": "unsaved changes",
13561
14519
  "row.modelsRefresh": "Refresh from WorkBuddy",
13562
14520
  "row.modelsRefreshing": "Refreshing models…",
@@ -13585,12 +14543,9 @@ window.__ModuleLoader__.load({
13585
14543
  "row.modelUnknown": "Unknown",
13586
14544
  "row.modelCapabilityPending": "Only capabilities advertised by WorkBuddy are shown.",
13587
14545
  "row.modelsTestEnabled": "Test enabled models",
13588
- "row.modelsTestAll": "Test all models",
13589
14546
  "row.modelsTesting": "Testing {done}/{total}…",
13590
14547
  "row.modelsTestEnabledHint": "Tests every model you have ENABLED, one request each — each probe sends a real-volume request, so this spends real credit (about 0.01 per model at the default 25000-token size). Rows show their verdict as it lands. Stops early if the credential is rejected.",
13591
- "row.modelsTestAllHint": "Tests EVERY model in this region's catalog, including the ones you have NOT enabled — so it costs noticeably more than \"test enabled models\". Same per-probe cost, same early stop on a rejected credential.",
13592
14548
  "row.tpsSweepEnabled": "Measure speed (enabled)",
13593
- "row.tpsSweepAll": "Measure speed (all)",
13594
14549
  "row.tpsSweepEnabledHint": "Measures OUTPUT SPEED for every model you have ENABLED: three runs each, taking the median. Unlike the availability probes above, this sends a tiny prompt and asks for 256 output tokens back, so it costs far less per model (measured 0.01–0.15 credit against 0.72), because this gateway prices by input. Speed matters because DSH dispatches models as parallel sub-agents, so a slow model costs wall-clock time across the whole run.",
13595
14550
  "row.tpsTesting": "Measuring {done}/{total}…",
13596
14551
  "row.tpsMeasure": "Speed",
@@ -13708,7 +14663,6 @@ window.__ModuleLoader__.load({
13708
14663
  "row.poolLogBenefitFailed": "{accountName} claim failed: {message}",
13709
14664
  "row.poolBenefitHint": "Claim it on the plans page: {url}",
13710
14665
  "row.poolCreditSoon": "{count} expiring within 3 days",
13711
- "row.poolCreditNearest": "Nearest package expires {at}",
13712
14666
  "row.poolExcludedRateLimited": "Rate limited",
13713
14667
  "row.poolExcludedModelBusy": "Model busy",
13714
14668
  "row.poolExcludedOutOfCredit": "Out of credits",
@@ -13909,6 +14863,9 @@ window.__ModuleLoader__.load({
13909
14863
  "row.channelRejectContinueHint": "LAST RESORT, not a fix for 11128. When the gateway answers 400 with code 11128 (「被网关的渠道校验拦截」), the turn just fails: the plugin never retries it in place and never swaps accounts, because the gate matches the message contents and every account sends the same ones. Fixed system fingerprints are byte-identical every turn, so resending only pays for the same 400 again; since 5.13.1 `prepareChatBody` rewrites known phrases instead. The narrow case this can help is content that changes between turns. It sends the text below as a NEW turn and spends a real request each time. Stops after N CONSECUTIVE sends (default 1); one successful turn, or one message you type yourself, resets the count. Subagent sessions are never touched. Off by default. Takes effect immediately, no reload.",
13910
14864
  "row.channelRejectContinueLimit": "Max consecutive sends:",
13911
14865
  "row.channelRejectContinueText": "Text sent:",
14866
+ "row.dropAllThinkingLead": "Reasoning redaction — when the gateway refuses what we send.",
14867
+ "row.dropAllThinkingLabel": "Strip past thinking from requests (for 11128)",
14868
+ "row.dropAllThinkingHint": "LAST RESORT for 「被网关的渠道校验拦截」(400 / code 11128), and not a fix. The gateway scans the text of every request, and this plugin sends the model its own earlier reasoning as `reasoning_content` whenever a thinking block carries a signature — so past reasoning is one of the things being scanned. On, ALL thinking blocks are removed from the request: your messages, the tool calls and the answers are untouched, but the model no longer sees its own earlier reasoning, and that loss is real (it is the model working memory, not decoration). Off by default. Turn it on when the openings named in a 11128 can be matched to reasoning text in that session, which is what issue #213 measured. Takes effect on the next turn, no reload.",
13912
14869
  "row.cliBridgeLabel": "Let the local CodeBuddy CLI do the work",
13913
14870
  "row.cliBridgeHint": "Adds the codebuddy_ask tool and the /codebuddy command. Each call spends CodeBuddy quota. injectResult only affects /codebuddy — its result is injected back into the session, costing one DSH turn when the session is idle; tool calls never read it. Rate-limited: 6 turns per session per hour, 20 per process per hour, one turn at a time. Off by default.",
13914
14871
  "row.cnBaseLabel": "CN gateway host",
@@ -13966,6 +14923,9 @@ window.__ModuleLoader__.load({
13966
14923
  "row.creditPositionHintInline": "Where the readout sits. \"composer toolbar\" is the default — the row with the model picker.",
13967
14924
  "row.creditPositionDisabledHint": "Unavailable while the switch above is off: tick \"Show credits in the composer toolbar\" first.",
13968
14925
  "row.showCreditsHintInline": "The balance for the account currently serving this tab. Click for per-account balances; it also refreshes every 5 minutes.",
14926
+ "row.showNewModels": "Show newly seen models",
14927
+ "row.showNewModelsHint": "Adds a \"· N new models\" segment beside the credit readout, and a \"new\" mark on those rows in the model picker. \"New\" means this machine recorded the model id for the first time — it says nothing about when the upstream listed it. Off by default: on a new install the whole roster is \"new\".",
14928
+ "row.showNewModelsHintInline": "First seen by this machine, not newly listed upstream. Off by default — on a new install the whole roster counts as new.",
13969
14929
  "quotaNotice.fallbackHead": "The quota for this request is exhausted",
13970
14930
  "quotaNotice.supplement": " (some models also have a daily limit that is unrelated to your credits)",
13971
14931
  "row.creditPositionHint": "Where the credit readout sits. \"composer toolbar\" is the default (the row with the model picker). Choose \"below the input box\" — the row carrying the round / step / token statistics — if another plugin occupies the composer toolbar and the readout does not appear.",
@@ -14013,6 +14973,12 @@ window.__ModuleLoader__.load({
14013
14973
  };
14014
14974
  const zh = {
14015
14975
  "nav.panel": "WorkBuddy",
14976
+ "row.iconStyleLead": "外观 —— 插件长什么样,不是它能做什么。",
14977
+ "row.iconStyleLabel": "图标样式",
14978
+ "row.iconStyleHint": "点一下立即应用到侧边栏、页头与面板。默认是本插件自己的图标;另一个皮肤跟随主题的文字颜色。选择只存在当前浏览器里。",
14979
+ "row.iconStyleClaude": "Claude 风格",
14980
+ "row.iconStyleOriginal": "默认图标",
14981
+ "row.iconStyleSaveFailed": "图标选择保存失败,请检查浏览器存储权限。",
14016
14982
  "nav.back": "返回会话",
14017
14983
  "row.title": "接入使用 WorkBuddy 积分与模型(dsh-connect-workbuddy)",
14018
14984
  "row.desc": "在 DSH 中使用 WorkBuddy 模型:每次刷新都按上游目录读取每个模型的积分倍率,图片输入可逐模型开关,多个账号可切换或由账号池自动换号,每日签到与剩余积分一键可查。国内版与国际版是两个独立供应商,各有自己的账号,可同时使用。",
@@ -14093,7 +15059,6 @@ window.__ModuleLoader__.load({
14093
15059
  "row.cardCrashed": "配置区渲染失败。",
14094
15060
  "row.cardCrashedHint": "模型服务本身未受影响,对话与积分仍可用。反馈问题时请附上上面这行。",
14095
15061
  "row.modelsTitle": "模型",
14096
- "row.modelsSummary": "已启用 {count} 个",
14097
15062
  "row.modelsDirty": "有未保存的修改",
14098
15063
  "row.modelsRefresh": "从 WorkBuddy 刷新",
14099
15064
  "row.modelsRefreshing": "正在刷新模型…",
@@ -14121,13 +15086,10 @@ window.__ModuleLoader__.load({
14121
15086
  "row.modelEffortFollowNamed": "默认({effort})",
14122
15087
  "row.modelUnknown": "未知",
14123
15088
  "row.modelCapabilityPending": "仅展示 WorkBuddy 接口明确公布的模型能力。",
14124
- "row.modelsTestEnabled": "一键测试启用模型",
14125
- "row.modelsTestAll": "一键测试所有模型",
15089
+ "row.modelsTestEnabled": "测试启用模型",
14126
15090
  "row.modelsTesting": "测试中 {done}/{total}…",
14127
15091
  "row.modelsTestEnabledHint": "逐个测试你**已启用**的模型,一个模型一次请求 —— 每次探测都发真实体积的请求,真花积分(默认 25000 token 体积下约 0.01/个)。每行的结果一出来就显示。凭据被拒时提前停止。",
14128
- "row.modelsTestAllHint": "测试本区域目录里的**每一个**模型,含**未启用**的 —— 所以比「仅测试启用模型」明显更贵。单次探测成本相同,凭据被拒时同样提前停止。",
14129
- "row.tpsSweepEnabled": "一键测速启用模型",
14130
- "row.tpsSweepAll": "一键测速所有模型",
15092
+ "row.tpsSweepEnabled": "测速启用模型",
14131
15093
  "row.tpsSweepEnabledHint": "测**已启用**模型的**输出速度**:每个模型跑 3 次取中位数。和上面的可用性探测不同,它只发一个极小的提示、要求返回 256 个输出 token —— 这个网关按**输入**计价,所以单模型成本低得多(实测 0.01–0.15 积分,可用性探测是 0.72)。速度之所以重要:DSH 会把模型当子代理并行派发,慢模型拖的是整个任务的实际耗时。",
14132
15094
  "row.tpsTesting": "测速中 {done}/{total}…",
14133
15095
  "row.tpsMeasure": "测速",
@@ -14245,7 +15207,6 @@ window.__ModuleLoader__.load({
14245
15207
  "row.poolLogBenefitFailed": "{accountName} 领取失败:{message}",
14246
15208
  "row.poolBenefitHint": "去套餐与积分页领取:{url}",
14247
15209
  "row.poolCreditSoon": "{count} 积分 3 天内过期",
14248
- "row.poolCreditNearest": "最近积分包 {at} 过期",
14249
15210
  "row.poolExcludedRateLimited": "被限流",
14250
15211
  "row.poolExcludedModelBusy": "模型繁忙",
14251
15212
  "row.poolExcludedOutOfCredit": "积分耗尽",
@@ -14446,6 +15407,9 @@ window.__ModuleLoader__.load({
14446
15407
  "row.channelRejectContinueHint": "最后兜底,不是 11128 的修复。上游用 400 + code 11128(「被网关的渠道校验拦截」)拒绝时,这一轮就直接失败了:插件不会在原地重试,也不会换号——网关匹配的是消息内容,每个账号发出去都一样。固定 system 指纹每一轮逐字节相同,重发只会再付一次同一个 400;5.13.1 起由 `prepareChatBody` 按句改词处理。只有被拒内容刚好随轮次变化的窄情况才可能靠新回合碰过去。它会把下面这句作为新回合发出,每次真实消耗一次请求;默认只发 1 次、默认关闭;连续计数,成功一轮或你自己发一条消息即清零。子代理会话一律不碰,改完立即生效,不必重载插件。",
14447
15408
  "row.channelRejectContinueLimit": "连续发送上限:",
14448
15409
  "row.channelRejectContinueText": "发送的文本:",
15410
+ "row.dropAllThinkingLead": "思考剥离 —— 网关拒收我们发出去的内容时。",
15411
+ "row.dropAllThinkingLabel": "把历史思考从请求里剥掉(针对 11128)",
15412
+ "row.dropAllThinkingHint": "「被网关的渠道校验拦截」(400 + code 11128)的最后兜底,不是修复。网关会扫描每一份请求的文本,而本插件会把模型过去的思考作为 reasoning_content 发出去(thinking 块带 signature 时就会),所以历史思考也是被扫的内容之一。开启后请求里的 thinking 块会被全部移除——你的消息、工具调用和回答不受影响,但模型看不到自己之前的思考,而这个代价是真的(那是它的工作记忆,不是装饰)。默认关闭。适用情形:这次 11128 报出的那几个开头,能与该会话里的 reasoning 文本逐字对上——#213 里被证实的就是这种情况。改完下一轮生效,不必重载插件。",
14449
15413
  "row.cliBridgeLabel": "允许调用本机 CodeBuddy CLI 干活",
14450
15414
  "row.cliBridgeHint": "开启后多出 codebuddy_ask 工具与 /codebuddy 指令;每次调用花 CodeBuddy 配额。injectResult 只影响 /codebuddy:其结果回注会话,会话空闲时多花一次 DSH 回合;工具调用不读它。限流:每会话每小时 6 回合、每进程每小时 20 回合、同时只跑一个回合。默认关闭。",
14451
15415
  "row.cnBaseLabel": "CN 网关主机",
@@ -14503,6 +15467,9 @@ window.__ModuleLoader__.load({
14503
15467
  "row.creditPositionHintInline": "读数显示在哪里。「输入框工具栏」是默认位置,与模型选择同一行。",
14504
15468
  "row.creditPositionDisabledHint": "主开关关闭时不可调整:先勾选上方「在输入框工具栏显示积分读数」。",
14505
15469
  "row.showCreditsHintInline": "当前为本 tab 服务的那个账号的余额。点一下能看各账号明细,另外每 5 分钟自动刷新一次。",
15470
+ "row.showNewModels": "显示新出现的模型",
15471
+ "row.showNewModelsHint": "在积分读数旁多加一段「· N 新模型」,并在模型选择器里给这些行标一个「新」。这里的「新」指**本机首次记到这个模型 id**,与上游何时上架无关。默认关闭:全新安装时整个目录都算「新」,那个数字说明不了任何事。",
15472
+ "row.showNewModelsHintInline": "指本机首次见到,不是上游新上架。默认关闭——全新安装时整个目录都算新。",
14506
15473
  "quotaNotice.fallbackHead": "当前请求的额度已用尽",
14507
15474
  "quotaNotice.supplement": "(部分模型另有每日额度,与积分无关)",
14508
15475
  "row.creditPositionHint": "积分显示在哪里。「输入框工具栏」是默认位置(与模型选择同一行)。如果装了别的插件后读数不显示,改成「输入框下方」—— 那是「轮次 / 步数 / token」统计所在的那一行。",
@@ -14551,23 +15518,77 @@ window.__ModuleLoader__.load({
14551
15518
  //#endregion
14552
15519
  //#region src/client/settings-jump.ts
14553
15520
  /**
14554
- * Best-effort jump to this plugin's **Settings section** (设置 → WorkBuddy).
14555
- *
14556
- * ## Why a DOM walk rather than a service call
14557
- *
14558
- * The host gives a third-party plugin NO public way to open one of its
14559
- * `settings.section`s. The shell keeps the selected section in its own store
14560
- * (`ui-settings-general`'s `createSettingsShellStore().activeId`), and the only
14561
- * `openSection(id)` it hands out goes to `settings.onboarding` registrants —
14562
- * that is the first-run guidance seat, not a configuration entry. Nothing else
14563
- * in `@deepseek-ai/dsh-client-ui-settings`' client contract exposes a
14564
- * `openSection` / `selectedSection` service.
14565
- *
14566
- * This is not a WorkBuddy-specific finding: `dsh-connect-qoder`, `dsh-context`
14567
- * and `dsh-better-sidebar` all document the same gap and all drive the real
14568
- * chrome instead.
14569
- *
14570
- * ## What "driving the chrome" means here
15521
+ * The route from this plugin's UI to its **Settings section** (设置 → WorkBuddy).
15522
+ *
15523
+ * ## Two routes, best first
15524
+ *
15525
+ * 1. **The settings shell's store seat** — one call, exact, no timing:
15526
+ * `slots.entries('sidebar.settings')[0].store.create().actions.openSection(id)`.
15527
+ * 2. **Driving the chrome** — click the sidebar's settings trigger, wait for the
15528
+ * panel, click this plugin's nav row by label.
15529
+ *
15530
+ * Route 1 is what the owner asked for ("clicking the button should open Settings
15531
+ * already on this plugin") and it is available on the shell this plugin targets;
15532
+ * route 2 stays as the fallback for a host whose shell predates the seat. Route 1
15533
+ * is strictly better where it exists: `openSection(id)` sets `activeId` AND
15534
+ * `open` in one action, so there is no retry window in which the dialog is open
15535
+ * on the wrong section, and no dependency on the nav row's localized label.
15536
+ *
15537
+ * ## Why the seat is legitimately public (verified, not assumed)
15538
+ *
15539
+ * Read from the shipped host (0.1.7-rc.1), not from a sibling README:
15540
+ *
15541
+ * ctx.remoteAccess.whenAccess('settings/describe', () => ctx.slots.inject('sidebar.settings', () => {
15542
+ * const shellHandle = createSettingsShellStore()
15543
+ * const shellInstance = shellHandle.create()
15544
+ * const shellStore = { ...shellHandle, create: () => shellInstance }
15545
+ * …
15546
+ * ctx.slots.register({ name: 'sidebar.settings', store: shellStore, … })
15547
+ * }))
15548
+ *
15549
+ * and the store itself:
15550
+ *
15551
+ * defineStore({
15552
+ * init: () => ({ open: false, activeId: void 0 }),
15553
+ * actions: {
15554
+ * open: (d) => { d.open = true },
15555
+ * close: (d) => { d.open = false; d.activeId = void 0 },
15556
+ * select: (d, id) => { d.activeId = id },
15557
+ * openSection: (d, id) => { d.activeId = id; d.open = true },
15558
+ * },
15559
+ * })
15560
+ *
15561
+ * Three things follow, and all three are load-bearing:
15562
+ *
15563
+ * - `create: () => shellInstance` PINS the seat to the shell's one live
15564
+ * instance. A bare handle would mint a fresh private copy per `create()`,
15565
+ * and `openSection` on that copy would move a dialog nobody renders.
15566
+ * - `store` is a declared registration field ("Declared store seat; instance
15567
+ * resolution and lifecycle live with the host machinery"), and
15568
+ * `slots.entries(key)` is a public service method — the harness's own client
15569
+ * tests read this exact seat the same way.
15570
+ * - **Only `openSection` answers this need.** The published contract gives a
15571
+ * `settings.section` registrant just `close`; `settings.launcher` gets
15572
+ * `openSettings` with no id; `openSection(id)` is otherwise handed only to
15573
+ * `settings.onboarding` steps. Registering a fake first-run step to reach it
15574
+ * would be far more intrusive than reading a seat the shell published.
15575
+ *
15576
+ * ## Why the probe happens per PRESS, not during `apply`
15577
+ *
15578
+ * The seat belongs to ANOTHER bundle whose apply order is not ours to assume.
15579
+ * Probing once during `apply` would capture `undefined` on a host whose sidebar
15580
+ * applied later, leaving the button dead for the whole session. `entries()`
15581
+ * answers `[]` for an undeclared slot, so a per-press probe is stateless and
15582
+ * always current — the same reason the popover button is built around `softGet`.
15583
+ *
15584
+ * ## Route 2, and why it is kept rather than deleted
15585
+ *
15586
+ * The host range this plugin declares spans shell lines that may predate the
15587
+ * seat. When the seat is absent, the old route still lands the user on this
15588
+ * plugin's page, so deleting it would trade a working fallback for nothing. It
15589
+ * is now the SECOND choice, which also means its known weakness (the nav row is
15590
+ * found by its localized label, so a language we did not ship cannot match) can
15591
+ * no longer affect a host that has the seat.
14571
15592
  *
14572
15593
  * 1. click the shell's settings trigger (`aria-haspopup="dialog"` +
14573
15594
  * `aria-expanded`) — unless the panel is already open, in which case
@@ -14576,22 +15597,12 @@ window.__ModuleLoader__.load({
14576
15597
  * 2. wait for the panel to mount (it renders on demand into `body`);
14577
15598
  * 3. find this plugin's nav row by its LABEL and click it.
14578
15599
  *
14579
- * ## Why the label and not the id
14580
- *
14581
- * The shell renders each nav row's `row.label` — an already-localized string —
14582
- * and writes no `data-section-id` or similar stable anchor; `aria-current` only
14583
- * appears on the row that is already selected. The label comes from this
14584
- * plugin's own `section.label` (`t('nav.panel')`), so both languages live in
14585
- * this repository and "the one we found" cannot drift from "the one we
14586
- * registered".
14587
- *
14588
15600
  * ## Why it never throws
14589
15601
  *
14590
- * Every step is called from a RENDER path (a click handler in the credits
14591
- * popover). A throw here would take out the whole readout rather than one
14592
- * button, so each stage swallows its own failure and the whole jump degrades to
14593
- * a silent no-op when the shell has a different shape (an older host, a hidden
14594
- * sidebar, a language we did not ship).
15602
+ * Every step runs from a RENDER path (a click handler in the credits popover). A
15603
+ * throw here would take out the whole readout rather than one button, so each
15604
+ * stage swallows its own failure and the whole jump degrades to a silent no-op
15605
+ * when the shell has a different shape.
14595
15606
  *
14596
15607
  * @module dsh-connect-workbuddy/client/settings-jump
14597
15608
  */
@@ -14605,6 +15616,8 @@ window.__ModuleLoader__.load({
14605
15616
  const SETTINGS_PANEL_SELECTOR = "[data-shortcut-modal=\"settings\"]";
14606
15617
  /** The sidebar's settings trigger: dialog semantics plus an expanded state. */
14607
15618
  const TRIGGER_SELECTOR = "button[aria-haspopup=\"dialog\"][aria-expanded]";
15619
+ /** The shipped slot whose store seat is the settings shell's state handle. */
15620
+ const SETTINGS_SLOT = "sidebar.settings";
14608
15621
  /**
14609
15622
  * Budget for "panel mounted + nav row rendered".
14610
15623
  *
@@ -14637,14 +15650,62 @@ window.__ModuleLoader__.load({
14637
15650
  return buttonsIn(scope).find((button) => (button.textContent ?? "").trim() === want);
14638
15651
  }
14639
15652
  /**
15653
+ * Open Settings on this plugin's section through the shell's store seat.
15654
+ *
15655
+ * @returns `'opened'` when the dialog is on the right section (done), `'shell'`
15656
+ * when the dialog was opened but not preselected (route 2 can still click the
15657
+ * row), and `undefined` when the seat is absent or unusable.
15658
+ */
15659
+ function openThroughStoreSeat(get, sectionId) {
15660
+ let slots;
15661
+ try {
15662
+ slots = get("slots");
15663
+ } catch {
15664
+ return;
15665
+ }
15666
+ if (slots === void 0 || typeof slots.entries !== "function") return void 0;
15667
+ let seat;
15668
+ try {
15669
+ seat = slots.entries(SETTINGS_SLOT)[0]?.store;
15670
+ } catch {
15671
+ return;
15672
+ }
15673
+ if (seat === null || typeof seat !== "object") return void 0;
15674
+ const handle = seat;
15675
+ if (typeof handle.create !== "function") return void 0;
15676
+ try {
15677
+ const instance = handle.create();
15678
+ const openSection = instance?.actions?.openSection;
15679
+ if (typeof openSection === "function") {
15680
+ openSection(sectionId);
15681
+ return "opened";
15682
+ }
15683
+ const open = instance?.actions?.open;
15684
+ if (typeof open === "function") {
15685
+ open();
15686
+ return "shell";
15687
+ }
15688
+ } catch {}
15689
+ }
15690
+ /**
14640
15691
  * Open the settings panel and select this plugin's section.
14641
15692
  *
14642
- * @returns whether the trigger was driven at all (`false` = the panel is not on
14643
- * this host, so nothing was attempted and `onGiveUp` already ran).
15693
+ * @returns whether any route was taken (`false` = no route could be attempted,
15694
+ * so the shell is unrecognisable and `onGiveUp` already ran).
14644
15695
  */
14645
15696
  function openWorkBuddySettingsSection(options) {
14646
15697
  const { doc = document, label } = options;
14647
15698
  const schedule = options.schedule ?? defaultSchedule;
15699
+ const sectionId = options.sectionId ?? "dsh-connect-workbuddy";
15700
+ if (options.get !== void 0) {
15701
+ let seatResult;
15702
+ try {
15703
+ seatResult = openThroughStoreSeat(options.get, sectionId);
15704
+ } catch {
15705
+ seatResult = void 0;
15706
+ }
15707
+ if (seatResult === "opened") return true;
15708
+ }
14648
15709
  try {
14649
15710
  if (doc.querySelector(SETTINGS_PANEL_SELECTOR) === null) {
14650
15711
  const collapsed = Array.from(doc.querySelectorAll(TRIGGER_SELECTOR)).find((button) => button.getAttribute("aria-expanded") !== "true");
@@ -14717,6 +15778,74 @@ window.__ModuleLoader__.load({
14717
15778
  */
14718
15779
  const inject = ["slots", "locale"];
14719
15780
  /** Register card copy and the WorkBuddy card under Plugin configuration. */
15781
+ /**
15782
+ * Report whether the model-picker label slot landed.
15783
+ *
15784
+ * The slot is a `single` cell declared as a CHILD of `conversation.input.model`,
15785
+ * so the host calls our inject callback only once that parent entry mounts. Two
15786
+ * failures follow, and neither is visible on the page:
15787
+ *
15788
+ * 1. `register()` threw — another claim at the same priority.
15789
+ * 2. The callback never ran — the parent never mounted. Nothing throws, the
15790
+ * disposer list is simply one shorter, and the picker shows no badges.
15791
+ *
15792
+ * Case 2 is why this exists: it produced NO trace of any kind. The state is
15793
+ * published on `window` (so a person can inspect it without reproducing the
15794
+ * symptom) and a failure is warned about exactly once per rebind. A healthy
15795
+ * load stays silent — a warning that fires when nothing is wrong stops being
15796
+ * read.
15797
+ *
15798
+ * Exported for the test; never called outside `rebindSlots`.
15799
+ *
15800
+ * @param state - What the registration path recorded.
15801
+ * @param target - Where to publish; defaults to the global object.
15802
+ * @returns The published view, or `undefined` when there is no global to
15803
+ * publish onto (server rendering, a bare test).
15804
+ */
15805
+ /**
15806
+ * One word for the state of the model-label registration.
15807
+ *
15808
+ * The four outcomes need DIFFERENT fixes, and three of them look identical from
15809
+ * the picker (no badges):
15810
+ *
15811
+ * not-reached the client half never reached registration — a boot or
15812
+ * composition problem, nothing to do with the slot.
15813
+ * parent-not-mounted we asked, the host never called back: the parent entry
15814
+ * (`conversation.input.model`) is not mounted, so the child
15815
+ * cell does not exist yet.
15816
+ * failed `register()` threw (a same-priority claim).
15817
+ * claimed it landed; if badges are still missing the cause is
15818
+ * downstream (render or CSS), not here.
15819
+ *
15820
+ * @param state - What the registration path recorded.
15821
+ * @returns The verdict word.
15822
+ */
15823
+ function modelLabelVerdictOf(state) {
15824
+ if (state.failure !== void 0) return "failed";
15825
+ if (state.injectRanAt !== void 0) return "claimed";
15826
+ if (state.askedAt === void 0) return "not-reached";
15827
+ return "parent-not-mounted";
15828
+ }
15829
+ function publishModelLabelState(state, target = globalThis) {
15830
+ const view = {
15831
+ verdict: modelLabelVerdictOf(state),
15832
+ injectRanAt: state.injectRanAt,
15833
+ askedAt: state.askedAt,
15834
+ rebinds: state.rebinds,
15835
+ failure: state.failure,
15836
+ claimed: state.dispose !== void 0,
15837
+ at: Date.now()
15838
+ };
15839
+ try {
15840
+ target["__dshWorkBuddyModelLabel__"] = view;
15841
+ } catch {
15842
+ return;
15843
+ }
15844
+ if (state.failure !== void 0) try {
15845
+ target.warn?.("[dsh-connect-workbuddy] the model-picker badges could not be registered: " + state.failure);
15846
+ } catch {}
15847
+ return view;
15848
+ }
14720
15849
  function apply(ctx) {
14721
15850
  try {
14722
15851
  const namespace = "settings.workbuddy";
@@ -14729,9 +15858,9 @@ window.__ModuleLoader__.load({
14729
15858
  /**
14730
15859
  * The credits popover's header button: open 设置 → WorkBuddy.
14731
15860
  *
14732
- * ALWAYS A FUNCTION, never `undefined`. It drives the shell's real chrome
14733
- * (see `settings-jump.ts`) rather than asking a host service, so it has a
14734
- * definite value from the moment `apply` runs. That matters because the
15861
+ * ALWAYS A FUNCTION, never `undefined`, and it takes no route value at
15862
+ * creation time: it reads the store seat per press and otherwise drives the
15863
+ * shell's real chrome (see `settings-jump.ts`). That matters because the
14735
15864
  * readout only renders the button when this is present, and the first
14736
15865
  * `registerAllSlots()` happens before most of `apply` has finished — a
14737
15866
  * route captured from `ctx.get('layout')` at that moment is `undefined` on
@@ -14743,6 +15872,7 @@ window.__ModuleLoader__.load({
14743
15872
  */
14744
15873
  const openSettingsSection = () => openWorkBuddySettingsSection({
14745
15874
  label: () => t("nav.panel"),
15875
+ get: softGet,
14746
15876
  onGiveUp: () => {
14747
15877
  const navigation = softGet("pluginNavigation");
14748
15878
  if (navigation !== void 0 && typeof navigation.openBundle === "function") try {
@@ -14806,18 +15936,12 @@ window.__ModuleLoader__.load({
14806
15936
  locale: namespace
14807
15937
  }, (iconProps) => {
14808
15938
  const edge = typeof iconProps?.size === "number" ? iconProps.size : 16;
14809
- return (0, react.createElement)("img", {
14810
- src: WORKBUDDY_PLUGIN_ICON,
14811
- alt: "",
14812
- width: edge,
14813
- height: edge,
15939
+ return (0, react.createElement)(PluginIcon, {
15940
+ size: edge,
14814
15941
  className: "dsm-workbuddy-nav-icon",
14815
15942
  style: {
14816
- width: `${edge}px`,
14817
- height: `${edge}px`,
14818
15943
  borderRadius: "4px",
14819
15944
  display: "block",
14820
- objectFit: "contain",
14821
15945
  opacity: iconProps?.active === false ? .75 : 1
14822
15946
  }
14823
15947
  });
@@ -14927,13 +16051,40 @@ window.__ModuleLoader__.load({
14927
16051
  * meeting that price for the first time; the disposition is to state it
14928
16052
  * plainly rather than to coordinate at runtime.
14929
16053
  */
16054
+ /**
16055
+ * WHY THIS RECORDS AN OUTCOME, not just a disposer.
16056
+ *
16057
+ * Claiming the cell can fail in two DIFFERENT ways and both are silent:
16058
+ *
16059
+ * 1. `register()` throws — a `single` slot with another claim at the same
16060
+ * priority. The catch logs, the page looks fine, the badges are gone.
16061
+ * 2. `inject()` never runs — the slot is declared as a child of
16062
+ * `conversation.input.model`, so the host only calls back once THAT
16063
+ * entry mounts. If it never mounts (a session-less surface, an older
16064
+ * host, a renamed parent), nothing throws at all: the callback simply
16065
+ * does not happen and the disposer list stays one shorter.
16066
+ *
16067
+ * Case 2 left no trace of any kind, which is why this plugin could look
16068
+ * healthy while the picker showed no badges. Recording the timestamp of the
16069
+ * callback and the reason for a failure turns "did it land?" from a guess
16070
+ * into a fact the diagnostics row can print.
16071
+ */
16072
+ const modelLabelState = {};
16073
+ /** The verdict for the console line (see `modelLabelVerdictOf`). */
16074
+ const modelLabelVerdict = () => modelLabelVerdictOf(modelLabelState);
14930
16075
  const registerModelLabel = () => {
16076
+ modelLabelState.askedAt = Date.now();
14931
16077
  try {
14932
- return ctx.slots.inject("conversation.input.model.label", () => ctx.slots.register({
14933
- name: "conversation.input.model.label",
14934
- priority: MODEL_LABEL_PRIORITY
14935
- }, WorkBuddyModelLabel));
16078
+ return ctx.slots.inject("conversation.input.model.label", () => {
16079
+ modelLabelState.injectRanAt = Date.now();
16080
+ return ctx.slots.register({
16081
+ name: "conversation.input.model.label",
16082
+ priority: MODEL_LABEL_PRIORITY
16083
+ }, WorkBuddyModelLabel);
16084
+ });
14936
16085
  } catch (error) {
16086
+ const message = error instanceof Error ? error.message : String(error);
16087
+ modelLabelState.failure = message;
14937
16088
  console.error("[dsh-connect-workbuddy] model label slot failed to register (host provider unaffected):", error);
14938
16089
  return;
14939
16090
  }
@@ -14948,13 +16099,9 @@ window.__ModuleLoader__.load({
14948
16099
  */
14949
16100
  function WorkBuddyPanelIcon(props) {
14950
16101
  const edge = typeof props.size === "number" && props.size > 0 ? props.size : 16;
14951
- return (0, react.createElement)("img", {
16102
+ return (0, react.createElement)(PluginIcon, {
14952
16103
  className: "dsm-workbuddy-panel-icon",
14953
- src: WORKBUDDY_PLUGIN_ICON,
14954
- alt: "",
14955
- width: edge,
14956
- height: edge,
14957
- "aria-hidden": "true"
16104
+ size: edge
14958
16105
  });
14959
16106
  }
14960
16107
  /**
@@ -15212,7 +16359,11 @@ window.__ModuleLoader__.load({
15212
16359
  registerStatsCredits(),
15213
16360
  registerCliLive(),
15214
16361
  registerQuotaNotice(),
15215
- registerModelLabel(),
16362
+ (() => {
16363
+ const dispose = registerModelLabel();
16364
+ modelLabelState.dispose = dispose;
16365
+ return dispose;
16366
+ })(),
15216
16367
  registerMainPage()
15217
16368
  ].filter((disposer) => disposer !== void 0);
15218
16369
  /**
@@ -15243,9 +16394,11 @@ window.__ModuleLoader__.load({
15243
16394
  dispose();
15244
16395
  } catch {}
15245
16396
  liveDisposers = [];
16397
+ modelLabelState.rebinds = (modelLabelState.rebinds ?? 0) + 1;
15246
16398
  liveDisposers = registerAllSlots();
16399
+ publishModelLabelState(modelLabelState);
15247
16400
  try {
15248
- console.info(`[dsh-connect-workbuddy] registered ${String(liveDisposers.length)} slots (settings form: ${settingsScope === void 0 ? "none — page is read-only" : "bound"}, sidebar panel: ${sidebarPanelWanted() ? "on" : "off"})`);
16401
+ console.info(`[dsh-connect-workbuddy] registered ${String(liveDisposers.length)} slots (settings form: ${settingsScope === void 0 ? "none — page is read-only" : "bound"}, sidebar panel: ${sidebarPanelWanted() ? "on" : "off"}, model label: ${modelLabelVerdict()}${modelLabelState.failure === void 0 ? "" : ` (${modelLabelState.failure})`})`);
15249
16402
  } catch {}
15250
16403
  syncPanelRegistration();
15251
16404
  };
@@ -15341,7 +16494,9 @@ window.__ModuleLoader__.load({
15341
16494
  //#endregion
15342
16495
  exports.apply = apply;
15343
16496
  exports.inject = inject;
16497
+ exports.modelLabelVerdictOf = modelLabelVerdictOf;
15344
16498
  exports.name = name;
16499
+ exports.publishModelLabelState = publishModelLabelState;
15345
16500
  return module.exports;
15346
16501
  }
15347
16502
  });