@eddyskywalker/dsh-chatgpt-subscription 0.76.1 → 0.77.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 (70) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +9 -7
  3. package/lib/client.js +1491 -536
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +3884 -2273
  6. package/lib/tool-result-pruner.js +5 -1
  7. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  8. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  9. package/lib/types/client/hub/providers.d.ts.map +1 -1
  10. package/lib/types/client/index.d.ts +2 -0
  11. package/lib/types/client/index.d.ts.map +1 -1
  12. package/lib/types/client/kimi-code/locales.d.ts +2 -2
  13. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  14. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  15. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts +3 -0
  16. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts.map +1 -0
  17. package/lib/types/client/locales.d.ts +3 -1
  18. package/lib/types/client/locales.d.ts.map +1 -1
  19. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts +14 -0
  20. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts.map +1 -0
  21. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts +4 -0
  22. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts.map +1 -0
  23. package/lib/types/client/qianwen-token-plan/api.d.ts +5 -0
  24. package/lib/types/client/qianwen-token-plan/api.d.ts.map +1 -0
  25. package/lib/types/client/qianwen-token-plan/locales.d.ts +182 -0
  26. package/lib/types/client/qianwen-token-plan/locales.d.ts.map +1 -0
  27. package/lib/types/client/qianwen-token-plan/styles.d.ts +3 -0
  28. package/lib/types/client/qianwen-token-plan/styles.d.ts.map +1 -0
  29. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts +35 -0
  30. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts.map +1 -0
  31. package/lib/types/compat.d.ts +1 -1
  32. package/lib/types/entry-tool-result-pruner.d.ts.map +1 -1
  33. package/lib/types/host/cache-warmup/budget.d.ts.map +1 -1
  34. package/lib/types/host/cache-warmup/contracts.d.ts +4 -0
  35. package/lib/types/host/cache-warmup/contracts.d.ts.map +1 -1
  36. package/lib/types/host/cache-warmup/usage.d.ts.map +1 -1
  37. package/lib/types/host/common/i18n/en.d.ts.map +1 -1
  38. package/lib/types/host/common/i18n/ru.d.ts.map +1 -1
  39. package/lib/types/host/common/i18n/zh.d.ts +4 -0
  40. package/lib/types/host/common/i18n/zh.d.ts.map +1 -1
  41. package/lib/types/host/common/model-request-control.d.ts +1 -1
  42. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  43. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  44. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  45. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  46. package/lib/types/host/ptc-sdk-cache-guard.d.ts.map +1 -1
  47. package/lib/types/host/qianwen-token-plan/adapter.d.ts +39 -0
  48. package/lib/types/host/qianwen-token-plan/adapter.d.ts.map +1 -0
  49. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts +17 -0
  50. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts.map +1 -0
  51. package/lib/types/host/qianwen-token-plan/client.d.ts +5 -0
  52. package/lib/types/host/qianwen-token-plan/client.d.ts.map +1 -0
  53. package/lib/types/host/qianwen-token-plan/mapper.d.ts +71 -0
  54. package/lib/types/host/qianwen-token-plan/mapper.d.ts.map +1 -0
  55. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts +28 -0
  56. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts.map +1 -0
  57. package/lib/types/host/qianwen-token-plan/routes.d.ts +12 -0
  58. package/lib/types/host/qianwen-token-plan/routes.d.ts.map +1 -0
  59. package/lib/types/host/qianwen-token-plan/token-store.d.ts +56 -0
  60. package/lib/types/host/qianwen-token-plan/token-store.d.ts.map +1 -0
  61. package/lib/types/host/qianwen-token-plan/types.d.ts +13 -0
  62. package/lib/types/host/qianwen-token-plan/types.d.ts.map +1 -0
  63. package/lib/types/host/timeline-cache-guard.d.ts.map +1 -1
  64. package/lib/types/index.d.ts +5 -0
  65. package/lib/types/index.d.ts.map +1 -1
  66. package/lib/types/shared/contracts.d.ts +1 -1
  67. package/lib/types/shared/contracts.d.ts.map +1 -1
  68. package/lib/types/shared/qianwen-token-plan-contracts.d.ts +94 -0
  69. package/lib/types/shared/qianwen-token-plan-contracts.d.ts.map +1 -0
  70. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -570,6 +570,13 @@ window.__ModuleLoader__.load({
570
570
  fit: "cover"
571
571
  },
572
572
  tile: "#FFFFFF"
573
+ },
574
+ "qianwen-token-plan": {
575
+ image: {
576
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAARGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAAAwoAMABAAAAAEAAAAwAAAAANs3bAwAAAlmSURBVGgFzVoJcFXVGf7OfS97gCAgDVshSYcSMkprDFsQtCOKdFrMdAswIrRxwCnU6TLtOJ3pVMeF6RScOqWA1bGt4AJSZKYLoy2rC4jayFJLISyBUGxACQIJ5N3T77vv3eQl5CX3vaSYf+bPvffcs3z/ev5z8wySJGvtUA4pId9EriQXkx1yKuRy0AHyC+Q95H3GmJO89iwRdD/yveS/ks+S/1+kubXGfHJet6XgJGHyfeR/ka81HeSCWjuckiAcWEiWNj5tEoaipITggHLysU8bedz6x3k/JZAQ7CjwZ+IG95bbegKZ3F4IE9/ADgV83kYeFt/ei+5riWUaM1WNj6kl/RF8GhtXkVMGv/kNYOYSi4WPWRzu+WQozMPJK2NY9dxKbPwOOWVauc7a9DLXpk1wbXiiawu+5tp/Hk15uq4GVvnIPQuwdz82POg3pnLdWW2hXSk7G8jNBU7Uc4c6lspMgcb8mJj7qqfvQnfzflSgoQk6hZmtHTqhCUU5LZ3P/uwJxnSjuZBjKzTeoSQKZJUE3SIfePwVmjkAnfwIeGq7xa4jNkDvli6zdaddbgh5vB66Q4baNpzNY1mB/mSMAEWlaLoCXLoM5OW0rnKRz8+9YbFqu4vac3Q9ut89Ew0evMNBOufogsqo/CESYCxZMdAtCsfcx4m5kAfeRMFvfs/iF69Y1F8AFtxmMG+awa7DFss2W1SftEjPAPpSMEsl/GGPRWWpxejruzSfMJdIgLLuIHep5E07WUoeBDIIxIRs1Aq0QAbjYO8xi3uftGjmIoqLRzZZrHvHovbjaFt2lsa0sqLyirJBMCqVAN8M1vfqXhcbgft/abF+O32R4KTJFjBUYIjA6ujflymkB5SrpVHAo2fZnxbL4LPfX8AvEXjJZ4D8vl1q3wdTKQFUz3dKzRGgsSnqo/EdtVltfJ1AMpkNPDDUvq/NGAZlopDexb1PUx/vmbPxvokC5lIBs8cZLJrkYABjISAVc5qWVNrhmL/tAh5eDZz+yGLRNwy+PQvIIWCR3EdABN4Jx4EXOLkBhVAYxIOPCso2Apdbib402uB7Uw3GDQms+ejA6NL+/dXX3XuBWQ9YNNEC8t8f0pdf3MIdb57BzElAEYuO8UwBO/ZbZNMlwr72dSUWyscbMt1GwS1tC7gb8/OxPNs9MM3BjDFJA9fMHnGqxFRDF7nE9JdFk6bRv3OYKapraOqHLeY8YnHkFPDKQwaPLjC4jjmhkYIKZER4OLNSZj+5g9/GayMt05879U/vdLCpKoTxnzU4T/dMlQxzqaeojib4C/17Ji2Q24cYqGFpz9ekrJLX12LBDIPvVxgooJdutNjwtsV13OQXs33eLVHN/p65fsU2Fw3M+7O+wP63OcimRVe86WLdPhcD+hh8d4LBl0c7cJI0RqcCCNTPf2vx9J8AbTpZSnnydwpi6PPK2xKkkK7wg7sNKqcYHP4Pczq1PrjdzvLheaCh0WLUQIP1rJt+TfDHGywyaVm5lJSzpiKE0vzkJOhUAN8qb38APL7G4tX3olGTkdE2YOU5V2jHGfxO8cxCBxm0VkfUxKhduD6Cv9dYb49Q6hVwMfWDX00P4c6C5AToNAZ8EDd/HlhPX3/2JwZjR7Lq5Brewso2XFwBrip0KwU9SAskokP1Fju5sWUxi/k7ty+AUm1WAsETzaf2QAKoo7JKRTnws3tMqwAx7fkg5Fbw6h+N6IB8wTUu5opyR6VWCfTEPyLYfNyNZq8OhnfUFFgAf7CykuezMe0LvLJOEzeFacUGnxvMhwRUNMBgSqHxNq4WK8aUoHL80HmLH70VweLXm7GP+04QSlqAQQxOmVubkIJYqXPYQGD5XAe/q3JwgjWOArY9/ZeF3EkG7VOzQnh8uoMhSrvEaGMCqIZKpyum0xLbP7SoerMZyz6IRFNz+8ningMFcVx/b/d9+S2L5X+2OHsJmFNusGS68faLZa+52Pi+RX+m3ftvcTC3NGqNtdUuVu1hGqX1vsJNa0lZCJlUwur3Xbx0yMUntF4mwbfs0nwn52YSxIrSEMoHJtZz0gL4wpwneGWVPkytT++wWL3ThbSsAJWLNRP7hvmOFztffyHiaVeWU7YZzH1iwY0UsNjBkXMWvzkQwdbTNAfHyQp+TDVxjsdKmJkGJxZAsqZEAr6D2l72qov9zDzK535pLKAu98cGqlAHHWk2ja4hYNm8P0fBl74TwbZTLlbeGsYTk8PYwvvV/3Zx4BO6EsdICSpPhmUnjikBT0mAd5kKl/MwsuVgtMbJ0Qbn+zJnlD9LZ94pjTct7/yA5VV1UzXj5SgDd0x/g1vzHUy43sHLtdyd6yIYmGVw30gHJdylOyMJoLpR63VJpz4GnqTGX2K5cJFazCRwb1duB94DzNm8AxnX93zbEywmjNKtVuS4+IN/Fp/nEnTFcG6GfB/qHLvwuhJA3+dL9NQZ1TOzVK6gu5yyyOGm5ZUVMeBescYFdVjxta25pBmB8NuiV+ulXaXRGQQ6IvdqlNmcNyAdkB6eD9K5juauOcPCjuDl4z4oJhZPw6OYShWg8t0rxKTjZD6zkYSIngc0hrs434/sZ7BsItMpM4y03g16URbYE2SCtBhoaVvgpUHVP+OGsaaf6uDm4QZrmBbXsrocRK0uLnMwhoVbLePF17yuyk43DDK4fah0123aLQH2kflRo/MvEwVcdN5kg+f41eAC/X8ENV7F49/sm4yXLQRlEUFX3uB4NU1GnGZbDvpsE2wJ3wMkzPvD/NJbxyPBbj7c3tmkOoA/9FUHd91osbeO54SxxttN24/J4z7QhhxaIGY9zxIC3yPKxy7OVCcLiNaSOxXA68U/E0Yasv/U9dU7E1PzUTfilQIovfYAPU/lq5rxaAP/Ho7d9+iFYRKtd2QFqYvC9IALHeFMfxRQTwBK0sD7pWroaSpixsnnGVh1zWVqX2XzF/t3e5VHiVkx4H0z8GZjHHBq8PAYzJW8QQH/HL9g8exRF6f5hWvOCAeTBviGDzhB226v8fEuCqAM3iqAHihEAS9bycPJvZFOENRUgq/xwbVRReyFPrWf8Tv0ois/SKIyHnxCbLTEFLL+tdlb6BiBlCcE3NELDigi95Z/dBd2hLHLNgrg/9RA//a/1qSfN6T+U4N46ThRHnk+WRa5Fj/20A9LeGrumpKuSjjxUE6r8ruU/C1yMblNMuBzUFKxqnJelcC75KR/bvM/oz335IdbWbMAAAAASUVORK5CYII=",
577
+ fit: "cover"
578
+ },
579
+ tile: "#FFFFFF"
573
580
  }
574
581
  };
575
582
  /** One brand mark at a given box size; the artwork is decorative. */
