dsh-connect-workbuddy 5.20.0 → 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/CHANGELOG.md +1611 -6
- package/README.en.md +30 -7
- package/README.md +30 -7
- package/docs/PRIVACY.md +196 -0
- package/docs/assets/dsh-connect-workbuddy-account-pool.png +0 -0
- package/docs/assets/dsh-connect-workbuddy-composer-credits.png +0 -0
- package/docs/assets/dsh-connect-workbuddy-model-picker.png +0 -0
- package/lib/bin.js +1 -1
- package/lib/client.js +1675 -405
- package/lib/{host-heartbeat-BTTe5VDs.js → host-heartbeat-DekAOmo0.js} +327 -20
- package/lib/index.d.ts +51 -0
- package/lib/index.js +253 -15
- package/package.json +5 -3
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
|
|
2028
|
-
* - a stated instant
|
|
2029
|
-
* -
|
|
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
|
|
2072
|
+
* - any other outcome → the bare outcome ("连不上上游")
|
|
2032
2073
|
*
|
|
2033
|
-
* That
|
|
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}
|
|
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
|
-
|
|
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",
|
|
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
|
-
|
|
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"))
|
|
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-
|
|
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
|
-
|
|
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,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAXGUlEQVR4nH1bC7BdVXn+1tr7nHPvzb3JvUloSAQp0JHWoAMttKOCFrWU8irQSbCTQYG21IahnTJUUTsM0FJhZCzCSIcKImOpDkhrhQ5YC7ROB3lUBU3EyCuBFBIIedzcx3ntvTr/a621TwIns3PO3mfvddf/+v7v/9c6DvYKoYBz1cZNYfJpVBcNBm7dcIhj3TBM15VzqAE6XAWEGggVADroOl0byDW+PtRr9E732rl9r2PxOMNsrCogVE7PA0Kge4Lcz5/TGI6v00UaK+h98u4QUA9quIDg4Pe2i2LTsknc++mzZu9cv37VHNaFAveSJICj/9aFUNzrXHXSTwdnznl/Y+X9MaEP1D0A/ToKaUdDASoAK0YVYcLad/G88S6C1aQcOkI2Nj9HylBFBRMYqPUeFp6EDXQfKcIUoud6LQQP59rwrsBEOdhy9KGDK/7j9mUPmBKcCf++Z4YbF6eKLw+6QFioKl/DoYILlXMsHE2KPCCzwlsqoNb3oUw4Kq+2a0k4G4MtXOX3J4HNyulzUkC0eqYI8ZAaQZQSAh9080Qx1m7jHStnL/3B3ctvXbcuFOwBH/p5OG12DA/29leV6wcHeI8hadE1rBldl/6ACs7WMEuz0PIcKawe0Gdzeyf36eTzcOHxVAEpTEQB0QtY0PRZPMYsX+t3tSqBxkteYeHh6qqu6yIsmVhaHHtE7/fu/8fJhzzF/OywunXQR+DJOO9pkLp2NJ64pIXhaOxb/IfmJM29PemSJ+NSzJP1s2dhwmucJ6uaoIYFzVjnkFDhLRTkb2XC03gQTKDrZNjSV1icXwzPv9y99Z5Hw6R/psQnqoniyLBQ1d65IoGiDqZuHwWwzyFzx8xl5RDBZR4uCZc9E8fS+8TdSfHZ2KxAel6VwEIYZiflxC9NKToeKcKrAcjV2d2DK3xYqOcXJ478ytf2fcL3htWGegAaSZGeBnKixWgVPXRiZpEomLq4Kcri2RCc7zN3NWuq5XlOJLwqjq9liqlHlEfzSveIdVk0Fjh5kVjdjKLneniCtcEg7N492FBWAWvrHpwLzgmYUfySi+VorcJFBE6I7jIAjFnC3DybePKE5ClxLLsPI0q3kNAsYJ4g1wjkzDuju4nQJrx6RxRe/7YHfFX3MOyHtaUHloaKcqa4rcQTDWxubHnZ0lESNoaGXad7+RmLc7GMxbS4s8Y82S3mdhMshR+Po4pk181jkx22afHc8hL3plNTjOGDjEfu7pxfWkpcyA02Ofo6xpylPsMCi3eNTROShVawM0H4+4bXaGqzcTKQzc8j6VGPkb9tFtU56bwlBdK9ZMQMKNgolMtVKepFcq6hBMAzQJAQ6srG9iwNJRfN0LtWd64z1qZjRPDieBYQkyNTqFpCsoYoKQFoFt8xhA5icZ2fXWOwY4GScsT95Tv7XoSnd0ehgLJBSPSdkdhYWbSeAk2eCSzuScDs/qQo9dpRZarVWWm5ZRuxn8YRRabYtiwhn5PVRXD9js8FzM2rowKII7MnOJSR2GSZJMVUckfzjIjKMe2p5fOsENGfPESR38AwB8AsZTUBUV025TwWVEAsubSl6gYA8rU6eUMmvE2ErjMrQEDZQGkewGI6TcqPAhlT1hHBBV0xZC/R3B09JFmdXDESrIz5GRPMlWQA6kNAoVbjf7FAyq1vsW8xrt+rImI4aEiwIuqAMjI9y/8Z5RSAS+f04P4uTcihozDLaO6kZup2gSWFIXjm3plb75sHxkugMKzAgWmQcYmsTvqrgPkuMOgHFAhY0gnolDJfOgTM0t/xMcYTJeZz9QZRgHiUd5AQIHe2fNqIY3o4xiEw3wc++A6HvzweWNbWtKmsrF853PFEwDd/LEqoVOiYQQLQ7QGXn+Zw3okOhc9i1tw8umpS7mBQ4PW9Ab/YVuHxTTV+8EyF7TsqTHQCxtsBlVWSUVBViGYHcnMDQvaUyAv03wmPDcP8ECiy2lwOKl4CFz2+AoYDx1b73rkOayaVfUXziRMu9oGTbg54cz9pNlV9FEJzi8CJv+zwwOWWoZvZfXSst3rteDPgXx4e4LZv9fDS9grLlzotkclDakmXJCCFTswAdC5eZQqphwErZgr40QInAh4XHMbsHGt6ugSmWuLZwyqwlclFhwqOrSJgZky+izydc7bj+1ZPy7P9AT2nz/MR+PuK/g6/50fg8QdDGffQFQ4b13fwyFcmccl5HczOUgVYoXTcAGEBSWBzdRY4hoLUBvGeQGFgrM84gMWglq/mwszXqcSlAahgdi57l8/Mr9gaxiqbnZwheZMU23Lw88zN0zWff5ZzCpeyAApqTNWkjBorljnceMUEbvnMEqK0qIc1A6UAnYQS5/6Md4jTNxlhGUkKRYYBHmHCiEewJxQjzmmenFdphiXsZ0aKstogvmwkEiqwYml6MmS6kQkQKcUlICsIY6hyDAEbzupgZgr448/OouyI5Y3t8YgGfq5OIaHfeiZDWXclFizWw1OmF0lRQ4A8UWevnPTEsTNFjoQ7fV0UDq3SoSyBVgmU/FmOVsuz9VmfrCUBMPIMut4f1Dj9tzv4wqcmORzIvW1qwgOcYIC5vB0gzAClQW1EGuJXkgql2MlyuTHFhg4OAlrm8vRxtHrMFUhRV4trv/hawK3fqbF/QSwoYwSUPuCwlcDJ7y3wgeMKFHAYDgN7gOmwLBwGgxobzhnH/z7Txz9/exErpz2HK1teUZ+tTSGXZYZCFGAc3eqBZsESmZs1L0e92HK5TikSKA2N2CMY8QATfuvOgLOvqrBlW0CnyOioeWVF1/v4rXd7/M2fjeGEtQWGFO+FpkzFFPKOv/7zKXz/sR5m99foUJ2rRRNhhwCfAqBOxQkbVObHKSv14UZb2KnFdBAl5CdxvMwDcnotrTsW/vW9wPnXVdi2M+DwQ4DVK4CZSWDFVDp+aRkwNR7wxE8GOOuyWdz3vT7K0jMGyN8ToKTzFTMel2yYwPxcAJe56voR/eO7tOscY0Ls2GSFkJW+Nue8QTn6agJD6gta5mhwf7mHhCdesOGGCpu3AmMthzv+qsTHf6fArj0SP5YGKXNQZpleArRcjU9ePYdHnxgwPrAStK1EXkBhvO7scRx+aIleL2SWTzFP1qdQYkCs6dx66COob/28mB61GjzACwhmc9Q2rxnt/9GfUGwY1g4XfbHG488GjLWAmzYWOOU4zwAoKG6KteYG8YSAdunQKQM+dcMc9uwLbHnRv9Baumf5dIGPnNTB4jx5gQjNgisNLuH0Gr07ygKpjpdKsFnWGiuMXtLwfaPDpoRk/dFqjcYht6Q7P3lzhQefqvn87y4usOEjkgpjYlHhyT2psjMLErOcHANe3DbAXfd1xfUZVzRH6qMf/VA7E15JkfECdX9TiB+11ughDcisQGr4+wEfDqzrtegRxAau+aca3/gvEejK8z0uOcNhsUfWtAJGviOhrWKLXRwujgImx4Fvf3cR3V7gLGBRyDnfBbxnbQurVlImqJlEmdtLSpS/I9dACpD0l+I+sTjLCNbLe3sekHlEJry5/tJxh/98usZtDwo1vfTsAp/+mMeA0hrnPssalgl0PtoEEUYn18fbDltfHmLzlgEcs0MtiZ0oY+UKjyPWlBj0lRVGy3s+J2VQreKZIGUWq7MFDMEBaW01yMyoC7iRwmikG0zaZo5BcTwE9s0FXPS7Hp+/2DO356rQquKsvy9NDWV2yuXlM4Eb0O8FbN4ieTnCheIAKWLNao9qKPm/gJdD6bfhQkHlMLE9QmouF7Mlq1geM/hpO2xU/oNciT2K2B0Wik1/cHYu4Jz3O9y80bNXCOAJfnCzRAeguUhxbF0e7eLwMyIUKeW1HRkoWS9QXzPTnmWQvoOkQMED5Q8UDnDUE0ytLVv6jtbTyae6IP8T2qczNhKbAymLWP4nwXp94IhVDv9wWcGWoBRHHD/Fr8NPn6/Q8lpFpqCKwEgCGLsjF+4umOs3nZJeS8Y8ilrSHV0kazPqq6J5BRQylsgR4z2rALXhmWWkt8CAZvES49/aYDTZXsDxRzksnaDcTqAnz5DLtkqPux8c4LuPDTjfE9rnq0ziFUpotJfH4WFdjthUSbOjMdjFSXCtWg0EyyC9DU+fWcNq6UaDMq7tExJn6fFt3J+vKmPkZog9p4wqhoc6Dwvf8vjOfw9w+RcXucNj7e+0kpPa4wZmHDg1sHK5FAVCBXRgndb8XB2boj4TmBkgW9+AsLIOr/X6m/TX1uxjiyz3AOvjNQODMcVqb1GKrtrQ83qRQoCEf+SpITbeQJsSrLcnbhOR2zVZnBU0pXc46ghRAI+phMzGf3NnjRYBLOEPK8DzOxMheqcqFF5DIF+dyRZIYkhEgpJiNmn7wGIokhlLXWzNlEeHKvyTm4f4o+sWsdgNWHuUx2RHlG2KYDfniSaGyIUMMb4Zz/k+F5pGpyKp263x6v9VaBOztNyv40RmqGsG3o30+SMQZvXBAQsdb/UaJVTRdaVHZ2sPY22HzS9WuPDaLnbuqnHWySUe+vIU/uCjbcxRIUPpylKfeQMjuLTHF+drHH9sC2tWlxxGRKJiFADY/nKFXTsqjLUpE2jsx3Qq6C8A6CQEuP2V1wCNNfpmamvG/wg6amzLOmESPh+D0P7FVwMuuHoRW7dXOP19JW79zDjaLWBqQsLGipXo9jpZa2tTuG742EQmtKZSpcU/+VEf3fmANhVDbHnJGpEa8zUnxVK+o8N4fFx/H2F/MSXl3VvrBzhqUUmIJHdNedyAcfvrARdc08WzL9U4+bgSt181jjEFP1tljiVsrOHFAzothz27a5xx6jhOfn8HVUVU12YkvUR6/c/DPXQKEi4VPkyIuDrMiqNA3pbz/tGV29j3N68QetLweWuKKEOjdjMpsMX8Sb6nt2VLgCd/VuHMK4Z44ZUK7z26wJ1Xj2N6ynGKHOvYjhR6XumrKpFkbBfAnjcrrD2mhc9dORXpb5wJhULh8dzPB9j0wwEmlxDZMM9JyC9VoGQmz7wgU0Bc089dfqRCPKApqqsutCRGrarTf8PhjT0Bu2cDdu8L2LOvxu69AbP7A3a8UeEXWyu86zCPr187jjWHNFtclvqoFUZkiRRKf6/fDdj1eoXf/PUObrtlBstnpIVH1aB5IydBB3zr6wvodym/Sy9AKG8qi1NPgOixk7XBfJ0ub2o2lJBVdY2YsK6MFiWfO9/jnSuBHz1HHuGFSmuKC5XH6uUOHz+jhdUrndQChSiBXtTEoLRHQFj1a47bibbDrxxR4twzx7Bh/QTKlvCHKLzyf+oSbX66j0f/vYtlU1K/MAFSdyceEIVXAxdxeVy5fwPtRxHd9vw0GqBqIn4zWhpw4akeF5769gmDeADFr1mOXq/urHkN8Nyzx3DGKR20yoBDVhQ4+siSFUVWr014fZCUTue9bsCXrtsfOQIxWxNamiAKiOwZojxPHmBr75a/Y2hpP988pMEHYsfT1u0TEaFTyvMCS9m9htTWpIwlMMWuw8JizV3do99Z4PNXTnHLK9UXQemz4/rBhmW84naYw99fuw/PbR5g5XTBniwIT9bWuHcS+8YraAAfGyIZBlgGyHd45fv4UsTZW+rGmB7KghoVQkqK/J1XeEiIlLRJWRQ+DzzSx8+2DHHqB9osfK9Xs9DkKZRdpAucApDcXsb2uOX6WTz0r4tYQcIPc0HT59QBSpmgsBCILa98BSfb0jKa7jMAOEhTJOmGU2C85BCoINEvyT9IwHbL49WdFW68bZ6Xu9afPcZ3m+KUPFiASQiQkkuP/ftr3PS3s3j4/i73Aql+sc4vC6+rQIL2Qs+NY6QQqG0zZEZYLC2mYowfokVN1n6dGg/NV8YPzF1iBORlFK36BLS956XuP/3sPjy7ZYDL/2QJjv3VEr2+FDK8yKrZIa0byvS//0gPt39pDttfqHiVF4NEm2PDU0tgvpZ7AdMXMUZpW1Kb+4GaqY8+twpgx96A+x4PuPjDsmB54GukX3DQl1yfXwDuf7SHm766gJdfGeIPf38c11wxxd91aO/BQV673qjw1BMDPPhvi3j6yT7GSoeZZbKIa2UyNb3yJqitBebub6tPnosj22010rsf3exEgDNRAld9o8aPX3B412rdB2xgl1Hf0CiEMseoA3r9gG3bK/xw0wAvbB1iqkMkyeOw1QW+9s0FDAeCFeIwAYNewK5dNV7ZWmHb80O8uaNmUrR0Uqo6WgITmptITlRAg1LnZMiIEODec8MwkDV4707+A4isCHJD2cNr3GDfHLi/Z3v4448Xsj38EiepEOLqTru8RaDdHeDtLrZldn6/LnHbhLlNpwQmAB3vMNFxGOPtNZrmaqvzpbYXzm/ARyWvl4YIdYbU/Rn4CFMqYGq5ly0yVqUdUMnZ6q4Bl94zM2E9xGztTxc045aavK1Of1wxxQWiqDULYJuj6G/QEje7byAl6IT1YAF0H7HsKpUmjVV4eakcra6rwlIP6DJYtkbA6Ri8P0CB1jYv5u2lvBoULsfnnJpG9vCyIEqWZHeJrjJn48adGrzzSyZgGxek2ySeZqFjz3FjNd/vo0JKw8QEVgVqt0iKH1sDlBTKy+r6TLBx6nwFuPGefpMTc79Z3RRkPXw+H21njVSPcQ9fanXbWLymb/1/29RgkKmNTRuLBVXrxx0m+lkENmVY7S/zEWtrb9BWiRxlgZGCJ+a9PLHlfEDBTP2hsTFRdpVJNWdPx21qWVPDWtP5ik+j4Zn176wFzoWN9fcyoDNhI+dXppkA0XoCTQLEPCAIdhxk5Tur+nWPsChKYzxH97h/37aqm+z2Sw7ZvGRa5x5c3IuUlBBbVBYWBlymuEx4Gyuv74X4pDTXYILWD8ja4zRKYVR49Fcdxg3invt8yUsVJCRPHshrBWNZ+R49UYLt5tYfRcR6Xy0c3Ta5dJ6/Zd/vCNjlxCcueCa2l1pgGQDGzpIVSEPMyq6w5q+wzOoNUIzu0uz0SFhkHlHTiq4InO4zr9ENSjHO841N2e5ui3PrBTZQPFlagC0Jb54Vd4pZqNiOttgPoI4AZn1ZYLPzLoQatS2CNmod3T3W7Asc+Puc5D1JKRbpRJnFYgZAI9iQub7EvY9gxc9yW1vW+HgME3KkwSkNDs0EVnXqWqARIG3X1y3XDq0xbPbTS4q7vVcCN7qwGWM73/HV3P0t7iwImoOhlMZpe0rc8q7tblaE9vxzJaTCJa3nC/iZp6QFTgNGi/0mC9TvOTukUNLUG8Y6hZte7e/2l52Iu8ar6qXalR6hrhq5P0+LI7/DaYBgrHnMve1HEhYu6RkWgq2bvKDJ3cVGOfhZLOdYkaq8xPIYX2zVV72uyPBEN01XnTDuy2WLL33w+rG7/PpT3NyvrQ4bx9tww8qT1ejHNHFPQEJ6Ke0E1LJd2FmhR90g04xpP+tfKCjmYKaWIU/ImhcpTpXi2q7UfLeH9fXVqSVsTNiMD+Rh4uraDT2mlpXu8BNaG1etcnN+3T2huPcvWg8dubS6dHJJUfD6bFVXrq5rrw3+tCaXOuGmBENzAzHpu0tvL63uNj8bykdeoCkt8QHL+SqAkRxz60wJcQ9BFh6p7CX8CYEQLtShKocTfmbpRLHs3d1LT7u+9dA99tNZ+yHxBTcNztz0mr9x74I/hnZXhD7F/PCAn6bJz+U0vrPr7K5VJUJZf5/v040NDcG02LGGJVmfOsuxdifg03U9vUZHrPz0fl7p5caGjNkiEmTFUXBooUDbjWGs5TE+Pdyy6vjqijO+MPYACb+efjwdiYsqIewMk+d8tbro1b1uXXehPrYahmn+hZmGgtefqsalNFvU1BpAhM8QXhUlCmgCmihAUnBUQixk6J2eSYqwvM9Iz5sfrApM7LDF7W651oILbef3Tky0Nk2vcfeed0dxp3Nu7h6EYr2sgOL/Aa5OuMdnE5sWAAAAAElFTkSuQmCC";
|
|
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)}
|
|
@@ -6464,6 +6913,59 @@ window.__ModuleLoader__.load({
|
|
|
6464
6913
|
* of the 16px gap, and the panel's first block (the pool, with its own 16px top
|
|
6465
6914
|
* padding) added a third layer. */
|
|
6466
6915
|
.dsm-workbuddy-panel{margin:0}
|
|
6916
|
+
/* THE CAPABILITIES PANEL IS A COLUMN OF GROUPS, not a run of paragraphs.
|
|
6917
|
+
*
|
|
6918
|
+
* Measured before this rule existed: the panel was display:block with
|
|
6919
|
+
* gap:normal, so its six blocks had NO space between them at all and the
|
|
6920
|
+
* rhythm was being improvised by whatever padding each block happened to carry
|
|
6921
|
+
* — ink-to-ink the gaps read 12 / 50 / 2 / 17 / 0 px. The 50px hole sat between
|
|
6922
|
+
* the gateway card and the first switch (the card's own 10px bottom padding plus
|
|
6923
|
+
* .prefs' 2px top), and the 2px squeeze sat between two switch groups that are
|
|
6924
|
+
* different KINDS of setting. Neither number was chosen; both fell out of the
|
|
6925
|
+
* order the blocks happen to be written in.
|
|
6926
|
+
*
|
|
6927
|
+
* One gap now owns the rhythm, and every group drops the ad-hoc padding it used
|
|
6928
|
+
* to fake it. 18px is the same step the rest of this card uses between
|
|
6929
|
+
* distinctly different things, and it is large enough to separate two groups of
|
|
6930
|
+
* switches WITHOUT a divider — which is why the one divider that used to sit
|
|
6931
|
+
* above the first upstream switch was deleted rather than kept: once the panel
|
|
6932
|
+
* owns 18px, a border plus 10px of its own padding became a third spacing
|
|
6933
|
+
* statement in the same 20px of air (measured 69px ink-to-ink against 18px
|
|
6934
|
+
* everywhere else, the single visible hole in the panel). */
|
|
6935
|
+
/* THE ID IS THE HOOK, not a second class name.
|
|
6936
|
+
*
|
|
6937
|
+
* Every panel in this card renders as plain dsm-workbuddy-panel; none of them
|
|
6938
|
+
* carries a per-panel class. A rule written as
|
|
6939
|
+
* .dsm-workbuddy-panel-capabilities{...} therefore matches NOTHING — it parses,
|
|
6940
|
+
* ships, and does nothing at all, which is the worst failure mode available
|
|
6941
|
+
* here because the panel keeps looking slightly wrong and the CSS looks right.
|
|
6942
|
+
* #dsm-workbuddy-panel-capabilities is the attribute that actually exists on
|
|
6943
|
+
* the element. */
|
|
6944
|
+
#dsm-workbuddy-panel-capabilities{display:flex;flex-direction:column;gap:18px}
|
|
6945
|
+
/* THE PANEL MUST STILL BE HIDEABLE (regression fix, 5.20.1).
|
|
6946
|
+
*
|
|
6947
|
+
* An ID selector outranks the UA sheet's [hidden]{display:none} on
|
|
6948
|
+
* specificity (1,0,0 vs 0,1,0), so adding display:flex above made the
|
|
6949
|
+
* capabilities panel IGNORE its own hidden attribute. Result: it painted
|
|
6950
|
+
* permanently and, being later in the DOM, covered the diagnostics and SDK
|
|
6951
|
+
* panels entirely — clicking those tabs appeared to do nothing.
|
|
6952
|
+
*
|
|
6953
|
+
* The measure is simple: a panel that is hidden must never be displayed,
|
|
6954
|
+
* whatever other rules set. Both declarations are needed and neither is
|
|
6955
|
+
* redundant — display:none wins the cascade, and !important is what stops
|
|
6956
|
+
* the same thing recurring the next time someone gives a panel a display value.
|
|
6957
|
+
*
|
|
6958
|
+
* Why the shot tool did not catch it: tools/capabilities-shot.tsx hides the
|
|
6959
|
+
* other panels with display:none!important so the section can be measured in
|
|
6960
|
+
* one screenful. That override masked this exact bug — the harness was fixing
|
|
6961
|
+
* the thing it was supposed to observe. The tool no longer forces display on
|
|
6962
|
+
* the panel, and tests/capabilities-layout.spec.tsx now pins that a hidden
|
|
6963
|
+
* panel stays hidden. */
|
|
6964
|
+
#dsm-workbuddy-panel-capabilities[hidden]{display:none!important}
|
|
6965
|
+
/* The note keeps the panel's gap like every other block: a special-cased
|
|
6966
|
+
tighter gap here would be one more number to decode, and the panel's own
|
|
6967
|
+
rhythm is what this rule exists to establish. */
|
|
6968
|
+
#dsm-workbuddy-panel-capabilities > .dsm-workbuddy-panel-note{margin:0}
|
|
6467
6969
|
/* DIAGNOSTICS: a two-column fact table rather than prose. Each row is one thing
|
|
6468
6970
|
* the card actually READ, so a bug report can quote a line instead of
|
|
6469
6971
|
* paraphrasing the UI. No control lives here on purpose — a diagnostics panel
|
|
@@ -6498,7 +7000,19 @@ window.__ModuleLoader__.load({
|
|
|
6498
7000
|
* (the dsm-workbuddy-models-summary class) has no side padding, so copying the
|
|
6499
7001
|
* reference's 2px would leave the two edges 2px apart — a difference too small
|
|
6500
7002
|
* to name and just big enough to look unaligned. */
|
|
6501
|
-
.dsm-workbuddy-prefs{display:flex;flex-direction:column;gap:14px;padding:
|
|
7003
|
+
.dsm-workbuddy-prefs{display:flex;flex-direction:column;gap:14px;padding:0}
|
|
7004
|
+
/* THE GROUP'S LEAD LINE BELONGS TO THE ROW UNDER IT (5.20.0).
|
|
7005
|
+
*
|
|
7006
|
+
* Every group opens with one sentence saying what the switches beneath it
|
|
7007
|
+
* control. With the group's uniform 14px gap, that sentence sat as far from its
|
|
7008
|
+
* first row as two rows sit from each other — measured 14px on all four groups,
|
|
7009
|
+
* identical to the row-to-row distance — so it read as a paragraph of body text
|
|
7010
|
+
* that happened to precede the list rather than as the list's heading.
|
|
7011
|
+
*
|
|
7012
|
+
* Pulling it 6px closer makes the pair visible as a pair without introducing a
|
|
7013
|
+
* new step: the group's own rows stay 14px apart, the lead sits 8px from its
|
|
7014
|
+
* first row, and the 18px panel gap still separates one group from the next. */
|
|
7015
|
+
.dsm-workbuddy-prefs > .dsm-workbuddy-pref-hint:first-child{margin-bottom:-6px}
|
|
6502
7016
|
.dsm-workbuddy-pref{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary,#c6c9d0);cursor:pointer}
|
|
6503
7017
|
/* The platform's own checkbox, themed only with accent-color. A hand-drawn box
|
|
6504
7018
|
was tried on this card and reverted: brand-primary resolves to the host's
|
|
@@ -6511,24 +7025,48 @@ window.__ModuleLoader__.load({
|
|
|
6511
7025
|
* field that needs an explicit Save. Giving it a card of its own is what says
|
|
6512
7026
|
* "this answers a different question".
|
|
6513
7027
|
*
|
|
7028
|
+
* The 25px LEFT padding is the same indent .dsm-workbuddy-pref-indent uses
|
|
7029
|
+
* (15px checkbox + 10px row gap): it puts the card's title on the same left edge
|
|
7030
|
+
* as every switch LABEL in the panel below it, measured 318px vs 330px before
|
|
7031
|
+
* this value existed. A bordered box whose text starts 12px left of the text
|
|
7032
|
+
* beside it reads as a misaligned column, not as a card.
|
|
7033
|
+
*
|
|
6514
7034
|
* The row wraps, and the input takes the whole width when it does: a host name is
|
|
6515
7035
|
* long (https://wb.tencentbuddy.com is 26 characters) and a half-width input in
|
|
6516
7036
|
* the panel column would show about eight of them. */
|
|
6517
|
-
.dsm-workbuddy-cnbase{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:10px;background:var(--dsw-alias-bg-layer-2,#24262c)}
|
|
6518
|
-
.
|
|
7037
|
+
.dsm-workbuddy-cnbase{display:flex;flex-direction:column;gap:8px;padding:10px 12px 10px 25px;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:10px;background:var(--dsw-alias-bg-layer-2,#24262c)}
|
|
7038
|
+
/* SAME TYPOGRAPHY AS A SWITCH ROW (13px/18px).
|
|
7039
|
+
*
|
|
7040
|
+
* Measured before this rule: the card's title rendered at 16px while every
|
|
7041
|
+
* switch label in the same panel rendered at 13px. The cause is structural
|
|
7042
|
+
* rather than a wrong number — a switch row gets its 13px from
|
|
7043
|
+
* .dsm-workbuddy-pref, and this row is NOT a .dsm-workbuddy-pref (it stacks
|
|
7044
|
+
* its label above a text field instead of sitting beside a 15px box), so it
|
|
7045
|
+
* inherited the page's 16px instead. One group rendering a size nobody chose is
|
|
7046
|
+
* exactly the kind of defect a screenshot shows and nobody can name. */
|
|
7047
|
+
.dsm-workbuddy-cnbase-row{display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary,#c6c9d0)}
|
|
6519
7048
|
.dsm-workbuddy-cnbase-input{box-sizing:border-box;width:100%;padding:6px 10px;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:8px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit;font-size:13px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
|
|
6520
7049
|
.dsm-workbuddy-cnbase-input:disabled{opacity:.5;cursor:default}
|
|
6521
7050
|
.dsm-workbuddy-cnbase-input:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px}
|
|
6522
7051
|
.dsm-workbuddy-cnbase-error{margin:0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-error-primary,#ef4444)}
|
|
6523
7052
|
.dsm-workbuddy-cnbase-notice{margin:0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-success-primary,#22a06b)}
|
|
6524
7053
|
.dsm-workbuddy-cnbase-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
|
|
6525
|
-
.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}
|
|
6526
7055
|
/* The upstream-identity switches are their own group, so they get a divider
|
|
6527
7056
|
above them instead of relying on spacing alone: they change the request the
|
|
6528
7057
|
whole plugin sends, not a per-region display choice, and reading them as the
|
|
6529
7058
|
tail of the preference list would misrepresent what flipping one costs. */
|
|
6530
|
-
.
|
|
6531
|
-
|
|
7059
|
+
/* The divider above the first upstream switch is GONE as of 5.20.0.
|
|
7060
|
+
*
|
|
7061
|
+
* It was doing double duty: separating "what this tab shows" from "what the
|
|
7062
|
+
* plugin sends" AND propping up a panel that had no gap of its own. Once
|
|
7063
|
+
* #dsm-workbuddy-panel-capabilities owns the rhythm at 18px, the border plus its
|
|
7064
|
+
* 10px padding became a third spacing statement in the same 20px of air —
|
|
7065
|
+
* measured ink-to-ink 69px against 18px everywhere else, i.e. the one visible
|
|
7066
|
+
* hole in the panel. The semantic break it marked is still real, and it is now
|
|
7067
|
+
* expressed the way the rest of the panel expresses it: one group, one gap.
|
|
7068
|
+
* The 4px that remains is optical only, between the group's own rows. */
|
|
7069
|
+
.dsm-workbuddy-upstream-pref{margin-top:0}
|
|
6532
7070
|
.dsm-workbuddy-pref input:disabled{cursor:default}
|
|
6533
7071
|
.dsm-workbuddy-pref:has(input:disabled){opacity:.6;cursor:default}
|
|
6534
7072
|
/* The NAME and what it does are TWO lines, not one wrapped blob: first what the
|
|
@@ -6687,10 +7225,22 @@ window.__ModuleLoader__.load({
|
|
|
6687
7225
|
colour: it has to stand out from the three lines around it WITHOUT reading as
|
|
6688
7226
|
an error banner, because the fact it states is normal product behaviour
|
|
6689
7227
|
rather than a failure. Weight is the only signal it needs. */
|
|
6690
|
-
/*
|
|
6691
|
-
*
|
|
6692
|
-
*
|
|
6693
|
-
|
|
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}
|
|
6694
7244
|
/* The line that explains the REGION pair, directly under it.
|
|
6695
7245
|
*
|
|
6696
7246
|
* It used to be a .dsm-workbuddy-models-summary inside the accounts panel,
|
|
@@ -6698,8 +7248,16 @@ window.__ModuleLoader__.load({
|
|
|
6698
7248
|
* cells above it, so it gets its own name and its own margin: the summary's
|
|
6699
7249
|
* margin:2px 0 0 was tuned to sit under a section heading, and here the line
|
|
6700
7250
|
* follows a row of boxed cells and needs more air, plus it precedes the section
|
|
6701
|
-
* tabs whose own top margin would otherwise crowd it.
|
|
6702
|
-
|
|
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}
|
|
6703
7261
|
/* Every model is laid out in full — NO inner scroll box.
|
|
6704
7262
|
*
|
|
6705
7263
|
* The previous rule capped this at max-height 520px with overflow-y auto, so a
|
|
@@ -6722,9 +7280,12 @@ window.__ModuleLoader__.load({
|
|
|
6722
7280
|
/* ISSUE #198 — the model row's controls MUST WRAP.
|
|
6723
7281
|
|
|
6724
7282
|
The row carries four groups on one line: the name, the two checkboxes, the
|
|
6725
|
-
context-budget
|
|
6726
|
-
|
|
6727
|
-
|
|
7283
|
+
context-budget control, and the test/measure buttons. (It was a radio GROUP;
|
|
7284
|
+
as of 5.20.2 it is one select, which cannot wrap or clip internally — but the
|
|
7285
|
+
row still has to wrap, because the four groups together are what overflow.)
|
|
7286
|
+
The budget control had flex:none and the row had no flex-wrap, so on a narrow
|
|
7287
|
+
card (dsh-go on a phone, a ~360 px settings panel) the row's intrinsic width
|
|
7288
|
+
exceeded the
|
|
6728
7289
|
container and the model list's overflow:hidden CLIPPED THE REST — the third
|
|
6729
7290
|
radio (「模型原生窗口」, e.g. 1M) was neither visible nor clickable, and the
|
|
6730
7291
|
largest budget a user could pick looked like 500K. A control that is clipped is
|
|
@@ -6733,7 +7294,32 @@ window.__ModuleLoader__.load({
|
|
|
6733
7294
|
itself wraps, because its three labels can exceed even a whole narrow line —
|
|
6734
7295
|
hence the media query below as well, which gives the group the full width on a
|
|
6735
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. */
|
|
6736
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}
|
|
6737
7323
|
.dsm-workbuddy-model-enabled{display:flex;align-items:center;gap:8px;min-width:0;cursor:pointer;flex:1}
|
|
6738
7324
|
.dsm-workbuddy-model-enabled input{margin:0;accent-color:var(--dsw-alias-brand-primary,#5686fe);flex:none}
|
|
6739
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}
|
|
@@ -6754,7 +7340,20 @@ window.__ModuleLoader__.load({
|
|
|
6754
7340
|
* floor. It may still ellipsize — a name longer than the whole row cannot fit —
|
|
6755
7341
|
* but it never collapses to a stub while a badge sits whole beside it. */
|
|
6756
7342
|
.dsm-workbuddy-model-copy{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;min-width:0}
|
|
6757
|
-
|
|
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}
|
|
6758
7357
|
/* Below the panel's own width the floor is too greedy: 9em plus two chips is
|
|
6759
7358
|
wider than the line, and the NAME would force the wrap it is meant to avoid.
|
|
6760
7359
|
Give it less and let the chips take the second line. */
|
|
@@ -6779,13 +7378,26 @@ window.__ModuleLoader__.load({
|
|
|
6779
7378
|
"· N 新模型" segment (label-dimmed), but no chip border and one step smaller,
|
|
6780
7379
|
so it reads as a side note beside the promotion chip rather than a second
|
|
6781
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}
|
|
6782
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))}
|
|
6783
7396
|
.dsm-workbuddy-busy{flex:none;display:inline-flex;align-items:center;block-size:12px;color:var(--dsm-workbuddy-busy-color);vertical-align:-2px}
|
|
6784
7397
|
.dsm-workbuddy-busy svg{display:block;block-size:12px;inline-size:auto}
|
|
6785
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)}
|
|
6786
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}
|
|
6787
7400
|
.dsm-workbuddy-model-desc{margin:0;color:var(--dsw-alias-label-tertiary,#9aa0a8);font-size:12px;line-height:18px}
|
|
6788
|
-
.dsm-workbuddy-model-details{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
|
|
6789
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}
|
|
6790
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)}
|
|
6791
7403
|
/* The per-model default thinking tier (issue #179). It lives INSIDE the meta row
|
|
@@ -6803,9 +7415,28 @@ window.__ModuleLoader__.load({
|
|
|
6803
7415
|
the clipping bug, and flex-wrap is the other half — a 1.048M label is wider
|
|
6804
7416
|
than 200K. Left-aligning the group under the media query makes the group
|
|
6805
7417
|
own its line on a phone instead of dangling at the right edge. */
|
|
6806
|
-
.
|
|
6807
|
-
|
|
6808
|
-
.
|
|
7418
|
+
/* ONE SELECT, NOT A ROW OF RADIOS.
|
|
7419
|
+
*
|
|
7420
|
+
* It was a wrapping flex row of three radios. In the Settings column (564px,
|
|
7421
|
+
* of which the model row already spends ~300px on the id/speed column) those
|
|
7422
|
+
* three wrapped onto a second line, and a wrapped row of radios reads as three
|
|
7423
|
+
* independent switches rather than as one choice.
|
|
7424
|
+
*
|
|
7425
|
+
* A FIXED min-inline-size keeps the three rows' columns aligned. Without it the
|
|
7426
|
+
* control sizes to its widest option, so a model offering only 192K drew a
|
|
7427
|
+
* 56px control while its neighbours drew 58px and the left edges stepped by 2px
|
|
7428
|
+
* down the list — the same misalignment the wrapped radios had, in miniature.
|
|
7429
|
+
*
|
|
7430
|
+
* Being a <select>, this is now a single fixed-width control that cannot wrap,
|
|
7431
|
+
* and the native dropdown is what the platform draws — so the styling here is
|
|
7432
|
+
* only about the closed state: the same 11px secondary text the radios used, a
|
|
7433
|
+
* chevron the platform provides, and a chevron-affordance gap.
|
|
7434
|
+
*
|
|
7435
|
+
* flex:none matters: the row is a flex line, and a select that grows steals
|
|
7436
|
+
* width from the model name beside it. */
|
|
7437
|
+
.dsm-workbuddy-context-budget{flex:none;margin:0;min-inline-size:58px;padding:2px 4px;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:6px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-secondary,#c6c9d0);font-family:inherit;font-size:11px;line-height:16px;cursor:pointer}
|
|
7438
|
+
.dsm-workbuddy-context-budget:disabled{cursor:default;opacity:.6}
|
|
7439
|
+
.dsm-workbuddy-context-budget:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px}
|
|
6809
7440
|
.dsm-workbuddy-model-capability-note{margin:0;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px}
|
|
6810
7441
|
/* Model probe (test button + result). The result line is its own row under the
|
|
6811
7442
|
meta line, because a cooldown sentence ("rate limited - the upstream gave no
|
|
@@ -6925,11 +7556,102 @@ window.__ModuleLoader__.load({
|
|
|
6925
7556
|
* viewport, which is where a full-screen overlay belongs. The table itself
|
|
6926
7557
|
* contains only the header and member rows — no fixed-position descendants. */
|
|
6927
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)}
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
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
|
+
}
|
|
6931
7634
|
.dsm-workbuddy-pool-row:first-child{border-top:0}
|
|
6932
|
-
.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}
|
|
6933
7655
|
/* WHERE THE LABELED COLUMN ACTUALLY STARTS (learned from dsh-connect-trae, which
|
|
6934
7656
|
carries the same rule for the same reason).
|
|
6935
7657
|
*
|
|
@@ -6941,27 +7663,34 @@ window.__ModuleLoader__.load({
|
|
|
6941
7663
|
* 38px is the checkbox (13px) plus the cell's 8px gap plus the vertical
|
|
6942
7664
|
* centring slack of an 18px glyph in a 20px label; rounded to the value that
|
|
6943
7665
|
* measured flush rather than derived, because the two cells do not share a
|
|
6944
|
-
* box. The
|
|
6945
|
-
*
|
|
6946
|
-
.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}
|
|
6947
7669
|
.dsm-workbuddy-pool-row-current{background:rgba(86,134,254,.07)}
|
|
6948
7670
|
/* The serving row, made findable at a glance: a left accent bar plus the tint.
|
|
6949
7671
|
The bar is what distinguishes it in a long table, where a 7%-opacity wash
|
|
6950
7672
|
alone reads as an alternating-row stripe. */
|
|
6951
7673
|
.dsm-workbuddy-pool-row-current{box-shadow:inset 3px 0 0 var(--dsw-alias-brand-primary,#5686fe)}
|
|
6952
|
-
.dsm-workbuddy-pool-account{display:flex;align-items:center;gap:8px;min-width:0}
|
|
6953
|
-
.
|
|
6954
|
-
|
|
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%}
|
|
6955
7684
|
.dsm-workbuddy-pool-account-name span{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#999)}
|
|
6956
7685
|
/* Declared AFTER the blanket span rule so it wins: the badge must not inherit
|
|
6957
7686
|
the muted 11px tertiary treatment the membership line uses. */
|
|
6958
|
-
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:
|
|
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}
|
|
6959
7688
|
/* Manual-priority chrome (order badge + up/down arrows). The rank badge is a SPAN,
|
|
6960
7689
|
not a button: it only DESCRIBES the current order and must not read as a
|
|
6961
7690
|
control (nor join the row's button list). The solid vs dashed distinction is
|
|
6962
7691
|
load-bearing — a numeric rank must NOT appear when the credit policy still
|
|
6963
7692
|
decides the order, so the -auto modifier is the dashed/grey state. */
|
|
6964
|
-
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{display:flex;align-items:center;gap:6px;
|
|
7693
|
+
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
|
6965
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}
|
|
6966
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)}
|
|
6967
7696
|
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-move{display:inline-flex;align-items:center;gap:2px}
|
|
@@ -6998,10 +7727,42 @@ window.__ModuleLoader__.load({
|
|
|
6998
7727
|
/* The "why expiring credits win" note is the sentence users push back on, so
|
|
6999
7728
|
it is tinted rather than buried in the same grey as the eight rules. */
|
|
7000
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)}
|
|
7001
|
-
.
|
|
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}
|
|
7002
7764
|
.dsm-workbuddy-pool-credits b{color:var(--dsw-alias-label-primary,#e6e6e6);font-weight:600}
|
|
7003
7765
|
.dsm-workbuddy-pool-soon{font-size:11px;line-height:16px;color:var(--dsw-alias-state-warn-primary,#f59e0b)}
|
|
7004
|
-
.dsm-workbuddy-pool-soon-plain{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#999)}
|
|
7005
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. */
|
|
7006
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}
|
|
7007
7768
|
/* One entry = text + pill, and the text wraps rather than being cut.
|
|
@@ -7111,8 +7872,33 @@ window.__ModuleLoader__.load({
|
|
|
7111
7872
|
box-shadow:none;
|
|
7112
7873
|
}
|
|
7113
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}
|
|
7114
|
-
.
|
|
7115
|
-
|
|
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. */
|
|
7116
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}
|
|
7117
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}
|
|
7118
7904
|
.dsm-workbuddy-pool-prov-live{background:rgba(245,158,11,.16);color:var(--dsw-alias-state-warn-primary,#f59e0b)}
|
|
@@ -7138,6 +7924,15 @@ window.__ModuleLoader__.load({
|
|
|
7138
7924
|
.dsm-workbuddy-pool-check input{margin:0;cursor:pointer;accent-color:var(--dsw-alias-brand-primary,#5686fe)}
|
|
7139
7925
|
.dsm-workbuddy-pool-check input:disabled{cursor:default;opacity:.5}
|
|
7140
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}
|
|
7141
7936
|
.dsm-workbuddy-pool-unknown{color:var(--dsw-alias-label-dimmed,#9aa0a6)}
|
|
7142
7937
|
.dsm-workbuddy-pool-not-member{color:var(--dsw-alias-label-dimmed,#9aa0a6)}
|
|
7143
7938
|
/* A section break, not just a gap: below this line the page stops showing what
|
|
@@ -7257,13 +8052,28 @@ window.__ModuleLoader__.load({
|
|
|
7257
8052
|
.dsm-workbuddy-pool-log-error{color:var(--dsw-alias-state-error-primary,#ef4444)}
|
|
7258
8053
|
.dsm-workbuddy-pool-log-info{color:var(--dsw-alias-label-secondary,#c6c9d0)}
|
|
7259
8054
|
.dsm-workbuddy-pool-log-empty{padding:14px;font-size:12px;color:var(--dsw-alias-label-tertiary,#999)}
|
|
7260
|
-
/* Per-row actions (test / remove),
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
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%}
|
|
7267
8077
|
.dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{white-space:nowrap}
|
|
7268
8078
|
.dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{padding:2px 10px;font-size:12px}
|
|
7269
8079
|
/* The picker's cap, narrowed on a phone. NOTE this @media measures the VIEWPORT,
|
|
@@ -7281,75 +8091,45 @@ window.__ModuleLoader__.load({
|
|
|
7281
8091
|
/* The settings rows (target model, probe size) are flex with a content column
|
|
7282
8092
|
* that grows and a control that does not. In the Settings panel the control was
|
|
7283
8093
|
* squeezed to a sliver: max-width:260px caps it but nothing gives it a floor,
|
|
7284
|
-
* and the copy beside it takes everything else. Stacking
|
|
7285
|
-
*
|
|
7286
|
-
*
|
|
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. */
|
|
7287
8100
|
@container (max-width:620px){.dsm-workbuddy-pool-set{flex-direction:column;align-items:stretch;gap:8px}
|
|
7288
8101
|
.dsm-workbuddy-pool-set-ctl{flex:1 1 auto;justify-content:flex-start}
|
|
7289
8102
|
.dsm-workbuddy-pool-select{max-width:none;width:100%}}
|
|
7290
|
-
/* THE
|
|
8103
|
+
/* THE ONE THING THAT STILL DEPENDS ON WIDTH — and it is a DETAIL, not a shape.
|
|
7291
8104
|
*
|
|
7292
|
-
*
|
|
7293
|
-
*
|
|
7294
|
-
*
|
|
7295
|
-
*
|
|
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.
|
|
7296
8110
|
*
|
|
7297
|
-
*
|
|
7298
|
-
*
|
|
7299
|
-
*
|
|
7300
|
-
*
|
|
7301
|
-
*
|
|
7302
|
-
*
|
|
7303
|
-
* 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.
|
|
7304
8121
|
*
|
|
7305
|
-
*
|
|
7306
|
-
*
|
|
7307
|
-
*
|
|
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). */
|
|
7308
8129
|
@container (max-width:700px){
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
actions own a full line each (they are the identify-it and act-on-it ends),
|
|
7313
|
-
while the three facts in between share the middle line and wrap among
|
|
7314
|
-
themselves only when they genuinely do not fit. */
|
|
7315
|
-
.dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:10px 12px}
|
|
7316
|
-
.dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline}
|
|
7317
|
-
/* The column headers describe tracks that no longer exist. */
|
|
7318
|
-
.dsm-workbuddy-pool-row-head{display:none}
|
|
7319
|
-
.dsm-workbuddy-pool-account{flex:1 1 100%;align-items:center}
|
|
7320
|
-
/* THE ACCOUNT CELL'S OWN COLUMN, collapsed the same way — and this is the
|
|
7321
|
-
rule that actually decides the row height (learned from dsh-connect-trae
|
|
7322
|
-
4.9.0, which shipped the outer half of this fix and measured 138px rows).
|
|
7323
|
-
*
|
|
7324
|
-
* Collapsing only .dsm-workbuddy-pool-account above is NOT enough: that is
|
|
7325
|
-
* just a flex wrapper. The cells that stack are one level deeper, inside
|
|
7326
|
-
* .dsm-workbuddy-pool-account-name, which declares flex-direction:column so
|
|
7327
|
-
* that the name, the rank badge with its ↑/↓ arrows, the 「当前使用」 pill and
|
|
7328
|
-
* the 「测试于 …」 line read as a small card when the table is WIDE.
|
|
7329
|
-
*
|
|
7330
|
-
* In the Settings column they have no reason to keep one line each: measured
|
|
7331
|
-
* at 549px, that block was 81px of the row's 157px — five lines (name, rank +
|
|
7332
|
-
* arrows, current badge, tested-at), while the three facts beside it sat on
|
|
7333
|
-
* one 18px line. The row therefore read as "one tall account block and three
|
|
7334
|
-
* strays", and every extra row cost the reader two thirds of a screen.
|
|
7335
|
-
*
|
|
7336
|
-
* Read as a sentence it is one line — 「用户7520607992 · 第 1 位 ↑↓ · 当前使用 ·
|
|
7337
|
-
* 测试于 11/06, 03:57」 — so it wraps among itself instead of stacking. The
|
|
7338
|
-
* margins the wide form needs (2px above the badge, 2px above the current pill)
|
|
7339
|
-
* go away with the stacking: in a wrapped row they become uneven leading. */
|
|
7340
|
-
.dsm-workbuddy-pool-account-name{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7341
|
-
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{margin-top:0}
|
|
7342
|
-
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:center;margin-top:0}
|
|
7343
|
-
/* The name still has to be allowed to SHRINK. The <b> carries nowrap + ellipsis,
|
|
7344
|
-
whose whole point is that a long account name ends in "…" rather than
|
|
7345
|
-
pushing the line — but as a flex item it defaults to min-width:auto, i.e.
|
|
7346
|
-
its content width, and then the ellipsis can never engage. */
|
|
7347
|
-
.dsm-workbuddy-pool-account-name b{min-width:0;max-width:100%}
|
|
7348
|
-
/* The three middle facts, laid out as one line of the same sentence. */
|
|
7349
|
-
.dsm-workbuddy-pool-credits{flex:0 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7350
|
-
.dsm-workbuddy-pool-probe{flex:1 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7351
|
-
.dsm-workbuddy-pool-checkin{flex:none}
|
|
7352
|
-
.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}
|
|
7353
8133
|
}
|
|
7354
8134
|
|
|
7355
8135
|
/* ISSUE #198, the same breakpoint the pool row already uses. On a phone the model
|
|
@@ -7357,7 +8137,7 @@ window.__ModuleLoader__.load({
|
|
|
7357
8137
|
wrapped two-tier group reads as a stray fragment under the buttons, and the tier
|
|
7358
8138
|
the user is trying to find — the native window — is the last label in the group,
|
|
7359
8139
|
so the line has to start at the left to have room to end at all. */
|
|
7360
|
-
|
|
8140
|
+
|
|
7361
8141
|
/* Pool switch, namespaced under .dsm-workbuddy-pool so it cannot collide with host styles. */
|
|
7362
8142
|
.dsm-workbuddy-pool .sw{position:relative;display:inline-block;width:38px;height:22px;flex:none;cursor:pointer}
|
|
7363
8143
|
.dsm-workbuddy-pool .sw input{position:absolute;opacity:0;width:0;height:0}
|
|
@@ -7650,7 +8430,7 @@ window.__ModuleLoader__.load({
|
|
|
7650
8430
|
border:1px solid var(--dsw-alias-border-l2,#3a3d45);
|
|
7651
8431
|
}
|
|
7652
8432
|
|
|
7653
|
-
|
|
8433
|
+
` + seriesLayoutCss("workbuddy");
|
|
7654
8434
|
/**
|
|
7655
8435
|
* Composer credit readout styles, injected by the readout component itself.
|
|
7656
8436
|
*
|
|
@@ -8629,6 +9409,15 @@ window.__ModuleLoader__.load({
|
|
|
8629
9409
|
*/
|
|
8630
9410
|
const [togglingCredits, setTogglingCredits] = (0, react.useState)(void 0);
|
|
8631
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
|
+
/**
|
|
8632
9421
|
* Which video-model pin is being written right now: the tag string, or
|
|
8633
9422
|
* undefined.
|
|
8634
9423
|
*
|
|
@@ -8695,6 +9484,8 @@ window.__ModuleLoader__.load({
|
|
|
8695
9484
|
const [sessionTitleBusy, setSessionTitleBusy] = (0, react.useState)(false);
|
|
8696
9485
|
const [channelRejectContinueOn, setChannelRejectContinueOn] = (0, react.useState)(void 0);
|
|
8697
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);
|
|
8698
9489
|
/**
|
|
8699
9490
|
* Probe results, keyed by region then model id.
|
|
8700
9491
|
*
|
|
@@ -9085,6 +9876,20 @@ window.__ModuleLoader__.load({
|
|
|
9085
9876
|
return regionCreditsShownOf(settingsScope?.getSnapshot().value, item);
|
|
9086
9877
|
};
|
|
9087
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
|
+
/**
|
|
9088
9893
|
* Whether the model may call the image tool in this region.
|
|
9089
9894
|
*
|
|
9090
9895
|
* Read off the Host's answer first, like {@link creditsShownOn} and for the
|
|
@@ -9199,6 +10004,19 @@ window.__ModuleLoader__.load({
|
|
|
9199
10004
|
if (mounted.current) setTogglingCredits(void 0);
|
|
9200
10005
|
}
|
|
9201
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
|
+
};
|
|
9202
10020
|
const toggleCredits = async (item, shown) => {
|
|
9203
10021
|
if (settingsScope === void 0) return;
|
|
9204
10022
|
setTogglingCredits(item);
|
|
@@ -9318,6 +10136,17 @@ window.__ModuleLoader__.load({
|
|
|
9318
10136
|
};
|
|
9319
10137
|
};
|
|
9320
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
|
+
/**
|
|
9321
10150
|
* Flip one upstream-identity switch.
|
|
9322
10151
|
*
|
|
9323
10152
|
* No `refreshUsage` afterwards, unlike the CLI switch: these change the shape
|
|
@@ -9327,8 +10156,8 @@ window.__ModuleLoader__.load({
|
|
|
9327
10156
|
*/
|
|
9328
10157
|
const toggleUpstreamSwitch = async (field, enabled) => {
|
|
9329
10158
|
if (settingsScope === void 0) return;
|
|
9330
|
-
const setBusy = field === "usageIdentity" ? setUsageIdentityBusy : field === "keepPromptLast" ? setKeepPromptLastBusy : field === "sessionTitle" ? setSessionTitleBusy : setChannelRejectContinueBusy;
|
|
9331
|
-
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;
|
|
9332
10161
|
setBusy(true);
|
|
9333
10162
|
try {
|
|
9334
10163
|
await writeUpstreamSwitch(settingsScope, field, field === "sessionTitle" ? {
|
|
@@ -9960,16 +10789,6 @@ window.__ModuleLoader__.load({
|
|
|
9960
10789
|
const sweepTpsEnabledModels = () => {
|
|
9961
10790
|
measureTpsFor(visibleModels.filter((model) => activeEnabledIds.has(model.id)).map((model) => model.id));
|
|
9962
10791
|
};
|
|
9963
|
-
/**
|
|
9964
|
-
* Sweep EVERY model in the region's live catalog, enabled or not.
|
|
9965
|
-
*
|
|
9966
|
-
* Deliberately the whole VISIBLE catalog and nothing else: those are the ids
|
|
9967
|
-
* the host can validate against its own catalog, so this cannot spend credit
|
|
9968
|
-
* on an id that only exists in a config file.
|
|
9969
|
-
*/
|
|
9970
|
-
const sweepAllModels = () => {
|
|
9971
|
-
sweepModels(visibleModels.map((model) => model.id));
|
|
9972
|
-
};
|
|
9973
10792
|
const saveModels = async () => {
|
|
9974
10793
|
if (settingsScope === void 0) return;
|
|
9975
10794
|
if (status.status !== "signed-in") return;
|
|
@@ -10434,25 +11253,31 @@ window.__ModuleLoader__.load({
|
|
|
10434
11253
|
}) : null
|
|
10435
11254
|
]
|
|
10436
11255
|
});
|
|
10437
|
-
const sidebarPanelPreference = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
10438
|
-
className: "dsm-workbuddy-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
10454
|
-
className: "dsm-workbuddy-pref-
|
|
10455
|
-
children:
|
|
11256
|
+
const sidebarPanelPreference = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11257
|
+
className: "dsm-workbuddy-prefs",
|
|
11258
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11259
|
+
className: "dsm-workbuddy-pref-hint",
|
|
11260
|
+
children: t("row.sidebarPanelLead")
|
|
11261
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11262
|
+
className: "dsm-workbuddy-pref",
|
|
11263
|
+
title: t("row.sidebarPanelHint"),
|
|
11264
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11265
|
+
type: "checkbox",
|
|
11266
|
+
className: "dsm-workbuddy-sidebar-panel-check",
|
|
11267
|
+
checked: sidebarPanelSwitchedOn(),
|
|
11268
|
+
disabled: !canWrite || saving || poolBusy || sidebarPanelBusy,
|
|
11269
|
+
onChange: (event) => {
|
|
11270
|
+
toggleSidebarPanel(event.target.checked);
|
|
11271
|
+
}
|
|
11272
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11273
|
+
className: "dsm-workbuddy-pref-copy",
|
|
11274
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11275
|
+
className: "dsm-workbuddy-pref-label",
|
|
11276
|
+
children: t("row.sidebarPanelLabel")
|
|
11277
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11278
|
+
className: "dsm-workbuddy-pref-hint",
|
|
11279
|
+
children: t("row.sidebarPanelHint")
|
|
11280
|
+
})]
|
|
10456
11281
|
})]
|
|
10457
11282
|
})]
|
|
10458
11283
|
});
|
|
@@ -10676,9 +11501,12 @@ window.__ModuleLoader__.load({
|
|
|
10676
11501
|
* to be exactly 3, so an unvalidated free-text field here would be a second way
|
|
10677
11502
|
* to get it wrong.
|
|
10678
11503
|
*/
|
|
10679
|
-
const channelRejectContinuePreference = /* @__PURE__ */ (0, react_jsx_runtime.
|
|
11504
|
+
const channelRejectContinuePreference = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10680
11505
|
className: "dsm-workbuddy-prefs",
|
|
10681
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
11506
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11507
|
+
className: "dsm-workbuddy-pref-hint",
|
|
11508
|
+
children: t("row.channelRejectHint")
|
|
11509
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10682
11510
|
className: "dsm-workbuddy-pref dsm-workbuddy-upstream-pref",
|
|
10683
11511
|
title: t("row.channelRejectContinueHint"),
|
|
10684
11512
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -10714,11 +11542,51 @@ window.__ModuleLoader__.load({
|
|
|
10714
11542
|
}) : null
|
|
10715
11543
|
]
|
|
10716
11544
|
})]
|
|
10717
|
-
})
|
|
11545
|
+
})]
|
|
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
|
+
})]
|
|
10718
11582
|
});
|
|
10719
11583
|
const creditPreferences = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10720
11584
|
className: "dsm-workbuddy-prefs",
|
|
10721
11585
|
children: [
|
|
11586
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11587
|
+
className: "dsm-workbuddy-pref-hint",
|
|
11588
|
+
children: t("row.modelToolsHint")
|
|
11589
|
+
}),
|
|
10722
11590
|
cliBridgePreference,
|
|
10723
11591
|
cliBridgeSwitchedOn() ? cliBridgePickers : null,
|
|
10724
11592
|
imageToolPreference,
|
|
@@ -10747,6 +11615,28 @@ window.__ModuleLoader__.load({
|
|
|
10747
11615
|
})]
|
|
10748
11616
|
})]
|
|
10749
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
|
+
}),
|
|
10750
11640
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
10751
11641
|
className: "dsm-workbuddy-pref dsm-workbuddy-pref-indent",
|
|
10752
11642
|
title: t("row.creditPositionHint"),
|
|
@@ -10797,11 +11687,7 @@ window.__ModuleLoader__.load({
|
|
|
10797
11687
|
})
|
|
10798
11688
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("nav.back") })]
|
|
10799
11689
|
}) : null,
|
|
10800
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
10801
|
-
className: "dsm-workbuddy-page-icon",
|
|
10802
|
-
src: WORKBUDDY_PLUGIN_ICON,
|
|
10803
|
-
alt: ""
|
|
10804
|
-
}),
|
|
11690
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginIcon, { className: "dsm-workbuddy-page-icon" }),
|
|
10805
11691
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10806
11692
|
className: "dsm-workbuddy-page-title",
|
|
10807
11693
|
children: title
|
|
@@ -10860,10 +11746,6 @@ window.__ModuleLoader__.load({
|
|
|
10860
11746
|
className: "dsm-workbuddy-models-summary dsm-workbuddy-tab-hint",
|
|
10861
11747
|
children: t("row.tabHint")
|
|
10862
11748
|
}),
|
|
10863
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10864
|
-
className: "dsm-workbuddy-models-summary dsm-workbuddy-free-quota-warn",
|
|
10865
|
-
children: t("row.tabFreeQuotaWarn")
|
|
10866
|
-
}),
|
|
10867
11749
|
signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10868
11750
|
className: "dsm-workbuddy-panels",
|
|
10869
11751
|
role: "tablist",
|
|
@@ -11033,7 +11915,7 @@ window.__ModuleLoader__.load({
|
|
|
11033
11915
|
children: [
|
|
11034
11916
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11035
11917
|
className: "dsm-workbuddy-models-head",
|
|
11036
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
11918
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11037
11919
|
className: "dsm-workbuddy-models-title-row",
|
|
11038
11920
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h3", {
|
|
11039
11921
|
className: "dsm-workbuddy-models-title",
|
|
@@ -11042,10 +11924,7 @@ window.__ModuleLoader__.load({
|
|
|
11042
11924
|
children: t("row.modelsDirty")
|
|
11043
11925
|
}) : null]
|
|
11044
11926
|
})
|
|
11045
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
11046
|
-
className: "dsm-workbuddy-models-summary",
|
|
11047
|
-
children: t("row.modelsSummary", { count: activeEnabledIds.size })
|
|
11048
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11927
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11049
11928
|
className: "dsm-workbuddy-models-head-actions",
|
|
11050
11929
|
children: [
|
|
11051
11930
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -11068,17 +11947,6 @@ window.__ModuleLoader__.load({
|
|
|
11068
11947
|
total: sweeping.total
|
|
11069
11948
|
})
|
|
11070
11949
|
}),
|
|
11071
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11072
|
-
type: "button",
|
|
11073
|
-
className: "dsm-btn dsm-btn-outline dsm-workbuddy-models-sweep",
|
|
11074
|
-
disabled: busy || sweeping !== void 0 || visibleModels.length === 0,
|
|
11075
|
-
title: t("row.modelsTestAllHint"),
|
|
11076
|
-
onClick: sweepAllModels,
|
|
11077
|
-
children: sweeping === void 0 ? t("row.modelsTestAll") : t("row.modelsTesting", {
|
|
11078
|
-
done: sweeping.done,
|
|
11079
|
-
total: sweeping.total
|
|
11080
|
-
})
|
|
11081
|
-
}),
|
|
11082
11950
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11083
11951
|
type: "button",
|
|
11084
11952
|
className: "dsm-btn dsm-btn-outline dsm-workbuddy-models-sweep",
|
|
@@ -11110,128 +11978,93 @@ window.__ModuleLoader__.load({
|
|
|
11110
11978
|
children: [
|
|
11111
11979
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11112
11980
|
className: "dsm-workbuddy-model-head",
|
|
11113
|
-
children: [
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
className: "dsm-workbuddy-model-copy",
|
|
11125
|
-
children: [
|
|
11126
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11127
|
-
className: "dsm-workbuddy-model-name",
|
|
11128
|
-
children: [model.name, effectiveRate(model) === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11129
|
-
className: "dsm-workbuddy-model-name-rate",
|
|
11130
|
-
children: ["x", effectiveRate(model).toFixed(2)]
|
|
11131
|
-
})]
|
|
11132
|
-
}),
|
|
11133
|
-
promoChip(model),
|
|
11134
|
-
busyIcon(busyLevels[model.id], uiLanguage())
|
|
11135
|
-
]
|
|
11136
|
-
})]
|
|
11137
|
-
}),
|
|
11138
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11139
|
-
className: "dsm-workbuddy-model-image",
|
|
11140
|
-
title: imageCheckboxHint(model, t),
|
|
11141
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11142
|
-
type: "checkbox",
|
|
11143
|
-
checked: activeImageIds.has(model.id),
|
|
11144
|
-
disabled: !canWrite || saving,
|
|
11145
|
-
onChange: () => {
|
|
11146
|
-
toggleImage(model.id);
|
|
11147
|
-
}
|
|
11148
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelImage") })]
|
|
11149
|
-
}),
|
|
11150
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11151
|
-
className: `dsm-workbuddy-model-off${offBlocked(model) ? " dsm-workbuddy-model-off-blocked" : ""}`,
|
|
11152
|
-
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",
|
|
11153
11992
|
children: [
|
|
11154
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
}
|
|
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
|
+
})]
|
|
11161
11999
|
}),
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
className: "dsm-workbuddy-model-off-flag",
|
|
11165
|
-
children: t("row.modelOffRefused")
|
|
11166
|
-
}) : null
|
|
12000
|
+
promoChip(model),
|
|
12001
|
+
busyIcon(busyLevels[model.id], uiLanguage())
|
|
11167
12002
|
]
|
|
11168
|
-
})
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
onChange: () => {
|
|
11179
|
-
setContextBudget(model.id, 2e5);
|
|
11180
|
-
}
|
|
11181
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "200K" })] }) : null,
|
|
11182
|
-
model.nativeContextWindow > 5e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11183
|
-
type: "radio",
|
|
11184
|
-
name: `context-${model.id}`,
|
|
11185
|
-
checked: effectiveContextBudget(model.nativeContextWindow, activeContextBudgets[model.id]) === 5e5,
|
|
11186
|
-
disabled: !canWrite || saving,
|
|
11187
|
-
onChange: () => {
|
|
11188
|
-
setContextBudget(model.id, 5e5);
|
|
11189
|
-
}
|
|
11190
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "500K" })] }) : null,
|
|
11191
|
-
model.nativeContextWindow > 2e5 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11192
|
-
type: "radio",
|
|
11193
|
-
name: `context-${model.id}`,
|
|
11194
|
-
checked: effectiveContextBudget(model.nativeContextWindow, activeContextBudgets[model.id]) === model.nativeContextWindow,
|
|
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", {
|
|
12011
|
+
type: "checkbox",
|
|
12012
|
+
checked: activeImageIds.has(model.id),
|
|
11195
12013
|
disabled: !canWrite || saving,
|
|
11196
12014
|
onChange: () => {
|
|
11197
|
-
|
|
12015
|
+
toggleImage(model.id);
|
|
11198
12016
|
}
|
|
11199
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children:
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
}),
|
|
11220
|
-
|
|
11221
|
-
className: "dsm-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
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);
|
|
11226
12046
|
},
|
|
11227
|
-
children:
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
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
|
+
})]
|
|
11231
12064
|
}),
|
|
11232
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
12065
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11233
12066
|
className: "dsm-workbuddy-model-details",
|
|
11234
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
12067
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11235
12068
|
className: "dsm-workbuddy-model-meta",
|
|
11236
12069
|
children: [
|
|
11237
12070
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("row.modelContext", { context: formatCapacity(model.nativeContextWindow, t("row.modelUnknown")) }) }),
|
|
@@ -11265,7 +12098,28 @@ window.__ModuleLoader__.load({
|
|
|
11265
12098
|
});
|
|
11266
12099
|
})()
|
|
11267
12100
|
]
|
|
11268
|
-
})
|
|
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
|
+
})]
|
|
11269
12123
|
}),
|
|
11270
12124
|
(() => {
|
|
11271
12125
|
const result = probes[activeRegion]?.[model.id];
|
|
@@ -11353,7 +12207,15 @@ window.__ModuleLoader__.load({
|
|
|
11353
12207
|
creditPreferences,
|
|
11354
12208
|
upstreamSwitches,
|
|
11355
12209
|
channelRejectContinuePreference,
|
|
11356
|
-
|
|
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
|
+
})
|
|
11357
12219
|
]
|
|
11358
12220
|
}),
|
|
11359
12221
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -11539,6 +12401,14 @@ window.__ModuleLoader__.load({
|
|
|
11539
12401
|
});
|
|
11540
12402
|
if (pageSurface || settingsSurface) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11541
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
|
+
},
|
|
11542
12412
|
children: [pageHead, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11543
12413
|
className: "dsm-workbuddy-page-body",
|
|
11544
12414
|
children: cardBody
|
|
@@ -11555,11 +12425,7 @@ window.__ModuleLoader__.load({
|
|
|
11555
12425
|
setCardOpen(!cardOpen);
|
|
11556
12426
|
},
|
|
11557
12427
|
children: [
|
|
11558
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
11559
|
-
className: "dsm-plugin-card-icon",
|
|
11560
|
-
src: WORKBUDDY_PLUGIN_ICON,
|
|
11561
|
-
alt: ""
|
|
11562
|
-
}),
|
|
12428
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginIcon, { className: "dsm-plugin-card-icon" }),
|
|
11563
12429
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11564
12430
|
className: "dsm-plugin-card-head",
|
|
11565
12431
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -11876,6 +12742,22 @@ window.__ModuleLoader__.load({
|
|
|
11876
12742
|
return typeof value === "boolean" ? value : void 0;
|
|
11877
12743
|
}
|
|
11878
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
|
+
/**
|
|
11879
12761
|
* A same-day instant, as the READER's locale writes it.
|
|
11880
12762
|
*
|
|
11881
12763
|
* The locale is `undefined` — the reader's, not a fixed one — so an English UI
|
|
@@ -12313,9 +13195,10 @@ window.__ModuleLoader__.load({
|
|
|
12313
13195
|
const signedOut = usage !== void 0 && usage.status === "signed-out";
|
|
12314
13196
|
const valueText = total === void 0 ? "—" : formatCredits(total);
|
|
12315
13197
|
const label = t(activeRegion === "cn" ? "composer.pointsCn" : "composer.pointsGlobal");
|
|
12316
|
-
const
|
|
13198
|
+
const newModelsShown = hostNewModelsShownOf(usage);
|
|
13199
|
+
const newModelNames = (newModelsShown ? newModelIdsOf(usage) : []).map((id) => modelNameOf(signedIn?.models ?? [], id));
|
|
12317
13200
|
const newModelTooltip = newModelNames.length === 0 ? void 0 : `${t("composer.newModelsTitle")}${newModelNames.slice(0, 3).join(t("composer.newModelsSep"))}${newModelNames.length > 3 ? "…" : ""}`;
|
|
12318
|
-
const rosterSeenNote = signedIn?.rosterSeenVersionNote;
|
|
13201
|
+
const rosterSeenNote = newModelsShown ? signedIn?.rosterSeenVersionNote : void 0;
|
|
12319
13202
|
/**
|
|
12320
13203
|
* The table's rows: every account in this region, with its balance.
|
|
12321
13204
|
*
|
|
@@ -12735,16 +13618,25 @@ window.__ModuleLoader__.load({
|
|
|
12735
13618
|
* the text and render the addition beside it, so this component returns the
|
|
12736
13619
|
* name first and never replaces it.
|
|
12737
13620
|
*
|
|
12738
|
-
* FOR A PROVIDER THAT IS NOT OURS IT RENDERS THE
|
|
12739
|
-
*
|
|
12740
|
-
*
|
|
12741
|
-
*
|
|
12742
|
-
*
|
|
12743
|
-
* made the lost-decoration cost look
|
|
12744
|
-
* mis-description looks like from the outside
|
|
12745
|
-
* disappears on ITS rows while this plugin holds the
|
|
12746
|
-
* would not free the cell either — occupancy is decided
|
|
12747
|
-
* 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`.
|
|
12748
13640
|
*/
|
|
12749
13641
|
/** The provider ids this plugin registers, and the region each one serves. */
|
|
12750
13642
|
const PROVIDER_REGIONS = /* @__PURE__ */ new Map([["workbuddy", "cn"], ["workbuddy-global", "global"]]);
|
|
@@ -12782,6 +13674,7 @@ window.__ModuleLoader__.load({
|
|
|
12782
13674
|
});
|
|
12783
13675
|
if (!response.ok) return void 0;
|
|
12784
13676
|
const body = await response.json();
|
|
13677
|
+
const showNewModels = body.showNewModelsInMainUi === true;
|
|
12785
13678
|
const promos = {};
|
|
12786
13679
|
const rates = {};
|
|
12787
13680
|
for (const model of body.models ?? []) {
|
|
@@ -12792,7 +13685,7 @@ window.__ModuleLoader__.load({
|
|
|
12792
13685
|
levels: body.busyLevels ?? {},
|
|
12793
13686
|
promos,
|
|
12794
13687
|
rates,
|
|
12795
|
-
newModelIds: normalizeNewModelIds(body.newModelIds)
|
|
13688
|
+
newModelIds: showNewModels ? normalizeNewModelIds(body.newModelIds) : []
|
|
12796
13689
|
};
|
|
12797
13690
|
caches.set(region, {
|
|
12798
13691
|
snapshot,
|
|
@@ -12882,6 +13775,120 @@ window.__ModuleLoader__.load({
|
|
|
12882
13775
|
});
|
|
12883
13776
|
}
|
|
12884
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
|
+
/**
|
|
12885
13892
|
* The priority this plugin registers the model-label slot at.
|
|
12886
13893
|
*
|
|
12887
13894
|
* WHY A DISTINCT PRIORITY AT ALL. `conversation.input.model.label` is a
|
|
@@ -12901,24 +13908,72 @@ window.__ModuleLoader__.load({
|
|
|
12901
13908
|
* WHY NOT `-1`. That is `dsh-connect-qoder`'s slot priority, and two plugins on
|
|
12902
13909
|
* one priority collide for exactly the same reason `0` did.
|
|
12903
13910
|
*
|
|
12904
|
-
* WHY `-0.5`
|
|
12905
|
-
*
|
|
12906
|
-
*
|
|
12907
|
-
*
|
|
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.
|
|
12908
13962
|
*
|
|
12909
13963
|
* WHAT THIS PLUGIN DELIBERATELY DOES NOT DO. It does not read the slot ledger,
|
|
12910
13964
|
* does not look for another plugin's registration, and does not render another
|
|
12911
|
-
* plugin's component. Foreign rows get the plain catalog name
|
|
12912
|
-
* the
|
|
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
|
|
12913
13969
|
* project policy (`docs/DESIGN.md` §零) — and that policy is NOT stricter than
|
|
12914
13970
|
* the Host's own: the shipped `dsh-client-ui-deepseek-model-label-1017` README
|
|
12915
13971
|
* lists, under "Known Limitations and Deferred Work", that "another model-label
|
|
12916
13972
|
* plugin at the same priority conflicts; the two presentations do not compose
|
|
12917
13973
|
* automatically", and the remedy it documents is DISABLING it in the profile
|
|
12918
|
-
* patch — a configuration decision, not a runtime negotiation.
|
|
12919
|
-
*
|
|
12920
|
-
*
|
|
12921
|
-
* 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.
|
|
12922
13977
|
*
|
|
12923
13978
|
* WHY WINNING IS THE RIGHT SIDE OF THAT TRADE. 1017 is a TEMPORARY marker
|
|
12924
13979
|
* (its own package description: "Temporary 1017 release badge …"; its README
|
|
@@ -12932,22 +13987,29 @@ window.__ModuleLoader__.load({
|
|
|
12932
13987
|
* Exported so the test asserts against the value that actually ships rather
|
|
12933
13988
|
* than a copy of it.
|
|
12934
13989
|
*/
|
|
12935
|
-
const MODEL_LABEL_PRIORITY =
|
|
13990
|
+
const MODEL_LABEL_PRIORITY = -105;
|
|
12936
13991
|
/**
|
|
12937
13992
|
* The label for one model row in the host's picker.
|
|
12938
13993
|
*
|
|
12939
13994
|
* Self-contained by design: a model this plugin owns gets the full label, and
|
|
12940
|
-
* anything else gets the
|
|
12941
|
-
*
|
|
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`.
|
|
12942
13998
|
*
|
|
12943
13999
|
* @param props - The host's model identity and the placement of this label.
|
|
12944
|
-
* @returns The catalog name, the promotion chip when one holds,
|
|
12945
|
-
*
|
|
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.
|
|
12946
14002
|
*/
|
|
12947
14003
|
function WorkBuddyModelLabel(props) {
|
|
12948
14004
|
const { provider, model, placement } = props;
|
|
12949
14005
|
const region = regionOfProvider(provider.id);
|
|
12950
|
-
if (region === void 0)
|
|
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
|
+
}
|
|
12951
14013
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkBuddyModelLabelInner, {
|
|
12952
14014
|
modelId: model.id,
|
|
12953
14015
|
name: model.name,
|
|
@@ -13367,6 +14429,12 @@ window.__ModuleLoader__.load({
|
|
|
13367
14429
|
*/
|
|
13368
14430
|
const en = {
|
|
13369
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.",
|
|
13370
14438
|
"nav.back": "Back to conversation",
|
|
13371
14439
|
"row.title": "WorkBuddy credits & models (dsh-connect-workbuddy)",
|
|
13372
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.",
|
|
@@ -13447,7 +14515,6 @@ window.__ModuleLoader__.load({
|
|
|
13447
14515
|
"row.cardCrashed": "The configuration area failed to render.",
|
|
13448
14516
|
"row.cardCrashedHint": "The model provider itself is unaffected — chat and credits keep working. Quote the line above in a bug report.",
|
|
13449
14517
|
"row.modelsTitle": "Models",
|
|
13450
|
-
"row.modelsSummary": "{count} enabled",
|
|
13451
14518
|
"row.modelsDirty": "unsaved changes",
|
|
13452
14519
|
"row.modelsRefresh": "Refresh from WorkBuddy",
|
|
13453
14520
|
"row.modelsRefreshing": "Refreshing models…",
|
|
@@ -13476,12 +14543,9 @@ window.__ModuleLoader__.load({
|
|
|
13476
14543
|
"row.modelUnknown": "Unknown",
|
|
13477
14544
|
"row.modelCapabilityPending": "Only capabilities advertised by WorkBuddy are shown.",
|
|
13478
14545
|
"row.modelsTestEnabled": "Test enabled models",
|
|
13479
|
-
"row.modelsTestAll": "Test all models",
|
|
13480
14546
|
"row.modelsTesting": "Testing {done}/{total}…",
|
|
13481
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.",
|
|
13482
|
-
"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.",
|
|
13483
14548
|
"row.tpsSweepEnabled": "Measure speed (enabled)",
|
|
13484
|
-
"row.tpsSweepAll": "Measure speed (all)",
|
|
13485
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.",
|
|
13486
14550
|
"row.tpsTesting": "Measuring {done}/{total}…",
|
|
13487
14551
|
"row.tpsMeasure": "Speed",
|
|
@@ -13599,7 +14663,6 @@ window.__ModuleLoader__.load({
|
|
|
13599
14663
|
"row.poolLogBenefitFailed": "{accountName} claim failed: {message}",
|
|
13600
14664
|
"row.poolBenefitHint": "Claim it on the plans page: {url}",
|
|
13601
14665
|
"row.poolCreditSoon": "{count} expiring within 3 days",
|
|
13602
|
-
"row.poolCreditNearest": "Nearest package expires {at}",
|
|
13603
14666
|
"row.poolExcludedRateLimited": "Rate limited",
|
|
13604
14667
|
"row.poolExcludedModelBusy": "Model busy",
|
|
13605
14668
|
"row.poolExcludedOutOfCredit": "Out of credits",
|
|
@@ -13784,6 +14847,9 @@ window.__ModuleLoader__.load({
|
|
|
13784
14847
|
"sdk.dirHint": "Point this at the desktop app's native/turing-sdk folder, not the folder holding WorkBuddy.exe. Saving re-probes immediately; a wrong path turns the state above into \"not found\" with that path shown, never a silent fall back to discovery. WORKBUDDY_TURING_SDK_DIR still wins.",
|
|
13785
14848
|
"sdk.fallbackLabel": "Fall back to the virtual device when no real one is available",
|
|
13786
14849
|
"sdk.fallbackHint": "On: when the SDK is unavailable (no desktop app, wrong directory, no token) the plugin sends the salt-derived virtual device pair instead, and the tier shown changes to “Virtual” with it — it never claims to be real. Off: no device header is sent at all, which is what the Real tier did before this switch.",
|
|
14850
|
+
"row.modelToolsHint": "These three decide what the model may DO on this tab: which commands it can run, and whether it can spend credits generating images or video. Each takes effect on the click.",
|
|
14851
|
+
"row.channelRejectHint": "One switch, on its own because it is the only one here that spends a real request every time it fires. Read its description before turning it on.",
|
|
14852
|
+
"row.sidebarPanelLead": "Where the card itself appears. This one only affects navigation — it changes no request and spends nothing.",
|
|
13787
14853
|
"row.upstreamHint": "These change what the gateway sees, not which provider serves the call. All of them are sampled when the plugin mounts, so reload the plugin (or restart DSH) after changing one.",
|
|
13788
14854
|
"row.usageIdentityLabel": "Make the usage page record these calls like the official client",
|
|
13789
14855
|
"row.usageIdentityHint": "Adds the X-IDE-* headers (which fill the 使用端 column, otherwise blank) and sends conversation ids as 32-hex UUIDv7. Display alignment only: the User-Agent and the request body never change. Off by default because the evidence comes from a reporter, not from this plugin.",
|
|
@@ -13797,6 +14863,9 @@ window.__ModuleLoader__.load({
|
|
|
13797
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.",
|
|
13798
14864
|
"row.channelRejectContinueLimit": "Max consecutive sends:",
|
|
13799
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.",
|
|
13800
14869
|
"row.cliBridgeLabel": "Let the local CodeBuddy CLI do the work",
|
|
13801
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.",
|
|
13802
14871
|
"row.cnBaseLabel": "CN gateway host",
|
|
@@ -13854,6 +14923,9 @@ window.__ModuleLoader__.load({
|
|
|
13854
14923
|
"row.creditPositionHintInline": "Where the readout sits. \"composer toolbar\" is the default — the row with the model picker.",
|
|
13855
14924
|
"row.creditPositionDisabledHint": "Unavailable while the switch above is off: tick \"Show credits in the composer toolbar\" first.",
|
|
13856
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.",
|
|
13857
14929
|
"quotaNotice.fallbackHead": "The quota for this request is exhausted",
|
|
13858
14930
|
"quotaNotice.supplement": " (some models also have a daily limit that is unrelated to your credits)",
|
|
13859
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.",
|
|
@@ -13901,6 +14973,12 @@ window.__ModuleLoader__.load({
|
|
|
13901
14973
|
};
|
|
13902
14974
|
const zh = {
|
|
13903
14975
|
"nav.panel": "WorkBuddy",
|
|
14976
|
+
"row.iconStyleLead": "外观 —— 插件长什么样,不是它能做什么。",
|
|
14977
|
+
"row.iconStyleLabel": "图标样式",
|
|
14978
|
+
"row.iconStyleHint": "点一下立即应用到侧边栏、页头与面板。默认是本插件自己的图标;另一个皮肤跟随主题的文字颜色。选择只存在当前浏览器里。",
|
|
14979
|
+
"row.iconStyleClaude": "Claude 风格",
|
|
14980
|
+
"row.iconStyleOriginal": "默认图标",
|
|
14981
|
+
"row.iconStyleSaveFailed": "图标选择保存失败,请检查浏览器存储权限。",
|
|
13904
14982
|
"nav.back": "返回会话",
|
|
13905
14983
|
"row.title": "接入使用 WorkBuddy 积分与模型(dsh-connect-workbuddy)",
|
|
13906
14984
|
"row.desc": "在 DSH 中使用 WorkBuddy 模型:每次刷新都按上游目录读取每个模型的积分倍率,图片输入可逐模型开关,多个账号可切换或由账号池自动换号,每日签到与剩余积分一键可查。国内版与国际版是两个独立供应商,各有自己的账号,可同时使用。",
|
|
@@ -13981,7 +15059,6 @@ window.__ModuleLoader__.load({
|
|
|
13981
15059
|
"row.cardCrashed": "配置区渲染失败。",
|
|
13982
15060
|
"row.cardCrashedHint": "模型服务本身未受影响,对话与积分仍可用。反馈问题时请附上上面这行。",
|
|
13983
15061
|
"row.modelsTitle": "模型",
|
|
13984
|
-
"row.modelsSummary": "已启用 {count} 个",
|
|
13985
15062
|
"row.modelsDirty": "有未保存的修改",
|
|
13986
15063
|
"row.modelsRefresh": "从 WorkBuddy 刷新",
|
|
13987
15064
|
"row.modelsRefreshing": "正在刷新模型…",
|
|
@@ -14009,13 +15086,10 @@ window.__ModuleLoader__.load({
|
|
|
14009
15086
|
"row.modelEffortFollowNamed": "默认({effort})",
|
|
14010
15087
|
"row.modelUnknown": "未知",
|
|
14011
15088
|
"row.modelCapabilityPending": "仅展示 WorkBuddy 接口明确公布的模型能力。",
|
|
14012
|
-
"row.modelsTestEnabled": "
|
|
14013
|
-
"row.modelsTestAll": "一键测试所有模型",
|
|
15089
|
+
"row.modelsTestEnabled": "测试启用模型",
|
|
14014
15090
|
"row.modelsTesting": "测试中 {done}/{total}…",
|
|
14015
15091
|
"row.modelsTestEnabledHint": "逐个测试你**已启用**的模型,一个模型一次请求 —— 每次探测都发真实体积的请求,真花积分(默认 25000 token 体积下约 0.01/个)。每行的结果一出来就显示。凭据被拒时提前停止。",
|
|
14016
|
-
"row.
|
|
14017
|
-
"row.tpsSweepEnabled": "一键测速启用模型",
|
|
14018
|
-
"row.tpsSweepAll": "一键测速所有模型",
|
|
15092
|
+
"row.tpsSweepEnabled": "测速启用模型",
|
|
14019
15093
|
"row.tpsSweepEnabledHint": "测**已启用**模型的**输出速度**:每个模型跑 3 次取中位数。和上面的可用性探测不同,它只发一个极小的提示、要求返回 256 个输出 token —— 这个网关按**输入**计价,所以单模型成本低得多(实测 0.01–0.15 积分,可用性探测是 0.72)。速度之所以重要:DSH 会把模型当子代理并行派发,慢模型拖的是整个任务的实际耗时。",
|
|
14020
15094
|
"row.tpsTesting": "测速中 {done}/{total}…",
|
|
14021
15095
|
"row.tpsMeasure": "测速",
|
|
@@ -14133,7 +15207,6 @@ window.__ModuleLoader__.load({
|
|
|
14133
15207
|
"row.poolLogBenefitFailed": "{accountName} 领取失败:{message}",
|
|
14134
15208
|
"row.poolBenefitHint": "去套餐与积分页领取:{url}",
|
|
14135
15209
|
"row.poolCreditSoon": "{count} 积分 3 天内过期",
|
|
14136
|
-
"row.poolCreditNearest": "最近积分包 {at} 过期",
|
|
14137
15210
|
"row.poolExcludedRateLimited": "被限流",
|
|
14138
15211
|
"row.poolExcludedModelBusy": "模型繁忙",
|
|
14139
15212
|
"row.poolExcludedOutOfCredit": "积分耗尽",
|
|
@@ -14318,6 +15391,9 @@ window.__ModuleLoader__.load({
|
|
|
14318
15391
|
"sdk.dirHint": "填的是桌面端里 native/turing-sdk 那一层目录,不是 WorkBuddy.exe 所在目录。保存后会立刻重新检测;填错时上面的状态会变成「未找到」并带上这个路径,不会静默回退到自动查找。环境变量 WORKBUDDY_TURING_SDK_DIR 优先级更高。",
|
|
14319
15392
|
"sdk.fallbackLabel": "取不到真实设备时退回虚拟值",
|
|
14320
15393
|
"sdk.fallbackHint": "开启时:SDK 不可用(没装桌面端、目录填错、token 取不到)就改发按本机盐派生的虚拟设备对,档位显示也会跟着变成「虚拟值」——不静默冒充。关闭时:一个设备头都不发,那是「真实值」档原本的行为。",
|
|
15394
|
+
"row.modelToolsHint": "这三项决定模型在这个 tab 上能「做」什么:能跑哪些命令,以及能不能花积分生图、生视频。点一下即生效。",
|
|
15395
|
+
"row.channelRejectHint": "单独一项,因为这里是唯一「每触发一次就真花一次请求」的开关。开启前请读完它的说明。",
|
|
15396
|
+
"row.sidebarPanelLead": "卡片本身出现在哪。这一项只管导航,不改任何请求、不花任何额度。",
|
|
14321
15397
|
"row.upstreamHint": "这一组改的是网关看到什么,不是由哪个 provider 提供服务。四项都在插件挂载时采样,改完需重载插件或重启 DSH。",
|
|
14322
15398
|
"row.usageIdentityLabel": "让用量页把调用记成官方客户端的样子",
|
|
14323
15399
|
"row.usageIdentityHint": "补上 X-IDE-* 头(「使用端」那一列就不会空白),并把会话 id 改成 32 位十六进制 UUIDv7。只影响显示:User-Agent 与请求正文永不变。默认关闭——证据来自报告者,本插件未在真机复现。",
|
|
@@ -14331,6 +15407,9 @@ window.__ModuleLoader__.load({
|
|
|
14331
15407
|
"row.channelRejectContinueHint": "最后兜底,不是 11128 的修复。上游用 400 + code 11128(「被网关的渠道校验拦截」)拒绝时,这一轮就直接失败了:插件不会在原地重试,也不会换号——网关匹配的是消息内容,每个账号发出去都一样。固定 system 指纹每一轮逐字节相同,重发只会再付一次同一个 400;5.13.1 起由 `prepareChatBody` 按句改词处理。只有被拒内容刚好随轮次变化的窄情况才可能靠新回合碰过去。它会把下面这句作为新回合发出,每次真实消耗一次请求;默认只发 1 次、默认关闭;连续计数,成功一轮或你自己发一条消息即清零。子代理会话一律不碰,改完立即生效,不必重载插件。",
|
|
14332
15408
|
"row.channelRejectContinueLimit": "连续发送上限:",
|
|
14333
15409
|
"row.channelRejectContinueText": "发送的文本:",
|
|
15410
|
+
"row.dropAllThinkingLead": "思考剥离 —— 网关拒收我们发出去的内容时。",
|
|
15411
|
+
"row.dropAllThinkingLabel": "把历史思考从请求里剥掉(针对 11128)",
|
|
15412
|
+
"row.dropAllThinkingHint": "「被网关的渠道校验拦截」(400 + code 11128)的最后兜底,不是修复。网关会扫描每一份请求的文本,而本插件会把模型过去的思考作为 reasoning_content 发出去(thinking 块带 signature 时就会),所以历史思考也是被扫的内容之一。开启后请求里的 thinking 块会被全部移除——你的消息、工具调用和回答不受影响,但模型看不到自己之前的思考,而这个代价是真的(那是它的工作记忆,不是装饰)。默认关闭。适用情形:这次 11128 报出的那几个开头,能与该会话里的 reasoning 文本逐字对上——#213 里被证实的就是这种情况。改完下一轮生效,不必重载插件。",
|
|
14334
15413
|
"row.cliBridgeLabel": "允许调用本机 CodeBuddy CLI 干活",
|
|
14335
15414
|
"row.cliBridgeHint": "开启后多出 codebuddy_ask 工具与 /codebuddy 指令;每次调用花 CodeBuddy 配额。injectResult 只影响 /codebuddy:其结果回注会话,会话空闲时多花一次 DSH 回合;工具调用不读它。限流:每会话每小时 6 回合、每进程每小时 20 回合、同时只跑一个回合。默认关闭。",
|
|
14336
15415
|
"row.cnBaseLabel": "CN 网关主机",
|
|
@@ -14388,6 +15467,9 @@ window.__ModuleLoader__.load({
|
|
|
14388
15467
|
"row.creditPositionHintInline": "读数显示在哪里。「输入框工具栏」是默认位置,与模型选择同一行。",
|
|
14389
15468
|
"row.creditPositionDisabledHint": "主开关关闭时不可调整:先勾选上方「在输入框工具栏显示积分读数」。",
|
|
14390
15469
|
"row.showCreditsHintInline": "当前为本 tab 服务的那个账号的余额。点一下能看各账号明细,另外每 5 分钟自动刷新一次。",
|
|
15470
|
+
"row.showNewModels": "显示新出现的模型",
|
|
15471
|
+
"row.showNewModelsHint": "在积分读数旁多加一段「· N 新模型」,并在模型选择器里给这些行标一个「新」。这里的「新」指**本机首次记到这个模型 id**,与上游何时上架无关。默认关闭:全新安装时整个目录都算「新」,那个数字说明不了任何事。",
|
|
15472
|
+
"row.showNewModelsHintInline": "指本机首次见到,不是上游新上架。默认关闭——全新安装时整个目录都算新。",
|
|
14391
15473
|
"quotaNotice.fallbackHead": "当前请求的额度已用尽",
|
|
14392
15474
|
"quotaNotice.supplement": "(部分模型另有每日额度,与积分无关)",
|
|
14393
15475
|
"row.creditPositionHint": "积分显示在哪里。「输入框工具栏」是默认位置(与模型选择同一行)。如果装了别的插件后读数不显示,改成「输入框下方」—— 那是「轮次 / 步数 / token」统计所在的那一行。",
|
|
@@ -14436,23 +15518,77 @@ window.__ModuleLoader__.load({
|
|
|
14436
15518
|
//#endregion
|
|
14437
15519
|
//#region src/client/settings-jump.ts
|
|
14438
15520
|
/**
|
|
14439
|
-
*
|
|
14440
|
-
*
|
|
14441
|
-
* ##
|
|
14442
|
-
*
|
|
14443
|
-
* The
|
|
14444
|
-
*
|
|
14445
|
-
*
|
|
14446
|
-
*
|
|
14447
|
-
*
|
|
14448
|
-
*
|
|
14449
|
-
*
|
|
14450
|
-
*
|
|
14451
|
-
*
|
|
14452
|
-
*
|
|
14453
|
-
*
|
|
14454
|
-
*
|
|
14455
|
-
* ##
|
|
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.
|
|
14456
15592
|
*
|
|
14457
15593
|
* 1. click the shell's settings trigger (`aria-haspopup="dialog"` +
|
|
14458
15594
|
* `aria-expanded`) — unless the panel is already open, in which case
|
|
@@ -14461,22 +15597,12 @@ window.__ModuleLoader__.load({
|
|
|
14461
15597
|
* 2. wait for the panel to mount (it renders on demand into `body`);
|
|
14462
15598
|
* 3. find this plugin's nav row by its LABEL and click it.
|
|
14463
15599
|
*
|
|
14464
|
-
* ## Why the label and not the id
|
|
14465
|
-
*
|
|
14466
|
-
* The shell renders each nav row's `row.label` — an already-localized string —
|
|
14467
|
-
* and writes no `data-section-id` or similar stable anchor; `aria-current` only
|
|
14468
|
-
* appears on the row that is already selected. The label comes from this
|
|
14469
|
-
* plugin's own `section.label` (`t('nav.panel')`), so both languages live in
|
|
14470
|
-
* this repository and "the one we found" cannot drift from "the one we
|
|
14471
|
-
* registered".
|
|
14472
|
-
*
|
|
14473
15600
|
* ## Why it never throws
|
|
14474
15601
|
*
|
|
14475
|
-
* Every step
|
|
14476
|
-
*
|
|
14477
|
-
*
|
|
14478
|
-
*
|
|
14479
|
-
* 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.
|
|
14480
15606
|
*
|
|
14481
15607
|
* @module dsh-connect-workbuddy/client/settings-jump
|
|
14482
15608
|
*/
|
|
@@ -14490,6 +15616,8 @@ window.__ModuleLoader__.load({
|
|
|
14490
15616
|
const SETTINGS_PANEL_SELECTOR = "[data-shortcut-modal=\"settings\"]";
|
|
14491
15617
|
/** The sidebar's settings trigger: dialog semantics plus an expanded state. */
|
|
14492
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";
|
|
14493
15621
|
/**
|
|
14494
15622
|
* Budget for "panel mounted + nav row rendered".
|
|
14495
15623
|
*
|
|
@@ -14522,14 +15650,62 @@ window.__ModuleLoader__.load({
|
|
|
14522
15650
|
return buttonsIn(scope).find((button) => (button.textContent ?? "").trim() === want);
|
|
14523
15651
|
}
|
|
14524
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
|
+
/**
|
|
14525
15691
|
* Open the settings panel and select this plugin's section.
|
|
14526
15692
|
*
|
|
14527
|
-
* @returns whether
|
|
14528
|
-
*
|
|
15693
|
+
* @returns whether any route was taken (`false` = no route could be attempted,
|
|
15694
|
+
* so the shell is unrecognisable and `onGiveUp` already ran).
|
|
14529
15695
|
*/
|
|
14530
15696
|
function openWorkBuddySettingsSection(options) {
|
|
14531
15697
|
const { doc = document, label } = options;
|
|
14532
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
|
+
}
|
|
14533
15709
|
try {
|
|
14534
15710
|
if (doc.querySelector(SETTINGS_PANEL_SELECTOR) === null) {
|
|
14535
15711
|
const collapsed = Array.from(doc.querySelectorAll(TRIGGER_SELECTOR)).find((button) => button.getAttribute("aria-expanded") !== "true");
|
|
@@ -14602,6 +15778,74 @@ window.__ModuleLoader__.load({
|
|
|
14602
15778
|
*/
|
|
14603
15779
|
const inject = ["slots", "locale"];
|
|
14604
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
|
+
}
|
|
14605
15849
|
function apply(ctx) {
|
|
14606
15850
|
try {
|
|
14607
15851
|
const namespace = "settings.workbuddy";
|
|
@@ -14614,9 +15858,9 @@ window.__ModuleLoader__.load({
|
|
|
14614
15858
|
/**
|
|
14615
15859
|
* The credits popover's header button: open 设置 → WorkBuddy.
|
|
14616
15860
|
*
|
|
14617
|
-
* ALWAYS A FUNCTION, never `undefined
|
|
14618
|
-
*
|
|
14619
|
-
*
|
|
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
|
|
14620
15864
|
* readout only renders the button when this is present, and the first
|
|
14621
15865
|
* `registerAllSlots()` happens before most of `apply` has finished — a
|
|
14622
15866
|
* route captured from `ctx.get('layout')` at that moment is `undefined` on
|
|
@@ -14628,6 +15872,7 @@ window.__ModuleLoader__.load({
|
|
|
14628
15872
|
*/
|
|
14629
15873
|
const openSettingsSection = () => openWorkBuddySettingsSection({
|
|
14630
15874
|
label: () => t("nav.panel"),
|
|
15875
|
+
get: softGet,
|
|
14631
15876
|
onGiveUp: () => {
|
|
14632
15877
|
const navigation = softGet("pluginNavigation");
|
|
14633
15878
|
if (navigation !== void 0 && typeof navigation.openBundle === "function") try {
|
|
@@ -14691,18 +15936,12 @@ window.__ModuleLoader__.load({
|
|
|
14691
15936
|
locale: namespace
|
|
14692
15937
|
}, (iconProps) => {
|
|
14693
15938
|
const edge = typeof iconProps?.size === "number" ? iconProps.size : 16;
|
|
14694
|
-
return (0, react.createElement)(
|
|
14695
|
-
|
|
14696
|
-
alt: "",
|
|
14697
|
-
width: edge,
|
|
14698
|
-
height: edge,
|
|
15939
|
+
return (0, react.createElement)(PluginIcon, {
|
|
15940
|
+
size: edge,
|
|
14699
15941
|
className: "dsm-workbuddy-nav-icon",
|
|
14700
15942
|
style: {
|
|
14701
|
-
width: `${edge}px`,
|
|
14702
|
-
height: `${edge}px`,
|
|
14703
15943
|
borderRadius: "4px",
|
|
14704
15944
|
display: "block",
|
|
14705
|
-
objectFit: "contain",
|
|
14706
15945
|
opacity: iconProps?.active === false ? .75 : 1
|
|
14707
15946
|
}
|
|
14708
15947
|
});
|
|
@@ -14812,13 +16051,40 @@ window.__ModuleLoader__.load({
|
|
|
14812
16051
|
* meeting that price for the first time; the disposition is to state it
|
|
14813
16052
|
* plainly rather than to coordinate at runtime.
|
|
14814
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);
|
|
14815
16075
|
const registerModelLabel = () => {
|
|
16076
|
+
modelLabelState.askedAt = Date.now();
|
|
14816
16077
|
try {
|
|
14817
|
-
return ctx.slots.inject("conversation.input.model.label", () =>
|
|
14818
|
-
|
|
14819
|
-
|
|
14820
|
-
|
|
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
|
+
});
|
|
14821
16085
|
} catch (error) {
|
|
16086
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16087
|
+
modelLabelState.failure = message;
|
|
14822
16088
|
console.error("[dsh-connect-workbuddy] model label slot failed to register (host provider unaffected):", error);
|
|
14823
16089
|
return;
|
|
14824
16090
|
}
|
|
@@ -14833,13 +16099,9 @@ window.__ModuleLoader__.load({
|
|
|
14833
16099
|
*/
|
|
14834
16100
|
function WorkBuddyPanelIcon(props) {
|
|
14835
16101
|
const edge = typeof props.size === "number" && props.size > 0 ? props.size : 16;
|
|
14836
|
-
return (0, react.createElement)(
|
|
16102
|
+
return (0, react.createElement)(PluginIcon, {
|
|
14837
16103
|
className: "dsm-workbuddy-panel-icon",
|
|
14838
|
-
|
|
14839
|
-
alt: "",
|
|
14840
|
-
width: edge,
|
|
14841
|
-
height: edge,
|
|
14842
|
-
"aria-hidden": "true"
|
|
16104
|
+
size: edge
|
|
14843
16105
|
});
|
|
14844
16106
|
}
|
|
14845
16107
|
/**
|
|
@@ -15097,7 +16359,11 @@ window.__ModuleLoader__.load({
|
|
|
15097
16359
|
registerStatsCredits(),
|
|
15098
16360
|
registerCliLive(),
|
|
15099
16361
|
registerQuotaNotice(),
|
|
15100
|
-
|
|
16362
|
+
(() => {
|
|
16363
|
+
const dispose = registerModelLabel();
|
|
16364
|
+
modelLabelState.dispose = dispose;
|
|
16365
|
+
return dispose;
|
|
16366
|
+
})(),
|
|
15101
16367
|
registerMainPage()
|
|
15102
16368
|
].filter((disposer) => disposer !== void 0);
|
|
15103
16369
|
/**
|
|
@@ -15128,9 +16394,11 @@ window.__ModuleLoader__.load({
|
|
|
15128
16394
|
dispose();
|
|
15129
16395
|
} catch {}
|
|
15130
16396
|
liveDisposers = [];
|
|
16397
|
+
modelLabelState.rebinds = (modelLabelState.rebinds ?? 0) + 1;
|
|
15131
16398
|
liveDisposers = registerAllSlots();
|
|
16399
|
+
publishModelLabelState(modelLabelState);
|
|
15132
16400
|
try {
|
|
15133
|
-
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})`})`);
|
|
15134
16402
|
} catch {}
|
|
15135
16403
|
syncPanelRegistration();
|
|
15136
16404
|
};
|
|
@@ -15226,7 +16494,9 @@ window.__ModuleLoader__.load({
|
|
|
15226
16494
|
//#endregion
|
|
15227
16495
|
exports.apply = apply;
|
|
15228
16496
|
exports.inject = inject;
|
|
16497
|
+
exports.modelLabelVerdictOf = modelLabelVerdictOf;
|
|
15229
16498
|
exports.name = name;
|
|
16499
|
+
exports.publishModelLabelState = publishModelLabelState;
|
|
15230
16500
|
return module.exports;
|
|
15231
16501
|
}
|
|
15232
16502
|
});
|