dsh-connect-workbuddy 5.21.3 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -126,9 +126,11 @@ window.__ModuleLoader__.load({
126
126
  /**
127
127
  * 真实设备参数(本机安装的桌面端 Turing Shield SDK)的状态与取值。
128
128
  *
129
- * - `GET` → `{ tier, sdk, token }`,`token` 只有掩码与长度。
129
+ * - `GET` → `{ tier, sdk, token }`,`token` 只有掩码与长度;另带 `sdkEnabled`
130
+ * (总开关的当前值),供卡片画出那个勾选框。
130
131
  * - `POST ?action=refresh` → 强制重取一次,再返回同一形状。
131
132
  * - `POST ?action=reveal` → `{ token }`,完整值,**只在用户显式点击时**。
133
+ * - `POST ?action=enable|disable` → 写总开关。
132
134
  *
133
135
  * 为什么把"完整值"单独做成一个动作:这是一枚能代表这台机器的凭据,卡片是
134
136
  * 一个会被截图、被贴进 issue 的界面。默认只给掩码,复制/查看各要一次显式动作。
@@ -327,6 +329,7 @@ window.__ModuleLoader__.load({
327
329
  "enabledModelIds",
328
330
  "imageModelIds",
329
331
  "imageToolEnabled",
332
+ "preferredImageModel",
330
333
  "offModelIds",
331
334
  "contextBudgets",
332
335
  "defaultThinkingEfforts",
@@ -377,6 +380,7 @@ window.__ModuleLoader__.load({
377
380
  if (slot["enabled"] === false) weight += 1;
378
381
  if (slot["showCreditsInMainUi"] === false) weight += 1;
379
382
  if (slot["imageToolEnabled"] === true) weight += 1;
383
+ if (typeof slot["preferredImageModel"] === "string" && slot["preferredImageModel"] !== "") weight += 1;
380
384
  return weight;
381
385
  }
382
386
  /**
@@ -578,6 +582,38 @@ window.__ModuleLoader__.load({
578
582
  return out;
579
583
  }
580
584
  /**
585
+ * The text-to-image model this region generates with (issue #241), or `''`.
586
+ *
587
+ * Empty means "no choice" — the tool then takes the catalog's first model for the
588
+ * tag, which is the exact behaviour a config written before this field existed
589
+ * had. Deliberately NOT defaulted to the watermark-free model here: that model
590
+ * costs roughly twice as much per image and caps the size at ~1 MP, so choosing
591
+ * it is a spending decision the user makes in the card, not one a schema
592
+ * default can make on their behalf.
593
+ *
594
+ * A stale id is tolerated the same way `regionPreferredVideoModelsOf` tolerates
595
+ * one: the catalog can change, and the tool falls back to the group's first
596
+ * model rather than failing a generation over a remembered choice.
597
+ */
598
+ function regionPreferredImageModelOf(value, region) {
599
+ const raw = regionSlotOf(value, region)["preferredImageModel"];
600
+ return typeof raw === "string" ? raw : "";
601
+ }
602
+ /**
603
+ * Build the next `regions` settings value for this region's image model choice.
604
+ *
605
+ * `modelId` of `undefined` or `''` CLEARS the choice, which is why this is a
606
+ * three-state write rather than a boolean: the card's picker has a "follow the
607
+ * catalog" row, and an empty string is what makes that row mean "no opinion"
608
+ * again.
609
+ */
610
+ function nextRegionPreferredImageModel(value, region, modelId) {
611
+ return nextRegionSlots(regionsMapOf(value), region, {
612
+ ...regionSlotOf(value, region),
613
+ preferredImageModel: modelId === void 0 ? "" : modelId
614
+ });
615
+ }
616
+ /**
581
617
  * Build the next `regions` settings value for one pinned video model.
582
618
  *
583
619
  * `modelId` of `undefined` or `''` CLEARS that tag's pin, which is why this is
@@ -1497,6 +1533,22 @@ window.__ModuleLoader__.load({
1497
1533
  return modelId === void 0 || modelId === "" ? current === void 0 || current === "" : current === modelId;
1498
1534
  });
1499
1535
  }
1536
+ /**
1537
+ * Set (or clear) this region's text-to-image model choice, verifying it landed.
1538
+ *
1539
+ * `modelId` of `undefined` / `''` clears it back to "follow the catalog". The
1540
+ * landed check matters here for the same reason as the video pin: a picker that
1541
+ * silently reverted would leave the user believing their images come out
1542
+ * watermark-free when the tool is still using the watermarked model.
1543
+ */
1544
+ async function writeRegionPreferredImageModel(scope, region, modelId, slot) {
1545
+ await writeField(scope, "regions", region, slot, (readBack) => {
1546
+ const stored = readBack;
1547
+ if (stored === null || stored === void 0) return false;
1548
+ const current = stored["preferredImageModel"];
1549
+ return modelId === void 0 || modelId === "" ? current === void 0 || current === "" : current === modelId;
1550
+ });
1551
+ }
1500
1552
  async function writeRegionCreditsShown(scope, region, shown, slot) {
1501
1553
  await writeField(scope, "regions", region, slot, (readBack) => {
1502
1554
  const stored = readBack;
@@ -1702,6 +1754,21 @@ window.__ModuleLoader__.load({
1702
1754
  };
1703
1755
  }
1704
1756
  //#endregion
1757
+ //#region src/image-gen.ts
1758
+ /**
1759
+ * 无水印模型:`hunyuan-image-v3.0`(issue #241)。
1760
+ *
1761
+ * 2026-11-12 实测:同一个提示词、同一个账号,`hunyuan-image-alpha` 的产物右下角
1762
+ * 固定带「AI生成 WORKBUDD>」水印,而 `hunyuan-image-v3.0` **完全没有**——它不是
1763
+ * 参数开关,是产物落盘路径的差别:带水印的产物落在 COS 的 `aigc-processed/`
1764
+ * 前缀下,v3.0 的不落。所以「关水印」这件事在上游只有一个等价做法:换模型。
1765
+ *
1766
+ * 代价如实体现在两处:单价 6 → 11.1 积分/张,尺寸上限降到
1767
+ * {@link IMAGE_SIZE_LIMITS_V3}。因此它是**用户选的**,不是默认——
1768
+ * 见 `preferredImageModels`。
1769
+ */
1770
+ const IMAGE_MODEL_NO_WATERMARK = "hunyuan-image-v3.0";
1771
+ //#endregion
1705
1772
  //#region src/client/panel-switch.ts
1706
1773
  /**
1707
1774
  * Whether the OPTIONAL sidebar panel is switched on, as the browser half sees
@@ -1932,7 +1999,7 @@ window.__ModuleLoader__.load({
1932
1999
  case "failed": return retryDue(probe, nowMs) ? void 0 : "failed";
1933
2000
  case "rate-limited": return retryDue(probe, nowMs) ? void 0 : "rate-limited";
1934
2001
  case "model-busy": return retryDue(probe, nowMs, 12e4) ? void 0 : "model-busy";
1935
- case "out-of-credit": return retryDue(probe, nowMs) ? void 0 : "out-of-credit";
2002
+ case "out-of-credit": return "out-of-credit";
1936
2003
  case "policy-rejected": return;
1937
2004
  case "channel-rejected": return;
1938
2005
  default: return "unusable";
@@ -1941,11 +2008,10 @@ window.__ModuleLoader__.load({
1941
2008
  /**
1942
2009
  * Whether an account's cooldown has elapsed (or was never stated).
1943
2010
  *
1944
- * The fallback is the ONLY thing a transient outcome relies on: `cooldownOf`
1945
- * attaches `retryAtMs` for a rate limit or a drained quota, never for a
1946
- * transport failure, so `atMs + POOL_UNKNOWN_COOLDOWN_MS` is what brings those
1947
- * back. That is deliberate — the alternative is a permanent exclusion decided by
1948
- * an event that said nothing about the account.
2011
+ * Transient failures without a stated retry time use the local short window.
2012
+ * Credit exhaustion is cleared by later positive balance evidence or an explicit
2013
+ * successful pool test; ordinary chat success does not update the probe store.
2014
+ * It does not call this helper.
1949
2015
  *
1950
2016
  * `fallbackMs` lets one outcome carry a SHORTER clock than the generic one: the
1951
2017
  * model-scoped throttle is upstream's own "about a minute", and applying the
@@ -2060,6 +2126,12 @@ window.__ModuleLoader__.load({
2060
2126
  }
2061
2127
  //#endregion
2062
2128
  //#region src/client/account-state.ts
2129
+ /** 积分补充需要实际到账;月度刷新时间不能代表账号必须等待的期限。 */
2130
+ function creditRecoveryLine(t, account) {
2131
+ if (account.probe?.outcome !== "out-of-credit" && account.excludedBy !== "out-of-credit") return void 0;
2132
+ const action = account.checkinSupported === true && account.enterprise !== true ? account.checkedInToday === true ? "row.creditCheckinTomorrow" : account.checkedInToday === false ? "row.creditCheckinRetry" : "row.creditAwaitReplenishment" : "row.creditAwaitReplenishment";
2133
+ return `${t("row.poolExcludedOutOfCredit")} · ${t(action)}`;
2134
+ }
2063
2135
  /** Whether a probe outcome means the model answered. */
2064
2136
  function outcomeOk(outcome) {
2065
2137
  return outcome === "ok";
@@ -2146,6 +2218,8 @@ window.__ModuleLoader__.load({
2146
2218
  * would imply waiting helps, when the only fix is signing in again.
2147
2219
  */
2148
2220
  function availabilityLine(t, account, nowMs = Date.now()) {
2221
+ const creditLine = creditRecoveryLine(t, account);
2222
+ if (creditLine !== void 0) return creditLine;
2149
2223
  const probe = account.probe;
2150
2224
  if (probe !== void 0) {
2151
2225
  if (probe.outcome === "ok") return outcomeText(t, probe.outcome);
@@ -2176,6 +2250,8 @@ window.__ModuleLoader__.load({
2176
2250
  * to lose the wait.
2177
2251
  */
2178
2252
  function availabilityMark(t, account, nowMs = Date.now()) {
2253
+ const creditLine = creditRecoveryLine(t, account);
2254
+ if (creditLine !== void 0) return creditLine;
2179
2255
  const probe = account.probe;
2180
2256
  if (probe !== void 0) {
2181
2257
  if (probe.outcome === "ok") return outcomeMarkText(t, probe.outcome);
@@ -2849,9 +2925,15 @@ window.__ModuleLoader__.load({
2849
2925
  /**
2850
2926
  * Outcomes whose label + stated recovery time ARE the whole story.
2851
2927
  *
2852
- * `rate-limited` and `out-of-credit` both carry a reset instant, which the row
2853
- * prints right beside them; their bodies restate that instant and add a
2854
- * `code`/`requestId` pair nobody reads.
2928
+ * `rate-limited` carries a reset instant, which the row prints right beside it;
2929
+ * its body restates that instant and adds a `code`/`requestId` pair nobody
2930
+ * reads.
2931
+ *
2932
+ * `out-of-credit` is here for a DIFFERENT reason than it once was. It no longer
2933
+ * prints an instant at all — the row states what replenishes the balance
2934
+ * (check-in / top-up) instead — and the recorded body's `msg` for the `14018`
2935
+ * family is the same quota envelope, which adds no evidence the label did not
2936
+ * already use. Printing it would bury the one actionable sentence under JSON.
2855
2937
  *
2856
2938
  * `model-busy` belongs here for the opposite reason: its label states the whole
2857
2939
  * finding INCLUDING the remedy ("this model is loaded right now · not your
@@ -3831,6 +3913,37 @@ window.__ModuleLoader__.load({
3831
3913
  memberAccountIds: next ? (pool?.accounts ?? []).map((account) => account.accountId) : []
3832
3914
  }));
3833
3915
  }, [editDraft, pool]);
3916
+ /**
3917
+ * Hand the order back to the credit policy (issue #240).
3918
+ *
3919
+ * WHY THIS MUST EXIST. Once any member is listed in `orderAccountIds`, the
3920
+ * ranking puts the manual order ahead of every credit key, and nothing else
3921
+ * ever clears that list — there was no control that did, so a single stray
3922
+ * click on ↑ pinned the pool to that order forever. The reporter's complaint
3923
+ * ("I can only fix it by hand-sorting") is that state: they wanted the
3924
+ * automatic policy back and the card offered no way to ask for it.
3925
+ *
3926
+ * `[]` rather than deleting the field: the Host treats an empty list and an
3927
+ * absent one identically (`rankPool` reads it as "not listed = sorted last",
3928
+ * and the credit keys then decide everything), and an explicit empty array
3929
+ * round-trips through the settings schema without relying on how a missing
3930
+ * key is merged. Membership is untouched — this clears the ORDER only, which
3931
+ * is the same separation the two fields exist to keep.
3932
+ */
3933
+ const setSortManual = (0, react.useCallback)((manual) => {
3934
+ editDraft((current) => {
3935
+ const here = current.memberAccountIds.filter((id) => (pool?.accounts ?? []).some((account) => account.accountId === id));
3936
+ if (!manual) return current.orderAccountIds.some((id) => here.includes(id)) ? {
3937
+ ...current,
3938
+ orderAccountIds: []
3939
+ } : current;
3940
+ const visible = [...current.orderAccountIds.filter((id) => here.includes(id)), ...here.filter((id) => !current.orderAccountIds.includes(id))];
3941
+ return {
3942
+ ...current,
3943
+ orderAccountIds: sameOrder(visible, current.orderAccountIds) ? current.orderAccountIds : visible
3944
+ };
3945
+ });
3946
+ }, [editDraft, pool]);
3834
3947
  /** Run one batch action against the Host. */
3835
3948
  const runAction = (0, react.useCallback)(async (action) => {
3836
3949
  setBusy(action);
@@ -4310,20 +4423,57 @@ window.__ModuleLoader__.load({
4310
4423
  }, `${t("row.poolModelWideBusy")} ${t("row.poolModelWideBusyHint")}`) : (0, react.createElement)("p", {
4311
4424
  className: "dsm-workbuddy-pool-warn",
4312
4425
  role: "status"
4313
- }, `${t("row.poolNoCandidate")} ${t("row.poolNoCandidateHint")}`) : null, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-members" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-members-head" }, (0, react.createElement)("div", null, (0, react.createElement)("h4", { className: "dsm-workbuddy-pool-members-title" }, t("row.poolMembersTitle")), (0, react.createElement)("p", { className: "dsm-workbuddy-pool-note" }, t("row.poolMembersHint"))), (0, react.createElement)("div", { className: "dsm-workbuddy-pool-members-actions" }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-hint" }, t("row.poolSelectedCount", {
4314
- count: effectiveMembers.length,
4315
- total: pool.accounts.length
4316
- })), (0, react.createElement)("button", {
4317
- type: "button",
4318
- className: "dsm-btn dsm-btn-outline dsm-workbuddy-pool-small-btn",
4319
- disabled: pool.accounts.length === 0 || !canEditPool,
4320
- onClick: () => selectAll(true)
4321
- }, t("row.poolSelectAll")), (0, react.createElement)("button", {
4322
- type: "button",
4323
- className: "dsm-btn dsm-btn-outline dsm-workbuddy-pool-small-btn",
4324
- disabled: effectiveMembers.length === 0 || !canEditPool,
4325
- onClick: () => selectAll(false)
4326
- }, t("row.poolSelectNone")))), (0, react.createElement)("div", { className: "dsm-workbuddy-pool-actions" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-actions-group" }, pool.checkinSupported ? (0, react.createElement)("button", {
4426
+ }, `${t("row.poolNoCandidate")} ${t("row.poolNoCandidateHint")}`) : null, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-members" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-members-head" }, (0, react.createElement)("div", null, (0, react.createElement)("h4", { className: "dsm-workbuddy-pool-members-title" }, t("row.poolMembersTitle")), (0, react.createElement)("p", { className: "dsm-workbuddy-pool-note" }, t("row.poolMembersHint"))), (0, react.createElement)(
4427
+ "div",
4428
+ { className: "dsm-workbuddy-pool-members-actions" },
4429
+ (0, react.createElement)("span", { className: "dsm-workbuddy-pool-hint" }, t("row.poolSelectedCount", {
4430
+ count: effectiveMembers.length,
4431
+ total: pool.accounts.length
4432
+ })),
4433
+ (0, react.createElement)("button", {
4434
+ type: "button",
4435
+ className: "dsm-btn dsm-btn-outline dsm-workbuddy-pool-small-btn",
4436
+ disabled: pool.accounts.length === 0 || !canEditPool,
4437
+ onClick: () => selectAll(true)
4438
+ }, t("row.poolSelectAll")),
4439
+ (0, react.createElement)("button", {
4440
+ type: "button",
4441
+ className: "dsm-btn dsm-btn-outline dsm-workbuddy-pool-small-btn",
4442
+ disabled: effectiveMembers.length === 0 || !canEditPool,
4443
+ onClick: () => selectAll(false)
4444
+ }, t("row.poolSelectNone")),
4445
+ /**
4446
+ * HOW THIS POOL ORDERS ITS ACCOUNTS — a two-state switch (issue #240).
4447
+ *
4448
+ * Both states are always rendered, with the active one pressed, because
4449
+ * the pair IS the explanation: "自动排序 / 手动排序" told the user which
4450
+ * mode they were in only after they had already guessed. A single
4451
+ * "reset" button (the first attempt at this) said nothing at all in the
4452
+ * automatic state — it simply vanished, so the card never stated which
4453
+ * of the two policies was in force.
4454
+ *
4455
+ * Choosing 自动排序 clears the manual order; choosing 手动排序 keeps the
4456
+ * order currently on screen and marks the draft manually ordered. That
4457
+ * is why "manual" needs no separate list to seed: the rows the user is
4458
+ * looking at ARE the order they are choosing, and `orderIds` already
4459
+ * derives it from the visible sequence.
4460
+ */
4461
+ (0, react.createElement)("span", {
4462
+ className: "dsm-workbuddy-pool-sortseg",
4463
+ role: "group",
4464
+ "aria-label": t("row.poolSortModeTitle")
4465
+ }, ...[false, true].map((manual) => (0, react.createElement)("button", {
4466
+ key: manual ? "manual" : "auto",
4467
+ type: "button",
4468
+ className: `dsm-workbuddy-pool-sortseg-btn${orderIsManual === manual ? " dsm-workbuddy-pool-sortseg-on" : ""}`,
4469
+ "aria-pressed": orderIsManual === manual,
4470
+ disabled: !canEditPool || manual && effectiveMembers.length === 0,
4471
+ title: manual ? t("row.poolSortManualTitle") : t("row.poolSortAutoTitle"),
4472
+ onClick: () => {
4473
+ setSortManual(manual);
4474
+ }
4475
+ }, manual ? t("row.poolSortManual") : t("row.poolSortAuto"))))
4476
+ )), (0, react.createElement)("div", { className: "dsm-workbuddy-pool-actions" }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-actions-group" }, pool.checkinSupported ? (0, react.createElement)("button", {
4327
4477
  type: "button",
4328
4478
  className: "dsm-btn dsm-btn-primary",
4329
4479
  disabled: busy !== void 0 || effectiveMembers.length === 0,
@@ -4408,7 +4558,7 @@ window.__ModuleLoader__.load({
4408
4558
  },
4409
4559
  orderIndex: isMember && orderIsManual ? left + 1 : void 0,
4410
4560
  orderIsManual,
4411
- moveEnabled: active.enabled && isMember && canEditPool,
4561
+ moveEnabled: active.enabled && isMember && canEditPool && orderIsManual,
4412
4562
  onMoveUp: () => {
4413
4563
  moveMember(account.accountId, -1);
4414
4564
  },
@@ -4524,8 +4674,12 @@ window.__ModuleLoader__.load({
4524
4674
  * falls back to exactly this text.
4525
4675
  */
4526
4676
  const excludedRepeatsVerdict = excluded === void 0 || probe === void 0 || probe.outcome === account.excludedBy;
4527
- const measuredButSilent = probe !== void 0 && availabilityLine(t, account) === void 0;
4528
- const outcomeLine = availabilityLine(t, account) ?? (probe === void 0 ? t("row.poolNeverTested") : void 0);
4677
+ const availability = {
4678
+ ...account,
4679
+ checkinSupported
4680
+ };
4681
+ const measuredButSilent = probe !== void 0 && availabilityLine(t, availability) === void 0;
4682
+ const outcomeLine = availabilityLine(t, availability) ?? (probe === void 0 ? t("row.poolNeverTested") : void 0);
4529
4683
  const reason = probe === void 0 ? void 0 : inlineProbeReason(probe.outcome, probe.message);
4530
4684
  const age = probe === void 0 ? void 0 : probeAgeText(t, probe.atMs, Date.now());
4531
4685
  const probeLabel = probe === void 0 ? void 0 : probe.source === void 0 ? {
@@ -4760,6 +4914,7 @@ window.__ModuleLoader__.load({
4760
4914
  }
4761
4915
  //#endregion
4762
4916
  //#region src/client/device-sdk.ts
4917
+ /** 校验并折成 Host 的类型;形状不认识时返回 `undefined`,面板据此显示"不可用"。 */
4763
4918
  function normalize(body) {
4764
4919
  if (typeof body !== "object" || body === null) return void 0;
4765
4920
  const record = body;
@@ -4770,25 +4925,27 @@ window.__ModuleLoader__.load({
4770
4925
  const tokenRecord = token;
4771
4926
  const sdkState = sdkRecord["state"];
4772
4927
  const tokenState = tokenRecord["state"];
4928
+ const info = {
4929
+ state: sdkState === "ready" || sdkState === "unsupported" || sdkState === "missing" || sdkState === "error" || sdkState === "disabled" ? sdkState : "error",
4930
+ bundle: typeof sdkRecord["bundle"] === "string" ? sdkRecord["bundle"] : "",
4931
+ path: typeof sdkRecord["path"] === "string" ? sdkRecord["path"] : "",
4932
+ platform: typeof sdkRecord["platform"] === "string" ? sdkRecord["platform"] : "",
4933
+ arch: typeof sdkRecord["arch"] === "string" ? sdkRecord["arch"] : "",
4934
+ runtime: typeof sdkRecord["runtime"] === "string" ? sdkRecord["runtime"] : "",
4935
+ ...typeof sdkRecord["reason"] === "string" ? { reason: sdkRecord["reason"] } : {}
4936
+ };
4937
+ const readout = {
4938
+ state: tokenState === "ok" || tokenState === "stale" || tokenState === "unavailable" || tokenState === "idle" ? tokenState : "unavailable",
4939
+ masked: typeof tokenRecord["masked"] === "string" ? tokenRecord["masked"] : "",
4940
+ length: typeof tokenRecord["length"] === "number" ? tokenRecord["length"] : 0,
4941
+ ...typeof tokenRecord["fetchedAtMs"] === "number" ? { fetchedAtMs: tokenRecord["fetchedAtMs"] } : {},
4942
+ ...typeof tokenRecord["lastAttemptMs"] === "number" ? { lastAttemptMs: tokenRecord["lastAttemptMs"] } : {},
4943
+ ...typeof tokenRecord["reason"] === "string" ? { reason: tokenRecord["reason"] } : {}
4944
+ };
4773
4945
  return {
4774
4946
  tier: record["tier"] === "real" ? "real" : "virtual",
4775
- sdk: {
4776
- state: sdkState === "ready" || sdkState === "unsupported" || sdkState === "missing" || sdkState === "error" || sdkState === "disabled" ? sdkState : "error",
4777
- bundle: typeof sdkRecord["bundle"] === "string" ? sdkRecord["bundle"] : "",
4778
- path: typeof sdkRecord["path"] === "string" ? sdkRecord["path"] : "",
4779
- platform: typeof sdkRecord["platform"] === "string" ? sdkRecord["platform"] : "",
4780
- arch: typeof sdkRecord["arch"] === "string" ? sdkRecord["arch"] : "",
4781
- runtime: typeof sdkRecord["runtime"] === "string" ? sdkRecord["runtime"] : "",
4782
- ...typeof sdkRecord["reason"] === "string" ? { reason: sdkRecord["reason"] } : {}
4783
- },
4784
- token: {
4785
- state: tokenState === "ok" || tokenState === "stale" || tokenState === "unavailable" || tokenState === "idle" ? tokenState : "unavailable",
4786
- masked: typeof tokenRecord["masked"] === "string" ? tokenRecord["masked"] : "",
4787
- length: typeof tokenRecord["length"] === "number" ? tokenRecord["length"] : 0,
4788
- ...typeof tokenRecord["fetchedAtMs"] === "number" ? { fetchedAtMs: tokenRecord["fetchedAtMs"] } : {},
4789
- ...typeof tokenRecord["lastAttemptMs"] === "number" ? { lastAttemptMs: tokenRecord["lastAttemptMs"] } : {},
4790
- ...typeof tokenRecord["reason"] === "string" ? { reason: tokenRecord["reason"] } : {}
4791
- },
4947
+ sdk: info,
4948
+ token: readout,
4792
4949
  ...typeof record["sdkEnabled"] === "boolean" ? { sdkEnabled: record["sdkEnabled"] } : {}
4793
4950
  };
4794
4951
  }
@@ -4913,6 +5070,8 @@ window.__ModuleLoader__.load({
4913
5070
  */
4914
5071
  const [sdkMasterEnabled, setSdkMasterEnabled] = (0, react.useState)(void 0);
4915
5072
  const [savingMaster, setSavingMaster] = (0, react.useState)(false);
5073
+ /** 七处 `catch` 原本各写一遍同样的展平;收成一个。 */
5074
+ const fail = (cause) => setError(cause instanceof Error ? cause.message : String(cause));
4916
5075
  const load = (0, react.useCallback)(async (refresh) => {
4917
5076
  if (path === "") return;
4918
5077
  setBusy(true);
@@ -4926,7 +5085,7 @@ window.__ModuleLoader__.load({
4926
5085
  setCopied(false);
4927
5086
  }
4928
5087
  } catch (cause) {
4929
- setError(cause instanceof Error ? cause.message : String(cause));
5088
+ fail(cause);
4930
5089
  } finally {
4931
5090
  setBusy(false);
4932
5091
  setLoading(false);
@@ -4994,7 +5153,7 @@ window.__ModuleLoader__.load({
4994
5153
  if (full === void 0) setError(t("sdk.noValue"));
4995
5154
  else setValue(full);
4996
5155
  } catch (cause) {
4997
- setError(cause instanceof Error ? cause.message : String(cause));
5156
+ fail(cause);
4998
5157
  }
4999
5158
  };
5000
5159
  const copy = async () => {
@@ -5011,62 +5170,57 @@ window.__ModuleLoader__.load({
5011
5170
  setCopied(false);
5012
5171
  }, 2e3);
5013
5172
  } catch (cause) {
5014
- setError(cause instanceof Error ? cause.message : String(cause));
5173
+ fail(cause);
5015
5174
  }
5016
5175
  };
5017
5176
  /**
5018
- * 保存目录:写盘之后**立刻重探一次**。
5019
- *
5020
- * 只写不重探会让用户看见"已保存"而状态行还是旧的——那正是这条意见要消掉的
5021
- * 迷雾(`dirSource` 让新目录下一次 `probe` 就生效,所以这里必须主动触发那一次)。
5177
+ * 保存目录:写盘之后**立刻重探一次**。清空按钮复用同一条路径(原来内联重写了
5178
+ * 整个 try/catch/finally,是这份面板里最明显的一处复制粘贴)。
5022
5179
  */
5023
- const saveDir = async () => {
5180
+ const saveDir = async (dir = draftDir.trim()) => {
5024
5181
  if (settingsPath === "") return;
5025
5182
  setSavingDir(true);
5026
5183
  setError(void 0);
5027
5184
  setSavedNote(false);
5028
5185
  try {
5029
- const next = await putDeviceSdk(settingsPath, { sdkDir: draftDir.trim() });
5186
+ const next = await putDeviceSdk(settingsPath, { sdkDir: dir });
5030
5187
  setSdkDir(next.sdkDir);
5031
5188
  setDraftDir(next.sdkDir);
5032
5189
  setSavedNote(true);
5033
5190
  await load(true);
5034
5191
  } catch (cause) {
5035
- setError(cause instanceof Error ? cause.message : String(cause));
5192
+ fail(cause);
5036
5193
  } finally {
5037
5194
  setSavingDir(false);
5038
5195
  }
5039
5196
  };
5040
- const saveFallback = async (value) => {
5197
+ const saveFallback = async (nextValue) => {
5041
5198
  if (settingsPath === "") return;
5042
5199
  setSavingFallback(true);
5043
5200
  setError(void 0);
5044
5201
  try {
5045
- const next = await putDeviceSdk(settingsPath, { sdkFallbackToVirtual: value });
5202
+ const next = await putDeviceSdk(settingsPath, { sdkFallbackToVirtual: nextValue });
5046
5203
  setFallback(next.sdkFallbackToVirtual);
5047
5204
  } catch (cause) {
5048
- setError(cause instanceof Error ? cause.message : String(cause));
5205
+ fail(cause);
5049
5206
  } finally {
5050
5207
  setSavingFallback(false);
5051
5208
  }
5052
5209
  };
5053
5210
  /**
5054
- * 切换 SDK 总开关。
5055
- *
5056
- * 写完之后**重读一次快照**:关掉之后状态行必须立刻变成 `disabled`,而那一条是
5057
- * 从 `GET /device-sdk` 算出来的——只改本地 state 会让"已关"与下面那行"正常"
5058
- * 并存,正是这一页最不该出现的自相矛盾。
5211
+ * 切换 SDK 总开关。写完重读一次快照:状态行是从 `GET /device-sdk` 算的,
5212
+ * 只改本地 state 会让"已关"与下面那行"正常"并存。
5059
5213
  */
5060
- const saveMaster = async (value) => {
5214
+ const saveMaster = async (nextValue) => {
5061
5215
  if (path === "") return;
5062
5216
  setSavingMaster(true);
5063
5217
  setError(void 0);
5064
5218
  try {
5065
- await setDeviceSdkEnabled(path, value);
5066
- setSdkMasterEnabled(value);
5219
+ await setDeviceSdkEnabled(path, nextValue);
5220
+ setSdkMasterEnabled(nextValue);
5067
5221
  await load(false);
5068
5222
  } catch (cause) {
5069
- setError(cause instanceof Error ? cause.message : String(cause));
5223
+ fail(cause);
5070
5224
  } finally {
5071
5225
  setSavingMaster(false);
5072
5226
  }
@@ -5214,22 +5368,7 @@ window.__ModuleLoader__.load({
5214
5368
  className: "dsm-btn dsm-btn-outline",
5215
5369
  disabled: savingDir,
5216
5370
  onClick: () => {
5217
- setDraftDir("");
5218
- (async () => {
5219
- setSavingDir(true);
5220
- setError(void 0);
5221
- try {
5222
- const next = await putDeviceSdk(settingsPath, { sdkDir: "" });
5223
- setSdkDir(next.sdkDir);
5224
- setDraftDir("");
5225
- setSavedNote(true);
5226
- await load(true);
5227
- } catch (cause) {
5228
- setError(cause instanceof Error ? cause.message : String(cause));
5229
- } finally {
5230
- setSavingDir(false);
5231
- }
5232
- })();
5371
+ saveDir("");
5233
5372
  },
5234
5373
  children: t("sdk.dirClear")
5235
5374
  })
@@ -7197,6 +7336,8 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
7197
7336
  tag chip and the select sit on one baseline, like a roster row does. */
7198
7337
  .dsm-workbuddy-video-model-select{font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary,#b8bcc4);background:var(--dsw-alias-bg-l1,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:1px 6px;max-width:100%;min-width:0}
7199
7338
  .dsm-workbuddy-video-model-select:disabled{opacity:.6}
7339
+ .dsm-workbuddy-image-model-select{font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary,#b8bcc4);background:var(--dsw-alias-bg-l1,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:1px 6px;max-width:100%;min-width:0}
7340
+ .dsm-workbuddy-image-model-select:disabled{opacity:.6}
7200
7341
  .dsm-workbuddy-media-empty,.dsm-workbuddy-media-error{font-size:12px;line-height:17px}
7201
7342
  .dsm-workbuddy-media-empty{color:var(--dsw-alias-label-tertiary,#8b8f98)}
7202
7343
  .dsm-workbuddy-media-error{color:var(--dsw-alias-label-error,#e5675f)}
@@ -8005,6 +8146,19 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
8005
8146
  .dsm-workbuddy-pool-members-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
8006
8147
  .dsm-workbuddy-pool-members-title{margin:0 0 3px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary,#e6e6e6)}
8007
8148
  .dsm-workbuddy-pool-members-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
8149
+ /* 选号顺序的两态切换(issue #240)。两个按钮常驻、共享一条边框,当前态用
8150
+ aria-pressed 加底色表达——和一个「重置」按钮的差别在于:自动态下那个按钮会
8151
+ 直接消失,于是卡片从不说自己正处于哪种规则;常驻的两格把这句话永远说出来。 */
8152
+ .dsm-workbuddy-pool-sortseg{display:inline-flex;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:999px;overflow:hidden}
8153
+ .dsm-workbuddy-pool-sortseg-btn{appearance:none;border:0;background:transparent;cursor:pointer;padding:3px 10px;font:inherit;font-size:12px;line-height:16px;color:var(--dsw-alias-label-secondary,#b8bcc4)}
8154
+ /* 悬停排除选中项:否则鼠标划过时选中格会被换成半透明底,看着像「选中被取消」。 */
8155
+ .dsm-workbuddy-pool-sortseg-btn:hover:not(:disabled):not(.dsm-workbuddy-pool-sortseg-on){background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.12))}
8156
+ .dsm-workbuddy-pool-sortseg-btn:disabled{opacity:.55;cursor:default}
8157
+ .dsm-workbuddy-pool-sortseg-btn:focus-visible{outline:2px solid rgba(86,134,254,.55);outline-offset:-2px}
8158
+ /* 选中态用「前景色做底、底色做字」这一对反相变量,理由同 device-seg-on:
8159
+ brand-primary 在暗色主题下本身是浅色,白字落上去整格会消失。 */
8160
+ .dsm-workbuddy-pool-sortseg-on{background:var(--dsw-alias-label-primary,#ededed);color:var(--dsw-alias-bg-base,#181818);font-weight:600}
8161
+
8008
8162
  /* The 测试/删除 and 全选/全不选 buttons. Shared with the benefit pill, which
8009
8163
  * OVERRIDES both properties at higher specificity (see its rule above): a pill is
8010
8164
  * a capsule whose height is fixed at 19px, so inheriting this 3px/10px rhythm
@@ -9250,22 +9404,30 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
9250
9404
  * The sentence a probe result gets, and how it should be coloured.
9251
9405
  *
9252
9406
  * The cooldown wording is the part that had to be got right. The upstream names
9253
- * a "use again" time in three situations: a `Retry-After` header, the reset
9254
- * sentence it writes into its own failure BODY (where this service actually
9255
- * puts it — its 429s carry no rate-limit header at all), or an exhausted
9256
- * monthly quota whose refresh point it declares. So a limited result WITHOUT
9257
- * any stated time must say that plainly. Substituting a locally invented
9258
- * countdown would be the single most misleading thing this feature could do: it
9259
- * would look like an upstream answer while being a guess, and the user would
9260
- * wait for a moment that means nothing.
9407
+ * a "use again" time in two situations that describe a WAIT: a `Retry-After`
9408
+ * header, and the reset sentence it writes into its own failure BODY (where this
9409
+ * service actually puts it — its 429s carry no rate-limit header at all). So a
9410
+ * limited result WITHOUT either must say that plainly. Substituting a locally
9411
+ * invented countdown would be the single most misleading thing this feature
9412
+ * could do: it would look like an upstream answer while being a guess, and the
9413
+ * user would wait for a moment that means nothing.
9414
+ *
9415
+ * `out-of-credit` is deliberately NOT in that list any more. The monthly package
9416
+ * refresh point is a fact about the PACKAGE's cycle, not the earliest moment the
9417
+ * account can serve: check-in and top-ups replenish credits whenever they land.
9418
+ * Rendering it as a countdown told users to wait three weeks for credits that
9419
+ * could arrive today, so this row now borrows the pool's replenishment wording
9420
+ * from `availabilityLine` — one rule for the account row and the model row, so
9421
+ * the two cannot print different stories about the same measurement.
9261
9422
  */
9262
9423
  /**
9263
9424
  * ` · 约 1 小时后` for a future instant, or `''` when there is none.
9264
9425
  *
9265
- * Kept beside {@link probeResultView} rather than inlined three times so the
9266
- * "append only when non-empty" rule cannot drift between the two limited
9267
- * outcomes. The absolute instant stays the primary text: it is the upstream's
9268
- * own answer, and the relative form is a convenience derived from it.
9426
+ * Kept beside {@link probeResultView} rather than inlined so the "append only
9427
+ * when non-empty" rule cannot drift between the two outcomes that still carry a
9428
+ * stated WAIT (rate-limited, model-busy). The absolute instant stays the primary
9429
+ * text: it is the upstream's own answer, and the relative form is a convenience
9430
+ * derived from it.
9269
9431
  */
9270
9432
  function retrySuffix(t, untilMs, nowMs) {
9271
9433
  if (untilMs === void 0) return "";
@@ -9321,7 +9483,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
9321
9483
  tone: "warn"
9322
9484
  };
9323
9485
  case "out-of-credit": return {
9324
- text: result.retryAtMs === void 0 ? t("row.probeOutOfCreditUnknown") : t("row.probeOutOfCreditAt", { at: formatDate(result.retryAtMs) }) + retrySuffix(t, result.retryAtMs, nowMs),
9486
+ text: `✗ ${availabilityLine(t, { probe: result }, nowMs)}`,
9325
9487
  tone: "bad"
9326
9488
  };
9327
9489
  case "credential-rejected": return {
@@ -9531,6 +9693,14 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
9531
9693
  */
9532
9694
  const [pinningVideoModel, setPinningVideoModel] = (0, react.useState)(void 0);
9533
9695
  /**
9696
+ * The image-model picker's in-flight marker (issue #241).
9697
+ *
9698
+ * Separate from {@link pinningVideoModel} for the same reason that one is
9699
+ * separate from {@link togglingCredits}: the two write different fields of the
9700
+ * same region slot, so one pending write must not disable the other control.
9701
+ */
9702
+ const [pinningImageModel, setPinningImageModel] = (0, react.useState)(false);
9703
+ /**
9534
9704
  * The OPTIONAL CodeBuddy CLI route switch (global: one switch, one budget).
9535
9705
  *
9536
9706
  * `undefined` until the first Host answer arrives, so the box renders the
@@ -10052,6 +10222,20 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
10052
10222
  return regionPreferredVideoModelsOf(settingsScope?.getSnapshot().value, item)[tag] ?? "";
10053
10223
  };
10054
10224
  /**
10225
+ * The text-to-image model this region generates with, or `''` for "follow the
10226
+ * catalog" (issue #241).
10227
+ *
10228
+ * Same read order as {@link preferredVideoModelOf} and for the same measured
10229
+ * reason: the Host's answer first, because this namespace's browser mirror is
10230
+ * stale on the affected deployments, and a picker rendering the mirror alone
10231
+ * would show a watermark-free choice the tool does not honour.
10232
+ */
10233
+ const preferredImageModelOf = (item) => {
10234
+ const usage = statusByRegion[item];
10235
+ if (typeof usage?.preferredImageModel === "string") return usage.preferredImageModel;
10236
+ return regionPreferredImageModelOf(settingsScope?.getSnapshot().value, item);
10237
+ };
10238
+ /**
10055
10239
  * Switch one region's provider off or on. The write carries the region's
10056
10240
  * whole slot through untouched — only `enabled` changes — so the user's
10057
10241
  * directory, model picks, image opt-ins and budgets survive a round trip.
@@ -10465,6 +10649,28 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
10465
10649
  }
10466
10650
  };
10467
10651
  /**
10652
+ * Pick (or clear) this region's text-to-image model (issue #241).
10653
+ *
10654
+ * `undefined` means "follow the catalog": the tool then takes the group's
10655
+ * first model, which is the watermarked-but-cheaper one. Both directions go
10656
+ * through the same landed-checked write as the video pin and then re-read the
10657
+ * Host — a choice that reverted silently would leave the user believing their
10658
+ * images come out watermark-free when the tool still uses the other model.
10659
+ */
10660
+ const pinImageModel = async (item, modelId) => {
10661
+ if (settingsScope === void 0) return;
10662
+ setPinningImageModel(true);
10663
+ try {
10664
+ const slot = nextRegionPreferredImageModel(settingsScope.getSnapshot().value, item, modelId)[item];
10665
+ await writeRegionPreferredImageModel(settingsScope, item, modelId, typeof slot === "object" && slot !== null ? slot : {});
10666
+ await refreshUsage(item);
10667
+ } catch (error) {
10668
+ if (mounted.current) setAccountError(error instanceof Error ? error.message : t("row.requestFailed"));
10669
+ } finally {
10670
+ if (mounted.current) setPinningImageModel(false);
10671
+ }
10672
+ };
10673
+ /**
10468
10674
  * Read the active region's media roster. Read-only and free (the same GET the
10469
10675
  * image tool performs), so it is safe to run whenever the capability panel is
10470
10676
  * shown; `refresh` bypasses the Host's 5-minute cache for the explicit
@@ -11191,6 +11397,68 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
11191
11397
  ]
11192
11398
  })
11193
11399
  });
11400
+ /**
11401
+ * The image-model picker (issue #241).
11402
+ *
11403
+ * Only on the CN tab, and only once the image tool is authorized there: the
11404
+ * watermark-free model has no route on the international gateway (measured
11405
+ * 2026-11-12: `hunyuan-image-v3.0` → 400 / 14401 route config not found), so
11406
+ * offering it there would be a button that can only fail. Showing the picker
11407
+ * where the tool cannot be called at all would invite a decision that changes
11408
+ * nothing, same rule as `videoModelPreference`.
11409
+ *
11410
+ * The watermark-free entry is NOT in this region's catalog — it is the
11411
+ * official CLI's own hard-coded fallback — so it is appended here rather than
11412
+ * read from `activeMedia`. Everything about the cost lives in the hint: a user
11413
+ * who only wants "no watermark" must not have to discover the price tag after
11414
+ * spending 11.1 credits.
11415
+ */
11416
+ const imageModelPreference = activeRegion !== "cn" || !(activeRegionOn && imageToolOn(activeRegion)) || activeMedia === void 0 ? null : (() => {
11417
+ const picked = preferredImageModelOf(activeRegion);
11418
+ const options = [...activeMedia.filter((model) => model.tags.includes("text-to-image")).map((model) => ({
11419
+ id: model.id,
11420
+ name: model.name
11421
+ })), ...activeMedia.some((model) => model.id === "hunyuan-image-v3.0") ? [] : [{
11422
+ id: IMAGE_MODEL_NO_WATERMARK,
11423
+ name: t("row.imageModelWatermarkFree")
11424
+ }]];
11425
+ if (options.length < 2) return null;
11426
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11427
+ className: "dsm-workbuddy-pref dsm-workbuddy-media",
11428
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11429
+ className: "dsm-workbuddy-pref-copy",
11430
+ children: [
11431
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11432
+ className: "dsm-workbuddy-pref-label",
11433
+ children: t("row.imageModelLabel")
11434
+ }),
11435
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11436
+ className: "dsm-workbuddy-pref-hint",
11437
+ children: t("row.imageModelHint")
11438
+ }),
11439
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
11440
+ className: "dsm-workbuddy-media-row",
11441
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
11442
+ className: "dsm-workbuddy-image-model-select",
11443
+ value: options.some((option) => option.id === picked) ? picked : "",
11444
+ disabled: !canWrite || saving || poolBusy || pinningImageModel,
11445
+ onChange: (event) => {
11446
+ const next = event.target.value;
11447
+ pinImageModel(activeRegion, next === "" ? void 0 : next);
11448
+ },
11449
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11450
+ value: "",
11451
+ children: t("row.imageModelDefault")
11452
+ }), options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11453
+ value: option.id,
11454
+ children: option.name
11455
+ }, option.id))]
11456
+ })
11457
+ })
11458
+ ]
11459
+ })
11460
+ });
11461
+ })();
11194
11462
  const mediaModelsPreference = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11195
11463
  className: "dsm-workbuddy-pref dsm-workbuddy-media",
11196
11464
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
@@ -11808,6 +12076,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
11808
12076
  cliBridgeSwitchedOn() ? cliBridgePickers : null,
11809
12077
  imageToolPreference,
11810
12078
  videoToolPreference,
12079
+ imageModelPreference,
11811
12080
  videoModelPreference,
11812
12081
  mediaModelsPreference,
11813
12082
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
@@ -13027,6 +13296,8 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13027
13296
  if (t === void 0) throw new Error("Composer credits readout requires its translation function");
13028
13297
  const owned = provider === void 0 ? void 0 : WORKBUDDY_COMPOSER_PROVIDERS[provider];
13029
13298
  const activeRegion = region ?? owned;
13299
+ const activeRegionRef = (0, react.useRef)(activeRegion);
13300
+ activeRegionRef.current = activeRegion;
13030
13301
  const [usage, setUsage] = (0, react.useState)(void 0);
13031
13302
  /**
13032
13303
  * The refresh cadence, taken from the SAME document the card polls.
@@ -13068,7 +13339,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13068
13339
  const [settingsFailed, setSettingsFailed] = (0, react.useState)(false);
13069
13340
  const [lastRefresh, setLastRefresh] = (0, react.useState)(void 0);
13070
13341
  const [open, setOpen] = (0, react.useState)(false);
13071
- const inFlight = (0, react.useRef)(false);
13342
+ const inFlight = (0, react.useRef)(void 0);
13072
13343
  /** A batch is running; guards a second press that lands before `setTesting`. */
13073
13344
  const testingRef = (0, react.useRef)(false);
13074
13345
  /** Account-table reads in flight; see `fetchAccountCredits`. */
@@ -13123,25 +13394,40 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13123
13394
  margin: 12
13124
13395
  });
13125
13396
  useDismissOnOutsidePointer(rootRef, open, setOpen, panelRef);
13126
- const fetchUsage = (0, react.useCallback)(async (signal) => {
13127
- if (inFlight.current || activeRegion === void 0) return;
13128
- inFlight.current = true;
13397
+ const fetchUsage = (0, react.useCallback)(async (signal, force = false) => {
13398
+ if (activeRegion === void 0 || signal?.aborted || activeRegionRef.current !== activeRegion) return;
13399
+ while (inFlight.current !== void 0) {
13400
+ const pending = inFlight.current;
13401
+ await pending.task;
13402
+ if (signal?.aborted || activeRegionRef.current !== activeRegion) return;
13403
+ if (!force && pending.region === activeRegion && pending.signal?.aborted !== true) return;
13404
+ }
13405
+ const task = (async () => {
13406
+ try {
13407
+ const response = await fetch(withWorkBuddyRegion(WORKBUDDY_USAGE_PATH, activeRegion), {
13408
+ headers: { accept: "application/json" },
13409
+ credentials: "same-origin",
13410
+ ...signal === void 0 ? {} : { signal }
13411
+ });
13412
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
13413
+ const value = await response.json();
13414
+ if (!mounted.current || signal?.aborted === true || activeRegionRef.current !== activeRegion) return;
13415
+ setUsage(value);
13416
+ setLastRefresh(Date.now());
13417
+ setFailed(false);
13418
+ } catch {
13419
+ if (mounted.current && signal?.aborted !== true && activeRegionRef.current === activeRegion) setFailed(true);
13420
+ }
13421
+ })();
13422
+ inFlight.current = {
13423
+ region: activeRegion,
13424
+ signal,
13425
+ task
13426
+ };
13129
13427
  try {
13130
- const response = await fetch(withWorkBuddyRegion(WORKBUDDY_USAGE_PATH, activeRegion), {
13131
- headers: { accept: "application/json" },
13132
- credentials: "same-origin",
13133
- ...signal === void 0 ? {} : { signal }
13134
- });
13135
- if (!response.ok) throw new Error(`HTTP ${response.status}`);
13136
- const value = await response.json();
13137
- if (!mounted.current || signal?.aborted === true) return;
13138
- setUsage(value);
13139
- setLastRefresh(Date.now());
13140
- setFailed(false);
13141
- } catch {
13142
- if (mounted.current && signal?.aborted !== true) setFailed(true);
13428
+ await task;
13143
13429
  } finally {
13144
- inFlight.current = false;
13430
+ inFlight.current = void 0;
13145
13431
  }
13146
13432
  }, [activeRegion]);
13147
13433
  /**
@@ -13168,8 +13454,8 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13168
13454
  * which would silently re-draw a mark the press had just cleared.
13169
13455
  */
13170
13456
  const fetchAccountCredits = (0, react.useCallback)(async (signal, force) => {
13171
- if (activeRegion === void 0) return;
13172
- if (!force && accountsInFlight.current > 0) return;
13457
+ if (activeRegion === void 0 || signal?.aborted || activeRegionRef.current !== activeRegion) return false;
13458
+ if (!force && accountsInFlight.current > 0) return false;
13173
13459
  const generation = ++accountsReadGeneration.current;
13174
13460
  accountsInFlight.current += 1;
13175
13461
  try {
@@ -13180,19 +13466,22 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13180
13466
  });
13181
13467
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
13182
13468
  const data = await response.json();
13183
- if (!mounted.current || signal?.aborted === true) return;
13184
- if (generation !== accountsReadGeneration.current) return;
13469
+ if (!mounted.current || signal?.aborted === true || activeRegionRef.current !== activeRegion) return false;
13470
+ if (generation !== accountsReadGeneration.current) return false;
13185
13471
  if (Array.isArray(data.accounts)) {
13186
13472
  setAccountCredits(data.accounts);
13187
13473
  setLastRefresh(Date.now());
13188
13474
  }
13189
- } catch {} finally {
13475
+ return true;
13476
+ } catch {
13477
+ return true;
13478
+ } finally {
13190
13479
  accountsInFlight.current -= 1;
13191
13480
  }
13192
13481
  }, [activeRegion]);
13193
13482
  const hostHidden = hostCreditsShownOf(usage) === false;
13194
13483
  (0, react.useEffect)(() => {
13195
- if (owned === void 0 || hostHidden) return void 0;
13484
+ if (owned === void 0 || hostHidden || open) return void 0;
13196
13485
  let cancelled = false;
13197
13486
  let timer;
13198
13487
  const controller = new AbortController();
@@ -13210,6 +13499,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13210
13499
  }, [
13211
13500
  owned,
13212
13501
  hostHidden,
13502
+ open,
13213
13503
  fetchUsage
13214
13504
  ]);
13215
13505
  /**
@@ -13234,10 +13524,20 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13234
13524
  let cancelled = false;
13235
13525
  let timer;
13236
13526
  const controller = new AbortController();
13237
- fetchAccountCredits(controller.signal).finally(() => {
13527
+ let refreshing = false;
13528
+ const refreshPanel = async (force = false) => {
13529
+ if (refreshing || cancelled) return;
13530
+ refreshing = true;
13531
+ try {
13532
+ if (await fetchAccountCredits(controller.signal, force) && !cancelled) await fetchUsage(controller.signal);
13533
+ } finally {
13534
+ refreshing = false;
13535
+ }
13536
+ };
13537
+ refreshPanel(true).finally(() => {
13238
13538
  if (cancelled) return;
13239
13539
  timer = window.setInterval(() => {
13240
- fetchAccountCredits(controller.signal);
13540
+ refreshPanel();
13241
13541
  }, refreshIntervalMs);
13242
13542
  });
13243
13543
  return () => {
@@ -13249,6 +13549,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13249
13549
  open,
13250
13550
  activeRegion,
13251
13551
  fetchAccountCredits,
13552
+ fetchUsage,
13252
13553
  refreshIntervalMs
13253
13554
  ]);
13254
13555
  (0, react.useEffect)(() => {
@@ -13278,7 +13579,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13278
13579
  setFailed(false);
13279
13580
  try {
13280
13581
  await writeAccountSlot(settingsScope, activeRegion, accountId);
13281
- await fetchUsage();
13582
+ await fetchUsage(void 0, true);
13282
13583
  await fetchAccountCredits(void 0, true);
13283
13584
  } catch {
13284
13585
  if (mounted.current) setFailed(true);
@@ -13355,7 +13656,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13355
13656
  } finally {
13356
13657
  testingRef.current = false;
13357
13658
  if (mounted.current) setTesting(false);
13358
- await Promise.all([fetchUsage(), fetchAccountCredits(void 0, true)]);
13659
+ await Promise.all([fetchUsage(void 0, true), fetchAccountCredits(void 0, true)]);
13359
13660
  }
13360
13661
  }, [
13361
13662
  activeRegion,
@@ -13582,9 +13883,12 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
13582
13883
  const current = row.id === selectedId;
13583
13884
  const poolRow = poolById.get(row.id);
13584
13885
  const live = poolRow === void 0 ? current : poolRow.current;
13585
- const availability = poolRow ?? {
13586
- excludedBy: row.excludedBy,
13587
- probe: void 0
13886
+ const availability = {
13887
+ ...poolRow ?? {
13888
+ excludedBy: row.excludedBy,
13889
+ probe: void 0
13890
+ },
13891
+ checkinSupported: usage?.status === "signed-in" && usage.pool?.checkinSupported === true
13588
13892
  };
13589
13893
  const usable = stateTone(availability) === "ok";
13590
13894
  const currentMark = live ? t("composer.current") : void 0;
@@ -14927,8 +15231,6 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
14927
15231
  "row.probeRateLimitedAt": "✗ Rate limited · usable again after {at}",
14928
15232
  "row.probeModelBusyUnknown": "✗ This model is loaded right now · not your account — another account will not help; wait about a minute or switch models",
14929
15233
  "row.probeModelBusyAt": "✗ This model is loaded right now · not your account; retry after {at}, or switch models",
14930
- "row.probeOutOfCreditUnknown": "✗ Not enough credits · the upstream gave no time for when it frees up",
14931
- "row.probeOutOfCreditAt": "✗ Not enough credits · quota refreshes {at}",
14932
15234
  "row.probeCredentialRejected": "✗ WorkBuddy refused this account's token — sign in again or pick another account",
14933
15235
  "row.probePolicyRejected": "✗ WorkBuddy's server refused this request under its content policy — re-signing in won't help; try the desktop app or another region/account",
14934
15236
  "row.probeChannelRejected": "✗ The gateway refused the PROMPT itself, not this account — the opening of a system message matched its third-party-agent filter, so another account or region answers the same way",
@@ -14979,7 +15281,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
14979
15281
  "row.transferNoService": "Could not reach the local plugin service ({size} KiB sent). The file may be too large, or the service may be restarting — try again, and if it keeps failing, trim the file and retry.",
14980
15282
  "row.poolTitle": "Account pool",
14981
15283
  "row.poolNoCandidate": "No account in this pool can be used right now.",
14982
- "row.poolNoCandidateHint": "Members are rate-limited, out of credits, rejected, or unreachable. Rate limits, drained quotas and transient failures return to the pool on their own — at the time the upstream states, or after a 30-minute fallback. Only a rejected credential needs a new sign-in.",
15284
+ "row.poolNoCandidateHint": "Members are rate-limited, out of credits, rejected, or unreachable. Rate limits and transient failures return to the pool on their own — at the time the upstream states, or after a 30-minute fallback. An account out of credits returns once a balance read confirms replenishment (check-in or top-up). Only a rejected credential needs a new sign-in.",
14983
15285
  "row.poolModelWideBusy": "Every member is blocked on the same model — this is the model, not your accounts.",
14984
15286
  "row.poolModelWideBusyHint": "Switching accounts cannot help: the limit follows the model, so a different account hits the same wall. Wait about a minute, or switch to a less busy model in this session.",
14985
15287
  "row.poolCheckinAll": "Check in selected",
@@ -15024,6 +15326,9 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15024
15326
  "row.poolExcludedRateLimited": "Rate limited",
15025
15327
  "row.poolExcludedModelBusy": "Model busy",
15026
15328
  "row.poolExcludedOutOfCredit": "Out of credits",
15329
+ "row.creditCheckinTomorrow": "Retry after tomorrow’s check-in",
15330
+ "row.creditCheckinRetry": "Retry after check-in",
15331
+ "row.creditAwaitReplenishment": "Awaiting credit replenishment",
15027
15332
  "row.poolExcludedRejected": "Rejected",
15028
15333
  "row.poolExcludedAccountRestricted": "Account restricted upstream",
15029
15334
  "row.poolExcludedUnusable": "Unusable",
@@ -15096,7 +15401,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15096
15401
  "row.poolSelectedCount": "{count} of {total} selected",
15097
15402
  "row.poolOrderRulesTitle": "How this pool chooses an account",
15098
15403
  "row.poolOrderRulesIntro": "The pool always picks the first account that can actually be billed right now. The rules below are checked in order — the first one that separates two accounts decides; later rules only break ties.",
15099
- "row.poolOrderRuleUsable": "1. Can it be billed right now? Accounts that are rate-limited, out of credit, credential-rejected, or failing are moved to the back until their cooldown ends. This outranks everything, including your own order below.",
15404
+ "row.poolOrderRuleUsable": "1. Can it be billed right now? Accounts that are rate-limited, credential-rejected, or failing are moved to the back until their cooldown ends; an account out of credit stays out until a balance read confirms replenishment. This outranks everything, including your own order below.",
15100
15405
  "row.poolOrderRuleExpiring": "2. Does it have credits expiring within 3 days? Yes goes first. This also outranks your manual order — see the note below.",
15101
15406
  "row.poolOrderRuleManual": "3. Your manual order. The position you set with the ↑ / ↓ arrows. Accounts you never ordered are placed after every ordered one.",
15102
15407
  "row.poolOrderRuleNearestExpiry": "4. Which expiry comes first? Between accounts that both have credits expiring, the one losing them sooner goes first.",
@@ -15123,7 +15428,12 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15123
15428
  "row.poolRankLabel": "No. {rank}",
15124
15429
  "row.poolRankManualTitle": "You placed this account at position {rank} in the pool manually.",
15125
15430
  "row.poolRankAuto": "Auto",
15126
- "row.poolRankAutoTitle": "Not manually sorted yet: the pool spends expiring credits first, then picks accounts by remaining balance. Use ↑/↓ to set your own order.",
15431
+ "row.poolRankAutoTitle": "Automatic: the pool spends expiring credits first, then picks accounts by remaining balance. To set your own order, switch the control above to Manual.",
15432
+ "row.poolSortModeTitle": "Serving order",
15433
+ "row.poolSortAuto": "Automatic",
15434
+ "row.poolSortAutoTitle": "Hand it to the credit policy: spend expiring credits first, then pick by remaining balance. Switching here clears the manual order; checked members are unaffected.",
15435
+ "row.poolSortManual": "Manual",
15436
+ "row.poolSortManualTitle": "Serve in the order you set, top row first. Switching here keeps the order currently on screen; use ↑/↓ to adjust it.",
15127
15437
  "row.poolMoveUpTitle": "Move account up in this pool's order",
15128
15438
  "row.poolMoveDownTitle": "Move account down in this pool's order",
15129
15439
  "row.poolMoveUpAria": "Move {accountName} up in this pool's order",
@@ -15175,7 +15485,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15175
15485
  "sdk.statusError": "The SDK could not be loaded",
15176
15486
  "sdk.statusDisabled": "Turned off in settings",
15177
15487
  "sdk.masterLabel": "Use the real-device SDK",
15178
- "sdk.masterHint": "On: discover the installed desktop SDK, fetch its device token in a background child process and keep it fresh every 10 minutes. Off: none of that happens — no discovery, no child process, no prewarming — so the Real tier has no token to send. The Virtual tier is unaffected (its ids come from the local salt), so turning this off is safe if you only want virtual devices.",
15488
+ "sdk.masterHint": "On: discover the installed desktop SDK, fetch its device token in a background child process and keep it fresh every 10 minutes. Off: none of that happens — no discovery, no child process, no prewarming — so the Real tier has no token to send. The Virtual tier is unaffected (its ids come from the local salt), so turning this off is safe if you only want virtual devices. The switch takes effect immediately: turning it on starts fetching at once and turning it off stops the timer, with no plugin reload.",
15179
15489
  "sdk.bundle": "SDK",
15180
15490
  "sdk.runtime": "Runtime",
15181
15491
  "sdk.fetched": "Last fetched",
@@ -15270,6 +15580,10 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15270
15580
  "row.videoModelLabel": "Video model per mode",
15271
15581
  "row.videoModelHint": "Pinned separately for text-to-video and image-to-video, from THIS region's own catalog — a model id does not carry across regions. A call that names no model uses the pin; with nothing pinned the tool takes the first model of that group. A pin the catalog no longer carries quietly falls back to the first model instead of failing.",
15272
15582
  "row.videoModelDefault": "Default (first in the group)",
15583
+ "row.imageModelLabel": "Image model (watermark)",
15584
+ "row.imageModelHint": "WorkBuddy always stamps \"AI生成 WORKBUDD>\" on hunyuan-image-alpha output — the upstream has no switch to turn it off (issue #241). The only equivalent is a different model: hunyuan-image-v3.0 produces the same request WITHOUT a watermark, but costs about 11.1 credits per image instead of about 6, and caps output at 2048 px per edge / about 1 MP total (so 1024x1536 scales down to 836x1254, same ratio). Leave it on \"default\" to keep the cheaper, watermarked model with the full size range. CN gateway only.",
15585
+ "row.imageModelDefault": "Default (first in the group, watermarked)",
15586
+ "row.imageModelWatermarkFree": "Hunyuan Image v3.0 (no watermark — ~11.1 credits/image, smaller size limit)",
15273
15587
  "row.mediaModelsLabel": "Image models in this region",
15274
15588
  "row.mediaModelsHint": "Read from this account's product configuration. The draw tools pick their models from here: a prompt without an image uses a text-to-image model, one WITH an image uses an image-to-image model. Image rows are read-only (pass a model to the tool to change it); the VIDEO model is pinnable in the picker above.",
15275
15589
  "row.mediaModelsEmpty": "This region publishes no image or video model.",
@@ -15481,8 +15795,6 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15481
15795
  "row.probeRateLimitedAt": "✗ 被限流 · {at} 之后可再用",
15482
15796
  "row.probeModelBusyUnknown": "✗ 该模型当前负载较高 · 不是账号被限流——换账号没用,建议等待约 1 分钟或切换模型",
15483
15797
  "row.probeModelBusyAt": "✗ 该模型当前负载较高 · 不是账号被限流;{at} 之后可重试,或切换模型",
15484
- "row.probeOutOfCreditUnknown": "✗ 积分不足 · 上游未给出何时恢复",
15485
- "row.probeOutOfCreditAt": "✗ 积分不足 · 积分包 {at} 刷新",
15486
15798
  "row.probeCredentialRejected": "✗ WorkBuddy 拒绝了这个账号的 token——请重新登录或换一个账号",
15487
15799
  "row.probePolicyRejected": "✗ WorkBuddy 服务端按内容策略拒绝了这次请求——重新登录无效;可在桌面端验证或切换区域/账号",
15488
15800
  "row.probeChannelRejected": "✗ 网关拦的是提示词本身,不是这个账号——某条 system 消息的开头命中了它的第三方 agent 过滤,换账号或换区域都会得到同一个答案(测试能过、聊天被拒,正是这个原因)",
@@ -15533,7 +15845,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15533
15845
  "row.transferNoService": "与本地插件服务通信失败(本次发送 {size} KiB)。可能是文件过大,或服务正在重启——请重试;若持续失败,请精简文件后再导入。",
15534
15846
  "row.poolTitle": "账号池",
15535
15847
  "row.poolNoCandidate": "账号池里目前没有可用的账号。",
15536
- "row.poolNoCandidateHint": "成员要么在限流冷却中、要么积分耗尽、要么凭据被拒、要么上游无响应。限流、积分耗尽与瞬时故障都会自动回池——按上游给出的恢复时间,没给时间就按 30 分钟兜底,不需要你操作;只有「凭据被拒」需要重新登录。",
15848
+ "row.poolNoCandidateHint": "成员要么在限流冷却中、要么积分耗尽、要么凭据被拒、要么上游无响应。限流与瞬时故障会自动回池——按上游给出的恢复时间,没给时间就按 30 分钟兜底;积分耗尽则要等一次余额查询确认到账(签到或充值)后才回池。只有「凭据被拒」需要重新登录。",
15537
15849
  "row.poolModelWideBusy": "所有成员都卡在同一个模型上 —— 这是模型的问题,不是你的账号。",
15538
15850
  "row.poolModelWideBusyHint": "换账号解决不了:限制跟随模型,换一个账号撞的是同一堵墙。等大约 1 分钟,或把这个会话切到负载较低的模型。",
15539
15851
  "row.poolCheckinAll": "签到勾选的账号",
@@ -15578,6 +15890,9 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15578
15890
  "row.poolExcludedRateLimited": "被限流",
15579
15891
  "row.poolExcludedModelBusy": "模型繁忙",
15580
15892
  "row.poolExcludedOutOfCredit": "积分耗尽",
15893
+ "row.creditCheckinTomorrow": "明日签到后重试",
15894
+ "row.creditCheckinRetry": "签到后重试",
15895
+ "row.creditAwaitReplenishment": "等待积分补充",
15581
15896
  "row.poolExcludedRejected": "被拒绝",
15582
15897
  "row.poolExcludedAccountRestricted": "账号被上游限制使用",
15583
15898
  "row.poolExcludedUnusable": "不可用",
@@ -15650,7 +15965,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15650
15965
  "row.poolSelectedCount": "已选 {count} / {total}",
15651
15966
  "row.poolOrderRulesTitle": "本池如何挑选账号",
15652
15967
  "row.poolOrderRulesIntro": "池子总是先挑「现在确实能扣费的」账号。下面这些规则按顺序逐条比较,第一条分出胜负就停止,后面的只在平局时才看。",
15653
- "row.poolOrderRuleUsable": "1. 现在能扣费吗?被限流、积分耗尽、凭证被拒或调用失败的账号会被挪到后面,直到冷却结束。这一条优先级最高,压过下面的手动顺序。",
15968
+ "row.poolOrderRuleUsable": "1. 现在能扣费吗?被限流、凭证被拒或调用失败的账号会被挪到后面,直到冷却结束;积分耗尽的账号则要等一次余额查询确认到账后才回池。这一条优先级最高,压过下面的手动顺序。",
15654
15969
  "row.poolOrderRuleExpiring": "2. 有 3 天内会过期的积分吗?有就排前面。这一条同样压过手动顺序,原因见下方说明。",
15655
15970
  "row.poolOrderRuleManual": "3. 你排的手动顺序。就是用 ↑ / ↓ 设定的位置。没有手动排过的账号,会排在所有已排序账号之后。",
15656
15971
  "row.poolOrderRuleNearestExpiry": "4. 谁先过期?两个都有临期积分时,先到期的排前面。",
@@ -15677,7 +15992,12 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15677
15992
  "row.poolRankLabel": "第 {rank} 位",
15678
15993
  "row.poolRankManualTitle": "你在本池中手动把该账号排在第 {rank} 位。",
15679
15994
  "row.poolRankAuto": "自动排序",
15680
- "row.poolRankAutoTitle": "还没有手动排序:池会先花临期积分,再按余额多寡选号。用 ↑/↓ 自己指定顺序。",
15995
+ "row.poolRankAutoTitle": "自动排序:池会先花临期积分,再按余额多寡选号。想自己指定顺序,把上面的开关切到「手动排序」。",
15996
+ "row.poolSortModeTitle": "选号顺序",
15997
+ "row.poolSortAuto": "自动排序",
15998
+ "row.poolSortAutoTitle": "交给积分规则:先花临期积分,再按余额多寡选号。切到这里会清空手动顺序,勾选的账号不受影响。",
15999
+ "row.poolSortManual": "手动排序",
16000
+ "row.poolSortManualTitle": "按你排的顺序选号(顶部优先)。切到这里会保留当前屏幕上的顺序,之后用 ↑/↓ 调整。",
15681
16001
  "row.poolMoveUpTitle": "在本池顺序中上移该账号",
15682
16002
  "row.poolMoveDownTitle": "在本池顺序中下移该账号",
15683
16003
  "row.poolMoveUpAria": "在本池顺序中上移 {accountName}",
@@ -15729,7 +16049,7 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15729
16049
  "sdk.statusError": "SDK 加载失败",
15730
16050
  "sdk.statusDisabled": "已在设置里关闭",
15731
16051
  "sdk.masterLabel": "启用真实设备 SDK",
15732
- "sdk.masterHint": "开启时:查找本机安装的桌面端 SDK、在后台子进程里取设备 token,并每 10 分钟换新一次。关闭时这些事一件都不做——不查找、不起子进程、不预热——「真实值」档因此没有 token 可发。「虚拟值」档不受影响(它的 id 由本机盐派生),只想用虚拟设备的话关掉是安全的。",
16052
+ "sdk.masterHint": "开启时:查找本机安装的桌面端 SDK、在后台子进程里取设备 token,并每 10 分钟换新一次。关闭时这些事一件都不做——不查找、不起子进程、不预热——「真实值」档因此没有 token 可发。「虚拟值」档不受影响(它的 id 由本机盐派生),只想用虚拟设备的话关掉是安全的。开关即时生效:打开后立刻开始取,关掉即停掉定时器,都不用重载插件。",
15733
16053
  "sdk.bundle": "SDK",
15734
16054
  "sdk.runtime": "运行时",
15735
16055
  "sdk.fetched": "最近取到",
@@ -15824,6 +16144,10 @@ ${u} ${p}-pool .sw input:checked+.sw-track::after{transform:translateX(16px)}
15824
16144
  "row.videoModelLabel": "按模式指定视频模型",
15825
16145
  "row.videoModelHint": "文生视频与图生视频各钉一个,选项只来自当前这一区自己的目录——模型 id 不跨区。调用时不填 model 就用这里钉的;什么都没钉就用该组第一个模型。钉住的模型如果目录里已经没有了,会安静地回落到第一个,而不是让这次生成失败。",
15826
16146
  "row.videoModelDefault": "默认(组内第一个)",
16147
+ "row.imageModelLabel": "生图模型(水印)",
16148
+ "row.imageModelHint": "WorkBuddy 出图固定带「AI生成 WORKBUDD>」水印,上游没有关掉它的开关(issue #241)——唯一的等价做法是换模型:hunyuan-image-v3.0 出同样的图但不带水印。代价是单价约 11.1 积分/张(默认那条约 6),尺寸上限也小得多:边长 2048、总像素约 104 万,所以 1024x1536 会等比缩成 836x1254(比例不变,只是更小)。留在「默认」就是用便宜、带水印、尺寸档位全的那条。仅国内区有效。",
16149
+ "row.imageModelDefault": "默认(组内第一个,带水印)",
16150
+ "row.imageModelWatermarkFree": "Hunyuan Image v3.0(无水印——约 11.1 积分/张,尺寸上限更小)",
15827
16151
  "row.mediaModelsLabel": "本区可用的图像模型",
15828
16152
  "row.mediaModelsHint": "读自当前账号的产品配置。生图工具就按这里挑模型:不填图片走「文生图」那一组,填了图片走「图生图」那一组。「图像」那几行是只读的(想换就在调用工具时指定模型);「视频」模型可以在上面的选择器里钉住。",
15829
16153
  "row.mediaModelsEmpty": "这一区的产品配置里没有图像或视频模型。",