@eddyskywalker/dsh-chatgpt-subscription 0.89.0 → 0.90.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.
Files changed (68) hide show
  1. package/lib/client.js +1518 -293
  2. package/lib/client.js.map +1 -1
  3. package/lib/index.js +1240 -346
  4. package/lib/{plan-mode-Rrk8NKuk.js → plan-mode-CoublSCJ.js} +16 -1
  5. package/lib/plan-mode.js +1 -1
  6. package/lib/types/client/common/ContextWindowEditor.d.ts +2 -0
  7. package/lib/types/client/common/ContextWindowEditor.d.ts.map +1 -1
  8. package/lib/types/client/features/advisor/AdvisorModelOption.d.ts +52 -0
  9. package/lib/types/client/features/advisor/AdvisorModelOption.d.ts.map +1 -0
  10. package/lib/types/client/features/advisor/locales.d.ts +47 -0
  11. package/lib/types/client/features/advisor/locales.d.ts.map +1 -0
  12. package/lib/types/client/features/advisor/styles.d.ts +2 -0
  13. package/lib/types/client/features/advisor/styles.d.ts.map +1 -0
  14. package/lib/types/client/features/progress-updates/locales.d.ts +38 -2
  15. package/lib/types/client/features/progress-updates/locales.d.ts.map +1 -1
  16. package/lib/types/client/features/progress-updates/settings-binding.d.ts +13 -1
  17. package/lib/types/client/features/progress-updates/settings-binding.d.ts.map +1 -1
  18. package/lib/types/client/features/progress-updates/settings-section.d.ts +33 -0
  19. package/lib/types/client/features/progress-updates/settings-section.d.ts.map +1 -1
  20. package/lib/types/client/features/progress-updates/styles.d.ts.map +1 -1
  21. package/lib/types/client/index.d.ts +2 -0
  22. package/lib/types/client/index.d.ts.map +1 -1
  23. package/lib/types/client/locales-ru/advisor.d.ts +3 -0
  24. package/lib/types/client/locales-ru/advisor.d.ts.map +1 -0
  25. package/lib/types/client/locales-ru/claude.d.ts.map +1 -1
  26. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  27. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  28. package/lib/types/client/providers/claude/ClaudeSection.d.ts.map +1 -1
  29. package/lib/types/client/providers/claude/locales.d.ts +26 -5
  30. package/lib/types/client/providers/claude/locales.d.ts.map +1 -1
  31. package/lib/types/client/providers/claude/useClaudeSection.d.ts +9 -0
  32. package/lib/types/client/providers/claude/useClaudeSection.d.ts.map +1 -1
  33. package/lib/types/compat.d.ts +1 -1
  34. package/lib/types/host/providers/_claude-shared/claude-code-cch.d.ts +9 -1
  35. package/lib/types/host/providers/_claude-shared/claude-code-cch.d.ts.map +1 -1
  36. package/lib/types/host/providers/aws-quick/adapter.d.ts.map +1 -1
  37. package/lib/types/host/providers/aws-quick/client.d.ts +2 -0
  38. package/lib/types/host/providers/aws-quick/client.d.ts.map +1 -1
  39. package/lib/types/host/providers/claude/adapter.d.ts +8 -0
  40. package/lib/types/host/providers/claude/adapter.d.ts.map +1 -1
  41. package/lib/types/host/providers/claude/mapper.d.ts +7 -0
  42. package/lib/types/host/providers/claude/mapper.d.ts.map +1 -1
  43. package/lib/types/host/providers/claude/routes.d.ts.map +1 -1
  44. package/lib/types/host/providers/claude/token-store.d.ts +16 -0
  45. package/lib/types/host/providers/claude/token-store.d.ts.map +1 -1
  46. package/lib/types/host/providers/claude/types.d.ts +2 -0
  47. package/lib/types/host/providers/claude/types.d.ts.map +1 -1
  48. package/lib/types/host/providers/claude-api/mapper.d.ts.map +1 -1
  49. package/lib/types/host/runtime/advisor/index.d.ts +28 -0
  50. package/lib/types/host/runtime/advisor/index.d.ts.map +1 -0
  51. package/lib/types/host/runtime/advisor/prompt.d.ts +3 -0
  52. package/lib/types/host/runtime/advisor/prompt.d.ts.map +1 -0
  53. package/lib/types/host/runtime/advisor/request.d.ts +28 -0
  54. package/lib/types/host/runtime/advisor/request.d.ts.map +1 -0
  55. package/lib/types/host/runtime/advisor/selection-store.d.ts +30 -0
  56. package/lib/types/host/runtime/advisor/selection-store.d.ts.map +1 -0
  57. package/lib/types/host/runtime/advisor/transcript.d.ts +22 -0
  58. package/lib/types/host/runtime/advisor/transcript.d.ts.map +1 -0
  59. package/lib/types/host/runtime/guards/dispatch-execution-guard.d.ts +5 -0
  60. package/lib/types/host/runtime/guards/dispatch-execution-guard.d.ts.map +1 -1
  61. package/lib/types/host/runtime/guards/subagent-model-authorization.d.ts.map +1 -1
  62. package/lib/types/index.d.ts +22 -0
  63. package/lib/types/index.d.ts.map +1 -1
  64. package/lib/types/shared/advisor-contracts.d.ts +62 -0
  65. package/lib/types/shared/advisor-contracts.d.ts.map +1 -0
  66. package/lib/types/shared/claude-contracts.d.ts +8 -0
  67. package/lib/types/shared/claude-contracts.d.ts.map +1 -1
  68. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -611,7 +611,7 @@ window.__ModuleLoader__.load({
611
611
  //#endregion
612
612
  //#region src/client/providers/codex-chatgpt/locales.ts
613
613
  const NS = "dsh-chatgpt-subscription";
614
- const zh$23 = {
614
+ const zh$24 = {
615
615
  ...accountPoolZh,
616
616
  title: "ChatGPT",
617
617
  hubTitle: "订阅服务",
@@ -887,8 +887,8 @@ window.__ModuleLoader__.load({
887
887
  codeRunFailed: "失败",
888
888
  codeRunStopped: "已停止"
889
889
  };
890
- const dictionaries$23 = {
891
- zh: zh$23,
890
+ const dictionaries$24 = {
891
+ zh: zh$24,
892
892
  en: {
893
893
  ...accountPoolEn,
894
894
  title: "ChatGPT",
@@ -1277,7 +1277,7 @@ window.__ModuleLoader__.load({
1277
1277
  * reads).
1278
1278
  */
1279
1279
  function LineProxySection({ line, fetchSnapshot, onSave, idPrefix, snapshot: provided }) {
1280
- const labels = useLineDict(NS, zh$23);
1280
+ const labels = useLineDict(NS, zh$24);
1281
1281
  const readSnapshotFromRoute = (0, react.useCallback)(() => (fetchSnapshot ?? (() => fetchLineProxySnapshot("/api/dsh-chatgpt-subscription")))(), [fetchSnapshot]);
1282
1282
  const writePreferences = (0, react.useCallback)((patch) => (onSave ?? ((next) => savePreferences("/api/dsh-chatgpt-subscription", next)))(patch), [onSave]);
1283
1283
  const [readSnapshot, setReadSnapshot] = (0, react.useState)(null);
@@ -2692,7 +2692,7 @@ window.__ModuleLoader__.load({
2692
2692
  * still override any label through the checklist's `labels` prop.
2693
2693
  */
2694
2694
  const NS_MODEL_CHECKLIST = "dsh-model-checklist";
2695
- const zh$22 = {
2695
+ const zh$23 = {
2696
2696
  allGroups: "全部",
2697
2697
  enabledGroup: "已启用",
2698
2698
  otherGroup: "其他",
@@ -2700,7 +2700,7 @@ window.__ModuleLoader__.load({
2700
2700
  noMatches: "没有匹配的模型",
2701
2701
  groupsNav: "模型厂商"
2702
2702
  };
2703
- const en$22 = {
2703
+ const en$23 = {
2704
2704
  allGroups: "All",
2705
2705
  enabledGroup: "Enabled",
2706
2706
  otherGroup: "Other",
@@ -2708,10 +2708,10 @@ window.__ModuleLoader__.load({
2708
2708
  noMatches: "No matching models",
2709
2709
  groupsNav: "Model vendors"
2710
2710
  };
2711
- const modelChecklistZh = zh$22;
2712
- const dictionaries$22 = {
2713
- zh: zh$22,
2714
- en: en$22
2711
+ const modelChecklistZh = zh$23;
2712
+ const dictionaries$23 = {
2713
+ zh: zh$23,
2714
+ en: en$23
2715
2715
  };
2716
2716
  //#endregion
2717
2717
  //#region src/client/common/model-vendors.ts
@@ -4704,7 +4704,7 @@ window.__ModuleLoader__.load({
4704
4704
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4705
4705
  type: "button",
4706
4706
  className: "dsha-context-save dsha-context-reset",
4707
- "aria-label": `${row.name} ${labels.reset}`,
4707
+ "aria-label": row.resetLabel ?? `${row.name} ${labels.reset}`,
4708
4708
  disabled: row.saving || !row.hasOverride,
4709
4709
  onClick: () => onReset(row.id),
4710
4710
  children: labels.reset
@@ -4777,7 +4777,7 @@ window.__ModuleLoader__.load({
4777
4777
  //#endregion
4778
4778
  //#region src/client/providers/command-code/locales.ts
4779
4779
  const NS_COMMAND_CODE = "dsh-command-code";
4780
- const zh$21 = {
4780
+ const zh$22 = {
4781
4781
  ...accountPoolZh,
4782
4782
  title: "Command Code",
4783
4783
  pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。",
@@ -4851,7 +4851,7 @@ window.__ModuleLoader__.load({
4851
4851
  loginFailed: "登录失败",
4852
4852
  tokens: "tokens"
4853
4853
  };
4854
- const en$21 = {
4854
+ const en$22 = {
4855
4855
  ...accountPoolEn,
4856
4856
  title: "Command Code",
4857
4857
  pageDesc: "Sign in to Command Code and manage models, context windows, and quota.",
@@ -4925,11 +4925,11 @@ window.__ModuleLoader__.load({
4925
4925
  loginFailed: "Sign-in failed",
4926
4926
  tokens: "tokens"
4927
4927
  };
4928
- const dictionaries$21 = {
4929
- zh: zh$21,
4930
- "zh-CN": zh$21,
4931
- en: en$21,
4932
- "en-US": en$21
4928
+ const dictionaries$22 = {
4929
+ zh: zh$22,
4930
+ "zh-CN": zh$22,
4931
+ en: en$22,
4932
+ "en-US": en$22
4933
4933
  };
4934
4934
  //#endregion
4935
4935
  //#region src/client/providers/command-code/model-vendors.ts
@@ -4976,7 +4976,7 @@ window.__ModuleLoader__.load({
4976
4976
  const [apiKey, setApiKey] = (0, react.useState)("");
4977
4977
  /** Follow-up poll owed while the host refreshes the quota behind an answer. */
4978
4978
  const quotaFollowUp = (0, react.useRef)(null);
4979
- const t = useLineDict(NS_COMMAND_CODE, zh$21);
4979
+ const t = useLineDict(NS_COMMAND_CODE, zh$22);
4980
4980
  const notifyChange = (0, react.useCallback)(() => {
4981
4981
  onModelChange?.();
4982
4982
  loadModelDirectory?.();
@@ -5752,7 +5752,7 @@ window.__ModuleLoader__.load({
5752
5752
  //#endregion
5753
5753
  //#region src/client/providers/kimi-code/locales.ts
5754
5754
  const NS_KIMI_CODE = "dsh-kimi-code";
5755
- const zh$20 = {
5755
+ const zh$21 = {
5756
5756
  ...accountPoolZh,
5757
5757
  title: "Kimi Code",
5758
5758
  pageDesc: "登录 Kimi Code 订阅,管理模型、思考档位、上下文窗口与额度。",
@@ -5948,7 +5948,7 @@ window.__ModuleLoader__.load({
5948
5948
  compactionRouteNoImage: "该模型不接受图片:摘要里的截图会被替换为占位文本。",
5949
5949
  compactionRouteEmpty: "没有可用的线路——先登录任意一条线路再回来设置。"
5950
5950
  };
5951
- const en$20 = {
5951
+ const en$21 = {
5952
5952
  ...accountPoolEn,
5953
5953
  title: "Kimi Code",
5954
5954
  pageDesc: "Sign in to the Kimi Code subscription and manage models, thinking level, context windows, and quota.",
@@ -6144,11 +6144,11 @@ window.__ModuleLoader__.load({
6144
6144
  compactionRouteNoImage: "This model takes no images: screenshots become placeholder text in the summary.",
6145
6145
  compactionRouteEmpty: "No route is available — sign in to one first."
6146
6146
  };
6147
- const dictionaries$20 = {
6148
- zh: zh$20,
6149
- "zh-CN": zh$20,
6150
- en: en$20,
6151
- "en-US": en$20
6147
+ const dictionaries$21 = {
6148
+ zh: zh$21,
6149
+ "zh-CN": zh$21,
6150
+ en: en$21,
6151
+ "en-US": en$21
6152
6152
  };
6153
6153
  //#endregion
6154
6154
  //#region src/shared/kimi-code-contracts.ts
@@ -6260,7 +6260,7 @@ window.__ModuleLoader__.load({
6260
6260
  return `${value}x`;
6261
6261
  }
6262
6262
  function KimiModelCapabilities({ models }) {
6263
- const t = useLineDict(NS_KIMI_CODE, zh$20);
6263
+ const t = useLineDict(NS_KIMI_CODE, zh$21);
6264
6264
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6265
6265
  className: "dsha-cap-table",
6266
6266
  children: [
@@ -6792,7 +6792,7 @@ window.__ModuleLoader__.load({
6792
6792
  statusGeneration.current += 1;
6793
6793
  setStatus(next);
6794
6794
  }, []);
6795
- const t = useLineDict(NS_KIMI_CODE, zh$20);
6795
+ const t = useLineDict(NS_KIMI_CODE, zh$21);
6796
6796
  const notifyChange = (0, react.useCallback)(() => {
6797
6797
  onModelChange?.();
6798
6798
  loadModelDirectory?.();
@@ -7694,7 +7694,7 @@ window.__ModuleLoader__.load({
7694
7694
  //#endregion
7695
7695
  //#region src/client/providers/minimax-code/locales.ts
7696
7696
  const NS_MINIMAX_CODE = "dsh-minimax-code";
7697
- const zh$19 = {
7697
+ const zh$20 = {
7698
7698
  ...accountPoolZh,
7699
7699
  title: "MiniMax Code",
7700
7700
  pageDesc: "登录 MiniMax Code 编程订阅(设备码 OAuth),复用本机 MiniMax Code 的登录态,管理账号、连接与模型。",
@@ -7892,7 +7892,7 @@ window.__ModuleLoader__.load({
7892
7892
  videoHistoryEncrypted: "已由系统凭据后端加密",
7893
7893
  videoHistoryPlain: "本机没有可用的凭据后端,记录为明文"
7894
7894
  };
7895
- const en$19 = {
7895
+ const en$20 = {
7896
7896
  ...accountPoolEn,
7897
7897
  title: "MiniMax Code",
7898
7898
  pageDesc: "Sign in to the MiniMax Code coding subscription (device-code OAuth) and reuse the local MiniMax Code sign-in to manage the account, connection, and models.",
@@ -8090,11 +8090,11 @@ window.__ModuleLoader__.load({
8090
8090
  videoHistoryEncrypted: "Encrypted by the platform credential backend",
8091
8091
  videoHistoryPlain: "No credential backend on this host; stored as plain text"
8092
8092
  };
8093
- const dictionaries$19 = {
8094
- zh: zh$19,
8095
- "zh-CN": zh$19,
8096
- en: en$19,
8097
- "en-US": en$19
8093
+ const dictionaries$20 = {
8094
+ zh: zh$20,
8095
+ "zh-CN": zh$20,
8096
+ en: en$20,
8097
+ "en-US": en$20
8098
8098
  };
8099
8099
  //#endregion
8100
8100
  //#region src/client/providers/minimax-code/useMinimaxCodeSection.ts
@@ -8108,7 +8108,7 @@ window.__ModuleLoader__.load({
8108
8108
  * rather than inferred from the JSX.
8109
8109
  */
8110
8110
  /** The card's own dictionary; stable identity keeps effect dependencies intact. */
8111
- const fallbackTranslate$7 = (key) => zh$19[key];
8111
+ const fallbackTranslate$7 = (key) => zh$20[key];
8112
8112
  /**
8113
8113
  * The shared pool card's labels, resolved through this card's dictionary.
8114
8114
  *
@@ -10124,7 +10124,7 @@ window.__ModuleLoader__.load({
10124
10124
  * 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
10125
10125
  */
10126
10126
  const NS_GLM_CODING_PLAN = "dsh-glm-coding-plan";
10127
- const zh$18 = {
10127
+ const zh$19 = {
10128
10128
  ...accountPoolZh,
10129
10129
  title: "GLM(ZCode 账号)",
10130
10130
  pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。",
@@ -10218,7 +10218,7 @@ window.__ModuleLoader__.load({
10218
10218
  quotaAllowanceUnknown: "未判定",
10219
10219
  quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」指新用户注册后自动获得、首次使用起 5 天内每天 800 万 token 的体验额度。"
10220
10220
  };
10221
- const en$18 = {
10221
+ const en$19 = {
10222
10222
  ...accountPoolEn,
10223
10223
  title: "GLM (ZCode account)",
10224
10224
  pageDesc: "Sign in with a ZCode account to reach GLM Coding Plan (China bigmodel.cn / International z.ai), and manage the account pool, plan quota and model selection. The two regions hold independent credentials, so a pool can carry accounts from both.",
@@ -10312,11 +10312,11 @@ window.__ModuleLoader__.load({
10312
10312
  quotaAllowanceUnknown: "Undetermined",
10313
10313
  quotaAllowanceHint: "The allowance source established by the sign-in probe. “Free trial allowance” means 8M tokens per day for 5 days from first use, granted automatically to new accounts."
10314
10314
  };
10315
- const dictionaries$18 = {
10316
- zh: zh$18,
10317
- "zh-CN": zh$18,
10318
- en: en$18,
10319
- "en-US": en$18
10315
+ const dictionaries$19 = {
10316
+ zh: zh$19,
10317
+ "zh-CN": zh$19,
10318
+ en: en$19,
10319
+ "en-US": en$19
10320
10320
  };
10321
10321
  /** 一个配额窗口的键到「窗口长度(分钟)」的映射。 */
10322
10322
  const QUOTA_WINDOW_MINUTES$1 = {
@@ -10397,7 +10397,7 @@ window.__ModuleLoader__.load({
10397
10397
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
10398
10398
  const LOGIN_POLL_INTERVAL_MS$2 = 2e3;
10399
10399
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
10400
- const fallbackTranslate$6 = (key) => zh$18[key];
10400
+ const fallbackTranslate$6 = (key) => zh$19[key];
10401
10401
  /**
10402
10402
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
10403
10403
  *
@@ -10823,7 +10823,7 @@ window.__ModuleLoader__.load({
10823
10823
  const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
10824
10824
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels } = derived;
10825
10825
  const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, refreshQuota, refreshCatalog, testConnection } = actions;
10826
- const t = useLineDict(NS_GLM_CODING_PLAN, zh$18);
10826
+ const t = useLineDict(NS_GLM_CODING_PLAN, zh$19);
10827
10827
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10828
10828
  className: "dsha-page",
10829
10829
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -11289,7 +11289,7 @@ window.__ModuleLoader__.load({
11289
11289
  * provider — the same reason every sibling line has one.
11290
11290
  */
11291
11291
  const NS_CLAUDE = "dsh-claude";
11292
- const zh$17 = {
11292
+ const zh$18 = {
11293
11293
  ...accountPoolZh,
11294
11294
  title: "Claude(订阅)",
11295
11295
  pageDesc: "登录 Claude Pro/Max 订阅,管理模型、思考档位、上下文窗口与额度。",
@@ -11354,11 +11354,14 @@ window.__ModuleLoader__.load({
11354
11354
  defaultReasoningEffort: "默认思考档位",
11355
11355
  defaultReasoningEffortHint: "下拉列出的是目录中出现过的全部档位(含 xhigh);每个模型真正支持的档位见下方列表,Host 按模型自身的阶梯发送。",
11356
11356
  defaultEffortAuto: "使用模型默认值",
11357
- cacheTtl: "提示缓存时长",
11357
+ cacheTtl: "主对话的提示缓存时长",
11358
11358
  cacheTtlHint: "Anthropic 提供 5 分钟与 1 小时两档。订阅用户在套餐额度内,官方 Claude Code 对主对话默认使用 1 小时;超出额度改按用量计费后官方会降回 5 分钟。1 小时写入更贵,短会话不划算。选择 1 小时(含「跟随官方」)时,子代理或后台任务运行期间本线路约每 55 分钟发一次很小的续热请求,避免缓存过期;5 分钟时长不会这样做。",
11359
11359
  cacheTtlSubscription: "跟随官方(订阅默认 1 小时)",
11360
11360
  cacheTtl1h: "1 小时",
11361
11361
  cacheTtl5m: "5 分钟",
11362
+ subagentCacheTtl: "子代理与后台请求的缓存时长",
11363
+ subagentCacheTtlHint: "子代理、上下文压缩、生成标题等主对话以外的请求。官方 Claude Code 对这些请求使用 5 分钟:它们通常几分钟内就结束,用不上 1 小时,而 1 小时档写入更贵。",
11364
+ subagentCacheTtlOfficial: "跟随官方(5 分钟)",
11362
11365
  fastMode: "快速模式",
11363
11366
  fastModeHint: "仅对支持的模型发送 speed: fast;被拒时自动纠正,并按账号和模型记住结论。",
11364
11367
  cacheKeepalive: "cache-keepalive(cache_touch)",
@@ -11375,6 +11378,10 @@ window.__ModuleLoader__.load({
11375
11378
  contextWindowReset: "恢复默认",
11376
11379
  contextWindowResetAll: "全部恢复默认",
11377
11380
  contextWindowResetAllConfirm: "确定把已改过的模型上下文窗口全部恢复为默认值吗?",
11381
+ maxTokensSection: "单次输出上限",
11382
+ maxTokensHint: "每次回复最多输出多少 token,思考也计入其中。默认是模型本身的上限。调低可以给对话多留上下文,但回复写到上限就会被截断,这一轮也随之结束。",
11383
+ maxTokensInvalid: "输出上限无效:{value}",
11384
+ maxTokensResetAllConfirm: "确定把已改过的模型输出上限全部恢复为默认值吗?",
11378
11385
  contextWindowNoneEnabled: "还没有勾选任何模型。在上方勾选后,这里会出现该模型的上下文窗口设置。",
11379
11386
  contextWindowInvalid: "上下文长度无效:{value}",
11380
11387
  save: "保存",
@@ -11410,7 +11417,7 @@ window.__ModuleLoader__.load({
11410
11417
  copy: "复制",
11411
11418
  copied: "已复制"
11412
11419
  };
11413
- const en$17 = {
11420
+ const en$18 = {
11414
11421
  ...accountPoolEn,
11415
11422
  title: "Claude (subscription)",
11416
11423
  pageDesc: "Sign in to a Claude Pro/Max subscription and manage models, thinking levels, context windows and quota.",
@@ -11474,11 +11481,14 @@ window.__ModuleLoader__.load({
11474
11481
  enhanced: "Thinking",
11475
11482
  defaultReasoningEffort: "Default thinking level",
11476
11483
  defaultReasoningEffortHint: "The list is every level the catalog names (xhigh included); the per-model ladder is listed below, and the Host sends what that model itself accepts.",
11477
- cacheTtl: "Prompt cache duration",
11484
+ cacheTtl: "Prompt cache duration for the main conversation",
11478
11485
  cacheTtlHint: "Anthropic offers 5-minute and 1-hour tiers. While a subscription is drawing on included plan usage, the official Claude Code uses the hour for the main conversation; once the plan is exhausted and requests bill against usage credits, it drops back to five minutes. A 1-hour write costs more, so it does not pay off for short sessions. With the 1-hour duration (including \"follow the official\"), while subagents or background tasks are running the line sends one small keepalive request about every 55 minutes so the cache does not expire; the 5-minute duration never does this.",
11479
11486
  cacheTtlSubscription: "Follow the official (subscription default 1h)",
11480
11487
  cacheTtl1h: "1 hour",
11481
11488
  cacheTtl5m: "5 minutes",
11489
+ subagentCacheTtl: "Cache duration for subagents and background requests",
11490
+ subagentCacheTtlHint: "Subagents, context compaction, titles and other requests outside the main conversation. The official Claude Code uses 5 minutes for these: they usually finish within minutes, and the 1-hour tier costs more to write.",
11491
+ subagentCacheTtlOfficial: "Follow the official (5 minutes)",
11482
11492
  fastMode: "Fast mode",
11483
11493
  fastModeHint: "Sends speed: fast only for supported models; corrects refusals and remembers the result per account and model.",
11484
11494
  cacheKeepalive: "cache-keepalive (cache_touch)",
@@ -11496,6 +11506,10 @@ window.__ModuleLoader__.load({
11496
11506
  contextWindowReset: "Restore default",
11497
11507
  contextWindowResetAll: "Restore all defaults",
11498
11508
  contextWindowResetAllConfirm: "Restore every changed model context window to its default?",
11509
+ maxTokensSection: "Output limit per reply",
11510
+ maxTokensHint: "How many tokens one reply may produce, thinking included. The default is the model's own limit. Lowering it leaves more room for the conversation, but a reply that reaches it is cut off and the turn ends.",
11511
+ maxTokensInvalid: "Invalid output limit: {value}",
11512
+ maxTokensResetAllConfirm: "Restore every changed model output limit to its default?",
11499
11513
  contextWindowNoneEnabled: "No model is checked yet. Check one above and its context window setting appears here.",
11500
11514
  contextWindowInvalid: "Invalid context capacity: {value}",
11501
11515
  save: "Save",
@@ -11531,11 +11545,11 @@ window.__ModuleLoader__.load({
11531
11545
  copy: "Copy",
11532
11546
  copied: "Copied"
11533
11547
  };
11534
- const dictionaries$17 = {
11535
- zh: zh$17,
11536
- "zh-CN": zh$17,
11537
- en: en$17,
11538
- "en-US": en$17
11548
+ const dictionaries$18 = {
11549
+ zh: zh$18,
11550
+ "zh-CN": zh$18,
11551
+ en: en$18,
11552
+ "en-US": en$18
11539
11553
  };
11540
11554
  //#endregion
11541
11555
  //#region src/client/providers/claude/useClaudeSection.ts
@@ -11566,10 +11580,16 @@ window.__ModuleLoader__.load({
11566
11580
  const [pasteValue, setPasteValue] = (0, react.useState)("");
11567
11581
  const [contextDrafts, setContextDrafts] = (0, react.useState)({});
11568
11582
  const [savingModel, setSavingModel] = (0, react.useState)(null);
11583
+ const [maxTokensDrafts, setMaxTokensDrafts] = (0, react.useState)({});
11584
+ const maxTokensKey = JSON.stringify([status?.maxTokensOverrides ?? {}, (status?.models ?? []).map((model) => [model.id, model.defaultMaxTokens])]);
11585
+ (0, react.useEffect)(() => {
11586
+ const [overrides, defaults] = JSON.parse(maxTokensKey);
11587
+ setMaxTokensDrafts(Object.fromEntries(defaults.map(([id, fallback]) => [id, formatCapacity$1(overrides[id] ?? fallback)])));
11588
+ }, [maxTokensKey]);
11569
11589
  const [connection, setConnection] = (0, react.useState)(null);
11570
11590
  /** Follow-up poll owed while the host refreshes the quota behind an answer. */
11571
11591
  const quotaFollowUp = (0, react.useRef)(null);
11572
- const t = useLineDict(NS_CLAUDE, zh$17);
11592
+ const t = useLineDict(NS_CLAUDE, zh$18);
11573
11593
  const notifyChange = (0, react.useCallback)(() => {
11574
11594
  onModelChange?.();
11575
11595
  loadModelDirectory?.();
@@ -11863,6 +11883,18 @@ window.__ModuleLoader__.load({
11863
11883
  reportError(err);
11864
11884
  }
11865
11885
  };
11886
+ const updateSubagentCacheTtl = async (ttl) => {
11887
+ try {
11888
+ const updated = await api$16.request("/settings", {
11889
+ method: "POST",
11890
+ body: JSON.stringify({ subagentCacheTtl: ttl })
11891
+ });
11892
+ setStatus(updated);
11893
+ notifyChange();
11894
+ } catch (err) {
11895
+ reportError(err);
11896
+ }
11897
+ };
11866
11898
  const updateBooleanSetting = async (field, checked) => {
11867
11899
  try {
11868
11900
  const updated = await api$16.request("/settings", {
@@ -11954,6 +11986,47 @@ window.__ModuleLoader__.load({
11954
11986
  setBusy(null);
11955
11987
  }
11956
11988
  };
11989
+ const postMaxTokens = async (patch, modelId) => {
11990
+ try {
11991
+ if (modelId === null) setBusy("maxTokens");
11992
+ else setSavingModel(modelId);
11993
+ setError(null);
11994
+ const updated = await api$16.request("/settings", {
11995
+ method: "POST",
11996
+ body: JSON.stringify({ maxTokensOverrides: patch })
11997
+ });
11998
+ setStatus(updated);
11999
+ notifyChange();
12000
+ } catch (err) {
12001
+ reportError(err);
12002
+ } finally {
12003
+ if (modelId === null) setBusy(null);
12004
+ else setSavingModel(null);
12005
+ }
12006
+ };
12007
+ const saveMaxTokens = async (modelId) => {
12008
+ const raw = maxTokensDrafts[modelId] || "";
12009
+ const parsed = parsePositiveCapacity$1(raw);
12010
+ if (parsed === null) {
12011
+ setError(t.maxTokensInvalid.replace("{value}", raw));
12012
+ return;
12013
+ }
12014
+ await postMaxTokens({ [modelId]: parsed }, modelId);
12015
+ };
12016
+ /** `null` restores the model's own limit; the host deletes the saved value. */
12017
+ const resetMaxTokens = (modelId) => postMaxTokens({ [modelId]: null }, modelId);
12018
+ const resetAllMaxTokens = async () => {
12019
+ const models = Object.keys(status?.maxTokensOverrides ?? {});
12020
+ if (models.length === 0) return;
12021
+ if (typeof window !== "undefined" && !window.confirm(t.maxTokensResetAllConfirm)) return;
12022
+ await postMaxTokens(Object.fromEntries(models.map((model) => [model, null])), null);
12023
+ };
12024
+ const updateMaxTokensDraft = (modelId, draft) => {
12025
+ setMaxTokensDrafts((prev) => ({
12026
+ ...prev,
12027
+ [modelId]: draft
12028
+ }));
12029
+ };
11957
12030
  const updateContextDraft = (modelId, draft) => {
11958
12031
  setContextDrafts((prev) => ({
11959
12032
  ...prev,
@@ -11964,6 +12037,7 @@ window.__ModuleLoader__.load({
11964
12037
  const hasAdopted = accounts.some((account) => account.adopted === true || account.removable === false);
11965
12038
  const contextModels = status?.models.filter((model) => model.enabled) ?? [];
11966
12039
  const overrideCount = Object.keys(status?.contextWindowOverrides ?? {}).length;
12040
+ const maxTokensOverrideCount = Object.keys(status?.maxTokensOverrides ?? {}).length;
11967
12041
  const quota = status?.quota;
11968
12042
  const windows = quota?.windows ?? [];
11969
12043
  return {
@@ -11976,6 +12050,7 @@ window.__ModuleLoader__.load({
11976
12050
  connection,
11977
12051
  pasteValue,
11978
12052
  contextDrafts,
12053
+ maxTokensDrafts,
11979
12054
  savingModel
11980
12055
  },
11981
12056
  derived: {
@@ -11983,6 +12058,7 @@ window.__ModuleLoader__.load({
11983
12058
  hasAdopted,
11984
12059
  contextModels,
11985
12060
  overrideCount,
12061
+ maxTokensOverrideCount,
11986
12062
  quota,
11987
12063
  windows,
11988
12064
  poolLabels: t
@@ -12003,11 +12079,16 @@ window.__ModuleLoader__.load({
12003
12079
  setAllModels,
12004
12080
  updateEffort,
12005
12081
  updateCacheTtl,
12082
+ updateSubagentCacheTtl,
12006
12083
  updateFastMode,
12007
12084
  updateCacheKeepalive,
12008
12085
  saveContextWindow,
12009
12086
  resetContextWindow,
12010
12087
  resetAllContextWindows,
12088
+ updateMaxTokensDraft,
12089
+ saveMaxTokens,
12090
+ resetMaxTokens,
12091
+ resetAllMaxTokens,
12011
12092
  updateContextDraft,
12012
12093
  setPasteValue
12013
12094
  }
@@ -12032,11 +12113,11 @@ window.__ModuleLoader__.load({
12032
12113
  * out here would hide a choice the host would accept and a catalog may expose.
12033
12114
  */
12034
12115
  const EFFORT_LABELS$2 = {
12035
- low: zh$17.effortLow,
12036
- medium: zh$17.effortMedium,
12037
- high: zh$17.effortHigh,
12038
- xhigh: zh$17.effortXHigh,
12039
- max: zh$17.effortMax
12116
+ low: zh$18.effortLow,
12117
+ medium: zh$18.effortMedium,
12118
+ high: zh$18.effortHigh,
12119
+ xhigh: zh$18.effortXHigh,
12120
+ max: zh$18.effortMax
12040
12121
  };
12041
12122
  /** One-line capability summary shown as a model pill's hover title. */
12042
12123
  function modelFacts(model, t) {
@@ -12054,10 +12135,10 @@ window.__ModuleLoader__.load({
12054
12135
  onModelChange,
12055
12136
  loadModelDirectory
12056
12137
  });
12057
- const { status, loading, busy, error, flow, connection, pasteValue, contextDrafts, savingModel } = state;
12058
- const { accounts, hasAdopted, contextModels, overrideCount, quota, windows, poolLabels } = derived;
12059
- const { login, cancelLogin, submitPaste, adopt, stopImporting, accountAction, setStrategy, relogin, refreshQuota, refreshCatalog, testConnection, toggleModel, setAllModels, updateEffort, updateCacheTtl, updateFastMode, updateCacheKeepalive, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setPasteValue } = actions;
12060
- const t = useLineDict(NS_CLAUDE, zh$17);
12138
+ const { status, loading, busy, error, flow, connection, pasteValue, contextDrafts, savingModel, maxTokensDrafts } = state;
12139
+ const { accounts, hasAdopted, contextModels, overrideCount, maxTokensOverrideCount, quota, windows, poolLabels } = derived;
12140
+ const { login, cancelLogin, submitPaste, adopt, stopImporting, accountAction, setStrategy, relogin, refreshQuota, refreshCatalog, testConnection, toggleModel, setAllModels, updateEffort, updateCacheTtl, updateSubagentCacheTtl, updateFastMode, updateCacheKeepalive, saveContextWindow, resetContextWindow, resetAllContextWindows, updateMaxTokensDraft, saveMaxTokens, resetMaxTokens, resetAllMaxTokens, updateContextDraft, setPasteValue } = actions;
12141
+ const t = useLineDict(NS_CLAUDE, zh$18);
12061
12142
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12062
12143
  className: "dsha-page",
12063
12144
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -12348,6 +12429,36 @@ window.__ModuleLoader__.load({
12348
12429
  ]
12349
12430
  })]
12350
12431
  }),
12432
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12433
+ className: "dsha-pref-row",
12434
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.subagentCacheTtl }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
12435
+ className: "dsha-muted",
12436
+ children: t.subagentCacheTtlHint
12437
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
12438
+ className: "dsha-select",
12439
+ "aria-label": t.subagentCacheTtl,
12440
+ value: status?.subagentCacheTtl ?? "",
12441
+ disabled: busy !== null,
12442
+ onChange: (event) => {
12443
+ const value = event.currentTarget.value;
12444
+ updateSubagentCacheTtl(value === "" ? null : value);
12445
+ },
12446
+ children: [
12447
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12448
+ value: "",
12449
+ children: t.subagentCacheTtlOfficial
12450
+ }),
12451
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12452
+ value: "1h",
12453
+ children: t.cacheTtl1h
12454
+ }),
12455
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
12456
+ value: "5m",
12457
+ children: t.cacheTtl5m
12458
+ })
12459
+ ]
12460
+ })]
12461
+ }),
12351
12462
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12352
12463
  className: "dsha-pref-row",
12353
12464
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.fastMode }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -12434,6 +12545,44 @@ window.__ModuleLoader__.load({
12434
12545
  })
12435
12546
  ]
12436
12547
  }),
12548
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12549
+ className: "dsha-group",
12550
+ children: [
12551
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12552
+ className: "dsha-grouphead",
12553
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.maxTokensSection })
12554
+ }),
12555
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
12556
+ className: "dsha-muted",
12557
+ children: t.maxTokensHint
12558
+ }),
12559
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextWindowEditor, {
12560
+ rows: contextModels.map((model) => ({
12561
+ id: model.id,
12562
+ name: model.name,
12563
+ draft: maxTokensDrafts[model.id] ?? "",
12564
+ inputLabel: `${model.name} max output tokens`,
12565
+ resetLabel: `${model.name} ${t.maxTokensSection} ${t.contextWindowReset}`,
12566
+ hasOverride: status?.maxTokensOverrides?.[model.id] !== void 0,
12567
+ saving: savingModel === model.id
12568
+ })),
12569
+ labels: {
12570
+ tokens: t.tokens,
12571
+ save: t.save,
12572
+ saving: t.saving,
12573
+ reset: t.contextWindowReset,
12574
+ resetAll: t.contextWindowResetAll,
12575
+ empty: t.contextWindowNoneEnabled
12576
+ },
12577
+ busy: busy !== null,
12578
+ overrideCount: maxTokensOverrideCount,
12579
+ onDraftChange: (id, draft) => updateMaxTokensDraft(id, draft),
12580
+ onCommit: (id) => void saveMaxTokens(id),
12581
+ onReset: (id) => void resetMaxTokens(id),
12582
+ onResetAll: () => void resetAllMaxTokens()
12583
+ })
12584
+ ]
12585
+ }),
12437
12586
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12438
12587
  className: "dsha-group",
12439
12588
  children: [
@@ -12679,7 +12828,7 @@ window.__ModuleLoader__.load({
12679
12828
  //#endregion
12680
12829
  //#region src/client/providers/ollama/locales.ts
12681
12830
  const NS_OLLAMA = "dsh-ollama";
12682
- const zh$16 = {
12831
+ const zh$17 = {
12683
12832
  ...accountPoolZh,
12684
12833
  relogin: "更换 Key",
12685
12834
  needsRelogin: "Key 已失效",
@@ -12731,7 +12880,7 @@ window.__ModuleLoader__.load({
12731
12880
  usageNone: "尚无请求",
12732
12881
  usageHint: "按 Ollama 每次响应自带的 token 计数本地累加。"
12733
12882
  };
12734
- const en$16 = {
12883
+ const en$17 = {
12735
12884
  ...accountPoolEn,
12736
12885
  relogin: "Replace Key",
12737
12886
  needsRelogin: "Key rejected",
@@ -12783,11 +12932,11 @@ window.__ModuleLoader__.load({
12783
12932
  usageNone: "No requests yet",
12784
12933
  usageHint: "Summed locally from the token counts Ollama returns on each response."
12785
12934
  };
12786
- const dictionaries$16 = {
12787
- zh: zh$16,
12788
- "zh-CN": zh$16,
12789
- en: en$16,
12790
- "en-US": en$16
12935
+ const dictionaries$17 = {
12936
+ zh: zh$17,
12937
+ "zh-CN": zh$17,
12938
+ en: en$17,
12939
+ "en-US": en$17
12791
12940
  };
12792
12941
  //#endregion
12793
12942
  //#region src/client/providers/ollama/OllamaSection.tsx
@@ -12923,7 +13072,7 @@ window.__ModuleLoader__.load({
12923
13072
  const setEffort = (0, react.useCallback)((value) => {
12924
13073
  run("effort", () => API$8.setDefaultReasoningEffort(value === "" ? null : value));
12925
13074
  }, [run]);
12926
- const t = useLineDict(NS_OLLAMA, zh$16);
13075
+ const t = useLineDict(NS_OLLAMA, zh$17);
12927
13076
  const pool = status?.pool;
12928
13077
  const models = status?.models ?? [];
12929
13078
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
@@ -13038,7 +13187,7 @@ window.__ModuleLoader__.load({
13038
13187
  className: "dsha-btn",
13039
13188
  disabled: busy !== null,
13040
13189
  onClick: () => setShowKeyForm(false),
13041
- children: zh$16.deleteAccount
13190
+ children: zh$17.deleteAccount
13042
13191
  })]
13043
13192
  })
13044
13193
  ]
@@ -13239,7 +13388,7 @@ window.__ModuleLoader__.load({
13239
13388
  //#endregion
13240
13389
  //#region src/client/providers/antigravity-acp/locales.ts
13241
13390
  const NS_ANTIGRAVITY_ACP = "dsh-antigravity-acp";
13242
- const zh$15 = {
13391
+ const zh$16 = {
13243
13392
  title: "Antigravity(ACP)",
13244
13393
  pageDesc: "通过 Google 官方 Antigravity CLI 的 Agent Client Protocol(ACP)接入:模型、工具与会话全部由官方进程驱动,登录态由官方进程自己保管。",
13245
13394
  routeOwned: "模型路由由本插件提供",
@@ -13331,7 +13480,7 @@ window.__ModuleLoader__.load({
13331
13480
  enabledHint: "该线路当前已启用。",
13332
13481
  toggleHint: "可在「订阅服务」总览页的该线路卡片上随时停用。"
13333
13482
  };
13334
- const en$15 = {
13483
+ const en$16 = {
13335
13484
  title: "Antigravity (ACP)",
13336
13485
  pageDesc: "Connect through Google's official Antigravity CLI over the Agent Client Protocol (ACP): the model, its tools and its sessions all come from the official process, which also keeps its own sign-in state.",
13337
13486
  routeOwned: "Model route served by this plugin",
@@ -13423,11 +13572,11 @@ window.__ModuleLoader__.load({
13423
13572
  enabledHint: "This line is enabled.",
13424
13573
  toggleHint: "You can switch it off at any time from its card in the subscription overview."
13425
13574
  };
13426
- const dictionaries$15 = {
13427
- zh: zh$15,
13428
- "zh-CN": zh$15,
13429
- en: en$15,
13430
- "en-US": en$15
13575
+ const dictionaries$16 = {
13576
+ zh: zh$16,
13577
+ "zh-CN": zh$16,
13578
+ en: en$16,
13579
+ "en-US": en$16
13431
13580
  };
13432
13581
  //#endregion
13433
13582
  //#region src/client/providers/antigravity-acp/AntigravityAcpSection.tsx
@@ -13484,7 +13633,7 @@ window.__ModuleLoader__.load({
13484
13633
  setBusy(null);
13485
13634
  }
13486
13635
  }, [props]);
13487
- const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$15);
13636
+ const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$16);
13488
13637
  const models = status?.models ?? [];
13489
13638
  const auth = status?.auth;
13490
13639
  const usage = status?.usage;
@@ -13992,7 +14141,7 @@ window.__ModuleLoader__.load({
13992
14141
  //#endregion
13993
14142
  //#region src/client/providers/aws-quick/locales.ts
13994
14143
  const NS_AWS_QUICK = "dsh-aws-quick";
13995
- const zh$14 = {
14144
+ const zh$15 = {
13996
14145
  title: "AWS Quick",
13997
14146
  pageDesc: "通过本机 AWS Quick Desktop 官方 agent 使用 Quick 订阅,支持流式文本、思考与三种响应模式。",
13998
14147
  refresh: "刷新状态",
@@ -14047,8 +14196,8 @@ window.__ModuleLoader__.load({
14047
14196
  toolsError: "工具初始化失败",
14048
14197
  toolsHint: "提前创建 Quick 原生连接器;插件不会绕过 Quick 批准。"
14049
14198
  };
14050
- const dictionaries$14 = {
14051
- zh: zh$14,
14199
+ const dictionaries$15 = {
14200
+ zh: zh$15,
14052
14201
  en: {
14053
14202
  title: "AWS Quick",
14054
14203
  pageDesc: "Use an AWS Quick subscription through the official local Quick Desktop agent, with streaming text, reasoning and three response modes.",
@@ -14113,7 +14262,7 @@ window.__ModuleLoader__.load({
14113
14262
  const [error, setError] = (0, react.useState)(null);
14114
14263
  const [selected, setSelected] = (0, react.useState)(null);
14115
14264
  const [binaryPath, setBinaryPath] = (0, react.useState)("");
14116
- const t = useLineDict(NS_AWS_QUICK, zh$14);
14265
+ const t = useLineDict(NS_AWS_QUICK, zh$15);
14117
14266
  const apply = (0, react.useCallback)((next) => {
14118
14267
  setStatus(next);
14119
14268
  setSelected(next.enabledModelIds === null ? null : new Set(next.enabledModelIds));
@@ -14493,7 +14642,7 @@ window.__ModuleLoader__.load({
14493
14642
  //#endregion
14494
14643
  //#region src/client/providers/opencode-go/locales.ts
14495
14644
  const NS_OPENCODE_GO = "dsh-opencode-go";
14496
- const zh$13 = {
14645
+ const zh$14 = {
14497
14646
  ...accountPoolZh,
14498
14647
  title: "OpenCode Go",
14499
14648
  pageDesc: "使用 OpenCode Go 订阅,管理账号、模型、思考档位与额度。",
@@ -14566,7 +14715,7 @@ window.__ModuleLoader__.load({
14566
14715
  authMethodApiKey: "个人 API Key",
14567
14716
  composerLabel: "OpenCode Go 剩余额度"
14568
14717
  };
14569
- const en$13 = {
14718
+ const en$14 = {
14570
14719
  ...accountPoolEn,
14571
14720
  title: "OpenCode Go",
14572
14721
  pageDesc: "Use an OpenCode Go subscription and manage accounts, models, reasoning levels, and quota.",
@@ -14639,11 +14788,11 @@ window.__ModuleLoader__.load({
14639
14788
  authMethodApiKey: "Personal API Key",
14640
14789
  composerLabel: "OpenCode Go allowance left"
14641
14790
  };
14642
- const dictionaries$13 = {
14643
- zh: zh$13,
14644
- "zh-CN": zh$13,
14645
- en: en$13,
14646
- "en-US": en$13
14791
+ const dictionaries$14 = {
14792
+ zh: zh$14,
14793
+ "zh-CN": zh$14,
14794
+ en: en$14,
14795
+ "en-US": en$14
14647
14796
  };
14648
14797
  //#endregion
14649
14798
  //#region src/client/providers/opencode-go/OpenCodeGoQuotaCard.tsx
@@ -14861,7 +15010,7 @@ window.__ModuleLoader__.load({
14861
15010
  const api$14 = createLineApi("/opencode-go/api", "OpenCode Go");
14862
15011
  const QUOTA_POLL_MS$1 = 3e4;
14863
15012
  function OpenCodeGoSection({ onModelChange, loadModelDirectory }) {
14864
- const t = useLineDict(NS_OPENCODE_GO, zh$13);
15013
+ const t = useLineDict(NS_OPENCODE_GO, zh$14);
14865
15014
  const [status, setStatus] = (0, react.useState)(null);
14866
15015
  const [loading, setLoading] = (0, react.useState)(true);
14867
15016
  const [busy, setBusy] = (0, react.useState)(null);
@@ -15271,7 +15420,7 @@ window.__ModuleLoader__.load({
15271
15420
  * 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
15272
15421
  */
15273
15422
  const NS_STEP_CODE = "dsh-step-code";
15274
- const zh$12 = {
15423
+ const zh$13 = {
15275
15424
  ...accountPoolZh,
15276
15425
  title: "Step Code(Step Plan 订阅)",
15277
15426
  pageDesc: "连接 Step Plan 订阅或开放平台 API Key,管理账号池、额度与可用模型。",
@@ -15441,7 +15590,7 @@ window.__ModuleLoader__.load({
15441
15590
  cacheExpiredHint: "缓存可能已过期:距上次请求约 {minutes} 分钟,下次会重新处理前缀。",
15442
15591
  cacheHitRatioUnavailable: "—"
15443
15592
  };
15444
- const en$12 = {
15593
+ const en$13 = {
15445
15594
  ...accountPoolEn,
15446
15595
  title: "Step Code (Step Plan subscription)",
15447
15596
  pageDesc: "Reach StepFun with a Step Plan subscription (China api.stepfun.com / international api.stepfun.ai) or an open-platform API key, and manage the account pool, plan quota, cache usage and model selection. A region is a property of the credential and the two never share, so a pool can carry accounts from both.",
@@ -15609,11 +15758,11 @@ window.__ModuleLoader__.load({
15609
15758
  cacheExpiredHint: "The cache has likely expired: about {minutes} minutes since the last request, so the next turn will reprocess the prefix.",
15610
15759
  cacheHitRatioUnavailable: "—"
15611
15760
  };
15612
- const dictionaries$12 = {
15613
- zh: zh$12,
15614
- "zh-CN": zh$12,
15615
- en: en$12,
15616
- "en-US": en$12
15761
+ const dictionaries$13 = {
15762
+ zh: zh$13,
15763
+ "zh-CN": zh$13,
15764
+ en: en$13,
15765
+ "en-US": en$13
15617
15766
  };
15618
15767
  /** 一个额度窗口的键到「窗口长度(分钟)」的映射。窗口名由共享组件按长度本地化。 */
15619
15768
  const QUOTA_WINDOW_MINUTES = {
@@ -15703,7 +15852,7 @@ window.__ModuleLoader__.load({
15703
15852
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
15704
15853
  const LOGIN_POLL_INTERVAL_MS$1 = 2e3;
15705
15854
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
15706
- const fallbackTranslate$5 = (key) => zh$12[key];
15855
+ const fallbackTranslate$5 = (key) => zh$13[key];
15707
15856
  /**
15708
15857
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
15709
15858
  *
@@ -16389,7 +16538,7 @@ window.__ModuleLoader__.load({
16389
16538
  const { status, loading, busy, error, connection, adoptResult, pasteValue, profile, pasteOpen, contextDrafts, savingModel, quotaAccount, quotaPassword, quotaToken } = state;
16390
16539
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio, quotaCredential } = derived;
16391
16540
  const { setProfile, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setDefaultReasoningEffort, setCacheRequestParams, refreshQuota, refreshCatalog, testConnection, setQuotaAccount, setQuotaPassword, setQuotaToken, submitQuotaPassword, submitQuotaToken, clearQuotaCredential } = actions;
16392
- const t = useLineDict(NS_STEP_CODE, zh$12);
16541
+ const t = useLineDict(NS_STEP_CODE, zh$13);
16393
16542
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
16394
16543
  className: "dsha-page",
16395
16544
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -17293,7 +17442,7 @@ window.__ModuleLoader__.load({
17293
17442
  //#endregion
17294
17443
  //#region src/client/providers/cline-pass/locales.ts
17295
17444
  const NS_CLINE_PASS = "dsh-cline-pass";
17296
- const zh$11 = {
17445
+ const zh$12 = {
17297
17446
  ...accountPoolZh,
17298
17447
  relogin: "重新登录",
17299
17448
  needsRelogin: "登录已失效",
@@ -17417,7 +17566,7 @@ window.__ModuleLoader__.load({
17417
17566
  limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 cline-pass,本卡仍可配置,但请求由对方服务。",
17418
17567
  limitQuota: "额度窗口来自网关的 usage-limits 接口;接口失败时卡片保留上一次读数并显示原因。"
17419
17568
  };
17420
- const en$11 = {
17569
+ const en$12 = {
17421
17570
  ...accountPoolEn,
17422
17571
  relogin: "Sign in again",
17423
17572
  needsRelogin: "Sign-in expired",
@@ -17541,11 +17690,11 @@ window.__ModuleLoader__.load({
17541
17690
  limitRoute: "The route is claimed by provider id: if another plugin already serves cline-pass, this card still configures the line but that provider answers the requests.",
17542
17691
  limitQuota: "Quota windows come from the gateway usage-limits endpoint; when it fails the card keeps the previous reading and says why."
17543
17692
  };
17544
- const dictionaries$11 = {
17545
- zh: zh$11,
17546
- "zh-CN": zh$11,
17547
- en: en$11,
17548
- "en-US": en$11
17693
+ const dictionaries$12 = {
17694
+ zh: zh$12,
17695
+ "zh-CN": zh$12,
17696
+ en: en$12,
17697
+ "en-US": en$12
17549
17698
  };
17550
17699
  //#endregion
17551
17700
  //#region src/client/providers/cline-pass/ClinePassSection.tsx
@@ -17666,10 +17815,10 @@ window.__ModuleLoader__.load({
17666
17815
  API$5.loginStatus(flow.id).then((next) => {
17667
17816
  setLoginFlow(next);
17668
17817
  if (next.status === "complete") {
17669
- setNotice(zh$11.loginComplete.replace("{account}", next.accountAlias === "" ? "Cline Pass" : next.accountAlias));
17818
+ setNotice(zh$12.loginComplete.replace("{account}", next.accountAlias === "" ? "Cline Pass" : next.accountAlias));
17670
17819
  setShowKeyForm(false);
17671
17820
  loadStatus();
17672
- } else if (next.status === "failed") setError(zh$11.loginFailed.replace("{detail}", next.error));
17821
+ } else if (next.status === "failed") setError(zh$12.loginFailed.replace("{detail}", next.error));
17673
17822
  }).catch((cause) => setError(detail$1(cause)));
17674
17823
  }, Math.max(2, flow.intervalSeconds) * 1e3);
17675
17824
  return () => window.clearInterval(timer);
@@ -17743,7 +17892,7 @@ window.__ModuleLoader__.load({
17743
17892
  apiKey: trimmed,
17744
17893
  ...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
17745
17894
  }).then((result) => {
17746
- setNotice(result.authorized ? zh$11.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$11.keyTestFailed.replace("{detail}", result.error));
17895
+ setNotice(result.authorized ? zh$12.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$12.keyTestFailed.replace("{detail}", result.error));
17747
17896
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
17748
17897
  }, [key, keyBaseURL]);
17749
17898
  const testStored = (0, react.useCallback)((accountId) => {
@@ -17751,7 +17900,7 @@ window.__ModuleLoader__.load({
17751
17900
  setError(null);
17752
17901
  setNotice(null);
17753
17902
  API$5.testKey({ accountId }).then((result) => {
17754
- setNotice(result.authorized ? zh$11.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$11.keyTestFailed.replace("{detail}", result.error));
17903
+ setNotice(result.authorized ? zh$12.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$12.keyTestFailed.replace("{detail}", result.error));
17755
17904
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
17756
17905
  }, []);
17757
17906
  const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
@@ -17787,7 +17936,7 @@ window.__ModuleLoader__.load({
17787
17936
  if (model === void 0) return;
17788
17937
  const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
17789
17938
  if (parsed === null) {
17790
- setError(zh$11.error.replace("{detail}", zh$11.defaultContextWindow));
17939
+ setError(zh$12.error.replace("{detail}", zh$12.defaultContextWindow));
17791
17940
  return;
17792
17941
  }
17793
17942
  run("ctx:" + id, () => API$5.setContextWindow(id, parsed));
@@ -17809,7 +17958,7 @@ window.__ModuleLoader__.load({
17809
17958
  }, [run, status]);
17810
17959
  const resetAllContext = (0, react.useCallback)(() => {
17811
17960
  if (status === null) return;
17812
- if (typeof window !== "undefined" && !window.confirm(zh$11.contextResetAll)) return;
17961
+ if (typeof window !== "undefined" && !window.confirm(zh$12.contextResetAll)) return;
17813
17962
  const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
17814
17963
  run("ctx-all", async () => {
17815
17964
  let next = status;
@@ -17850,7 +17999,7 @@ window.__ModuleLoader__.load({
17850
17999
  const refreshUsage = (0, react.useCallback)(() => {
17851
18000
  run("usage", async () => {
17852
18001
  const outcome = await API$5.readUsage();
17853
- setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$11.usageEmpty);
18002
+ setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$12.usageEmpty);
17854
18003
  return outcome.status;
17855
18004
  });
17856
18005
  }, [run]);
@@ -17870,7 +18019,7 @@ window.__ModuleLoader__.load({
17870
18019
  };
17871
18020
  const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
17872
18021
  if (invalid !== void 0) {
17873
- setError(zh$11.error.replace("{detail}", invalid[0]));
18022
+ setError(zh$12.error.replace("{detail}", invalid[0]));
17874
18023
  return;
17875
18024
  }
17876
18025
  setBusy("settings");
@@ -17881,7 +18030,7 @@ window.__ModuleLoader__.load({
17881
18030
  }).then((next) => {
17882
18031
  applyStatus(next);
17883
18032
  setSettingsForm(settingsFormOf$1(next));
17884
- setNotice(zh$11.saved);
18033
+ setNotice(zh$12.saved);
17885
18034
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
17886
18035
  }, [settingsForm, applyStatus]);
17887
18036
  const toggleTools = (0, react.useCallback)(() => {
@@ -17892,10 +18041,10 @@ window.__ModuleLoader__.load({
17892
18041
  API$5.updateSettings({ exposeTools: value }).then((next) => {
17893
18042
  applyStatus(next);
17894
18043
  setSettingsForm(settingsFormOf$1(next));
17895
- setNotice(zh$11.restartRequired);
18044
+ setNotice(zh$12.restartRequired);
17896
18045
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
17897
18046
  }, [status, applyStatus]);
17898
- const t = useLineDict(NS_CLINE_PASS, zh$11);
18047
+ const t = useLineDict(NS_CLINE_PASS, zh$12);
17899
18048
  const errorPrefix = t.error.split("{detail}")[0] ?? "";
17900
18049
  const pool = status?.pool;
17901
18050
  const accounts = (0, react.useMemo)(() => {
@@ -18672,7 +18821,7 @@ window.__ModuleLoader__.load({
18672
18821
  * 'settings.section' 上的那张座位(那张座绑定的是 ChatGPT 的键集)。
18673
18822
  */
18674
18823
  const NS_QODER = "dsh-qoder";
18675
- const zh$10 = {
18824
+ const zh$11 = {
18676
18825
  modelRowEfforts: "档位 {list}",
18677
18826
  modelRowNoEfforts: "无档位",
18678
18827
  modelRowOutput: "输出 {cap}",
@@ -18796,8 +18945,8 @@ window.__ModuleLoader__.load({
18796
18945
  quotaWindow: "额度窗口"
18797
18946
  };
18798
18947
  /** 两套字典。 */
18799
- const dictionaries$10 = {
18800
- zh: zh$10,
18948
+ const dictionaries$11 = {
18949
+ zh: zh$11,
18801
18950
  en: {
18802
18951
  modelRowEfforts: "efforts {list}",
18803
18952
  modelRowNoEfforts: "no efforts",
@@ -18998,7 +19147,7 @@ window.__ModuleLoader__.load({
18998
19147
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
18999
19148
  const LOGIN_POLL_INTERVAL_MS = 2e3;
19000
19149
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
19001
- const fallbackTranslate$4 = (key) => zh$10[key];
19150
+ const fallbackTranslate$4 = (key) => zh$11[key];
19002
19151
  /**
19003
19152
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
19004
19153
  *
@@ -19570,7 +19719,7 @@ window.__ModuleLoader__.load({
19570
19719
  * `defaultMaxTokens`),客户端不按模型名推断任何一项。与 OpenDesign 卡同一写法:
19571
19720
  * 数据一行,散文进折叠区。
19572
19721
  */
19573
- function qoderModelRowHint(model, t = zh$10) {
19722
+ function qoderModelRowHint(model, t = zh$11) {
19574
19723
  return `${formatTokenCount(model.contextWindow)} · ${model.supportsImages ? "text+image" : "text"} · ${model.reasoningEfforts.length === 0 ? t.modelRowNoEfforts : t.modelRowEfforts.replace("{list}", model.reasoningEfforts.join("/"))} · ${t.modelRowOutput.replace("{cap}", formatTokenCount(model.defaultMaxTokens))}`;
19575
19724
  }
19576
19725
  function QoderSection({ onModelChange } = {}) {
@@ -19578,7 +19727,7 @@ window.__ModuleLoader__.load({
19578
19727
  const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
19579
19728
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio } = derived;
19580
19729
  const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, setModelGroup, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setDefaultReasoningEffort, refreshQuota, refreshCatalog, testConnection } = actions;
19581
- const t = useLineDict(NS_QODER, zh$10);
19730
+ const t = useLineDict(NS_QODER, zh$11);
19582
19731
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19583
19732
  className: "dsha-page",
19584
19733
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -20176,7 +20325,7 @@ window.__ModuleLoader__.load({
20176
20325
  //#endregion
20177
20326
  //#region src/client/providers/opendesign/locales.ts
20178
20327
  const NS_OPENDESIGN = "dsh-opendesign";
20179
- const zh$9 = {
20328
+ const zh$10 = {
20180
20329
  ...accountPoolZh,
20181
20330
  relogin: "重新登录",
20182
20331
  needsRelogin: "登录已失效",
@@ -20284,7 +20433,7 @@ window.__ModuleLoader__.load({
20284
20433
  limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 opendesign,本卡仍可配置,但请求由对方服务。",
20285
20434
  limitQuota: "套餐与额度读取只覆盖浏览器授权登录的账号;粘贴的 API Key 没有控制 Key,请在 OpenDesign Cloud 控制台查看用量。"
20286
20435
  };
20287
- const en$9 = {
20436
+ const en$10 = {
20288
20437
  ...accountPoolEn,
20289
20438
  relogin: "Add again",
20290
20439
  needsRelogin: "Key invalid",
@@ -20392,11 +20541,11 @@ window.__ModuleLoader__.load({
20392
20541
  limitRoute: "The route is claimed by provider id: if another plugin already serves opendesign, this card still configures the line but that provider answers the requests.",
20393
20542
  limitQuota: "Plan and credit reads cover browser-signed-in accounts only; a pasted API key has no control key, so see usage in the OpenDesign Cloud console."
20394
20543
  };
20395
- const dictionaries$9 = {
20396
- zh: zh$9,
20397
- "zh-CN": zh$9,
20398
- en: en$9,
20399
- "en-US": en$9
20544
+ const dictionaries$10 = {
20545
+ zh: zh$10,
20546
+ "zh-CN": zh$10,
20547
+ en: en$10,
20548
+ "en-US": en$10
20400
20549
  };
20401
20550
  //#endregion
20402
20551
  //#region src/client/providers/opendesign/OpenDesignSection.tsx
@@ -20691,7 +20840,7 @@ window.__ModuleLoader__.load({
20691
20840
  try {
20692
20841
  const outcome = await API$4.readUsage();
20693
20842
  setStatus(outcome.status);
20694
- if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$9.usageEmpty);
20843
+ if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$10.usageEmpty);
20695
20844
  } catch (cause) {
20696
20845
  if (!silent) setError(detail(cause));
20697
20846
  }
@@ -20728,10 +20877,10 @@ window.__ModuleLoader__.load({
20728
20877
  API$4.loginStatus(flow.id).then((next) => {
20729
20878
  setLoginFlow(next);
20730
20879
  if (next.status === "complete") {
20731
- setNotice(zh$9.loginComplete.replace("{account}", next.accountAlias === "" ? "OpenDesign" : next.accountAlias));
20880
+ setNotice(zh$10.loginComplete.replace("{account}", next.accountAlias === "" ? "OpenDesign" : next.accountAlias));
20732
20881
  setShowKeyForm(false);
20733
20882
  reload();
20734
- } else if (next.status === "failed") setError(zh$9.loginFailed.replace("{detail}", next.error));
20883
+ } else if (next.status === "failed") setError(zh$10.loginFailed.replace("{detail}", next.error));
20735
20884
  }).catch((cause) => setError(detail(cause)));
20736
20885
  }, Math.max(2, flow.intervalSeconds) * 1e3);
20737
20886
  return () => window.clearInterval(timer);
@@ -20797,7 +20946,7 @@ window.__ModuleLoader__.load({
20797
20946
  const refreshUsage = (0, react.useCallback)(() => {
20798
20947
  run("usage", async () => {
20799
20948
  const outcome = await API$4.readUsage();
20800
- setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$9.usageEmpty);
20949
+ setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$10.usageEmpty);
20801
20950
  return outcome.status;
20802
20951
  });
20803
20952
  }, [run]);
@@ -20832,7 +20981,7 @@ window.__ModuleLoader__.load({
20832
20981
  apiKey: trimmed,
20833
20982
  ...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
20834
20983
  }).then((result) => {
20835
- setNotice(result.authorized ? zh$9.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$9.keyTestFailed.replace("{detail}", result.error));
20984
+ setNotice(result.authorized ? zh$10.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$10.keyTestFailed.replace("{detail}", result.error));
20836
20985
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
20837
20986
  }, [key, keyBaseURL]);
20838
20987
  const testStored = (0, react.useCallback)((accountId) => {
@@ -20840,7 +20989,7 @@ window.__ModuleLoader__.load({
20840
20989
  setError(null);
20841
20990
  setNotice(null);
20842
20991
  API$4.testKey({ accountId }).then((result) => {
20843
- setNotice(result.authorized ? zh$9.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$9.keyTestFailed.replace("{detail}", result.error));
20992
+ setNotice(result.authorized ? zh$10.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$10.keyTestFailed.replace("{detail}", result.error));
20844
20993
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
20845
20994
  }, []);
20846
20995
  const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
@@ -20876,7 +21025,7 @@ window.__ModuleLoader__.load({
20876
21025
  if (model === void 0) return;
20877
21026
  const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
20878
21027
  if (parsed === null) {
20879
- setError(zh$9.error.replace("{detail}", zh$9.defaultContextWindow));
21028
+ setError(zh$10.error.replace("{detail}", zh$10.defaultContextWindow));
20880
21029
  return;
20881
21030
  }
20882
21031
  run("ctx:" + id, () => API$4.setContextWindow(id, parsed));
@@ -20898,7 +21047,7 @@ window.__ModuleLoader__.load({
20898
21047
  }, [run, status]);
20899
21048
  const resetAllContext = (0, react.useCallback)(() => {
20900
21049
  if (status === null) return;
20901
- if (typeof window !== "undefined" && !window.confirm(zh$9.contextResetAll)) return;
21050
+ if (typeof window !== "undefined" && !window.confirm(zh$10.contextResetAll)) return;
20902
21051
  const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
20903
21052
  run("ctx-all", async () => {
20904
21053
  let next = status;
@@ -20914,7 +21063,7 @@ window.__ModuleLoader__.load({
20914
21063
  const refreshCatalog = (0, react.useCallback)(() => {
20915
21064
  run("catalog", async () => {
20916
21065
  const outcome = await API$4.refreshCatalog();
20917
- setNotice(zh$9.catalogSyncedNote.replace("{count}", String(outcome.status.catalogCount)));
21066
+ setNotice(zh$10.catalogSyncedNote.replace("{count}", String(outcome.status.catalogCount)));
20918
21067
  return outcome.status;
20919
21068
  });
20920
21069
  }, [run]);
@@ -20928,7 +21077,7 @@ window.__ModuleLoader__.load({
20928
21077
  };
20929
21078
  const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
20930
21079
  if (invalid !== void 0) {
20931
- setError(zh$9.error.replace("{detail}", invalid[0]));
21080
+ setError(zh$10.error.replace("{detail}", invalid[0]));
20932
21081
  return;
20933
21082
  }
20934
21083
  setBusy("settings");
@@ -20939,10 +21088,10 @@ window.__ModuleLoader__.load({
20939
21088
  }).then((next) => {
20940
21089
  applyStatus(next);
20941
21090
  setSettingsForm(settingsFormOf(next));
20942
- setNotice(zh$9.saved);
21091
+ setNotice(zh$10.saved);
20943
21092
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
20944
21093
  }, [settingsForm, applyStatus]);
20945
- const t = useLineDict(NS_OPENDESIGN, zh$9);
21094
+ const t = useLineDict(NS_OPENDESIGN, zh$10);
20946
21095
  const errorPrefix = t.error.split("{detail}")[0] ?? "";
20947
21096
  const pool = status?.pool;
20948
21097
  const accounts = pool?.accounts ?? [];
@@ -21462,7 +21611,7 @@ window.__ModuleLoader__.load({
21462
21611
  * control that renders it instead.
21463
21612
  */
21464
21613
  const NS_WORKBUDDY = "dsh-workbuddy";
21465
- const zh$8 = {
21614
+ const zh$9 = {
21466
21615
  title: "WorkBuddy",
21467
21616
  pageDesc: "复用本机 CodeBuddy 桌面端登录态,管理 WorkBuddy(CodeBuddy 订阅)模型、上下文窗口与额度。",
21468
21617
  account: "账号",
@@ -21588,7 +21737,7 @@ window.__ModuleLoader__.load({
21588
21737
  modelCooldownActive: "模型限流中",
21589
21738
  notRoutable: "当前不可路由"
21590
21739
  };
21591
- const en$8 = {
21740
+ const en$9 = {
21592
21741
  title: "WorkBuddy",
21593
21742
  pageDesc: "Reuse the local CodeBuddy desktop sign-in to manage WorkBuddy (CodeBuddy subscription) models, context windows, and quota.",
21594
21743
  account: "Account",
@@ -21714,11 +21863,11 @@ window.__ModuleLoader__.load({
21714
21863
  modelCooldownActive: "Model parked",
21715
21864
  notRoutable: "Not routable right now"
21716
21865
  };
21717
- const dictionaries$8 = {
21718
- zh: zh$8,
21719
- "zh-CN": zh$8,
21720
- en: en$8,
21721
- "en-US": en$8
21866
+ const dictionaries$9 = {
21867
+ zh: zh$9,
21868
+ "zh-CN": zh$9,
21869
+ en: en$9,
21870
+ "en-US": en$9
21722
21871
  };
21723
21872
  //#endregion
21724
21873
  //#region src/client/providers/workbuddy/useWorkBuddySection.ts
@@ -21816,7 +21965,7 @@ window.__ModuleLoader__.load({
21816
21965
  const quotaFollowUp = (0, react.useRef)(null);
21817
21966
  const [contextDrafts, setContextDrafts] = (0, react.useState)({});
21818
21967
  const [savingModel, setSavingModel] = (0, react.useState)(null);
21819
- const t = useLineDict(NS_WORKBUDDY, zh$8);
21968
+ const t = useLineDict(NS_WORKBUDDY, zh$9);
21820
21969
  const notifyChange = (0, react.useCallback)(() => {
21821
21970
  onModelChange?.();
21822
21971
  loadModelDirectory?.();
@@ -22443,7 +22592,7 @@ window.__ModuleLoader__.load({
22443
22592
  const timer = window.setInterval(() => setNow(Date.now()), 1e3);
22444
22593
  return () => window.clearInterval(timer);
22445
22594
  }, [pausedUntil]);
22446
- const t = useLineDict(NS_WORKBUDDY, zh$8);
22595
+ const t = useLineDict(NS_WORKBUDDY, zh$9);
22447
22596
  const poolState = poolStateLines(pool, t, now);
22448
22597
  const storageLine = poolStorageLine(pool?.storage, t);
22449
22598
  const storageUnavailable = pool?.storage === void 0 ? null : poolStorageUnavailableLabel(pool.storage, t);
@@ -23079,7 +23228,7 @@ window.__ModuleLoader__.load({
23079
23228
  //#endregion
23080
23229
  //#region src/client/providers/qianwen-token-plan/locales.ts
23081
23230
  const NS_QIANWEN = "dsh-qianwen-token-plan";
23082
- const zh$7 = {
23231
+ const zh$8 = {
23083
23232
  title: "Qwen Token Plan(千问)",
23084
23233
  pageDesc: "使用千问 Token Plan 专属 API Key 调用 Qwen4,管理显式缓存、思考回放、推理档位、模型和视觉预算。",
23085
23234
  loading: "加载中...",
@@ -23152,8 +23301,8 @@ window.__ModuleLoader__.load({
23152
23301
  noQuota: "无配额数据",
23153
23302
  proxy: "代理"
23154
23303
  };
23155
- const dictionaries$7 = {
23156
- zh: zh$7,
23304
+ const dictionaries$8 = {
23305
+ zh: zh$8,
23157
23306
  en: {
23158
23307
  title: "Qwen Token Plan",
23159
23308
  pageDesc: "Use a dedicated Qianwen Token Plan API key with Qwen4, explicit caching, thinking replay, all reasoning levels, models and visual budgets.",
@@ -23431,7 +23580,7 @@ window.__ModuleLoader__.load({
23431
23580
  });
23432
23581
  }
23433
23582
  function QianwenTokenPlanSection(props = {}) {
23434
- const t = useLineDict(NS_QIANWEN, zh$7);
23583
+ const t = useLineDict(NS_QIANWEN, zh$8);
23435
23584
  const view = useQianwenSection(props);
23436
23585
  const { status, busy } = view;
23437
23586
  if (view.loading && status === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -23786,7 +23935,7 @@ window.__ModuleLoader__.load({
23786
23935
  //#endregion
23787
23936
  //#region src/client/providers/relayone/locales.ts
23788
23937
  const NS_RELAYONE = "dsh-relayone";
23789
- const zh$6 = {
23938
+ const zh$7 = {
23790
23939
  title: "RelayOne",
23791
23940
  pageDesc: "一个 API Key,动态接入当前分组可用的对话与媒体模型。",
23792
23941
  enabled: "启用 RelayOne",
@@ -23893,8 +24042,8 @@ window.__ModuleLoader__.load({
23893
24042
  quotaWindow: "额度窗口",
23894
24043
  quotaFactsScope: "以下为当前 Key 的额度事实;每个 Key 自己的进度显示在它的卡片里。"
23895
24044
  };
23896
- const dictionaries$6 = {
23897
- zh: zh$6,
24045
+ const dictionaries$7 = {
24046
+ zh: zh$7,
23898
24047
  en: {
23899
24048
  title: "RelayOne",
23900
24049
  pageDesc: "One API key for the chat and media models visible to its current upstream group.",
@@ -24269,7 +24418,7 @@ window.__ModuleLoader__.load({
24269
24418
  max: "effortMax"
24270
24419
  };
24271
24420
  function RelayOneSection(props = {}) {
24272
- const t = useLineDict(NS_RELAYONE, zh$6);
24421
+ const t = useLineDict(NS_RELAYONE, zh$7);
24273
24422
  const view = useRelayOneSection(props);
24274
24423
  const { status, busy } = view;
24275
24424
  if (view.loading && status === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -24669,7 +24818,7 @@ window.__ModuleLoader__.load({
24669
24818
  //#endregion
24670
24819
  //#region src/client/providers/claude-api/locales.ts
24671
24820
  const NS_CLAUDE_API = "dsh-claude-api";
24672
- const zh$5 = {
24821
+ const zh$6 = {
24673
24822
  title: "Claude API",
24674
24823
  pageDesc: "用一个 API Key 直连 Anthropic Messages 端点或兼容网关,请求形态与官方 Claude Code 客户端一致。",
24675
24824
  loading: "正在读取线路状态…",
@@ -24746,8 +24895,8 @@ window.__ModuleLoader__.load({
24746
24895
  contextEmpty: "没有已启用的模型。",
24747
24896
  invalidCapacity: "上下文窗口必须是正整数。"
24748
24897
  };
24749
- const dictionaries$5 = {
24750
- zh: zh$5,
24898
+ const dictionaries$6 = {
24899
+ zh: zh$6,
24751
24900
  en: {
24752
24901
  title: "Claude API",
24753
24902
  pageDesc: "One API key against the Anthropic Messages endpoint or a compatible gateway, sent in the request shape of the official Claude Code client.",
@@ -25153,7 +25302,7 @@ window.__ModuleLoader__.load({
25153
25302
  const SEPARATOR = " · ";
25154
25303
  const DASH = "—";
25155
25304
  function ClaudeApiSection(props = {}) {
25156
- const t = useLineDict(NS_CLAUDE_API, zh$5);
25305
+ const t = useLineDict(NS_CLAUDE_API, zh$6);
25157
25306
  const view = useClaudeApiSection(props);
25158
25307
  const { status, busy } = view;
25159
25308
  if (view.loading && status === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -27274,7 +27423,7 @@ window.__ModuleLoader__.load({
27274
27423
  */
27275
27424
  const NS_DISPATCH_LEDGER = "dsh-dispatch-ledger";
27276
27425
  /** 中文文案。 */
27277
- const zh$4 = {
27426
+ const zh$5 = {
27278
27427
  mandateTitle: "派发子代理",
27279
27428
  mandateTitleFork: "派发子代理(继承上下文)",
27280
27429
  mandatePreparing: "正在组装派发",
@@ -27298,8 +27447,8 @@ window.__ModuleLoader__.load({
27298
27447
  mandateNoBody: "(没有正文)"
27299
27448
  };
27300
27449
  /** 注册进 locale 服务的双语字典。 */
27301
- const dictionaries$4 = {
27302
- zh: zh$4,
27450
+ const dictionaries$5 = {
27451
+ zh: zh$5,
27303
27452
  en: {
27304
27453
  mandateTitle: "Subagent dispatch",
27305
27454
  mandateTitleFork: "Subagent dispatch (inherits context)",
@@ -27341,7 +27490,7 @@ window.__ModuleLoader__.load({
27341
27490
  * 不另起一套点号命名——同一份 index.tsx 里两种命名风格会让「这条键属于哪张表」
27342
27491
  * 变成要靠记忆的事。
27343
27492
  */
27344
- const zh$3 = {
27493
+ const zh$4 = {
27345
27494
  /** 设置页导航里的那一格,也是侧栏页签的标题。 */
27346
27495
  navTitle: "进展更新",
27347
27496
  progressTitle: "进展更新",
@@ -27413,11 +27562,23 @@ window.__ModuleLoader__.load({
27413
27562
  settingsLanguageRu: "Русский",
27414
27563
  settingsPanelName: "进展面板",
27415
27564
  settingsPanelNote: "在右侧栏查看本次会话的全部进展",
27565
+ settingsAdvisorEnabledName: "顾问",
27566
+ settingsAdvisorEnabledNote: "新对话默认开启只读顾问;主模型可在方案、排错与收尾前让另一个模型审阅对话",
27567
+ settingsAdvisorSessionBudgetName: "对话顾问预算",
27568
+ settingsAdvisorSessionBudgetNote: "单个对话累计可消耗的顾问 token 上限;用完即停止咨询,0 表示不限制",
27569
+ settingsAdvisorMaxTokensName: "顾问单次输出上限",
27570
+ settingsAdvisorMaxTokensNote: "顾问单次回复的最大 token 数,与模型自身上限取较小值",
27571
+ settingsAdvisorContextName: "顾问上下文预算",
27572
+ settingsAdvisorContextNote: "投影给顾问的对话历史预算;超出时保留首条任务与最近证据",
27573
+ settingsAdvisorTimeoutName: "顾问超时",
27574
+ settingsAdvisorTimeoutNote: "单次咨询的总超时毫秒数,超时按不可用处理,不阻断主任务",
27575
+ settingsAdvisorRetriesName: "顾问重试次数",
27576
+ settingsAdvisorRetriesNote: "遇到 429、5xx 或网络错误时的最大追加重试次数",
27416
27577
  settingsUnavailable: "这项设置当前不可修改(宿主没有开放配置表单)",
27417
27578
  settingsSaveFailed: "保存失败,请稍后再试"
27418
27579
  };
27419
27580
  /** 英文对照,键集与 zh 完全一致。 */
27420
- const en$3 = {
27581
+ const en$4 = {
27421
27582
  navTitle: "Progress updates",
27422
27583
  progressTitle: "Progress updates",
27423
27584
  progressGuideNote: "Every step the agent reports, collected here",
@@ -27487,21 +27648,33 @@ window.__ModuleLoader__.load({
27487
27648
  settingsLanguageRu: "Russian",
27488
27649
  settingsPanelName: "Progress panel",
27489
27650
  settingsPanelNote: "See every update from this session in the right sidebar",
27651
+ settingsAdvisorEnabledName: "Advisor",
27652
+ settingsAdvisorEnabledNote: "Turn the read-only advisor on by default for new conversations, so the main model can ask a second model to review the conversation before committing, when stuck, and before declaring done",
27653
+ settingsAdvisorSessionBudgetName: "Advisor budget per conversation",
27654
+ settingsAdvisorSessionBudgetNote: "Cumulative advisor tokens one conversation may spend before consultations stop; 0 means unlimited",
27655
+ settingsAdvisorMaxTokensName: "Advisor output limit",
27656
+ settingsAdvisorMaxTokensNote: "Maximum tokens for one advisor reply, capped by the model own limit",
27657
+ settingsAdvisorContextName: "Advisor context budget",
27658
+ settingsAdvisorContextNote: "History budget projected to the advisor; past it, the first task and the most recent evidence are kept",
27659
+ settingsAdvisorTimeoutName: "Advisor timeout",
27660
+ settingsAdvisorTimeoutNote: "Total timeout in milliseconds for one consultation; a timeout counts as unavailable and never blocks the main task",
27661
+ settingsAdvisorRetriesName: "Advisor retries",
27662
+ settingsAdvisorRetriesNote: "Maximum extra attempts after a 429, a 5xx, or a network error",
27490
27663
  settingsUnavailable: "This setting cannot be changed right now (the host serves no config form)",
27491
27664
  settingsSaveFailed: "Could not save. Try again in a moment."
27492
27665
  };
27493
27666
  /** 与其余线路同形的字典包(四个内置语言 id 都指向那两份)。 */
27494
- const dictionaries$3 = {
27495
- zh: zh$3,
27496
- "zh-CN": zh$3,
27497
- en: en$3,
27498
- "en-US": en$3
27667
+ const dictionaries$4 = {
27668
+ zh: zh$4,
27669
+ "zh-CN": zh$4,
27670
+ en: en$4,
27671
+ "en-US": en$4
27499
27672
  };
27500
27673
  //#endregion
27501
27674
  //#region src/client/features/compact-after-turn/locales.ts
27502
27675
  /** Copy of the one-shot "compact after this turn" row in the composer's model menu. */
27503
27676
  const NS_COMPACT_AFTER_TURN = "dsh-compact-after-turn";
27504
- const dictionaries$2 = {
27677
+ const dictionaries$3 = {
27505
27678
  zh: {
27506
27679
  label: "本轮结束后压缩",
27507
27680
  infoLabel: "关于本轮结束后压缩",
@@ -27532,7 +27705,7 @@ window.__ModuleLoader__.load({
27532
27705
  //#endregion
27533
27706
  //#region src/client/features/session-quota/locales.ts
27534
27707
  const NS_SESSION_QUOTA = "dsh-session-quota";
27535
- const zh$1 = {
27708
+ const zh$2 = {
27536
27709
  sectionTitle: "订阅额度",
27537
27710
  refresh: "刷新",
27538
27711
  refreshing: "刷新中…",
@@ -27564,8 +27737,8 @@ window.__ModuleLoader__.load({
27564
27737
  creditBucket: "额度池 #{index}",
27565
27738
  resetCredits: "重置券"
27566
27739
  };
27567
- const dictionaries$1 = {
27568
- zh: zh$1,
27740
+ const dictionaries$2 = {
27741
+ zh: zh$2,
27569
27742
  en: {
27570
27743
  sectionTitle: "Plan Usage",
27571
27744
  refresh: "Refresh",
@@ -27600,6 +27773,51 @@ window.__ModuleLoader__.load({
27600
27773
  }
27601
27774
  };
27602
27775
  //#endregion
27776
+ //#region src/client/features/advisor/locales.ts
27777
+ const NS_ADVISOR = "dsh-advisor";
27778
+ const dictionaries$1 = {
27779
+ zh: {
27780
+ label: "顾问",
27781
+ model: "顾问模型",
27782
+ none: "未选择",
27783
+ enabled: "已开启",
27784
+ disabled: "已关闭",
27785
+ choose: "选择顾问模型",
27786
+ search: "搜索顾问模型",
27787
+ enableFirst: "未开启",
27788
+ enableHint: "开启顾问后可选择模型。",
27789
+ reasoning: "顾问推理强度",
27790
+ defaultReasoning: "模型默认",
27791
+ faster: "更快",
27792
+ stronger: "更强",
27793
+ privacy: "咨询时,当前对话、工具结果及支持的图片会发送给顾问模型,并产生独立用量。",
27794
+ loading: "正在加载模型…",
27795
+ empty: "当前没有可用模型。",
27796
+ failed: "顾问设置失败:{message}",
27797
+ inherited: "当前使用新对话默认设置;修改后只影响当前对话。"
27798
+ },
27799
+ en: {
27800
+ label: "Advisor",
27801
+ model: "Advisor model",
27802
+ none: "Not selected",
27803
+ enabled: "On",
27804
+ disabled: "Off",
27805
+ choose: "Choose advisor model",
27806
+ search: "Search advisor models",
27807
+ enableFirst: "Off",
27808
+ enableHint: "Turn Advisor on to choose a model.",
27809
+ reasoning: "Advisor reasoning effort",
27810
+ defaultReasoning: "Model default",
27811
+ faster: "Faster",
27812
+ stronger: "Stronger",
27813
+ privacy: "Consulting sends this conversation, tool results, and supported images to the advisor model and uses its quota separately.",
27814
+ loading: "Loading models…",
27815
+ empty: "No models are currently available.",
27816
+ failed: "Could not update Advisor: {message}",
27817
+ inherited: "This conversation inherits the new-conversation default until you change it."
27818
+ }
27819
+ };
27820
+ //#endregion
27603
27821
  //#region src/client/locales-ru/account-pool.ts
27604
27822
  const accountPoolRu = {
27605
27823
  accountPool: "Аккаунты",
@@ -27644,7 +27862,7 @@ window.__ModuleLoader__.load({
27644
27862
  * account-pool labels come from `./account-pool.ts`, with the same overrides the
27645
27863
  * source applies on top of them.
27646
27864
  */
27647
- const dictionary$22 = {
27865
+ const dictionary$23 = {
27648
27866
  ...accountPoolRu,
27649
27867
  title: "Claude (подписка)",
27650
27868
  pageDesc: "Войдите в подписку Claude Pro/Max и управляйте моделями, уровнями рассуждений, контекстными окнами и квотой.",
@@ -27709,11 +27927,14 @@ window.__ModuleLoader__.load({
27709
27927
  defaultReasoningEffort: "Уровень рассуждений по умолчанию",
27710
27928
  defaultReasoningEffortHint: "В списке все уровни, которые встречаются в каталоге (включая xhigh); какие уровни принимает каждая модель, видно ниже — Host отправляет тот, что поддерживает сама модель.",
27711
27929
  defaultEffortAuto: "Значение модели по умолчанию",
27712
- cacheTtl: "Время жизни кеша промпта",
27930
+ cacheTtl: "Время жизни кеша промпта для основного диалога",
27713
27931
  cacheTtlHint: "Anthropic предлагает две ступени: 5 минут и 1 час. Пока подписка расходует лимит тарифа, официальный Claude Code держит час для основного диалога; после исчерпания тарифа и перехода на оплату по расходу он возвращается к пяти минутам. Запись на час дороже, для коротких сессий она не окупается. При длительности 1 час (включая «как у официального клиента»), пока работают субагенты или фоновые задачи, линия примерно каждые 55 минут отправляет один небольшой запрос поддержания кеша, чтобы срок кеша не истёк; при длительности 5 минут этого не происходит.",
27714
27932
  cacheTtlSubscription: "Как у официального (в подписке по умолчанию 1 ч)",
27715
27933
  cacheTtl1h: "1 час",
27716
27934
  cacheTtl5m: "5 минут",
27935
+ subagentCacheTtl: "Время жизни кеша для субагентов и фоновых запросов",
27936
+ subagentCacheTtlHint: "Субагенты, сжатие контекста, заголовки и другие запросы вне основного диалога. Официальный Claude Code использует для них 5 минут: обычно они завершаются за несколько минут, а запись в часовой кеш стоит дороже.",
27937
+ subagentCacheTtlOfficial: "Как у официального (5 минут)",
27717
27938
  fastMode: "Быстрый режим",
27718
27939
  fastModeHint: "Host отправляет speed: fast только поддерживаемым моделям; при отказе исправляет запрос и запоминает результат.",
27719
27940
  cacheKeepalive: "cache-keepalive (cache_touch)",
@@ -27730,6 +27951,10 @@ window.__ModuleLoader__.load({
27730
27951
  contextWindowReset: "Сбросить к умолчанию",
27731
27952
  contextWindowResetAll: "Сбросить все",
27732
27953
  contextWindowResetAllConfirm: "Сбросить контекстные окна всех изменённых моделей к значениям по умолчанию?",
27954
+ maxTokensSection: "Предел вывода за ответ",
27955
+ maxTokensHint: "Сколько токенов может вывести один ответ, включая размышления. По умолчанию — собственный предел модели. Уменьшение оставляет больше места для диалога, но ответ, дошедший до предела, обрывается, и ход завершается.",
27956
+ maxTokensInvalid: "Недопустимый предел вывода: {value}",
27957
+ maxTokensResetAllConfirm: "Вернуть все изменённые пределы вывода к значениям по умолчанию?",
27733
27958
  contextWindowNoneEnabled: "Ни одна модель не отмечена. Отметьте модель выше, и здесь появятся её настройки контекстного окна.",
27734
27959
  contextWindowInvalid: "Недопустимый размер контекста: {value}",
27735
27960
  save: "Сохранить",
@@ -27767,7 +27992,7 @@ window.__ModuleLoader__.load({
27767
27992
  };
27768
27993
  //#endregion
27769
27994
  //#region src/client/locales-ru/cline-pass.ts
27770
- const dictionary$21 = {
27995
+ const dictionary$22 = {
27771
27996
  ...accountPoolRu,
27772
27997
  relogin: "Войти заново",
27773
27998
  needsRelogin: "Вход истёк",
@@ -27893,7 +28118,7 @@ window.__ModuleLoader__.load({
27893
28118
  };
27894
28119
  //#endregion
27895
28120
  //#region src/client/locales-ru/command-code.ts
27896
- const dictionary$20 = {
28121
+ const dictionary$21 = {
27897
28122
  ...accountPoolRu,
27898
28123
  title: "Command Code",
27899
28124
  pageDesc: "Войдите в Command Code и управляйте моделями, контекстными окнами и квотой.",
@@ -27969,7 +28194,7 @@ window.__ModuleLoader__.load({
27969
28194
  };
27970
28195
  //#endregion
27971
28196
  //#region src/client/locales-ru/glm-coding-plan.ts
27972
- const dictionary$19 = {
28197
+ const dictionary$20 = {
27973
28198
  ...accountPoolRu,
27974
28199
  title: "GLM (аккаунт ZCode)",
27975
28200
  pageDesc: "Вход аккаунтом ZCode подключает GLM Coding Plan (Китай — bigmodel.cn, международный — z.ai). Здесь же пул аккаунтов, квота тарифа и выбор моделей. Учётные данные двух регионов независимы, поэтому в одном пуле могут быть аккаунты обоих.",
@@ -28072,7 +28297,7 @@ window.__ModuleLoader__.load({
28072
28297
  * account-pool labels come from `./account-pool.ts`, with the same overrides the
28073
28298
  * source applies on top of them.
28074
28299
  */
28075
- const dictionary$18 = {
28300
+ const dictionary$19 = {
28076
28301
  ...accountPoolRu,
28077
28302
  title: "ChatGPT",
28078
28303
  hubTitle: "Подписки",
@@ -28350,7 +28575,7 @@ window.__ModuleLoader__.load({
28350
28575
  };
28351
28576
  //#endregion
28352
28577
  //#region src/client/locales-ru/kimi-code.ts
28353
- const dictionary$17 = {
28578
+ const dictionary$18 = {
28354
28579
  ...accountPoolRu,
28355
28580
  title: "Kimi Code",
28356
28581
  pageDesc: "Вход в подписку Kimi Code: модели, уровень рассуждений, контекстные окна и квота.",
@@ -28548,7 +28773,7 @@ window.__ModuleLoader__.load({
28548
28773
  };
28549
28774
  //#endregion
28550
28775
  //#region src/client/locales-ru/minimax-code.ts
28551
- const dictionary$16 = {
28776
+ const dictionary$17 = {
28552
28777
  ...accountPoolRu,
28553
28778
  title: "MiniMax Code",
28554
28779
  pageDesc: "Вход в подписку MiniMax Code для программирования (OAuth по коду устройства) с переиспользованием локального входа MiniMax Code: управление аккаунтом, подключением и моделями.",
@@ -28748,7 +28973,7 @@ window.__ModuleLoader__.load({
28748
28973
  };
28749
28974
  //#endregion
28750
28975
  //#region src/client/locales-ru/ollama.ts
28751
- const dictionary$15 = {
28976
+ const dictionary$16 = {
28752
28977
  ...accountPoolRu,
28753
28978
  relogin: "Заменить ключ",
28754
28979
  needsRelogin: "Ключ отклонён",
@@ -28802,7 +29027,7 @@ window.__ModuleLoader__.load({
28802
29027
  };
28803
29028
  //#endregion
28804
29029
  //#region src/client/locales-ru/antigravity-acp.ts
28805
- const dictionary$14 = {
29030
+ const dictionary$15 = {
28806
29031
  title: "Antigravity (ACP)",
28807
29032
  pageDesc: "Подключение через официальный Antigravity CLI от Google по Agent Client Protocol (ACP): модель, инструменты и сессии приходят от официального процесса, и он же хранит состояние входа.",
28808
29033
  routeOwned: "Маршрут моделей обслуживает этот плагин",
@@ -28896,7 +29121,7 @@ window.__ModuleLoader__.load({
28896
29121
  };
28897
29122
  //#endregion
28898
29123
  //#region src/client/locales-ru/opendesign.ts
28899
- const dictionary$13 = {
29124
+ const dictionary$14 = {
28900
29125
  ...accountPoolRu,
28901
29126
  relogin: "Добавить заново",
28902
29127
  needsRelogin: "API-ключ недействителен",
@@ -29006,7 +29231,7 @@ window.__ModuleLoader__.load({
29006
29231
  };
29007
29232
  //#endregion
29008
29233
  //#region src/client/locales-ru/dispatch-ledger.ts
29009
- const dictionary$12 = {
29234
+ const dictionary$13 = {
29010
29235
  mandateTitle: "Запуск субагента",
29011
29236
  mandateTitleFork: "Запуск субагента (с контекстом)",
29012
29237
  mandatePreparing: "Сборка задания",
@@ -29031,7 +29256,7 @@ window.__ModuleLoader__.load({
29031
29256
  };
29032
29257
  //#endregion
29033
29258
  //#region src/client/locales-ru/progress-updates.ts
29034
- const dictionary$11 = {
29259
+ const dictionary$12 = {
29035
29260
  navTitle: "Ход работы",
29036
29261
  progressTitle: "Ход работы",
29037
29262
  progressGuideNote: "Каждый шаг, о котором сообщает агент, собирается здесь",
@@ -29101,12 +29326,24 @@ window.__ModuleLoader__.load({
29101
29326
  settingsLanguageRu: "Русский",
29102
29327
  settingsPanelName: "Панель хода работы",
29103
29328
  settingsPanelNote: "Показывать все записи этой сессии в правой панели",
29329
+ settingsAdvisorEnabledName: "Советник",
29330
+ settingsAdvisorEnabledNote: "Включать советника по умолчанию в новых диалогах, чтобы основная модель могла попросить другую модель проверить диалог перед решением, при повторной ошибке и перед завершением",
29331
+ settingsAdvisorSessionBudgetName: "Бюджет советника на диалог",
29332
+ settingsAdvisorSessionBudgetNote: "Суммарный лимит токенов советника на один диалог; после исчерпания консультации прекращаются, 0 означает без ограничения",
29333
+ settingsAdvisorMaxTokensName: "Лимит ответа советника",
29334
+ settingsAdvisorMaxTokensNote: "Максимум токенов одного ответа советника, ограничен также лимитом самой модели",
29335
+ settingsAdvisorContextName: "Бюджет контекста советника",
29336
+ settingsAdvisorContextNote: "Бюджет истории, передаваемой советнику; при превышении сохраняются первая задача и последние свидетельства",
29337
+ settingsAdvisorTimeoutName: "Тайм-аут советника",
29338
+ settingsAdvisorTimeoutNote: "Общий тайм-аут одной консультации в миллисекундах; тайм-аут считается недоступностью и не блокирует основную задачу",
29339
+ settingsAdvisorRetriesName: "Повторы советника",
29340
+ settingsAdvisorRetriesNote: "Максимум дополнительных попыток при 429, 5xx или сетевой ошибке",
29104
29341
  settingsUnavailable: "Эту настройку сейчас нельзя изменить (Host не предоставляет форму настроек)",
29105
29342
  settingsSaveFailed: "Не удалось сохранить, попробуйте позже"
29106
29343
  };
29107
29344
  //#endregion
29108
29345
  //#region src/client/locales-ru/qoder.ts
29109
- const dictionary$10 = {
29346
+ const dictionary$11 = {
29110
29347
  modelRowEfforts: "уровни {list}",
29111
29348
  modelRowNoEfforts: "без уровней",
29112
29349
  modelRowOutput: "вывод {cap}",
@@ -29228,7 +29465,7 @@ window.__ModuleLoader__.load({
29228
29465
  };
29229
29466
  //#endregion
29230
29467
  //#region src/client/locales-ru/step-code.ts
29231
- const dictionary$9 = {
29468
+ const dictionary$10 = {
29232
29469
  ...accountPoolRu,
29233
29470
  title: "Step Code (подписка Step Plan)",
29234
29471
  pageDesc: "Подключение к StepFun по подписке Step Plan (Китай api.stepfun.com / международный api.stepfun.ai) или по API-ключу открытой платформы: пул аккаунтов, квота тарифа, расход кеша и выбор моделей. Регион — свойство учётных данных, и два региона несовместимы, поэтому в пуле могут быть аккаунты из обоих.",
@@ -29405,7 +29642,7 @@ window.__ModuleLoader__.load({
29405
29642
  * dropped '{placeholder}' would turn a sentence into a bald claim. 'test/
29406
29643
  * russian-locale.test.tsx' pins both rules.
29407
29644
  */
29408
- const dictionary$8 = {
29645
+ const dictionary$9 = {
29409
29646
  title: "WorkBuddy",
29410
29647
  pageDesc: "Повторно использует локальный вход CodeBuddy, чтобы управлять моделями WorkBuddy (подписка CodeBuddy), контекстными окнами и квотой.",
29411
29648
  account: "Аккаунт",
@@ -29533,7 +29770,7 @@ window.__ModuleLoader__.load({
29533
29770
  };
29534
29771
  //#endregion
29535
29772
  //#region src/client/locales-ru/qianwen-token-plan.ts
29536
- const dictionary$7 = {
29773
+ const dictionary$8 = {
29537
29774
  title: "Qwen Token Plan",
29538
29775
  pageDesc: "Подключение Qwen4 по выделенному API-ключу Qianwen Token Plan: явный кеш, воспроизведение размышлений, уровни reasoning, модели и визуальный бюджет.",
29539
29776
  loading: "Загрузка…",
@@ -29608,7 +29845,7 @@ window.__ModuleLoader__.load({
29608
29845
  };
29609
29846
  //#endregion
29610
29847
  //#region src/client/locales-ru/relayone.ts
29611
- const dictionary$6 = {
29848
+ const dictionary$7 = {
29612
29849
  title: "RelayOne",
29613
29850
  pageDesc: "Один API-ключ для диалоговых и медиамоделей, доступных в его текущей группе.",
29614
29851
  enabled: "Включить RelayOne",
@@ -29717,7 +29954,7 @@ window.__ModuleLoader__.load({
29717
29954
  };
29718
29955
  //#endregion
29719
29956
  //#region src/client/locales-ru/claude-api.ts
29720
- const dictionary$5 = {
29957
+ const dictionary$6 = {
29721
29958
  title: "Claude API",
29722
29959
  pageDesc: "Один API-ключ для эндпоинта Anthropic Messages или совместимого шлюза; запросы отправляются в формате официального клиента Claude Code.",
29723
29960
  loading: "Чтение состояния линии…",
@@ -29796,7 +30033,7 @@ window.__ModuleLoader__.load({
29796
30033
  };
29797
30034
  //#endregion
29798
30035
  //#region src/client/locales-ru/aws-quick.ts
29799
- const dictionary$4 = {
30036
+ const dictionary$5 = {
29800
30037
  title: "AWS Quick",
29801
30038
  pageDesc: "Используйте подписку AWS Quick через официальный локальный agent Quick Desktop: потоковый текст, reasoning и три режима ответа.",
29802
30039
  refresh: "Обновить",
@@ -29853,7 +30090,7 @@ window.__ModuleLoader__.load({
29853
30090
  };
29854
30091
  //#endregion
29855
30092
  //#region src/client/locales-ru/compact-after-turn.ts
29856
- const dictionary$3 = {
30093
+ const dictionary$4 = {
29857
30094
  label: "Сжать после этого хода",
29858
30095
  infoLabel: "О сжатии после этого хода",
29859
30096
  hint: "Когда включено, контекст сжимается один раз сразу после окончания этого хода, затем переключатель выключается сам. Ход, остановленный вручную, не считается: переключатель остаётся включённым до конца следующего хода.",
@@ -29868,7 +30105,7 @@ window.__ModuleLoader__.load({
29868
30105
  };
29869
30106
  //#endregion
29870
30107
  //#region src/client/locales-ru/session-quota.ts
29871
- const dictionary$2 = {
30108
+ const dictionary$3 = {
29872
30109
  sectionTitle: "Лимиты плана",
29873
30110
  refresh: "Обновить",
29874
30111
  refreshing: "Обновление…",
@@ -29902,7 +30139,7 @@ window.__ModuleLoader__.load({
29902
30139
  };
29903
30140
  //#endregion
29904
30141
  //#region src/client/locales-ru/model-checklist.ts
29905
- const dictionary$1 = {
30142
+ const dictionary$2 = {
29906
30143
  allGroups: "Все",
29907
30144
  enabledGroup: "Включённые",
29908
30145
  otherGroup: "Другие",
@@ -29912,7 +30149,7 @@ window.__ModuleLoader__.load({
29912
30149
  };
29913
30150
  //#endregion
29914
30151
  //#region src/client/locales-ru/opencode-go.ts
29915
- const dictionary = {
30152
+ const dictionary$1 = {
29916
30153
  ...accountPoolRu,
29917
30154
  title: "OpenCode Go",
29918
30155
  pageDesc: "Используйте подписку OpenCode Go: аккаунты, модели, уровень рассуждений и квота.",
@@ -29985,6 +30222,28 @@ window.__ModuleLoader__.load({
29985
30222
  authMethodApiKey: "Личный API Key",
29986
30223
  composerLabel: "Остаток квоты OpenCode Go"
29987
30224
  };
30225
+ //#endregion
30226
+ //#region src/client/locales-ru/advisor.ts
30227
+ const dictionary = {
30228
+ label: "Советник",
30229
+ model: "Модель советника",
30230
+ none: "Не выбрана",
30231
+ enabled: "Включён",
30232
+ disabled: "Выключен",
30233
+ choose: "Выбрать модель советника",
30234
+ search: "Поиск модели советника",
30235
+ enableFirst: "Выключен",
30236
+ enableHint: "Включите советника, чтобы выбрать модель.",
30237
+ reasoning: "Интенсивность рассуждения советника",
30238
+ defaultReasoning: "По умолчанию для модели",
30239
+ faster: "Быстрее",
30240
+ stronger: "Сильнее",
30241
+ privacy: "При консультации текущий диалог, результаты инструментов и поддерживаемые изображения отправляются модели советника и расходуют её квоту отдельно.",
30242
+ loading: "Загрузка моделей…",
30243
+ empty: "Сейчас нет доступных моделей.",
30244
+ failed: "Не удалось изменить настройки советника: {message}",
30245
+ inherited: "Диалог использует настройку по умолчанию для новых диалогов, пока вы её не измените."
30246
+ };
29988
30247
  /**
29989
30248
  * Register the Russian language and every dictionary it covers.
29990
30249
  *
@@ -30007,29 +30266,30 @@ window.__ModuleLoader__.load({
30007
30266
  }
30008
30267
  }, "dsh-chatgpt-subscription: ru language");
30009
30268
  const dictionaries = [
30010
- [NS, dictionary$18],
30011
- [NS_CLAUDE, dictionary$22],
30012
- [NS_COMMAND_CODE, dictionary$20],
30013
- [NS_KIMI_CODE, dictionary$17],
30014
- [NS_MINIMAX_CODE, dictionary$16],
30015
- [NS_GLM_CODING_PLAN, dictionary$19],
30016
- [NS_OLLAMA, dictionary$15],
30017
- [NS_STEP_CODE, dictionary$9],
30018
- [NS_CLINE_PASS, dictionary$21],
30019
- [NS_QODER, dictionary$10],
30020
- [NS_OPENDESIGN, dictionary$13],
30021
- [NS_PROGRESS_UPDATES, dictionary$11],
30022
- [NS_WORKBUDDY, dictionary$8],
30023
- [NS_DISPATCH_LEDGER, dictionary$12],
30024
- [NS_ANTIGRAVITY_ACP, dictionary$14],
30025
- [NS_QIANWEN, dictionary$7],
30026
- [NS_RELAYONE, dictionary$6],
30027
- [NS_CLAUDE_API, dictionary$5],
30028
- [NS_AWS_QUICK, dictionary$4],
30029
- [NS_COMPACT_AFTER_TURN, dictionary$3],
30030
- [NS_SESSION_QUOTA, dictionary$2],
30031
- [NS_MODEL_CHECKLIST, dictionary$1],
30032
- [NS_OPENCODE_GO, dictionary]
30269
+ [NS, dictionary$19],
30270
+ [NS_CLAUDE, dictionary$23],
30271
+ [NS_COMMAND_CODE, dictionary$21],
30272
+ [NS_KIMI_CODE, dictionary$18],
30273
+ [NS_MINIMAX_CODE, dictionary$17],
30274
+ [NS_GLM_CODING_PLAN, dictionary$20],
30275
+ [NS_OLLAMA, dictionary$16],
30276
+ [NS_STEP_CODE, dictionary$10],
30277
+ [NS_CLINE_PASS, dictionary$22],
30278
+ [NS_QODER, dictionary$11],
30279
+ [NS_OPENDESIGN, dictionary$14],
30280
+ [NS_PROGRESS_UPDATES, dictionary$12],
30281
+ [NS_WORKBUDDY, dictionary$9],
30282
+ [NS_DISPATCH_LEDGER, dictionary$13],
30283
+ [NS_ANTIGRAVITY_ACP, dictionary$15],
30284
+ [NS_QIANWEN, dictionary$8],
30285
+ [NS_RELAYONE, dictionary$7],
30286
+ [NS_CLAUDE_API, dictionary$6],
30287
+ [NS_AWS_QUICK, dictionary$5],
30288
+ [NS_COMPACT_AFTER_TURN, dictionary$4],
30289
+ [NS_SESSION_QUOTA, dictionary$3],
30290
+ [NS_MODEL_CHECKLIST, dictionary$2],
30291
+ [NS_OPENCODE_GO, dictionary$1],
30292
+ [NS_ADVISOR, dictionary]
30033
30293
  ];
30034
30294
  for (const [ns, dictionary] of dictionaries) ctx.effect(() => {
30035
30295
  try {
@@ -30079,7 +30339,7 @@ window.__ModuleLoader__.load({
30079
30339
  }
30080
30340
  //#endregion
30081
30341
  //#region src/client/providers/codex-chatgpt/styles.ts
30082
- const CSS$6 = `
30342
+ const CSS$7 = `
30083
30343
  .dsh-codex-page{box-sizing:border-box;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:20px;max-width:780px;min-width:0;padding:2px 0 30px}
30084
30344
  .dsh-codex-page *{box-sizing:border-box}
30085
30345
  .dsh-codex-page :where(.dsha-account-add-actions:not(.dsh-codex-login-actions)){flex-wrap:nowrap;min-width:0}
@@ -30229,7 +30489,7 @@ window.__ModuleLoader__.load({
30229
30489
  * removed with, some other package.
30230
30490
  */
30231
30491
  function installStyles() {
30232
- return installPluginStyle("main", CSS$6);
30492
+ return installPluginStyle("main", CSS$7);
30233
30493
  }
30234
30494
  //#endregion
30235
30495
  //#region src/client/hub/hub-styles.ts
@@ -30239,7 +30499,7 @@ window.__ModuleLoader__.load({
30239
30499
  * batch selection bar, and context menu. Uses DSH theme tokens so light, dark,
30240
30500
  * and custom theme palettes work without hardcoded branches.
30241
30501
  */
30242
- const CSS$5 = `
30502
+ const CSS$6 = `
30243
30503
  .dsh-hub-overview{display:flex;flex-direction:column;gap:10px;min-width:0}
30244
30504
  .dsh-hub-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;margin:2px 0 4px;min-width:0}
30245
30505
  .dsh-hub-head-tools{flex:0 1 auto;margin:0}
@@ -30360,7 +30620,7 @@ window.__ModuleLoader__.load({
30360
30620
  .dsh-hub-detail .dsha-page>header{margin-bottom:4px}
30361
30621
  `;
30362
30622
  function installHubStyles() {
30363
- installPluginStyle("hub", CSS$5);
30623
+ installPluginStyle("hub", CSS$6);
30364
30624
  }
30365
30625
  //#endregion
30366
30626
  //#region src/client/common/model-checklist-styles.ts
@@ -30369,7 +30629,7 @@ window.__ModuleLoader__.load({
30369
30629
  * and hover follow the claude-style model picker so the settings list and the
30370
30630
  * conversation picker read as one surface.
30371
30631
  */
30372
- const CSS$4 = `
30632
+ const CSS$5 = `
30373
30633
  .dsh-mcl{display:flex;flex-direction:column;min-width:0;padding:4px 0 2px}
30374
30634
  .dsh-mcl-head{align-items:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;min-height:28px;padding:2px 2px 6px}
30375
30635
  .dsh-mcl-count{color:var(--dsw-alias-label-caption,#a6a094);font-size:11px;letter-spacing:.02em;margin-right:auto}
@@ -30415,7 +30675,7 @@ window.__ModuleLoader__.load({
30415
30675
  @media(max-width:560px){.dsh-mcl-split{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);height:420px}.dsh-mcl-vendors{border-bottom:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-right:none;flex-direction:row;overflow-x:auto;overflow-y:hidden}.dsh-mcl-vendor{width:auto}.dsh-mcl-vendor-sep{height:18px;margin:auto 2px;width:1px}.dsh-mcl-search{flex:1;max-width:none;width:auto}}
30416
30676
  `;
30417
30677
  function installModelChecklistStyles() {
30418
- installPluginStyle("model-checklist", CSS$4);
30678
+ installPluginStyle("model-checklist", CSS$5);
30419
30679
  }
30420
30680
  //#endregion
30421
30681
  //#region src/client/common/styles.ts
@@ -30978,7 +31238,7 @@ window.__ModuleLoader__.load({
30978
31238
  //#region src/client/providers/minimax-code/MinimaxVideoDocumentBody.tsx
30979
31239
  /** 兜底翻译:只在没有 locale 座位时用到。 */
30980
31240
  function translate$1(key) {
30981
- return zh$19[key] ?? key;
31241
+ return zh$20[key] ?? key;
30982
31242
  }
30983
31243
  /**
30984
31244
  * 一个文件地址里的会话与路径。
@@ -31114,7 +31374,7 @@ window.__ModuleLoader__.load({
31114
31374
  */
31115
31375
  /** 兜底翻译:只在没有 locale 座位时用到,走同一份 zh 字典。 */
31116
31376
  function translate(key) {
31117
- return zh$19[key] ?? key;
31377
+ return zh$20[key] ?? key;
31118
31378
  }
31119
31379
  /**
31120
31380
  * 一张视频工具卡片。
@@ -31570,7 +31830,7 @@ window.__ModuleLoader__.load({
31570
31830
  * 没有快照、没有窗口、或全部窗口都没有百分比时返回 null,即**不渲染胶囊**:
31571
31831
  * 契约允许 quota 为 null,装一个占位数字比不显示更像坏了。
31572
31832
  */
31573
- function selectBadgeFacts$3(status, lookup = (key) => zh$18[key]) {
31833
+ function selectBadgeFacts$3(status, lookup = (key) => zh$19[key]) {
31574
31834
  const measured = (status?.quota?.windows ?? []).filter((window) => typeof window.usedPercent === "number" && Number.isFinite(window.usedPercent));
31575
31835
  if (measured.length === 0) return null;
31576
31836
  const tightest = measured.reduce((best, window) => {
@@ -31666,7 +31926,7 @@ window.__ModuleLoader__.load({
31666
31926
  * single most misleading pixel on the page.
31667
31927
  */
31668
31928
  function AntigravityAcpComposerBadge(props) {
31669
- const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$15);
31929
+ const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$16);
31670
31930
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
31671
31931
  directory: props.directory,
31672
31932
  loadModelDirectory: props.loadModelDirectory,
@@ -31750,7 +32010,7 @@ window.__ModuleLoader__.load({
31750
32010
  *
31751
32011
  * 没有快照、没有窗口、或全部窗口都没有百分比时返回 null(见文件头)。
31752
32012
  */
31753
- function selectBadgeFacts$2(status, lookup = (key) => zh$12[key]) {
32013
+ function selectBadgeFacts$2(status, lookup = (key) => zh$13[key]) {
31754
32014
  const quota = status?.quota;
31755
32015
  if (quota === null || quota === void 0) return null;
31756
32016
  if (quota.kind !== "windowed") return null;
@@ -31897,7 +32157,7 @@ window.__ModuleLoader__.load({
31897
32157
  directory: props.directory,
31898
32158
  loadModelDirectory: props.loadModelDirectory,
31899
32159
  providerId: "cline-pass",
31900
- label: zh$11.composerLabel,
32160
+ label: zh$12.composerLabel,
31901
32161
  readStatus: (refresh) => API$1.status(refresh),
31902
32162
  selectFacts: selectClinePassFacts
31903
32163
  });
@@ -31983,7 +32243,7 @@ window.__ModuleLoader__.load({
31983
32243
  * 另外那只可能还剩一大半。所以这里不平均、不取最小剩余,而是取最大已用比例。
31984
32244
  * 没有快照、没有桶、或全部桶都没有总额时返回 null(见文件头)。
31985
32245
  */
31986
- function selectBadgeFacts$1(status, lookup = (key) => zh$10[key]) {
32246
+ function selectBadgeFacts$1(status, lookup = (key) => zh$11[key]) {
31987
32247
  const quota = status?.quota;
31988
32248
  if (quota === null || quota === void 0) return null;
31989
32249
  const measurable = quota.buckets.filter((bucket) => bucket.total !== null && bucket.total > 0 && bucket.used !== null);
@@ -31993,7 +32253,7 @@ window.__ModuleLoader__.load({
31993
32253
  const remaining = Math.round((1 - used) * 100);
31994
32254
  const unit = tightest.unit !== null && tightest.unit !== "" ? " " + tightest.unit : "";
31995
32255
  const bucketLabel = quotaBucketText(tightest.kind, {
31996
- ...zh$10,
32256
+ ...zh$11,
31997
32257
  quotaBucketPersonal: lookup("quotaBucketPersonal"),
31998
32258
  quotaBucketAddOn: lookup("quotaBucketAddOn"),
31999
32259
  quotaBucketOrg: lookup("quotaBucketOrg")
@@ -32104,7 +32364,7 @@ window.__ModuleLoader__.load({
32104
32364
  directory: props.directory,
32105
32365
  loadModelDirectory: props.loadModelDirectory,
32106
32366
  providerId: "opendesign",
32107
- label: zh$9.composerLabel,
32367
+ label: zh$10.composerLabel,
32108
32368
  readStatus: () => API.status(),
32109
32369
  selectFacts: selectOpenDesignFacts
32110
32370
  });
@@ -32125,9 +32385,9 @@ window.__ModuleLoader__.load({
32125
32385
  * is not), and one decimal is what keeps "1.5 小时" from reading as "2 小时".
32126
32386
  */
32127
32387
  function planWindowName(seconds) {
32128
- if (seconds >= 86400 && seconds % 86400 === 0) return zh$9.usageWindowDays.replace("{count}", String(seconds / 86400));
32129
- if (seconds >= 3600) return zh$9.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
32130
- return zh$9.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
32388
+ if (seconds >= 86400 && seconds % 86400 === 0) return zh$10.usageWindowDays.replace("{count}", String(seconds / 86400));
32389
+ if (seconds >= 3600) return zh$10.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
32390
+ return zh$10.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
32131
32391
  }
32132
32392
  /** What a window still has, from the grant and the remainder it states. */
32133
32393
  function windowRemaining(limitCredits, remainingCredits) {
@@ -32160,7 +32420,7 @@ window.__ModuleLoader__.load({
32160
32420
  const primaryId = status.pool.activeAccountId ?? status.pool.accounts.find((account) => account.isPrimary)?.id;
32161
32421
  const reading = readings.find((account) => account.accountId === primaryId) ?? readings[0];
32162
32422
  const amount = reading.balanceUsd;
32163
- const readAt = zh$9.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
32423
+ const readAt = zh$10.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
32164
32424
  const windows = planWindows(reading.codingPlan);
32165
32425
  if (windows.length === 0) return {
32166
32426
  text: `$${amount}`,
@@ -32169,8 +32429,8 @@ window.__ModuleLoader__.load({
32169
32429
  };
32170
32430
  const narrowest = windows[0];
32171
32431
  return {
32172
- text: zh$9.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
32173
- tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$9.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
32432
+ text: zh$10.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
32433
+ tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$10.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
32174
32434
  level: quotaLevel(narrowest.remaining),
32175
32435
  percent: narrowest.remaining
32176
32436
  };
@@ -33960,7 +34220,7 @@ window.__ModuleLoader__.load({
33960
34220
  }
33961
34221
  /** 兜底翻译:只在没有 locale 服务时用到(测试、以及菜单渲染早于字典注册)。 */
33962
34222
  function fallbackTranslate$3(key, params) {
33963
- const template = zh$19[key] ?? key;
34223
+ const template = zh$20[key] ?? key;
33964
34224
  if (params === void 0) return template;
33965
34225
  return template.replace(/\{(\w+)\}/g, (_match, name) => String(params[name] ?? ""));
33966
34226
  }
@@ -61115,7 +61375,7 @@ window.__ModuleLoader__.load({
61115
61375
  }
61116
61376
  function translator(t) {
61117
61377
  return (key, params) => {
61118
- return interpolate$1(t === void 0 ? zh$3[key] ?? key : t(key), params);
61378
+ return interpolate$1(t === void 0 ? zh$4[key] ?? key : t(key), params);
61119
61379
  };
61120
61380
  }
61121
61381
  function titleOf(update) {
@@ -62021,7 +62281,7 @@ window.__ModuleLoader__.load({
62021
62281
  //#region src/client/features/progress-updates/updates-panel.tsx
62022
62282
  /** 进展面板的数据源适配;视觉实现见 dashboard.tsx。 */
62023
62283
  function fallbackTranslate$2(key, params) {
62024
- return interpolate(zh$3[key] ?? key, params);
62284
+ return interpolate(zh$4[key] ?? key, params);
62025
62285
  }
62026
62286
  function interpolate(template, params) {
62027
62287
  if (params === void 0) return template;
@@ -62259,6 +62519,39 @@ window.__ModuleLoader__.load({
62259
62519
  })]
62260
62520
  });
62261
62521
  }
62522
+ /** 顾问数字字段的范围与默认值,逐项照抄宿主 `Config` schema。 */
62523
+ const ADVISOR_LIMITS = {
62524
+ budget: {
62525
+ min: 0,
62526
+ max: 1e7,
62527
+ step: 1,
62528
+ fallback: 2e5
62529
+ },
62530
+ output: {
62531
+ min: 256,
62532
+ max: 32768,
62533
+ step: 1,
62534
+ fallback: 4096
62535
+ },
62536
+ context: {
62537
+ min: 8e3,
62538
+ max: 1e6,
62539
+ step: 1,
62540
+ fallback: 1e5
62541
+ },
62542
+ timeout: {
62543
+ min: 1e3,
62544
+ max: 3e5,
62545
+ step: 1,
62546
+ fallback: 3e5
62547
+ },
62548
+ retries: {
62549
+ min: 0,
62550
+ max: 3,
62551
+ step: 1,
62552
+ fallback: 1
62553
+ }
62554
+ };
62262
62555
  /**
62263
62556
  * 没有表单通道时的空快照。写成模块级常量,是因为
62264
62557
  * `useSyncExternalStore` 要求 `getSnapshot` 返回稳定引用。
@@ -62549,6 +62842,130 @@ window.__ModuleLoader__.load({
62549
62842
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 4.5v11" })]
62550
62843
  });
62551
62844
  }
62845
+ /** 顾问开关那一行的标记:两枚对望的气泡(第二意见)。 */
62846
+ function AdvisorMark() {
62847
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62848
+ viewBox: "0 0 20 20",
62849
+ width: "20",
62850
+ height: "20",
62851
+ fill: "none",
62852
+ stroke: "currentColor",
62853
+ strokeWidth: "1.6",
62854
+ strokeLinecap: "round",
62855
+ strokeLinejoin: "round",
62856
+ "aria-hidden": "true",
62857
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.5 8.2a3.7 3.7 0 0 1 3.7-3.7h3.1a3.7 3.7 0 0 1 0 7.4H8.9L6.3 14v-2.3a3.7 3.7 0 0 1-2.8-3.5Z" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.2 6.2h.6a3.4 3.4 0 0 1 3.4 3.4c0 1.5-1 2.8-2.4 3.2v1.9l-2.1-1.6" })]
62858
+ });
62859
+ }
62860
+ /** 顾问预算那一行的标记:一枚硬币(成本闸门)。 */
62861
+ function AdvisorBudgetMark() {
62862
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62863
+ viewBox: "0 0 20 20",
62864
+ width: "20",
62865
+ height: "20",
62866
+ fill: "none",
62867
+ stroke: "currentColor",
62868
+ strokeWidth: "1.6",
62869
+ strokeLinecap: "round",
62870
+ strokeLinejoin: "round",
62871
+ "aria-hidden": "true",
62872
+ children: [
62873
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
62874
+ cx: "10",
62875
+ cy: "10",
62876
+ r: "6.5"
62877
+ }),
62878
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.3 7.6c-.6-.6-1.4-.9-2.3-.9-1.4 0-2.4.7-2.4 1.7 0 1.1 1 1.5 2.4 1.8 1.4.3 2.4.7 2.4 1.7 0 1-1 1.7-2.4 1.7-.9 0-1.7-.3-2.3-.9" }),
62879
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 5.6v1M10 13.4v1" })
62880
+ ]
62881
+ });
62882
+ }
62883
+ /** 顾问输出上限那一行的标记:一块向下收窄的量尺。 */
62884
+ function AdvisorOutputMark() {
62885
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62886
+ viewBox: "0 0 20 20",
62887
+ width: "20",
62888
+ height: "20",
62889
+ fill: "none",
62890
+ stroke: "currentColor",
62891
+ strokeWidth: "1.6",
62892
+ strokeLinecap: "round",
62893
+ strokeLinejoin: "round",
62894
+ "aria-hidden": "true",
62895
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
62896
+ x: "3.5",
62897
+ y: "4",
62898
+ width: "13",
62899
+ height: "12",
62900
+ rx: "2"
62901
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6.8 8h6.4M6.8 11h4M6.8 14h2" })]
62902
+ });
62903
+ }
62904
+ /** 顾问上下文预算那一行的标记:一叠层叠的历史。 */
62905
+ function AdvisorContextMark() {
62906
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62907
+ viewBox: "0 0 20 20",
62908
+ width: "20",
62909
+ height: "20",
62910
+ fill: "none",
62911
+ stroke: "currentColor",
62912
+ strokeWidth: "1.6",
62913
+ strokeLinecap: "round",
62914
+ strokeLinejoin: "round",
62915
+ "aria-hidden": "true",
62916
+ children: [
62917
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
62918
+ x: "3.5",
62919
+ y: "4",
62920
+ width: "13",
62921
+ height: "4",
62922
+ rx: "1.4"
62923
+ }),
62924
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
62925
+ x: "3.5",
62926
+ y: "9",
62927
+ width: "13",
62928
+ height: "4",
62929
+ rx: "1.4"
62930
+ }),
62931
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 15h8" })
62932
+ ]
62933
+ });
62934
+ }
62935
+ /** 顾问超时那一行的标记:一只钟。 */
62936
+ function AdvisorTimeoutMark() {
62937
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62938
+ viewBox: "0 0 20 20",
62939
+ width: "20",
62940
+ height: "20",
62941
+ fill: "none",
62942
+ stroke: "currentColor",
62943
+ strokeWidth: "1.6",
62944
+ strokeLinecap: "round",
62945
+ strokeLinejoin: "round",
62946
+ "aria-hidden": "true",
62947
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
62948
+ cx: "10",
62949
+ cy: "10",
62950
+ r: "6.5"
62951
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 6.4V10l2.4 1.6" })]
62952
+ });
62953
+ }
62954
+ /** 顾问重试那一行的标记:一段循环箭头。 */
62955
+ function AdvisorRetryMark() {
62956
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
62957
+ viewBox: "0 0 20 20",
62958
+ width: "20",
62959
+ height: "20",
62960
+ fill: "none",
62961
+ stroke: "currentColor",
62962
+ strokeWidth: "1.6",
62963
+ strokeLinecap: "round",
62964
+ strokeLinejoin: "round",
62965
+ "aria-hidden": "true",
62966
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16 10a6 6 0 1 1-1.8-4.3" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16 3.9v2.9h-2.9" })]
62967
+ });
62968
+ }
62552
62969
  /**
62553
62970
  * 一行卡片的外壳:左侧方块、中间名称与说明、右侧控件。
62554
62971
  * @param props - 行内各部件与是否关闭态。
@@ -62611,6 +63028,12 @@ window.__ModuleLoader__.load({
62611
63028
  const toolRunawayGuard = value.toolRunawayGuard !== false;
62612
63029
  const mediaTools = value.mediaTools !== false;
62613
63030
  const teamPolicyCacheGuard = value.teamPolicyCacheGuard !== false;
63031
+ const advisorEnabled = value.advisorEnabled === true;
63032
+ const advisorBudget = typeof value.advisorSessionTokenBudget === "number" ? value.advisorSessionTokenBudget : ADVISOR_LIMITS.budget.fallback;
63033
+ const advisorOutput = typeof value.advisorMaxTokens === "number" ? value.advisorMaxTokens : ADVISOR_LIMITS.output.fallback;
63034
+ const advisorContext = typeof value.advisorContextTokenBudget === "number" ? value.advisorContextTokenBudget : ADVISOR_LIMITS.context.fallback;
63035
+ const advisorTimeout = typeof value.advisorTimeoutMs === "number" ? value.advisorTimeoutMs : ADVISOR_LIMITS.timeout.fallback;
63036
+ const advisorRetry = typeof value.advisorMaxRetries === "number" ? value.advisorMaxRetries : ADVISOR_LIMITS.retries.fallback;
62614
63037
  const threshold = typeof value.progressUpdatesNudgeThreshold === "number" ? value.progressUpdatesNudgeThreshold : 8;
62615
63038
  const language = value.progressUpdatesLanguage === "zh" || value.progressUpdatesLanguage === "en" || value.progressUpdatesLanguage === "ru" ? value.progressUpdatesLanguage : "auto";
62616
63039
  const [draft, setDraft] = (0, react.useState)(() => String(threshold));
@@ -62618,6 +63041,43 @@ window.__ModuleLoader__.load({
62618
63041
  setDraft(String(threshold));
62619
63042
  }, [threshold]);
62620
63043
  /**
63044
+ * 顾问的五个数字字段各有一份草稿文本:与催促阈值同一条策略——只有落进
63045
+ * 宿主 schema 范围的整数才提交,半截输入留在框里不打扰宿主。
63046
+ */
63047
+ const advisorNumbers = {
63048
+ advisorBudget,
63049
+ advisorOutput,
63050
+ advisorContext,
63051
+ advisorTimeout,
63052
+ advisorRetry
63053
+ };
63054
+ const [advisorDrafts, setAdvisorDrafts] = (0, react.useState)(() => Object.fromEntries(Object.entries(advisorNumbers).map(([key, value]) => [key, String(value)])));
63055
+ (0, react.useEffect)(() => {
63056
+ setAdvisorDrafts(Object.fromEntries(Object.entries(advisorNumbers).map(([key, value]) => [key, String(value)])));
63057
+ }, [
63058
+ advisorBudget,
63059
+ advisorOutput,
63060
+ advisorContext,
63061
+ advisorTimeout,
63062
+ advisorRetry
63063
+ ]);
63064
+ /**
63065
+ * 提交一个顾问数字字段。
63066
+ * @param row - 出问题的是哪一行。
63067
+ * @param field - 本插件 Config 的根字段名。
63068
+ * @param raw - 输入框原始文本。
63069
+ * @param bounds - 合法范围。
63070
+ */
63071
+ const editAdvisorNumber = (row, field, raw, bounds) => {
63072
+ setAdvisorDrafts((prev) => ({
63073
+ ...prev,
63074
+ [row]: raw
63075
+ }));
63076
+ const parsed = Number(raw);
63077
+ if (!Number.isSafeInteger(parsed) || parsed < bounds.min || parsed > bounds.max) return;
63078
+ write(row, field, parsed);
63079
+ };
63080
+ /**
62621
63081
  * 写一个字段;宿主拒绝、传输失败、没有通道都落到该行的说明行上。
62622
63082
  * @param row - 出问题的是哪一行。
62623
63083
  * @param field - 字段名(本插件 Config 的根字段)。
@@ -62895,6 +63355,172 @@ window.__ModuleLoader__.load({
62895
63355
  }
62896
63356
  })
62897
63357
  }),
63358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63359
+ part: "settings-row-advisor",
63360
+ brand: "#3f7d8c",
63361
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorMark, {}),
63362
+ name: translate("settingsAdvisorEnabledName"),
63363
+ note: unavailable ?? (failure?.row === "advisor" ? failure.text : translate("settingsAdvisorEnabledNote")),
63364
+ danger: failure?.row === "advisor" || unavailable !== void 0,
63365
+ enabled: advisorEnabled,
63366
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
63367
+ type: "button",
63368
+ role: "switch",
63369
+ "aria-checked": advisorEnabled,
63370
+ "aria-label": translate("settingsAdvisorEnabledName"),
63371
+ className: "dsh-progress-switch",
63372
+ "data-dsh-part": "settings-advisor-switch",
63373
+ disabled: !writable,
63374
+ onClick: () => {
63375
+ write("advisor", "advisorEnabled", !advisorEnabled);
63376
+ }
63377
+ })
63378
+ }),
63379
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63380
+ part: "settings-row-advisor-budget",
63381
+ brand: "#2f7d5c",
63382
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorBudgetMark, {}),
63383
+ name: translate("settingsAdvisorSessionBudgetName"),
63384
+ note: failure?.row === "advisorBudget" ? failure.text : translate("settingsAdvisorSessionBudgetNote"),
63385
+ danger: failure?.row === "advisorBudget",
63386
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
63387
+ type: "number",
63388
+ inputMode: "numeric",
63389
+ min: ADVISOR_LIMITS.budget.min,
63390
+ max: ADVISOR_LIMITS.budget.max,
63391
+ step: ADVISOR_LIMITS.budget.step,
63392
+ className: "dsh-progress-number dsh-progress-number-wide",
63393
+ "data-dsh-part": "settings-advisor-budget",
63394
+ "aria-label": translate("settingsAdvisorSessionBudgetName"),
63395
+ value: advisorDrafts["advisorBudget"] ?? "200000",
63396
+ disabled: !writable,
63397
+ onChange: (event) => {
63398
+ editAdvisorNumber("advisorBudget", "advisorSessionTokenBudget", event.target.value, ADVISOR_LIMITS.budget);
63399
+ },
63400
+ onBlur: () => {
63401
+ setAdvisorDrafts((prev) => ({
63402
+ ...prev,
63403
+ advisorBudget: String(advisorBudget)
63404
+ }));
63405
+ }
63406
+ })
63407
+ }),
63408
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63409
+ part: "settings-row-advisor-output",
63410
+ brand: "#4d6bfe",
63411
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorOutputMark, {}),
63412
+ name: translate("settingsAdvisorMaxTokensName"),
63413
+ note: failure?.row === "advisorOutput" ? failure.text : translate("settingsAdvisorMaxTokensNote"),
63414
+ danger: failure?.row === "advisorOutput",
63415
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
63416
+ type: "number",
63417
+ inputMode: "numeric",
63418
+ min: ADVISOR_LIMITS.output.min,
63419
+ max: ADVISOR_LIMITS.output.max,
63420
+ step: ADVISOR_LIMITS.output.step,
63421
+ className: "dsh-progress-number dsh-progress-number-wide",
63422
+ "data-dsh-part": "settings-advisor-output",
63423
+ "aria-label": translate("settingsAdvisorMaxTokensName"),
63424
+ value: advisorDrafts["advisorOutput"] ?? "4096",
63425
+ disabled: !writable,
63426
+ onChange: (event) => {
63427
+ editAdvisorNumber("advisorOutput", "advisorMaxTokens", event.target.value, ADVISOR_LIMITS.output);
63428
+ },
63429
+ onBlur: () => {
63430
+ setAdvisorDrafts((prev) => ({
63431
+ ...prev,
63432
+ advisorOutput: String(advisorOutput)
63433
+ }));
63434
+ }
63435
+ })
63436
+ }),
63437
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63438
+ part: "settings-row-advisor-context",
63439
+ brand: "#168a9c",
63440
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorContextMark, {}),
63441
+ name: translate("settingsAdvisorContextName"),
63442
+ note: failure?.row === "advisorContext" ? failure.text : translate("settingsAdvisorContextNote"),
63443
+ danger: failure?.row === "advisorContext",
63444
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
63445
+ type: "number",
63446
+ inputMode: "numeric",
63447
+ min: ADVISOR_LIMITS.context.min,
63448
+ max: ADVISOR_LIMITS.context.max,
63449
+ step: ADVISOR_LIMITS.context.step,
63450
+ className: "dsh-progress-number dsh-progress-number-wide",
63451
+ "data-dsh-part": "settings-advisor-context",
63452
+ "aria-label": translate("settingsAdvisorContextName"),
63453
+ value: advisorDrafts["advisorContext"] ?? "100000",
63454
+ disabled: !writable,
63455
+ onChange: (event) => {
63456
+ editAdvisorNumber("advisorContext", "advisorContextTokenBudget", event.target.value, ADVISOR_LIMITS.context);
63457
+ },
63458
+ onBlur: () => {
63459
+ setAdvisorDrafts((prev) => ({
63460
+ ...prev,
63461
+ advisorContext: String(advisorContext)
63462
+ }));
63463
+ }
63464
+ })
63465
+ }),
63466
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63467
+ part: "settings-row-advisor-timeout",
63468
+ brand: "#d97724",
63469
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorTimeoutMark, {}),
63470
+ name: translate("settingsAdvisorTimeoutName"),
63471
+ note: failure?.row === "advisorTimeout" ? failure.text : translate("settingsAdvisorTimeoutNote"),
63472
+ danger: failure?.row === "advisorTimeout",
63473
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
63474
+ type: "number",
63475
+ inputMode: "numeric",
63476
+ min: ADVISOR_LIMITS.timeout.min,
63477
+ max: ADVISOR_LIMITS.timeout.max,
63478
+ step: ADVISOR_LIMITS.timeout.step,
63479
+ className: "dsh-progress-number dsh-progress-number-wide",
63480
+ "data-dsh-part": "settings-advisor-timeout",
63481
+ "aria-label": translate("settingsAdvisorTimeoutName"),
63482
+ value: advisorDrafts["advisorTimeout"] ?? "300000",
63483
+ disabled: !writable,
63484
+ onChange: (event) => {
63485
+ editAdvisorNumber("advisorTimeout", "advisorTimeoutMs", event.target.value, ADVISOR_LIMITS.timeout);
63486
+ },
63487
+ onBlur: () => {
63488
+ setAdvisorDrafts((prev) => ({
63489
+ ...prev,
63490
+ advisorTimeout: String(advisorTimeout)
63491
+ }));
63492
+ }
63493
+ })
63494
+ }),
63495
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
63496
+ part: "settings-row-advisor-retry",
63497
+ brand: "#7c6aef",
63498
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorRetryMark, {}),
63499
+ name: translate("settingsAdvisorRetriesName"),
63500
+ note: failure?.row === "advisorRetry" ? failure.text : translate("settingsAdvisorRetriesNote"),
63501
+ danger: failure?.row === "advisorRetry",
63502
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
63503
+ type: "number",
63504
+ inputMode: "numeric",
63505
+ min: ADVISOR_LIMITS.retries.min,
63506
+ max: ADVISOR_LIMITS.retries.max,
63507
+ step: ADVISOR_LIMITS.retries.step,
63508
+ className: "dsh-progress-number dsh-progress-number-wide",
63509
+ "data-dsh-part": "settings-advisor-retry",
63510
+ "aria-label": translate("settingsAdvisorRetriesName"),
63511
+ value: advisorDrafts["advisorRetry"] ?? "1",
63512
+ disabled: !writable,
63513
+ onChange: (event) => {
63514
+ editAdvisorNumber("advisorRetry", "advisorMaxRetries", event.target.value, ADVISOR_LIMITS.retries);
63515
+ },
63516
+ onBlur: () => {
63517
+ setAdvisorDrafts((prev) => ({
63518
+ ...prev,
63519
+ advisorRetry: String(advisorRetry)
63520
+ }));
63521
+ }
63522
+ })
63523
+ }),
62898
63524
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
62899
63525
  part: "settings-row-threshold",
62900
63526
  brand: "#2f9e6e",
@@ -63617,7 +64243,7 @@ window.__ModuleLoader__.load({
63617
64243
  try {
63618
64244
  return ctx.locale.bind(NS_PROGRESS_UPDATES)("progressTitle");
63619
64245
  } catch {
63620
- return zh$3.progressTitle;
64246
+ return zh$4.progressTitle;
63621
64247
  }
63622
64248
  },
63623
64249
  guide: [{
@@ -63627,14 +64253,14 @@ window.__ModuleLoader__.load({
63627
64253
  try {
63628
64254
  return ctx.locale.bind(NS_PROGRESS_UPDATES)("progressTitle");
63629
64255
  } catch {
63630
- return zh$3.progressTitle;
64256
+ return zh$4.progressTitle;
63631
64257
  }
63632
64258
  },
63633
64259
  description: () => {
63634
64260
  try {
63635
64261
  return ctx.locale.bind(NS_PROGRESS_UPDATES)("progressGuideNote");
63636
64262
  } catch {
63637
- return zh$3.progressGuideNote;
64263
+ return zh$4.progressGuideNote;
63638
64264
  }
63639
64265
  },
63640
64266
  icon: ProgressUpdatesArtwork
@@ -63712,7 +64338,7 @@ window.__ModuleLoader__.load({
63712
64338
  try {
63713
64339
  return ctx.locale.bind(NS_PROGRESS_UPDATES)("navTitle");
63714
64340
  } catch {
63715
- return zh$3.navTitle;
64341
+ return zh$4.navTitle;
63716
64342
  }
63717
64343
  },
63718
64344
  locale: NS_PROGRESS_UPDATES,
@@ -63760,7 +64386,7 @@ window.__ModuleLoader__.load({
63760
64386
  /** 这张表的 `data-plugin-css` 子名。 */
63761
64387
  const STYLE_NAME$1 = "progress-updates";
63762
64388
  /** 设置卡片与面板的样式全文。 */
63763
- const CSS$3 = `
64389
+ const CSS$4 = `
63764
64390
  .dsh-progress-overview{display:flex;flex-direction:column;min-width:0}
63765
64391
  .dsh-progress-hint{color:var(--dsw-alias-label-secondary,#5d5c52);font-size:13px;line-height:1.55;margin:0 0 14px}
63766
64392
  .dsh-progress-cards{border-top:0.5px solid var(--dsw-alias-border-l2,#eceadf)}
@@ -63781,6 +64407,7 @@ window.__ModuleLoader__.load({
63781
64407
  .dsh-progress-switch:disabled{cursor:default;opacity:.5}
63782
64408
  .dsh-progress-switch:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}
63783
64409
  .dsh-progress-number{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);font:inherit;font-size:13px;height:30px;padding:0 8px;text-align:center;width:64px}
64410
+ .dsh-progress-number-wide{width:96px}
63784
64411
  .dsh-progress-number:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:1px}
63785
64412
  .dsh-progress-number:disabled{cursor:default;opacity:.5}
63786
64413
  .dsh-progress-select{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);cursor:pointer;font:inherit;font-size:13px;height:30px;padding:0 6px}
@@ -63795,7 +64422,7 @@ window.__ModuleLoader__.load({
63795
64422
  * @returns 空操作释放函数(与邻居同形)。
63796
64423
  */
63797
64424
  function installProgressUpdatesStyles() {
63798
- return installPluginStyle(STYLE_NAME$1, CSS$3);
64425
+ return installPluginStyle(STYLE_NAME$1, CSS$4);
63799
64426
  }
63800
64427
  //#endregion
63801
64428
  //#region src/client/providers/workbuddy/WorkBuddyComposerQuota.tsx
@@ -63861,7 +64488,7 @@ window.__ModuleLoader__.load({
63861
64488
  providerId: "workbuddy-subscription",
63862
64489
  readStatus: (refresh) => refresh ? api$1.post("/quota") : api$1.get("/status"),
63863
64490
  selectFacts: selectBadgeFacts,
63864
- label: useLineDict(NS_WORKBUDDY, zh$8).composerLabel
64491
+ label: useLineDict(NS_WORKBUDDY, zh$9).composerLabel
63865
64492
  });
63866
64493
  }
63867
64494
  //#endregion
@@ -63924,7 +64551,7 @@ window.__ModuleLoader__.load({
63924
64551
  }
63925
64552
  //#endregion
63926
64553
  //#region src/client/providers/qianwen-token-plan/QianwenComposerQuota.tsx
63927
- function selectQianwenBadgeFacts(status, lookup = (key) => zh$7[key]) {
64554
+ function selectQianwenBadgeFacts(status, lookup = (key) => zh$8[key]) {
63928
64555
  const cache = status?.cacheStats;
63929
64556
  if (cache === void 0 || cache === null) return null;
63930
64557
  const ratio = qianwenCacheHitRatio(cache);
@@ -63968,7 +64595,7 @@ window.__ModuleLoader__.load({
63968
64595
  }
63969
64596
  //#endregion
63970
64597
  //#region src/client/providers/relayone/RelayOneComposerQuota.tsx
63971
- function selectRelayOneBadgeFacts(status, lookup = (key) => zh$6[key]) {
64598
+ function selectRelayOneBadgeFacts(status, lookup = (key) => zh$7[key]) {
63972
64599
  if (status === null || !status.authenticated || status.quota === void 0) return null;
63973
64600
  const quota = status.quota;
63974
64601
  const text = relayOneQuotaText(quota);
@@ -64052,7 +64679,7 @@ window.__ModuleLoader__.load({
64052
64679
  this.code = code;
64053
64680
  }
64054
64681
  };
64055
- async function call(url, init) {
64682
+ async function call$1(url, init) {
64056
64683
  const response = await fetch(url, {
64057
64684
  ...init,
64058
64685
  credentials: "same-origin"
@@ -64065,8 +64692,8 @@ window.__ModuleLoader__.load({
64065
64692
  return envelope.value;
64066
64693
  }
64067
64694
  const compactAfterTurnApi = {
64068
- read: (sessionId) => call(`${COMPACT_AFTER_TURN_PATH}?session=${encodeURIComponent(sessionId)}`),
64069
- write: (sessionId, armed) => call(COMPACT_AFTER_TURN_PATH, {
64695
+ read: (sessionId) => call$1(`${COMPACT_AFTER_TURN_PATH}?session=${encodeURIComponent(sessionId)}`),
64696
+ write: (sessionId, armed) => call$1(COMPACT_AFTER_TURN_PATH, {
64070
64697
  method: "POST",
64071
64698
  headers: { "content-type": "application/json" },
64072
64699
  body: JSON.stringify({
@@ -64231,7 +64858,7 @@ window.__ModuleLoader__.load({
64231
64858
  //#endregion
64232
64859
  //#region src/client/features/compact-after-turn/styles.ts
64233
64860
  const STYLE_ID$2 = "dsh-compact-after-turn-style";
64234
- const CSS$2 = `
64861
+ const CSS$3 = `
64235
64862
  .dshcat-row{align-items:center;border-radius:var(--dsw-radius-md,6px);box-sizing:border-box;color:var(--dsw-alias-label-primary);display:flex;font-size:13px;gap:8px;line-height:20px;min-height:34px;padding:0 8px;position:relative;width:100%}
64236
64863
  .dshcat-label{align-items:center;display:inline-flex;flex:1;gap:4px;min-width:0}
64237
64864
  .dshcat-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -64254,7 +64881,569 @@ window.__ModuleLoader__.load({
64254
64881
  @media (prefers-reduced-motion:reduce){.dshcat-switch,.dshcat-switch::before{transition:none}.dshcat-tip{animation:none}}
64255
64882
  `;
64256
64883
  function installCompactAfterTurnStyles() {
64257
- return installPluginStyle("compact-after-turn", CSS$2, STYLE_ID$2);
64884
+ return installPluginStyle("compact-after-turn", CSS$3, STYLE_ID$2);
64885
+ }
64886
+ //#endregion
64887
+ //#region src/shared/advisor-contracts.ts
64888
+ const ADVISOR_STATE_PATH = "/advisor/state";
64889
+ //#endregion
64890
+ //#region src/client/features/advisor/AdvisorModelOption.tsx
64891
+ function AdvisorReasoningSlider({ selection, directory, pending, locked, update, t }) {
64892
+ const model = (0, react.useSyncExternalStore)((cb) => directory.subscribe(cb), () => directory.getSnapshot()).groups.find((group) => group.id === selection.provider)?.models.find((item) => item.id === selection.model);
64893
+ const efforts = model?.reasoning?.efforts ?? [];
64894
+ const trackRef = (0, react.useRef)(null);
64895
+ const fillRef = (0, react.useRef)(null);
64896
+ const knobRef = (0, react.useRef)(null);
64897
+ const rootRef = (0, react.useRef)(null);
64898
+ const dragging = (0, react.useRef)(false);
64899
+ const disabled = locked || pending;
64900
+ const current = Math.max(0, efforts.findIndex((effort) => effort.id === (selection.reasoningEffort ?? model?.reasoning?.defaultEffort ?? efforts[0].id)));
64901
+ if (efforts.length === 0) return null;
64902
+ const last = Math.max(1, efforts.length - 1);
64903
+ const resting = current / last;
64904
+ const name = efforts[Math.max(0, Math.min(efforts.length - 1, current))].name;
64905
+ const select = (index) => {
64906
+ const next = efforts[Math.max(0, Math.min(efforts.length - 1, index))];
64907
+ if (next.id !== selection.reasoningEffort) update({ selection: {
64908
+ ...selection,
64909
+ reasoningEffort: next.id
64910
+ } });
64911
+ };
64912
+ /** Paint one ratio onto the knob, the fill and the apex tint without React. */
64913
+ const paint = (ratio) => {
64914
+ const clamped = Math.max(0, Math.min(1, ratio));
64915
+ const track = trackRef.current;
64916
+ if (track === null) return;
64917
+ const travel = track.clientWidth - 16;
64918
+ if (knobRef.current !== null) knobRef.current.style.transform = `translateX(${clamped * travel}px)`;
64919
+ if (fillRef.current !== null) fillRef.current.style.width = `${clamped * travel + 8}px`;
64920
+ if (rootRef.current !== null) {
64921
+ const tinted = efforts.length > 1 ? Math.round(clamped * 100) : 100;
64922
+ rootRef.current.style.setProperty("--dshadv-effort-tint", String(tinted));
64923
+ if (clamped >= .999) rootRef.current.setAttribute("data-apex", "");
64924
+ else rootRef.current.removeAttribute("data-apex");
64925
+ }
64926
+ };
64927
+ const ratioAt = (clientX) => {
64928
+ const rect = trackRef.current?.getBoundingClientRect();
64929
+ const width = (rect?.width ?? 0) - 16;
64930
+ if (rect === void 0 || width <= 0) return resting;
64931
+ return Math.max(0, Math.min(1, (clientX - rect.left - 8) / width));
64932
+ };
64933
+ (0, react.useEffect)(() => {
64934
+ if (!dragging.current) paint(resting);
64935
+ });
64936
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
64937
+ ref: rootRef,
64938
+ className: "dshadv-effort dshadv-effort-tinted dsh-claude-effort",
64939
+ "data-dragging": dragging.current ? "" : void 0,
64940
+ children: [
64941
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
64942
+ className: "dshadv-effort-head dsh-claude-effort-head",
64943
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
64944
+ className: "dshadv-effort-label dsh-claude-effort-label",
64945
+ children: t("reasoning")
64946
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
64947
+ className: "dshadv-effort-value dsh-claude-effort-value",
64948
+ children: name
64949
+ })]
64950
+ }),
64951
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
64952
+ ref: trackRef,
64953
+ className: "dshadv-effort-track dsh-claude-effort-track",
64954
+ role: "slider",
64955
+ tabIndex: disabled ? -1 : 0,
64956
+ "aria-disabled": disabled,
64957
+ "aria-label": t("reasoning"),
64958
+ "aria-valuemin": 0,
64959
+ "aria-valuemax": last,
64960
+ "aria-valuenow": current,
64961
+ "aria-valuetext": name,
64962
+ onPointerDown: (event) => {
64963
+ if (disabled) return;
64964
+ event.currentTarget.setPointerCapture(event.pointerId);
64965
+ dragging.current = true;
64966
+ rootRef.current?.setAttribute("data-dragging", "");
64967
+ paint(ratioAt(event.clientX));
64968
+ },
64969
+ onPointerMove: (event) => {
64970
+ if (!disabled && dragging.current) paint(ratioAt(event.clientX));
64971
+ },
64972
+ onPointerUp: (event) => {
64973
+ if (disabled || !dragging.current) return;
64974
+ dragging.current = false;
64975
+ rootRef.current?.removeAttribute("data-dragging");
64976
+ select(Math.round(ratioAt(event.clientX) * last));
64977
+ },
64978
+ onPointerCancel: () => {
64979
+ dragging.current = false;
64980
+ rootRef.current?.removeAttribute("data-dragging");
64981
+ paint(resting);
64982
+ },
64983
+ onKeyDown: (event) => {
64984
+ if (disabled) return;
64985
+ if (event.key === "ArrowLeft" || event.key === "ArrowDown") {
64986
+ event.preventDefault();
64987
+ select(current - 1);
64988
+ } else if (event.key === "ArrowRight" || event.key === "ArrowUp") {
64989
+ event.preventDefault();
64990
+ select(current + 1);
64991
+ } else if (event.key === "Home") {
64992
+ event.preventDefault();
64993
+ select(0);
64994
+ } else if (event.key === "End") {
64995
+ event.preventDefault();
64996
+ select(last);
64997
+ }
64998
+ },
64999
+ children: [
65000
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65001
+ ref: fillRef,
65002
+ className: "dshadv-effort-fill dsh-claude-effort-fill"
65003
+ }),
65004
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65005
+ className: "dshadv-effort-ticks dsh-claude-effort-ticks",
65006
+ children: efforts.map((effort, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65007
+ className: "dshadv-effort-tick dsh-claude-effort-tick",
65008
+ style: { left: `${index / last * 100}%` }
65009
+ }, effort.id))
65010
+ }),
65011
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65012
+ ref: knobRef,
65013
+ className: "dshadv-effort-knob dsh-claude-effort-knob"
65014
+ })
65015
+ ]
65016
+ }),
65017
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
65018
+ className: "dshadv-effort-ends dsh-claude-effort-ends",
65019
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65020
+ className: "dsh-claude-effort-end",
65021
+ children: t("faster")
65022
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65023
+ className: "dsh-claude-effort-end",
65024
+ children: t("stronger")
65025
+ })]
65026
+ })
65027
+ ]
65028
+ });
65029
+ }
65030
+ async function call(url, init) {
65031
+ const response = await fetch(url, {
65032
+ ...init,
65033
+ credentials: "same-origin"
65034
+ });
65035
+ const envelope = await response.json().catch(() => null);
65036
+ if (!response.ok || envelope?.ok !== true || envelope.value === void 0) throw new Error(`HTTP ${response.status}`);
65037
+ return envelope.value;
65038
+ }
65039
+ const advisorApi = {
65040
+ read: (sessionId) => call(`${ADVISOR_STATE_PATH}?session=${encodeURIComponent(sessionId)}`),
65041
+ write: (sessionId, patch) => call(ADVISOR_STATE_PATH, {
65042
+ method: "POST",
65043
+ headers: { "content-type": "application/json" },
65044
+ body: JSON.stringify({
65045
+ sessionId,
65046
+ ...patch
65047
+ })
65048
+ })
65049
+ };
65050
+ function useAdvisorState(sessionId, api, reportFailure, t) {
65051
+ const [state, setState] = (0, react.useState)(null);
65052
+ const [pending, setPending] = (0, react.useState)(false);
65053
+ const mounted = (0, react.useRef)(true);
65054
+ (0, react.useEffect)(() => {
65055
+ mounted.current = true;
65056
+ setState(null);
65057
+ api.read(sessionId).then((value) => {
65058
+ if (mounted.current) setState(value);
65059
+ }).catch(() => void 0);
65060
+ return () => {
65061
+ mounted.current = false;
65062
+ };
65063
+ }, [api, sessionId]);
65064
+ (0, react.useEffect)(() => {
65065
+ const changed = (event) => {
65066
+ const next = event.detail;
65067
+ if (next?.sessionId === sessionId) setState(next);
65068
+ };
65069
+ window.addEventListener("dsh-advisor-changed", changed);
65070
+ return () => window.removeEventListener("dsh-advisor-changed", changed);
65071
+ }, [sessionId]);
65072
+ return {
65073
+ state,
65074
+ pending,
65075
+ update: (0, react.useCallback)((patch) => {
65076
+ setPending(true);
65077
+ api.write(sessionId, patch).then((value) => {
65078
+ if (mounted.current) setState(value);
65079
+ window.dispatchEvent(new CustomEvent("dsh-advisor-changed", { detail: value }));
65080
+ }, (error) => {
65081
+ if (mounted.current) reportFailure(t("failed", { message: error instanceof Error ? error.message : String(error) }));
65082
+ }).finally(() => {
65083
+ if (mounted.current) setPending(false);
65084
+ });
65085
+ }, [
65086
+ api,
65087
+ reportFailure,
65088
+ sessionId,
65089
+ t
65090
+ ])
65091
+ };
65092
+ }
65093
+ /** Shared popover motion: hover opens, a short grace period closes, Escape closes. */
65094
+ function usePanelMotion() {
65095
+ const anchor = (0, react.useRef)(null);
65096
+ const [open, setOpen] = (0, react.useState)(false);
65097
+ const [style, setStyle] = (0, react.useState)(void 0);
65098
+ const closeTimer = (0, react.useRef)(void 0);
65099
+ const openPanel = (target, widthOverride) => {
65100
+ window.clearTimeout(closeTimer.current);
65101
+ closeTimer.current = void 0;
65102
+ const rect = target.getBoundingClientRect();
65103
+ const width = Math.min(widthOverride ?? 320, window.innerWidth - 16);
65104
+ setStyle({
65105
+ position: "fixed",
65106
+ width,
65107
+ left: Math.min(Math.max(8, rect.right - width), Math.max(8, window.innerWidth - width - 8)),
65108
+ bottom: Math.max(8, window.innerHeight - rect.top + 8),
65109
+ maxHeight: Math.max(160, rect.top - 24)
65110
+ });
65111
+ setOpen(true);
65112
+ };
65113
+ const close = () => {
65114
+ window.clearTimeout(closeTimer.current);
65115
+ setOpen(false);
65116
+ };
65117
+ const scheduleClose = () => {
65118
+ window.clearTimeout(closeTimer.current);
65119
+ closeTimer.current = window.setTimeout(() => setOpen(false), 320);
65120
+ };
65121
+ const cancelClose = () => {
65122
+ window.clearTimeout(closeTimer.current);
65123
+ closeTimer.current = void 0;
65124
+ };
65125
+ (0, react.useEffect)(() => () => window.clearTimeout(closeTimer.current), []);
65126
+ return {
65127
+ anchor,
65128
+ open,
65129
+ style,
65130
+ openPanel,
65131
+ close,
65132
+ cancelClose,
65133
+ scheduleClose
65134
+ };
65135
+ }
65136
+ /** Model seat: enable switch plus the advisor model list. No reasoning control. */
65137
+ function AdvisorModelTrigger(props) {
65138
+ const { sessionId, locked, reportFailure, t } = props;
65139
+ const api = props.api ?? advisorApi;
65140
+ const { anchor, open, style, openPanel, close, cancelClose, scheduleClose } = usePanelMotion();
65141
+ const { state, pending, update } = useAdvisorState(sessionId, api, reportFailure, t);
65142
+ (0, react.useEffect)(() => {
65143
+ props.load();
65144
+ }, [props.load]);
65145
+ (0, react.useEffect)(() => {
65146
+ if (!open) return;
65147
+ const outside = (event) => {
65148
+ const target = event.target;
65149
+ const panel = document.getElementById("dshadv-model-popover");
65150
+ if (!(target === null || anchor.current?.contains(target) || panel !== null && panel.contains(target))) close();
65151
+ };
65152
+ const escape = (event) => {
65153
+ if (event.key === "Escape") close();
65154
+ };
65155
+ document.addEventListener("pointerdown", outside, true);
65156
+ document.addEventListener("keydown", escape, true);
65157
+ return () => {
65158
+ document.removeEventListener("pointerdown", outside, true);
65159
+ document.removeEventListener("keydown", escape, true);
65160
+ };
65161
+ }, [open]);
65162
+ if (state === null || state.sessionId !== sessionId) return null;
65163
+ const selected = state.selection;
65164
+ const caption = !state.enabled ? t("label") : selected === null ? t("enableFirst") : selected.model;
65165
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
65166
+ ref: anchor,
65167
+ type: "button",
65168
+ className: "dshadv-trigger",
65169
+ "data-enabled": state.enabled,
65170
+ "aria-haspopup": "dialog",
65171
+ "aria-expanded": open,
65172
+ "aria-description": t("privacy"),
65173
+ "aria-label": `${t("label")} · ${t("model")}`,
65174
+ disabled: locked,
65175
+ onPointerEnter: (event) => openPanel(event.currentTarget),
65176
+ onMouseEnter: (event) => openPanel(event.currentTarget),
65177
+ onFocus: (event) => openPanel(event.currentTarget),
65178
+ onClick: (event) => openPanel(event.currentTarget),
65179
+ onPointerLeave: scheduleClose,
65180
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65181
+ className: "dshadv-trigger-label",
65182
+ children: caption
65183
+ })
65184
+ }), open && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
65185
+ id: "dshadv-model-popover",
65186
+ className: "dshadv-popover",
65187
+ role: "dialog",
65188
+ "aria-label": t("model"),
65189
+ style,
65190
+ onPointerEnter: cancelClose,
65191
+ onMouseEnter: cancelClose,
65192
+ onPointerLeave: scheduleClose,
65193
+ onMouseLeave: scheduleClose,
65194
+ children: [
65195
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
65196
+ className: "dshadv-popover-head",
65197
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65198
+ className: "dshadv-popover-title",
65199
+ children: t("label")
65200
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
65201
+ type: "button",
65202
+ role: "switch",
65203
+ className: "dshadv-switch",
65204
+ "aria-checked": state.enabled,
65205
+ "aria-label": t("label"),
65206
+ disabled: pending,
65207
+ onClick: () => update({ enabled: !state.enabled })
65208
+ })]
65209
+ }),
65210
+ state.enabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorModelPane, {
65211
+ sessionId,
65212
+ directory: props.directory,
65213
+ load: props.load,
65214
+ locked: locked || pending,
65215
+ reportFailure,
65216
+ t,
65217
+ api
65218
+ }),
65219
+ !state.enabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
65220
+ className: "dshadv-off-hint",
65221
+ children: t("enableHint")
65222
+ })
65223
+ ]
65224
+ }), document.body)] });
65225
+ }
65226
+ /** Reasoning seat: the same effort ladder as the main model, for the advisor model. */
65227
+ function AdvisorEffortTrigger(props) {
65228
+ const { sessionId, locked, reportFailure, t } = props;
65229
+ const api = props.api ?? advisorApi;
65230
+ const { anchor, open, style, openPanel, close, cancelClose, scheduleClose } = usePanelMotion();
65231
+ const { state, pending, update } = useAdvisorState(sessionId, api, reportFailure, t);
65232
+ (0, react.useEffect)(() => {
65233
+ props.load();
65234
+ }, [props.load]);
65235
+ (0, react.useEffect)(() => {
65236
+ if (!open) return;
65237
+ const outside = (event) => {
65238
+ const target = event.target;
65239
+ const panel = document.getElementById("dshadv-effort-popover");
65240
+ if (!(target === null || anchor.current?.contains(target) || panel !== null && panel.contains(target))) close();
65241
+ };
65242
+ const escape = (event) => {
65243
+ if (event.key === "Escape") close();
65244
+ };
65245
+ document.addEventListener("pointerdown", outside, true);
65246
+ document.addEventListener("keydown", escape, true);
65247
+ return () => {
65248
+ document.removeEventListener("pointerdown", outside, true);
65249
+ document.removeEventListener("keydown", escape, true);
65250
+ };
65251
+ }, [open]);
65252
+ const snapshot = (0, react.useSyncExternalStore)((cb) => props.directory.subscribe(cb), () => props.directory.getSnapshot());
65253
+ if (state === null || state.sessionId !== sessionId || !state.enabled || state.selection === null) return null;
65254
+ const selected = state.selection;
65255
+ const model = snapshot.groups.find((group) => group.id === selected.provider)?.models.find((item) => item.id === selected.model);
65256
+ const efforts = model?.reasoning?.efforts ?? [];
65257
+ if (efforts.length === 0) return null;
65258
+ const currentId = selected.reasoningEffort ?? model?.reasoning?.defaultEffort ?? efforts[0].id;
65259
+ const currentEffort = efforts.find((effort) => effort.id === currentId) ?? efforts[0];
65260
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
65261
+ ref: anchor,
65262
+ type: "button",
65263
+ className: "dshadv-effort-trigger",
65264
+ "aria-haspopup": "dialog",
65265
+ "aria-expanded": open,
65266
+ "aria-label": `${t("reasoning")} ${currentEffort.name}`,
65267
+ disabled: locked,
65268
+ onPointerEnter: (event) => openPanel(event.currentTarget, 232),
65269
+ onMouseEnter: (event) => openPanel(event.currentTarget, 232),
65270
+ onFocus: (event) => openPanel(event.currentTarget, 232),
65271
+ onClick: (event) => openPanel(event.currentTarget, 232),
65272
+ onPointerLeave: scheduleClose,
65273
+ children: currentEffort.name
65274
+ }), open && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65275
+ id: "dshadv-effort-popover",
65276
+ className: "dshadv-popover dshadv-effort-popover",
65277
+ role: "dialog",
65278
+ "aria-label": t("reasoning"),
65279
+ style,
65280
+ onPointerEnter: cancelClose,
65281
+ onMouseEnter: cancelClose,
65282
+ onPointerLeave: scheduleClose,
65283
+ onMouseLeave: scheduleClose,
65284
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvisorReasoningSlider, {
65285
+ selection: selected,
65286
+ directory: props.directory,
65287
+ pending,
65288
+ locked,
65289
+ update,
65290
+ t
65291
+ })
65292
+ }), document.body)] });
65293
+ }
65294
+ function AdvisorModelPane(props) {
65295
+ const { sessionId, locked, reportFailure, t } = props;
65296
+ const { state, pending, update } = useAdvisorState(sessionId, props.api ?? advisorApi, reportFailure, t);
65297
+ const [query, setQuery] = (0, react.useState)("");
65298
+ const directory = (0, react.useSyncExternalStore)((cb) => props.directory.subscribe(cb), () => props.directory.getSnapshot());
65299
+ (0, react.useEffect)(() => {
65300
+ props.load();
65301
+ }, [props.load]);
65302
+ if (state === null || state.sessionId !== sessionId) return null;
65303
+ const selection = state.selection;
65304
+ const normalizedQuery = query.trim().toLowerCase();
65305
+ const visibleGroups = directory.groups.map((group) => ({
65306
+ ...group,
65307
+ models: group.models.filter((model) => normalizedQuery === "" || `${group.name} ${model.name} ${model.id}`.toLowerCase().includes(normalizedQuery))
65308
+ })).filter((group) => group.models.length > 0);
65309
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
65310
+ className: "dshadv-pane",
65311
+ children: [
65312
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65313
+ className: "dsh-claude-model-search dshadv-search-wrap",
65314
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65315
+ className: "dsh-claude-model-search-field",
65316
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
65317
+ className: "dsh-claude-model-search-input dshadv-search",
65318
+ type: "search",
65319
+ value: query,
65320
+ placeholder: t("search"),
65321
+ "aria-label": t("search"),
65322
+ onChange: (event) => setQuery(event.target.value)
65323
+ })
65324
+ })
65325
+ }),
65326
+ directory.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("loading") }),
65327
+ visibleGroups.length === 0 && directory.status !== "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("empty") }),
65328
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65329
+ className: "dshadv-list dsh-claude-model-sub-body",
65330
+ children: visibleGroups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
65331
+ className: "dsh-claude-model-group-section",
65332
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65333
+ className: "dsh-claude-model-rule dshadv-group",
65334
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65335
+ className: "dsh-claude-model-rule-name",
65336
+ children: group.name
65337
+ })
65338
+ }), group.models.map((model) => {
65339
+ const checked = selection?.provider === group.id && selection?.model === model.id;
65340
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
65341
+ type: "button",
65342
+ role: "menuitemradio",
65343
+ "aria-label": `${group.name}: ${model.name}`,
65344
+ "aria-checked": checked,
65345
+ className: "dshadv-choice dsh-claude-popover-item dsh-claude-model-option",
65346
+ disabled: locked || pending,
65347
+ onClick: () => update({ selection: {
65348
+ provider: group.id,
65349
+ model: model.id,
65350
+ reasoningEffort: model.reasoning?.defaultEffort
65351
+ } }),
65352
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65353
+ className: "dsh-claude-model-name dshadv-choice-label",
65354
+ children: model.name
65355
+ }), checked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
65356
+ className: "dsh-claude-popover-check",
65357
+ "aria-label": t("enabled"),
65358
+ children: "✓"
65359
+ })]
65360
+ }, model.id);
65361
+ })]
65362
+ }, group.id))
65363
+ })
65364
+ ]
65365
+ });
65366
+ }
65367
+ //#endregion
65368
+ //#region src/client/features/advisor/styles.ts
65369
+ const CSS$2 = `
65370
+ .dshadv-trigger{align-items:center;background:transparent;border:0;border-radius:14px;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer;display:inline-flex;font:inherit;font-size:13px;gap:0;height:28px;max-width:200px;padding:0 4px;white-space:nowrap}
65371
+ .dshadv-trigger:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.18));color:var(--dsw-alias-label-primary,#e8e8e8)}
65372
+ .dshadv-trigger:disabled{cursor:default;opacity:.5}
65373
+ .dshadv-trigger-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
65374
+ .dshadv-trigger[data-enabled=true]{color:var(--dsw-alias-brand-primary,#397ee8)}
65375
+ .dshadv-effort-trigger{background:transparent;border:0;border-radius:14px;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer;font:inherit;font-size:13px;height:28px;padding:0 4px;white-space:nowrap}.dshadv-effort-trigger:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.18));color:var(--dsw-alias-label-primary,#e8e8e8)}.dshadv-effort-trigger:disabled{cursor:default;opacity:.5}.dshadv-effort-popover{padding:8px 6px 6px}.dshadv-popover{background:var(--dsw-alias-bg-overlay,#242422);border:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.28));border-radius:10px;box-shadow:0 12px 36px rgba(0,0,0,.32);box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;z-index:2147482000;animation:dshadv-pop-in 160ms cubic-bezier(.22,.61,.36,1)}@keyframes dshadv-pop-in{from{opacity:0;transform:scale(.96) translateY(4px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.dshadv-effort-fill,.dshadv-effort-knob{transition:none}.dshadv-popover{animation:none}}
65376
+ .dshadv-off-hint{color:var(--dsw-alias-label-tertiary,#9a9a9a);font-size:12px;margin:10px 12px;text-align:center}.dshadv-popover-head{align-items:center;border-bottom:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.18));display:flex;flex:none;gap:8px;justify-content:space-between;padding:9px 12px}
65377
+ .dshadv-popover-title{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:13px;font-weight:500}
65378
+ .dshadv-popover-foot{border-top:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.18));flex:none;padding:2px 4px 8px}
65379
+ .dshadv-switch{appearance:none;background:var(--dsw-specific-selector,rgba(127,127,127,.2));border:0;border-radius:9px;cursor:pointer;flex:none;height:18px;padding:2px;width:30px}
65380
+ .dshadv-switch:before{background:var(--dsw-alias-bg-overlay,#fff);border-radius:50%;content:'';display:block;height:14px;transition:transform .15s;width:14px}
65381
+ .dshadv-switch[aria-checked=true]{background:var(--dsw-alias-brand-primary,#397ee8)}
65382
+ .dshadv-switch[aria-checked=true]:before{transform:translateX(12px)}
65383
+ .dshadv-pane{box-sizing:border-box;flex:1 1 auto;min-height:0;overflow:auto;padding:6px}
65384
+ .dshadv-search{background:var(--dsw-alias-bg-primary,rgba(0,0,0,.25));border:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.28));border-radius:6px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#e8e8e8);font:inherit;margin-bottom:6px;padding:7px 9px;width:100%}
65385
+ .dshadv-group{color:var(--dsw-alias-label-tertiary,#9a9a9a);font-size:11px;font-weight:500;margin:8px 8px 4px}
65386
+ .dshadv-choice{align-items:center;background:transparent;border:0;border-radius:6px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;display:flex;font:inherit;font-size:13px;gap:8px;justify-content:space-between;line-height:20px;min-height:30px;padding:0 8px;text-align:left;width:100%}
65387
+ .dshadv-choice:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.18))}
65388
+ .dshadv-choice:disabled{cursor:default;opacity:.55}
65389
+ .dshadv-choice[aria-checked=true]{color:var(--dsw-alias-brand-primary,#397ee8)}
65390
+ .dshadv-effort{margin-top:0;padding:2px 2px 0;--dshadv-effort-tint:0}
65391
+ .dshadv-effort-tinted{--dshadv-ramp:color-mix(in oklch,var(--dsw-alias-brand-primary,#397ee8),var(--dsw-alias-label-primary,#e8e8e8) calc(var(--dshadv-effort-tint)*1%))}
65392
+ .dshadv-effort-head{display:flex;align-items:baseline;gap:6px;font-size:11px;margin-bottom:4px}
65393
+ .dshadv-effort-label{color:var(--dsw-alias-label-secondary,#b8b8b8)}
65394
+ .dshadv-effort-value{color:var(--dshadv-ramp,var(--dsw-alias-label-primary,#e8e8e8));transition:color 200ms ease}
65395
+ .dshadv-effort-track{position:relative;height:30px;margin-top:1px;cursor:pointer;touch-action:none}
65396
+ .dshadv-effort-track:before{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.22));border-radius:8px;bottom:50%;content:'';height:26px;margin-bottom:-13px;left:0;position:absolute;right:0}
65397
+ .dshadv-effort-fill{background:var(--dshadv-ramp,var(--dsw-alias-brand-primary,#397ee8));border-radius:8px 0 0 8px;bottom:50%;height:26px;left:0;margin-bottom:-13px;position:absolute;transition:width 220ms cubic-bezier(.22,.61,.36,1),background 200ms ease;pointer-events:none}
65398
+ .dshadv-effort-ticks{inset:0;position:absolute;pointer-events:none}
65399
+ .dshadv-effort-tick{background:color-mix(in srgb,var(--dsw-alias-label-primary,#e8e8e8) 30%,transparent);border-radius:50%;height:4px;margin-top:-2px;position:absolute;top:50%;transform:translateX(-50%);width:4px}
65400
+ .dshadv-effort-knob{background:#fff;border-radius:5px;box-shadow:0 1px 3px rgba(0,0,0,.45);height:30px;left:0;position:absolute;top:50%;margin-top:-15px;transition:transform 220ms cubic-bezier(.22,.61,.36,1),background-color 200ms ease,box-shadow 200ms ease;width:16px;will-change:transform}
65401
+ .dshadv-effort[data-dragging] .dshadv-effort-knob{transition:background-color 200ms ease,box-shadow 200ms ease}
65402
+ .dshadv-effort[data-dragging] .dshadv-effort-fill{transition:background 200ms ease}
65403
+ .dshadv-effort[data-apex] .dshadv-effort-fill,.dshadv-effort[data-apex] .dshadv-effort-ticks{opacity:0}
65404
+ .dshadv-effort[data-apex] .dshadv-effort-track:before{background-color:transparent;background-image:radial-gradient(circle at 2px 2px,color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 85%,transparent) 1.6px,transparent 2px),radial-gradient(circle at 2px 2px,color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 45%,transparent) 1.6px,transparent 2px);background-position:0 0,14px 7px;background-size:14px 13px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 25%,transparent),0 0 10px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 35%,transparent);animation:dshadv-apex-flow 2.4s linear infinite}
65405
+ .dshadv-effort[data-apex] .dshadv-effort-knob{background-color:color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 24%,#fff);box-shadow:0 0 12px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 80%,transparent),0 0 0 1px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 38%,transparent)}
65406
+ .dshadv-effort[data-apex] .dshadv-effort-value{color:color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 65%,var(--dsw-alias-label-primary,#e8e8e8))}
65407
+ @keyframes dshadv-apex-flow{from{background-position:0 0,14px 7px}to{background-position:14px 0,28px 7px}}
65408
+ @media(prefers-reduced-motion:reduce){.dshadv-effort[data-apex] .dshadv-effort-track:before{animation:none}}
65409
+ .dshadv-popover-head{align-items:center;border-bottom:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.18));display:flex;flex:none;gap:8px;justify-content:space-between;padding:9px 12px}
65410
+ .dshadv-popover-title{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:13px;font-weight:500}
65411
+ .dshadv-popover-foot{border-top:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.18));flex:none;padding:2px 4px 8px}
65412
+ .dshadv-switch{appearance:none;background:var(--dsw-specific-selector,rgba(127,127,127,.2));border:0;border-radius:9px;cursor:pointer;flex:none;height:18px;padding:2px;width:30px}
65413
+ .dshadv-switch:before{background:var(--dsw-alias-bg-overlay,#fff);border-radius:50%;content:'';display:block;height:14px;transition:transform .15s;width:14px}
65414
+ .dshadv-switch[aria-checked=true]{background:var(--dsw-alias-brand-primary,#397ee8)}
65415
+ .dshadv-switch[aria-checked=true]:before{transform:translateX(12px)}
65416
+ .dshadv-pane{box-sizing:border-box;flex:1 1 auto;min-height:0;overflow:auto;padding:6px}
65417
+ .dshadv-search{background:var(--dsw-alias-bg-primary,rgba(0,0,0,.25));border:1px solid var(--dsw-alias-border-secondary,rgba(127,127,127,.28));border-radius:6px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#e8e8e8);font:inherit;margin-bottom:6px;padding:7px 9px;width:100%}
65418
+ .dshadv-group{color:var(--dsw-alias-label-tertiary,#9a9a9a);font-size:11px;font-weight:500;margin:8px 8px 4px}
65419
+ .dshadv-choice{align-items:center;background:transparent;border:0;border-radius:6px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;display:flex;font:inherit;font-size:13px;gap:8px;justify-content:space-between;line-height:20px;min-height:30px;padding:0 8px;text-align:left;width:100%}
65420
+ .dshadv-choice:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.18))}
65421
+ .dshadv-choice:disabled{cursor:default;opacity:.55}
65422
+ .dshadv-choice[aria-checked=true]{color:var(--dsw-alias-brand-primary,#397ee8)}
65423
+ .dshadv-effort{margin-top:0;padding:2px 2px 0;--dshadv-effort-tint:0}
65424
+ .dshadv-effort-tinted{--dshadv-ramp:color-mix(in oklch,var(--dsw-alias-brand-primary,#397ee8),var(--dsw-alias-label-primary,#e8e8e8) calc(var(--dshadv-effort-tint)*1%))}
65425
+ .dshadv-effort-head{display:flex;align-items:baseline;gap:6px;font-size:11px;margin-bottom:4px}
65426
+ .dshadv-effort-label{color:var(--dsw-alias-label-secondary,#b8b8b8)}
65427
+ .dshadv-effort-value{color:var(--dshadv-ramp,var(--dsw-alias-label-primary,#e8e8e8));transition:color 200ms ease}
65428
+ .dshadv-effort-track{position:relative;height:30px;margin-top:1px;cursor:pointer;touch-action:none}
65429
+ .dshadv-effort-track:before{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.22));border-radius:8px;bottom:50%;content:'';height:26px;margin-bottom:-13px;left:0;position:absolute;right:0}
65430
+ .dshadv-effort-fill{background:var(--dshadv-ramp,var(--dsw-alias-brand-primary,#397ee8));border-radius:8px 0 0 8px;bottom:50%;height:26px;left:0;margin-bottom:-13px;position:absolute;transition:width 220ms cubic-bezier(.22,.61,.36,1),background 200ms ease;pointer-events:none}
65431
+ .dshadv-effort-ticks{inset:0;position:absolute;pointer-events:none}
65432
+ .dshadv-effort-tick{background:color-mix(in srgb,var(--dsw-alias-label-primary,#e8e8e8) 30%,transparent);border-radius:50%;height:4px;margin-top:-2px;position:absolute;top:50%;transform:translateX(-50%);width:4px}
65433
+ .dshadv-effort-knob{background:#fff;border-radius:5px;box-shadow:0 1px 3px rgba(0,0,0,.45);height:30px;left:0;position:absolute;top:50%;margin-top:-15px;transition:transform 220ms cubic-bezier(.22,.61,.36,1),background-color 200ms ease,box-shadow 200ms ease;width:16px;will-change:transform}
65434
+ .dshadv-effort[data-dragging] .dshadv-effort-knob{transition:background-color 200ms ease,box-shadow 200ms ease}
65435
+ .dshadv-effort[data-dragging] .dshadv-effort-fill{transition:background 200ms ease}
65436
+ .dshadv-effort[data-apex] .dshadv-effort-fill,.dshadv-effort[data-apex] .dshadv-effort-ticks{opacity:0}
65437
+ .dshadv-effort[data-apex] .dshadv-effort-track:before{background:linear-gradient(90deg,color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 70%,transparent),color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 30%,transparent),color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 70%,transparent));background-size:220% 100%;animation:dshadv-apex-flow 2.6s linear infinite;box-shadow:0 0 10px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 45%,transparent)}
65438
+ .dshadv-effort[data-apex] .dshadv-effort-knob{background-color:color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 24%,#fff);box-shadow:0 0 12px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 80%,transparent),0 0 0 1px color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 38%,transparent)}
65439
+ .dshadv-effort[data-apex] .dshadv-effort-value{color:color-mix(in srgb,var(--dsw-alias-brand-primary,#397ee8) 70%,var(--dsw-alias-label-primary,#e8e8e8))}
65440
+ @keyframes dshadv-apex-flow{from{background-position:0% 0}to{background-position:220% 0}}
65441
+ @media(prefers-reduced-motion:reduce){.dshadv-effort[data-apex] .dshadv-effort-track:before{animation:none}}
65442
+ .dshadv-effort-ends{color:var(--dsw-alias-label-tertiary,#9a9a9a);display:flex;font-size:10px;justify-content:space-between;margin-top:2px}
65443
+ .dshadv-effort [role=slider][aria-disabled=true]{opacity:.5;pointer-events:none}
65444
+ `;
65445
+ function installAdvisorStyles() {
65446
+ return installPluginStyle("advisor", CSS$2, "dsh-advisor-style");
64258
65447
  }
64259
65448
  //#endregion
64260
65449
  //#region src/client/providers/claude-api/styles.ts
@@ -66748,7 +67937,7 @@ window.__ModuleLoader__.load({
66748
67937
  /** 头部围栏的开场标记。 */
66749
67938
  const MANDATE_FENCE = "```dsh-mandate-v2";
66750
67939
  function fallbackTranslate$1(key) {
66751
- return zh$4[key];
67940
+ return zh$5[key];
66752
67941
  }
66753
67942
  function firstLine$1(text) {
66754
67943
  const nl = text.indexOf("\n");
@@ -67608,7 +68797,7 @@ window.__ModuleLoader__.load({
67608
68797
  * @module @eddyskywalker/dsh-chatgpt-subscription/client/codemode/CodeRunToolView
67609
68798
  */
67610
68799
  function fallbackTranslate(key) {
67611
- return zh$23[key] ?? key;
68800
+ return zh$24[key] ?? key;
67612
68801
  }
67613
68802
  function firstLine(text) {
67614
68803
  const nl = text.indexOf("\n");
@@ -69166,7 +70355,7 @@ window.__ModuleLoader__.load({
69166
70355
  * panel hides the section automatically.
69167
70356
  */
69168
70357
  function SessionQuotaSection(props) {
69169
- const dict = useLineDict(NS_SESSION_QUOTA, zh$1);
70358
+ const dict = useLineDict(NS_SESSION_QUOTA, zh$2);
69170
70359
  if (!props.directory) return null;
69171
70360
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionQuotaSectionBody, {
69172
70361
  directory: props.directory,
@@ -69279,7 +70468,7 @@ window.__ModuleLoader__.load({
69279
70468
  * folded (`conversation.session.panel.section.actions`).
69280
70469
  */
69281
70470
  function SessionQuotaReading(props) {
69282
- const dict = useLineDict(NS_SESSION_QUOTA, zh$1);
70471
+ const dict = useLineDict(NS_SESSION_QUOTA, zh$2);
69283
70472
  if (!props.directory) return null;
69284
70473
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionQuotaReadingBody, {
69285
70474
  directory: props.directory,
@@ -69328,7 +70517,7 @@ window.__ModuleLoader__.load({
69328
70517
  name: SECTION_SLOT,
69329
70518
  id: SESSION_QUOTA_SECTION_ID,
69330
70519
  order: 35,
69331
- label: () => typeof t === "function" ? t("sectionTitle") : zh$1.sectionTitle,
70520
+ label: () => typeof t === "function" ? t("sectionTitle") : zh$2.sectionTitle,
69332
70521
  locale: NS_SESSION_QUOTA,
69333
70522
  inject: (sessionId) => injectSessionSeats(ctx, sessionId)
69334
70523
  }, SessionQuotaSection);
@@ -69418,102 +70607,104 @@ window.__ModuleLoader__.load({
69418
70607
  installLineLocale(ctx.locale);
69419
70608
  ctx.effect(() => installHostLocaleMirror(ctx.locale), "dsh-chatgpt-subscription: host locale mirror");
69420
70609
  installRussianLocale(ctx);
69421
- ctx.effect(() => ctx.locale.register(NS, dictionaries$23), "dsh-chatgpt-subscription: dictionaries");
70610
+ ctx.effect(() => ctx.locale.register(NS, dictionaries$24), "dsh-chatgpt-subscription: dictionaries");
69422
70611
  ctx.effect(() => installStyles(), "dsh-chatgpt-subscription: styles");
69423
70612
  ctx.effect(() => {
69424
70613
  installHubStyles();
69425
70614
  installModelChecklistStyles();
69426
70615
  return () => {};
69427
70616
  }, "dsh-chatgpt-subscription: hub styles");
69428
- ctx.effect(() => ctx.locale.register(NS_MODEL_CHECKLIST, dictionaries$22), "dsh-model-checklist: dictionaries");
69429
- ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$17), "dsh-claude: dictionaries");
70617
+ ctx.effect(() => ctx.locale.register(NS_MODEL_CHECKLIST, dictionaries$23), "dsh-model-checklist: dictionaries");
70618
+ ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$18), "dsh-claude: dictionaries");
69430
70619
  ctx.effect(() => {
69431
70620
  installClaudeStyles();
69432
70621
  return () => {};
69433
70622
  }, "dsh-claude: styles");
69434
- ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$21), "dsh-command-code: dictionaries");
69435
- ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$20), "dsh-kimi-code: dictionaries");
70623
+ ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$22), "dsh-command-code: dictionaries");
70624
+ ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$21), "dsh-kimi-code: dictionaries");
69436
70625
  ctx.effect(() => {
69437
70626
  installKimiCodeStyles();
69438
70627
  return () => {};
69439
70628
  }, "dsh-kimi-code: styles");
69440
- ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$19), "dsh-minimax-code: dictionaries");
70629
+ ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$20), "dsh-minimax-code: dictionaries");
69441
70630
  ctx.effect(() => {
69442
70631
  installMinimaxCodeStyles();
69443
70632
  return () => {};
69444
70633
  }, "dsh-minimax-code: styles");
69445
- ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$18), "dsh-glm-coding-plan: dictionaries");
70634
+ ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$19), "dsh-glm-coding-plan: dictionaries");
69446
70635
  ctx.effect(() => {
69447
70636
  installGlmCodingPlanStyles();
69448
70637
  return () => {};
69449
70638
  }, "dsh-glm-coding-plan: styles");
69450
- ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$16), "dsh-ollama: dictionaries");
69451
- ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$15), "dsh-antigravity-acp: dictionaries");
70639
+ ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$17), "dsh-ollama: dictionaries");
70640
+ ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$16), "dsh-antigravity-acp: dictionaries");
69452
70641
  ctx.effect(() => {
69453
70642
  installAntigravityAcpStyles();
69454
70643
  return () => {};
69455
70644
  }, "dsh-antigravity-acp: styles");
69456
- ctx.effect(() => ctx.locale.register(NS_PROGRESS_UPDATES, dictionaries$3), "dsh-progress-updates: dictionaries");
70645
+ ctx.effect(() => ctx.locale.register(NS_PROGRESS_UPDATES, dictionaries$4), "dsh-progress-updates: dictionaries");
69457
70646
  ctx.effect(() => {
69458
70647
  installProgressUpdatesStyles();
69459
70648
  return () => {};
69460
70649
  }, "dsh-progress-updates: styles");
69461
- ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$12), "dsh-step-code: dictionaries");
70650
+ ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$13), "dsh-step-code: dictionaries");
69462
70651
  ctx.effect(() => {
69463
70652
  installStepCodeStyles();
69464
70653
  return () => {};
69465
70654
  }, "dsh-step-code: styles");
69466
- ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$11), "dsh-cline-pass: dictionaries");
70655
+ ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$12), "dsh-cline-pass: dictionaries");
69467
70656
  ctx.effect(() => {
69468
70657
  installClinePassStyles();
69469
70658
  return () => {};
69470
70659
  }, "dsh-cline-pass: styles");
69471
- ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$10), "dsh-qoder: dictionaries");
70660
+ ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$11), "dsh-qoder: dictionaries");
69472
70661
  ctx.effect(() => {
69473
70662
  installQoderStyles();
69474
70663
  return () => {};
69475
70664
  }, "dsh-qoder: styles");
69476
- ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$9), "dsh-opendesign: dictionaries");
70665
+ ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$10), "dsh-opendesign: dictionaries");
69477
70666
  ctx.effect(() => {
69478
70667
  installOpenDesignStyles();
69479
70668
  return () => {};
69480
70669
  }, "dsh-opendesign: styles");
69481
- ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$8), "dsh-workbuddy: dictionaries");
70670
+ ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$9), "dsh-workbuddy: dictionaries");
69482
70671
  ctx.effect(() => {
69483
70672
  installWorkBuddyStyles();
69484
70673
  return () => {};
69485
70674
  }, "dsh-workbuddy: styles");
69486
- ctx.effect(() => ctx.locale.register(NS_QIANWEN, dictionaries$7), "dsh-qianwen-token-plan: dictionaries");
70675
+ ctx.effect(() => ctx.locale.register(NS_QIANWEN, dictionaries$8), "dsh-qianwen-token-plan: dictionaries");
69487
70676
  ctx.effect(() => {
69488
70677
  installQianwenStyles();
69489
70678
  return () => {};
69490
70679
  }, "dsh-qianwen-token-plan: styles");
69491
- ctx.effect(() => ctx.locale.register(NS_RELAYONE, dictionaries$6), "dsh-relayone: dictionaries");
70680
+ ctx.effect(() => ctx.locale.register(NS_RELAYONE, dictionaries$7), "dsh-relayone: dictionaries");
69492
70681
  ctx.effect(() => {
69493
70682
  installRelayOneStyles();
69494
70683
  return () => {};
69495
70684
  }, "dsh-relayone: styles");
69496
- ctx.effect(() => ctx.locale.register(NS_COMPACT_AFTER_TURN, dictionaries$2), "dsh-compact-after-turn: dictionaries");
70685
+ ctx.effect(() => ctx.locale.register(NS_COMPACT_AFTER_TURN, dictionaries$3), "dsh-compact-after-turn: dictionaries");
69497
70686
  ctx.effect(() => installCompactAfterTurnStyles(), "dsh-compact-after-turn: styles");
69498
- ctx.effect(() => ctx.locale.register(NS_SESSION_QUOTA, dictionaries$1), "dsh-session-quota: dictionaries");
70687
+ ctx.effect(() => ctx.locale.register(NS_ADVISOR, dictionaries$1), "dsh-advisor: dictionaries");
70688
+ ctx.effect(() => installAdvisorStyles(), "dsh-advisor: styles");
70689
+ ctx.effect(() => ctx.locale.register(NS_SESSION_QUOTA, dictionaries$2), "dsh-session-quota: dictionaries");
69499
70690
  ctx.effect(() => installSessionQuotaStyles(), "dsh-session-quota: styles");
69500
- ctx.effect(() => ctx.locale.register(NS_CLAUDE_API, dictionaries$5), "dsh-claude-api: dictionaries");
70691
+ ctx.effect(() => ctx.locale.register(NS_CLAUDE_API, dictionaries$6), "dsh-claude-api: dictionaries");
69501
70692
  ctx.effect(() => {
69502
70693
  installClaudeApiStyles();
69503
70694
  return () => {};
69504
70695
  }, "dsh-claude-api: styles");
69505
- ctx.effect(() => ctx.locale.register(NS_AWS_QUICK, dictionaries$14), "dsh-aws-quick: dictionaries");
70696
+ ctx.effect(() => ctx.locale.register(NS_AWS_QUICK, dictionaries$15), "dsh-aws-quick: dictionaries");
69506
70697
  ctx.effect(() => {
69507
70698
  installAwsQuickStyles();
69508
70699
  return () => {};
69509
70700
  }, "dsh-aws-quick: styles");
69510
- ctx.effect(() => ctx.locale.register(NS_OPENCODE_GO, dictionaries$13), "dsh-opencode-go: dictionaries");
70701
+ ctx.effect(() => ctx.locale.register(NS_OPENCODE_GO, dictionaries$14), "dsh-opencode-go: dictionaries");
69511
70702
  ctx.effect(() => {
69512
70703
  installOpenCodeGoStyles();
69513
70704
  return () => {};
69514
70705
  }, "dsh-opencode-go: styles");
69515
70706
  ctx.effect(() => ctx.locale.register(NS_SUBAGENT, dictionaries), "dsh-subagent-settings: dictionaries");
69516
- ctx.effect(() => ctx.locale.register(NS_DISPATCH_LEDGER, dictionaries$4), "dsh-dispatch-ledger: dictionaries");
70707
+ ctx.effect(() => ctx.locale.register(NS_DISPATCH_LEDGER, dictionaries$5), "dsh-dispatch-ledger: dictionaries");
69517
70708
  ctx.effect(() => {
69518
70709
  installSubagentStyles();
69519
70710
  return () => {};
@@ -69663,6 +70854,40 @@ window.__ModuleLoader__.load({
69663
70854
  return () => {};
69664
70855
  }
69665
70856
  });
70857
+ ctx.slots.inject("conversation.input.right", () => {
70858
+ try {
70859
+ const inject = (sessionId) => {
70860
+ const directory = ctx.modelDirectories.directoryFor(sessionId);
70861
+ return {
70862
+ sessionId: String(sessionId),
70863
+ directory: directory.store,
70864
+ load: () => {
70865
+ directory.load().catch(() => void 0);
70866
+ }
70867
+ };
70868
+ };
70869
+ const modelRow = ctx.slots.register({
70870
+ name: "conversation.input.right",
70871
+ id: "advisor-model",
70872
+ order: 52,
70873
+ locale: NS_ADVISOR,
70874
+ inject
70875
+ }, AdvisorModelTrigger);
70876
+ const effortRow = ctx.slots.register({
70877
+ name: "conversation.input.right",
70878
+ id: "advisor-effort",
70879
+ order: 53,
70880
+ locale: NS_ADVISOR,
70881
+ inject
70882
+ }, AdvisorEffortTrigger);
70883
+ return () => {
70884
+ effortRow();
70885
+ modelRow();
70886
+ };
70887
+ } catch {
70888
+ return () => {};
70889
+ }
70890
+ });
69666
70891
  ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
69667
70892
  name: "tool.call.toolview",
69668
70893
  key: CODEX_IMAGE_TOOL_NAME,