@eddyskywalker/dsh-chatgpt-subscription 0.36.1 → 0.37.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 (54) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +23 -3
  3. package/lib/client.js +340 -47
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +3088 -54
  6. package/lib/types/client/common/ComposerQuotaBadge.d.ts +7 -0
  7. package/lib/types/client/common/ComposerQuotaBadge.d.ts.map +1 -1
  8. package/lib/types/client/locales-ru/opendesign.d.ts.map +1 -1
  9. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  10. package/lib/types/client/locales.d.ts +4 -4
  11. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +6 -0
  12. package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -1
  13. package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -1
  14. package/lib/types/client/opendesign/locales.d.ts +54 -0
  15. package/lib/types/client/opendesign/locales.d.ts.map +1 -1
  16. package/lib/types/client/opendesign/styles.d.ts +5 -0
  17. package/lib/types/client/opendesign/styles.d.ts.map +1 -1
  18. package/lib/types/client/progress-updates/locales.d.ts +17 -2
  19. package/lib/types/client/progress-updates/locales.d.ts.map +1 -1
  20. package/lib/types/client/progress-updates/settings-binding.d.ts +13 -3
  21. package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
  22. package/lib/types/client/progress-updates/settings-section.d.ts +5 -5
  23. package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
  24. package/lib/types/client/progress-updates/styles.d.ts.map +1 -1
  25. package/lib/types/host/claude/routes.d.ts.map +1 -1
  26. package/lib/types/host/opendesign/client.d.ts +103 -0
  27. package/lib/types/host/opendesign/client.d.ts.map +1 -1
  28. package/lib/types/host/opendesign/routes.d.ts.map +1 -1
  29. package/lib/types/host/opendesign/types.d.ts +31 -0
  30. package/lib/types/host/opendesign/types.d.ts.map +1 -1
  31. package/lib/types/host/progress-updates/index.d.ts +5 -0
  32. package/lib/types/host/progress-updates/index.d.ts.map +1 -1
  33. package/lib/types/host/progress-updates/prompt.d.ts +37 -3
  34. package/lib/types/host/progress-updates/prompt.d.ts.map +1 -1
  35. package/lib/types/host/progress-updates/tool.d.ts.map +1 -1
  36. package/lib/types/host/proxy-manager.d.ts +63 -1
  37. package/lib/types/host/proxy-manager.d.ts.map +1 -1
  38. package/lib/types/host/widget-board/line-contracts.d.ts +192 -0
  39. package/lib/types/host/widget-board/line-contracts.d.ts.map +1 -0
  40. package/lib/types/host/widget-board/line-quota.d.ts +284 -0
  41. package/lib/types/host/widget-board/line-quota.d.ts.map +1 -0
  42. package/lib/types/host/widget-board/line-registry.d.ts +402 -0
  43. package/lib/types/host/widget-board/line-registry.d.ts.map +1 -0
  44. package/lib/types/host/widget-board/provider.d.ts +140 -0
  45. package/lib/types/host/widget-board/provider.d.ts.map +1 -0
  46. package/lib/types/index.d.ts +10 -0
  47. package/lib/types/index.d.ts.map +1 -1
  48. package/lib/types/shared/opendesign-contracts.d.ts +47 -0
  49. package/lib/types/shared/opendesign-contracts.d.ts.map +1 -1
  50. package/package.json +2 -1
  51. package/widgets/line-flip/index.html +58 -0
  52. package/widgets/line-flip/main.js +1102 -0
  53. package/widgets/line-flip/style.css +729 -0
  54. package/widgets/line-flip/widget.json +555 -0
