dsh-codex-subscription 2.1.3 → 2.1.4

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/README.en.md CHANGED
@@ -22,9 +22,11 @@ No OpenAI API key or Codex CLI. Models, search, quota, and image generation stay
22
22
  <img src="docs/assets/codex-subscription-overview-en.webp" width="900" alt="Use ChatGPT and Codex subscriptions in DeepSeek Harness: sign in without an API key, choose models and view remaining quota">
23
23
  </p>
24
24
 
25
+ Compatible with the settings and UI changes in DSH `0.1.7-alpha.1`, while retaining support for previously supported versions.
26
+
25
27
  ## Three-step start
26
28
 
27
- 1. **Install the plugin.** In newer DSH, open **Plugins → Add plugin** and enter `dsh-codex-subscription`. To select a candidate, enter `package@version`, for example `dsh-codex-subscription@2.1.3-beta.1`. This field does not accept a full terminal command.
29
+ 1. **Install the plugin.** In newer DSH, open **Plugins → Add plugin** and enter `dsh-codex-subscription`. To select a candidate, enter `package@version`, for example `dsh-codex-subscription@2.1.4`. This field does not accept a full terminal command.
28
30
 
29
31
  For older DSH or terminal use, run:
30
32
 
@@ -136,6 +138,12 @@ Restart DSH manually after installation, then:
136
138
  - Visible errors when subscription routing is unavailable, with no silent paid fallback.
137
139
 
138
140
 
141
+ Subscription chat and native DSH subtasks do not require the Codex runtime. Updating to 2.1.3 removes the runtime previously pulled in automatically when no other dependency requires it. An explicitly installed component can be removed in Advanced settings. Switching back to DSH does not uninstall it, and uninstalling does not automatically clear the host’s shared download cache.
142
+
143
+ ### Add instructions while a task is running
144
+
145
+ Use DSH’s native message queue: messages sent during generation can wait for the next turn. Where the host offers interjection, its shortcut delivers queued input at the next step of the current turn. This does not immediately rewrite a response already being generated.
146
+
139
147
  ### GPT-Reserve (Experimental)
140
148
 
141
149
  When the account’s official catalog advertises `gpt-reserve`, it appears at the end of the model picker as an experimental option. Availability and billing are determined by the service; a successful response does not confirm use of a separate reserve allowance. The composer shows only a matching quota bucket returned by the service, and does not substitute ordinary Codex quota when none is returned.
package/README.md CHANGED
@@ -23,9 +23,11 @@
23
23
  <img src="docs/assets/codex-subscription-overview.webp" width="900" alt="在 DeepSeek Harness 登录 ChatGPT 并使用 Codex 订阅:无需 API Key,支持模型选择和剩余额度显示">
24
24
  </p>
25
25
 
26
+ 已适配 DSH `0.1.7-alpha.1` 的设置保存与界面接口,同时保留已支持版本的兼容。
27
+
26
28
  ## 三步开始
27
29
 
28
- 1. **安装插件**:在新版 DSH 的 **插件 → 添加插件** 中填写 `dsh-codex-subscription`;指定候选版本时填写完整的 `包名@版本`,例如 `dsh-codex-subscription@2.1.3-beta.1`。这个输入框不接受整条终端命令。
30
+ 1. **安装插件**:在新版 DSH 的 **插件 → 添加插件** 中填写 `dsh-codex-subscription`;指定候选版本时填写完整的 `包名@版本`,例如 `dsh-codex-subscription@2.1.4`。这个输入框不接受整条终端命令。
29
31
 
30
32
  旧版 DSH 或偏好终端操作时,才在终端运行:
31
33
 
@@ -137,6 +139,12 @@ dsh --profile web --dump-config
137
139
  - 订阅路由不可用时明确报错,不会静默切换到其他付费路由。
138
140
 
139
141
 
142
+ 普通订阅对话和 DSH 原生子任务不需要安装 Codex 运行时。升级到 2.1.3 后,旧版自动引入且没有其他依赖引用的运行时会随依赖更新移除;主动安装的独立组件可在高级设置中卸载。切换回 DSH 不等于卸载,卸载也不会自动清空宿主共享下载缓存。
143
+
144
+ ### 执行中补充指令
145
+
146
+ 沿用 DSH 原生消息队列:生成中发送消息可排队到下一轮;界面提供插话入口时,可用其快捷键将排队内容交给当前轮的下一步处理。插话不是立即改写正在生成的响应。
147
+
140
148
  ### GPT-Reserve(实验性)
141
149
 
142
150
  账号的官方模型目录提供 `gpt-reserve` 时,模型选择器末尾会出现实验性选项。可用性和扣费归属由服务端决定;请求成功不代表已确认使用独立备用额度。输入框只显示服务端返回的匹配额度桶,未返回时不会借用普通 Codex 额度。
@@ -9,6 +9,7 @@
9
9
  "0.1.5-alpha.1",
10
10
  "0.1.5-alpha.2",
11
11
  "0.1.6-alpha.1",
12
- "0.1.6-alpha.2"
12
+ "0.1.6-alpha.2",
13
+ "0.1.7-alpha.1"
13
14
  ]
14
15
  }
