@eddyskywalker/dsh-chatgpt-subscription 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -240,6 +240,11 @@ window.__ModuleLoader__.load({
240
240
  supportsReasoningSummary: false
241
241
  }
242
242
  ];
243
+ const DEFAULT_VISIBLE_CODEX_MODEL_IDS = [
244
+ "gpt-5.6-sol",
245
+ "gpt-5.6-terra",
246
+ "gpt-5.6-luna"
247
+ ];
243
248
  const DEFAULT_CODEX_MODEL = CODEX_MODEL_CATALOG[0];
244
249
  const CONFIGURABLE_CONTEXT_MODEL_IDS = [
245
250
  "gpt-5.6-sol",
@@ -444,6 +449,12 @@ window.__ModuleLoader__.load({
444
449
  preferences
445
450
  });
446
451
  });
452
+ const toggleVisibleModel = async (modelId, checked) => {
453
+ const current = status?.preferences.visibleModelIds ?? [...DEFAULT_VISIBLE_CODEX_MODEL_IDS];
454
+ const visibleModelIds = checked ? [...current, modelId] : current.filter((id) => id !== modelId);
455
+ if (visibleModelIds.length === 0) return;
456
+ await updatePreferences({ visibleModelIds });
457
+ };
447
458
  const updateContextWindow = async (model) => {
448
459
  const current = status?.preferences.contextWindowOverrides[model] ?? resolveCodexCatalogEntry(model).contextWindow;
449
460
  const parsed = parseCapacity$1(contextDrafts[model] ?? String(current));
@@ -478,6 +489,7 @@ window.__ModuleLoader__.load({
478
489
  }
479
490
  };
480
491
  const account = status?.account;
492
+ const visibleModelIds = status?.preferences.visibleModelIds ?? DEFAULT_VISIBLE_CODEX_MODEL_IDS;
481
493
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
482
494
  className: "dsh-codex-page",
483
495
  "aria-labelledby": "dsh-codex-title",
@@ -583,13 +595,26 @@ window.__ModuleLoader__.load({
583
595
  label: t("latency"),
584
596
  value: `${connection.latencyMs} ms · ${formatDate(connection.checkedAt)}`
585
597
  }) : null,
598
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
599
+ className: "dsh-codex-muted dsh-codex-models-hint",
600
+ children: t("modelsHint")
601
+ }),
586
602
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
587
603
  className: "dsh-codex-models",
588
604
  "aria-label": t("models"),
589
- children: CODEX_MODEL_CATALOG.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
590
- title: model.id,
591
- children: model.name
592
- }, model.id))
605
+ children: CODEX_MODEL_CATALOG.map((model) => {
606
+ const checked = visibleModelIds.some((id) => id === model.id);
607
+ const lastVisible = checked && visibleModelIds.length === 1;
608
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
609
+ title: model.id,
610
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
611
+ type: "checkbox",
612
+ checked,
613
+ disabled: busy !== null || lastVisible,
614
+ onChange: (event) => void toggleVisibleModel(model.id, event.currentTarget.checked)
615
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: model.name })]
616
+ }, model.id);
617
+ })
593
618
  }),
594
619
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
595
620
  className: "dsh-codex-actions",
@@ -948,6 +973,7 @@ window.__ModuleLoader__.load({
948
973
  function messageOf$1(error) {
949
974
  return error instanceof Error ? error.message : String(error);
950
975
  }
976
+ [...DEFAULT_VISIBLE_CODEX_MODEL_IDS];
951
977
  //#endregion
952
978
  //#region src/client/SubagentSettingsSection.tsx
953
979
  function SubagentSettingsSection({ t }) {
@@ -1300,6 +1326,7 @@ window.__ModuleLoader__.load({
1300
1326
  testing: "测试中…",
1301
1327
  latency: "最近延迟",
1302
1328
  models: "可用模型",
1329
+ modelsHint: "勾选后模型才会显示在对话页的模型选择列表中;至少保留一个。",
1303
1330
  enhancements: "增强功能",
1304
1331
  subagentSettingsNav: "子代理",
1305
1332
  subagentSettingsTitle: "子代理设置",
@@ -1422,6 +1449,7 @@ window.__ModuleLoader__.load({
1422
1449
  testing: "Testing…",
1423
1450
  latency: "Last latency",
1424
1451
  models: "Available models",
1452
+ modelsHint: "Checked models appear in the conversation model picker; at least one must remain enabled.",
1425
1453
  enhancements: "Enhancements",
1426
1454
  subagentSettingsNav: "Subagents",
1427
1455
  subagentSettingsTitle: "Subagent settings",
@@ -1534,8 +1562,14 @@ window.__ModuleLoader__.load({
1534
1562
  .dsh-codex-success{color:var(--dsw-alias-label-success,#2e9b62)}
1535
1563
  .dsh-codex-errorbar{align-items:center;background:color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 9%,transparent);border:1px solid color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 28%,transparent);border-radius:7px;color:var(--dsw-alias-label-danger,#d94b4b);display:flex;font-size:13px;gap:12px;justify-content:space-between;padding:10px 12px}
1536
1564
  .dsh-codex-link{color:var(--dsw-alias-label-link,#3278d4);display:inline-block;font-size:13px;margin-top:8px}
1537
- .dsh-codex-models{display:flex;flex-wrap:wrap;gap:6px;padding-top:12px}
1538
- .dsh-codex-models code{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:5px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;padding:4px 6px}
1565
+ .dsh-codex-models-hint{padding-top:10px}
1566
+ .dsh-codex-models{display:flex;flex-wrap:wrap;gap:7px;padding-top:8px}
1567
+ .dsh-codex-models label{cursor:pointer;display:block;position:relative}
1568
+ .dsh-codex-models input{position:absolute;opacity:0;pointer-events:none}
1569
+ .dsh-codex-models span{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;color:var(--dsw-alias-label-secondary);display:block;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;padding:5px 8px}
1570
+ .dsh-codex-models input:checked+span{background:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 14%,var(--dsw-alias-bg-layer-2));border-color:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 55%,var(--dsw-alias-border-l2));color:var(--dsw-alias-label-primary)}
1571
+ .dsh-codex-models input:focus-visible+span{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}
1572
+ .dsh-codex-models input:disabled+span{cursor:default;opacity:.5}
1539
1573
  .dsh-codex-pref-row{align-items:center;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;gap:16px;justify-content:space-between;min-height:58px;padding:10px 0}
1540
1574
  .dsh-codex-pref-row strong,.dsh-codex-check strong{display:block;font-size:13px;font-weight:600;line-height:1.35}
1541
1575
  .dsh-codex-segments{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:flex;flex:none;gap:2px;padding:2px}