package/lib/client.js CHANGED
@@ -16125,6 +16125,15 @@ window.__ModuleLoader__.load({
16125
16125
  usageTotalConsumed: "累计消耗 ${amount}",
16126
16126
  usageUsageCount: "计费请求 {count} 次",
16127
16127
  usagePlanUnknown: "已读取额度,但上游未返回套餐档位。",
16128
+ usageWindowsTitle: "Design Plan 额度窗口",
16129
+ usageWindowUsed: "已用 {used}%",
16130
+ usageWindowRemaining: "剩余 {remaining}%",
16131
+ usageWindowResetsAt: "{time} 重置",
16132
+ usageWindowsUnavailable: "额度窗口读取失败或该工作区未配置",
16133
+ usageWindowsConsoleOnly: "额度窗口仅在 OpenDesign 控制台可见:该端点不接受插件凭证",
16134
+ usageWindowDays: "{count} 天",
16135
+ usageWindowHours: "{count} 小时",
16136
+ usageWindowMinutes: "{count} 分钟",
16128
16137
  limitKey: "凭据存储在系统加密凭据库中,界面从不显示 Key 本身。",
16129
16138
  limitGateway: "请求由 OpenDesign 网关服务,实际上游由网关决定。",
16130
16139
  limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 opendesign,本卡仍可配置,但请求由对方服务。",
@@ -16222,6 +16231,15 @@ window.__ModuleLoader__.load({
16222
16231
  usageTotalConsumed: "Consumed in total ${amount}",
16223
16232
  usageUsageCount: "Billed requests: {count}",
16224
16233
  usagePlanUnknown: "Credits were read, but the upstream named no plan tier.",
16234
+ usageWindowsTitle: "Design Plan allowance windows",
16235
+ usageWindowUsed: "{used}% used",
16236
+ usageWindowRemaining: "{remaining}% remaining",
16237
+ usageWindowResetsAt: "Resets {time}",
16238
+ usageWindowsUnavailable: "Allowance windows could not be read, or this workspace has none configured",
16239
+ usageWindowsConsoleOnly: "Allowance windows are only visible in the OpenDesign console: the endpoint refuses plugin credentials",
16240
+ usageWindowDays: "days: {count}",
16241
+ usageWindowHours: "hours: {count}",
16242
+ usageWindowMinutes: "minutes: {count}",
16225
16243
  limitKey: "API keys live in the OS credential store; the card never shows the key itself.",
16226
16244
  limitGateway: "Requests are served by the OpenDesign gateway, which chooses the actual upstream.",
16227
16245
  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.",
@@ -16265,6 +16283,54 @@ window.__ModuleLoader__.load({
16265
16283
  function formatUsd(value) {
16266
16284
  return value === null ? "—" : value;
16267
16285
  }
16286
+ /** A number the card prints bare: the surrounding label already carries the unit. */
16287
+ function formatDecimal$1(value) {
16288
+ try {
16289
+ return new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value);
16290
+ } catch {
16291
+ return String(value);
16292
+ }
16293
+ }
16294
+ /** The width a share may draw: inside its own track even if the figure is not. */
16295
+ function clampPercent(value) {
16296
+ return Math.min(100, Math.max(0, value));
16297
+ }
16298
+ /**
16299
+ * A window's length in the words the service sold it in.
16300
+ *
16301
+ * A policy states seconds, and the tier's windows are round days and hours:
16302
+ * naming 604800 seconds "168 小时" would describe the window differently from
16303
+ * the console the user reads it in. A whole day stays a day; anything shorter
16304
+ * counts hours, then minutes.
16305
+ */
16306
+ function planWindowName$1(seconds, labels) {
16307
+ if (seconds >= 86400 && seconds % 86400 === 0) return labels.usageWindowDays.replace("{count}", String(seconds / 86400));
16308
+ if (seconds >= 3600) return labels.usageWindowHours.replace("{count}", formatDecimal$1(seconds / 3600));
16309
+ return labels.usageWindowMinutes.replace("{count}", formatDecimal$1(seconds / 60));
16310
+ }
16311
+ /**
16312
+ * The windows worth drawing, or none at all.
16313
+ *
16314
+ * A failed window read and a workspace that configures no window mean the same
16315
+ * thing here: there is no measurement to draw, so the caller says that in words
16316
+ * instead of showing an empty bar.
16317
+ */
16318
+ function planWindowRows(plan, labels) {
16319
+ if (plan === void 0 || plan.error !== "") return [];
16320
+ return plan.windows.map((window, index) => {
16321
+ const limit = Number(window.limitCredits);
16322
+ const left = Number(window.remainingCredits);
16323
+ const used = Number.isFinite(limit) && Number.isFinite(left) && limit > 0 ? clampPercent(Math.round((limit - left) / limit * 1e3) / 10) : null;
16324
+ const resetAt = window.resetsAt === null ? NaN : Date.parse(window.resetsAt);
16325
+ return {
16326
+ key: `${window.policyId}-${index}`,
16327
+ name: planWindowName$1(window.durationSeconds, labels),
16328
+ used,
16329
+ remaining: used === null ? null : clampPercent(Math.round((100 - used) * 10) / 10),
16330
+ resetsAt: Number.isFinite(resetAt) ? resetAt : null
16331
+ };
16332
+ });
16333
+ }
16268
16334
  /** ISO instant as the card's date, or the honest dash. */
16269
16335
  function formatIso(value) {
16270
16336
  if (value === null) return "—";
@@ -16289,15 +16355,22 @@ window.__ModuleLoader__.load({
16289
16355
  /**
16290
16356
  * One account's plan and credit facts.
16291
16357
  *
16292
- * Deliberately numbers, not a percentage bar: the summary states what is left
16293
- * (subscription credits, top-up credits) and what was consumed, but not the
16294
- * grant those figures are a share of, and this card does not invent a total to
16295
- * divide by. A failed wallet read still shows the billing figures, because they
16296
- * are different surfaces of the same account.
16358
+ * The billing summary prices what is left and what was consumed but omits the
16359
+ * grant, so nothing on it can be drawn as "percent of the period used". The
16360
+ * Design Plan endpoint does state a grant per window — five hours, seven days —
16361
+ * beside what is left of it, so those windows are the only bars drawn here, each
16362
+ * measured against its own policy. A failed window read, or a workspace with no
16363
+ * window configured, gets one weak line instead of an empty bar, and the numeric
16364
+ * grid still carries every figure the summary did send. A failed wallet read
16365
+ * still shows the billing figures, because they are different surfaces of the
16366
+ * same account.
16297
16367
  */
16298
16368
  function UsageCard(props) {
16299
16369
  const { entry, labels } = props;
16300
16370
  const billing = entry.billing;
16371
+ const planWindows = planWindowRows(entry.codingPlan, labels);
16372
+ const planHasBar = planWindows.some((window) => window.used !== null);
16373
+ const planHint = planHasBar ? null : /401|403/.test(entry.codingPlan?.error ?? "") ? labels.usageWindowsConsoleOnly : labels.usageWindowsUnavailable;
16301
16374
  const credits = (creditsValue, usdValue) => ({
16302
16375
  credits: formatCredits(creditsValue),
16303
16376
  usd: formatUsd(usdValue)
@@ -16325,32 +16398,80 @@ window.__ModuleLoader__.load({
16325
16398
  })
16326
16399
  ]
16327
16400
  }),
16328
- billing !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(billing.periodStart !== null || billing.periodEnd !== null) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16401
+ billing !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
16402
+ (billing.periodStart !== null || billing.periodEnd !== null) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16403
+ className: "dshod-quota-meta",
16404
+ children: labels.usagePeriod.replace("{start}", formatIso(billing.periodStart)).replace("{end}", formatIso(billing.periodEnd))
16405
+ }),
16406
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16407
+ className: "dshod-quota-grid",
16408
+ children: [
16409
+ (() => {
16410
+ const value = credits(billing.subscriptionCredits, billing.subscriptionCreditsUsd);
16411
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageSubscriptionCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16412
+ })(),
16413
+ (() => {
16414
+ const value = credits(billing.rechargeCredits, billing.rechargeCreditsUsd);
16415
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageRechargeCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16416
+ })(),
16417
+ (() => {
16418
+ const value = credits(billing.totalAvailableCredits, billing.totalAvailableCreditsUsd);
16419
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16420
+ })(),
16421
+ billing.todayConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTodayConsumed.replace("{amount}", billing.todayConsumedUsd) }),
16422
+ billing.totalConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalConsumed.replace("{amount}", billing.totalConsumedUsd) }),
16423
+ billing.usageCount !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageUsageCount.replace("{count}", String(billing.usageCount)) })
16424
+ ]
16425
+ }),
16426
+ planHasBar && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16427
+ className: "dshod-plan",
16428
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16429
+ className: "dshod-plan-title",
16430
+ children: labels.usageWindowsTitle
16431
+ }), planWindows.map((window) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16432
+ className: "dshod-plan-window",
16433
+ children: [
16434
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16435
+ className: "dshod-plan-window-head",
16436
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16437
+ className: "dshod-plan-window-name",
16438
+ children: window.name
16439
+ }), window.used !== null && window.remaining !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
16440
+ className: "dshod-plan-window-figures",
16441
+ children: [
16442
+ labels.usageWindowUsed.replace("{used}", formatDecimal$1(window.used)),
16443
+ " · ",
16444
+ labels.usageWindowRemaining.replace("{remaining}", formatDecimal$1(window.remaining))
16445
+ ]
16446
+ })]
16447
+ }),
16448
+ window.used !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16449
+ className: "dshod-meter-track",
16450
+ role: "progressbar",
16451
+ "aria-label": `${window.name} · ${labels.usageWindowUsed.replace("{used}", formatDecimal$1(window.used))}`,
16452
+ "aria-valuemin": 0,
16453
+ "aria-valuemax": 100,
16454
+ "aria-valuenow": window.used,
16455
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", {
16456
+ className: "dshod-meter-fill",
16457
+ style: { width: `${clampPercent(window.used)}%` }
16458
+ })
16459
+ }),
16460
+ window.resetsAt !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16461
+ className: "dshod-plan-resets",
16462
+ children: labels.usageWindowResetsAt.replace("{time}", formatAccountDate(window.resetsAt))
16463
+ })
16464
+ ]
16465
+ }, window.key))]
16466
+ })
16467
+ ] }),
16468
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
16329
16469
  className: "dshod-quota-meta",