package/lib/client.js CHANGED
@@ -31,6 +31,7 @@ window.__ModuleLoader__.load({
31
31
  let react_jsx_runtime = require("react/jsx-runtime");
32
32
  let react_dom = require("react-dom");
33
33
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
34
+ _deepseek_ai_dsh_client_ui_primitives = __toESM(_deepseek_ai_dsh_client_ui_primitives, 1);
34
35
  //#region src/sketch-curves.js
35
36
  const cached = /* @__PURE__ */ new WeakMap();
36
37
  const midpoint = (a, b) => ({
@@ -4417,6 +4418,23 @@ window.__ModuleLoader__.load({
4417
4418
  }) });
4418
4419
  }
4419
4420
  //#endregion
4421
+ //#region src/client-primitives.js
4422
+ const Input = _deepseek_ai_dsh_client_ui_primitives.Input;
4423
+ const Button = _deepseek_ai_dsh_client_ui_primitives.Button;
4424
+ const useAnchoredPosition = _deepseek_ai_dsh_client_ui_primitives.useAnchoredPosition;
4425
+ const useDismissOnOutsidePointer = _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer;
4426
+ const IconCheckOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular;
4427
+ const IconChevronDownOutline14 = _deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14 ?? _deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular;
4428
+ const IconChevronRightOutline14 = _deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14 ?? _deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular;
4429
+ const Menu = _deepseek_ai_dsh_client_ui_primitives.Menu;
4430
+ const Tooltip = _deepseek_ai_dsh_client_ui_primitives.Tooltip;
4431
+ const IconChevronLeftOutline14 = _deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14 ?? _deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutlineRegular;
4432
+ const IconCloseOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular;
4433
+ const IconCopyOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconCopyOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconCopyOutlineRegular;
4434
+ const IconDownloadOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconDownloadOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular;
4435
+ const IconEditOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconEditOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconEditOutlineRegular;
4436
+ const IconFullscreenOutline16 = _deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutline16 ?? _deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutlineRegular;
4437
+ //#endregion
4420
4438
  //#region src/image-workspace.jsx
4421
4439
  function ImageWorkspace(props) {
4422
4440
  const { preference, t, registerOpen } = props;
@@ -4430,9 +4448,9 @@ window.__ModuleLoader__.load({
4430
4448
  dispose();
4431
4449
  };
4432
4450
  }, [registerOpen]);
4433
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [settings.imageSketch && settings.imageEditing ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
4451
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [settings.imageSketch && settings.imageEditing ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, {
4434
4452
  label: t("sketch"),
4435
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4453
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
4436
4454
  variant: "toolbar",
4437
4455
  size: "sm",
4438
4456
  "aria-label": t("sketch"),
@@ -4506,6 +4524,8 @@ window.__ModuleLoader__.load({
4506
4524
  //#endregion
4507
4525
  //#region src/client-locales.js
4508
4526
  const zh = {
4527
+ runtimeIncompatible: "检测到不兼容的 Codex 子任务组件,请卸载后重启,再安装受支持版本。",
4528
+ runtimeManagedElsewhere: "此组件由宿主或其他依赖管理,请在 DSH 插件管理中查看;这里不能直接卸载。",
4509
4529
  runtimeLoading: "正在检查组件…",
4510
4530
  runtimeRestart: "组件已更新,请重启 DSH 后使用。",
4511
4531
  runtime_installing: "正在通过 DSH 安装组件…",
@@ -4957,6 +4977,8 @@ window.__ModuleLoader__.load({
4957
4977
  imageRemoveAnnotation: "删除标注"
4958
4978
  };
4959
4979
  const en = {
4980
+ runtimeIncompatible: "An incompatible Codex subtask component was found. Uninstall it, restart DSH, then install the supported version.",
4981
+ runtimeManagedElsewhere: "This component is managed by the host or another dependency. Check DSH plugin management; it cannot be removed here.",
4960
4982
  runtimeLoading: "Checking component…",
4961
4983
  runtimeRestart: "Component changed. Restart DSH before using it.",
4962
4984
  runtime_installing: "Installing through DSH…",
@@ -6001,7 +6023,7 @@ window.__ModuleLoader__.load({
6001
6023
  invoke();
6002
6024
  },
6003
6025
  children: [
6004
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {}),
6026
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutline16, {}),
6005
6027
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6006
6028
  className: "dcsiv-label",
6007
6029
  children: label ?? t("imageEdit")
@@ -6055,7 +6077,7 @@ window.__ModuleLoader__.load({
6055
6077
  onClick: () => {
6056
6078
  invoke();
6057
6079
  },
6058
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6080
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDownloadOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6059
6081
  className: "dcsiv-label",
6060
6082
  children: state === "pending" ? `${label} ${progress}% · ${t("cancel")}` : label
6061
6083
  })]
@@ -6244,7 +6266,7 @@ window.__ModuleLoader__.load({
6244
6266
  resetGesture();
6245
6267
  setAnnotating((value) => !value);
6246
6268
  },
6247
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6269
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6248
6270
  className: "dcsiv-label",
6249
6271
  children: annotating ? t("imageAnnotateCancel") : t("imageAnnotate")
6250
6272
  })]
@@ -6272,7 +6294,7 @@ window.__ModuleLoader__.load({
6272
6294
  className: "dcsiv-button",
6273
6295
  "aria-label": t("imageFit"),
6274
6296
  onClick: fit,
6275
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6297
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFullscreenOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6276
6298
  className: "dcsiv-label",
6277
6299
  children: t("imageFit")
6278
6300
  })]
@@ -6291,7 +6313,7 @@ window.__ModuleLoader__.load({
6291
6313
  className: "dcsiv-download",
6292
6314
  href: item.src,
6293
6315
  download: downloadName(item.name),
6294
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6316
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDownloadOutline16, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6295
6317
  className: "dcsiv-label",
6296
6318
  children: t("imageDownload")
6297
6319
  })]
@@ -6316,7 +6338,7 @@ window.__ModuleLoader__.load({
6316
6338
  className: "dcsiv-close-floating",
6317
6339
  "aria-label": t("imageClosePreview"),
6318
6340
  onClick: () => service.close(),
6319
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, {})
6341
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, {})
6320
6342
  }),
6321
6343
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6322
6344
  className: "dcsiv-workspace",
@@ -6406,7 +6428,7 @@ window.__ModuleLoader__.load({
6406
6428
  setAnnotations((current) => current.filter((entry) => entry.id !== annotation.id));
6407
6429
  setSelected(void 0);
6408
6430
  },
6409
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, {})
6431
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, {})
6410
6432
  })