@@ -959,10 +966,10 @@ window.__ModuleLoader__.load({
959
966
  //#region src/client/api.ts
960
967
  var SubscriptionApi = class {
961
968
  status() {
962
- return request$3(`${ROUTE_PREFIX}/status`);
969
+ return request$4(`${ROUTE_PREFIX}/status`);
963
970
  }
964
971
  startLogin() {
965
- return post$6(`${ROUTE_PREFIX}/login/start`, {});
972
+ return post$7(`${ROUTE_PREFIX}/login/start`, {});
966
973
  }
967
974
  /**
968
975
  * Start a device-code sign-in instead of the browser callback.
@@ -972,14 +979,14 @@ window.__ModuleLoader__.load({
972
979
  * wait for confirmation arrives on the same event stream as any other login.
973
980
  */
974
981
  startDeviceLogin() {
975
- return post$6(`${ROUTE_PREFIX}/login/device/start`, {});
982
+ return post$7(`${ROUTE_PREFIX}/login/device/start`, {});
976
983
  }
977
984
  cancelLogin(loginId) {
978
- return post$6(`${ROUTE_PREFIX}/login/cancel`, { loginId });
985
+ return post$7(`${ROUTE_PREFIX}/login/cancel`, { loginId });
979
986
  }
980
987
  /** Sign out one pooled account; without an id, the active one. */
981
988
  logout(accountId) {
982
- return post$6(`${ROUTE_PREFIX}/logout`, accountId === void 0 ? {} : { accountId });
989
+ return post$7(`${ROUTE_PREFIX}/logout`, accountId === void 0 ? {} : { accountId });
983
990
  }
984
991
  /**
985
992
  * One account-pool action, returning the refreshed status.
@@ -988,7 +995,7 @@ window.__ModuleLoader__.load({
988
995
  * never has to guess what the pool looks like after a change.
989
996
  */
990
997
  accountAction(action, body = {}) {
991
- return post$6(`${ROUTE_PREFIX}/accounts`, {
998
+ return post$7(`${ROUTE_PREFIX}/accounts`, {
992
999
  action,
993
1000
  ...body
994
1001
  });
@@ -1003,11 +1010,11 @@ window.__ModuleLoader__.load({
1003
1010
  * call the host always answers with a 400.
1004
1011
  */
1005
1012
  adoptLocalLogin(source) {
1006
- return post$6(`${ROUTE_PREFIX}/adopt`, { source });
1013
+ return post$7(`${ROUTE_PREFIX}/adopt`, { source });
1007
1014
  }
1008
1015
  /** Forget every imported snapshot. The CLIs' own files are never touched. */
1009
1016
  disableAdoptedLocalLogins() {
1010
- return post$6(`${ROUTE_PREFIX}/adopt/disable`, {});
1017
+ return post$7(`${ROUTE_PREFIX}/adopt/disable`, {});
1011
1018
  }
1012
1019
  /**
1013
1020
  * Choose the account-pool store, answering with the refreshed status.
@@ -1016,39 +1023,39 @@ window.__ModuleLoader__.load({
1016
1023
  * back already names the store the pools will read and write from here on.
1017
1024
  */
1018
1025
  setPoolStorage(mode) {
1019
- return post$6(`${ROUTE_PREFIX}/storage`, { mode });
1026
+ return post$7(`${ROUTE_PREFIX}/storage`, { mode });
1020
1027
  }
1021
1028
  refresh() {
1022
- return post$6(`${ROUTE_PREFIX}/token/refresh`, {});
1029
+ return post$7(`${ROUTE_PREFIX}/token/refresh`, {});
1023
1030
  }
1024
1031
  refreshQuota() {
1025
- return post$6(`${ROUTE_PREFIX}/quota/refresh`, {});
1032
+ return post$7(`${ROUTE_PREFIX}/quota/refresh`, {});
1026
1033
  }
1027
1034
  useResetCredit() {
1028
- return post$6(`${ROUTE_PREFIX}/quota/reset-credit/use`, {});
1035
+ return post$7(`${ROUTE_PREFIX}/quota/reset-credit/use`, {});
1029
1036
  }
1030
1037
  testConnection() {
1031
- return post$6(`${ROUTE_PREFIX}/connection/test`, {});
1038
+ return post$7(`${ROUTE_PREFIX}/connection/test`, {});
1032
1039
  }
1033
1040
  updatePreferences(patch) {
1034
- return post$6(`${ROUTE_PREFIX}/preferences/update`, patch);
1041
+ return post$7(`${ROUTE_PREFIX}/preferences/update`, patch);
1035
1042
  }
1036
1043
  /** Every route a compaction summary may be pointed at, read per call. */
1037
1044
  compactionCandidates() {
1038
- return post$6(`${ROUTE_PREFIX}/compaction/candidates`, {});
1045
+ return post$7(`${ROUTE_PREFIX}/compaction/candidates`, {});
1039
1046
  }
1040
1047
  events(loginId) {
1041
1048
  return new EventSource(`${ROUTE_PREFIX}/login/events?loginId=${encodeURIComponent(loginId)}`);
1042
1049
  }
1043
1050
  };
1044
- async function post$6(url, body) {
1045
- return request$3(url, {
1051
+ async function post$7(url, body) {
1052
+ return request$4(url, {
1046
1053
  method: "POST",
1047
1054
  headers: { "content-type": "application/json" },
1048
1055
  body: JSON.stringify(body)
1049
1056
  });
1050
1057
  }
1051
- async function request$3(url, init) {
1058
+ async function request$4(url, init) {
1052
1059
  const response = await fetch(url, {
1053
1060
  ...init,
1054
1061
  credentials: "same-origin"
@@ -1068,7 +1075,7 @@ window.__ModuleLoader__.load({
1068
1075
  //#endregion
1069
1076
  //#region src/client/locales.ts
1070
1077
  const NS = "dsh-chatgpt-subscription";
1071
- const zh$15 = {
1078
+ const zh$16 = {
1072
1079
  ...accountPoolZh,
1073
1080
  title: "ChatGPT",
1074
1081
  hubTitle: "订阅服务",
@@ -1282,6 +1289,7 @@ window.__ModuleLoader__.load({
1282
1289
  "cardName.opendesign": "OpenDesign",
1283
1290
  "cardName.workbuddy": "WorkBuddy",
1284
1291
  "cardName.antigravity-acp": "Antigravity(ACP)",
1292
+ "cardName.qianwen-token-plan": "Qwen Token Plan(千问)",
1285
1293
  modelChecklistCount: "已启用 {count}/{total}",
1286
1294
  codeRunTitle: "代码",
1287
1295
  codeRunOutput: "输出",
@@ -1295,8 +1303,8 @@ window.__ModuleLoader__.load({
1295
1303
  codeRunFailed: "失败",
1296
1304
  codeRunStopped: "已停止"
1297
1305
  };
1298
- const dictionaries$15 = {
1299
- zh: zh$15,
1306
+ const dictionaries$16 = {
1307
+ zh: zh$16,
1300
1308
  en: {
1301
1309
  ...accountPoolEn,
1302
1310
  title: "ChatGPT",
@@ -1511,6 +1519,7 @@ window.__ModuleLoader__.load({
1511
1519
  "cardName.opendesign": "OpenDesign",
1512
1520
  "cardName.workbuddy": "WorkBuddy",
1513
1521
  "cardName.antigravity-acp": "Antigravity (ACP)",
1522
+ "cardName.qianwen-token-plan": "Qwen Token Plan",
1514
1523
  modelChecklistCount: "{count}/{total} enabled",
1515
1524
  codeRunTitle: "Code",
1516
1525
  codeRunOutput: "Output",
@@ -1636,7 +1645,7 @@ window.__ModuleLoader__.load({
1636
1645
  * reads).
1637
1646
  */
1638
1647
  function LineProxySection({ line, fetchSnapshot, onSave, idPrefix, snapshot: provided }) {
1639
- const labels = useLineDict(NS, zh$15);
1648
+ const labels = useLineDict(NS, zh$16);
1640
1649
  const readSnapshotFromRoute = (0, react.useCallback)(() => (fetchSnapshot ?? (() => fetchLineProxySnapshot("/api/dsh-chatgpt-subscription")))(), [fetchSnapshot]);
1641
1650
  const writePreferences = (0, react.useCallback)((patch) => (onSave ?? ((next) => savePreferences("/api/dsh-chatgpt-subscription", next)))(patch), [onSave]);
1642
1651
  const [readSnapshot, setReadSnapshot] = (0, react.useState)(null);
@@ -2509,7 +2518,7 @@ window.__ModuleLoader__.load({
2509
2518
  load(true);
2510
2519
  });
2511
2520
  } catch (cause) {
2512
- if (!quiet) setError(messageOf$4(cause));
2521
+ if (!quiet) setError(messageOf$5(cause));
2513
2522
  }
2514
2523
  }, []);
2515
2524
  (0, react.useEffect)(() => {
@@ -2589,7 +2598,7 @@ window.__ModuleLoader__.load({
2589
2598
  } catch (cause) {
2590
2599
  popup?.close();
2591
2600
  setBusy(null);
2592
- setError(messageOf$4(cause));
2601
+ setError(messageOf$5(cause));
2593
2602
  }
2594
2603
  };
2595
2604
  /**
@@ -2614,8 +2623,8 @@ window.__ModuleLoader__.load({
2614
2623
  setBusy(null);
2615
2624
  await load(true);
2616
2625
  } catch (cause) {
2617
- if (deviceLogin === null) setError(messageOf$4(cause));
2618
- else setDeviceError(messageOf$4(cause));
2626
+ if (deviceLogin === null) setError(messageOf$5(cause));
2627
+ else setDeviceError(messageOf$5(cause));
2619
2628
  setBusy(null);
2620
2629
  }
2621
2630
  };
@@ -2671,7 +2680,7 @@ window.__ModuleLoader__.load({
2671
2680
  setDeviceError(null);
2672
2681
  await load();
2673
2682
  } catch (cause) {
2674
- setError(messageOf$4(cause));
2683
+ setError(messageOf$5(cause));
2675
2684
  } finally {
2676
2685
  setBusy(null);
2677
2686
  }
@@ -2891,7 +2900,7 @@ window.__ModuleLoader__.load({
2891
2900
  const next = await apiRef.current.accountAction("relogin", { accountId });
2892
2901
  setStatus(next);
2893
2902
  } catch (cause) {
2894
- setError(messageOf$4(cause));
2903
+ setError(messageOf$5(cause));
2895
2904
  return;
2896
2905
  }
2897
2906
  await startLogin();
@@ -2904,7 +2913,7 @@ window.__ModuleLoader__.load({
2904
2913
  try {
2905
2914
  await task();
2906
2915
  } catch (cause) {
2907
- setError(messageOf$4(cause));
2916
+ setError(messageOf$5(cause));
2908
2917
  } finally {
2909
2918
  setBusy(null);
2910
2919
  }
@@ -3732,7 +3741,7 @@ window.__ModuleLoader__.load({
3732
3741
  return absolute;
3733
3742
  }
3734
3743
  }
3735
- function messageOf$4(error) {
3744
+ function messageOf$5(error) {
3736
3745
  return error instanceof Error ? error.message : String(error);
3737
3746
  }
3738
3747
  //#endregion
@@ -3892,7 +3901,7 @@ window.__ModuleLoader__.load({
3892
3901
  //#endregion
3893
3902
  //#region src/client/command-code/locales.ts
3894
3903
  const NS_COMMAND_CODE = "dsh-command-code";
3895
- const zh$14 = {
3904
+ const zh$15 = {
3896
3905
  ...accountPoolZh,
3897
3906
  title: "Command Code",
3898
3907
  pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。",
@@ -3960,7 +3969,7 @@ window.__ModuleLoader__.load({
3960
3969
  loginFailed: "登录失败",
3961
3970
  tokens: "tokens"
3962
3971
  };
3963
- const en$14 = {
3972
+ const en$15 = {
3964
3973
  ...accountPoolEn,
3965
3974
  title: "Command Code",
3966
3975
  pageDesc: "Sign in to Command Code and manage models, context windows, and quota.",
@@ -4028,11 +4037,11 @@ window.__ModuleLoader__.load({
4028
4037
  loginFailed: "Sign-in failed",
4029
4038
  tokens: "tokens"
4030
4039
  };
4031
- const dictionaries$14 = {
4032
- zh: zh$14,
4033
- "zh-CN": zh$14,
4034
- en: en$14,
4035
- "en-US": en$14
4040
+ const dictionaries$15 = {
4041
+ zh: zh$15,
4042
+ "zh-CN": zh$15,
4043
+ en: en$15,
4044
+ "en-US": en$15
4036
4045
  };
4037
4046
  //#endregion
4038
4047
  //#region src/client/command-code/CommandCodeSection.tsx
@@ -4049,7 +4058,7 @@ window.__ModuleLoader__.load({
4049
4058
  xhigh: "X-High",
4050
4059
  max: "Max"
4051
4060
  };
4052
- const api$14 = createLineApi("/command-code/api", "Command Code");
4061
+ const api$15 = createLineApi("/command-code/api", "Command Code");
4053
4062
  /**
4054
4063
  * Route name shown next to a model.
4055
4064
  *
@@ -4073,7 +4082,7 @@ window.__ModuleLoader__.load({
4073
4082
  const [apiKey, setApiKey] = (0, react.useState)("");
4074
4083
  /** Follow-up poll owed while the host refreshes the quota behind an answer. */
4075
4084
  const quotaFollowUp = (0, react.useRef)(null);
4076
- const t = useLineDict(NS_COMMAND_CODE, zh$14);
4085
+ const t = useLineDict(NS_COMMAND_CODE, zh$15);
4077
4086
  const notifyChange = (0, react.useCallback)(() => {
4078
4087
  onModelChange?.();
4079
4088
  loadModelDirectory?.();
@@ -4081,7 +4090,7 @@ window.__ModuleLoader__.load({
4081
4090
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
4082
4091
  if (!quiet) setError(null);
4083
4092
  try {
4084
- const data = await api$14.request("/status");
4093
+ const data = await api$15.request("/status");
4085
4094
  setStatus(data);
4086
4095
  setContextDrafts(contextDraftsFor(data));
4087
4096
  quotaFollowUp.current ??= createQuotaFollowUp();
@@ -4112,12 +4121,12 @@ window.__ModuleLoader__.load({
4112
4121
  setBusy("login");
4113
4122
  setError(null);
4114
4123
  setLoginProgress(null);
4115
- const flow = await api$14.request("/login", { method: "POST" });
4124
+ const flow = await api$15.request("/login", { method: "POST" });
4116
4125
  if (flow.authUrl) window.open(flow.authUrl, "_blank");
4117
4126
  const pollTimer = window.setInterval(() => {
4118
4127
  (async () => {
4119
4128
  try {
4120
- const poll = await api$14.request("/login/status");
4129
+ const poll = await api$15.request("/login/status");
4121
4130
  if (poll.progress) setLoginProgress(poll.progress);
4122
4131
  if (poll.status === "complete") {
4123
4132
  window.clearInterval(pollTimer);
@@ -4149,7 +4158,7 @@ window.__ModuleLoader__.load({
4149
4158
  try {
4150
4159
  setBusy("apikey");
4151
4160
  setError(null);
4152
- const updated = await api$14.request("/login/apikey", {
4161
+ const updated = await api$15.request("/login/apikey", {
4153
4162
  method: "POST",
4154
4163
  body: JSON.stringify({ apiKey })
4155
4164
  });
@@ -4167,7 +4176,7 @@ window.__ModuleLoader__.load({
4167
4176
  try {
4168
4177
  setBusy(`${action}-${accountId}`);
4169
4178
  setError(null);
4170
- const updated = await api$14.request("/accounts", {
4179
+ const updated = await api$15.request("/accounts", {
4171
4180
  method: "POST",
4172
4181
  body: JSON.stringify({
4173
4182
  action,
@@ -4186,7 +4195,7 @@ window.__ModuleLoader__.load({
4186
4195
  try {
4187
4196
  setBusy("strategy");
4188
4197
  setError(null);
4189
- const updated = await api$14.request("/accounts", {
4198
+ const updated = await api$15.request("/accounts", {
4190
4199
  method: "POST",
4191
4200
  body: JSON.stringify({
4192
4201
  action: "strategy",
@@ -4209,7 +4218,7 @@ window.__ModuleLoader__.load({
4209
4218
  const handleRelogin = (accountId) => {
4210
4219
  (async () => {
4211
4220
  try {
4212
- const updated = await api$14.request("/accounts", {
4221
+ const updated = await api$15.request("/accounts", {
4213
4222
  method: "POST",
4214
4223
  body: JSON.stringify({
4215
4224
  action: "relogin",
@@ -4228,7 +4237,7 @@ window.__ModuleLoader__.load({
4228
4237
  try {
4229
4238
  setBusy("quota");
4230
4239
  setError(null);
4231
- const updated = await api$14.request("/quota", { method: "POST" });
4240
+ const updated = await api$15.request("/quota", { method: "POST" });
4232
4241
  setStatus(updated);
4233
4242
  } catch (err) {
4234
4243
  setError(err instanceof Error ? err.message : String(err));
@@ -4240,7 +4249,7 @@ window.__ModuleLoader__.load({
4240
4249
  try {
4241
4250
  setBusy("catalog");
4242
4251
  setError(null);
4243
- const updated = await api$14.request("/catalog/refresh", { method: "POST" });
4252
+ const updated = await api$15.request("/catalog/refresh", { method: "POST" });
4244
4253
  setStatus(updated);
4245
4254
  setContextDrafts(contextDraftsFor(updated));
4246
4255
  notifyChange();
@@ -4254,7 +4263,7 @@ window.__ModuleLoader__.load({
4254
4263
  try {
4255
4264
  setBusy("connection");
4256
4265
  setError(null);
4257
- await api$14.post("/connection/test");
4266
+ await api$15.post("/connection/test");
4258
4267
  await loadStatus(true);
4259
4268
  } catch (err) {
4260
4269
  setError(err instanceof Error ? err.message : String(err));
@@ -4264,7 +4273,7 @@ window.__ModuleLoader__.load({
4264
4273
  };
4265
4274
  const applyEnabled = async (enabledModelIds) => {
4266
4275
  try {
4267
- const updated = await api$14.request("/models", {
4276
+ const updated = await api$15.request("/models", {
4268
4277
  method: "POST",
4269
4278
  body: JSON.stringify({ enabledModelIds })
4270
4279
  });
@@ -4287,7 +4296,7 @@ window.__ModuleLoader__.load({
4287
4296
  };
4288
4297
  const handleUpdateEffort = async (effort) => {
4289
4298
  try {
4290
- const updated = await api$14.request("/settings", {
4299
+ const updated = await api$15.request("/settings", {
4291
4300
  method: "POST",
4292
4301
  body: JSON.stringify({ defaultReasoningEffort: effort })
4293
4302
  });
@@ -4307,7 +4316,7 @@ window.__ModuleLoader__.load({
4307
4316
  try {
4308
4317
  setSavingModel(modelId);
4309
4318
  setError(null);
4310
- const updated = await api$14.request("/settings", {
4319
+ const updated = await api$15.request("/settings", {
4311
4320
  method: "POST",
4312
4321
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
4313
4322
  });
@@ -4328,7 +4337,7 @@ window.__ModuleLoader__.load({
4328
4337
  try {
4329
4338
  setSavingModel(modelId);
4330
4339
  setError(null);
4331
- const updated = await api$14.request("/settings", {
4340
+ const updated = await api$15.request("/settings", {
4332
4341
  method: "POST",
4333
4342
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
4334
4343
  });
@@ -4355,7 +4364,7 @@ window.__ModuleLoader__.load({
4355
4364
  try {
4356
4365
  setBusy("context");
4357
4366
  setError(null);
4358
- const updated = await api$14.request("/settings", {
4367
+ const updated = await api$15.request("/settings", {
4359
4368
  method: "POST",
4360
4369
  body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
4361
4370
  });
@@ -4835,7 +4844,7 @@ window.__ModuleLoader__.load({
4835
4844
  //#endregion
4836
4845
  //#region src/client/kimi-code/locales.ts
4837
4846
  const NS_KIMI_CODE = "dsh-kimi-code";
4838
- const zh$13 = {
4847
+ const zh$14 = {
4839
4848
  ...accountPoolZh,
4840
4849
  title: "Kimi Code",
4841
4850
  pageDesc: "登录 Kimi Code 订阅,管理模型、思考档位、上下文窗口与额度。",
@@ -5022,7 +5031,7 @@ window.__ModuleLoader__.load({
5022
5031
  compactionRouteNoImage: "该模型不接受图片:摘要里的截图会被替换为占位文本。",
5023
5032
  compactionRouteEmpty: "没有可用的线路——先登录任意一条线路再回来设置。"
5024
5033
  };
5025
- const en$13 = {
5034
+ const en$14 = {
5026
5035
  ...accountPoolEn,
5027
5036
  title: "Kimi Code",
5028
5037
  pageDesc: "Sign in to the Kimi Code subscription and manage models, thinking level, context windows, and quota.",
@@ -5209,11 +5218,11 @@ window.__ModuleLoader__.load({
5209
5218
  compactionRouteNoImage: "This model takes no images: screenshots become placeholder text in the summary.",
5210
5219
  compactionRouteEmpty: "No route is available — sign in to one first."
5211
5220
  };
5212
- const dictionaries$13 = {
5213
- zh: zh$13,
5214
- "zh-CN": zh$13,
5215
- en: en$13,
5216
- "en-US": en$13
5221
+ const dictionaries$14 = {
5222
+ zh: zh$14,
5223
+ "zh-CN": zh$14,
5224
+ en: en$14,
5225
+ "en-US": en$14
5217
5226
  };
5218
5227
  //#endregion
5219
5228
  //#region src/shared/kimi-code-contracts.ts
@@ -5325,7 +5334,7 @@ window.__ModuleLoader__.load({
5325
5334
  return `${value}x`;
5326
5335
  }
5327
5336
  function KimiModelCapabilities({ models }) {
5328
- const t = useLineDict(NS_KIMI_CODE, zh$13);
5337
+ const t = useLineDict(NS_KIMI_CODE, zh$14);
5329
5338
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5330
5339
  className: "dsha-cap-table",
5331
5340
  children: [
@@ -5482,7 +5491,7 @@ window.__ModuleLoader__.load({
5482
5491
  /** 提示条箭头离气泡两端的最小距离,免得圆角把三角切掉。 */
5483
5492
  const ARROW_INSET = 12;
5484
5493
  /** 百分比,最多两位小数;非有限数不画。舍入规则放在共享的 `formatPercent`。 */
5485
- function percentText$2(value) {
5494
+ function percentText$3(value) {
5486
5495
  if (!Number.isFinite(value)) return "0%";
5487
5496
  return `${formatPercent$1(value)}%`;
5488
5497
  }
@@ -5657,7 +5666,7 @@ window.__ModuleLoader__.load({
5657
5666
  children: headline
5658
5667
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5659
5668
  className: "dsha-kq-value",
5660
- children: percentText$2(totalPercent)
5669
+ children: percentText$3(totalPercent)
5661
5670
  })]
5662
5671
  }),
5663
5672
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -5683,7 +5692,7 @@ window.__ModuleLoader__.load({
5683
5692
  "--kq-tip-shift": `${tipPlacement.shift}px`,
5684
5693
  ...tipPlacement.arrowPx === null ? {} : { "--kq-tip-arrow": `${tipPlacement.arrowPx}px` }
5685
5694
  },
5686
- children: t.kqTip.replace("{pct}", percentText$2(totalPercent))
5695
+ children: t.kqTip.replace("{pct}", percentText$3(totalPercent))
5687
5696
  })]
5688
5697
  }),
5689
5698
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -5693,7 +5702,7 @@ window.__ModuleLoader__.load({
5693
5702
  className: "dsha-kq-legend-item",
5694
5703
  children: [
5695
5704
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", { className: "dsha-kq-dot dsha-kq-dot--recent" }),
5696
- t.kqShortWindow.replace("{pct}", percentText$2(used(shortWindow))),
5705
+ t.kqShortWindow.replace("{pct}", percentText$3(used(shortWindow))),
5697
5706
  shortReset !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5698
5707
  className: "dsha-kq-legend-note",
5699
5708
  children: shortReset > clock ? t.kqResetIn.replace("{time}", durationText(t, shortReset - clock)) : t.kqResetSoon
@@ -5727,7 +5736,7 @@ window.__ModuleLoader__.load({
5727
5736
  }
5728
5737
  //#endregion
5729
5738
  //#region src/client/kimi-code/KimiCodeSection.tsx
5730
- const api$13 = createLineApi("/kimi-code/api", "Kimi Code");
5739
+ const api$14 = createLineApi("/kimi-code/api", "Kimi Code");
5731
5740
  /**
5732
5741
  * One token count as the card prints it.
5733
5742
  *
@@ -5854,7 +5863,7 @@ window.__ModuleLoader__.load({
5854
5863
  statusGeneration.current += 1;
5855
5864
  setStatus(next);
5856
5865
  }, []);
5857
- const t = useLineDict(NS_KIMI_CODE, zh$13);
5866
+ const t = useLineDict(NS_KIMI_CODE, zh$14);
5858
5867
  const notifyChange = (0, react.useCallback)(() => {
5859
5868
  onModelChange?.();
5860
5869
  loadModelDirectory?.();
@@ -5863,7 +5872,7 @@ window.__ModuleLoader__.load({
5863
5872
  const generation = ++statusGeneration.current;
5864
5873
  if (!quiet) setError(null);
5865
5874
  try {
5866
- const data = await api$13.request("/status");
5875
+ const data = await api$14.request("/status");
5867
5876
  if (generation !== statusGeneration.current) return;
5868
5877
  setStatus(data);
5869
5878
  setContextDrafts(contextDraftsFor(data));
@@ -5905,7 +5914,7 @@ window.__ModuleLoader__.load({
5905
5914
  const timer = window.setInterval(() => {
5906
5915
  (async () => {
5907
5916
  try {
5908
- const poll = await api$13.request("/login/status");
5917
+ const poll = await api$14.request("/login/status");
5909
5918
  setFlow(poll);
5910
5919
  if (poll.status === "complete") {
5911
5920
  await loadStatus();
@@ -5927,7 +5936,7 @@ window.__ModuleLoader__.load({
5927
5936
  setBusy("login");
5928
5937
  setError(null);
5929
5938
  setCopied(false);
5930
- const next = await api$13.request("/login", {
5939
+ const next = await api$14.request("/login", {
5931
5940
  method: "POST",
5932
5941
  body: JSON.stringify(accountId === void 0 ? {} : { accountId })
5933
5942
  });
@@ -5940,7 +5949,7 @@ window.__ModuleLoader__.load({
5940
5949
  };
5941
5950
  const handleCancelLogin = async () => {
5942
5951
  try {
5943
- await api$13.request("/login/cancel", { method: "POST" });
5952
+ await api$14.request("/login/cancel", { method: "POST" });
5944
5953
  setFlow({ status: "idle" });
5945
5954
  } catch (err) {
5946
5955
  setError(err instanceof Error ? err.message : String(err));
@@ -5960,7 +5969,7 @@ window.__ModuleLoader__.load({
5960
5969
  try {
5961
5970
  setBusy(`${action}-${accountId}`);
5962
5971
  setError(null);
5963
- const updated = await api$13.request("/accounts", {
5972
+ const updated = await api$14.request("/accounts", {
5964
5973
  method: "POST",
5965
5974
  body: JSON.stringify({
5966
5975
  action,
@@ -5980,7 +5989,7 @@ window.__ModuleLoader__.load({
5980
5989
  try {
5981
5990
  setBusy("strategy");
5982
5991
  setError(null);
5983
- const updated = await api$13.request("/accounts", {
5992
+ const updated = await api$14.request("/accounts", {
5984
5993
  method: "POST",
5985
5994
  body: JSON.stringify({
5986
5995
  action: "strategy",
@@ -6003,7 +6012,7 @@ window.__ModuleLoader__.load({
6003
6012
  const handleRelogin = (accountId) => {
6004
6013
  (async () => {
6005
6014
  try {
6006
- const updated = await api$13.request("/accounts", {
6015
+ const updated = await api$14.request("/accounts", {
6007
6016
  method: "POST",
6008
6017
  body: JSON.stringify({
6009
6018
  action: "relogin",
@@ -6022,7 +6031,7 @@ window.__ModuleLoader__.load({
6022
6031
  try {
6023
6032
  setBusy("quota");
6024
6033
  setError(null);
6025
- const updated = await api$13.request("/quota", { method: "POST" });
6034
+ const updated = await api$14.request("/quota", { method: "POST" });
6026
6035
  applyStatus(updated);
6027
6036
  } catch (err) {
6028
6037
  setError(err instanceof Error ? err.message : String(err));
@@ -6035,7 +6044,7 @@ window.__ModuleLoader__.load({
6035
6044
  try {
6036
6045
  setBusy("catalog");
6037
6046
  setError(null);
6038
- const updated = await api$13.request("/catalog/refresh", { method: "POST" });
6047
+ const updated = await api$14.request("/catalog/refresh", { method: "POST" });
6039
6048
  applyStatus(updated);
6040
6049
  setContextDrafts(contextDraftsFor(updated));
6041
6050
  notifyChange();
@@ -6050,7 +6059,7 @@ window.__ModuleLoader__.load({
6050
6059
  setBusy("connection");
6051
6060
  setError(null);
6052
6061
  setConnectionNotice(null);
6053
- const result = await api$13.request("/connection/test", { method: "POST" });
6062
+ const result = await api$14.request("/connection/test", { method: "POST" });
6054
6063
  setConnectionNotice(result.connected ? `${t.testSuccess} · ${result.latencyMs} ms` : t.testFailed);
6055
6064
  await loadStatus(true);
6056
6065
  } catch (err) {
@@ -6061,7 +6070,7 @@ window.__ModuleLoader__.load({
6061
6070
  };
6062
6071
  const applyEnabled = async (enabledModelIds) => {
6063
6072
  try {
6064
- const updated = await api$13.request("/models", {
6073
+ const updated = await api$14.request("/models", {
6065
6074
  method: "POST",
6066
6075
  body: JSON.stringify({ enabledModelIds })
6067
6076
  });
@@ -6084,7 +6093,7 @@ window.__ModuleLoader__.load({
6084
6093
  };
6085
6094
  const handleUpdateEffort = async (effort) => {
6086
6095
  try {
6087
- const updated = await api$13.request("/settings", {
6096
+ const updated = await api$14.request("/settings", {
6088
6097
  method: "POST",
6089
6098
  body: JSON.stringify({ defaultReasoningEffort: effort })
6090
6099
  });
@@ -6104,7 +6113,7 @@ window.__ModuleLoader__.load({
6104
6113
  try {
6105
6114
  setSavingModel(modelId);
6106
6115
  setError(null);
6107
- const updated = await api$13.request("/settings", {
6116
+ const updated = await api$14.request("/settings", {
6108
6117
  method: "POST",
6109
6118
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
6110
6119
  });
@@ -6125,7 +6134,7 @@ window.__ModuleLoader__.load({
6125
6134
  try {
6126
6135
  setSavingModel(modelId);
6127
6136
  setError(null);
6128
- const updated = await api$13.request("/settings", {
6137
+ const updated = await api$14.request("/settings", {
6129
6138
  method: "POST",
6130
6139
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
6131
6140
  });
@@ -6152,7 +6161,7 @@ window.__ModuleLoader__.load({
6152
6161
  try {
6153
6162
  setBusy("context");
6154
6163
  setError(null);
6155
- const updated = await api$13.request("/settings", {
6164
+ const updated = await api$14.request("/settings", {
6156
6165
  method: "POST",
6157
6166
  body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
6158
6167
  });
@@ -6633,11 +6642,11 @@ window.__ModuleLoader__.load({
6633
6642
  * The names stay as they were so the hook that consumes them does not have to
6634
6643
  * change with the reader.
6635
6644
  */
6636
- const api$12 = createLineApi(MINIMAX_CODE_ROUTE_PREFIX, "MiniMax Code");
6637
- api$12.request;
6638
- const get$3 = api$12.get;
6639
- const post$5 = api$12.post;
6640
- function messageOf$3(cause) {
6645
+ const api$13 = createLineApi(MINIMAX_CODE_ROUTE_PREFIX, "MiniMax Code");
6646
+ api$13.request;
6647
+ const get$4 = api$13.get;
6648
+ const post$6 = api$13.post;
6649
+ function messageOf$4(cause) {
6641
6650
  return cause instanceof Error ? cause.message : String(cause);
6642
6651
  }
6643
6652
  /**
@@ -6647,7 +6656,7 @@ window.__ModuleLoader__.load({
6647
6656
  * produces the reader's "restart DSH" sentence rather than a bare parse crash.
6648
6657
  */
6649
6658
  function fetchResetCards() {
6650
- return get$3("/reset-cards");
6659
+ return get$4("/reset-cards");
6651
6660
  }
6652
6661
  /**
6653
6662
  * Spend one card.
@@ -6658,12 +6667,12 @@ window.__ModuleLoader__.load({
6658
6667
  * looks the card up and sends the key it found.
6659
6668
  */
6660
6669
  function useResetCard(cardId) {
6661
- return post$5("/reset-cards/use", { cardId });
6670
+ return post$6("/reset-cards/use", { cardId });
6662
6671
  }
6663
6672
  //#endregion
6664
6673
  //#region src/client/minimax-code/locales.ts
6665
6674
  const NS_MINIMAX_CODE = "dsh-minimax-code";
6666
- const zh$12 = {
6675
+ const zh$13 = {
6667
6676
  ...accountPoolZh,
6668
6677
  title: "MiniMax Code",
6669
6678
  pageDesc: "登录 MiniMax Code 编程订阅(设备码 OAuth),复用本机 MiniMax Code 的登录态,管理账号、连接与模型。",
@@ -6861,7 +6870,7 @@ window.__ModuleLoader__.load({
6861
6870
  videoHistoryEncrypted: "已由系统凭据后端加密",
6862
6871
  videoHistoryPlain: "本机没有可用的凭据后端,记录为明文"
6863
6872
  };
6864
- const en$12 = {
6873
+ const en$13 = {
6865
6874
  ...accountPoolEn,
6866
6875
  title: "MiniMax Code",
6867
6876
  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.",
@@ -7059,11 +7068,11 @@ window.__ModuleLoader__.load({
7059
7068
  videoHistoryEncrypted: "Encrypted by the platform credential backend",
7060
7069
  videoHistoryPlain: "No credential backend on this host; stored as plain text"
7061
7070
  };
7062
- const dictionaries$12 = {
7063
- zh: zh$12,
7064
- "zh-CN": zh$12,
7065
- en: en$12,
7066
- "en-US": en$12
7071
+ const dictionaries$13 = {
7072
+ zh: zh$13,
7073
+ "zh-CN": zh$13,
7074
+ en: en$13,
7075
+ "en-US": en$13
7067
7076
  };
7068
7077
  //#endregion
7069
7078
  //#region src/client/minimax-code/useMinimaxCodeSection.ts
@@ -7077,7 +7086,7 @@ window.__ModuleLoader__.load({
7077
7086
  * rather than inferred from the JSX.
7078
7087
  */
7079
7088
  /** The card's own dictionary; stable identity keeps effect dependencies intact. */
7080
- const fallbackTranslate$7 = (key) => zh$12[key];
7089
+ const fallbackTranslate$7 = (key) => zh$13[key];
7081
7090
  /**
7082
7091
  * The shared pool card's labels, resolved through this card's dictionary.
7083
7092
  *
@@ -7190,7 +7199,7 @@ window.__ModuleLoader__.load({
7190
7199
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
7191
7200
  if (!quiet) setError(null);
7192
7201
  try {
7193
- const next = await get$3("/status");
7202
+ const next = await get$4("/status");
7194
7203
  setStatus(next);
7195
7204
  setContextDrafts(contextDraftsFor(next));
7196
7205
  quotaFollowUp.current ??= createQuotaFollowUp();
@@ -7198,7 +7207,7 @@ window.__ModuleLoader__.load({
7198
7207
  loadStatus(true);
7199
7208
  });
7200
7209
  } catch (cause) {
7201
- if (!quiet) setError(messageOf$3(cause));
7210
+ if (!quiet) setError(messageOf$4(cause));
7202
7211
  } finally {
7203
7212
  setLoading(false);
7204
7213
  }
@@ -7227,7 +7236,7 @@ window.__ModuleLoader__.load({
7227
7236
  const timer = window.setInterval(() => {
7228
7237
  (async () => {
7229
7238
  try {
7230
- const poll = await post$5("/login/poll", { loginId });
7239
+ const poll = await post$6("/login/poll", { loginId });
7231
7240
  if (stopped || poll.status === "pending") return;
7232
7241
  stopped = true;
7233
7242
  window.clearInterval(timer);
@@ -7268,7 +7277,7 @@ window.__ModuleLoader__.load({
7268
7277
  quotaRequested.current = true;
7269
7278
  (async () => {
7270
7279
  try {
7271
- setStatus(await post$5("/quota"));
7280
+ setStatus(await post$6("/quota"));
7272
7281
  } catch {}
7273
7282
  })();
7274
7283
  }, [authenticated, status?.quota]);
@@ -7325,7 +7334,7 @@ window.__ModuleLoader__.load({
7325
7334
  await loadResetCards();
7326
7335
  await refreshQuota();
7327
7336
  } catch (cause) {
7328
- setError(messageOf$3(cause));
7337
+ setError(messageOf$4(cause));
7329
7338
  } finally {
7330
7339
  setBusy(null);
7331
7340
  }
@@ -7336,7 +7345,7 @@ window.__ModuleLoader__.load({
7336
7345
  setError(null);
7337
7346
  setConnectionNotice(null);
7338
7347
  setCopied(false);
7339
- const started = await post$5("/login/start");
7348
+ const started = await post$6("/login/start");
7340
7349
  const next = started.login ?? (typeof started.loginId === "string" ? started : void 0);
7341
7350
  if (next === void 0) {
7342
7351
  setError(t("loginFailed"));
@@ -7344,7 +7353,7 @@ window.__ModuleLoader__.load({
7344
7353
  }
7345
7354
  setFlow(next);
7346
7355
  } catch (cause) {
7347
- setError(messageOf$3(cause));
7356
+ setError(messageOf$4(cause));
7348
7357
  } finally {
7349
7358
  setBusy(null);
7350
7359
  }
@@ -7354,9 +7363,9 @@ window.__ModuleLoader__.load({
7354
7363
  setFlow(null);
7355
7364
  if (pending === null) return;
7356
7365
  try {
7357
- await post$5("/login/cancel", { loginId: pending.loginId });
7366
+ await post$6("/login/cancel", { loginId: pending.loginId });
7358
7367
  } catch (cause) {
7359
- setError(messageOf$3(cause));
7368
+ setError(messageOf$4(cause));
7360
7369
  }
7361
7370
  };
7362
7371
  const copyCode = async () => {
@@ -7374,12 +7383,12 @@ window.__ModuleLoader__.load({
7374
7383
  setError(null);
7375
7384
  setConnectionNotice(null);
7376
7385
  setFlow(null);
7377
- const result = await post$5("/logout");
7386
+ const result = await post$6("/logout");
7378
7387
  if (result.native === true) setConnectionNotice(result.error ?? t("logoutOwnedByApp"));
7379
7388
  await loadStatus(true);
7380
7389
  onModelChange?.();
7381
7390
  } catch (cause) {
7382
- setError(messageOf$3(cause));
7391
+ setError(messageOf$4(cause));
7383
7392
  await loadStatus(true);
7384
7393
  } finally {
7385
7394
  setBusy(null);
@@ -7394,7 +7403,7 @@ window.__ModuleLoader__.load({
7394
7403
  /** Re-read the pool slice, which lives beside the status on its own route. */
7395
7404
  const loadPool = (0, react.useCallback)(async () => {
7396
7405
  try {
7397
- const next = await get$3("/accounts");
7406
+ const next = await get$4("/accounts");
7398
7407
  setPool(next);
7399
7408
  } catch {
7400
7409
  setPool(void 0);
@@ -7405,7 +7414,7 @@ window.__ModuleLoader__.load({
7405
7414
  try {
7406
7415
  setBusy(action);
7407
7416
  setError(null);
7408
- await post$5("/accounts", {
7417
+ await post$6("/accounts", {
7409
7418
  action,
7410
7419
  accountId
7411
7420
  });
@@ -7413,7 +7422,7 @@ window.__ModuleLoader__.load({
7413
7422
  await loadStatus(true);
7414
7423
  onModelChange?.();
7415
7424
  } catch (cause) {
7416
- setError(messageOf$3(cause));
7425
+ setError(messageOf$4(cause));
7417
7426
  } finally {
7418
7427
  setBusy(null);
7419
7428
  }
@@ -7422,13 +7431,13 @@ window.__ModuleLoader__.load({
7422
7431
  try {
7423
7432
  setBusy("strategy");
7424
7433
  setError(null);
7425
- await post$5("/accounts", {
7434
+ await post$6("/accounts", {
7426
7435
  action: "strategy",
7427
7436
  strategy
7428
7437
  });
7429
7438
  await loadPool();
7430
7439
  } catch (cause) {
7431
- setError(messageOf$3(cause));
7440
+ setError(messageOf$4(cause));
7432
7441
  } finally {
7433
7442
  setBusy(null);
7434
7443
  }
@@ -7436,12 +7445,12 @@ window.__ModuleLoader__.load({
7436
7445
  const applyEnabled = async (enabledModelIds) => {
7437
7446
  try {
7438
7447
  setError(null);
7439
- const updated = await post$5("/models", { enabledModelIds });
7448
+ const updated = await post$6("/models", { enabledModelIds });
7440
7449
  setStatus(updated);
7441
7450
  setContextDrafts(contextDraftsFor(updated));
7442
7451
  onModelChange?.();
7443
7452
  } catch (cause) {
7444
- setError(messageOf$3(cause));
7453
+ setError(messageOf$4(cause));
7445
7454
  }
7446
7455
  };
7447
7456
  /** Flip the check-in scheduler's own switch, through the same settings route. */
@@ -7449,10 +7458,10 @@ window.__ModuleLoader__.load({
7449
7458
  try {
7450
7459
  setBusy("checkin");
7451
7460
  setError(null);
7452
- const updated = await post$5("/settings", { checkin: { enabled } });
7461
+ const updated = await post$6("/settings", { checkin: { enabled } });
7453
7462
  setStatus(updated);
7454
7463
  } catch (cause) {
7455
- setError(messageOf$3(cause));
7464
+ setError(messageOf$4(cause));
7456
7465
  } finally {
7457
7466
  setBusy(null);
7458
7467
  }
@@ -7462,10 +7471,10 @@ window.__ModuleLoader__.load({
7462
7471
  try {
7463
7472
  setBusy("checkin");
7464
7473
  setError(null);
7465
- const updated = await post$5("/checkin/now");
7474
+ const updated = await post$6("/checkin/now");
7466
7475
  setStatus(updated);
7467
7476
  } catch (cause) {
7468
- setError(messageOf$3(cause));
7477
+ setError(messageOf$4(cause));
7469
7478
  } finally {
7470
7479
  setBusy(null);
7471
7480
  }
@@ -7483,11 +7492,11 @@ window.__ModuleLoader__.load({
7483
7492
  const updateEffort = async (effort) => {
7484
7493
  try {
7485
7494
  setError(null);
7486
- const updated = await post$5("/settings", { defaultReasoningEffort: effort });
7495
+ const updated = await post$6("/settings", { defaultReasoningEffort: effort });
7487
7496
  setStatus(updated);
7488
7497
  onModelChange?.();
7489
7498
  } catch (cause) {
7490
- setError(messageOf$3(cause));
7499
+ setError(messageOf$4(cause));
7491
7500
  }
7492
7501
  };
7493
7502
  const saveContextWindow = async (modelId) => {
@@ -7500,7 +7509,7 @@ window.__ModuleLoader__.load({
7500
7509
  try {
7501
7510
  setSavingModel(modelId);
7502
7511
  setError(null);
7503
- const updated = await post$5("/settings", { contextWindowOverrides: { [modelId]: parsed } });
7512
+ const updated = await post$6("/settings", { contextWindowOverrides: { [modelId]: parsed } });
7504
7513
  setStatus(updated);
7505
7514
  setContextDrafts((prev) => ({
7506
7515
  ...prev,
@@ -7508,7 +7517,7 @@ window.__ModuleLoader__.load({
7508
7517
  }));
7509
7518
  onModelChange?.();
7510
7519
  } catch (cause) {
7511
- setError(messageOf$3(cause));
7520
+ setError(messageOf$4(cause));
7512
7521
  } finally {
7513
7522
  setSavingModel(null);
7514
7523
  }
@@ -7517,7 +7526,7 @@ window.__ModuleLoader__.load({
7517
7526
  try {
7518
7527
  setSavingModel(modelId);
7519
7528
  setError(null);
7520
- const updated = await post$5("/settings", { contextWindowOverrides: { [modelId]: null } });
7529
+ const updated = await post$6("/settings", { contextWindowOverrides: { [modelId]: null } });
7521
7530
  setStatus(updated);
7522
7531
  const model = updated.models.find((entry) => entry.id === modelId);
7523
7532
  if (model !== void 0) setContextDrafts((prev) => ({
@@ -7526,7 +7535,7 @@ window.__ModuleLoader__.load({
7526
7535
  }));
7527
7536
  onModelChange?.();
7528
7537
  } catch (cause) {
7529
- setError(messageOf$3(cause));
7538
+ setError(messageOf$4(cause));
7530
7539
  } finally {
7531
7540
  setSavingModel(null);
7532
7541
  }
@@ -7536,12 +7545,12 @@ window.__ModuleLoader__.load({
7536
7545
  if (ids.length === 0) return;
7537
7546
  try {
7538
7547
  setError(null);
7539
- const updated = await post$5("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
7548
+ const updated = await post$6("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
7540
7549
  setStatus(updated);
7541
7550
  setContextDrafts(contextDraftsFor(updated));
7542
7551
  onModelChange?.();
7543
7552
  } catch (cause) {
7544
- setError(messageOf$3(cause));
7553
+ setError(messageOf$4(cause));
7545
7554
  }
7546
7555
  };
7547
7556
  /** Force one usage read through `/quota` and render the fresh status. */
@@ -7549,9 +7558,9 @@ window.__ModuleLoader__.load({
7549
7558
  try {
7550
7559
  setBusy("quota");
7551
7560
  setError(null);
7552
- setStatus(await post$5("/quota"));
7561
+ setStatus(await post$6("/quota"));
7553
7562
  } catch (cause) {
7554
- setError(messageOf$3(cause));
7563
+ setError(messageOf$4(cause));
7555
7564
  } finally {
7556
7565
  setBusy(null);
7557
7566
  }
@@ -7561,14 +7570,14 @@ window.__ModuleLoader__.load({
7561
7570
  setBusy("test");
7562
7571
  setError(null);
7563
7572
  setConnectionNotice(null);
7564
- const result = await post$5("/test");
7573
+ const result = await post$6("/test");
7565
7574
  if (result.ok === true) {
7566
7575
  setConnectionNotice(result.model === void 0 || result.model === "" ? t("testSuccess") : t("testSuccessModel").replace("{model}", result.model));
7567
7576
  return;
7568
7577
  }
7569
7578
  setConnectionNotice(result.error === void 0 || result.error === "" ? t("testFailed") : `${t("testFailed")}:${result.error}`);
7570
7579
  } catch (cause) {
7571
- setConnectionNotice(`${t("testFailed")}:${messageOf$3(cause)}`);
7580
+ setConnectionNotice(`${t("testFailed")}:${messageOf$4(cause)}`);
7572
7581
  } finally {
7573
7582
  setBusy(null);
7574
7583
  }
@@ -8303,13 +8312,13 @@ window.__ModuleLoader__.load({
8303
8312
  }, []);
8304
8313
  const load = (0, react.useCallback)(async () => {
8305
8314
  try {
8306
- const value = await get$3("/video-history");
8315
+ const value = await get$4("/video-history");
8307
8316
  if (!alive.current) return;
8308
8317
  setData(parseVideoHistoryDto(value));
8309
8318
  setFailure(null);
8310
8319
  } catch (error) {
8311
8320
  if (!alive.current) return;
8312
- setFailure(messageOf$3(error));
8321
+ setFailure(messageOf$4(error));
8313
8322
  } finally {
8314
8323
  if (alive.current) setLoading(false);
8315
8324
  }
@@ -9136,7 +9145,7 @@ window.__ModuleLoader__.load({
9136
9145
  * 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
9137
9146
  */
9138
9147
  const NS_GLM_CODING_PLAN = "dsh-glm-coding-plan";
9139
- const zh$11 = {
9148
+ const zh$12 = {
9140
9149
  ...accountPoolZh,
9141
9150
  title: "GLM(ZCode 账号)",
9142
9151
  pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。",
@@ -9230,7 +9239,7 @@ window.__ModuleLoader__.load({
9230
9239
  quotaAllowanceUnknown: "未判定",
9231
9240
  quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」指新用户注册后自动获得、首次使用起 5 天内每天 800 万 token 的体验额度。"
9232
9241
  };
9233
- const en$11 = {
9242
+ const en$12 = {
9234
9243
  ...accountPoolEn,
9235
9244
  title: "GLM (ZCode account)",
9236
9245
  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.",
@@ -9324,11 +9333,11 @@ window.__ModuleLoader__.load({
9324
9333
  quotaAllowanceUnknown: "Undetermined",
9325
9334
  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."
9326
9335
  };
9327
- const dictionaries$11 = {
9328
- zh: zh$11,
9329
- "zh-CN": zh$11,
9330
- en: en$11,
9331
- "en-US": en$11
9336
+ const dictionaries$12 = {
9337
+ zh: zh$12,
9338
+ "zh-CN": zh$12,
9339
+ en: en$12,
9340
+ "en-US": en$12
9332
9341
  };
9333
9342
  /** 一个配额窗口的键到「窗口长度(分钟)」的映射。 */
9334
9343
  const QUOTA_WINDOW_MINUTES$1 = {
@@ -9387,10 +9396,10 @@ window.__ModuleLoader__.load({
9387
9396
  * 除 adopt 与 connection/test 外,全部走共享的 { ok, value } 信封,
9388
9397
  * 因此答案都是裸 DTO——createLineApi 已经把信封拆掉了。
9389
9398
  */
9390
- const api$11 = createLineApi(GLM_CODING_PLAN_ROUTE_PREFIX, GLM_CODING_PLAN_PROVIDER_NAME);
9391
- const get$2 = api$11.get;
9392
- const post$4 = api$11.post;
9393
- function messageOf$2(cause) {
9399
+ const api$12 = createLineApi(GLM_CODING_PLAN_ROUTE_PREFIX, GLM_CODING_PLAN_PROVIDER_NAME);
9400
+ const get$3 = api$12.get;
9401
+ const post$5 = api$12.post;
9402
+ function messageOf$3(cause) {
9394
9403
  return cause instanceof Error ? cause.message : String(cause);
9395
9404
  }
9396
9405
  //#endregion
@@ -9409,7 +9418,7 @@ window.__ModuleLoader__.load({
9409
9418
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
9410
9419
  const LOGIN_POLL_INTERVAL_MS$2 = 2e3;
9411
9420
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
9412
- const fallbackTranslate$6 = (key) => zh$11[key];
9421
+ const fallbackTranslate$6 = (key) => zh$12[key];
9413
9422
  /**
9414
9423
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
9415
9424
  *
@@ -9490,7 +9499,7 @@ window.__ModuleLoader__.load({
9490
9499
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
9491
9500
  if (!quiet) setError(null);
9492
9501
  try {
9493
- const next = await get$2("/status");
9502
+ const next = await get$3("/status");
9494
9503
  setStatus(next);
9495
9504
  setContextDrafts(contextDraftsFor(next));
9496
9505
  if (!regionTouched.current) setRegionState(next.region);
@@ -9499,7 +9508,7 @@ window.__ModuleLoader__.load({
9499
9508
  loadStatus(true);
9500
9509
  });
9501
9510
  } catch (cause) {
9502
- if (!quiet) setError(messageOf$2(cause));
9511
+ if (!quiet) setError(messageOf$3(cause));
9503
9512
  } finally {
9504
9513
  setLoading(false);
9505
9514
  }
@@ -9524,7 +9533,7 @@ window.__ModuleLoader__.load({
9524
9533
  const timer = window.setInterval(() => {
9525
9534
  (async () => {
9526
9535
  try {
9527
- const poll = await get$2("/login/status");
9536
+ const poll = await get$3("/login/status");
9528
9537
  if (stopped) return;
9529
9538
  if (poll.status === "complete") {
9530
9539
  setPasteValue("");
@@ -9557,13 +9566,13 @@ window.__ModuleLoader__.load({
9557
9566
  setError(null);
9558
9567
  setConnection(null);
9559
9568
  setPasteValue("");
9560
- const flow = await post$4("/login/start", { region: loginRegion });
9569
+ const flow = await post$5("/login/start", { region: loginRegion });
9561
9570
  await loadStatus(true);
9562
9571
  if (flow.authorizeUrl !== void 0 && flow.authorizeUrl !== "") try {
9563
9572
  window.open(flow.authorizeUrl, "_blank", "noopener,noreferrer");
9564
9573
  } catch {}
9565
9574
  } catch (cause) {
9566
- setError(messageOf$2(cause));
9575
+ setError(messageOf$3(cause));
9567
9576
  } finally {
9568
9577
  setBusy(null);
9569
9578
  }
@@ -9572,10 +9581,10 @@ window.__ModuleLoader__.load({
9572
9581
  try {
9573
9582
  setBusy("login:cancel");
9574
9583
  setError(null);
9575
- await post$4("/login/cancel", { region });
9584
+ await post$5("/login/cancel", { region });
9576
9585
  await loadStatus(true);
9577
9586
  } catch (cause) {
9578
- setError(messageOf$2(cause));
9587
+ setError(messageOf$3(cause));
9579
9588
  } finally {
9580
9589
  setBusy(null);
9581
9590
  }
@@ -9588,14 +9597,14 @@ window.__ModuleLoader__.load({
9588
9597
  try {
9589
9598
  setBusy("login-manual");
9590
9599
  setError(null);
9591
- setStatus(await post$4("/login/manual", {
9600
+ setStatus(await post$5("/login/manual", {
9592
9601
  region,
9593
9602
  code: pasteValue.trim()
9594
9603
  }));
9595
9604
  setPasteValue("");
9596
9605
  onModelChange?.();
9597
9606
  } catch (cause) {
9598
- setError(messageOf$2(cause));
9607
+ setError(messageOf$3(cause));
9599
9608
  } finally {
9600
9609
  setBusy(null);
9601
9610
  }
@@ -9604,12 +9613,12 @@ window.__ModuleLoader__.load({
9604
9613
  try {
9605
9614
  setBusy("adopt");
9606
9615
  setError(null);
9607
- const result = await post$4("/adopt", { region });
9616
+ const result = await post$5("/adopt", { region });
9608
9617
  setAdoptResult(result);
9609
9618
  await loadStatus(true);
9610
9619
  if (result.adopted) onModelChange?.();
9611
9620
  } catch (cause) {
9612
- setError(messageOf$2(cause));
9621
+ setError(messageOf$3(cause));
9613
9622
  } finally {
9614
9623
  setBusy(null);
9615
9624
  }
@@ -9618,13 +9627,13 @@ window.__ModuleLoader__.load({
9618
9627
  try {
9619
9628
  setBusy(`account:${action}:${accountId}`);
9620
9629
  setError(null);
9621
- setStatus(await post$4("/accounts", {
9630
+ setStatus(await post$5("/accounts", {
9622
9631
  action,
9623
9632
  accountId
9624
9633
  }));
9625
9634
  onModelChange?.();
9626
9635
  } catch (cause) {
9627
- setError(messageOf$2(cause));
9636
+ setError(messageOf$3(cause));
9628
9637
  } finally {
9629
9638
  setBusy(null);
9630
9639
  }
@@ -9633,12 +9642,12 @@ window.__ModuleLoader__.load({
9633
9642
  try {
9634
9643
  setBusy("strategy");
9635
9644
  setError(null);
9636
- setStatus(await post$4("/accounts", {
9645
+ setStatus(await post$5("/accounts", {
9637
9646
  action: "strategy",
9638
9647
  strategy
9639
9648
  }));
9640
9649
  } catch (cause) {
9641
- setError(messageOf$2(cause));
9650
+ setError(messageOf$3(cause));
9642
9651
  } finally {
9643
9652
  setBusy(null);
9644
9653
  }
@@ -9647,12 +9656,12 @@ window.__ModuleLoader__.load({
9647
9656
  const applyEnabledModels = async (enabledModelIds) => {
9648
9657
  try {
9649
9658
  setError(null);
9650
- const updated = await post$4("/settings", { enabledModelIds });
9659
+ const updated = await post$5("/settings", { enabledModelIds });
9651
9660
  setStatus(updated);
9652
9661
  setContextDrafts(contextDraftsFor(updated));
9653
9662
  onModelChange?.();
9654
9663
  } catch (cause) {
9655
- setError(messageOf$2(cause));
9664
+ setError(messageOf$3(cause));
9656
9665
  }
9657
9666
  };
9658
9667
  const toggleModel = (modelId, enabled) => {
@@ -9675,14 +9684,14 @@ window.__ModuleLoader__.load({
9675
9684
  try {
9676
9685
  setSavingModel(modelId);
9677
9686
  setError(null);
9678
- setStatus(await post$4("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
9687
+ setStatus(await post$5("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
9679
9688
  setContextDrafts((previous) => ({
9680
9689
  ...previous,
9681
9690
  [modelId]: formatCapacity$1(parsed)
9682
9691
  }));
9683
9692
  onModelChange?.();
9684
9693
  } catch (cause) {
9685
- setError(messageOf$2(cause));
9694
+ setError(messageOf$3(cause));
9686
9695
  } finally {
9687
9696
  setSavingModel(null);
9688
9697
  }
@@ -9691,7 +9700,7 @@ window.__ModuleLoader__.load({
9691
9700
  try {
9692
9701
  setSavingModel(modelId);
9693
9702
  setError(null);
9694
- const updated = await post$4("/settings", { contextWindowOverrides: { [modelId]: null } });
9703
+ const updated = await post$5("/settings", { contextWindowOverrides: { [modelId]: null } });
9695
9704
  setStatus(updated);
9696
9705
  const model = updated.models.find((entry) => entry.id === modelId);
9697
9706
  if (model !== void 0) setContextDrafts((previous) => ({
@@ -9700,7 +9709,7 @@ window.__ModuleLoader__.load({
9700
9709
  }));
9701
9710
  onModelChange?.();
9702
9711
  } catch (cause) {
9703
- setError(messageOf$2(cause));
9712
+ setError(messageOf$3(cause));
9704
9713
  } finally {
9705
9714
  setSavingModel(null);
9706
9715
  }
@@ -9710,21 +9719,21 @@ window.__ModuleLoader__.load({
9710
9719
  if (ids.length === 0) return;
9711
9720
  try {
9712
9721
  setError(null);
9713
- const updated = await post$4("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
9722
+ const updated = await post$5("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
9714
9723
  setStatus(updated);
9715
9724
  setContextDrafts(contextDraftsFor(updated));
9716
9725
  onModelChange?.();
9717
9726
  } catch (cause) {
9718
- setError(messageOf$2(cause));
9727
+ setError(messageOf$3(cause));
9719
9728
  }
9720
9729
  };
9721
9730
  const refreshQuota = async () => {
9722
9731
  try {
9723
9732
  setBusy("quota");
9724
9733
  setError(null);
9725
- setStatus(await post$4("/quota", {}));
9734
+ setStatus(await post$5("/quota", {}));
9726
9735
  } catch (cause) {
9727
- setError(messageOf$2(cause));
9736
+ setError(messageOf$3(cause));
9728
9737
  } finally {
9729
9738
  setBusy(null);
9730
9739
  }
@@ -9733,9 +9742,9 @@ window.__ModuleLoader__.load({
9733
9742
  try {
9734
9743
  setBusy("catalog");
9735
9744
  setError(null);
9736
- setStatus(await post$4("/catalog/refresh", {}));
9745
+ setStatus(await post$5("/catalog/refresh", {}));
9737
9746
  } catch (cause) {
9738
- setError(messageOf$2(cause));
9747
+ setError(messageOf$3(cause));
9739
9748
  } finally {
9740
9749
  setBusy(null);
9741
9750
  }
@@ -9744,9 +9753,9 @@ window.__ModuleLoader__.load({
9744
9753
  try {
9745
9754
  setBusy("connection");
9746
9755
  setError(null);
9747
- setConnection(await post$4("/connection/test", {}));
9756
+ setConnection(await post$5("/connection/test", {}));
9748
9757
  } catch (cause) {
9749
- setError(messageOf$2(cause));
9758
+ setError(messageOf$3(cause));
9750
9759
  } finally {
9751
9760
  setBusy(null);
9752
9761
  }
@@ -9835,7 +9844,7 @@ window.__ModuleLoader__.load({
9835
9844
  const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
9836
9845
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels } = derived;
9837
9846
  const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, refreshQuota, refreshCatalog, testConnection } = actions;
9838
- const t = useLineDict(NS_GLM_CODING_PLAN, zh$11);
9847
+ const t = useLineDict(NS_GLM_CODING_PLAN, zh$12);
9839
9848
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9840
9849
  className: "dsha-page",
9841
9850
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -10301,7 +10310,7 @@ window.__ModuleLoader__.load({
10301
10310
  * provider — the same reason every sibling line has one.
10302
10311
  */
10303
10312
  const NS_CLAUDE = "dsh-claude";
10304
- const zh$10 = {
10313
+ const zh$11 = {
10305
10314
  ...accountPoolZh,
10306
10315
  title: "Claude(订阅)",
10307
10316
  pageDesc: "登录 Claude Pro/Max 订阅,管理模型、思考档位、上下文窗口与额度。",
@@ -10418,7 +10427,7 @@ window.__ModuleLoader__.load({
10418
10427
  copy: "复制",
10419
10428
  copied: "已复制"
10420
10429
  };
10421
- const en$10 = {
10430
+ const en$11 = {
10422
10431
  ...accountPoolEn,
10423
10432
  title: "Claude (subscription)",
10424
10433
  pageDesc: "Sign in to a Claude Pro/Max subscription and manage models, thinking levels, context windows and quota.",
@@ -10535,11 +10544,11 @@ window.__ModuleLoader__.load({
10535
10544
  copy: "Copy",
10536
10545
  copied: "Copied"
10537
10546
  };
10538
- const dictionaries$10 = {
10539
- zh: zh$10,
10540
- "zh-CN": zh$10,
10541
- en: en$10,
10542
- "en-US": en$10
10547
+ const dictionaries$11 = {
10548
+ zh: zh$11,
10549
+ "zh-CN": zh$11,
10550
+ en: en$11,
10551
+ "en-US": en$11
10543
10552
  };
10544
10553
  //#endregion
10545
10554
  //#region src/client/claude/useClaudeSection.ts
@@ -10552,7 +10561,7 @@ window.__ModuleLoader__.load({
10552
10561
  * `ClaudeSectionView` — so the contract between the two is visible here rather
10553
10562
  * than inferred from a thousand lines of JSX.
10554
10563
  */
10555
- const api$10 = createLineApi("/claude/api", "Claude");
10564
+ const api$11 = createLineApi("/claude/api", "Claude");
10556
10565
  /**
10557
10566
  * The poll cadence of a pending sign-in.
10558
10567
  *
@@ -10573,7 +10582,7 @@ window.__ModuleLoader__.load({
10573
10582
  const [connection, setConnection] = (0, react.useState)(null);
10574
10583
  /** Follow-up poll owed while the host refreshes the quota behind an answer. */
10575
10584
  const quotaFollowUp = (0, react.useRef)(null);
10576
- const t = useLineDict(NS_CLAUDE, zh$10);
10585
+ const t = useLineDict(NS_CLAUDE, zh$11);
10577
10586
  const notifyChange = (0, react.useCallback)(() => {
10578
10587
  onModelChange?.();
10579
10588
  loadModelDirectory?.();
@@ -10585,7 +10594,7 @@ window.__ModuleLoader__.load({
10585
10594
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
10586
10595
  if (!quiet) setError(null);
10587
10596
  try {
10588
- const data = await api$10.request("/status");
10597
+ const data = await api$11.request("/status");
10589
10598
  setStatus(data);
10590
10599
  setContextDrafts(contextDraftsFor(data));
10591
10600
  quotaFollowUp.current ??= createQuotaFollowUp();
@@ -10616,7 +10625,7 @@ window.__ModuleLoader__.load({
10616
10625
  const timer = window.setInterval(() => {
10617
10626
  (async () => {
10618
10627
  try {
10619
- const poll = await api$10.request("/login/status");
10628
+ const poll = await api$11.request("/login/status");
10620
10629
  setFlow(poll);
10621
10630
  if (poll.status === "complete") {
10622
10631
  setPasteValue("");
@@ -10638,7 +10647,7 @@ window.__ModuleLoader__.load({
10638
10647
  setBusy("login");
10639
10648
  setError(null);
10640
10649
  setPasteValue("");
10641
- const next = await api$10.request("/login", {
10650
+ const next = await api$11.request("/login", {
10642
10651
  method: "POST",
10643
10652
  body: JSON.stringify({})
10644
10653
  });
@@ -10652,7 +10661,7 @@ window.__ModuleLoader__.load({
10652
10661
  };
10653
10662
  const cancelLogin = async () => {
10654
10663
  try {
10655
- const next = await api$10.request("/login/cancel", { method: "POST" });
10664
+ const next = await api$11.request("/login/cancel", { method: "POST" });
10656
10665
  setFlow(next);
10657
10666
  } catch (err) {
10658
10667
  reportError(err);
@@ -10664,7 +10673,7 @@ window.__ModuleLoader__.load({
10664
10673
  try {
10665
10674
  setBusy("login-input");
10666
10675
  setError(null);
10667
- const updated = await api$10.request("/login/input", {
10676
+ const updated = await api$11.request("/login/input", {
10668
10677
  method: "POST",
10669
10678
  body: JSON.stringify({ input: pasteValue })
10670
10679
  });
@@ -10688,7 +10697,7 @@ window.__ModuleLoader__.load({
10688
10697
  try {
10689
10698
  setBusy("adopt");
10690
10699
  setError(null);
10691
- const updated = await api$10.request("/adopt", { method: "POST" });
10700
+ const updated = await api$11.request("/adopt", { method: "POST" });
10692
10701
  setStatus(updated);
10693
10702
  setContextDrafts(contextDraftsFor(updated));
10694
10703
  notifyChange();
@@ -10703,7 +10712,7 @@ window.__ModuleLoader__.load({
10703
10712
  try {
10704
10713
  setBusy(accountId === void 0 ? "adopt-disable" : `adopt-disable-${accountId}`);
10705
10714
  setError(null);
10706
- const updated = await api$10.request("/adopt/disable", {
10715
+ const updated = await api$11.request("/adopt/disable", {
10707
10716
  method: "POST",
10708
10717
  body: JSON.stringify(accountId === void 0 ? {} : { accountId })
10709
10718
  });
@@ -10720,7 +10729,7 @@ window.__ModuleLoader__.load({
10720
10729
  try {
10721
10730
  setBusy(`${action}-${accountId}`);
10722
10731
  setError(null);
10723
- const updated = await api$10.request("/accounts", {
10732
+ const updated = await api$11.request("/accounts", {
10724
10733
  method: "POST",
10725
10734
  body: JSON.stringify({
10726
10735
  action,
@@ -10739,7 +10748,7 @@ window.__ModuleLoader__.load({
10739
10748
  try {
10740
10749
  setBusy("strategy");
10741
10750
  setError(null);
10742
- const updated = await api$10.request("/accounts", {
10751
+ const updated = await api$11.request("/accounts", {
10743
10752
  method: "POST",
10744
10753
  body: JSON.stringify({
10745
10754
  action: "strategy",
@@ -10766,7 +10775,7 @@ window.__ModuleLoader__.load({
10766
10775
  setBusy(`relogin-${accountId}`);
10767
10776
  setError(null);
10768
10777
  setPasteValue("");
10769
- const next = await api$10.request("/login", {
10778
+ const next = await api$11.request("/login", {
10770
10779
  method: "POST",
10771
10780
  body: JSON.stringify({ accountId })
10772
10781
  });
@@ -10783,7 +10792,7 @@ window.__ModuleLoader__.load({
10783
10792
  try {
10784
10793
  setBusy("quota");
10785
10794
  setError(null);
10786
- const updated = await api$10.request("/quota", { method: "POST" });
10795
+ const updated = await api$11.request("/quota", { method: "POST" });
10787
10796
  setStatus(updated);
10788
10797
  } catch (err) {
10789
10798
  reportError(err);
@@ -10796,7 +10805,7 @@ window.__ModuleLoader__.load({
10796
10805
  try {
10797
10806
  setBusy("catalog");
10798
10807
  setError(null);
10799
- const updated = await api$10.request("/catalog/refresh", { method: "POST" });
10808
+ const updated = await api$11.request("/catalog/refresh", { method: "POST" });
10800
10809
  setStatus(updated);
10801
10810
  setContextDrafts(contextDraftsFor(updated));
10802
10811
  notifyChange();
@@ -10811,7 +10820,7 @@ window.__ModuleLoader__.load({
10811
10820
  setBusy("connection");
10812
10821
  setError(null);
10813
10822
  setConnection(null);
10814
- const result = await api$10.request("/connection/test", { method: "POST" });
10823
+ const result = await api$11.request("/connection/test", { method: "POST" });
10815
10824
  setConnection(result);
10816
10825
  await loadStatus(true);
10817
10826
  } catch (err) {
@@ -10822,7 +10831,7 @@ window.__ModuleLoader__.load({
10822
10831
  };
10823
10832
  const applyEnabled = async (enabledModelIds) => {
10824
10833
  try {
10825
- const updated = await api$10.request("/models", {
10834
+ const updated = await api$11.request("/models", {
10826
10835
  method: "POST",
10827
10836
  body: JSON.stringify({ enabledModelIds })
10828
10837
  });
@@ -10845,7 +10854,7 @@ window.__ModuleLoader__.load({
10845
10854
  };
10846
10855
  const updateEffort = async (effort) => {
10847
10856
  try {
10848
- const updated = await api$10.request("/settings", {
10857
+ const updated = await api$11.request("/settings", {
10849
10858
  method: "POST",
10850
10859
  body: JSON.stringify({ defaultReasoningEffort: effort })
10851
10860
  });
@@ -10857,7 +10866,7 @@ window.__ModuleLoader__.load({
10857
10866
  };
10858
10867
  const updateCacheTtl = async (ttl) => {
10859
10868
  try {
10860
- const updated = await api$10.request("/settings", {
10869
+ const updated = await api$11.request("/settings", {
10861
10870
  method: "POST",
10862
10871
  body: JSON.stringify({ cacheTtl: ttl })
10863
10872
  });
@@ -10877,7 +10886,7 @@ window.__ModuleLoader__.load({
10877
10886
  try {
10878
10887
  setSavingModel(modelId);
10879
10888
  setError(null);
10880
- const updated = await api$10.request("/settings", {
10889
+ const updated = await api$11.request("/settings", {
10881
10890
  method: "POST",
10882
10891
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
10883
10892
  });
@@ -10904,7 +10913,7 @@ window.__ModuleLoader__.load({
10904
10913
  try {
10905
10914
  setSavingModel(modelId);
10906
10915
  setError(null);
10907
- const updated = await api$10.request("/settings", {
10916
+ const updated = await api$11.request("/settings", {
10908
10917
  method: "POST",
10909
10918
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
10910
10919
  });
@@ -10931,7 +10940,7 @@ window.__ModuleLoader__.load({
10931
10940
  try {
10932
10941
  setBusy("context");
10933
10942
  setError(null);
10934
- const updated = await api$10.request("/settings", {
10943
+ const updated = await api$11.request("/settings", {
10935
10944
  method: "POST",
10936
10945
  body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
10937
10946
  });
@@ -11020,11 +11029,11 @@ window.__ModuleLoader__.load({
11020
11029
  * out here would hide a choice the host would accept and a catalog may expose.
11021
11030
  */
11022
11031
  const EFFORT_LABELS$2 = {
11023
- low: zh$10.effortLow,
11024
- medium: zh$10.effortMedium,
11025
- high: zh$10.effortHigh,
11026
- xhigh: zh$10.effortXHigh,
11027
- max: zh$10.effortMax
11032
+ low: zh$11.effortLow,
11033
+ medium: zh$11.effortMedium,
11034
+ high: zh$11.effortHigh,
11035
+ xhigh: zh$11.effortXHigh,
11036
+ max: zh$11.effortMax
11028
11037
  };
11029
11038
  /** One-line capability summary shown as a model pill's hover title. */
11030
11039
  function modelFacts(model, t) {
@@ -11045,7 +11054,7 @@ window.__ModuleLoader__.load({
11045
11054
  const { status, loading, busy, error, flow, connection, pasteValue, contextDrafts, savingModel } = state;
11046
11055
  const { accounts, hasAdopted, contextModels, overrideCount, quota, windows, poolLabels } = derived;
11047
11056
  const { login, cancelLogin, submitPaste, adopt, stopImporting, accountAction, setStrategy, relogin, refreshQuota, refreshCatalog, testConnection, toggleModel, setAllModels, updateEffort, updateCacheTtl, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setPasteValue } = actions;
11048
- const t = useLineDict(NS_CLAUDE, zh$10);
11057
+ const t = useLineDict(NS_CLAUDE, zh$11);
11049
11058
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11050
11059
  className: "dsha-page",
11051
11060
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -11537,7 +11546,7 @@ window.__ModuleLoader__.load({
11537
11546
  */
11538
11547
  var OllamaApi = class {
11539
11548
  status() {
11540
- return request$1(`${API$9}/status`);
11549
+ return request$2(`${API$9}/status`);
11541
11550
  }
11542
11551
  /**
11543
11552
  * One pool action, returning the refreshed status.
@@ -11546,13 +11555,13 @@ window.__ModuleLoader__.load({
11546
11555
  * never has to guess what the pool looks like after a change.
11547
11556
  */
11548
11557
  accountAction(action, body = {}) {
11549
- return post$3(`${API$9}/accounts`, {
11558
+ return post$4(`${API$9}/accounts`, {
11550
11559
  action,
11551
11560
  ...body
11552
11561
  });
11553
11562
  }
11554
11563
  refreshCatalog() {
11555
- return post$3(`${API$9}/catalog/refresh`, {});
11564
+ return post$4(`${API$9}/catalog/refresh`, {});
11556
11565
  }
11557
11566
  /**
11558
11567
  * Store the default thinking level, answering with the refreshed status.
@@ -11567,7 +11576,7 @@ window.__ModuleLoader__.load({
11567
11576
  * explicitly rather than left out of the body.
11568
11577
  */
11569
11578
  setDefaultReasoningEffort(effort) {
11570
- return post$3(`${API$9}/settings`, { defaultReasoningEffort: effort }).then(() => this.status());
11579
+ return post$4(`${API$9}/settings`, { defaultReasoningEffort: effort }).then(() => this.status());
11571
11580
  }
11572
11581
  /**
11573
11582
  * Replace the enabled-model selection.
@@ -11577,17 +11586,17 @@ window.__ModuleLoader__.load({
11577
11586
  * selection before it could answer 'turn this one off'.
11578
11587
  */
11579
11588
  setEnabledModels(enabledModelIds) {
11580
- return post$3(`${API$9}/models`, { enabledModelIds });
11589
+ return post$4(`${API$9}/models`, { enabledModelIds });
11581
11590
  }
11582
11591
  };
11583
- async function post$3(url, body) {
11584
- return request$1(url, {
11592
+ async function post$4(url, body) {
11593
+ return request$2(url, {
11585
11594
  method: "POST",
11586
11595
  headers: { "Content-Type": "application/json" },
11587
11596
  body: JSON.stringify(body)
11588
11597
  });
11589
11598
  }
11590
- async function request$1(url, init) {
11599
+ async function request$2(url, init) {
11591
11600
  const response = await fetch(url, {
11592
11601
  ...init,
11593
11602
  credentials: "same-origin"
@@ -11637,7 +11646,7 @@ window.__ModuleLoader__.load({
11637
11646
  //#endregion
11638
11647
  //#region src/client/ollama/locales.ts
11639
11648
  const NS_OLLAMA = "dsh-ollama";
11640
- const zh$9 = {
11649
+ const zh$10 = {
11641
11650
  ...accountPoolZh,
11642
11651
  relogin: "更换 Key",
11643
11652
  needsRelogin: "Key 已失效",
@@ -11689,7 +11698,7 @@ window.__ModuleLoader__.load({
11689
11698
  usageNone: "尚无请求",
11690
11699
  usageHint: "按 Ollama 每次响应自带的 token 计数本地累加。"
11691
11700
  };
11692
- const en$9 = {
11701
+ const en$10 = {
11693
11702
  ...accountPoolEn,
11694
11703
  relogin: "Replace Key",
11695
11704
  needsRelogin: "Key rejected",
@@ -11741,11 +11750,11 @@ window.__ModuleLoader__.load({
11741
11750
  usageNone: "No requests yet",
11742
11751
  usageHint: "Summed locally from the token counts Ollama returns on each response."
11743
11752
  };
11744
- const dictionaries$9 = {
11745
- zh: zh$9,
11746
- "zh-CN": zh$9,
11747
- en: en$9,
11748
- "en-US": en$9
11753
+ const dictionaries$10 = {
11754
+ zh: zh$10,
11755
+ "zh-CN": zh$10,
11756
+ en: en$10,
11757
+ "en-US": en$10
11749
11758
  };
11750
11759
  //#endregion
11751
11760
  //#region src/client/ollama/OllamaSection.tsx
@@ -11871,7 +11880,7 @@ window.__ModuleLoader__.load({
11871
11880
  const setEffort = (0, react.useCallback)((value) => {
11872
11881
  run("effort", () => API$8.setDefaultReasoningEffort(value === "" ? null : value));
11873
11882
  }, [run]);
11874
- const t = useLineDict(NS_OLLAMA, zh$9);
11883
+ const t = useLineDict(NS_OLLAMA, zh$10);
11875
11884
  const pool = status?.pool;
11876
11885
  const models = status?.models ?? [];
11877
11886
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
@@ -11986,7 +11995,7 @@ window.__ModuleLoader__.load({
11986
11995
  className: "dsha-btn",
11987
11996
  disabled: busy !== null,
11988
11997
  onClick: () => setShowKeyForm(false),
11989
- children: zh$9.deleteAccount
11998
+ children: zh$10.deleteAccount
11990
11999
  })]
11991
12000
  })
11992
12001
  ]
@@ -12108,19 +12117,19 @@ window.__ModuleLoader__.load({
12108
12117
  */
12109
12118
  var AntigravityAcpApi = class {
12110
12119
  status() {
12111
- return request(`${API$7}/status`);
12120
+ return request$1(`${API$7}/status`);
12112
12121
  }
12113
12122
  /** Submit one settings patch and receive the refreshed status. */
12114
12123
  update(patch) {
12115
- return post$2(`${API$7}/settings`, patch);
12124
+ return post$3(`${API$7}/settings`, patch);
12116
12125
  }
12117
12126
  /** Force a live catalogue read. */
12118
12127
  refresh() {
12119
- return post$2(`${API$7}/refresh`, {});
12128
+ return post$3(`${API$7}/refresh`, {});
12120
12129
  }
12121
12130
  /** Run the line's self-check and return its one-line-per-stage report. */
12122
12131
  doctor() {
12123
- return post$2(`${API$7}/doctor`, {});
12132
+ return post$3(`${API$7}/doctor`, {});
12124
12133
  }
12125
12134
  /**
12126
12135
  * Start the official sign-in.
@@ -12130,21 +12139,21 @@ window.__ModuleLoader__.load({
12130
12139
  * producing two Google pages.
12131
12140
  */
12132
12141
  startLogin() {
12133
- return post$2(`${API$7}/login/start`, {});
12142
+ return post$3(`${API$7}/login/start`, {});
12134
12143
  }
12135
12144
  /** Re-read the auth state after a sign-in attempt. */
12136
12145
  loginStatus() {
12137
- return request(`${API$7}/login/status`);
12146
+ return request$1(`${API$7}/login/status`);
12138
12147
  }
12139
12148
  };
12140
- async function post$2(url, body) {
12141
- return request(url, {
12149
+ async function post$3(url, body) {
12150
+ return request$1(url, {
12142
12151
  method: "POST",
12143
12152
  headers: { "Content-Type": "application/json" },
12144
12153
  body: JSON.stringify(body)
12145
12154
  });
12146
12155
  }
12147
- async function request(url, init) {
12156
+ async function request$1(url, init) {
12148
12157
  const response = await fetch(url, {
12149
12158
  ...init,
12150
12159
  credentials: "same-origin"
@@ -12185,7 +12194,7 @@ window.__ModuleLoader__.load({
12185
12194
  //#endregion
12186
12195
  //#region src/client/antigravity-acp/locales.ts
12187
12196
  const NS_ANTIGRAVITY_ACP = "dsh-antigravity-acp";
12188
- const zh$8 = {
12197
+ const zh$9 = {
12189
12198
  title: "Antigravity(ACP)",
12190
12199
  pageDesc: "通过 Google 官方 Antigravity CLI 的 Agent Client Protocol(ACP)接入:模型、工具与会话全部由官方进程驱动,登录态由官方进程自己保管。",
12191
12200
  routeOwned: "模型路由由本插件提供",
@@ -12277,7 +12286,7 @@ window.__ModuleLoader__.load({
12277
12286
  enabledHint: "该线路当前已启用。",
12278
12287
  toggleHint: "可在「订阅服务」总览页的该线路卡片上随时停用。"
12279
12288
  };
12280
- const en$8 = {
12289
+ const en$9 = {
12281
12290
  title: "Antigravity (ACP)",
12282
12291
  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.",
12283
12292
  routeOwned: "Model route served by this plugin",
@@ -12369,11 +12378,11 @@ window.__ModuleLoader__.load({
12369
12378
  enabledHint: "This line is enabled.",
12370
12379
  toggleHint: "You can switch it off at any time from its card in the subscription overview."
12371
12380
  };
12372
- const dictionaries$8 = {
12373
- zh: zh$8,
12374
- "zh-CN": zh$8,
12375
- en: en$8,
12376
- "en-US": en$8
12381
+ const dictionaries$9 = {
12382
+ zh: zh$9,
12383
+ "zh-CN": zh$9,
12384
+ en: en$9,
12385
+ "en-US": en$9
12377
12386
  };
12378
12387
  //#endregion
12379
12388
  //#region src/client/antigravity-acp/AntigravityAcpSection.tsx
@@ -12430,7 +12439,7 @@ window.__ModuleLoader__.load({
12430
12439
  setBusy(null);
12431
12440
  }
12432
12441
  }, [props]);
12433
- const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$8);
12442
+ const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$9);
12434
12443
  const models = status?.models ?? [];
12435
12444
  const auth = status?.auth;
12436
12445
  const usage = status?.usage;
@@ -12921,7 +12930,7 @@ window.__ModuleLoader__.load({
12921
12930
  * 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
12922
12931
  */
12923
12932
  const NS_STEP_CODE = "dsh-step-code";
12924
- const zh$7 = {
12933
+ const zh$8 = {
12925
12934
  ...accountPoolZh,
12926
12935
  title: "Step Code(Step Plan 订阅)",
12927
12936
  pageDesc: "用 StepFun 的 Step Plan 订阅(国区 api.stepfun.com / 国际区 api.stepfun.ai)或开放平台 API Key 接入,管理账号池、套餐额度、缓存用量与模型勾选。区域是凭据的属性,两区凭据互不通用,因此号池里可以同时存在两区账号。",
@@ -13091,7 +13100,7 @@ window.__ModuleLoader__.load({
13091
13100
  cacheExpiredHint: "缓存可能已过期:距上次请求约 {minutes} 分钟,下次会重新处理前缀。",
13092
13101
  cacheHitRatioUnavailable: "—"
13093
13102
  };
13094
- const en$7 = {
13103
+ const en$8 = {
13095
13104
  ...accountPoolEn,
13096
13105
  title: "Step Code (Step Plan subscription)",
13097
13106
  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.",
@@ -13259,11 +13268,11 @@ window.__ModuleLoader__.load({
13259
13268
  cacheExpiredHint: "The cache has likely expired: about {minutes} minutes since the last request, so the next turn will reprocess the prefix.",
13260
13269
  cacheHitRatioUnavailable: "—"
13261
13270
  };
13262
- const dictionaries$7 = {
13263
- zh: zh$7,
13264
- "zh-CN": zh$7,
13265
- en: en$7,
13266
- "en-US": en$7
13271
+ const dictionaries$8 = {
13272
+ zh: zh$8,
13273
+ "zh-CN": zh$8,
13274
+ en: en$8,
13275
+ "en-US": en$8
13267
13276
  };
13268
13277
  /** 一个额度窗口的键到「窗口长度(分钟)」的映射。窗口名由共享组件按长度本地化。 */
13269
13278
  const QUOTA_WINDOW_MINUTES = {
@@ -13355,10 +13364,10 @@ window.__ModuleLoader__.load({
13355
13364
  * **仅有的两处**带秘密的形状,它们只在这两个函数调用点的字面量里出现,
13356
13365
  * 既不进 URL、也不进日志,卡片那边同样没有别的地方可以读到它们。
13357
13366
  */
13358
- const api$9 = createLineApi(STEP_CODE_ROUTE_PREFIX, STEP_CODE_PROVIDER_NAME);
13359
- const get$1 = api$9.get;
13360
- const post$1 = api$9.post;
13361
- function messageOf$1(cause) {
13367
+ const api$10 = createLineApi(STEP_CODE_ROUTE_PREFIX, STEP_CODE_PROVIDER_NAME);
13368
+ const get$2 = api$10.get;
13369
+ const post$2 = api$10.post;
13370
+ function messageOf$2(cause) {
13362
13371
  return cause instanceof Error ? cause.message : String(cause);
13363
13372
  }
13364
13373
  //#endregion
@@ -13381,7 +13390,7 @@ window.__ModuleLoader__.load({
13381
13390
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
13382
13391
  const LOGIN_POLL_INTERVAL_MS$1 = 2e3;
13383
13392
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
13384
- const fallbackTranslate$5 = (key) => zh$7[key];
13393
+ const fallbackTranslate$5 = (key) => zh$8[key];
13385
13394
  /**
13386
13395
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
13387
13396
  *
@@ -13530,7 +13539,7 @@ window.__ModuleLoader__.load({
13530
13539
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
13531
13540
  if (!quiet) setError(null);
13532
13541
  try {
13533
- const next = await get$1("/status");
13542
+ const next = await get$2("/status");
13534
13543
  setStatus(next);
13535
13544
  setContextDrafts(contextDraftsFor(next));
13536
13545
  if (!profileTouched.current && isStepCodeProfile(next.profile)) setProfileState(next.profile);
@@ -13539,7 +13548,7 @@ window.__ModuleLoader__.load({
13539
13548
  loadStatus(true);
13540
13549
  });
13541
13550
  } catch (cause) {
13542
- if (!quiet) setError(messageOf$1(cause));
13551
+ if (!quiet) setError(messageOf$2(cause));
13543
13552
  } finally {
13544
13553
  setLoading(false);
13545
13554
  }
@@ -13564,7 +13573,7 @@ window.__ModuleLoader__.load({
13564
13573
  const timer = window.setInterval(() => {
13565
13574
  (async () => {
13566
13575
  try {
13567
- const poll = await get$1("/login/status");
13576
+ const poll = await get$2("/login/status");
13568
13577
  if (stopped) return;
13569
13578
  if (poll.status === "complete") {
13570
13579
  setPasteValue("");
@@ -13597,13 +13606,13 @@ window.__ModuleLoader__.load({
13597
13606
  setError(null);
13598
13607
  setConnection(null);
13599
13608
  setPasteValue("");
13600
- const flow = await post$1("/login/start", { profile: loginProfile });
13609
+ const flow = await post$2("/login/start", { profile: loginProfile });
13601
13610
  await loadStatus(true);
13602
13611
  if (flow.authorizeUrl !== void 0 && flow.authorizeUrl !== "") try {
13603
13612
  window.open(flow.authorizeUrl, "_blank", "noopener,noreferrer");
13604
13613
  } catch {}
13605
13614
  } catch (cause) {
13606
- setError(messageOf$1(cause));
13615
+ setError(messageOf$2(cause));
13607
13616
  } finally {
13608
13617
  setBusy(null);
13609
13618
  }
@@ -13612,10 +13621,10 @@ window.__ModuleLoader__.load({
13612
13621
  try {
13613
13622
  setBusy("login:cancel");
13614
13623
  setError(null);
13615
- await post$1("/login/cancel", {});
13624
+ await post$2("/login/cancel", {});
13616
13625
  await loadStatus(true);
13617
13626
  } catch (cause) {
13618
- setError(messageOf$1(cause));
13627
+ setError(messageOf$2(cause));
13619
13628
  } finally {
13620
13629
  setBusy(null);
13621
13630
  }
@@ -13629,14 +13638,14 @@ window.__ModuleLoader__.load({
13629
13638
  try {
13630
13639
  setBusy("login-manual");
13631
13640
  setError(null);
13632
- setStatus(await post$1("/login/manual", {
13641
+ setStatus(await post$2("/login/manual", {
13633
13642
  profile,
13634
13643
  apiKey
13635
13644
  }));
13636
13645
  setPasteValue("");
13637
13646
  onModelChange?.();
13638
13647
  } catch (cause) {
13639
- setError(messageOf$1(cause));
13648
+ setError(messageOf$2(cause));
13640
13649
  } finally {
13641
13650
  setPasteValue("");
13642
13651
  setBusy(null);
@@ -13646,12 +13655,12 @@ window.__ModuleLoader__.load({
13646
13655
  try {
13647
13656
  setBusy("adopt");
13648
13657
  setError(null);
13649
- const result = await post$1("/adopt", {});
13658
+ const result = await post$2("/adopt", {});
13650
13659
  setAdoptResult(result);
13651
13660
  await loadStatus(true);
13652
13661
  if (result.adopted) onModelChange?.();
13653
13662
  } catch (cause) {
13654
- setError(messageOf$1(cause));
13663
+ setError(messageOf$2(cause));
13655
13664
  } finally {
13656
13665
  setBusy(null);
13657
13666
  }
@@ -13660,13 +13669,13 @@ window.__ModuleLoader__.load({
13660
13669
  try {
13661
13670
  setBusy(`account:${action}:${accountId}`);
13662
13671
  setError(null);
13663
- setStatus(await post$1("/accounts", {
13672
+ setStatus(await post$2("/accounts", {
13664
13673
  action,
13665
13674
  accountId
13666
13675
  }));
13667
13676
  onModelChange?.();
13668
13677
  } catch (cause) {
13669
- setError(messageOf$1(cause));
13678
+ setError(messageOf$2(cause));
13670
13679
  } finally {
13671
13680
  setBusy(null);
13672
13681
  }
@@ -13675,12 +13684,12 @@ window.__ModuleLoader__.load({
13675
13684
  try {
13676
13685
  setBusy("strategy");
13677
13686
  setError(null);
13678
- setStatus(await post$1("/accounts", {
13687
+ setStatus(await post$2("/accounts", {
13679
13688
  action: "strategy",
13680
13689
  strategy
13681
13690
  }));
13682
13691
  } catch (cause) {
13683
- setError(messageOf$1(cause));
13692
+ setError(messageOf$2(cause));
13684
13693
  } finally {
13685
13694
  setBusy(null);
13686
13695
  }
@@ -13695,12 +13704,12 @@ window.__ModuleLoader__.load({
13695
13704
  const applyEnabledModels = async (enabledModelIds) => {
13696
13705
  try {
13697
13706
  setError(null);
13698
- const updated = await post$1("/settings", { enabledModelIds });
13707
+ const updated = await post$2("/settings", { enabledModelIds });
13699
13708
  setStatus(updated);
13700
13709
  setContextDrafts(contextDraftsFor(updated));
13701
13710
  onModelChange?.();
13702
13711
  } catch (cause) {
13703
- setError(messageOf$1(cause));
13712
+ setError(messageOf$2(cause));
13704
13713
  }
13705
13714
  };
13706
13715
  const toggleModel = (modelId, enabled) => {
@@ -13723,14 +13732,14 @@ window.__ModuleLoader__.load({
13723
13732
  try {
13724
13733
  setSavingModel(modelId);
13725
13734
  setError(null);
13726
- setStatus(await post$1("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
13735
+ setStatus(await post$2("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
13727
13736
  setContextDrafts((previous) => ({
13728
13737
  ...previous,
13729
13738
  [modelId]: formatCapacity$1(parsed)
13730
13739
  }));
13731
13740
  onModelChange?.();
13732
13741
  } catch (cause) {
13733
- setError(messageOf$1(cause));
13742
+ setError(messageOf$2(cause));
13734
13743
  } finally {
13735
13744
  setSavingModel(null);
13736
13745
  }
@@ -13739,7 +13748,7 @@ window.__ModuleLoader__.load({
13739
13748
  try {
13740
13749
  setSavingModel(modelId);
13741
13750
  setError(null);
13742
- const updated = await post$1("/settings", { contextWindowOverrides: { [modelId]: null } });
13751
+ const updated = await post$2("/settings", { contextWindowOverrides: { [modelId]: null } });
13743
13752
  setStatus(updated);
13744
13753
  const model = updated.models.find((entry) => entry.id === modelId);
13745
13754
  if (model !== void 0) setContextDrafts((previous) => ({
@@ -13748,7 +13757,7 @@ window.__ModuleLoader__.load({
13748
13757
  }));
13749
13758
  onModelChange?.();
13750
13759
  } catch (cause) {
13751
- setError(messageOf$1(cause));
13760
+ setError(messageOf$2(cause));
13752
13761
  } finally {
13753
13762
  setSavingModel(null);
13754
13763
  }
@@ -13758,21 +13767,21 @@ window.__ModuleLoader__.load({
13758
13767
  if (ids.length === 0) return;
13759
13768
  try {
13760
13769
  setError(null);
13761
- const updated = await post$1("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
13770
+ const updated = await post$2("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
13762
13771
  setStatus(updated);
13763
13772
  setContextDrafts(contextDraftsFor(updated));
13764
13773
  onModelChange?.();
13765
13774
  } catch (cause) {
13766
- setError(messageOf$1(cause));
13775
+ setError(messageOf$2(cause));
13767
13776
  }
13768
13777
  };
13769
13778
  const setDefaultReasoningEffort = async (effort) => {
13770
13779
  try {
13771
13780
  setBusy("effort");
13772
13781
  setError(null);
13773
- setStatus(await post$1("/settings", { defaultReasoningEffort: effort }));
13782
+ setStatus(await post$2("/settings", { defaultReasoningEffort: effort }));
13774
13783
  } catch (cause) {
13775
- setError(messageOf$1(cause));
13784
+ setError(messageOf$2(cause));
13776
13785
  } finally {
13777
13786
  setBusy(null);
13778
13787
  }
@@ -13781,9 +13790,9 @@ window.__ModuleLoader__.load({
13781
13790
  try {
13782
13791
  setBusy("cache-params");
13783
13792
  setError(null);
13784
- setStatus(await post$1("/settings", { cacheRequestParams: enabled }));
13793
+ setStatus(await post$2("/settings", { cacheRequestParams: enabled }));
13785
13794
  } catch (cause) {
13786
- setError(messageOf$1(cause));
13795
+ setError(messageOf$2(cause));
13787
13796
  } finally {
13788
13797
  setBusy(null);
13789
13798
  }
@@ -13792,9 +13801,9 @@ window.__ModuleLoader__.load({
13792
13801
  try {
13793
13802
  setBusy("quota");
13794
13803
  setError(null);
13795
- setStatus(await post$1("/quota", {}));
13804
+ setStatus(await post$2("/quota", {}));
13796
13805
  } catch (cause) {
13797
- setError(messageOf$1(cause));
13806
+ setError(messageOf$2(cause));
13798
13807
  } finally {
13799
13808
  setBusy(null);
13800
13809
  }
@@ -13803,9 +13812,9 @@ window.__ModuleLoader__.load({
13803
13812
  try {
13804
13813
  setBusy("catalog");
13805
13814
  setError(null);
13806
- setStatus(await post$1("/catalog/refresh", {}));
13815
+ setStatus(await post$2("/catalog/refresh", {}));
13807
13816
  } catch (cause) {
13808
- setError(messageOf$1(cause));
13817
+ setError(messageOf$2(cause));
13809
13818
  } finally {
13810
13819
  setBusy(null);
13811
13820
  }
@@ -13814,9 +13823,9 @@ window.__ModuleLoader__.load({
13814
13823
  try {
13815
13824
  setBusy("connection");
13816
13825
  setError(null);
13817
- setConnection(await post$1("/connection/test", {}));
13826
+ setConnection(await post$2("/connection/test", {}));
13818
13827
  } catch (cause) {
13819
- setError(messageOf$1(cause));
13828
+ setError(messageOf$2(cause));
13820
13829
  } finally {
13821
13830
  setBusy(null);
13822
13831
  }
@@ -13848,7 +13857,7 @@ window.__ModuleLoader__.load({
13848
13857
  try {
13849
13858
  setBusy(`quota-credential:${mode}`);
13850
13859
  setError(null);
13851
- setStatus(await post$1("/quota/credential", mode === "password" ? {
13860
+ setStatus(await post$2("/quota/credential", mode === "password" ? {
13852
13861
  mode,
13853
13862
  account,
13854
13863
  password
@@ -13857,7 +13866,7 @@ window.__ModuleLoader__.load({
13857
13866
  token
13858
13867
  } : { mode }));
13859
13868
  } catch (cause) {
13860
- setError(messageOf$1(cause));
13869
+ setError(messageOf$2(cause));
13861
13870
  } finally {
13862
13871
  setQuotaPassword("");
13863
13872
  setQuotaToken("");
@@ -13965,7 +13974,7 @@ window.__ModuleLoader__.load({
13965
13974
  return stepCodeRegionOf(profile) === "cn" ? t.regionCn : t.regionIntl;
13966
13975
  }
13967
13976
  /** 百分比,最多一位小数;调用方已经排除了非有限值。 */
13968
- function percentText$1(ratio) {
13977
+ function percentText$2(ratio) {
13969
13978
  const value = Math.max(0, Math.min(1, ratio));
13970
13979
  try {
13971
13980
  return `${new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value * 100)}%`;
@@ -13978,7 +13987,7 @@ window.__ModuleLoader__.load({
13978
13987
  return usedPercent >= 95 ? "danger" : usedPercent >= 80 ? "warning" : "normal";
13979
13988
  }
13980
13989
  /** 千分位;Intl 不可用时退回原值,不让一个格式化失败变成一次渲染失败。 */
13981
- function tokenText$1(value) {
13990
+ function tokenText$2(value) {
13982
13991
  try {
13983
13992
  return new Intl.NumberFormat().format(value);
13984
13993
  } catch {
@@ -14042,7 +14051,7 @@ window.__ModuleLoader__.load({
14042
14051
  measured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14043
14052
  className: "dshsc-quota-track",
14044
14053
  role: "progressbar",
14045
- "aria-label": `${name}: ${percentText$1(used / 100)} ${t.quotaUsed}`,
14054
+ "aria-label": `${name}: ${percentText$2(used / 100)} ${t.quotaUsed}`,
14046
14055
  "aria-valuemin": 0,
14047
14056
  "aria-valuemax": 100,
14048
14057
  "aria-valuenow": used,
@@ -14053,7 +14062,7 @@ window.__ModuleLoader__.load({
14053
14062
  }),
14054
14063
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14055
14064
  className: "dshsc-quota-value",
14056
- children: measured ? percentText$1(used / 100) : t.quotaUsedUnknown
14065
+ children: measured ? percentText$2(used / 100) : t.quotaUsedUnknown
14057
14066
  }),
14058
14067
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14059
14068
  className: "dshsc-quota-meta",
@@ -14067,7 +14076,7 @@ window.__ModuleLoader__.load({
14067
14076
  const { status, loading, busy, error, connection, adoptResult, pasteValue, profile, pasteOpen, contextDrafts, savingModel, quotaAccount, quotaPassword, quotaToken } = state;
14068
14077
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio, quotaCredential } = derived;
14069
14078
  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;
14070
- const t = useLineDict(NS_STEP_CODE, zh$7);
14079
+ const t = useLineDict(NS_STEP_CODE, zh$8);
14071
14080
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
14072
14081
  className: "dsha-page",
14073
14082
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -14348,7 +14357,7 @@ window.__ModuleLoader__.load({
14348
14357
  children: [
14349
14358
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14350
14359
  className: "dsha-meter-label",
14351
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: hitRatio === null ? t.cacheHitRatioUnavailable : percentText$1(hitRatio) })]
14360
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: hitRatio === null ? t.cacheHitRatioUnavailable : percentText$2(hitRatio) })]
14352
14361
  }),
14353
14362
  hitRatio !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
14354
14363
  className: `dsha-meter ${hitRatio >= .9 ? "dsha-meter-green" : "dsha-meter-cyan"}`,
@@ -14360,17 +14369,17 @@ window.__ModuleLoader__.load({
14360
14369
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
14361
14370
  t.cacheReadTokens,
14362
14371
  ": ",
14363
- tokenText$1(cache.cacheReadTokens)
14372
+ tokenText$2(cache.cacheReadTokens)
14364
14373
  ] }),
14365
14374
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
14366
14375
  t.cacheMissedTokens,
14367
14376
  ": ",
14368
- tokenText$1(cache.missedInputTokens)
14377
+ tokenText$2(cache.missedInputTokens)
14369
14378
  ] }),
14370
14379
  cache.requests !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
14371
14380
  t.cacheRequests,
14372
14381
  ": ",
14373
- tokenText$1(cache.requests)
14382
+ tokenText$2(cache.requests)
14374
14383
  ] })
14375
14384
  ]
14376
14385
  })
@@ -14386,7 +14395,7 @@ window.__ModuleLoader__.load({
14386
14395
  children: [
14387
14396
  t.cacheWriteNoteValue,
14388
14397
  ": ",
14389
- tokenText$1(cache.cacheWriteTokens),
14398
+ tokenText$2(cache.cacheWriteTokens),
14390
14399
  " · ",
14391
14400
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
14392
14401
  className: "dshsc-mono",
@@ -14620,9 +14629,9 @@ window.__ModuleLoader__.load({
14620
14629
  children: [
14621
14630
  t.quotaBucketRemaining,
14622
14631
  ": ",
14623
- tokenText$1(bucket.remaining),
14632
+ tokenText$2(bucket.remaining),
14624
14633
  " / ",
14625
- tokenText$1(bucket.total)
14634
+ tokenText$2(bucket.total)
14626
14635
  ]
14627
14636
  }),
14628
14637
  bucket.expiresAt !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
@@ -14857,7 +14866,7 @@ window.__ModuleLoader__.load({
14857
14866
  }
14858
14867
  //#endregion
14859
14868
  //#region src/client/cline-pass/api.ts
14860
- const api$8 = createLineApi(CLINE_PASS_ROUTE_PREFIX, "Cline Pass");
14869
+ const api$9 = createLineApi(CLINE_PASS_ROUTE_PREFIX, "Cline Pass");
14861
14870
  /**
14862
14871
  * Whether the host is refreshing the quota behind this answer.
14863
14872
  *
@@ -14888,62 +14897,62 @@ window.__ModuleLoader__.load({
14888
14897
  * raw quota payload.
14889
14898
  */
14890
14899
  status(refresh = false) {
14891
- if (!refresh) return api$8.get("/status");
14892
- return api$8.post("/usage", {}).then((outcome) => outcome.status);
14900
+ if (!refresh) return api$9.get("/status");
14901
+ return api$9.post("/usage", {}).then((outcome) => outcome.status);
14893
14902
  }
14894
14903
  updateSettings(patch) {
14895
- return api$8.post("/settings", patch).then(() => this.status());
14904
+ return api$9.post("/settings", patch).then(() => this.status());
14896
14905
  }
14897
14906
  accountAction(action, body = {}) {
14898
- return api$8.post("/accounts", {
14907
+ return api$9.post("/accounts", {
14899
14908
  action,
14900
14909
  ...body
14901
14910
  });
14902
14911
  }
14903
14912
  /** Verify a key without storing it; the host answers the verdict directly. */
14904
14913
  testKey(body) {
14905
- return api$8.post("/accounts", {
14914
+ return api$9.post("/accounts", {
14906
14915
  action: "test",
14907
14916
  ...body
14908
14917
  });
14909
14918
  }
14910
14919
  /** Start the Cline device-code sign-in. */
14911
14920
  startLogin() {
14912
- return api$8.post("/login/start", {});
14921
+ return api$9.post("/login/start", {});
14913
14922
  }
14914
14923
  /** One poll of the pending sign-in; the host throttles it to WorkOS's interval. */
14915
14924
  loginStatus(id) {
14916
- return api$8.get(`/login/status?id=${encodeURIComponent(id)}`);
14925
+ return api$9.get(`/login/status?id=${encodeURIComponent(id)}`);
14917
14926
  }
14918
14927
  cancelLogin(id) {
14919
- return api$8.post("/login/cancel", { id });
14928
+ return api$9.post("/login/cancel", { id });
14920
14929
  }
14921
14930
  setEnabledModels(enabledModelIds) {
14922
- return api$8.post("/models", { enabledModelIds });
14931
+ return api$9.post("/models", { enabledModelIds });
14923
14932
  }
14924
14933
  setContextWindow(model, contextWindow) {
14925
- return api$8.post("/models/context-window", {
14934
+ return api$9.post("/models/context-window", {
14926
14935
  model,
14927
14936
  contextWindow
14928
14937
  });
14929
14938
  }
14930
14939
  test(model) {
14931
- return api$8.post("/models/test", { model });
14940
+ return api$9.post("/models/test", { model });
14932
14941
  }
14933
14942
  setVisibility(model, visible) {
14934
- return api$8.post("/models/visibility", {
14943
+ return api$9.post("/models/visibility", {
14935
14944
  model,
14936
14945
  visible
14937
14946
  });
14938
14947
  }
14939
14948
  setVisibilityAll(mode) {
14940
- return api$8.post("/models/visibility-all", { mode });
14949
+ return api$9.post("/models/visibility-all", { mode });
14941
14950
  }
14942
14951
  refreshCatalog() {
14943
- return api$8.post("/catalog/refresh", {});
14952
+ return api$9.post("/catalog/refresh", {});
14944
14953
  }
14945
14954
  searchCatalog(query) {
14946
- return api$8.get("/catalog/search?q=" + encodeURIComponent(query));
14955
+ return api$9.get("/catalog/search?q=" + encodeURIComponent(query));
14947
14956
  }
14948
14957
  /**
14949
14958
  * Add one search hit.
@@ -14952,26 +14961,26 @@ window.__ModuleLoader__.load({
14952
14961
  * refuses it until the caller acknowledges that (`acknowledgeBilling`).
14953
14962
  */
14954
14963
  addCatalogModel(model, acknowledgeBilling = false) {
14955
- return api$8.post("/catalog/add", acknowledgeBilling ? {
14964
+ return api$9.post("/catalog/add", acknowledgeBilling ? {
14956
14965
  model,
14957
14966
  acknowledgeBilling: true
14958
14967
  } : { model });
14959
14968
  }
14960
14969
  readUsage() {
14961
- return api$8.post("/usage", {});
14970
+ return api$9.post("/usage", {});
14962
14971
  }
14963
14972
  history(limit = 25, model = "") {
14964
14973
  const query = new URLSearchParams({
14965
14974
  limit: String(limit),
14966
14975
  ...model === "" ? {} : { model }
14967
14976
  });
14968
- return api$8.get("/history?" + query.toString());
14977
+ return api$9.get("/history?" + query.toString());
14969
14978
  }
14970
14979
  };
14971
14980
  //#endregion
14972
14981
  //#region src/client/cline-pass/locales.ts
14973
14982
  const NS_CLINE_PASS = "dsh-cline-pass";
14974
- const zh$6 = {
14983
+ const zh$7 = {
14975
14984
  ...accountPoolZh,
14976
14985
  relogin: "重新登录",
14977
14986
  needsRelogin: "登录已失效",
@@ -15095,7 +15104,7 @@ window.__ModuleLoader__.load({
15095
15104
  limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 cline-pass,本卡仍可配置,但请求由对方服务。",
15096
15105
  limitQuota: "额度窗口来自网关的 usage-limits 接口;接口失败时卡片保留上一次读数并显示原因。"
15097
15106
  };
15098
- const en$6 = {
15107
+ const en$7 = {
15099
15108
  ...accountPoolEn,
15100
15109
  relogin: "Sign in again",
15101
15110
  needsRelogin: "Sign-in expired",
@@ -15219,11 +15228,11 @@ window.__ModuleLoader__.load({
15219
15228
  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.",
15220
15229
  limitQuota: "Quota windows come from the gateway usage-limits endpoint; when it fails the card keeps the previous reading and says why."
15221
15230
  };
15222
- const dictionaries$6 = {
15223
- zh: zh$6,
15224
- "zh-CN": zh$6,
15225
- en: en$6,
15226
- "en-US": en$6
15231
+ const dictionaries$7 = {
15232
+ zh: zh$7,
15233
+ "zh-CN": zh$7,
15234
+ en: en$7,
15235
+ "en-US": en$7
15227
15236
  };
15228
15237
  //#endregion
15229
15238
  //#region src/client/cline-pass/ClinePassSection.tsx
@@ -15342,10 +15351,10 @@ window.__ModuleLoader__.load({
15342
15351
  API$5.loginStatus(flow.id).then((next) => {
15343
15352
  setLoginFlow(next);
15344
15353
  if (next.status === "complete") {
15345
- setNotice(zh$6.loginComplete.replace("{account}", next.accountAlias === "" ? "Cline Pass" : next.accountAlias));
15354
+ setNotice(zh$7.loginComplete.replace("{account}", next.accountAlias === "" ? "Cline Pass" : next.accountAlias));
15346
15355
  setShowKeyForm(false);
15347
15356
  loadStatus();
15348
- } else if (next.status === "failed") setError(zh$6.loginFailed.replace("{detail}", next.error));
15357
+ } else if (next.status === "failed") setError(zh$7.loginFailed.replace("{detail}", next.error));
15349
15358
  }).catch((cause) => setError(detail$1(cause)));
15350
15359
  }, Math.max(2, flow.intervalSeconds) * 1e3);
15351
15360
  return () => window.clearInterval(timer);
@@ -15419,7 +15428,7 @@ window.__ModuleLoader__.load({
15419
15428
  apiKey: trimmed,
15420
15429
  ...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
15421
15430
  }).then((result) => {
15422
- setNotice(result.authorized ? zh$6.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$6.keyTestFailed.replace("{detail}", result.error));
15431
+ setNotice(result.authorized ? zh$7.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$7.keyTestFailed.replace("{detail}", result.error));
15423
15432
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
15424
15433
  }, [key, keyBaseURL]);
15425
15434
  const testStored = (0, react.useCallback)((accountId) => {
@@ -15427,7 +15436,7 @@ window.__ModuleLoader__.load({
15427
15436
  setError(null);
15428
15437
  setNotice(null);
15429
15438
  API$5.testKey({ accountId }).then((result) => {
15430
- setNotice(result.authorized ? zh$6.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$6.keyTestFailed.replace("{detail}", result.error));
15439
+ setNotice(result.authorized ? zh$7.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$7.keyTestFailed.replace("{detail}", result.error));
15431
15440
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
15432
15441
  }, []);
15433
15442
  const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
@@ -15453,7 +15462,7 @@ window.__ModuleLoader__.load({
15453
15462
  if (model === void 0) return;
15454
15463
  const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
15455
15464
  if (parsed === null) {
15456
- setError(zh$6.error.replace("{detail}", zh$6.defaultContextWindow));
15465
+ setError(zh$7.error.replace("{detail}", zh$7.defaultContextWindow));
15457
15466
  return;
15458
15467
  }
15459
15468
  run("ctx:" + id, () => API$5.setContextWindow(id, parsed));
@@ -15475,7 +15484,7 @@ window.__ModuleLoader__.load({
15475
15484
  }, [run, status]);
15476
15485
  const resetAllContext = (0, react.useCallback)(() => {
15477
15486
  if (status === null) return;
15478
- if (typeof window !== "undefined" && !window.confirm(zh$6.contextResetAll)) return;
15487
+ if (typeof window !== "undefined" && !window.confirm(zh$7.contextResetAll)) return;
15479
15488
  const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
15480
15489
  run("ctx-all", async () => {
15481
15490
  let next = status;
@@ -15516,7 +15525,7 @@ window.__ModuleLoader__.load({
15516
15525
  const refreshUsage = (0, react.useCallback)(() => {
15517
15526
  run("usage", async () => {
15518
15527
  const outcome = await API$5.readUsage();
15519
- setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$6.usageEmpty);
15528
+ setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$7.usageEmpty);
15520
15529
  return outcome.status;
15521
15530
  });
15522
15531
  }, [run]);
@@ -15536,7 +15545,7 @@ window.__ModuleLoader__.load({
15536
15545
  };
15537
15546
  const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
15538
15547
  if (invalid !== void 0) {
15539
- setError(zh$6.error.replace("{detail}", invalid[0]));
15548
+ setError(zh$7.error.replace("{detail}", invalid[0]));
15540
15549
  return;
15541
15550
  }
15542
15551
  setBusy("settings");
@@ -15547,7 +15556,7 @@ window.__ModuleLoader__.load({
15547
15556
  }).then((next) => {
15548
15557
  applyStatus(next);
15549
15558
  setSettingsForm(settingsFormOf$1(next));
15550
- setNotice(zh$6.saved);
15559
+ setNotice(zh$7.saved);
15551
15560
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
15552
15561
  }, [settingsForm, applyStatus]);
15553
15562
  const toggleTools = (0, react.useCallback)(() => {
@@ -15558,10 +15567,10 @@ window.__ModuleLoader__.load({
15558
15567
  API$5.updateSettings({ exposeTools: value }).then((next) => {
15559
15568
  applyStatus(next);
15560
15569
  setSettingsForm(settingsFormOf$1(next));
15561
- setNotice(zh$6.restartRequired);
15570
+ setNotice(zh$7.restartRequired);
15562
15571
  }).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
15563
15572
  }, [status, applyStatus]);
15564
- const t = useLineDict(NS_CLINE_PASS, zh$6);
15573
+ const t = useLineDict(NS_CLINE_PASS, zh$7);
15565
15574
  const errorPrefix = t.error.split("{detail}")[0] ?? "";
15566
15575
  const pool = status?.pool;
15567
15576
  const accounts = (0, react.useMemo)(() => {
@@ -16336,7 +16345,7 @@ window.__ModuleLoader__.load({
16336
16345
  * 'settings.section' 上的那张座位(那张座绑定的是 ChatGPT 的键集)。
16337
16346
  */
16338
16347
  const NS_QODER = "dsh-qoder";
16339
- const zh$5 = {
16348
+ const zh$6 = {
16340
16349
  modelRowEfforts: "档位 {list}",
16341
16350
  modelRowNoEfforts: "无档位",
16342
16351
  modelRowOutput: "输出 {cap}",
@@ -16460,8 +16469,8 @@ window.__ModuleLoader__.load({
16460
16469
  quotaWindow: "额度窗口"
16461
16470
  };
16462
16471
  /** 两套字典。 */
16463
- const dictionaries$5 = {
16464
- zh: zh$5,
16472
+ const dictionaries$6 = {
16473
+ zh: zh$6,
16465
16474
  en: {
16466
16475
  modelRowEfforts: "efforts {list}",
16467
16476
  modelRowNoEfforts: "no efforts",
@@ -16638,10 +16647,10 @@ window.__ModuleLoader__.load({
16638
16647
  * 凭据边界也写在这里:/login/manual 的请求体是本文件里**唯一**带秘密的形状,
16639
16648
  * 它只在这个函数调用点的字面量里出现,既不进 URL、也不进日志。
16640
16649
  */
16641
- const api$7 = createLineApi(QODER_ROUTE_PREFIX, QODER_PROVIDER_NAME);
16642
- const get = api$7.get;
16643
- const post = api$7.post;
16644
- function messageOf(cause) {
16650
+ const api$8 = createLineApi(QODER_ROUTE_PREFIX, QODER_PROVIDER_NAME);
16651
+ const get$1 = api$8.get;
16652
+ const post$1 = api$8.post;
16653
+ function messageOf$1(cause) {
16645
16654
  return cause instanceof Error ? cause.message : String(cause);
16646
16655
  }
16647
16656
  //#endregion
@@ -16662,7 +16671,7 @@ window.__ModuleLoader__.load({
16662
16671
  /** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
16663
16672
  const LOGIN_POLL_INTERVAL_MS = 2e3;
16664
16673
  /** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
16665
- const fallbackTranslate$4 = (key) => zh$5[key];
16674
+ const fallbackTranslate$4 = (key) => zh$6[key];
16666
16675
  /**
16667
16676
  * 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
16668
16677
  *
@@ -16801,7 +16810,7 @@ window.__ModuleLoader__.load({
16801
16810
  if (catalogPullAttempted.current) return;
16802
16811
  catalogPullAttempted.current = true;
16803
16812
  try {
16804
- const next = await post("/catalog/refresh", {});
16813
+ const next = await post$1("/catalog/refresh", {});
16805
16814
  setStatus(next);
16806
16815
  setContextDrafts(contextDraftsFor(next));
16807
16816
  } catch {}
@@ -16809,7 +16818,7 @@ window.__ModuleLoader__.load({
16809
16818
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
16810
16819
  if (!quiet) setError(null);
16811
16820
  try {
16812
- const next = await get("/status");
16821
+ const next = await get$1("/status");
16813
16822
  setStatus(next);
16814
16823
  setContextDrafts(contextDraftsFor(next));
16815
16824
  if (!regionTouched.current && isQoderRegion(next.region)) setRegionState(next.region);
@@ -16819,7 +16828,7 @@ window.__ModuleLoader__.load({
16819
16828
  });
16820
16829
  if (next.catalogRefreshing === true) pullCatalogQuietly();
16821
16830
  } catch (cause) {
16822
- if (!quiet) setError(messageOf(cause));
16831
+ if (!quiet) setError(messageOf$1(cause));
16823
16832
  } finally {
16824
16833
  setLoading(false);
16825
16834
  }
@@ -16844,7 +16853,7 @@ window.__ModuleLoader__.load({
16844
16853
  const timer = window.setInterval(() => {
16845
16854
  (async () => {
16846
16855
  try {
16847
- const poll = await get("/login/status");
16856
+ const poll = await get$1("/login/status");
16848
16857
  if (stopped) return;
16849
16858
  if (poll.status === "complete") {
16850
16859
  setPasteValue("");
@@ -16877,13 +16886,13 @@ window.__ModuleLoader__.load({
16877
16886
  setError(null);
16878
16887
  setConnection(null);
16879
16888
  setPasteValue("");
16880
- const flow = await post("/login/start", { region: loginRegion });
16889
+ const flow = await post$1("/login/start", { region: loginRegion });
16881
16890
  await loadStatus(true);
16882
16891
  if (flow.authorizeUrl !== void 0 && flow.authorizeUrl !== "") try {
16883
16892
  window.open(flow.authorizeUrl, "_blank", "noopener,noreferrer");
16884
16893
  } catch {}
16885
16894
  } catch (cause) {
16886
- setError(messageOf(cause));
16895
+ setError(messageOf$1(cause));
16887
16896
  } finally {
16888
16897
  setBusy(null);
16889
16898
  }
@@ -16892,10 +16901,10 @@ window.__ModuleLoader__.load({
16892
16901
  try {
16893
16902
  setBusy("login:cancel");
16894
16903
  setError(null);
16895
- await post("/login/cancel", {});
16904
+ await post$1("/login/cancel", {});
16896
16905
  await loadStatus(true);
16897
16906
  } catch (cause) {
16898
- setError(messageOf(cause));
16907
+ setError(messageOf$1(cause));
16899
16908
  } finally {
16900
16909
  setBusy(null);
16901
16910
  }
@@ -16909,13 +16918,13 @@ window.__ModuleLoader__.load({
16909
16918
  try {
16910
16919
  setBusy("login-manual");
16911
16920
  setError(null);
16912
- setStatus(await post("/login/manual", {
16921
+ setStatus(await post$1("/login/manual", {
16913
16922
  region,
16914
16923
  token
16915
16924
  }));
16916
16925
  onModelChange?.();
16917
16926
  } catch (cause) {
16918
- setError(messageOf(cause));
16927
+ setError(messageOf$1(cause));
16919
16928
  } finally {
16920
16929
  setPasteValue("");
16921
16930
  setBusy(null);
@@ -16925,12 +16934,12 @@ window.__ModuleLoader__.load({
16925
16934
  try {
16926
16935
  setBusy("adopt");
16927
16936
  setError(null);
16928
- const result = await post("/adopt", {});
16937
+ const result = await post$1("/adopt", {});
16929
16938
  setAdoptResult(result);
16930
16939
  await loadStatus(true);
16931
16940
  if (result.adopted) onModelChange?.();
16932
16941
  } catch (cause) {
16933
- setError(messageOf(cause));
16942
+ setError(messageOf$1(cause));
16934
16943
  } finally {
16935
16944
  setBusy(null);
16936
16945
  }
@@ -16939,13 +16948,13 @@ window.__ModuleLoader__.load({
16939
16948
  try {
16940
16949
  setBusy("account:" + action + ":" + accountId);
16941
16950
  setError(null);
16942
- setStatus(await post("/accounts", {
16951
+ setStatus(await post$1("/accounts", {
16943
16952
  action,
16944
16953
  accountId
16945
16954
  }));
16946
16955
  onModelChange?.();
16947
16956
  } catch (cause) {
16948
- setError(messageOf(cause));
16957
+ setError(messageOf$1(cause));
16949
16958
  } finally {
16950
16959
  setBusy(null);
16951
16960
  }
@@ -16954,12 +16963,12 @@ window.__ModuleLoader__.load({
16954
16963
  try {
16955
16964
  setBusy("strategy");
16956
16965
  setError(null);
16957
- setStatus(await post("/accounts", {
16966
+ setStatus(await post$1("/accounts", {
16958
16967
  action: "strategy",
16959
16968
  strategy
16960
16969
  }));
16961
16970
  } catch (cause) {
16962
- setError(messageOf(cause));
16971
+ setError(messageOf$1(cause));
16963
16972
  } finally {
16964
16973
  setBusy(null);
16965
16974
  }
@@ -16974,12 +16983,12 @@ window.__ModuleLoader__.load({
16974
16983
  const applyEnabledModels = async (enabledModelIds) => {
16975
16984
  try {
16976
16985
  setError(null);
16977
- const updated = await post("/settings", { enabledModelIds });
16986
+ const updated = await post$1("/settings", { enabledModelIds });
16978
16987
  setStatus(updated);
16979
16988
  setContextDrafts(contextDraftsFor(updated));
16980
16989
  onModelChange?.();
16981
16990
  } catch (cause) {
16982
- setError(messageOf(cause));
16991
+ setError(messageOf$1(cause));
16983
16992
  }
16984
16993
  };
16985
16994
  const toggleModel = (modelId, enabled) => {
@@ -17002,14 +17011,14 @@ window.__ModuleLoader__.load({
17002
17011
  try {
17003
17012
  setSavingModel(modelId);
17004
17013
  setError(null);
17005
- setStatus(await post("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
17014
+ setStatus(await post$1("/settings", { contextWindowOverrides: { [modelId]: parsed } }));
17006
17015
  setContextDrafts((previous) => ({
17007
17016
  ...previous,
17008
17017
  [modelId]: formatCapacity$1(parsed)
17009
17018
  }));
17010
17019
  onModelChange?.();
17011
17020
  } catch (cause) {
17012
- setError(messageOf(cause));
17021
+ setError(messageOf$1(cause));
17013
17022
  } finally {
17014
17023
  setSavingModel(null);
17015
17024
  }
@@ -17018,7 +17027,7 @@ window.__ModuleLoader__.load({
17018
17027
  try {
17019
17028
  setSavingModel(modelId);
17020
17029
  setError(null);
17021
- const updated = await post("/settings", { contextWindowOverrides: { [modelId]: null } });
17030
+ const updated = await post$1("/settings", { contextWindowOverrides: { [modelId]: null } });
17022
17031
  setStatus(updated);
17023
17032
  const model = updated.models.find((entry) => entry.id === modelId);
17024
17033
  if (model !== void 0) setContextDrafts((previous) => ({
@@ -17027,7 +17036,7 @@ window.__ModuleLoader__.load({
17027
17036
  }));
17028
17037
  onModelChange?.();
17029
17038
  } catch (cause) {
17030
- setError(messageOf(cause));
17039
+ setError(messageOf$1(cause));
17031
17040
  } finally {
17032
17041
  setSavingModel(null);
17033
17042
  }
@@ -17037,21 +17046,21 @@ window.__ModuleLoader__.load({
17037
17046
  if (ids.length === 0) return;
17038
17047
  try {
17039
17048
  setError(null);
17040
- const updated = await post("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
17049
+ const updated = await post$1("/settings", { contextWindowOverrides: Object.fromEntries(ids.map((id) => [id, null])) });
17041
17050
  setStatus(updated);
17042
17051
  setContextDrafts(contextDraftsFor(updated));
17043
17052
  onModelChange?.();
17044
17053
  } catch (cause) {
17045
- setError(messageOf(cause));
17054
+ setError(messageOf$1(cause));
17046
17055
  }
17047
17056
  };
17048
17057
  const setDefaultReasoningEffort = async (effort) => {
17049
17058
  try {
17050
17059
  setBusy("effort");
17051
17060
  setError(null);
17052
- setStatus(await post("/settings", { defaultReasoningEffort: effort }));
17061
+ setStatus(await post$1("/settings", { defaultReasoningEffort: effort }));
17053
17062
  } catch (cause) {
17054
- setError(messageOf(cause));
17063
+ setError(messageOf$1(cause));
17055
17064
  } finally {
17056
17065
  setBusy(null);
17057
17066
  }
@@ -17060,9 +17069,9 @@ window.__ModuleLoader__.load({
17060
17069
  try {
17061
17070
  setBusy("quota");
17062
17071
  setError(null);
17063
- setStatus(await post("/quota", {}));
17072
+ setStatus(await post$1("/quota", {}));
17064
17073
  } catch (cause) {
17065
- setError(messageOf(cause));
17074
+ setError(messageOf$1(cause));
17066
17075
  } finally {
17067
17076
  setBusy(null);
17068
17077
  }
@@ -17071,9 +17080,9 @@ window.__ModuleLoader__.load({
17071
17080
  try {
17072
17081
  setBusy("catalog");
17073
17082
  setError(null);
17074
- setStatus(await post("/catalog/refresh", {}));
17083
+ setStatus(await post$1("/catalog/refresh", {}));
17075
17084
  } catch (cause) {
17076
- setError(messageOf(cause));
17085
+ setError(messageOf$1(cause));
17077
17086
  } finally {
17078
17087
  setBusy(null);
17079
17088
  }
@@ -17082,9 +17091,9 @@ window.__ModuleLoader__.load({
17082
17091
  try {
17083
17092
  setBusy("connection");
17084
17093
  setError(null);
17085
- setConnection(await post("/connection/test", {}));
17094
+ setConnection(await post$1("/connection/test", {}));
17086
17095
  } catch (cause) {
17087
- setError(messageOf(cause));
17096
+ setError(messageOf$1(cause));
17088
17097
  } finally {
17089
17098
  setBusy(null);
17090
17099
  }
@@ -17174,7 +17183,7 @@ window.__ModuleLoader__.load({
17174
17183
  * 说明」。
17175
17184
  */
17176
17185
  /** 百分比,最多一位小数;调用方已经排除了非有限值。 */
17177
- function percentText(ratio) {
17186
+ function percentText$1(ratio) {
17178
17187
  const value = Math.max(0, Math.min(1, ratio));
17179
17188
  try {
17180
17189
  return new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value * 100) + "%";
@@ -17183,7 +17192,7 @@ window.__ModuleLoader__.load({
17183
17192
  }
17184
17193
  }
17185
17194
  /** 千分位;Intl 不可用时退回原值,不让一个格式化失败变成一次渲染失败。 */
17186
- function tokenText(value) {
17195
+ function tokenText$1(value) {
17187
17196
  try {
17188
17197
  return new Intl.NumberFormat().format(value);
17189
17198
  } catch {
@@ -17193,8 +17202,8 @@ window.__ModuleLoader__.load({
17193
17202
  /** 一只桶的量文本:「剩余 / 总额 单位」,缺哪格哪格就明说「未报」。 */
17194
17203
  function bucketAmountText(bucket, t) {
17195
17204
  const unit = bucket.unit !== null && bucket.unit !== "" ? " " + bucket.unit : "";
17196
- const remaining = bucket.remaining !== null ? tokenText(bucket.remaining) : "—";
17197
- const total = bucket.total !== null ? tokenText(bucket.total) : "—";
17205
+ const remaining = bucket.remaining !== null ? tokenText$1(bucket.remaining) : "—";
17206
+ const total = bucket.total !== null ? tokenText$1(bucket.total) : "—";
17198
17207
  return t.quotaRemaining + " " + remaining + " / " + t.quotaTotal + " " + total + unit;
17199
17208
  }
17200
17209
  /** 档位 → 字典键。六个取值一一对应,没有兜底串。 */
@@ -17228,7 +17237,7 @@ window.__ModuleLoader__.load({
17228
17237
  * `defaultMaxTokens`),客户端不按模型名推断任何一项。与 OpenDesign 卡同一写法:
17229
17238
  * 数据一行,散文进折叠区。
17230
17239
  */
17231
- function qoderModelRowHint(model, t = zh$5) {
17240
+ function qoderModelRowHint(model, t = zh$6) {
17232
17241
  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))}`;
17233
17242
  }
17234
17243
  function QoderSection({ onModelChange } = {}) {
@@ -17236,7 +17245,7 @@ window.__ModuleLoader__.load({
17236
17245
  const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
17237
17246
  const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio } = derived;
17238
17247
  const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setDefaultReasoningEffort, refreshQuota, refreshCatalog, testConnection } = actions;
17239
- const t = useLineDict(NS_QODER, zh$5);
17248
+ const t = useLineDict(NS_QODER, zh$6);
17240
17249
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
17241
17250
  className: "dsha-page",
17242
17251
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -17498,7 +17507,7 @@ window.__ModuleLoader__.load({
17498
17507
  children: [
17499
17508
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17500
17509
  className: "dsha-meter-label",
17501
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: hitRatio === null ? t.cacheHitRatioUnavailable : percentText(hitRatio) })]
17510
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: hitRatio === null ? t.cacheHitRatioUnavailable : percentText$1(hitRatio) })]
17502
17511
  }),
17503
17512
  hitRatio !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
17504
17513
  className: "dsha-meter " + (hitRatio >= .9 ? "dsha-meter-green" : "dsha-meter-cyan"),
@@ -17510,22 +17519,22 @@ window.__ModuleLoader__.load({
17510
17519
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
17511
17520
  t.cacheReadTokens,
17512
17521
  ": ",
17513
- tokenText(cache.cacheReadTokens)
17522
+ tokenText$1(cache.cacheReadTokens)
17514
17523
  ] }),
17515
17524
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
17516
17525
  t.cacheMissedTokens,
17517
17526
  ": ",
17518
- tokenText(cache.missedInputTokens)
17527
+ tokenText$1(cache.missedInputTokens)
17519
17528
  ] }),
17520
17529
  cache.cacheWriteTokens > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
17521
17530
  t.cacheWriteTokens,
17522
17531
  ": ",
17523
- tokenText(cache.cacheWriteTokens)
17532
+ tokenText$1(cache.cacheWriteTokens)
17524
17533
  ] }),
17525
17534
  cache.requests !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
17526
17535
  t.cacheRequests,
17527
17536
  ": ",
17528
- tokenText(cache.requests)
17537
+ tokenText$1(cache.requests)
17529
17538
  ] })
17530
17539
  ]
17531
17540
  })
@@ -17740,7 +17749,7 @@ window.__ModuleLoader__.load({
17740
17749
  children: [
17741
17750
  t.quotaUsed,
17742
17751
  " ",
17743
- percentText(bucket.used / bucket.total)
17752
+ percentText$1(bucket.used / bucket.total)
17744
17753
  ]
17745
17754
  })
17746
17755
  ]
@@ -17765,7 +17774,7 @@ window.__ModuleLoader__.load({
17765
17774
  const OPENDESIGN_ROUTE_PREFIX = "/opendesign/api";
17766
17775
  //#endregion
17767
17776
  //#region src/client/opendesign/api.ts
17768
- const api$6 = createLineApi(OPENDESIGN_ROUTE_PREFIX, "OpenDesign");
17777
+ const api$7 = createLineApi(OPENDESIGN_ROUTE_PREFIX, "OpenDesign");
17769
17778
  /**
17770
17779
  * The OpenDesign settings API, as the card uses it.
17771
17780
  *
@@ -17774,65 +17783,65 @@ window.__ModuleLoader__.load({
17774
17783
  */
17775
17784
  var OpenDesignApi = class {
17776
17785
  status() {
17777
- return api$6.get("/status");
17786
+ return api$7.get("/status");
17778
17787
  }
17779
17788
  updateSettings(patch) {
17780
- return api$6.post("/settings", patch).then(() => this.status());
17789
+ return api$7.post("/settings", patch).then(() => this.status());
17781
17790
  }
17782
17791
  accountAction(action, body = {}) {
17783
- return api$6.post("/accounts", {
17792
+ return api$7.post("/accounts", {
17784
17793
  action,
17785
17794
  ...body
17786
17795
  });
17787
17796
  }
17788
17797
  /** Verify a key without storing it; the host answers the verdict directly. */
17789
17798
  testKey(body) {
17790
- return api$6.post("/accounts", {
17799
+ return api$7.post("/accounts", {
17791
17800
  action: "test",
17792
17801
  ...body
17793
17802
  });
17794
17803
  }
17795
17804
  /** Start the browser device-authorization sign-in. */
17796
17805
  startLogin() {
17797
- return api$6.post("/login/start", {});
17806
+ return api$7.post("/login/start", {});
17798
17807
  }
17799
17808
  /** One poll of the pending sign-in; the host throttles it to the advertised interval. */
17800
17809
  loginStatus(id) {
17801
- return api$6.get(`/login/status?id=${encodeURIComponent(id)}`);
17810
+ return api$7.get(`/login/status?id=${encodeURIComponent(id)}`);
17802
17811
  }
17803
17812
  cancelLogin(id) {
17804
- return api$6.post("/login/cancel", { id });
17813
+ return api$7.post("/login/cancel", { id });
17805
17814
  }
17806
17815
  /** Read each OAuth account's wallet balance once (one upstream call per account). */
17807
17816
  readUsage() {
17808
- return api$6.post("/usage", {});
17817
+ return api$7.post("/usage", {});
17809
17818
  }
17810
17819
  setEnabledModels(enabledModelIds) {
17811
- return api$6.post("/models", { enabledModelIds });
17820
+ return api$7.post("/models", { enabledModelIds });
17812
17821
  }
17813
17822
  setContextWindow(model, contextWindow) {
17814
- return api$6.post("/models/context-window", {
17823
+ return api$7.post("/models/context-window", {
17815
17824
  model,
17816
17825
  contextWindow
17817
17826
  });
17818
17827
  }
17819
17828
  setVisibility(model, visible) {
17820
- return api$6.post("/models/visibility", {
17829
+ return api$7.post("/models/visibility", {
17821
17830
  model,
17822
17831
  visible
17823
17832
  });
17824
17833
  }
17825
17834
  setVisibilityAll(mode) {
17826
- return api$6.post("/models/visibility-all", { mode });
17835
+ return api$7.post("/models/visibility-all", { mode });
17827
17836
  }
17828
17837
  refreshCatalog() {
17829
- return api$6.post("/catalog/refresh", {});
17838
+ return api$7.post("/catalog/refresh", {});
17830
17839
  }
17831
17840
  };
17832
17841
  //#endregion
17833
17842
  //#region src/client/opendesign/locales.ts
17834
17843
  const NS_OPENDESIGN = "dsh-opendesign";
17835
- const zh$4 = {
17844
+ const zh$5 = {
17836
17845
  ...accountPoolZh,
17837
17846
  relogin: "重新登录",
17838
17847
  needsRelogin: "登录已失效",
@@ -17940,7 +17949,7 @@ window.__ModuleLoader__.load({
17940
17949
  limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 opendesign,本卡仍可配置,但请求由对方服务。",
17941
17950
  limitQuota: "套餐与额度读取只覆盖浏览器授权登录的账号;粘贴的 API Key 没有控制 Key,请在 OpenDesign Cloud 控制台查看用量。"
17942
17951
  };
17943
- const en$4 = {
17952
+ const en$5 = {
17944
17953
  ...accountPoolEn,
17945
17954
  relogin: "Add again",
17946
17955
  needsRelogin: "Key invalid",
@@ -18048,11 +18057,11 @@ window.__ModuleLoader__.load({
18048
18057
  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.",
18049
18058
  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."
18050
18059
  };
18051
- const dictionaries$4 = {
18052
- zh: zh$4,
18053
- "zh-CN": zh$4,
18054
- en: en$4,
18055
- "en-US": en$4
18060
+ const dictionaries$5 = {
18061
+ zh: zh$5,
18062
+ "zh-CN": zh$5,
18063
+ en: en$5,
18064
+ "en-US": en$5
18056
18065
  };
18057
18066
  //#endregion
18058
18067
  //#region src/client/opendesign/OpenDesignSection.tsx
@@ -18347,7 +18356,7 @@ window.__ModuleLoader__.load({
18347
18356
  try {
18348
18357
  const outcome = await API$4.readUsage();
18349
18358
  setStatus(outcome.status);
18350
- if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$4.usageEmpty);
18359
+ if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$5.usageEmpty);
18351
18360
  } catch (cause) {
18352
18361
  if (!silent) setError(detail(cause));
18353
18362
  }
@@ -18384,10 +18393,10 @@ window.__ModuleLoader__.load({
18384
18393
  API$4.loginStatus(flow.id).then((next) => {
18385
18394
  setLoginFlow(next);
18386
18395
  if (next.status === "complete") {
18387
- setNotice(zh$4.loginComplete.replace("{account}", next.accountAlias === "" ? "OpenDesign" : next.accountAlias));
18396
+ setNotice(zh$5.loginComplete.replace("{account}", next.accountAlias === "" ? "OpenDesign" : next.accountAlias));
18388
18397
  setShowKeyForm(false);
18389
18398
  reload();
18390
- } else if (next.status === "failed") setError(zh$4.loginFailed.replace("{detail}", next.error));
18399
+ } else if (next.status === "failed") setError(zh$5.loginFailed.replace("{detail}", next.error));
18391
18400
  }).catch((cause) => setError(detail(cause)));
18392
18401
  }, Math.max(2, flow.intervalSeconds) * 1e3);
18393
18402
  return () => window.clearInterval(timer);
@@ -18453,7 +18462,7 @@ window.__ModuleLoader__.load({
18453
18462
  const refreshUsage = (0, react.useCallback)(() => {
18454
18463
  run("usage", async () => {
18455
18464
  const outcome = await API$4.readUsage();
18456
- setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$4.usageEmpty);
18465
+ setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$5.usageEmpty);
18457
18466
  return outcome.status;
18458
18467
  });
18459
18468
  }, [run]);
@@ -18488,7 +18497,7 @@ window.__ModuleLoader__.load({
18488
18497
  apiKey: trimmed,
18489
18498
  ...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
18490
18499
  }).then((result) => {
18491
- setNotice(result.authorized ? zh$4.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$4.keyTestFailed.replace("{detail}", result.error));
18500
+ setNotice(result.authorized ? zh$5.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$5.keyTestFailed.replace("{detail}", result.error));
18492
18501
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
18493
18502
  }, [key, keyBaseURL]);
18494
18503
  const testStored = (0, react.useCallback)((accountId) => {
@@ -18496,7 +18505,7 @@ window.__ModuleLoader__.load({
18496
18505
  setError(null);
18497
18506
  setNotice(null);
18498
18507
  API$4.testKey({ accountId }).then((result) => {
18499
- setNotice(result.authorized ? zh$4.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$4.keyTestFailed.replace("{detail}", result.error));
18508
+ setNotice(result.authorized ? zh$5.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$5.keyTestFailed.replace("{detail}", result.error));
18500
18509
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
18501
18510
  }, []);
18502
18511
  const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
@@ -18522,7 +18531,7 @@ window.__ModuleLoader__.load({
18522
18531
  if (model === void 0) return;
18523
18532
  const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
18524
18533
  if (parsed === null) {
18525
- setError(zh$4.error.replace("{detail}", zh$4.defaultContextWindow));
18534
+ setError(zh$5.error.replace("{detail}", zh$5.defaultContextWindow));
18526
18535
  return;
18527
18536
  }
18528
18537
  run("ctx:" + id, () => API$4.setContextWindow(id, parsed));
@@ -18544,7 +18553,7 @@ window.__ModuleLoader__.load({
18544
18553
  }, [run, status]);
18545
18554
  const resetAllContext = (0, react.useCallback)(() => {
18546
18555
  if (status === null) return;
18547
- if (typeof window !== "undefined" && !window.confirm(zh$4.contextResetAll)) return;
18556
+ if (typeof window !== "undefined" && !window.confirm(zh$5.contextResetAll)) return;
18548
18557
  const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
18549
18558
  run("ctx-all", async () => {
18550
18559
  let next = status;
@@ -18560,7 +18569,7 @@ window.__ModuleLoader__.load({
18560
18569
  const refreshCatalog = (0, react.useCallback)(() => {
18561
18570
  run("catalog", async () => {
18562
18571
  const outcome = await API$4.refreshCatalog();
18563
- setNotice(zh$4.catalogSyncedNote.replace("{count}", String(outcome.status.catalogCount)));
18572
+ setNotice(zh$5.catalogSyncedNote.replace("{count}", String(outcome.status.catalogCount)));
18564
18573
  return outcome.status;
18565
18574
  });
18566
18575
  }, [run]);
@@ -18574,7 +18583,7 @@ window.__ModuleLoader__.load({
18574
18583
  };
18575
18584
  const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
18576
18585
  if (invalid !== void 0) {
18577
- setError(zh$4.error.replace("{detail}", invalid[0]));
18586
+ setError(zh$5.error.replace("{detail}", invalid[0]));
18578
18587
  return;
18579
18588
  }
18580
18589
  setBusy("settings");
@@ -18585,10 +18594,10 @@ window.__ModuleLoader__.load({
18585
18594
  }).then((next) => {
18586
18595
  applyStatus(next);
18587
18596
  setSettingsForm(settingsFormOf(next));
18588
- setNotice(zh$4.saved);
18597
+ setNotice(zh$5.saved);
18589
18598
  }).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
18590
18599
  }, [settingsForm, applyStatus]);
18591
- const t = useLineDict(NS_OPENDESIGN, zh$4);
18600
+ const t = useLineDict(NS_OPENDESIGN, zh$5);
18592
18601
  const errorPrefix = t.error.split("{detail}")[0] ?? "";
18593
18602
  const pool = status?.pool;
18594
18603
  const accounts = pool?.accounts ?? [];
@@ -19106,7 +19115,7 @@ window.__ModuleLoader__.load({
19106
19115
  * control that renders it instead.
19107
19116
  */
19108
19117
  const NS_WORKBUDDY = "dsh-workbuddy";
19109
- const zh$3 = {
19118
+ const zh$4 = {
19110
19119
  title: "WorkBuddy",
19111
19120
  pageDesc: "复用本机 CodeBuddy 桌面端登录态,管理 WorkBuddy(CodeBuddy 订阅)模型、上下文窗口与额度。",
19112
19121
  account: "账号",
@@ -19232,7 +19241,7 @@ window.__ModuleLoader__.load({
19232
19241
  modelCooldownActive: "模型限流中",
19233
19242
  notRoutable: "当前不可路由"
19234
19243
  };
19235
- const en$3 = {
19244
+ const en$4 = {
19236
19245
  title: "WorkBuddy",
19237
19246
  pageDesc: "Reuse the local CodeBuddy desktop sign-in to manage WorkBuddy (CodeBuddy subscription) models, context windows, and quota.",
19238
19247
  account: "Account",
@@ -19358,11 +19367,11 @@ window.__ModuleLoader__.load({
19358
19367
  modelCooldownActive: "Model parked",
19359
19368
  notRoutable: "Not routable right now"
19360
19369
  };
19361
- const dictionaries$3 = {
19362
- zh: zh$3,
19363
- "zh-CN": zh$3,
19364
- en: en$3,
19365
- "en-US": en$3
19370
+ const dictionaries$4 = {
19371
+ zh: zh$4,
19372
+ "zh-CN": zh$4,
19373
+ en: en$4,
19374
+ "en-US": en$4
19366
19375
  };
19367
19376
  //#endregion
19368
19377
  //#region src/client/workbuddy/useWorkBuddySection.ts
@@ -19403,7 +19412,7 @@ window.__ModuleLoader__.load({
19403
19412
  * is exactly what a stale host half produces) be reported as such instead of as
19404
19413
  * a bare "Unexpected end of JSON input".
19405
19414
  */
19406
- const api$5 = createLineApi(API$3, "WorkBuddy");
19415
+ const api$6 = createLineApi(API$3, "WorkBuddy");
19407
19416
  /**
19408
19417
  * Reasoning levels the default-effort control may offer.
19409
19418
  *
@@ -19460,7 +19469,7 @@ window.__ModuleLoader__.load({
19460
19469
  const quotaFollowUp = (0, react.useRef)(null);
19461
19470
  const [contextDrafts, setContextDrafts] = (0, react.useState)({});
19462
19471
  const [savingModel, setSavingModel] = (0, react.useState)(null);
19463
- const t = useLineDict(NS_WORKBUDDY, zh$3);
19472
+ const t = useLineDict(NS_WORKBUDDY, zh$4);
19464
19473
  const notifyChange = (0, react.useCallback)(() => {
19465
19474
  onModelChange?.();
19466
19475
  loadModelDirectory?.();
@@ -19472,7 +19481,7 @@ window.__ModuleLoader__.load({
19472
19481
  const loadStatus = (0, react.useCallback)(async (quiet = false) => {
19473
19482
  if (!quiet) setError(null);
19474
19483
  try {
19475
- const data = await api$5.request("/status");
19484
+ const data = await api$6.request("/status");
19476
19485
  const normalized = normalizeStatus(data);
19477
19486
  setStatus(normalized);
19478
19487
  setStatusFailed(false);
@@ -19507,7 +19516,7 @@ window.__ModuleLoader__.load({
19507
19516
  try {
19508
19517
  setBusy("rescan");
19509
19518
  setError(null);
19510
- const updated = await api$5.request("/rescan", { method: "POST" });
19519
+ const updated = await api$6.request("/rescan", { method: "POST" });
19511
19520
  setStatus(normalizeStatus(updated));
19512
19521
  notifyChange();
19513
19522
  } catch (err) {
@@ -19521,7 +19530,7 @@ window.__ModuleLoader__.load({
19521
19530
  setBusy(`login:${region}`);
19522
19531
  setError(null);
19523
19532
  setLoginProgress(t.loginWaiting);
19524
- const flow = await api$5.request("/accounts/login", {
19533
+ const flow = await api$6.request("/accounts/login", {
19525
19534
  method: "POST",
19526
19535
  body: JSON.stringify({ region })
19527
19536
  });
@@ -19531,7 +19540,7 @@ window.__ModuleLoader__.load({
19531
19540
  const timer = window.setInterval(() => {
19532
19541
  (async () => {
19533
19542
  try {
19534
- const poll = await api$5.request("/accounts/login/status");
19543
+ const poll = await api$6.request("/accounts/login/status");
19535
19544
  if (poll.progress) setLoginProgress(poll.progress);
19536
19545
  if (poll.status === "complete") {
19537
19546
  window.clearInterval(timer);
@@ -19540,7 +19549,7 @@ window.__ModuleLoader__.load({
19540
19549
  loginTimeoutRef.current = null;
19541
19550
  setBusy(null);
19542
19551
  setLoginProgress(null);
19543
- if (poll.accountId) await api$5.request("/settings", {
19552
+ if (poll.accountId) await api$6.request("/settings", {
19544
19553
  method: "POST",
19545
19554
  body: JSON.stringify({ selectedAccountId: poll.accountId })
19546
19555
  });
@@ -19580,7 +19589,7 @@ window.__ModuleLoader__.load({
19580
19589
  try {
19581
19590
  setBusy(`${action}:${accountId}`);
19582
19591
  setError(null);
19583
- const updated = await api$5.request("/accounts/action", {
19592
+ const updated = await api$6.request("/accounts/action", {
19584
19593
  method: "POST",
19585
19594
  body: JSON.stringify({
19586
19595
  action,
@@ -19603,7 +19612,7 @@ window.__ModuleLoader__.load({
19603
19612
  try {
19604
19613
  setBusy("strategy");
19605
19614
  setError(null);
19606
- const updated = await api$5.request("/accounts/strategy", {
19615
+ const updated = await api$6.request("/accounts/strategy", {
19607
19616
  method: "POST",
19608
19617
  body: JSON.stringify({ strategy })
19609
19618
  });
@@ -19618,7 +19627,7 @@ window.__ModuleLoader__.load({
19618
19627
  try {
19619
19628
  setBusy("connection");
19620
19629
  setError(null);
19621
- setConnection(await api$5.request("/connection/test", { method: "POST" }));
19630
+ setConnection(await api$6.request("/connection/test", { method: "POST" }));
19622
19631
  } catch (err) {
19623
19632
  setError(err instanceof Error ? err.message : String(err));
19624
19633
  } finally {
@@ -19629,7 +19638,7 @@ window.__ModuleLoader__.load({
19629
19638
  try {
19630
19639
  setBusy("quota");
19631
19640
  setError(null);
19632
- const updated = await api$5.request("/quota", { method: "POST" });
19641
+ const updated = await api$6.request("/quota", { method: "POST" });
19633
19642
  setStatus(updated);
19634
19643
  } catch (err) {
19635
19644
  setError(err instanceof Error ? err.message : String(err));
@@ -19641,7 +19650,7 @@ window.__ModuleLoader__.load({
19641
19650
  try {
19642
19651
  setBusy("checkin");
19643
19652
  setError(null);
19644
- const updated = await api$5.request("/checkin/now", { method: "POST" });
19653
+ const updated = await api$6.request("/checkin/now", { method: "POST" });
19645
19654
  setStatus(normalizeStatus(updated));
19646
19655
  } catch (err) {
19647
19656
  setError(err instanceof Error ? err.message : String(err));
@@ -19653,7 +19662,7 @@ window.__ModuleLoader__.load({
19653
19662
  try {
19654
19663
  setBusy("checkin");
19655
19664
  setError(null);
19656
- const updated = await api$5.request("/settings", {
19665
+ const updated = await api$6.request("/settings", {
19657
19666
  method: "POST",
19658
19667
  body: JSON.stringify({ checkin })
19659
19668
  });
@@ -19669,7 +19678,7 @@ window.__ModuleLoader__.load({
19669
19678
  try {
19670
19679
  setBusy("outbound");
19671
19680
  setError(null);
19672
- const updated = await api$5.request("/settings", {
19681
+ const updated = await api$6.request("/settings", {
19673
19682
  method: "POST",
19674
19683
  body: JSON.stringify({ outboundIdentity })
19675
19684
  });
@@ -19685,7 +19694,7 @@ window.__ModuleLoader__.load({
19685
19694
  try {
19686
19695
  setBusy("guardrails");
19687
19696
  setError(null);
19688
- const updated = await api$5.request("/settings", {
19697
+ const updated = await api$6.request("/settings", {
19689
19698
  method: "POST",
19690
19699
  body: JSON.stringify({ guardrails })
19691
19700
  });
@@ -19701,7 +19710,7 @@ window.__ModuleLoader__.load({
19701
19710
  try {
19702
19711
  setBusy("atrest");
19703
19712
  setError(null);
19704
- const updated = await api$5.request("/at-rest-key", {
19713
+ const updated = await api$6.request("/at-rest-key", {
19705
19714
  method: "POST",
19706
19715
  body: JSON.stringify({ key })
19707
19716
  });
@@ -19717,7 +19726,7 @@ window.__ModuleLoader__.load({
19717
19726
  try {
19718
19727
  setBusy("atrest");
19719
19728
  setError(null);
19720
- const updated = await api$5.request("/at-rest-key", { method: "DELETE" });
19729
+ const updated = await api$6.request("/at-rest-key", { method: "DELETE" });
19721
19730
  setStatus(normalizeStatus(updated));
19722
19731
  } catch (err) {
19723
19732
  setError(err instanceof Error ? err.message : String(err));
@@ -19732,7 +19741,7 @@ window.__ModuleLoader__.load({
19732
19741
  try {
19733
19742
  setBusy(`model:${modelId}`);
19734
19743
  setError(null);
19735
- const normalized = normalizeStatus(await api$5.request("/settings", {
19744
+ const normalized = normalizeStatus(await api$6.request("/settings", {
19736
19745
  method: "POST",
19737
19746
  body: JSON.stringify({ enabledModelIds: next })
19738
19747
  }));
@@ -19750,7 +19759,7 @@ window.__ModuleLoader__.load({
19750
19759
  try {
19751
19760
  setBusy("models-all");
19752
19761
  setError(null);
19753
- const normalized = normalizeStatus(await api$5.request("/settings", {
19762
+ const normalized = normalizeStatus(await api$6.request("/settings", {
19754
19763
  method: "POST",
19755
19764
  body: JSON.stringify({ enabledModelIds: enabled ? status.models.map((model) => model.id) : [] })
19756
19765
  }));
@@ -19767,7 +19776,7 @@ window.__ModuleLoader__.load({
19767
19776
  try {
19768
19777
  setBusy("effort");
19769
19778
  setError(null);
19770
- const updated = await api$5.request("/settings", {
19779
+ const updated = await api$6.request("/settings", {
19771
19780
  method: "POST",
19772
19781
  body: JSON.stringify({ defaultReasoningEffort: effort })
19773
19782
  });
@@ -19783,7 +19792,7 @@ window.__ModuleLoader__.load({
19783
19792
  try {
19784
19793
  setBusy("catalog");
19785
19794
  setError(null);
19786
- const normalized = normalizeStatus(await api$5.request("/catalog/refresh", { method: "POST" }));
19795
+ const normalized = normalizeStatus(await api$6.request("/catalog/refresh", { method: "POST" }));
19787
19796
  setStatus(normalized);
19788
19797
  setContextDrafts(contextDraftsFor(normalized));
19789
19798
  notifyChange();
@@ -19803,7 +19812,7 @@ window.__ModuleLoader__.load({
19803
19812
  try {
19804
19813
  setSavingModel(modelId);
19805
19814
  setError(null);
19806
- const updated = await api$5.request("/settings", {
19815
+ const updated = await api$6.request("/settings", {
19807
19816
  method: "POST",
19808
19817
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
19809
19818
  });
@@ -19824,7 +19833,7 @@ window.__ModuleLoader__.load({
19824
19833
  try {
19825
19834
  setSavingModel(modelId);
19826
19835
  setError(null);
19827
- const updated = normalizeStatus(await api$5.request("/settings", {
19836
+ const updated = normalizeStatus(await api$6.request("/settings", {
19828
19837
  method: "POST",
19829
19838
  body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
19830
19839
  }));
@@ -19851,7 +19860,7 @@ window.__ModuleLoader__.load({
19851
19860
  try {
19852
19861
  setBusy("context");
19853
19862
  setError(null);
19854
- const updated = normalizeStatus(await api$5.request("/settings", {
19863
+ const updated = normalizeStatus(await api$6.request("/settings", {
19855
19864
  method: "POST",
19856
19865
  body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
19857
19866
  }));
@@ -20094,7 +20103,7 @@ window.__ModuleLoader__.load({
20094
20103
  const timer = window.setInterval(() => setNow(Date.now()), 1e3);
20095
20104
  return () => window.clearInterval(timer);
20096
20105
  }, [pausedUntil]);
20097
- const t = useLineDict(NS_WORKBUDDY, zh$3);
20106
+ const t = useLineDict(NS_WORKBUDDY, zh$4);
20098
20107
  const poolState = poolStateLines(pool, t, now);
20099
20108
  const storageLine = poolStorageLine(pool?.storage, t);
20100
20109
  const storageUnavailable = pool?.storage === void 0 ? null : poolStorageUnavailableLabel(pool.storage, t);
@@ -20690,6 +20699,798 @@ window.__ModuleLoader__.load({
20690
20699
  });
20691
20700
  }
20692
20701
  //#endregion
20702
+ //#region src/shared/qianwen-token-plan-contracts.ts
20703
+ /**
20704
+ * Public host/client contract for the Qwen Token Plan line.
20705
+ *
20706
+ * No API key, encrypted thinking payload, or request body crosses this boundary.
20707
+ * Upstream facts are sourced from the official Qianwen documentation recorded in
20708
+ * docs/qianwen-token-plan-line-plan.md.
20709
+ */
20710
+ const QIANWEN_TOKEN_PLAN_PROVIDER_ID = "qianwen-token-plan";
20711
+ const QIANWEN_TOKEN_PLAN_PROVIDER_NAME = "Qwen Token Plan(千问)";
20712
+ const QIANWEN_TOKEN_PLAN_ROUTE_PREFIX = "/qianwen-token-plan/api";
20713
+ const QIANWEN_REASONING_EFFORTS = [
20714
+ "none",
20715
+ "minimal",
20716
+ "low",
20717
+ "medium",
20718
+ "high",
20719
+ "xhigh",
20720
+ "max"
20721
+ ];
20722
+ function isQianwenReasoningEffort(value) {
20723
+ return typeof value === "string" && QIANWEN_REASONING_EFFORTS.includes(value);
20724
+ }
20725
+ const QIANWEN_CACHE_TTLS = ["5m", "1h"];
20726
+ function isQianwenCacheTtl(value) {
20727
+ return value === "5m" || value === "1h";
20728
+ }
20729
+ const QIANWEN_IMAGE_DETAILS = [
20730
+ "low",
20731
+ "auto",
20732
+ "high"
20733
+ ];
20734
+ function isQianwenImageDetail(value) {
20735
+ return value === "low" || value === "auto" || value === "high";
20736
+ }
20737
+ //#endregion
20738
+ //#region src/client/qianwen-token-plan/locales.ts
20739
+ const NS_QIANWEN = "dsh-qianwen-token-plan";
20740
+ const zh$3 = {
20741
+ title: "Qwen Token Plan(千问)",
20742
+ pageDesc: "使用千问 Token Plan 专属 API Key 调用 Qwen4,管理显式缓存、思考回放、推理档位、模型和视觉预算。",
20743
+ loading: "加载中...",
20744
+ moreNotes: "更多说明",
20745
+ enabled: "启用此线路",
20746
+ keySection: "API Key",
20747
+ keyConfigured: "已配置套餐专属 API Key;凭据只保存在主机加密存储中。",
20748
+ keyMissing: "尚未配置 API Key。请在千问 Token Plan 控制台创建套餐专属 Key。",
20749
+ keyPlaceholder: "粘贴 Token Plan API Key(sk-sp-…)",
20750
+ saveKey: "保存 Key",
20751
+ savingKey: "保存中...",
20752
+ removeKey: "删除 Key",
20753
+ removingKey: "删除中...",
20754
+ storagePath: "加密存储",
20755
+ testConnection: "测试连接",
20756
+ testingConnection: "测试中...",
20757
+ connectionOk: "连接正常",
20758
+ connectionFailed: "连接失败",
20759
+ latency: "往返 {ms} 毫秒",
20760
+ routeOwned: "本插件正在服务该模型路由。",
20761
+ routeConflict: "模型路由被其他 Provider 占用:{detail}",
20762
+ cacheSection: "显式缓存",
20763
+ cacheDesc: "Qwen4 自动断点与稳定前缀断点共同复用输入;这里只统计本机 Token,不代表上游账单或剩余 Credits。",
20764
+ cacheEnabled: "启用显式缓存",
20765
+ cacheTtl: "缓存 TTL",
20766
+ ttl5m: "5 分钟(5m)",
20767
+ ttl1h: "1 小时(1h)",
20768
+ cacheHitRatio: "缓存命中率",
20769
+ cacheRead: "缓存读取",
20770
+ cacheMissed: "未缓存输入",
20771
+ cacheWrite5m: "5m 缓存写入",
20772
+ cacheWrite1h: "1h 缓存写入",
20773
+ cacheRequests: "统计请求数",
20774
+ reasoningTokens: "思考 Token",
20775
+ encryptedReplays: "密文回放次数",
20776
+ missingEncrypted: "密文缺失次数",
20777
+ cacheEmpty: "还没有缓存用量样本。",
20778
+ cacheUnavailable: "—",
20779
+ cacheHint: "缓存可能已过期:距最近请求约 {minutes} 分钟。",
20780
+ resetCache: "清空本地统计",
20781
+ thinkingSection: "思考",
20782
+ defaultEffort: "默认推理档位",
20783
+ effortDefault: "跟随上游默认(high)",
20784
+ effortNone: "关闭(none)",
20785
+ effortMinimal: "最低(minimal)",
20786
+ effortLow: "低(low)",
20787
+ effortMedium: "中(medium)",
20788
+ effortHigh: "高(high)",
20789
+ effortXhigh: "很高(xhigh)",
20790
+ effortMax: "最高(max)",
20791
+ effortHint: "所选档位原样发给上游;本线路不自动降档,也不同时发送 thinking_budget。会话中的档位选择优先于此默认值。",
20792
+ thinkingSummary: "启用 CoT 摘要与密文回放",
20793
+ thinkingSummaryHint: "Qwen4-Max 显示思考摘要,原样保存并回放 encrypted_content;密文不会进入可见正文或日志。",
20794
+ modelsSection: "模型",
20795
+ modelsHint: "勾选后模型才会出现在对话模型选择器中;preview 是上游限时模型,正式使用建议选择 qwen4-max。",
20796
+ selectAll: "全选",
20797
+ clearAll: "全不选",
20798
+ selectionHint: "清空全部勾选表示明确禁用本线路的所有模型,与首次安装的默认选择不同。",
20799
+ contextSection: "模型上下文窗口",
20800
+ contextHint: "覆盖值用于 DSH 压缩与溢出规划;默认 1M,可输入 256K、512K、1M 等容量。",
20801
+ contextEmpty: "尚未勾选模型。",
20802
+ tokens: "tokens",
20803
+ save: "保存",
20804
+ saving: "保存中...",
20805
+ reset: "恢复默认",
20806
+ resetAll: "全部恢复默认",
20807
+ invalidCapacity: "容量格式无效:{value}",
20808
+ visionSection: "视觉预算",
20809
+ imageDetail: "图片 detail",
20810
+ detailLow: "low(低成本)",
20811
+ detailAuto: "auto(默认上限)",
20812
+ detailHigh: "high(保留细节)",
20813
+ maxPixels: "max_pixels(可选)",
20814
+ maxPixelsPlaceholder: "留空使用线路默认",
20815
+ maxPixelsSave: "保存视觉预算",
20816
+ maxPixelsReset: "恢复默认",
20817
+ invalidPixels: "max_pixels 必须是 65536 至 16777216 的整数。",
20818
+ visionHint: "普通截图建议使用 auto/low;OCR 或细小文字可切换 high。显式 max_pixels 优先。",
20819
+ quotaNote: "本线路没有公开、可验证的剩余 Credits 查询接口,因此不显示余额或金额。",
20820
+ dashboard: "打开千问用量控制台",
20821
+ composerLabel: "Qwen 缓存",
20822
+ noQuota: "无配额数据",
20823
+ proxy: "代理"
20824
+ };
20825
+ const dictionaries$3 = {
20826
+ zh: zh$3,
20827
+ en: {
20828
+ title: "Qwen Token Plan",
20829
+ pageDesc: "Use a dedicated Qianwen Token Plan API key with Qwen4, explicit caching, thinking replay, all reasoning levels, models and visual budgets.",
20830
+ loading: "Loading...",
20831
+ moreNotes: "More details",
20832
+ enabled: "Enable this line",
20833
+ keySection: "API key",
20834
+ keyConfigured: "A dedicated plan key is configured and stored only in host encrypted storage.",
20835
+ keyMissing: "No API key yet. Create a dedicated key in the Qianwen Token Plan console.",
20836
+ keyPlaceholder: "Paste Token Plan API key (sk-sp-…)",
20837
+ saveKey: "Save key",
20838
+ savingKey: "Saving...",
20839
+ removeKey: "Remove key",
20840
+ removingKey: "Removing...",
20841
+ storagePath: "Encrypted storage",
20842
+ testConnection: "Test connection",
20843
+ testingConnection: "Testing...",
20844
+ connectionOk: "Connection OK",
20845
+ connectionFailed: "Connection failed",
20846
+ latency: "{ms} ms round trip",
20847
+ routeOwned: "This plugin serves the model route.",
20848
+ routeConflict: "Another provider owns the model route: {detail}",
20849
+ cacheSection: "Explicit cache",
20850
+ cacheDesc: "Qwen4 automatic and stable-prefix breakpoints reuse input. These are local token figures, not an upstream bill or remaining Credits.",
20851
+ cacheEnabled: "Enable explicit cache",
20852
+ cacheTtl: "Cache TTL",
20853
+ ttl5m: "5 minutes (5m)",
20854
+ ttl1h: "1 hour (1h)",
20855
+ cacheHitRatio: "Cache hit ratio",
20856
+ cacheRead: "Cache reads",
20857
+ cacheMissed: "Uncached input",
20858
+ cacheWrite5m: "5m cache writes",
20859
+ cacheWrite1h: "1h cache writes",
20860
+ cacheRequests: "Requests counted",
20861
+ reasoningTokens: "Reasoning tokens",
20862
+ encryptedReplays: "Encrypted replays",
20863
+ missingEncrypted: "Missing ciphertext",
20864
+ cacheEmpty: "No cache usage samples yet.",
20865
+ cacheUnavailable: "—",
20866
+ cacheHint: "The cache may be cold: about {minutes} minutes since the latest request.",
20867
+ resetCache: "Clear local stats",
20868
+ thinkingSection: "Thinking",
20869
+ defaultEffort: "Default reasoning effort",
20870
+ effortDefault: "Upstream default (high)",
20871
+ effortNone: "Off (none)",
20872
+ effortMinimal: "Minimal",
20873
+ effortLow: "Low",
20874
+ effortMedium: "Medium",
20875
+ effortHigh: "High",
20876
+ effortXhigh: "Very high (xhigh)",
20877
+ effortMax: "Max",
20878
+ effortHint: "The selected value is sent verbatim. This line never lowers it automatically and never sends thinking_budget alongside it. A per-conversation selection wins.",
20879
+ thinkingSummary: "Enable CoT summary and encrypted replay",
20880
+ thinkingSummaryHint: "Qwen4-Max displays a summary and preserves encrypted_content verbatim for replay; ciphertext never enters visible content or logs.",
20881
+ modelsSection: "Models",
20882
+ modelsHint: "Only checked models appear in the picker. Preview is time-limited upstream; prefer qwen4-max for stable use.",
20883
+ selectAll: "Select all",
20884
+ clearAll: "Clear all",
20885
+ selectionHint: "An explicitly empty selection disables every model on this line; it differs from the first-run default.",
20886
+ contextSection: "Model context windows",
20887
+ contextHint: "Overrides guide DSH compaction and overflow planning. The default is 1M; values such as 256K, 512K and 1M are accepted.",
20888
+ contextEmpty: "No models are checked.",
20889
+ tokens: "tokens",
20890
+ save: "Save",
20891
+ saving: "Saving...",
20892
+ reset: "Restore default",
20893
+ resetAll: "Restore all defaults",
20894
+ invalidCapacity: "Invalid capacity: {value}",
20895
+ visionSection: "Visual budget",
20896
+ imageDetail: "Image detail",
20897
+ detailLow: "low (lower cost)",
20898
+ detailAuto: "auto (default cap)",
20899
+ detailHigh: "high (more detail)",
20900
+ maxPixels: "max_pixels (optional)",
20901
+ maxPixelsPlaceholder: "Blank uses the line default",
20902
+ maxPixelsSave: "Save visual budget",
20903
+ maxPixelsReset: "Restore default",
20904
+ invalidPixels: "max_pixels must be an integer from 65536 through 16777216.",
20905
+ visionHint: "Use auto/low for ordinary screenshots and high for OCR or small text. Explicit max_pixels wins.",
20906
+ quotaNote: "No public verified remaining-Credits endpoint is available, so this card shows no balance or money.",
20907
+ dashboard: "Open Qianwen usage console",
20908
+ composerLabel: "Qwen cache",
20909
+ noQuota: "No quota data",
20910
+ proxy: "Proxy"
20911
+ }
20912
+ };
20913
+ //#endregion
20914
+ //#region src/client/qianwen-token-plan/api.ts
20915
+ const api$5 = createLineApi(QIANWEN_TOKEN_PLAN_ROUTE_PREFIX, QIANWEN_TOKEN_PLAN_PROVIDER_NAME);
20916
+ const get = api$5.get;
20917
+ const post = api$5.post;
20918
+ const request = api$5.request;
20919
+ const messageOf = (cause) => cause instanceof Error ? cause.message : String(cause);
20920
+ //#endregion
20921
+ //#region src/client/qianwen-token-plan/useQianwenSection.ts
20922
+ function qianwenCacheHitRatio(stats) {
20923
+ if (stats === null) return null;
20924
+ const denominator = stats.cacheReadTokens + stats.missedInputTokens + stats.cacheWriteTokens;
20925
+ return Number.isFinite(denominator) && denominator > 0 ? stats.cacheReadTokens / denominator : null;
20926
+ }
20927
+ function useQianwenSection({ onModelChange } = {}) {
20928
+ const [status, setStatus] = (0, react.useState)(null);
20929
+ const [loading, setLoading] = (0, react.useState)(true);
20930
+ const [busy, setBusy] = (0, react.useState)(null);
20931
+ const [error, setError] = (0, react.useState)(null);
20932
+ const [connection, setConnection] = (0, react.useState)(null);
20933
+ const [keyValue, setKeyValue] = (0, react.useState)("");
20934
+ const [contextDrafts, setContextDrafts] = (0, react.useState)({});
20935
+ const [savingModel, setSavingModel] = (0, react.useState)(null);
20936
+ const [pixelsDraft, setPixelsDraft] = (0, react.useState)("");
20937
+ const adopt = (0, react.useCallback)((next) => {
20938
+ setStatus(next);
20939
+ setContextDrafts(contextDraftsFor(next));
20940
+ setPixelsDraft(next.maxPixels === null ? "" : String(next.maxPixels));
20941
+ }, []);
20942
+ const loadStatus = (0, react.useCallback)(async (quiet = false) => {
20943
+ if (!quiet) setError(null);
20944
+ try {
20945
+ adopt(await get("/status"));
20946
+ } catch (cause) {
20947
+ if (!quiet) setError(messageOf(cause));
20948
+ } finally {
20949
+ setLoading(false);
20950
+ }
20951
+ }, [adopt]);
20952
+ (0, react.useEffect)(() => {
20953
+ loadStatus();
20954
+ const visible = () => {
20955
+ if (document.visibilityState === "visible") loadStatus(true);
20956
+ };
20957
+ const timer = window.setInterval(visible, 6e4);
20958
+ document.addEventListener("visibilitychange", visible);
20959
+ return () => {
20960
+ window.clearInterval(timer);
20961
+ document.removeEventListener("visibilitychange", visible);
20962
+ };
20963
+ }, [loadStatus]);
20964
+ const update = (0, react.useCallback)(async (patch, label = "settings") => {
20965
+ setBusy(label);
20966
+ setError(null);
20967
+ try {
20968
+ const next = await post("/settings", patch);
20969
+ adopt(next);
20970
+ if (patch.enabled !== void 0 || patch.enabledModelIds !== void 0 || patch.defaultReasoningEffort !== void 0) onModelChange?.();
20971
+ return next;
20972
+ } catch (cause) {
20973
+ setError(messageOf(cause));
20974
+ throw cause;
20975
+ } finally {
20976
+ setBusy(null);
20977
+ }
20978
+ }, [adopt, onModelChange]);
20979
+ const saveKey = (0, react.useCallback)(async () => {
20980
+ const apiKey = keyValue.trim();
20981
+ if (apiKey === "") return;
20982
+ setBusy("key");
20983
+ setError(null);
20984
+ try {
20985
+ adopt(await request("/credentials", {
20986
+ method: "PUT",
20987
+ body: JSON.stringify({ apiKey })
20988
+ }));
20989
+ setKeyValue("");
20990
+ setConnection(null);
20991
+ onModelChange?.();
20992
+ } catch (cause) {
20993
+ setError(messageOf(cause));
20994
+ } finally {
20995
+ setBusy(null);
20996
+ }
20997
+ }, [
20998
+ adopt,
20999
+ keyValue,
21000
+ onModelChange
21001
+ ]);
21002
+ const removeKey = (0, react.useCallback)(async () => {
21003
+ setBusy("remove-key");
21004
+ setError(null);
21005
+ try {
21006
+ adopt(await request("/credentials", { method: "DELETE" }));
21007
+ setConnection(null);
21008
+ onModelChange?.();
21009
+ } catch (cause) {
21010
+ setError(messageOf(cause));
21011
+ } finally {
21012
+ setBusy(null);
21013
+ }
21014
+ }, [adopt, onModelChange]);
21015
+ const testConnection = (0, react.useCallback)(async () => {
21016
+ setBusy("connection");
21017
+ setError(null);
21018
+ try {
21019
+ setConnection(await post("/connection", {}));
21020
+ } catch (cause) {
21021
+ setError(messageOf(cause));
21022
+ } finally {
21023
+ setBusy(null);
21024
+ }
21025
+ }, []);
21026
+ const toggleModel = (0, react.useCallback)((id, enabled) => {
21027
+ if (status === null) return;
21028
+ const ids = status.models.filter((model) => model.id === id ? enabled : model.enabled).map((model) => model.id);
21029
+ update({ enabledModelIds: ids }, "models").catch(() => void 0);
21030
+ }, [status, update]);
21031
+ const setAllModels = (0, react.useCallback)((enabled) => {
21032
+ if (status === null) return;
21033
+ update({ enabledModelIds: enabled ? status.models.map((model) => model.id) : [] }, "models").catch(() => void 0);
21034
+ }, [status, update]);
21035
+ const saveContextWindow = (0, react.useCallback)(async (id) => {
21036
+ const raw = contextDrafts[id] ?? "";
21037
+ const parsed = parsePositiveCapacity$1(raw);
21038
+ if (parsed === null) {
21039
+ setError("Invalid capacity: " + raw);
21040
+ return;
21041
+ }
21042
+ setSavingModel(id);
21043
+ try {
21044
+ await update({ contextWindowOverrides: { [id]: parsed } }, "context:" + id);
21045
+ } catch {} finally {
21046
+ setSavingModel(null);
21047
+ }
21048
+ }, [contextDrafts, update]);
21049
+ const resetContextWindow = (0, react.useCallback)(async (id) => {
21050
+ setSavingModel(id);
21051
+ try {
21052
+ await update({ contextWindowOverrides: { [id]: null } }, "context:" + id);
21053
+ } catch {} finally {
21054
+ setSavingModel(null);
21055
+ }
21056
+ }, [update]);
21057
+ const resetAllContextWindows = (0, react.useCallback)(async () => {
21058
+ const overrides = Object.fromEntries(Object.keys(status?.contextWindowOverrides ?? {}).map((id) => [id, null]));
21059
+ if (Object.keys(overrides).length > 0) await update({ contextWindowOverrides: overrides }, "context");
21060
+ }, [status, update]);
21061
+ const savePixels = (0, react.useCallback)(async () => {
21062
+ const raw = pixelsDraft.trim();
21063
+ const value = raw === "" ? null : Number(raw);
21064
+ if (value !== null && (!Number.isSafeInteger(value) || value < 65536 || value > 16777216)) {
21065
+ setError("max_pixels must be an integer from 65536 through 16777216.");
21066
+ return;
21067
+ }
21068
+ try {
21069
+ await update({ maxPixels: value }, "pixels");
21070
+ } catch {}
21071
+ }, [pixelsDraft, update]);
21072
+ return {
21073
+ status,
21074
+ loading,
21075
+ busy,
21076
+ error,
21077
+ connection,
21078
+ keyValue,
21079
+ contextDrafts,
21080
+ savingModel,
21081
+ pixelsDraft,
21082
+ cache: status?.cacheStats ?? null,
21083
+ cacheHitRatio: qianwenCacheHitRatio(status?.cacheStats ?? null),
21084
+ setKeyValue,
21085
+ setPixelsDraft,
21086
+ setContextDraft: (id, draft) => setContextDrafts((current) => ({
21087
+ ...current,
21088
+ [id]: draft
21089
+ })),
21090
+ saveKey,
21091
+ removeKey,
21092
+ testConnection,
21093
+ update,
21094
+ toggleModel,
21095
+ setAllModels,
21096
+ saveContextWindow,
21097
+ resetContextWindow,
21098
+ resetAllContextWindows,
21099
+ savePixels,
21100
+ setDefaultEffort: (defaultReasoningEffort) => update({ defaultReasoningEffort }, "effort"),
21101
+ setImageDetail: (imageDetail) => update({ imageDetail }, "vision"),
21102
+ clearCache: () => post("/cache/reset", {}).then(adopt)
21103
+ };
21104
+ }
21105
+ //#endregion
21106
+ //#region src/client/qianwen-token-plan/QianwenTokenPlanSection.tsx
21107
+ const EFFORT_KEYS = {
21108
+ none: "effortNone",
21109
+ minimal: "effortMinimal",
21110
+ low: "effortLow",
21111
+ medium: "effortMedium",
21112
+ high: "effortHigh",
21113
+ xhigh: "effortXhigh",
21114
+ max: "effortMax"
21115
+ };
21116
+ const tokenText = (value) => {
21117
+ try {
21118
+ return new Intl.NumberFormat().format(value);
21119
+ } catch {
21120
+ return String(value);
21121
+ }
21122
+ };
21123
+ const percentText = (value) => Math.round(value * 1e3) / 10 + "%";
21124
+ function more(title, lines) {
21125
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
21126
+ className: "dshqw-details",
21127
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: title }), lines.map((line) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: line }, line))]
21128
+ });
21129
+ }
21130
+ function stat(label, value) {
21131
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21132
+ className: "dshqw-stat",
21133
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tokenText(value) })]
21134
+ });
21135
+ }
21136
+ function QianwenTokenPlanSection(props = {}) {
21137
+ const t = useLineDict(NS_QIANWEN, zh$3);
21138
+ const view = useQianwenSection(props);
21139
+ const { status, busy } = view;
21140
+ if (view.loading && status === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21141
+ className: "dsha-empty",
21142
+ children: t.loading
21143
+ });
21144
+ const models = status?.models ?? [];
21145
+ const enabledModels = models.filter((model) => model.enabled);
21146
+ const cache = view.cache;
21147
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21148
+ className: "dsha-page dshqw-page",
21149
+ "data-provider": "qianwen-token-plan",
21150
+ children: [
21151
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21152
+ className: "dsha-group dshqw-account",
21153
+ children: [
21154
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21155
+ className: "dsha-grouphead",
21156
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.title }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21157
+ className: "dsha-actions",
21158
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21159
+ className: "dsha-btn",
21160
+ disabled: busy !== null || !status?.authenticated,
21161
+ onClick: () => void view.testConnection(),
21162
+ children: busy === "connection" ? t.testingConnection : t.testConnection
21163
+ }), status?.authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21164
+ className: "dsha-btn",
21165
+ disabled: busy !== null,
21166
+ onClick: () => void view.removeKey(),
21167
+ children: busy === "remove-key" ? t.removingKey : t.removeKey
21168
+ })]
21169
+ })]
21170
+ }),
21171
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21172
+ className: "dsha-muted",
21173
+ children: t.pageDesc
21174
+ }),
21175
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21176
+ className: "dsha-pref-row",
21177
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.enabled }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
21178
+ type: "checkbox",
21179
+ "aria-label": t.enabled,
21180
+ checked: status?.enabled !== false,
21181
+ disabled: busy !== null,
21182
+ onChange: (event) => void view.update({ enabled: event.currentTarget.checked }).catch(() => void 0)
21183
+ })]
21184
+ }),
21185
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21186
+ className: "dsha-empty",
21187
+ children: status?.authenticated ? t.keyConfigured : t.keyMissing
21188
+ }),
21189
+ status?.authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21190
+ className: "dsha-row",
21191
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
21192
+ className: "dsha-label",
21193
+ children: t.storagePath
21194
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
21195
+ className: "dsha-value",
21196
+ children: status.storagePath
21197
+ })]
21198
+ }),
21199
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21200
+ className: "dshqw-key-row",
21201
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
21202
+ className: "dsha-select",
21203
+ type: "password",
21204
+ autoComplete: "off",
21205
+ "aria-label": t.keySection,
21206
+ placeholder: t.keyPlaceholder,
21207
+ value: view.keyValue,
21208
+ disabled: busy !== null,
21209
+ onChange: (event) => view.setKeyValue(event.currentTarget.value),
21210
+ onKeyDown: (event) => {
21211
+ if (event.key === "Enter") view.saveKey();
21212
+ }
21213
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21214
+ className: "dsha-btn dsha-btn-primary",
21215
+ disabled: busy !== null || view.keyValue.trim() === "",
21216
+ onClick: () => void view.saveKey(),
21217
+ children: busy === "key" ? t.savingKey : t.saveKey
21218
+ })]
21219
+ }),
21220
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21221
+ className: "dsha-muted",
21222
+ children: status?.serving === false && status.conflict ? t.routeConflict.replace("{detail}", status.conflict) : t.routeOwned
21223
+ }),
21224
+ view.connection !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21225
+ className: view.connection.connected ? "dsha-muted" : "dsha-notice",
21226
+ children: view.connection.connected ? t.connectionOk + " · " + t.latency.replace("{ms}", String(view.connection.latencyMs)) : t.connectionFailed + ": " + (view.connection.error ?? "—")
21227
+ })
21228
+ ]
21229
+ }),
21230
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21231
+ className: "dsha-group dshqw-cache",
21232
+ children: [
21233
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21234
+ className: "dsha-grouphead",
21235
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.cacheSection }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21236
+ className: "dsha-btn",
21237
+ disabled: busy !== null || cache === null,
21238
+ onClick: () => void view.clearCache(),
21239
+ children: t.resetCache
21240
+ })]
21241
+ }),
21242
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21243
+ className: "dsha-muted",
21244
+ children: t.cacheDesc
21245
+ }),
21246
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21247
+ className: "dsha-pref-row",
21248
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.cacheEnabled }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
21249
+ type: "checkbox",
21250
+ "aria-label": t.cacheEnabled,
21251
+ checked: status?.cacheEnabled === true,
21252
+ disabled: busy !== null,
21253
+ onChange: (event) => void view.update({ cacheEnabled: event.currentTarget.checked }).catch(() => void 0)
21254
+ })]
21255
+ }),
21256
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21257
+ className: "dsha-pref-row",
21258
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.cacheTtl }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
21259
+ className: "dsha-select",
21260
+ "aria-label": t.cacheTtl,
21261
+ value: status?.cacheTtl ?? "5m",
21262
+ disabled: busy !== null || status?.cacheEnabled !== true,
21263
+ onChange: (event) => {
21264
+ const value = event.currentTarget.value;
21265
+ if (isQianwenCacheTtl(value)) view.update({ cacheTtl: value }).catch(() => void 0);
21266
+ },
21267
+ children: QIANWEN_CACHE_TTLS.map((ttl) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
21268
+ value: ttl,
21269
+ children: ttl === "5m" ? t.ttl5m : t.ttl1h
21270
+ }, ttl))
21271
+ })]
21272
+ }),
21273
+ cache === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21274
+ className: "dsha-empty",
21275
+ children: t.cacheEmpty
21276
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21277
+ className: "dsha-meter-label",
21278
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: view.cacheHitRatio === null ? t.cacheUnavailable : percentText(view.cacheHitRatio) })]
21279
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21280
+ className: "dshqw-stats",
21281
+ children: [
21282
+ stat(t.cacheRequests, cache.requests),
21283
+ stat(t.cacheRead, cache.cacheReadTokens),
21284
+ stat(t.cacheMissed, cache.missedInputTokens),
21285
+ stat(t.cacheWrite5m, cache.cacheWrite5mTokens),
21286
+ stat(t.cacheWrite1h, cache.cacheWrite1hTokens),
21287
+ stat(t.reasoningTokens, cache.reasoningTokens),
21288
+ stat(t.encryptedReplays, cache.encryptedReplays),
21289
+ stat(t.missingEncrypted, cache.missingEncryptedContent)
21290
+ ]
21291
+ })] }),
21292
+ status?.cacheHint && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21293
+ className: "dsha-muted",
21294
+ children: t.cacheHint.replace("{minutes}", String(Math.floor(status.cacheHint.idleMs / 6e4)))
21295
+ }),
21296
+ more(t.moreNotes, [t.quotaNote]),
21297
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21298
+ className: "dsha-actions",
21299
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
21300
+ href: "https://platform.qianwenai.com/home/analytics/token-plan/individual",
21301
+ target: "_blank",
21302
+ rel: "noreferrer",
21303
+ children: t.dashboard
21304
+ })
21305
+ })
21306
+ ]
21307
+ }),
21308
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21309
+ className: "dsha-group dshqw-thinking",
21310
+ children: [
21311
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21312
+ className: "dsha-grouphead",
21313
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.thinkingSection })
21314
+ }),
21315
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21316
+ className: "dsha-pref-row",
21317
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.defaultEffort }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21318
+ className: "dsha-muted",
21319
+ children: t.effortHint
21320
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
21321
+ className: "dsha-select",
21322
+ "aria-label": t.defaultEffort,
21323
+ value: status?.defaultReasoningEffort ?? "",
21324
+ disabled: busy !== null,
21325
+ onChange: (event) => {
21326
+ const value = event.currentTarget.value;
21327
+ view.setDefaultEffort(isQianwenReasoningEffort(value) ? value : null).catch(() => void 0);
21328
+ },
21329
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
21330
+ value: "",
21331
+ children: t.effortDefault
21332
+ }), QIANWEN_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
21333
+ value: effort,
21334
+ children: t[EFFORT_KEYS[effort]]
21335
+ }, effort))]
21336
+ })]
21337
+ }),
21338
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21339
+ className: "dsha-pref-row",
21340
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.thinkingSummary }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21341
+ className: "dsha-muted",
21342
+ children: t.thinkingSummaryHint
21343
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
21344
+ type: "checkbox",
21345
+ "aria-label": t.thinkingSummary,
21346
+ checked: status?.thinkingSummary === true,
21347
+ disabled: busy !== null,
21348
+ onChange: (event) => void view.update({ thinkingSummary: event.currentTarget.checked }).catch(() => void 0)
21349
+ })]
21350
+ })
21351
+ ]
21352
+ }),
21353
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21354
+ className: "dsha-group dshqw-models",
21355
+ children: [
21356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21357
+ className: "dsha-grouphead",
21358
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.modelsSection })
21359
+ }),
21360
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21361
+ className: "dsha-muted",
21362
+ children: t.modelsHint
21363
+ }),
21364
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelChecklist, {
21365
+ items: models.map((model) => ({
21366
+ id: model.id,
21367
+ name: model.name,
21368
+ hint: model.hint,
21369
+ enabled: model.enabled
21370
+ })),
21371
+ busy: busy !== null,
21372
+ onToggle: view.toggleModel,
21373
+ onToggleAll: view.setAllModels,
21374
+ labels: {
21375
+ selectAll: t.selectAll,
21376
+ clearAll: t.clearAll,
21377
+ list: t.modelsSection
21378
+ }
21379
+ }),
21380
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21381
+ className: "dsha-muted",
21382
+ children: t.selectionHint
21383
+ })
21384
+ ]
21385
+ }),
21386
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21387
+ className: "dsha-group dshqw-context",
21388
+ children: [
21389
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21390
+ className: "dsha-grouphead",
21391
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.contextSection })
21392
+ }),
21393
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21394
+ className: "dsha-muted",
21395
+ children: t.contextHint
21396
+ }),
21397
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextWindowEditor, {
21398
+ rows: enabledModels.map((model) => ({
21399
+ id: model.id,
21400
+ name: model.name,
21401
+ draft: view.contextDrafts[model.id] ?? "",
21402
+ meta: model.contextWindow !== model.defaultContextWindow ? formatCapacity$1(model.contextWindow) : void 0,
21403
+ inputLabel: model.name + " " + t.contextSection,
21404
+ hasOverride: status?.contextWindowOverrides[model.id] !== void 0,
21405
+ saving: view.savingModel === model.id
21406
+ })),
21407
+ labels: {
21408
+ tokens: t.tokens,
21409
+ save: t.save,
21410
+ saving: t.saving,
21411
+ reset: t.reset,
21412
+ resetAll: t.resetAll,
21413
+ empty: t.contextEmpty
21414
+ },
21415
+ busy: busy !== null,
21416
+ overrideCount: Object.keys(status?.contextWindowOverrides ?? {}).length,
21417
+ metaClassName: "dshqw-model-meta",
21418
+ onDraftChange: view.setContextDraft,
21419
+ onCommit: (id) => void view.saveContextWindow(id),
21420
+ onReset: (id) => void view.resetContextWindow(id),
21421
+ onResetAll: () => void view.resetAllContextWindows().catch(() => void 0)
21422
+ })
21423
+ ]
21424
+ }),
21425
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
21426
+ className: "dsha-group dshqw-vision",
21427
+ children: [
21428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21429
+ className: "dsha-grouphead",
21430
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.visionSection })
21431
+ }),
21432
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
21433
+ className: "dsha-muted",
21434
+ children: t.visionHint
21435
+ }),
21436
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21437
+ className: "dsha-pref-row",
21438
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.imageDetail }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
21439
+ className: "dsha-select",
21440
+ "aria-label": t.imageDetail,
21441
+ value: status?.imageDetail ?? "auto",
21442
+ disabled: busy !== null,
21443
+ onChange: (event) => {
21444
+ const value = event.currentTarget.value;
21445
+ if (isQianwenImageDetail(value)) view.setImageDetail(value).catch(() => void 0);
21446
+ },
21447
+ children: QIANWEN_IMAGE_DETAILS.map((detail) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
21448
+ value: detail,
21449
+ children: detail === "low" ? t.detailLow : detail === "high" ? t.detailHigh : t.detailAuto
21450
+ }, detail))
21451
+ })]
21452
+ }),
21453
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21454
+ className: "dshqw-key-row dshqw-vision-row",
21455
+ children: [
21456
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
21457
+ className: "dsha-select",
21458
+ inputMode: "numeric",
21459
+ "aria-label": t.maxPixels,
21460
+ placeholder: t.maxPixelsPlaceholder,
21461
+ value: view.pixelsDraft,
21462
+ disabled: busy !== null,
21463
+ onChange: (event) => view.setPixelsDraft(event.currentTarget.value)
21464
+ }),
21465
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21466
+ className: "dsha-btn",
21467
+ disabled: busy !== null,
21468
+ onClick: () => void view.savePixels(),
21469
+ children: t.maxPixelsSave
21470
+ }),
21471
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21472
+ className: "dsha-btn",
21473
+ disabled: busy !== null || view.pixelsDraft === "",
21474
+ onClick: () => {
21475
+ view.setPixelsDraft("");
21476
+ view.update({ maxPixels: null }, "pixels").catch(() => void 0);
21477
+ },
21478
+ children: t.maxPixelsReset
21479
+ })
21480
+ ]
21481
+ }),
21482
+ more(t.moreNotes, [t.invalidPixels])
21483
+ ]
21484
+ }),
21485
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "qianwen-token-plan" }),
21486
+ view.error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21487
+ className: "dsha-error",
21488
+ children: view.error
21489
+ })
21490
+ ]
21491
+ });
21492
+ }
21493
+ //#endregion
20693
21494
  //#region src/client/hub/providers.tsx
20694
21495
  /** One POST to a line's settings endpoint, answered with that line's refreshed status. */
20695
21496
  async function postLineSettings(prefix, body) {
@@ -20814,6 +21615,12 @@ window.__ModuleLoader__.load({
20814
21615
  name: "Antigravity (ACP)",
20815
21616
  setEnabled: (enabled) => postLineSettings("/antigravity-acp/api", { enabled }),
20816
21617
  renderDetail: ({ onModelChange }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AntigravityAcpSection, { onModelChange })
21618
+ },
21619
+ {
21620
+ id: "qianwen-token-plan",
21621
+ name: QIANWEN_TOKEN_PLAN_PROVIDER_NAME,
21622
+ setEnabled: (enabled) => postLineSettings(QIANWEN_TOKEN_PLAN_ROUTE_PREFIX, { enabled }),
21623
+ renderDetail: ({ onModelChange }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(QianwenTokenPlanSection, { onModelChange })
20817
21624
  }
20818
21625
  ];
20819
21626
  function hubProviderDescriptor(id) {
@@ -21651,7 +22458,7 @@ window.__ModuleLoader__.load({
21651
22458
  * account-pool labels come from `./account-pool.ts`, with the same overrides the
21652
22459
  * source applies on top of them.
21653
22460
  */
21654
- const dictionary$14 = {
22461
+ const dictionary$15 = {
21655
22462
  ...accountPoolRu,
21656
22463
  title: "Claude (подписка)",
21657
22464
  pageDesc: "Войдите в подписку Claude Pro/Max и управляйте моделями, уровнями рассуждений, контекстными окнами и квотой.",
@@ -21770,7 +22577,7 @@ window.__ModuleLoader__.load({
21770
22577
  };
21771
22578
  //#endregion
21772
22579
  //#region src/client/locales-ru/cline-pass.ts
21773
- const dictionary$13 = {
22580
+ const dictionary$14 = {
21774
22581
  ...accountPoolRu,
21775
22582
  relogin: "Войти заново",
21776
22583
  needsRelogin: "Вход истёк",
@@ -21896,7 +22703,7 @@ window.__ModuleLoader__.load({
21896
22703
  };
21897
22704
  //#endregion
21898
22705
  //#region src/client/locales-ru/command-code.ts
21899
- const dictionary$12 = {
22706
+ const dictionary$13 = {
21900
22707
  ...accountPoolRu,
21901
22708
  title: "Command Code",
21902
22709
  pageDesc: "Войдите в Command Code и управляйте моделями, контекстными окнами и квотой.",
@@ -21966,7 +22773,7 @@ window.__ModuleLoader__.load({
21966
22773
  };
21967
22774
  //#endregion
21968
22775
  //#region src/client/locales-ru/glm-coding-plan.ts
21969
- const dictionary$11 = {
22776
+ const dictionary$12 = {
21970
22777
  ...accountPoolRu,
21971
22778
  title: "GLM (аккаунт ZCode)",
21972
22779
  pageDesc: "Вход аккаунтом ZCode подключает GLM Coding Plan (Китай — bigmodel.cn, международный — z.ai). Здесь же пул аккаунтов, квота тарифа и выбор моделей. Учётные данные двух регионов независимы, поэтому в одном пуле могут быть аккаунты обоих.",
@@ -22069,7 +22876,7 @@ window.__ModuleLoader__.load({
22069
22876
  * account-pool labels come from `./account-pool.ts`, with the same overrides the
22070
22877
  * source applies on top of them.
22071
22878
  */
22072
- const dictionary$10 = {
22879
+ const dictionary$11 = {
22073
22880
  ...accountPoolRu,
22074
22881
  title: "ChatGPT",
22075
22882
  hubTitle: "Подписки",
@@ -22283,6 +23090,7 @@ window.__ModuleLoader__.load({
22283
23090
  "cardName.opendesign": "OpenDesign",
22284
23091
  "cardName.workbuddy": "WorkBuddy",
22285
23092
  "cardName.antigravity-acp": "Antigravity (ACP)",
23093
+ "cardName.qianwen-token-plan": "Qwen Token Plan",
22286
23094
  modelChecklistCount: "Включено {count}/{total}",
22287
23095
  codeRunTitle: "Код",
22288
23096
  codeRunOutput: "Вывод",
@@ -22298,7 +23106,7 @@ window.__ModuleLoader__.load({
22298
23106
  };
22299
23107
  //#endregion
22300
23108
  //#region src/client/locales-ru/kimi-code.ts
22301
- const dictionary$9 = {
23109
+ const dictionary$10 = {
22302
23110
  ...accountPoolRu,
22303
23111
  title: "Kimi Code",
22304
23112
  pageDesc: "Вход в подписку Kimi Code: модели, уровень рассуждений, контекстные окна и квота.",
@@ -22487,7 +23295,7 @@ window.__ModuleLoader__.load({
22487
23295
  };
22488
23296
  //#endregion
22489
23297
  //#region src/client/locales-ru/minimax-code.ts
22490
- const dictionary$8 = {
23298
+ const dictionary$9 = {
22491
23299
  ...accountPoolRu,
22492
23300
  title: "MiniMax Code",
22493
23301
  pageDesc: "Вход в подписку MiniMax Code для программирования (OAuth по коду устройства) с переиспользованием локального входа MiniMax Code: управление аккаунтом, подключением и моделями.",
@@ -22687,7 +23495,7 @@ window.__ModuleLoader__.load({
22687
23495
  };
22688
23496
  //#endregion
22689
23497
  //#region src/client/locales-ru/ollama.ts
22690
- const dictionary$7 = {
23498
+ const dictionary$8 = {
22691
23499
  ...accountPoolRu,
22692
23500
  relogin: "Заменить ключ",
22693
23501
  needsRelogin: "Ключ отклонён",
@@ -22741,7 +23549,7 @@ window.__ModuleLoader__.load({
22741
23549
  };
22742
23550
  //#endregion
22743
23551
  //#region src/client/locales-ru/antigravity-acp.ts
22744
- const dictionary$6 = {
23552
+ const dictionary$7 = {
22745
23553
  title: "Antigravity (ACP)",
22746
23554
  pageDesc: "Подключение через официальный Antigravity CLI от Google по Agent Client Protocol (ACP): модель, инструменты и сессии приходят от официального процесса, и он же хранит состояние входа.",
22747
23555
  routeOwned: "Маршрут моделей обслуживает этот плагин",
@@ -22835,7 +23643,7 @@ window.__ModuleLoader__.load({
22835
23643
  };
22836
23644
  //#endregion
22837
23645
  //#region src/client/locales-ru/opendesign.ts
22838
- const dictionary$5 = {
23646
+ const dictionary$6 = {
22839
23647
  ...accountPoolRu,
22840
23648
  relogin: "Добавить заново",
22841
23649
  needsRelogin: "API-ключ недействителен",
@@ -22945,7 +23753,7 @@ window.__ModuleLoader__.load({
22945
23753
  };
22946
23754
  //#endregion
22947
23755
  //#region src/client/locales-ru/dispatch-ledger.ts
22948
- const dictionary$4 = {
23756
+ const dictionary$5 = {
22949
23757
  mandateTitle: "Запуск субагента",
22950
23758
  mandateTitleFork: "Запуск субагента (с контекстом)",
22951
23759
  mandatePreparing: "Сборка задания",
@@ -22970,7 +23778,7 @@ window.__ModuleLoader__.load({
22970
23778
  };
22971
23779
  //#endregion
22972
23780
  //#region src/client/locales-ru/progress-updates.ts
22973
- const dictionary$3 = {
23781
+ const dictionary$4 = {
22974
23782
  navTitle: "Ход работы",
22975
23783
  progressTitle: "Ход работы",
22976
23784
  progressGuideNote: "Каждый шаг, о котором сообщает агент, собирается здесь",
@@ -23026,7 +23834,7 @@ window.__ModuleLoader__.load({
23026
23834
  };
23027
23835
  //#endregion
23028
23836
  //#region src/client/locales-ru/qoder.ts
23029
- const dictionary$2 = {
23837
+ const dictionary$3 = {
23030
23838
  modelRowEfforts: "уровни {list}",
23031
23839
  modelRowNoEfforts: "без уровней",
23032
23840
  modelRowOutput: "вывод {cap}",
@@ -23148,7 +23956,7 @@ window.__ModuleLoader__.load({
23148
23956
  };
23149
23957
  //#endregion
23150
23958
  //#region src/client/locales-ru/step-code.ts
23151
- const dictionary$1 = {
23959
+ const dictionary$2 = {
23152
23960
  ...accountPoolRu,
23153
23961
  title: "Step Code (подписка Step Plan)",
23154
23962
  pageDesc: "Подключение к StepFun по подписке Step Plan (Китай api.stepfun.com / международный api.stepfun.ai) или по API-ключу открытой платформы: пул аккаунтов, квота тарифа, расход кеша и выбор моделей. Регион — свойство учётных данных, и два региона несовместимы, поэтому в пуле могут быть аккаунты из обоих.",
@@ -23325,7 +24133,7 @@ window.__ModuleLoader__.load({
23325
24133
  * dropped '{placeholder}' would turn a sentence into a bald claim. 'test/
23326
24134
  * russian-locale.test.tsx' pins both rules.
23327
24135
  */
23328
- const dictionary = {
24136
+ const dictionary$1 = {
23329
24137
  title: "WorkBuddy",
23330
24138
  pageDesc: "Повторно использует локальный вход CodeBuddy, чтобы управлять моделями WorkBuddy (подписка CodeBuddy), контекстными окнами и квотой.",
23331
24139
  account: "Аккаунт",
@@ -23451,6 +24259,93 @@ window.__ModuleLoader__.load({
23451
24259
  modelCooldownActive: "Модель приостановлена",
23452
24260
  notRoutable: "Сейчас не маршрутизируется"
23453
24261
  };
24262
+ //#endregion
24263
+ //#region src/client/locales-ru/qianwen-token-plan.ts
24264
+ const dictionary = {
24265
+ title: "Qwen Token Plan",
24266
+ pageDesc: "Подключение Qwen4 по выделенному API-ключу Qianwen Token Plan: явный кеш, воспроизведение размышлений, уровни reasoning, модели и визуальный бюджет.",
24267
+ loading: "Загрузка…",
24268
+ moreNotes: "Подробнее",
24269
+ enabled: "Включить линию",
24270
+ keySection: "API-ключ",
24271
+ keyConfigured: "Выделенный ключ настроен и хранится только в зашифрованном хранилище host.",
24272
+ keyMissing: "API-ключ не настроен. Создайте выделенный ключ в консоли Qianwen Token Plan.",
24273
+ keyPlaceholder: "Вставьте API-ключ Token Plan (sk-sp-…)",
24274
+ saveKey: "Сохранить ключ",
24275
+ savingKey: "Сохранение…",
24276
+ removeKey: "Удалить ключ",
24277
+ removingKey: "Удаление…",
24278
+ storagePath: "Зашифрованное хранилище",
24279
+ testConnection: "Проверить соединение",
24280
+ testingConnection: "Проверка…",
24281
+ connectionOk: "Соединение работает",
24282
+ connectionFailed: "Ошибка соединения",
24283
+ latency: "{ms} мс",
24284
+ routeOwned: "Этот плагин обслуживает маршрут модели.",
24285
+ routeConflict: "Маршрут занят другим провайдером: {detail}",
24286
+ cacheSection: "Явный кеш",
24287
+ cacheDesc: "Автоматические и стабильные точки кеширования Qwen4 повторно используют ввод. Это локальные токены, а не счёт апстрима или остаток Credits.",
24288
+ cacheEnabled: "Включить явный кеш",
24289
+ cacheTtl: "TTL кеша",
24290
+ ttl5m: "5 минут (5m)",
24291
+ ttl1h: "1 час (1h)",
24292
+ cacheHitRatio: "Доля попаданий",
24293
+ cacheRead: "Прочитано из кеша",
24294
+ cacheMissed: "Ввод вне кеша",
24295
+ cacheWrite5m: "Запись кеша 5m",
24296
+ cacheWrite1h: "Запись кеша 1h",
24297
+ cacheRequests: "Учтено запросов",
24298
+ reasoningTokens: "Токены reasoning",
24299
+ encryptedReplays: "Зашифрованных повторов",
24300
+ missingEncrypted: "Отсутствует шифротекст",
24301
+ cacheEmpty: "Пока нет данных об использовании кеша.",
24302
+ cacheUnavailable: "—",
24303
+ cacheHint: "Кеш мог остыть: с последнего запроса прошло около {minutes} мин.",
24304
+ resetCache: "Очистить локальную статистику",
24305
+ thinkingSection: "Размышления",
24306
+ defaultEffort: "Уровень reasoning по умолчанию",
24307
+ effortDefault: "По умолчанию апстрима (high)",
24308
+ effortNone: "Выкл. (none)",
24309
+ effortMinimal: "Минимальный",
24310
+ effortLow: "Низкий",
24311
+ effortMedium: "Средний",
24312
+ effortHigh: "Высокий",
24313
+ effortXhigh: "Очень высокий (xhigh)",
24314
+ effortMax: "Максимальный",
24315
+ effortHint: "Выбранное значение передаётся без изменений. Плагин не понижает его автоматически и не добавляет thinking_budget. Выбор в текущем разговоре имеет приоритет.",
24316
+ thinkingSummary: "Включить сводку CoT и зашифрованный повтор",
24317
+ thinkingSummaryHint: "Qwen4-Max показывает сводку и сохраняет encrypted_content для повтора; шифротекст не попадает в видимый текст или журналы.",
24318
+ modelsSection: "Модели",
24319
+ modelsHint: "В выборе моделей появляются только отмеченные строки. Preview ограничен по времени; для стабильной работы выберите qwen4-max.",
24320
+ selectAll: "Выбрать все",
24321
+ clearAll: "Снять все",
24322
+ selectionHint: "Явно пустой выбор отключает все модели линии; это отличается от первоначальной настройки.",
24323
+ contextSection: "Контекстные окна",
24324
+ contextHint: "Переопределения управляют сжатием и переполнением DSH. По умолчанию 1M; допустимы 256K, 512K, 1M и другие значения.",
24325
+ contextEmpty: "Модели не выбраны.",
24326
+ tokens: "токенов",
24327
+ save: "Сохранить",
24328
+ saving: "Сохранение…",
24329
+ reset: "Сбросить",
24330
+ resetAll: "Сбросить все",
24331
+ invalidCapacity: "Неверная ёмкость: {value}",
24332
+ visionSection: "Визуальный бюджет",
24333
+ imageDetail: "Параметр detail",
24334
+ detailLow: "low (экономно)",
24335
+ detailAuto: "auto (обычный предел)",
24336
+ detailHigh: "high (больше деталей)",
24337
+ maxPixels: "max_pixels (необязательно)",
24338
+ maxPixelsPlaceholder: "Пусто — значение по умолчанию",
24339
+ maxPixelsSave: "Сохранить визуальный бюджет",
24340
+ maxPixelsReset: "Сбросить",
24341
+ invalidPixels: "max_pixels должно быть целым числом от 65536 до 16777216.",
24342
+ visionHint: "Для обычных снимков используйте auto/low, для OCR и мелкого текста — high. Явный max_pixels имеет приоритет.",
24343
+ quotaNote: "Публичного проверенного API остатка Credits нет, поэтому баланс и денежные суммы не показываются.",
24344
+ dashboard: "Открыть консоль использования Qianwen",
24345
+ composerLabel: "Кеш Qwen",
24346
+ noQuota: "Нет данных квоты",
24347
+ proxy: "Прокси"
24348
+ };
23454
24349
  /**
23455
24350
  * Register the Russian language and every dictionary it covers.
23456
24351
  *
@@ -23473,21 +24368,22 @@ window.__ModuleLoader__.load({
23473
24368
  }
23474
24369
  }, "dsh-chatgpt-subscription: ru language");
23475
24370
  const dictionaries = [
23476
- [NS, dictionary$10],
23477
- [NS_CLAUDE, dictionary$14],
23478
- [NS_COMMAND_CODE, dictionary$12],
23479
- [NS_KIMI_CODE, dictionary$9],
23480
- [NS_MINIMAX_CODE, dictionary$8],
23481
- [NS_GLM_CODING_PLAN, dictionary$11],
23482
- [NS_OLLAMA, dictionary$7],
23483
- [NS_STEP_CODE, dictionary$1],
23484
- [NS_CLINE_PASS, dictionary$13],
23485
- [NS_QODER, dictionary$2],
23486
- [NS_OPENDESIGN, dictionary$5],
23487
- [NS_PROGRESS_UPDATES, dictionary$3],
23488
- [NS_WORKBUDDY, dictionary],
23489
- [NS_DISPATCH_LEDGER, dictionary$4],
23490
- [NS_ANTIGRAVITY_ACP, dictionary$6]
24371
+ [NS, dictionary$11],
24372
+ [NS_CLAUDE, dictionary$15],
24373
+ [NS_COMMAND_CODE, dictionary$13],
24374
+ [NS_KIMI_CODE, dictionary$10],
24375
+ [NS_MINIMAX_CODE, dictionary$9],
24376
+ [NS_GLM_CODING_PLAN, dictionary$12],
24377
+ [NS_OLLAMA, dictionary$8],
24378
+ [NS_STEP_CODE, dictionary$2],
24379
+ [NS_CLINE_PASS, dictionary$14],
24380
+ [NS_QODER, dictionary$3],
24381
+ [NS_OPENDESIGN, dictionary$6],
24382
+ [NS_PROGRESS_UPDATES, dictionary$4],
24383
+ [NS_WORKBUDDY, dictionary$1],
24384
+ [NS_DISPATCH_LEDGER, dictionary$5],
24385
+ [NS_ANTIGRAVITY_ACP, dictionary$7],
24386
+ [NS_QIANWEN, dictionary]
23491
24387
  ];
23492
24388
  for (const [ns, dictionary] of dictionaries) ctx.effect(() => {
23493
24389
  try {
@@ -24030,7 +24926,7 @@ window.__ModuleLoader__.load({
24030
24926
  }
24031
24927
  //#endregion
24032
24928
  //#region src/client/claude/styles.ts
24033
- const STYLE_ID$7 = "dsh-claude-settings-style";
24929
+ const STYLE_ID$8 = "dsh-claude-settings-style";
24034
24930
  /**
24035
24931
  * Claude-only additions to the shared settings design system.
24036
24932
  *
@@ -24054,7 +24950,7 @@ window.__ModuleLoader__.load({
24054
24950
  .dshcl-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;overflow-wrap:anywhere}
24055
24951
  .dshcl-model-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;margin-left:5px}
24056
24952
  .dshcl-empty-inline{color:var(--dsw-alias-label-tertiary);font-size:12px}
24057
- `, STYLE_ID$7);
24953
+ `, STYLE_ID$8);
24058
24954
  }
24059
24955
  //#endregion
24060
24956
  //#region src/client/command-code/CommandCodeComposerQuota.tsx
@@ -24171,7 +25067,7 @@ window.__ModuleLoader__.load({
24171
25067
  }
24172
25068
  //#endregion
24173
25069
  //#region src/client/kimi-code/styles.ts
24174
- const STYLE_ID$6 = "dsh-kimi-code-settings-style";
25070
+ const STYLE_ID$7 = "dsh-kimi-code-settings-style";
24175
25071
  /**
24176
25072
  * Node the base control styles come from.
24177
25073
  *
@@ -24313,7 +25209,7 @@ window.__ModuleLoader__.load({
24313
25209
  `;
24314
25210
  /** Kimi-specific rules layered on top of the shared control styles. */
24315
25211
  function installKimiCodeStyles() {
24316
- installPluginStyle("kimi-code", BASE, STYLE_ID$6);
25212
+ installPluginStyle("kimi-code", BASE, STYLE_ID$7);
24317
25213
  }
24318
25214
  //#endregion
24319
25215
  //#region src/client/minimax-code/MinimaxCodeComposerQuota.tsx
@@ -24449,7 +25345,7 @@ window.__ModuleLoader__.load({
24449
25345
  //#region src/client/minimax-code/MinimaxVideoDocumentBody.tsx
24450
25346
  /** 兜底翻译:只在没有 locale 座位时用到。 */
24451
25347
  function translate$1(key) {
24452
- return zh$12[key] ?? key;
25348
+ return zh$13[key] ?? key;
24453
25349
  }
24454
25350
  /**
24455
25351
  * 一个文件地址里的会话与路径。
@@ -24585,7 +25481,7 @@ window.__ModuleLoader__.load({
24585
25481
  */
24586
25482
  /** 兜底翻译:只在没有 locale 座位时用到,走同一份 zh 字典。 */
24587
25483
  function translate(key) {
24588
- return zh$12[key] ?? key;
25484
+ return zh$13[key] ?? key;
24589
25485
  }
24590
25486
  /**
24591
25487
  * 一张视频工具卡片。
@@ -24855,7 +25751,7 @@ window.__ModuleLoader__.load({
24855
25751
  }
24856
25752
  //#endregion
24857
25753
  //#region src/client/minimax-code/styles.ts
24858
- const STYLE_ID$5 = "dsh-minimax-code-settings-style";
25754
+ const STYLE_ID$6 = "dsh-minimax-code-settings-style";
24859
25755
  /**
24860
25756
  * MiniMax Code-only additions to the shared settings design system.
24861
25757
  *
@@ -25024,7 +25920,7 @@ window.__ModuleLoader__.load({
25024
25920
  .dshm-video-history-meta{color:var(--dsw-alias-label-tertiary);flex:none;font-size:11px;font-variant-numeric:tabular-nums}
25025
25921
  @media(max-width:560px){.dshm-video-modal-root{padding:12px 8px}.dshm-video-modal{max-height:calc(100vh - 24px)}.dshm-video-field-row{flex-direction:column;gap:8px}.dshm-video-foot-hint{display:none}}
25026
25922
  @media(prefers-reduced-motion:reduce){.dshm-video-skeleton span{animation:none;opacity:.6}}
25027
- `, STYLE_ID$5);
25923
+ `, STYLE_ID$6);
25028
25924
  }
25029
25925
  //#endregion
25030
25926
  //#region src/client/glm-coding-plan/GlmCodingPlanComposerQuota.tsx
@@ -25041,7 +25937,7 @@ window.__ModuleLoader__.load({
25041
25937
  * 没有快照、没有窗口、或全部窗口都没有百分比时返回 null,即**不渲染胶囊**:
25042
25938
  * 契约允许 quota 为 null,装一个占位数字比不显示更像坏了。
25043
25939
  */
25044
- function selectBadgeFacts$3(status, lookup = (key) => zh$11[key]) {
25940
+ function selectBadgeFacts$3(status, lookup = (key) => zh$12[key]) {
25045
25941
  const measured = (status?.quota?.windows ?? []).filter((window) => typeof window.usedPercent === "number" && Number.isFinite(window.usedPercent));
25046
25942
  if (measured.length === 0) return null;
25047
25943
  const tightest = measured.reduce((best, window) => {
@@ -25072,14 +25968,14 @@ window.__ModuleLoader__.load({
25072
25968
  directory,
25073
25969
  loadModelDirectory,
25074
25970
  providerId: GLM_CODING_PLAN_PROVIDER_ID,
25075
- readStatus: (refresh) => refresh ? post$4("/quota", {}) : get$2("/status"),
25971
+ readStatus: (refresh) => refresh ? post$5("/quota", {}) : get$3("/status"),
25076
25972
  selectFacts: (status) => selectBadgeFacts$3(status, t),
25077
25973
  label: t("composerLabel")
25078
25974
  });
25079
25975
  }
25080
25976
  //#endregion
25081
25977
  //#region src/client/glm-coding-plan/styles.ts
25082
- const STYLE_ID$4 = "dsh-glm-coding-plan-settings-style";
25978
+ const STYLE_ID$5 = "dsh-glm-coding-plan-settings-style";
25083
25979
  /**
25084
25980
  * GLM(ZCode 账号)卡片独有的样式。
25085
25981
  *
@@ -25119,7 +26015,7 @@ window.__ModuleLoader__.load({
25119
26015
  :not(.dsha-btn-primary));通用 hover 修好后它只剩副作用:把 .dsha-btn 的次要
25120
26016
  按钮也画成主按钮,故删除。 */
25121
26017
  .dsha-account-add-actions{display:flex;flex-wrap:wrap;gap:8px}
25122
- `, STYLE_ID$4);
26018
+ `, STYLE_ID$5);
25123
26019
  }
25124
26020
  //#endregion
25125
26021
  //#region src/client/antigravity-acp/route.ts
@@ -25137,7 +26033,7 @@ window.__ModuleLoader__.load({
25137
26033
  * single most misleading pixel on the page.
25138
26034
  */
25139
26035
  function AntigravityAcpComposerBadge(props) {
25140
- const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$8);
26036
+ const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$9);
25141
26037
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
25142
26038
  directory: props.directory,
25143
26039
  loadModelDirectory: props.loadModelDirectory,
@@ -25179,7 +26075,7 @@ window.__ModuleLoader__.load({
25179
26075
  }
25180
26076
  //#endregion
25181
26077
  //#region src/client/antigravity-acp/styles.ts
25182
- const STYLE_ID$3 = "dsh-antigravity-acp-settings-style";
26078
+ const STYLE_ID$4 = "dsh-antigravity-acp-settings-style";
25183
26079
  /**
25184
26080
  * The Antigravity (ACP) card's own styles.
25185
26081
  *
@@ -25205,7 +26101,7 @@ window.__ModuleLoader__.load({
25205
26101
  .dshagy-details[open]>summary{color:var(--dsw-alias-label-primary)}
25206
26102
  .dshagy-details>p{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.55;margin:9px 0 0}
25207
26103
  .dshagy-boundary{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.55;margin:9px 0 0;padding-left:18px}
25208
- `, STYLE_ID$3);
26104
+ `, STYLE_ID$4);
25209
26105
  }
25210
26106
  //#endregion
25211
26107
  //#region src/client/step-code/StepCodeComposerQuota.tsx
@@ -25221,7 +26117,7 @@ window.__ModuleLoader__.load({
25221
26117
  *
25222
26118
  * 没有快照、没有窗口、或全部窗口都没有百分比时返回 null(见文件头)。
25223
26119
  */
25224
- function selectBadgeFacts$2(status, lookup = (key) => zh$7[key]) {
26120
+ function selectBadgeFacts$2(status, lookup = (key) => zh$8[key]) {
25225
26121
  const quota = status?.quota;
25226
26122
  if (quota === null || quota === void 0) return null;
25227
26123
  if (quota.kind !== "windowed") return null;
@@ -25262,14 +26158,14 @@ window.__ModuleLoader__.load({
25262
26158
  directory,
25263
26159
  loadModelDirectory,
25264
26160
  providerId: STEP_CODE_PROVIDER_ID,
25265
- readStatus: (refresh) => refresh ? post$1("/quota", {}) : get$1("/status"),
26161
+ readStatus: (refresh) => refresh ? post$2("/quota", {}) : get$2("/status"),
25266
26162
  selectFacts: (status) => selectBadgeFacts$2(status, t),
25267
26163
  label: t("composerLabel")
25268
26164
  });
25269
26165
  }
25270
26166
  //#endregion
25271
26167
  //#region src/client/step-code/styles.ts
25272
- const STYLE_ID$2 = "dsh-step-code-settings-style";
26168
+ const STYLE_ID$3 = "dsh-step-code-settings-style";
25273
26169
  /**
25274
26170
  * Step Code(Step Plan 订阅)卡片独有的样式。
25275
26171
  *
@@ -25347,7 +26243,7 @@ window.__ModuleLoader__.load({
25347
26243
  @media(max-width:560px){.dshsc-cred-grid,.dshsc-cred-grid-narrow{grid-template-columns:minmax(0,1fr)}}
25348
26244
 
25349
26245
  .dsha-badge.dshsc-adopted{background:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 16%,var(--dsw-alias-bg-layer-1));border-color:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 45%,var(--dsw-alias-border-l2));color:var(--dsw-alias-label-primary)}
25350
- `, STYLE_ID$2);
26246
+ `, STYLE_ID$3);
25351
26247
  }
25352
26248
  //#endregion
25353
26249
  //#region src/client/cline-pass/ClinePassComposerQuota.tsx
@@ -25368,7 +26264,7 @@ window.__ModuleLoader__.load({
25368
26264
  directory: props.directory,
25369
26265
  loadModelDirectory: props.loadModelDirectory,
25370
26266
  providerId: "cline-pass",
25371
- label: zh$6.composerLabel,
26267
+ label: zh$7.composerLabel,
25372
26268
  readStatus: (refresh) => API$1.status(refresh),
25373
26269
  selectFacts: selectClinePassFacts
25374
26270
  });
@@ -25454,7 +26350,7 @@ window.__ModuleLoader__.load({
25454
26350
  * 另外那只可能还剩一大半。所以这里不平均、不取最小剩余,而是取最大已用比例。
25455
26351
  * 没有快照、没有桶、或全部桶都没有总额时返回 null(见文件头)。
25456
26352
  */
25457
- function selectBadgeFacts$1(status, lookup = (key) => zh$5[key]) {
26353
+ function selectBadgeFacts$1(status, lookup = (key) => zh$6[key]) {
25458
26354
  const quota = status?.quota;
25459
26355
  if (quota === null || quota === void 0) return null;
25460
26356
  const measurable = quota.buckets.filter((bucket) => bucket.total !== null && bucket.total > 0 && bucket.used !== null);
@@ -25464,7 +26360,7 @@ window.__ModuleLoader__.load({
25464
26360
  const remaining = Math.round((1 - used) * 100);
25465
26361
  const unit = tightest.unit !== null && tightest.unit !== "" ? " " + tightest.unit : "";
25466
26362
  const bucketLabel = quotaBucketText(tightest.kind, {
25467
- ...zh$5,
26363
+ ...zh$6,
25468
26364
  quotaBucketPersonal: lookup("quotaBucketPersonal"),
25469
26365
  quotaBucketAddOn: lookup("quotaBucketAddOn"),
25470
26366
  quotaBucketOrg: lookup("quotaBucketOrg")
@@ -25489,14 +26385,14 @@ window.__ModuleLoader__.load({
25489
26385
  directory,
25490
26386
  loadModelDirectory,
25491
26387
  providerId: QODER_PROVIDER_ID,
25492
- readStatus: (refresh) => refresh ? post("/quota", {}) : get("/status"),
26388
+ readStatus: (refresh) => refresh ? post$1("/quota", {}) : get$1("/status"),
25493
26389
  selectFacts: (status) => selectBadgeFacts$1(status, t),
25494
26390
  label: t("composerLabel")
25495
26391
  });
25496
26392
  }
25497
26393
  //#endregion
25498
26394
  //#region src/client/qoder/styles.ts
25499
- const STYLE_ID$1 = "dsh-qoder-settings-style";
26395
+ const STYLE_ID$2 = "dsh-qoder-settings-style";
25500
26396
  /**
25501
26397
  * Qoder(订阅)卡片独有的样式。
25502
26398
  *
@@ -25551,7 +26447,7 @@ window.__ModuleLoader__.load({
25551
26447
  .dshq-details>p{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.55;margin:9px 0 0}
25552
26448
 
25553
26449
  .dsha-badge.dshq-adopted{background:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 16%,var(--dsw-alias-bg-layer-1));border-color:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 45%,var(--dsw-alias-border-l2));color:var(--dsw-alias-label-primary)}
25554
- `, STYLE_ID$1);
26450
+ `, STYLE_ID$2);
25555
26451
  }
25556
26452
  //#endregion
25557
26453
  //#region src/client/opendesign/OpenDesignComposerQuota.tsx
@@ -25575,7 +26471,7 @@ window.__ModuleLoader__.load({
25575
26471
  directory: props.directory,
25576
26472
  loadModelDirectory: props.loadModelDirectory,
25577
26473
  providerId: "opendesign",
25578
- label: zh$4.composerLabel,
26474
+ label: zh$5.composerLabel,
25579
26475
  readStatus: () => API.status(),
25580
26476
  selectFacts: selectOpenDesignFacts
25581
26477
  });
@@ -25596,9 +26492,9 @@ window.__ModuleLoader__.load({
25596
26492
  * is not), and one decimal is what keeps "1.5 小时" from reading as "2 小时".
25597
26493
  */
25598
26494
  function planWindowName(seconds) {
25599
- if (seconds >= 86400 && seconds % 86400 === 0) return zh$4.usageWindowDays.replace("{count}", String(seconds / 86400));
25600
- if (seconds >= 3600) return zh$4.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
25601
- return zh$4.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
26495
+ if (seconds >= 86400 && seconds % 86400 === 0) return zh$5.usageWindowDays.replace("{count}", String(seconds / 86400));
26496
+ if (seconds >= 3600) return zh$5.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
26497
+ return zh$5.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
25602
26498
  }
25603
26499
  /** What a window still has, from the grant and the remainder it states. */
25604
26500
  function windowRemaining(limitCredits, remainingCredits) {
@@ -25631,7 +26527,7 @@ window.__ModuleLoader__.load({
25631
26527
  const primaryId = status.pool.activeAccountId ?? status.pool.accounts.find((account) => account.isPrimary)?.id;
25632
26528
  const reading = readings.find((account) => account.accountId === primaryId) ?? readings[0];
25633
26529
  const amount = reading.balanceUsd;
25634
- const readAt = zh$4.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
26530
+ const readAt = zh$5.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
25635
26531
  const windows = planWindows(reading.codingPlan);
25636
26532
  if (windows.length === 0) return {
25637
26533
  text: `$${amount}`,
@@ -25640,8 +26536,8 @@ window.__ModuleLoader__.load({
25640
26536
  };
25641
26537
  const narrowest = windows[0];
25642
26538
  return {
25643
- text: zh$4.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
25644
- tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$4.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
26539
+ text: zh$5.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
26540
+ tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$5.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
25645
26541
  level: quotaLevel(narrowest.remaining),
25646
26542
  percent: narrowest.remaining
25647
26543
  };
@@ -27470,7 +28366,7 @@ window.__ModuleLoader__.load({
27470
28366
  }
27471
28367
  /** 兜底翻译:只在没有 locale 服务时用到(测试、以及菜单渲染早于字典注册)。 */
27472
28368
  function fallbackTranslate$3(key, params) {
27473
- const template = zh$12[key] ?? key;
28369
+ const template = zh$13[key] ?? key;
27474
28370
  if (params === void 0) return template;
27475
28371
  return template.replace(/\{(\w+)\}/g, (_match, name) => String(params[name] ?? ""));
27476
28372
  }
@@ -56768,12 +57664,12 @@ window.__ModuleLoader__.load({
56768
57664
  providerId: "workbuddy-subscription",
56769
57665
  readStatus: (refresh) => refresh ? api.post("/quota") : api.get("/status"),
56770
57666
  selectFacts: selectBadgeFacts,
56771
- label: useLineDict(NS_WORKBUDDY, zh$3).composerLabel
57667
+ label: useLineDict(NS_WORKBUDDY, zh$4).composerLabel
56772
57668
  });
56773
57669
  }
56774
57670
  //#endregion
56775
57671
  //#region src/client/workbuddy/styles.ts
56776
- const STYLE_ID = "dsh-workbuddy-settings-style";
57672
+ const STYLE_ID$1 = "dsh-workbuddy-settings-style";
56777
57673
  /**
56778
57674
  * WorkBuddy-only additions to the shared settings design system.
56779
57675
  *
@@ -56827,6 +57723,53 @@ window.__ModuleLoader__.load({
56827
57723
  .dsh-wb-inputrow>input{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:7px 9px;flex:1 1 260px;min-width:220px;max-width:420px;box-sizing:border-box}
56828
57724
  .dsh-wb-inputrow>input:disabled{opacity:.5}
56829
57725
 
57726
+ `, STYLE_ID$1);
57727
+ }
57728
+ //#endregion
57729
+ //#region src/client/qianwen-token-plan/QianwenComposerQuota.tsx
57730
+ function selectQianwenBadgeFacts(status, lookup = (key) => zh$3[key]) {
57731
+ const cache = status?.cacheStats;
57732
+ if (cache === void 0 || cache === null) return null;
57733
+ const ratio = qianwenCacheHitRatio(cache);
57734
+ if (ratio === null) return null;
57735
+ const percent = Math.round(ratio * 100);
57736
+ return {
57737
+ text: percent + "%",
57738
+ tooltip: "[" + lookup("title") + "] " + lookup("cacheHitRatio") + ": " + percent + "% · " + cache.cacheReadTokens + " tokens",
57739
+ level: quotaLevel(percent)
57740
+ };
57741
+ }
57742
+ function QianwenComposerQuota({ directory, loadModelDirectory, t }) {
57743
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
57744
+ directory,
57745
+ loadModelDirectory,
57746
+ providerId: QIANWEN_TOKEN_PLAN_PROVIDER_ID,
57747
+ readStatus: () => get("/status"),
57748
+ selectFacts: (status) => selectQianwenBadgeFacts(status, t),
57749
+ label: t("composerLabel")
57750
+ });
57751
+ }
57752
+ //#endregion
57753
+ //#region src/client/qianwen-token-plan/styles.ts
57754
+ const STYLE_ID = "dsh-qianwen-token-plan-settings-style";
57755
+ function installQianwenStyles() {
57756
+ installPluginStyle("qianwen-token-plan", `
57757
+ .dshqw-key-row{align-items:stretch;display:grid;gap:8px;grid-template-columns:minmax(0,1fr) auto;width:100%}
57758
+ .dshqw-vision-row{grid-template-columns:minmax(0,1fr) auto auto}
57759
+ .dshqw-key-row input{box-sizing:border-box;display:block;height:32px;max-width:none;min-width:0;width:100%}
57760
+ .dshqw-key-row .dsha-btn{align-items:center;display:inline-flex;height:32px;justify-content:center;min-width:80px;white-space:nowrap}
57761
+ @media(max-width:640px){
57762
+ .dshqw-key-row,.dshqw-vision-row{grid-template-columns:minmax(0,1fr)}
57763
+ .dshqw-key-row .dsha-btn{width:100%}
57764
+ }
57765
+ .dshqw-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:9px 18px;margin-top:10px}
57766
+ .dshqw-stat{display:flex;flex-direction:column;gap:3px;min-width:0}
57767
+ .dshqw-stat>span:first-child{color:var(--dsw-alias-label-tertiary);font-size:11px}
57768
+ .dshqw-stat>span:last-child{color:var(--dsw-alias-label-primary);font-size:12px;white-space:nowrap}
57769
+ .dshqw-details{border-top:0.5px solid var(--dsw-alias-border-l2);padding:10px 0 2px}
57770
+ .dshqw-details>summary{color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:12px;list-style:none}
57771
+ .dshqw-details>p{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.55;margin:9px 0 0}
57772
+ .dshqw-model-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;margin-left:5px}
56830
57773
  `, STYLE_ID);
56831
57774
  }
56832
57775
  //#endregion
@@ -60098,7 +61041,7 @@ window.__ModuleLoader__.load({
60098
61041
  * @module @eddyskywalker/dsh-chatgpt-subscription/client/codemode/CodeRunToolView
60099
61042
  */
60100
61043
  function fallbackTranslate(key) {
60101
- return zh$15[key] ?? key;
61044
+ return zh$16[key] ?? key;
60102
61045
  }
60103
61046
  function firstLine(text) {
60104
61047
  const nl = text.indexOf("\n");
@@ -60856,36 +61799,36 @@ window.__ModuleLoader__.load({
60856
61799
  installLineLocale(ctx.locale);
60857
61800
  ctx.effect(() => installHostLocaleMirror(ctx.locale), "dsh-chatgpt-subscription: host locale mirror");
60858
61801
  installRussianLocale(ctx);
60859
- ctx.effect(() => ctx.locale.register(NS, dictionaries$15), "dsh-chatgpt-subscription: dictionaries");
61802
+ ctx.effect(() => ctx.locale.register(NS, dictionaries$16), "dsh-chatgpt-subscription: dictionaries");
60860
61803
  ctx.effect(() => installStyles(), "dsh-chatgpt-subscription: styles");
60861
61804
  ctx.effect(() => {
60862
61805
  installHubStyles();
60863
61806
  installModelChecklistStyles();
60864
61807
  return () => {};
60865
61808
  }, "dsh-chatgpt-subscription: hub styles");
60866
- ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$10), "dsh-claude: dictionaries");
61809
+ ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$11), "dsh-claude: dictionaries");
60867
61810
  ctx.effect(() => {
60868
61811
  installClaudeStyles();
60869
61812
  return () => {};
60870
61813
  }, "dsh-claude: styles");
60871
- ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$14), "dsh-command-code: dictionaries");
60872
- ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$13), "dsh-kimi-code: dictionaries");
61814
+ ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$15), "dsh-command-code: dictionaries");
61815
+ ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$14), "dsh-kimi-code: dictionaries");
60873
61816
  ctx.effect(() => {
60874
61817
  installKimiCodeStyles();
60875
61818
  return () => {};
60876
61819
  }, "dsh-kimi-code: styles");
60877
- ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$12), "dsh-minimax-code: dictionaries");
61820
+ ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$13), "dsh-minimax-code: dictionaries");
60878
61821
  ctx.effect(() => {
60879
61822
  installMinimaxCodeStyles();
60880
61823
  return () => {};
60881
61824
  }, "dsh-minimax-code: styles");
60882
- ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$11), "dsh-glm-coding-plan: dictionaries");
61825
+ ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$12), "dsh-glm-coding-plan: dictionaries");
60883
61826
  ctx.effect(() => {
60884
61827
  installGlmCodingPlanStyles();
60885
61828
  return () => {};
60886
61829
  }, "dsh-glm-coding-plan: styles");
60887
- ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$9), "dsh-ollama: dictionaries");
60888
- ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$8), "dsh-antigravity-acp: dictionaries");
61830
+ ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$10), "dsh-ollama: dictionaries");
61831
+ ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$9), "dsh-antigravity-acp: dictionaries");
60889
61832
  ctx.effect(() => {
60890
61833
  installAntigravityAcpStyles();
60891
61834
  return () => {};
@@ -60895,31 +61838,36 @@ window.__ModuleLoader__.load({
60895
61838
  installProgressUpdatesStyles();
60896
61839
  return () => {};
60897
61840
  }, "dsh-progress-updates: styles");
60898
- ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$7), "dsh-step-code: dictionaries");
61841
+ ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$8), "dsh-step-code: dictionaries");
60899
61842
  ctx.effect(() => {
60900
61843
  installStepCodeStyles();
60901
61844
  return () => {};
60902
61845
  }, "dsh-step-code: styles");
60903
- ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$6), "dsh-cline-pass: dictionaries");
61846
+ ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$7), "dsh-cline-pass: dictionaries");
60904
61847
  ctx.effect(() => {
60905
61848
  installClinePassStyles();
60906
61849
  return () => {};
60907
61850
  }, "dsh-cline-pass: styles");
60908
- ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$5), "dsh-qoder: dictionaries");
61851
+ ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$6), "dsh-qoder: dictionaries");
60909
61852
  ctx.effect(() => {
60910
61853
  installQoderStyles();
60911
61854
  return () => {};
60912
61855
  }, "dsh-qoder: styles");
60913
- ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$4), "dsh-opendesign: dictionaries");
61856
+ ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$5), "dsh-opendesign: dictionaries");
60914
61857
  ctx.effect(() => {
60915
61858
  installOpenDesignStyles();
60916
61859
  return () => {};
60917
61860
  }, "dsh-opendesign: styles");
60918
- ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$3), "dsh-workbuddy: dictionaries");
61861
+ ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$4), "dsh-workbuddy: dictionaries");
60919
61862
  ctx.effect(() => {
60920
61863
  installWorkBuddyStyles();
60921
61864
  return () => {};
60922
61865
  }, "dsh-workbuddy: styles");
61866
+ ctx.effect(() => ctx.locale.register(NS_QIANWEN, dictionaries$3), "dsh-qianwen-token-plan: dictionaries");
61867
+ ctx.effect(() => {
61868
+ installQianwenStyles();
61869
+ return () => {};
61870
+ }, "dsh-qianwen-token-plan: styles");
60923
61871
  ctx.effect(() => ctx.locale.register(NS_SUBAGENT, dictionaries), "dsh-subagent-settings: dictionaries");
60924
61872
  ctx.effect(() => ctx.locale.register(NS_DISPATCH_LEDGER, dictionaries$2), "dsh-dispatch-ledger: dictionaries");
60925
61873
  ctx.effect(() => {
@@ -61038,6 +61986,13 @@ window.__ModuleLoader__.load({
61038
61986
  locale: NS_ANTIGRAVITY_ACP,
61039
61987
  inject: (sessionId) => composerBadgeInject(ctx, sessionId)
61040
61988
  }, AntigravityAcpComposerBadge));
61989
+ ctx.slots.inject("conversation.input.right", () => ctx.slots.register({
61990
+ name: "conversation.input.right",
61991
+ id: "qianwen-token-plan-quota",
61992
+ order: 49,
61993
+ locale: NS_QIANWEN,
61994
+ inject: (sessionId) => composerBadgeInject(ctx, sessionId)
61995
+ }, QianwenComposerQuota));
61041
61996
  ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
61042
61997
  name: "tool.call.toolview",
61043
61998
  key: CODEX_IMAGE_TOOL_NAME,