16330
- children: labels.usagePeriod.replace("{start}", formatIso(billing.periodStart)).replace("{end}", formatIso(billing.periodEnd))
16331
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16332
- className: "dshod-quota-grid",
16333
16470
  children: [
16334
- (() => {
16335
- const value = credits(billing.subscriptionCredits, billing.subscriptionCreditsUsd);
16336
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageSubscriptionCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16337
- })(),
16338
- (() => {
16339
- const value = credits(billing.rechargeCredits, billing.rechargeCreditsUsd);
16340
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageRechargeCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16341
- })(),
16342
- (() => {
16343
- const value = credits(billing.totalAvailableCredits, billing.totalAvailableCreditsUsd);
16344
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
16345
- })(),
16346
- billing.todayConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTodayConsumed.replace("{amount}", billing.todayConsumedUsd) }),
16347
- billing.totalConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalConsumed.replace("{amount}", billing.totalConsumedUsd) }),
16348
- billing.usageCount !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageUsageCount.replace("{count}", String(billing.usageCount)) })
16471
+ entry.balanceUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labels.usageBalance.replace("{amount}", entry.balanceUsd), " · "] }),
16472
+ labels.usageReadAt.replace("{time}", formatAccountDate(entry.fetchedAt)),
16473
+ planHint !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" · ", planHint] })
16349
16474
  ]