6411
6433
  ]
6412
6434
  }) : null]
@@ -6420,7 +6442,7 @@ window.__ModuleLoader__.load({
6420
6442
  event.stopPropagation();
6421
6443
  setIndex((value) => (value - 1 + request.items.length) % request.items.length);
6422
6444
  },
6423
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14, {})
6445
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronLeftOutline14, {})
6424
6446
  }),
6425
6447
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
6426
6448
  type: "button",
@@ -6430,7 +6452,7 @@ window.__ModuleLoader__.load({
6430
6452
  event.stopPropagation();
6431
6453
  setIndex((value) => (value + 1) % request.items.length);
6432
6454
  },
6433
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
6455
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronRightOutline14, {})
6434
6456
  }),
6435
6457
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6436
6458
  className: "dcsiv-counter",
@@ -6454,7 +6476,7 @@ window.__ModuleLoader__.load({
6454
6476
  onClick: () => {
6455
6477
  copyNotes();
6456
6478
  },
6457
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCopyOutline16, {}), copied ? t("imageCopied") : t("imageCopyNotes")]
6479
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopyOutline16, {}), copied ? t("imageCopied") : t("imageCopyNotes")]
6458
6480
  }) : null]
6459
6481
  })
6460
6482
  ]
@@ -6663,9 +6685,6 @@ window.__ModuleLoader__.load({
6663
6685
  limitId: limit.id
6664
6686
  }))).filter((window) => Number.isFinite(window.remainingPercent) && window.remainingPercent >= 0 && window.remainingPercent <= (mode === "custom" ? readCapabilitySettings(thresholds)[window.windowSeconds > 0 && window.windowSeconds <= 6 * 3600 ? "quotaShortThreshold" : "quotaLongThreshold"] : mode === "early" && window.windowSeconds > 0 && window.windowSeconds <= 6 * 3600 ? 50 : 20) && (!Number.isFinite(window.resetsAt) || window.resetsAt * 1e3 > now)).sort((a, b) => a.remainingPercent - b.remainingPercent)[0];
6665
6687
  }
6666
- //#endregion
6667
- //#region src/settings-contract.js
6668
- const SETTINGS_NAMESPACE = "codex-subscription";
6669
6688
  const QUICK_QUOTA_MODE_FIELD = "quickQuotaMode";
6670
6689
  const LEGACY_QUICK_QUOTA_FIELD = "quickQuotaVisible";
6671
6690
  const QUICK_QUOTA_MODE_PERCENT = "percent";
@@ -7255,7 +7274,7 @@ window.__ModuleLoader__.load({
7255
7274
  }
7256
7275
  //#endregion
7257
7276
  //#region src/version.js
7258
- const PACKAGE_VERSION = "2.1.3";
7277
+ const PACKAGE_VERSION = "2.1.4";
7259
7278
  //#endregion
7260
7279
  //#region src/client-recovery.js
7261
7280
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
@@ -7359,7 +7378,7 @@ window.__ModuleLoader__.load({
7359
7378
  (0, react.useEffect)(() => () => clearTimeout(dismissTimer.current), []);
7360
7379
  const id = (0, react.useId)();
7361
7380
  const visible = open && quotaEnabled && !!quotas?.length;
7362
- const position = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredPosition)({
7381
+ const position = useAnchoredPosition({
7363
7382
  open: visible,
7364
7383
  anchorRef: trigger,
7365
7384
  panelRef: panel,
@@ -7367,7 +7386,7 @@ window.__ModuleLoader__.load({
7367
7386
  gap: 8,
7368
7387
  margin: 12
7369
7388
  });
7370
- (0, _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer)(trigger, visible, dismiss, panel);
7389
+ useDismissOnOutsidePointer(trigger, visible, dismiss, panel);
7371
7390
  (0, react.useEffect)(() => {
7372
7391
  setOpen(false);
7373
7392
  }, [current?.model, quotaEnabled]);
@@ -7640,7 +7659,7 @@ window.__ModuleLoader__.load({
7640
7659
  })]
7641
7660
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7642
7661
  className: "codexModelSelectCheck",
7643
- children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
7662
+ children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, {}) : null
7644
7663
  })]
7645
7664
  }, key);
7646
7665
  const cell = (target, label, value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -7660,7 +7679,7 @@ window.__ModuleLoader__.load({
7660
7679
  className: "codexModelSelectCellValue",
7661
7680
  children: value
7662
7681
  }),
7663
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, { className: "codexModelSelectCellChevron" })
7682
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronRightOutline14, { className: "codexModelSelectCellChevron" })
7664
7683
  ]
7665
7684
  });
7666
7685
  let submenu = null;
@@ -7800,7 +7819,7 @@ window.__ModuleLoader__.load({
7800
7819
  className: "codexModelSelectEffort",
7801
7820
  children: effortLabel
7802
7821
  }),
7803
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: "codexModelSelectChevron" })
7822
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, { className: "codexModelSelectChevron" })
7804
7823
  ]
7805
7824
  }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7806
7825
  className: "codexModelSelectMenu",