16350
- })] }),
16351
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
16352
- className: "dshod-quota-meta",
16353
- children: [entry.balanceUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labels.usageBalance.replace("{amount}", entry.balanceUsd), " · "] }), labels.usageReadAt.replace("{time}", formatAccountDate(entry.fetchedAt))]
16354
16475
  }),
16355
16476
  !entry.ok && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
16356
16477
  className: "dshod-warning",
@@ -17746,7 +17867,7 @@ window.__ModuleLoader__.load({
17746
17867
  modelsHint: "勾选后模型才会显示在对话页的模型选择列表中;全部取消勾选或关闭上方开关可在列表中隐藏该供应商。",
17747
17868
  proxySettings: "网络代理",
17748
17869
  proxyMode: "代理模式",
17749
- proxyModeHint: "GPT 与 Antigravity(Gemini)共用此代理设置;支持自动读取系统代理,修改后对后续请求生效。",
17870
+ proxyModeHint: "本插件的全部供应线路共用这一份代理设置,登录、令牌续期、模型目录与配额读取同样经过它;支持自动读取系统代理,修改后对后续请求生效。",
17750
17871
  proxyModeAuto: "系统代理(自动检测)",
17751
17872
  proxyModeCustom: "自定义代理",
17752
17873
  proxyModeDirect: "直连(禁用代理)",
@@ -17757,7 +17878,7 @@ window.__ModuleLoader__.load({
17757
17878
  proxyDetected: "检测到系统代理",
17758
17879
  proxyDetectedEffective: "(已自动生效)",
17759
17880
  proxyNoneDetected: "未检测到系统代理,将使用直连",
17760
- proxyDirectHint: "所有网络请求将直接连接,不经过任何代理服务器。",
17881
+ proxyDirectHint: "本插件的全部请求将直接连接,不经过任何代理服务器。",
17761
17882
  enhancements: "增强功能",
17762
17883
  fastMode: "快速模式(1.5x 速度)",
17763
17884
  fastModeHint: "提升 Token 生成速度至约 1.5 倍;将以约 2x–2.5x 速度消耗 Codex 订阅额度。",
@@ -17921,7 +18042,7 @@ window.__ModuleLoader__.load({
17921
18042
  modelsHint: "Checked models appear in the conversation model picker; unchecking all or turning off the switch hides this provider from the picker.",
17922
18043
  proxySettings: "Network Proxy",
17923
18044
  proxyMode: "Proxy Mode",
17924
- proxyModeHint: "GPT and Antigravity (Gemini) share these proxy settings. Supports system proxy detection; changes apply to subsequent requests.",
18045
+ proxyModeHint: "Every provider line in this plugin shares these proxy settings, including sign-in, token renewal, model catalog and quota reads. Supports system proxy detection; changes apply to subsequent requests.",
17925
18046
  proxyModeAuto: "System Proxy (Auto-detect)",
17926
18047
  proxyModeCustom: "Custom Proxy",
17927
18048
  proxyModeDirect: "Direct (No Proxy)",
@@ -17932,7 +18053,7 @@ window.__ModuleLoader__.load({
17932
18053
  proxyDetected: "Detected system proxy",
17933
18054
  proxyDetectedEffective: " (active)",
17934
18055
  proxyNoneDetected: "No system proxy detected; connecting directly",
17935
- proxyDirectHint: "All requests connect directly without using any proxy server.",
18056
+ proxyDirectHint: "Every request from this plugin connects directly without using any proxy server.",
17936
18057
  enhancements: "Enhancements",
17937
18058
  fastMode: "Fast mode (1.5x speed)",
17938
18059
  fastModeHint: "Generates tokens ~1.5x faster; consumes Codex subscription quota at ~2x–2.5x the normal rate.",
@@ -18111,6 +18232,11 @@ window.__ModuleLoader__.load({
18111
18232
  settingsEnabledNote: "让 agent 在对话中发布进展更新",
18112
18233
  settingsThresholdName: "催促阈值",
18113
18234
  settingsThresholdNote: "连续这么多轮没有进展时,提醒 agent 汇报一次",
18235
+ settingsLanguageName: "输出语言",
18236
+ settingsLanguageNote: "进展更新的标题与正文用哪种语言写",
18237
+ settingsLanguageAuto: "自动(跟随对话)",
18238
+ settingsLanguageZh: "中文",
18239
+ settingsLanguageEn: "English",
18114
18240
  settingsPanelName: "进展面板",
18115
18241
  settingsPanelNote: "在右侧栏查看本次会话的全部进展",
18116
18242
  settingsUnavailable: "这项设置当前不可修改(宿主没有开放配置表单)",
@@ -18142,6 +18268,11 @@ window.__ModuleLoader__.load({
18142
18268
  settingsEnabledNote: "Let the agent post progress updates in the conversation",
18143
18269
  settingsThresholdName: "Nudge threshold",
18144
18270
  settingsThresholdNote: "Remind the agent after this many rounds without an update",
18271
+ settingsLanguageName: "Output language",
18272
+ settingsLanguageNote: "Which language the update titles and bodies are written in",
18273
+ settingsLanguageAuto: "Auto (follow the conversation)",
18274
+ settingsLanguageZh: "Chinese",
18275
+ settingsLanguageEn: "English",
18145
18276
  settingsPanelName: "Progress panel",
18146
18277
  settingsPanelNote: "See every update from this session in the right sidebar",
18147
18278
  settingsUnavailable: "This setting cannot be changed right now (the host serves no config form)",
@@ -18745,7 +18876,7 @@ window.__ModuleLoader__.load({
18745
18876
  modelsHint: "Отмеченные модели появляются в списке выбора модели на странице диалога; если снять все отметки или выключить переключатель выше, провайдер исчезнет из списка.",
18746
18877
  proxySettings: "Сетевой прокси",
18747
18878
  proxyMode: "Режим прокси",
18748
- proxyModeHint: "GPT и Antigravity (Gemini) используют эти настройки прокси вместе; поддерживается автоопределение системного прокси, изменения действуют на последующие запросы.",
18879
+ proxyModeHint: "Все линии провайдеров этого плагина используют эти настройки прокси, включая вход, обновление токенов, каталог моделей и чтение квот; поддерживается автоопределение системного прокси, изменения действуют на последующие запросы.",
18749
18880
  proxyModeAuto: "Системный прокси (автоопределение)",
18750
18881
  proxyModeCustom: "Свой прокси",
18751
18882
  proxyModeDirect: "Напрямую (без прокси)",
@@ -18756,7 +18887,7 @@ window.__ModuleLoader__.load({
18756
18887
  proxyDetected: "Обнаружен системный прокси",
18757
18888
  proxyDetectedEffective: " (уже действует)",
18758
18889
  proxyNoneDetected: "Системный прокси не обнаружен, соединение напрямую",
18759
- proxyDirectHint: "Все запросы идут напрямую, без прокси-сервера.",
18890
+ proxyDirectHint: "Все запросы этого плагина идут напрямую, без прокси-сервера.",
18760
18891
  enhancements: "Дополнительные функции",
18761
18892
  fastMode: "Быстрый режим (скорость 1.5x)",
18762
18893
  fastModeHint: "Генерирует токены примерно в 1.5 раза быстрее; квота подписки Codex при этом расходуется в 2–2.5 раза быстрее.",
@@ -19363,6 +19494,15 @@ window.__ModuleLoader__.load({
19363
19494
  usageTotalConsumed: "Израсходовано всего ${amount}",
19364
19495
  usageUsageCount: "Платных запросов: {count}",
19365
19496
  usagePlanUnknown: "Кредиты прочитаны, но сервис не указал тариф.",
19497
+ usageWindowsTitle: "Окна лимитов Design Plan",
19498
+ usageWindowUsed: "использовано {used}%",
19499
+ usageWindowRemaining: "остаток {remaining}%",
19500
+ usageWindowResetsAt: "сброс {time}",
19501
+ usageWindowsUnavailable: "Окна лимитов не прочитаны или не настроены для этого рабочего пространства",
19502
+ usageWindowsConsoleOnly: "Окна лимитов видны только в консоли OpenDesign: эндпоинт не принимает учётные данные плагина",
19503
+ usageWindowDays: "дней: {count}",
19504
+ usageWindowHours: "часов: {count}",
19505
+ usageWindowMinutes: "минут: {count}",
19366
19506
  limitKey: "API-ключи хранятся в системном хранилище учётных данных; карточка никогда не показывает сам ключ.",
19367
19507
  limitGateway: "Запросы обслуживает шлюз OpenDesign, он же выбирает фактического провайдера.",
19368
19508
  limitRoute: "Маршрут занимается по provider id: если opendesign уже обслуживает другой плагин, эта карточка по-прежнему настраивает линию, но запросы выполняет тот провайдер.",
@@ -19395,6 +19535,11 @@ window.__ModuleLoader__.load({
19395
19535
  settingsEnabledNote: "Разрешить агенту публиковать ход работы в диалоге",
19396
19536
  settingsThresholdName: "Порог напоминания",
19397
19537
  settingsThresholdNote: "Напомнить агенту после стольких раундов без отчёта",
19538
+ settingsLanguageName: "Язык вывода",
19539
+ settingsLanguageNote: "На каком языке пишутся заголовки и тексты записей",
19540
+ settingsLanguageAuto: "Авто (как в диалоге)",
19541
+ settingsLanguageZh: "Китайский",
19542
+ settingsLanguageEn: "English",
19398
19543
  settingsPanelName: "Панель хода работы",
19399
19544
  settingsPanelNote: "Показывать все записи этой сессии в правой панели",
19400
19545
  settingsUnavailable: "Эту настройку сейчас нельзя изменить (Host не предоставляет форму настроек)",
@@ -20203,13 +20348,24 @@ window.__ModuleLoader__.load({
20203
20348
  title: facts.tooltip,
20204
20349
  "aria-label": facts.tooltip,
20205
20350
  onClick: () => void fetchStatus(true),
20206
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
20207
- className: "dsha-composer-quota-label",
20208
- children: label
20209
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
20210
- className: "dsha-composer-quota-val",
20211
- children: loading ? "…" : facts.text
20212
- })]
20351
+ children: [
20352
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
20353
+ className: "dsha-composer-quota-label",
20354
+ children: label
20355
+ }),
20356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
20357
+ className: "dsha-composer-quota-val",
20358
+ children: loading ? "…" : facts.text
20359
+ }),
20360
+ typeof facts.percent === "number" && Number.isFinite(facts.percent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
20361
+ className: "dsha-composer-quota-meter",
20362
+ "aria-hidden": "true",
20363
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", {
20364
+ className: "dsha-composer-quota-meter-fill",
20365
+ style: { width: `${Math.min(100, Math.max(0, facts.percent))}%` }
20366
+ })
20367
+ })
20368
+ ]
20213
20369
  });
20214
20370
  }
20215
20371
  //#endregion
@@ -21734,6 +21890,12 @@ window.__ModuleLoader__.load({
21734
21890
  * at all; the badge shows the primary (else first) readable account's latest
21735
21891
  * balance and never triggers a read of its own — a poll must not fan out one
21736
21892
  * upstream call per account. A pasted-key-only pool renders nothing.
21893
+ *
21894
+ * The Design Plan endpoint also states the tier's allowance windows, each with
21895
+ * its own grant and what is left of it, so the badge shows the remaining share
21896
+ * of the narrowest window and draws it as a thin bar. A reading without a
21897
+ * measurable window keeps the bare balance, which is what every other line
21898
+ * renders.
21737
21899
  */
21738
21900
  function OpenDesignComposerQuota(props) {
21739
21901
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
@@ -21745,6 +21907,49 @@ window.__ModuleLoader__.load({
21745
21907
  selectFacts: selectOpenDesignFacts
21746
21908
  });
21747
21909
  }
21910
+ /** A number the badge prints bare: the label around it carries the unit. */
21911
+ function formatDecimal(value) {
21912
+ try {
21913
+ return new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value);
21914
+ } catch {
21915
+ return String(value);
21916
+ }
21917
+ }
21918
+ /**
21919
+ * A window's length in the words the service sold it in.
21920
+ *
21921
+ * The settings card makes the same derivation; it is repeated here because the
21922
+ * two surfaces read different dictionaries (the section is localized, this badge
21923
+ * is not), and one decimal is what keeps "1.5 小时" from reading as "2 小时".
21924
+ */
21925
+ function planWindowName(seconds) {
21926
+ if (seconds >= 86400 && seconds % 86400 === 0) return zh$2.usageWindowDays.replace("{count}", String(seconds / 86400));
21927
+ if (seconds >= 3600) return zh$2.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
21928
+ return zh$2.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
21929
+ }
21930
+ /** What a window still has, from the grant and the remainder it states. */
21931
+ function windowRemaining(limitCredits, remainingCredits) {
21932
+ const limit = Number(limitCredits);
21933
+ const left = Number(remainingCredits);
21934
+ if (!Number.isFinite(limit) || !Number.isFinite(left) || limit <= 0) return null;
21935
+ const used = Math.min(100, Math.max(0, Math.round((limit - left) / limit * 1e3) / 10));
21936
+ return Math.min(100, Math.max(0, Math.round((100 - used) * 10) / 10));
21937
+ }
21938
+ /** Every window the badge can speak about, narrowest first. */
21939
+ function planWindows(plan) {
21940
+ if (plan === void 0 || plan.error !== "") return [];
21941
+ const readings = [];
21942
+ for (const window of plan.windows) {
21943
+ const remaining = windowRemaining(window.limitCredits, window.remainingCredits);
21944
+ if (remaining === null) continue;
21945
+ readings.push({
21946
+ seconds: window.durationSeconds,
21947
+ name: planWindowName(window.durationSeconds),
21948
+ remaining
21949
+ });
21950
+ }
21951
+ return readings.sort((left, right) => left.seconds - right.seconds);
21952
+ }
21748
21953
  /** The line's own number picker, exported so a test can pin the rule. */
21749
21954
  function selectOpenDesignFacts(status, _modelId) {
21750
21955
  if (status === null || !status.authenticated || status.usage === null) return null;
@@ -21753,11 +21958,19 @@ window.__ModuleLoader__.load({
21753
21958
  const primaryId = status.pool.activeAccountId ?? status.pool.accounts.find((account) => account.isPrimary)?.id;
21754
21959
  const reading = readings.find((account) => account.accountId === primaryId) ?? readings[0];
21755
21960
  const amount = reading.balanceUsd;
21756
- const zero = Number(amount) === 0;
21757
- return {
21961
+ const readAt = zh$2.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
21962
+ const windows = planWindows(reading.codingPlan);
21963
+ if (windows.length === 0) return {
21758
21964
  text: `$${amount}`,
21759
- tooltip: `${reading.alias} · ${zh$2.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString())}`,
21760
- level: zero ? "danger" : "normal"
21965
+ tooltip: `${reading.alias} · ${readAt}`,
21966
+ level: Number(amount) === 0 ? "danger" : "normal"
21967
+ };
21968
+ const narrowest = windows[0];
21969
+ return {
21970
+ text: zh$2.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
21971
+ tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$2.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
21972
+ level: quotaLevel(narrowest.remaining),
21973
+ percent: narrowest.remaining
21761
21974
  };
21762
21975
  }
21763
21976
  //#endregion
@@ -21767,6 +21980,11 @@ window.__ModuleLoader__.load({
21767
21980
  * controls, which the shared `.dsha-*` vocabulary has no expression for.
21768
21981
  * Everything else on the tab reuses the shared card.
21769
21982
  *
21983
+ * The composer meter is the one shared-markup rule kept here: every line feeds
21984
+ * the shared badge differently, and this line is the only one that hands it a
21985
+ * remaining share to draw, so the rule lives beside the card that produces the
21986
+ * figure instead of being repeated in every line's sheet.
21987
+ *
21770
21988
  * `.dshod-input` mirrors the input styling another line declares under an
21771
21989
  * unprefixed name on purpose: that class is that line's own, and a prefix of
21772
21990
  * ours keeps this card's look from drifting with someone else's sheet.
@@ -21796,6 +22014,17 @@ window.__ModuleLoader__.load({
21796
22014
  .dshod-quota-status{color:var(--dsw-alias-label-secondary);font-size:12px}
21797
22015
  .dshod-quota-meta{color:var(--dsw-alias-label-tertiary);font-size:12px}
21798
22016
  .dshod-quota-grid{color:var(--dsw-alias-label-secondary);display:grid;font-size:12px;gap:4px 16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
22017
+ .dshod-plan{display:flex;flex-direction:column;gap:6px;margin-top:2px}
22018
+ .dshod-plan-title{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}
22019
+ .dshod-plan-window{display:flex;flex-direction:column;gap:4px}
22020
+ .dshod-plan-window-head{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}
22021
+ .dshod-plan-window-name{color:var(--dsw-alias-label-primary);font-size:12px}
22022
+ .dshod-plan-window-figures{color:var(--dsw-alias-label-secondary);font-size:12px;font-variant-numeric:tabular-nums}
22023
+ .dshod-plan-resets{color:var(--dsw-alias-label-tertiary);font-size:11px}
22024
+ .dshod-meter-track{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:999px;display:block;height:6px;overflow:hidden}
22025
+ .dshod-meter-fill{background:var(--dsw-alias-brand-primary);display:block;height:100%;transition:width .2s ease}
22026
+ .dsha-composer-quota-meter{align-self:center;background:var(--dsw-alias-border-l2);border-radius:999px;display:inline-block;flex:none;height:3px;overflow:hidden;width:24px}
22027
+ .dsha-composer-quota-meter-fill{background:var(--dsw-alias-brand-primary);display:block;height:100%}
21799
22028
  .dshod-adv-control{width:240px;max-width:100%;flex:none}
21800
22029
  .dshod-adv-control.dsha-select{max-width:240px;min-width:240px;width:240px}
21801
22030
  .dshod-adv-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
@@ -51334,7 +51563,35 @@ window.__ModuleLoader__.load({
51334
51563
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 6h12M4 10h8M4 14h5" })
51335
51564
  });
51336
51565
  }
51337
- /** 第三行的标记:一块右侧栏面板。 */
51566
+ /** 第三行的标记:一个地球,对应「输出语言」。 */
51567
+ function LanguageMark() {
51568
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
51569
+ viewBox: "0 0 20 20",
51570
+ width: "20",
51571
+ height: "20",
51572
+ fill: "none",
51573
+ stroke: "currentColor",
51574
+ strokeWidth: "1.6",
51575
+ strokeLinecap: "round",
51576
+ strokeLinejoin: "round",
51577
+ "aria-hidden": "true",
51578
+ children: [
51579
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
51580
+ cx: "10",
51581
+ cy: "10",
51582
+ r: "7"
51583
+ }),
51584
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 10h14" }),
51585
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ellipse", {
51586
+ cx: "10",
51587
+ cy: "10",
51588
+ rx: "3.2",
51589
+ ry: "7"
51590
+ })
51591
+ ]
51592
+ });
51593
+ }
51594
+ /** 第四行的标记:一块右侧栏面板。 */
51338
51595
  function PanelMark() {
51339
51596
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
51340
51597
  viewBox: "0 0 20 20",
@@ -51395,7 +51652,7 @@ window.__ModuleLoader__.load({
51395
51652
  });
51396
51653
  }
51397
51654
  /**
51398
- * 进展更新的设置分区:三行卡片。
51655
+ * 进展更新的设置分区:四行卡片。
51399
51656
  * @param props - 壳的关闭回调、注入的打开动作与表单、文案座位。
51400
51657
  * @returns 设置页里的这一页。
51401
51658
  */
@@ -51409,6 +51666,7 @@ window.__ModuleLoader__.load({
51409
51666
  const writable = settings !== void 0 && snapshot.status === "ready" && snapshot.writable;
51410
51667
  const enabled = value.progressUpdates !== false;
51411
51668
  const threshold = typeof value.progressUpdatesNudgeThreshold === "number" ? value.progressUpdatesNudgeThreshold : 8;
51669
+ const language = value.progressUpdatesLanguage === "zh" || value.progressUpdatesLanguage === "en" ? value.progressUpdatesLanguage : "auto";
51412
51670
  const [draft, setDraft] = (0, react.useState)(() => String(threshold));
51413
51671
  (0, react.useEffect)(() => {
51414
51672
  setDraft(String(threshold));
@@ -51528,6 +51786,38 @@ window.__ModuleLoader__.load({
51528
51786
  }
51529
51787
  })
51530
51788
  }),
51789
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
51790
+ part: "settings-row-language",
51791
+ brand: "#c26d2f",
51792
+ mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageMark, {}),
51793
+ name: translate("settingsLanguageName"),
51794
+ note: failure?.row === "language" ? failure.text : translate("settingsLanguageNote"),
51795
+ danger: failure?.row === "language",
51796
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
51797
+ className: "dsh-progress-select",
51798
+ "data-dsh-part": "settings-language",
51799
+ "aria-label": translate("settingsLanguageName"),
51800
+ value: language,
51801
+ disabled: !writable,
51802
+ onChange: (event) => {
51803
+ write("language", "progressUpdatesLanguage", event.target.value);
51804
+ },
51805
+ children: [
51806
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
51807
+ value: "auto",
51808
+ children: translate("settingsLanguageAuto")
51809
+ }),
51810
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
51811
+ value: "zh",
51812
+ children: translate("settingsLanguageZh")
51813
+ }),
51814
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
51815
+ value: "en",
51816
+ children: translate("settingsLanguageEn")
51817
+ })
51818
+ ]
51819
+ })
51820
+ }),
51531
51821
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardRow, {
51532
51822
  part: "settings-row-panel",
51533
51823
  brand: "#7c6aef",
@@ -52256,6 +52546,9 @@ window.__ModuleLoader__.load({
52256
52546
  .dsh-progress-number{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);font:inherit;font-size:13px;height:30px;padding:0 8px;text-align:center;width:64px}
52257
52547
  .dsh-progress-number:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:1px}
52258
52548
  .dsh-progress-number:disabled{cursor:default;opacity:.5}
52549
+ .dsh-progress-select{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);cursor:pointer;font:inherit;font-size:13px;height:30px;padding:0 6px}
52550
+ .dsh-progress-select:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:1px}
52551
+ .dsh-progress-select:disabled{cursor:default;opacity:.5}
52259
52552
  .dsh-progress-open{align-items:center;background:transparent;border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;color:var(--dsw-alias-label-primary,#141413);cursor:pointer;display:inline-flex;font:inherit;font-size:12px;gap:2px;padding:5px 8px}
52260
52553
  .dsh-progress-open:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(0,0,0,.04))}
52261
52554
  .dsh-progress-open:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}