@@ -7862,7 +7881,7 @@ window.__ModuleLoader__.load({
7862
7881
  className: "codexSubscriptionPreferenceHint",
7863
7882
  children: hint
7864
7883
  }) : null]
7865
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
7884
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
7866
7885
  open: open && !disabled,
7867
7886
  items,
7868
7887
  selectedId: value,
@@ -7884,7 +7903,7 @@ window.__ModuleLoader__.load({
7884
7903
  "aria-expanded": open && !disabled,
7885
7904
  disabled,
7886
7905
  onClick: () => setOpen((current) => !current),
7887
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})]
7906
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})]
7888
7907
  })
7889
7908
  })]
7890
7909
  });
@@ -7905,7 +7924,7 @@ window.__ModuleLoader__.load({
7905
7924
  className: "codexSubscriptionPreferenceHint",
7906
7925
  children: active ? modelLabel(snapshot.imageModel) : t("imageCapability_off")
7907
7926
  }),
7908
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
7927
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})
7909
7928
  ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7910
7929
  className: "codexSubscriptionSettingsDisclosureBody",
7911
7930
  children: [
@@ -8044,7 +8063,7 @@ window.__ModuleLoader__.load({
8044
8063
  className: "codexSubscriptionPreferenceCopy",
8045
8064
  children: [
8046
8065
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("searchDomains") }),
8047
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
8066
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
8048
8067
  "aria-label": t("searchDomains"),
8049
8068
  "aria-invalid": invalid,
8050
8069
  value: domains,
@@ -8089,7 +8108,7 @@ window.__ModuleLoader__.load({
8089
8108
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [
8090
8109
  t(field),
8091
8110
  " ",
8092
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
8111
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
8093
8112
  type: "number",
8094
8113
  min: 1,
8095
8114
  max: 100,
@@ -8179,6 +8198,9 @@ window.__ModuleLoader__.load({
8179
8198
  if (alive.current) setSending(false);
8180
8199
  }
8181
8200
  };
8201
+ (0, react.useEffect)(() => {
8202
+ if (state?.phase === "done") preference.load();
8203
+ }, [state?.phase]);
8182
8204
  const locked = sending || busy || state?.restartRequired || state?.active > 0;
8183
8205
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8184
8206
  className: "codexSubscriptionRuntime",
@@ -8187,17 +8209,18 @@ window.__ModuleLoader__.load({
8187
8209
  className: "codexSubscriptionPreference",
8188
8210
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8189
8211
  role: "status",
8190
- children: t(!state ? "runtimeLoading" : state.restartRequired ? "runtimeRestart" : busy ? `runtime_${state.phase}` : state.installed ? "subagentRuntimeInstalled" : "subagentRuntimeMissing")
8191
- }), state?.available ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8212
+ children: t(!state ? "runtimeLoading" : state.restartRequired ? "runtimeRestart" : busy ? `runtime_${state.phase}` : state.installed ? "subagentRuntimeInstalled" : state.present ? "runtimeIncompatible" : "subagentRuntimeMissing")
8213
+ }), state?.available ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8192
8214
  type: "button",
8193
8215
  variant: "outline",
8194
- disabled: locked || state.installed && !state.removable,
8195
- onClick: () => state.installed ? setConfirm(true) : void act("install"),
8196
- children: t(state.installed ? "runtimeRemove" : "runtimeInstall")
8216
+ disabled: locked || state.present && !state.removable,
8217
+ onClick: () => state.present ? setConfirm(true) : void act("install"),
8218
+ children: t(state.present ? "runtimeRemove" : "runtimeInstall")
8197
8219
  }) : null]
8198
8220
  }),
8221
+ state?.present && state.available && !state.removable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("runtimeManagedElsewhere") }) : null,
8199
8222
  state?.active > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("runtimeActive") }) : null,
8200
- busy && state.phase === "installing" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8223
+ busy && state.phase === "installing" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8201
8224
  type: "button",
8202
8225
  variant: "outline",
8203
8226
  disabled: sending,
@@ -8211,14 +8234,14 @@ window.__ModuleLoader__.load({
8211
8234
  "aria-label": t("runtimeRemove"),
8212
8235
  children: [
8213
8236
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("runtimeConfirm") }),
8214
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8237
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8215
8238
  type: "button",
8216
8239
  variant: "outline",
8217
8240
  onClick: () => setConfirm(false),
8218
8241
  children: t("runtimeKeep")
8219
8242
  }),
8220
8243
  " ",
8221
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8244
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8222
8245
  type: "button",
8223
8246
  variant: "outline",
8224
8247
  disabled: locked,
@@ -8237,7 +8260,7 @@ window.__ModuleLoader__.load({
8237
8260
  role: "status",
8238
8261
  children: t("runtimeCancelled")
8239
8262
  }) : null,
8240
- !busy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8263
+ !busy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8241
8264
  type: "button",
8242
8265
  variant: "outline",
8243
8266
  disabled: sending,
@@ -8443,7 +8466,7 @@ window.__ModuleLoader__.load({
8443
8466
  className: "codexSubscriptionContextHint",
8444
8467
  children: hint
8445
8468
  })]
8446
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
8469
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
8447
8470
  open: menuOpen,
8448
8471
  items: contextModeItems,
8449
8472
  selectedId: snapshot.contextMode,
@@ -8464,7 +8487,7 @@ window.__ModuleLoader__.load({
8464
8487
  "aria-expanded": menuOpen,
8465
8488
  disabled: !writable,
8466
8489
  onClick: () => setMenuOpen((value) => !value),
8467
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: selectedMode }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})]
8490
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: selectedMode }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})]
8468
8491
  })
8469
8492
  })]
8470
8493
  }),
@@ -8478,7 +8501,7 @@ window.__ModuleLoader__.load({
8478
8501
  minimum: String(Math.min(MIN_CUSTOM_CONTEXT_WINDOW, model.maximum)),
8479
8502
  value: String(model.maximum)
8480
8503
  }) })]
8481
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
8504
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
8482
8505
  "aria-label": `${model.label} ${t("contextTokens")}`,
8483
8506
  className: "codexSubscriptionContextInput",
8484
8507
  type: "number",
@@ -8516,7 +8539,7 @@ window.__ModuleLoader__.load({
8516
8539
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8517
8540
  className: "codexSubscriptionPreferenceHint",
8518
8541
  children: t(snapshot.catalogStatus?.source === "online" ? "catalogOnline" : "catalogFallback")
8519
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8542
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8520
8543
  type: "button",
8521
8544
  variant: "outline",
8522
8545
  disabled: snapshot.modelsLoading,
@@ -8687,7 +8710,7 @@ window.__ModuleLoader__.load({
8687
8710
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8688
8711
  className: "codexSubscriptionError",
8689
8712
  children: t("preferenceFailed")
8690
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8713
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8691
8714
  type: "button",
8692
8715
  variant: "outline",
8693
8716
  onClick: () => {
@@ -8927,7 +8950,7 @@ window.__ModuleLoader__.load({
8927
8950
  }), accountReady ? signedIn ? t("connected") : t("disconnected") : t("accountLoading")]
8928
8951
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8929
8952
  className: "codexSubscriptionActions",
8930
- children: signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8953
+ children: signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8931
8954
  type: "button",
8932
8955
  variant: "outline",
8933
8956
  disabled: busy || loginVisible,
@@ -8936,19 +8959,19 @@ window.__ModuleLoader__.load({
8936
8959
  setAdding(true);
8937
8960
  },
8938
8961
  children: t("addAccount")
8939
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8962
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8940
8963
  type: "button",
8941
8964
  variant: "outline",
8942
8965
  disabled: busy || loginVisible,
8943
8966
  onClick: logout,
8944
8967
  children: t("signOutAll")
8945
- })] }) : accountReady && (flow === void 0 || ["failed", "cancelled"].includes(flow.phase)) ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8968
+ })] }) : accountReady && (flow === void 0 || ["failed", "cancelled"].includes(flow.phase)) ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8946
8969
  type: "button",
8947
8970
  variant: "primary",
8948
8971
  disabled: busy,
8949
8972
  onClick: () => begin("browser"),
8950
8973
  children: t("browserLogin")
8951
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8974
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8952
8975
  type: "button",
8953
8976
  variant: "outline",
8954
8977
  disabled: busy,
@@ -8971,21 +8994,21 @@ window.__ModuleLoader__.load({
8971
8994
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8972
8995
  className: "codexSubscriptionActions",
8973
8996
  children: [
8974
- candidate.active ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8997
+ candidate.active ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8975
8998
  type: "button",
8976
8999
  variant: "outline",
8977
9000
  disabled: busy || loginVisible,
8978
9001
  onClick: () => selectAccount(candidate.id),
8979
9002
  children: t("switchAccount")
8980
9003
  }),
8981
- accounts.length > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9004
+ accounts.length > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8982
9005
  type: "button",
8983
9006
  variant: "outline",
8984
9007
  disabled: busy || loginVisible,
8985
9008
  onClick: () => removeAccount(candidate.id),
8986
9009
  children: removeId === candidate.id ? t("removeConfirm") : t("removeAccount")
8987
9010
  }) : null,
8988
- removeId === candidate.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9011
+ removeId === candidate.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8989
9012
  type: "button",
8990
9013
  variant: "outline",
8991
9014
  disabled: busy,
@@ -9001,21 +9024,21 @@ window.__ModuleLoader__.load({
9001
9024
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9002
9025
  className: "codexSubscriptionActions",
9003
9026
  children: [
9004
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9027
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9005
9028
  type: "button",
9006
9029
  variant: "primary",
9007
9030
  disabled: busy,
9008
9031
  onClick: () => begin("browser"),
9009
9032
  children: t("browserLogin")
9010
9033
  }),
9011
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9034
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9012
9035
  type: "button",
9013
9036
  variant: "outline",
9014
9037
  disabled: busy,
9015
9038
  onClick: () => begin("device_code"),
9016
9039
  children: t("deviceLogin")
9017
9040
  }),
9018
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9041
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9019
9042
  type: "button",
9020
9043
  variant: "outline",
9021
9044
  disabled: busy,
@@ -9040,7 +9063,7 @@ window.__ModuleLoader__.load({
9040
9063
  children: t("openLogin")
9041
9064
  }),
9042
9065
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("waiting") }),
9043
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9066
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9044
9067
  type: "button",
9045
9068
  variant: "outline",
9046
9069
  disabled: busy,
@@ -9054,7 +9077,7 @@ window.__ModuleLoader__.load({
9054
9077
  onSubmit: submit,
9055
9078
  children: [
9056
9079
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("manualCode") }),
9057
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
9080
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
9058
9081
  className: "codexSubscriptionInput",
9059
9082
  value: manualCode,
9060
9083
  onChange: (event) => setManualCode(event.currentTarget.value),
@@ -9063,12 +9086,12 @@ window.__ModuleLoader__.load({
9063
9086
  }),
9064
9087
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9065
9088
  className: "codexSubscriptionActions",
9066
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9089
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9067
9090
  type: "submit",
9068
9091
  variant: "primary",
9069
9092
  disabled: busy || manualCode.trim() === "",
9070
9093
  children: t("submit")
9071
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9094
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9072
9095
  type: "button",
9073
9096
  variant: "outline",
9074
9097
  disabled: busy,
@@ -9088,7 +9111,7 @@ window.__ModuleLoader__.load({
9088
9111
  rel: "noreferrer",
9089
9112
  children: t("openLogin")
9090
9113
  }),
9091
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9114
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9092
9115
  type: "button",
9093
9116
  variant: "outline",
9094
9117
  disabled: busy,
@@ -9140,7 +9163,7 @@ window.__ModuleLoader__.load({
9140
9163
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9141
9164
  className: "codexSubscriptionActions",
9142
9165
  children: [
9143
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9166
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9144
9167
  type: "button",
9145
9168
  variant: "outline",
9146
9169
  disabled: retrying || busy,
@@ -9150,14 +9173,14 @@ window.__ModuleLoader__.load({
9150
9173
  },
9151
9174
  children: retrying ? t("accountRetrying") : t("accountRetry")
9152
9175
  }),
9153
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9176
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9154
9177
  type: "button",
9155
9178
  variant: "outline",
9156
9179
  disabled: busy || retrying,
9157
9180
  onClick: () => void clear(),
9158
9181
  children: busy ? t("accountRetrying") : t(confirm ? "recoveryClearConfirm" : "recoveryClear")
9159
9182
  }),
9160
- confirm ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9183
+ confirm ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9161
9184
  type: "button",
9162
9185
  variant: "outline",
9163
9186
  disabled: busy,
@@ -9208,14 +9231,14 @@ window.__ModuleLoader__.load({
9208
9231
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9209
9232
  className: "codexSubscriptionActions",
9210
9233
  children: [
9211
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9234
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9212
9235
  type: "button",
9213
9236
  variant: "outline",
9214
9237
  disabled: busy,
9215
9238
  onClick: load,
9216
9239
  children: busy ? t("diagnosticsLoading") : t("diagnosticsLoad")
9217
9240
  }),
9218
- report === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9241
+ report === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9219
9242
  type: "button",
9220
9243
  variant: "outline",
9221
9244
  onClick: copy,
@@ -9372,7 +9395,7 @@ window.__ModuleLoader__.load({
9372
9395
  })]
9373
9396
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9374
9397
  className: "codexSubscriptionActions",
9375
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9398
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9376
9399
  className: "codexSubscriptionResetUse",
9377
9400
  type: "button",
9378
9401
  variant: "outline",
@@ -9418,13 +9441,13 @@ window.__ModuleLoader__.load({
9418
9441
  }) : null,
9419
9442
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9420
9443
  className: "codexSubscriptionActions",
9421
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9444
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9422
9445
  type: "button",
9423
9446
  variant: "outline",
9424
9447
  disabled: resetBusy,
9425
9448
  onClick: cancelReset,
9426
9449
  children: t("cancel")
9427
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9450
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9428
9451
  className: "codexSubscriptionResetFinal",
9429
9452
  type: "button",
9430
9453
  variant: "outline",
@@ -9517,7 +9540,7 @@ window.__ModuleLoader__.load({
9517
9540
  dateTime: fetchedAt.toISOString(),
9518
9541
  children: fill(t("usageUpdated"), { value: fetchedAt.toLocaleString() })
9519
9542
  })]
9520
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9543
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9521
9544
  className: "codexSubscriptionRefresh",
9522
9545
  type: "button",
9523
9546
  variant: "outline",
@@ -9756,7 +9779,6 @@ window.__ModuleLoader__.load({
9756
9779
  "locale",
9757
9780
  "connection",
9758
9781
  "remote",
9759
- "settingsScope",
9760
9782
  "modelDirectories",
9761
9783
  "conversation",
9762
9784
  "uiConversation",
@@ -9776,7 +9798,10 @@ window.__ModuleLoader__.load({
9776
9798
  return () => tag.remove();
9777
9799
  }, "codex-subscription: style");
9778
9800
  const rpc = createSubscriptionRpcClient(ctx.get("connection").rpc);
9779
- const preference = createPreferenceController(ctx.settingsScope.bind({ namespace: SETTINGS_NAMESPACE }), rpc);
9801
+ const preference = createPreferenceController(ctx.get("settingsScope")?.bind({ namespace: "codex-subscription" }) ?? {
9802
+ getSnapshot: () => ({ status: "unavailable" }),
9803
+ subscribe: () => () => {}
9804
+ }, rpc);
9780
9805
  ctx.effect(() => {
9781
9806
  let previous = JSON.stringify(preference.getSnapshot(), (key, value) => key.startsWith("image") || key === "" ? value : void 0);
9782
9807
  return preference.subscribe(() => {
package/lib/index.js CHANGED
@@ -22,6 +22,24 @@ import z from "@deepseek-ai/schemastery";
22
22
  import { openaiCodexProvider as createOpenAICodexProvider } from "@earendil-works/pi-ai/providers/openai-codex";
23
23
  import { createModels } from "@earendil-works/pi-ai";
24
24
  import { WebError } from "@deepseek-ai/dsh-web";
25
+ //#region src/settings-adapter.js
26
+ function createSettingsAdapter(ctx, schema, config, namespace) {
27
+ if (typeof ctx.settings.register === "function") return ctx.settings.register(namespace, schema);
28
+ if (typeof ctx.settings.configure !== "function" || typeof ctx.settings.update !== "function") throw new Error("DSH settings API is unavailable");
29
+ ctx.effect(() => ctx.settings.configure({ auto: false }));
30
+ const entry = ctx.fiber.entry;
31
+ const id = entry?.options?.id ?? entry?.id;
32
+ if (!id) throw new Error("DSH settings entry is unavailable");
33
+ const get = () => Object.fromEntries(Object.entries(config).map(([key, value]) => [key, typeof value?.get === "function" ? value.get() : value]));
34
+ return {
35
+ get,
36
+ update: (patch) => ctx.settings.update(id, patch),
37
+ watch(listener) {
38
+ return ctx.on("loader/volatile-update", () => listener(get()));
39
+ }
40
+ };
41
+ }
42
+ //#endregion
25
43
  //#region src/image-models.js
26
44
  const DEFAULT_IMAGE_MODEL = "gpt-image-2";
27
45
  const IMAGE_MODELS = Object.freeze({
@@ -1062,7 +1080,10 @@ const execute = promisify(execFile);
1062
1080
  function inspectSubagentRuntime(resolve = require.resolve) {
1063
1081
  try {
1064
1082
  const manifestPath = resolve(`${SUBAGENT_RUNTIME_PACKAGE}/package.json`);
1065
- if (JSON.parse(readFileSync(manifestPath, "utf8")).version !== "0.1.5-rc.2") return { installed: false };
1083
+ if (JSON.parse(readFileSync(manifestPath, "utf8")).version !== "0.1.5-rc.2") return {
1084
+ installed: false,
1085
+ present: true
1086
+ };
1066
1087
  return { installed: true };
1067
1088
  } catch {
1068
1089
  return { installed: false };
@@ -1325,10 +1346,12 @@ function createRuntimeManagement({ manager, inspect, active, selectDsh }) {
1325
1346
  } catch {
1326
1347
  available = false;
1327
1348
  }
1349
+ const runtime = inspect();
1328
1350
  return {
1329
1351
  ...state,
1330
1352
  available,
1331
- installed: inspect().installed,
1353
+ installed: runtime.installed,
1354
+ present: runtime.installed || runtime.present === true || bundle?.installed === true,
1332
1355
  removable: available && bundle?.installed === true && !bundle.readOnlyReason,
1333
1356
  active: active()
1334
1357
  };
@@ -2787,7 +2810,7 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
2787
2810
  Object.freeze(["0.82.1", "0.85.1"]);
2788
2811
  //#endregion
2789
2812
  //#region src/version.js
2790
- const PACKAGE_VERSION = "2.1.3";
2813
+ const PACKAGE_VERSION = "2.1.4";
2791
2814
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
2792
2815
  //#endregion
2793
2816
  //#region src/model-catalog.js
@@ -5045,28 +5068,30 @@ function createSearchProviderSwitcher(loader) {
5045
5068
  }
5046
5069
  });
5047
5070
  }
5048
- function apply(ctx) {
5049
- const settings = ctx.settings.register(SETTINGS_NAMESPACE, z.object({
5050
- ...Object.fromEntries(Object.entries(PREFERENCE_FIELDS).map(([field, rule]) => [field, rule.default === void 0 ? z.union(rule.choices) : z.union(rule.choices).default(rule.default)])),
5051
- imageModel: z.union(Object.keys(IMAGE_MODELS)).default(DEFAULT_IMAGE_MODEL),
5052
- imageQuality: z.union([
5053
- "auto",
5054
- "low",
5055
- "medium",
5056
- "high",
5057
- "xhigh",
5058
- "max"
5059
- ]).default("auto"),
5060
- ...Object.fromEntries(Object.entries(IMAGE_FEATURE_DEFAULTS).map(([key, value]) => [key, z.boolean().default(value)])),
5061
- [CUSTOM_CONTEXT_OVERRIDES_FIELD]: z.dict(z.number().step(1).min(1).max(MAX_CONTEXT_BUDGET)).default({}),
5062
- [SEARCH_MODE_FIELD]: z.union(SEARCH_MODES).default("live"),
5063
- [SEARCH_DOMAINS_FIELD]: z.transform(z.array(z.string()).max(20), normalizeSearchDomains).default([]),
5064
- ...Object.fromEntries(QUOTA_THRESHOLD_FIELDS.map((key) => [key, z.number().step(1).min(1).max(100).default(20)])),
5065
- [QUOTA_ALERTS_FIELD]: z.union(QUOTA_ALERT_MODES).default("important"),
5066
- [LEGACY_QUICK_QUOTA_FIELD]: z.boolean(),
5067
- [CUSTOM_CONTEXT_WINDOW_FIELD]: z.number().step(1).min(128e3).max(1e6).default(DEFAULT_CUSTOM_CONTEXT_WINDOW),
5068
- ...Object.fromEntries(Object.entries(CUSTOM_CONTEXT_MODEL_FIELDS).map(([modelKey, field]) => [field, z.number().step(1).min(128e3).max(CUSTOM_CONTEXT_MODEL_CAPS[modelKey]).default(CUSTOM_CONTEXT_MODEL_DEFAULTS[modelKey])]))
5069
- }));
5071
+ const settingsFields = {
5072
+ ...Object.fromEntries(Object.entries(PREFERENCE_FIELDS).map(([field, rule]) => [field, rule.default === void 0 ? z.union(rule.choices) : z.union(rule.choices).default(rule.default)])),
5073
+ imageModel: z.union(Object.keys(IMAGE_MODELS)).default(DEFAULT_IMAGE_MODEL),
5074
+ imageQuality: z.union([
5075
+ "auto",
5076
+ "low",
5077
+ "medium",
5078
+ "high",
5079
+ "xhigh",
5080
+ "max"
5081
+ ]).default("auto"),
5082
+ ...Object.fromEntries(Object.entries(IMAGE_FEATURE_DEFAULTS).map(([key, value]) => [key, z.boolean().default(value)])),
5083
+ [CUSTOM_CONTEXT_OVERRIDES_FIELD]: z.dict(z.number().step(1).min(1).max(MAX_CONTEXT_BUDGET)).default({}),
5084
+ [SEARCH_MODE_FIELD]: z.union(SEARCH_MODES).default("live"),
5085
+ [SEARCH_DOMAINS_FIELD]: z.transform(z.array(z.string()).max(20), normalizeSearchDomains).default([]),
5086
+ ...Object.fromEntries(QUOTA_THRESHOLD_FIELDS.map((key) => [key, z.number().step(1).min(1).max(100).default(20)])),
5087
+ [QUOTA_ALERTS_FIELD]: z.union(QUOTA_ALERT_MODES).default("important"),
5088
+ [LEGACY_QUICK_QUOTA_FIELD]: z.boolean(),
5089
+ [CUSTOM_CONTEXT_WINDOW_FIELD]: z.number().step(1).min(128e3).max(1e6).default(DEFAULT_CUSTOM_CONTEXT_WINDOW),
5090
+ ...Object.fromEntries(Object.entries(CUSTOM_CONTEXT_MODEL_FIELDS).map(([modelKey, field]) => [field, z.number().step(1).min(128e3).max(CUSTOM_CONTEXT_MODEL_CAPS[modelKey]).default(CUSTOM_CONTEXT_MODEL_DEFAULTS[modelKey])]))
5091
+ };
5092
+ const Config = z.object(Object.fromEntries(Object.entries(settingsFields).map(([key, field]) => [key, typeof field.volatile === "function" ? field.volatile() : field])));
5093
+ function apply(ctx, config = {}) {
5094
+ const settings = createSettingsAdapter(ctx, z.object(settingsFields), config, SETTINGS_NAMESPACE);
5070
5095
  const searchProvider = createSearchProviderSwitcher(ctx.loader);
5071
5096
  const network = createCodexNetworkTransport();
5072
5097
  const originalImages = new OriginalImageStore();
@@ -5400,4 +5425,4 @@ function apply(ctx) {
5400
5425
  }, "codex-subscription: DSH-trusted account RPC"));
5401
5426
  }
5402
5427
  //#endregion
5403
- export { CODEX_IMAGE_GENERATION_URL, CODEX_IMAGE_TOOL_NAME, CODEX_RESET_CONSUME_URL, CODEX_RESET_CREDITS_URL, CODEX_USAGE_URL, CodexLoginCoordinator, DshOAuthCredentialStore, apply, assertCodexAuthUrl, commandForCodexAuthUrl, createCodexAuthService, createCodexImageTool, createCodexResetCreditService, createCodexRpcHandler, createCodexUsageReader, createSearchProviderSwitcher, createSubscriptionDiagnostics, createSubscriptionRpcHandler, decodeCodexPng, inject, name, normalizeContextMode, normalizeCustomContextWindow, openCodexAuthUrl, parseCodexUsage };
5428
+ export { CODEX_IMAGE_GENERATION_URL, CODEX_IMAGE_TOOL_NAME, CODEX_RESET_CONSUME_URL, CODEX_RESET_CREDITS_URL, CODEX_USAGE_URL, CodexLoginCoordinator, Config, DshOAuthCredentialStore, apply, assertCodexAuthUrl, commandForCodexAuthUrl, createCodexAuthService, createCodexImageTool, createCodexResetCreditService, createCodexRpcHandler, createCodexUsageReader, createSearchProviderSwitcher, createSubscriptionDiagnostics, createSubscriptionRpcHandler, decodeCodexPng, inject, name, normalizeContextMode, normalizeCustomContextWindow, openCodexAuthUrl, parseCodexUsage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Use ChatGPT and Codex subscriptions in DeepSeek Harness with OAuth, quota, safe resets, web search, images, and Fast mode",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -73,22 +73,22 @@
73
73
  "node": "^22.19.0 || >=24.0.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@deepseek-ai/cordis": "4.0.1 || 4.0.2",
77
- "@deepseek-ai/dsh-api-remotes": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
78
- "@deepseek-ai/dsh-client-connection": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
79
- "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
80
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
81
- "@deepseek-ai/dsh-client-ui-model-selection": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
82
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
83
- "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
84
- "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
85
- "@deepseek-ai/dsh-client-ui-tool": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
86
- "@deepseek-ai/dsh-credentials": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
87
- "@deepseek-ai/dsh-llm": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
88
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
89
- "@deepseek-ai/dsh-settings": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
90
- "@deepseek-ai/dsh-tools": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
91
- "@deepseek-ai/dsh-web": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
76
+ "@deepseek-ai/cordis": "4.0.1 || 4.0.2 || 4.0.3",
77
+ "@deepseek-ai/dsh-api-remotes": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
78
+ "@deepseek-ai/dsh-client-connection": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
79
+ "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
80
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
81
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
82
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
83
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
84
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
85
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
86
+ "@deepseek-ai/dsh-credentials": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
87
+ "@deepseek-ai/dsh-llm": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
88
+ "@deepseek-ai/dsh-llm-pi-ai": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
89
+ "@deepseek-ai/dsh-settings": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
90
+ "@deepseek-ai/dsh-tools": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
91
+ "@deepseek-ai/dsh-web": "0.1.2-rc.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
92
92
  "@deepseek-ai/schemastery": "3.18.1 || ^3.18.2",
93
93
  "@earendil-works/pi-ai": "0.82.1 || 0.85.1",
94
94
  "react": "^18.2.0",