dsh-codex-subscription 2.2.4 → 2.2.6

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
@@ -31,12 +31,14 @@ Subscription access, model controls, quota management, and image creation in one
31
31
  | Feature | What you can do | Availability / setup |
32
32
  | --- | --- | --- |
33
33
  | **Subscription sign-in** | Sign in to ChatGPT and use Codex subscription models without an API key | Normal chat needs no Codex CLI |
34
- | **Model catalog sync** | Read available models and reasoning levels from your account, with manual refresh | New models appear when your account offers them |
34
+ | **Model catalog sync** | Read available models and reasoning levels from your account, with manual refresh; models marked for retirement show their retirement date next to the model name, without automatically switching your selection | New models appear when your account offers them |
35
35
  | **Reasoning levels** | Choose supported reasoning effort in the composer | Levels vary by model |
36
36
  | **Fast mode** | Switch supported models between Standard and Fast, with a lightning indicator | Standard by default; Fast increases usage |
37
37
  | **Response verbosity** | Request short, medium, or detailed responses | Follows the model default unless changed |
38
+ | **Input image detail** | Choose Low, High, Original, or Auto detail for images sent to the chat model | Affects input tokens; Auto by default |
38
39
  | **Subscription web search** | Use Codex search or choose DSH search | Auto, DSH, and Codex routing options |
39
40
  | **Search scope** | Choose live / cached search, disable search, or restrict domains | Configure under Models & runtime |
41
+ | **Stream inactivity timeout** | Set how long a request can receive no streamed data before it is aborted | 10 minutes by default; not an overall response deadline |
40
42
  | **Context budget** | Use standard, extended, or custom budgets per model | Limited by the model catalog |
41
43
  | **GPT-Reserve** | Select the reserve model when your account offers it | Experimental; no promise of a separate reserve quota |
42
44
 
@@ -85,7 +87,7 @@ Subscription access, model controls, quota management, and image creation in one
85
87
 
86
88
  ## Prepare DSH
87
89
 
88
- Compatible with DSH `0.1.7-rc.2` plugin compatibility checks and settings APIs, while retaining support for previously supported versions.
90
+ Verified against DSH `0.2.0-rc.1` (`next` channel) and `0.1.7-rc.2` (`latest` channel), with earlier accepted versions still supported.
89
91
 
90
92
  This plugin supports the latest DeepSeek Harness release recorded in its package metadata and requires a ChatGPT account that currently has Codex access.
91
93
 
@@ -268,6 +270,13 @@ dsh plugin --profile web remove dsh-codex-subscription
268
270
 
269
271
  ## Troubleshooting
270
272
 
273
+ <details>
274
+ <summary>DSH 0.2.0-rc.1 reports plugin 2.2.4 as incompatible?</summary>
275
+
276
+ DSH 0.2.0-rc.1 did not exist when 2.2.4 and earlier were published, and a published package's compatibility declaration cannot be changed. Update to 2.2.5 or later from the **Plugins** page, or run `dsh plugin --profile web update dsh-codex-subscription`, then restart DSH.
277
+
278
+ </details>
279
+
271
280
  <details>
272
281
  <summary>No dsh command on your computer?</summary>
273
282
 
@@ -301,6 +310,13 @@ The current plugin icon and its appearance in DSH’s Installed list.
301
310
 
302
311
  <sub>Captured in DSH 0.1.7-alpha.2.</sub>
303
312
 
313
+ ## Positioning and boundaries
314
+
315
+ - **ChatGPT / Codex subscription only**, done in depth: quota and forecasting, images and sketches, subtasks, diagnostics. Other subscriptions such as Claude or Grok are out of scope.
316
+ - **Fail explicitly**: requests never silently fall back to another paid route, and quota windows the account does not return are never invented.
317
+ - **Tracks official DSH releases**: every release is accepted end to end (install, start, remove, reinstall) against official DSH channels such as latest and next; verified versions are recorded in the [compatibility notes](docs/dsh-020-compatibility.md).
318
+ - Models, quota and features depend on what your account actually returns; the ChatGPT backend and DSH can change independently.
319
+
304
320
  ## Scope and support
305
321
 
306
322
  The ChatGPT Codex backend and DSH can change independently. This community project is not affiliated with or endorsed by DeepSeek or OpenAI.
package/README.md CHANGED
@@ -31,12 +31,14 @@
31
31
  | 功能 | 你可以做什么 | 使用方式 / 条件 |
32
32
  | --- | --- | --- |
33
33
  | **订阅登录** | 直接登录 ChatGPT,使用 Codex 订阅模型,无需 API Key | 普通聊天无需 Codex CLI |
34
- | **模型目录同步** | 自动读取账号可用模型与推理档位,支持手动刷新 | 新型号以账号目录开放情况为准 |
34
+ | **模型目录同步** | 自动读取账号可用模型与推理档位,支持手动刷新;目录标注退役的模型会在模型名称旁显示退役日期,不会自动切换你的选择 | 新型号以账号目录开放情况为准 |
35
35
  | **推理等级** | 在输入框选择模型支持的推理档位 | 档位随模型变化 |
36
36
  | **高速模式** | 在支持的模型上切换标准 / Fast,输入框显示闪电标识 | 默认标准;Fast 会增加用量消耗 |
37
37
  | **输出详略** | 选择简短、适中或详细的回答偏好 | 默认跟随模型 |
38
+ | **输入图片精度** | 为发送给聊天模型的图片选择低、高、原图或自动精度 | 影响输入 token 用量;默认自动 |
38
39
  | **订阅联网搜索** | 使用 Codex 搜索,或选择 DSH 搜索 | 可选自动、DSH、Codex 路由 |
39
40
  | **搜索范围** | 选择实时 / 缓存搜索、关闭搜索,或限定域名 | 在模型与运行中设置 |
41
+ | **流无响应超时** | 设置连续没有收到流式数据时中断请求的时长 | 默认 10 分钟;不是整体回答时限 |
40
42
  | **上下文预算** | 按模型使用标准、扩展或自定义上下文预算 | 受模型目录上限约束 |
41
43
  | **GPT-Reserve** | 在账号开放时选择备用模型入口 | 实验性;不承诺独立备用额度 |
42
44
 
@@ -85,7 +87,7 @@
85
87
 
86
88
  ## 准备 DSH
87
89
 
88
- 已适配 DSH `0.1.7-rc.2` 的插件兼容性检查与设置接口,同时保留已支持版本的兼容。
90
+ 已验证兼容 DSH `0.2.0-rc.1`(`next` 通道)和 `0.1.7-rc.2`(`latest` 通道),并继续支持更早的已验收版本。
89
91
 
90
92
  本插件支持软件包元数据中记录的最新版 DeepSeek Harness,并需要一个当前具有 Codex 使用资格的 ChatGPT 账户。
91
93
 
@@ -268,6 +270,13 @@ dsh plugin --profile web remove dsh-codex-subscription
268
270
 
269
271
  ## 常见问题
270
272
 
273
+ <details>
274
+ <summary>DSH 0.2.0-rc.1 提示插件 2.2.4 不兼容?</summary>
275
+
276
+ 2.2.4 及更早版本发布时 DSH 0.2.0-rc.1 还不存在,其兼容声明无法事后修改。请更新到 2.2.5 或更高版本:在 **插件** 页面更新,或运行 `dsh plugin --profile web update dsh-codex-subscription`,然后重启 DSH。
277
+
278
+ </details>
279
+
271
280
  <details>
272
281
  <summary>电脑没有 dsh 命令,怎么安装?</summary>
273
282
 
@@ -301,6 +310,13 @@ dsh plugin --profile web remove dsh-codex-subscription
301
310
 
302
311
  <sub>DSH 0.1.7-alpha.2 实机界面。</sub>
303
312
 
313
+ ## 定位与边界
314
+
315
+ - **只做 ChatGPT / Codex 订阅**,并把这一件事做深:额度与预测、图片与草图、子任务、诊断;不接入 Claude、Grok 等其他订阅。
316
+ - **失败就明确报错**:不会静默切换到其他付费路由,也不会虚构账号没有返回的额度窗口。
317
+ - **跟随官方 DSH 发布**:每次发版都用官方 DSH 的 latest、next 等通道做安装、启动、卸载、重装的端到端验收;已验证的版本见 [兼容性记录](docs/dsh-020-compatibility.md)。
318
+ - 模型、额度和功能开放情况以你的账号实际返回为准;ChatGPT 后端与 DSH 可能独立变化。
319
+
304
320
  ## 边界与支持
305
321
 
306
322
  ChatGPT Codex 后端和 DSH 可能独立变化;本项目为社区项目,与 DeepSeek、OpenAI 无隶属或背书关系。
@@ -1,12 +1,13 @@
1
1
  {
2
- "latestTested": "0.1.7-rc.2",
2
+ "latestTested": "0.2.0-rc.1",
3
3
  "supported": [
4
4
  "0.1.2-rc.1",
5
5
  "0.1.5-rc.1",
6
6
  "0.1.5-rc.2",
7
7
  "0.1.5-rc.3",
8
8
  "0.1.7-rc.1",
9
- "0.1.7-rc.2"
9
+ "0.1.7-rc.2",
10
+ "0.2.0-rc.1"
10
11
  ],
11
12
  "previews": [
12
13
  "0.1.5-alpha.1",
package/lib/client.js CHANGED
@@ -734,7 +734,20 @@ window.__ModuleLoader__.load({
734
734
  //#endregion
735
735
  //#region src/image-conversation-node.js
736
736
  const KIND = "codex-image-output";
737
- const resultsOf = (event) => event?.type === "tool/result" && event.data.meta?.kind === "codex-subscription-image" ? (event.data.message?.content ?? []).filter((block) => block.type === "tool-result" && !block.isError && block.content?.some((part) => part.type === "image" && part.attachment)) : [];
737
+ const hasImage = (block) => block?.content?.some((part) => part.type === "image" && part.attachment);
738
+ const isImage = (part) => part?.type === "image" && part.attachment;
739
+ const resultsOf = (event) => {
740
+ if (event?.type !== "tool/result" || event.data.meta?.kind !== "codex-subscription-image") return [];
741
+ const content = event.data.message?.content ?? [];
742
+ const wrapped = content.filter((block) => block.type === "tool-result" && !block.isError && hasImage(block));
743
+ if (wrapped.length > 0) return wrapped;
744
+ return content.some(isImage) ? [{
745
+ type: "tool-result",
746
+ toolCallId: `${event.data.turn}:${event.data.step ?? event.seq}`,
747
+ isError: false,
748
+ content
749
+ }] : [];
750
+ };
738
751
  const imageConversationNode = {
739
752
  kind: KIND,
740
753
  target: "chat",
@@ -1110,7 +1123,7 @@ window.__ModuleLoader__.load({
1110
1123
  })
1111
1124
  ]
1112
1125
  }),
1113
- !showOutput || image === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1126
+ !showOutput && !settled || image === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1114
1127
  className: "codexImageToolGallery",
1115
1128
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodexGeneratedImage, {
1116
1129
  features,
@@ -4724,11 +4737,24 @@ window.__ModuleLoader__.load({
4724
4737
  compaction_cloud: "开启",
4725
4738
  compactionHint: "实验功能,默认关闭。长上下文由 Codex 压缩后继续请求,保留 DSH 历史与原生压缩。开启时该请求使用 SSE;历史改变后重新建立压缩状态。",
4726
4739
  advancedModelSearch: "模型与搜索",
4740
+ inputImageDetail: "输入图片精度",
4741
+ inputImageDetailHint: "控制发送给模型的图片精度,精度越高输入 token 用量越大。",
4742
+ inputImageDetail_auto: "自动",
4743
+ inputImageDetail_low: "低",
4744
+ inputImageDetail_high: "高",
4745
+ inputImageDetail_original: "原图",
4727
4746
  subagentBackendTitle: "独立子任务",
4728
4747
  subagentBackend_dsh: "DSH",
4729
4748
  subagentBackend_codex: "Codex",
4730
4749
  connectionTitle: "连接方式",
4731
4750
  connectionHint: "默认 SSE。WebSocket 实验性复用连接与上下文传输;连接失败可回退 SSE。下次请求生效,不扩大上下文容量。",
4751
+ streamIdleTimeoutTitle: "流无响应超时",
4752
+ streamIdleTimeoutHint: "连续多久没有收到任何流式数据时中断本次请求,不是整体回答时限。调低可能中断较慢但仍在推理的回答,并交由 DSH 重试处理。默认 10 分钟。",
4753
+ streamIdleTimeout_2: "2 分钟",
4754
+ streamIdleTimeout_5: "5 分钟",
4755
+ streamIdleTimeout_10: "10 分钟",
4756
+ streamIdleTimeout_20: "20 分钟",
4757
+ streamIdleTimeout_30: "30 分钟",
4732
4758
  subagentBackendHint: "Codex 复用订阅登录和工作区权限;默认继承当前订阅模型。开启 DSH 子任务模型选择并新建会话后,可在聊天中指定允许的订阅模型与推理档位;非订阅会话需指定。共享上下文子任务仍用 DSH。",
4733
4759
  subagentBackendUnavailable: "当前宿主缺少子代理服务,请更新 DSH。",
4734
4760
  subagentRuntimeMissing: "尚未准备 Codex 子任务运行时,仅影响此选项。普通订阅对话无需安装。",
@@ -5259,11 +5285,24 @@ window.__ModuleLoader__.load({
5259
5285
  compaction_cloud: "On",
5260
5286
  compactionHint: "Experimental, off by default. Codex compacts long requests while DSH history and native compaction remain available. These requests use SSE; changed history invalidates previous checkpoints.",
5261
5287
  advancedModelSearch: "Models and search",
5288
+ inputImageDetail: "Input image detail",
5289
+ inputImageDetailHint: "Controls the detail level of images sent to the model. Higher detail uses more input tokens.",
5290
+ inputImageDetail_auto: "Auto",
5291
+ inputImageDetail_low: "Low",
5292
+ inputImageDetail_high: "High",
5293
+ inputImageDetail_original: "Original",
5262
5294
  subagentBackendTitle: "Independent subtasks",
5263
5295
  subagentBackend_dsh: "DSH",
5264
5296
  subagentBackend_codex: "Codex",
5265
5297
  connectionTitle: "Connection",
5266
5298
  connectionHint: "SSE by default. Experimental WebSocket reuses connections and context transfers and can fall back to SSE on connection failure. Applies to the next request; context limits stay the same.",
5299
+ streamIdleTimeoutTitle: "Stream inactivity timeout",
5300
+ streamIdleTimeoutHint: "How long a request may receive no streamed data before it is aborted. This is not an overall response deadline. Lower values can abort slow but valid reasoning and hand the request to DSH retry handling. Default: 10 minutes.",
5301
+ streamIdleTimeout_2: "2 min",
5302
+ streamIdleTimeout_5: "5 min",
5303
+ streamIdleTimeout_10: "10 min",
5304
+ streamIdleTimeout_20: "20 min",
5305
+ streamIdleTimeout_30: "30 min",
5267
5306
  subagentBackendHint: "Codex reuses subscription login and workspace permissions, inheriting the current subscription model by default. Enable DSH subtask model selection and start a new session to request an allowed subscription model and reasoning effort in chat; other model sessions require an explicit selection. Shared-context subtasks stay in DSH.",
5268
5307
  subagentBackendUnavailable: "Subagent services are unavailable. Update DSH to use this option.",
5269
5308
  subagentRuntimeMissing: "Codex subtask runtime is not prepared. Subscription chat does not require it.",
@@ -7000,6 +7039,22 @@ window.__ModuleLoader__.load({
7000
7039
  const OUTPUT_VERBOSITY_MEDIUM = "medium";
7001
7040
  const OUTPUT_VERBOSITY_HIGH = "high";
7002
7041
  const DEFAULT_OUTPUT_VERBOSITY = OUTPUT_VERBOSITY_DEFAULT;
7042
+ const INPUT_IMAGE_DETAIL_FIELD = "inputImageDetail";
7043
+ const INPUT_IMAGE_DETAILS = Object.freeze([
7044
+ "low",
7045
+ "high",
7046
+ "original",
7047
+ "auto"
7048
+ ]);
7049
+ const DEFAULT_INPUT_IMAGE_DETAIL = "auto";
7050
+ const STREAM_IDLE_TIMEOUT_MINUTES_FIELD = "streamIdleTimeoutMinutes";
7051
+ const STREAM_IDLE_TIMEOUT_MINUTES = Object.freeze([
7052
+ 2,
7053
+ 5,
7054
+ 10,
7055
+ 20,
7056
+ 30
7057
+ ]);
7003
7058
  const CONTEXT_MODE_FIELD = "contextMode";
7004
7059
  const CONTEXT_MODE_STANDARD = "standard";
7005
7060
  const CONTEXT_MODE_EXTENDED = "extended";
@@ -7042,6 +7097,8 @@ window.__ModuleLoader__.load({
7042
7097
  "medium",
7043
7098
  "high"
7044
7099
  ].includes(value) ? value : DEFAULT_OUTPUT_VERBOSITY;
7100
+ const normalizeInputImageDetail = (value) => INPUT_IMAGE_DETAILS.includes(value) ? value : DEFAULT_INPUT_IMAGE_DETAIL;
7101
+ const normalizeStreamIdleTimeoutMinutes = (value) => STREAM_IDLE_TIMEOUT_MINUTES.includes(value) ? value : 10;
7045
7102
  const normalizeSpeedMode = (value) => ["standard", "fast"].includes(value) ? value : DEFAULT_SPEED_MODE;
7046
7103
  const normalizeContextMode = (value) => [
7047
7104
  "standard",
@@ -7112,6 +7169,8 @@ window.__ModuleLoader__.load({
7112
7169
  searchProvider: normalizeSearchProvider(value?.[SEARCH_PROVIDER_FIELD]),
7113
7170
  speedMode: normalizeSpeedMode(value?.[SPEED_MODE_FIELD]),
7114
7171
  outputVerbosity: normalizeOutputVerbosity(value?.[OUTPUT_VERBOSITY_FIELD]),
7172
+ inputImageDetail: normalizeInputImageDetail(value?.[INPUT_IMAGE_DETAIL_FIELD]),
7173
+ streamIdleTimeoutMinutes: normalizeStreamIdleTimeoutMinutes(value?.[STREAM_IDLE_TIMEOUT_MINUTES_FIELD]),
7115
7174
  contextMode: normalizeContextMode(value?.[CONTEXT_MODE_FIELD]),
7116
7175
  customContextWindow: normalizeCustomContextWindow(value?.[CUSTOM_CONTEXT_WINDOW_FIELD]),
7117
7176
  customContextWindows: {
@@ -7162,6 +7221,8 @@ window.__ModuleLoader__.load({
7162
7221
  [SEARCH_PROVIDER_FIELD]: normalizeSearchProvider(value?.[SEARCH_PROVIDER_FIELD]),
7163
7222
  [SPEED_MODE_FIELD]: normalizeSpeedMode(value?.[SPEED_MODE_FIELD]),
7164
7223
  [OUTPUT_VERBOSITY_FIELD]: normalizeOutputVerbosity(value?.[OUTPUT_VERBOSITY_FIELD]),
7224
+ [INPUT_IMAGE_DETAIL_FIELD]: normalizeInputImageDetail(value?.[INPUT_IMAGE_DETAIL_FIELD]),
7225
+ [STREAM_IDLE_TIMEOUT_MINUTES_FIELD]: normalizeStreamIdleTimeoutMinutes(value?.[STREAM_IDLE_TIMEOUT_MINUTES_FIELD]),
7165
7226
  [CONTEXT_MODE_FIELD]: normalizeContextMode(value?.[CONTEXT_MODE_FIELD]),
7166
7227
  [CUSTOM_CONTEXT_WINDOW_FIELD]: normalizeCustomContextWindow(value?.[CUSTOM_CONTEXT_WINDOW_FIELD]),
7167
7228
  ...Object.fromEntries(Object.entries(CUSTOM_CONTEXT_MODEL_FIELDS).map(([modelKey, field]) => [field, normalizeCustomContextWindow(value?.[field] ?? CUSTOM_CONTEXT_MODEL_DEFAULTS[modelKey], CUSTOM_CONTEXT_MODEL_CAPS[modelKey])]))
@@ -7575,7 +7636,7 @@ window.__ModuleLoader__.load({
7575
7636
  }
7576
7637
  //#endregion
7577
7638
  //#region src/version.js
7578
- const PACKAGE_VERSION = "2.2.4";
7639
+ const PACKAGE_VERSION = "2.2.6";
7579
7640
  //#endregion
7580
7641
  //#region src/client-recovery.js
7581
7642
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
@@ -8744,6 +8805,76 @@ window.__ModuleLoader__.load({
8744
8805
  })]
8745
8806
  });
8746
8807
  }
8808
+ function InputImageDetailPreference({ preference, t }) {
8809
+ const snapshot = usePreferenceSnapshot(preference);
8810
+ const writable = snapshot.status === "ready" && snapshot.writable === true;
8811
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8812
+ className: "codexSubscriptionPreference",
8813
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8814
+ className: "codexSubscriptionPreferenceCopy",
8815
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8816
+ className: "codexSubscriptionPreferenceLabel",
8817
+ children: t("inputImageDetail")
8818
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8819
+ className: "codexSubscriptionPreferenceHint",
8820
+ children: t("inputImageDetailHint")
8821
+ })]
8822
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8823
+ className: "codexSubscriptionQuotaModes",
8824
+ "data-saving": snapshot.saving || void 0,
8825
+ "aria-busy": snapshot.saving || void 0,
8826
+ role: "radiogroup",
8827
+ "aria-label": t("inputImageDetail"),
8828
+ children: INPUT_IMAGE_DETAILS.map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
8829
+ className: "codexSubscriptionQuotaMode",
8830
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
8831
+ type: "radio",
8832
+ name: "codex-input-image-detail",
8833
+ checked: snapshot.inputImageDetail === value,
8834
+ disabled: !writable,
8835
+ onChange: () => {
8836
+ preference.set({ [INPUT_IMAGE_DETAIL_FIELD]: value });
8837
+ }
8838
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(`inputImageDetail_${value}`) })]
8839
+ }, value))
8840
+ })]
8841
+ });
8842
+ }
8843
+ function StreamIdleTimeoutPreference({ preference, t }) {
8844
+ const snapshot = usePreferenceSnapshot(preference);
8845
+ const writable = snapshot.status === "ready" && snapshot.writable === true;
8846
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8847
+ className: "codexSubscriptionPreference",
8848
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8849
+ className: "codexSubscriptionPreferenceCopy",
8850
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8851
+ className: "codexSubscriptionPreferenceLabel",
8852
+ children: t("streamIdleTimeoutTitle")
8853
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8854
+ className: "codexSubscriptionPreferenceHint",
8855
+ children: t("streamIdleTimeoutHint")
8856
+ })]
8857
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8858
+ className: "codexSubscriptionQuotaModes",
8859
+ "data-saving": snapshot.saving || void 0,
8860
+ "aria-busy": snapshot.saving || void 0,
8861
+ role: "radiogroup",
8862
+ "aria-label": t("streamIdleTimeoutTitle"),
8863
+ children: STREAM_IDLE_TIMEOUT_MINUTES.map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
8864
+ className: "codexSubscriptionQuotaMode",
8865
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
8866
+ type: "radio",
8867
+ name: "codex-stream-idle-timeout",
8868
+ checked: snapshot.streamIdleTimeoutMinutes === value,
8869
+ disabled: !writable,
8870
+ onChange: () => {
8871
+ preference.set({ [STREAM_IDLE_TIMEOUT_MINUTES_FIELD]: value });
8872
+ }
8873
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(`streamIdleTimeout_${value}`) })]
8874
+ }, value))
8875
+ })]
8876
+ });
8877
+ }
8747
8878
  function ContextWindowPreference({ preference, t }) {
8748
8879
  const snapshot = usePreferenceSnapshot(preference);
8749
8880
  const writable = snapshot.status === "ready" && snapshot.writable === true;
@@ -8922,46 +9053,58 @@ window.__ModuleLoader__.load({
8922
9053
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextWindowPreference, {
8923
9054
  preference,
8924
9055
  t
9056
+ }),
9057
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "codexSubscriptionDivider" }),
9058
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputImageDetailPreference, {
9059
+ preference,
9060
+ t
8925
9061
  })
8926
9062
  ]
8927
9063
  }),
8928
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
9064
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
8929
9065
  className: "codexSubscriptionCard codexSubscriptionPreferencesCard",
8930
9066
  "aria-label": t("connectionTitle"),
8931
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8932
- className: "codexSubscriptionPreference",
8933
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8934
- className: "codexSubscriptionPreferenceCopy",
8935
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
8936
- className: "codexSubscriptionPreferenceLabel",
8937
- children: [
8938
- t("connectionTitle"),
8939
- " ",
8940
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: "Beta" })
8941
- ]
8942
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8943
- className: "codexSubscriptionPreferenceHint",
8944
- children: t("connectionHint")
9067
+ children: [
9068
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9069
+ className: "codexSubscriptionPreference",
9070
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9071
+ className: "codexSubscriptionPreferenceCopy",
9072
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
9073
+ className: "codexSubscriptionPreferenceLabel",
9074
+ children: [
9075
+ t("connectionTitle"),
9076
+ " ",
9077
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: "Beta" })
9078
+ ]
9079
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9080
+ className: "codexSubscriptionPreferenceHint",
9081
+ children: t("connectionHint")
9082
+ })]
9083
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9084
+ className: "codexSubscriptionQuotaModes",
9085
+ role: "radiogroup",
9086
+ "aria-label": t("connectionTitle"),
9087
+ "aria-busy": snapshot.saving || void 0,
9088
+ children: ["sse", "websocket"].map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
9089
+ className: "codexSubscriptionQuotaMode",
9090
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
9091
+ type: "radio",
9092
+ name: "codex-connection-mode",
9093
+ checked: snapshot.connectionMode === value,
9094
+ disabled: !snapshot.writable,
9095
+ onChange: () => {
9096
+ preference.set({ connectionMode: value });
9097
+ }
9098
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: value === "sse" ? "SSE" : "WebSocket" })]
9099
+ }, value))
8945
9100
  })]
8946
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8947
- className: "codexSubscriptionQuotaModes",
8948
- role: "radiogroup",
8949
- "aria-label": t("connectionTitle"),
8950
- "aria-busy": snapshot.saving || void 0,
8951
- children: ["sse", "websocket"].map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
8952
- className: "codexSubscriptionQuotaMode",
8953
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
8954
- type: "radio",
8955
- name: "codex-connection-mode",
8956
- checked: snapshot.connectionMode === value,
8957
- disabled: !snapshot.writable,
8958
- onChange: () => {
8959
- preference.set({ connectionMode: value });
8960
- }
8961
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: value === "sse" ? "SSE" : "WebSocket" })]
8962
- }, value))
8963
- })]
8964
- })
9101
+ }),
9102
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "codexSubscriptionDivider" }),
9103
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StreamIdleTimeoutPreference, {
9104
+ preference,
9105
+ t
9106
+ })
9107
+ ]
8965
9108
  }),
8966
9109
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
8967
9110
  className: "codexSubscriptionCard codexSubscriptionPreferencesCard",
package/lib/index.js CHANGED
@@ -211,6 +211,22 @@ const OUTPUT_VERBOSITY_DEFAULT = "default";
211
211
  const OUTPUT_VERBOSITY_MEDIUM = "medium";
212
212
  const OUTPUT_VERBOSITY_HIGH = "high";
213
213
  const DEFAULT_OUTPUT_VERBOSITY = OUTPUT_VERBOSITY_DEFAULT;
214
+ const INPUT_IMAGE_DETAIL_FIELD = "inputImageDetail";
215
+ const INPUT_IMAGE_DETAILS = Object.freeze([
216
+ "low",
217
+ "high",
218
+ "original",
219
+ "auto"
220
+ ]);
221
+ const DEFAULT_INPUT_IMAGE_DETAIL = "auto";
222
+ const STREAM_IDLE_TIMEOUT_MINUTES_FIELD = "streamIdleTimeoutMinutes";
223
+ const STREAM_IDLE_TIMEOUT_MINUTES = Object.freeze([
224
+ 2,
225
+ 5,
226
+ 10,
227
+ 20,
228
+ 30
229
+ ]);
214
230
  const CONTEXT_MODE_FIELD = "contextMode";
215
231
  const CONTEXT_MODE_STANDARD = "standard";
216
232
  const CONTEXT_MODE_EXTENDED = "extended";
@@ -248,6 +264,8 @@ const normalizeOutputVerbosity = (value) => [
248
264
  "medium",
249
265
  "high"
250
266
  ].includes(value) ? value : DEFAULT_OUTPUT_VERBOSITY;
267
+ const normalizeInputImageDetail = (value) => INPUT_IMAGE_DETAILS.includes(value) ? value : DEFAULT_INPUT_IMAGE_DETAIL;
268
+ const normalizeStreamIdleTimeoutMinutes = (value) => STREAM_IDLE_TIMEOUT_MINUTES.includes(value) ? value : 10;
251
269
  const normalizeContextMode = (value) => [
252
270
  "standard",
253
271
  "extended",
@@ -358,6 +376,16 @@ const PREFERENCE_FIELDS = Object.freeze({
358
376
  default: DEFAULT_OUTPUT_VERBOSITY,
359
377
  error: "Invalid output verbosity preference"
360
378
  },
379
+ [INPUT_IMAGE_DETAIL_FIELD]: {
380
+ choices: INPUT_IMAGE_DETAILS,
381
+ default: DEFAULT_INPUT_IMAGE_DETAIL,
382
+ error: "Invalid input image detail preference"
383
+ },
384
+ [STREAM_IDLE_TIMEOUT_MINUTES_FIELD]: {
385
+ choices: STREAM_IDLE_TIMEOUT_MINUTES,
386
+ default: 10,
387
+ error: "Invalid stream idle timeout preference"
388
+ },
361
389
  [CONTEXT_MODE_FIELD]: {
362
390
  choices: [
363
391
  CONTEXT_MODE_STANDARD,
@@ -1164,7 +1192,8 @@ const SUPPORTED_RUNTIME_VERSIONS = Object.freeze([
1164
1192
  "0.1.5-rc.2",
1165
1193
  "0.1.5-rc.3",
1166
1194
  "0.1.7-rc.1",
1167
- "0.1.7-rc.2"
1195
+ "0.1.7-rc.2",
1196
+ "0.2.0-rc.1"
1168
1197
  ]);
1169
1198
  const require = createRequire(import.meta.url);
1170
1199
  const execute = promisify(execFile);
@@ -2812,6 +2841,34 @@ function normalizeTransportEvent(event, signal) {
2812
2841
  //#endregion
2813
2842
  //#region src/pi-ai-runtime.js
2814
2843
  const FAST_SERVICE_TIER = "priority";
2844
+ /** Apply the chosen detail to user and tool-result images after the provider assembles the request. */
2845
+ function withInputImageDetail(payload, detail) {
2846
+ if (!Array.isArray(payload.input)) return payload;
2847
+ let changed = false;
2848
+ const input = payload.input.map((item) => {
2849
+ const field = Array.isArray(item?.content) ? "content" : ["function_call_output", "custom_tool_call_output"].includes(item?.type) && Array.isArray(item.output) ? "output" : void 0;
2850
+ if (field === void 0) return item;
2851
+ let itemChanged = false;
2852
+ const parts = item[field].map((part) => {
2853
+ if (part?.type !== "input_image" || part.detail === detail) return part;
2854
+ itemChanged = true;
2855
+ return {
2856
+ ...part,
2857
+ detail
2858
+ };
2859
+ });
2860
+ if (!itemChanged) return item;
2861
+ changed = true;
2862
+ return {
2863
+ ...item,
2864
+ [field]: parts
2865
+ };
2866
+ });
2867
+ return changed ? {
2868
+ ...payload,
2869
+ input
2870
+ } : payload;
2871
+ }
2815
2872
  /**
2816
2873
  * Preserve pi-ai's native Codex OAuth provider while allowing DSH's generic
2817
2874
  * PiAiAdapter to pass the access token resolved by the host credential store.
@@ -2824,7 +2881,7 @@ const FAST_SERVICE_TIER = "priority";
2824
2881
  * persistence, headers, transport, and model behavior remain owned by the
2825
2882
  * original provider.
2826
2883
  */
2827
- function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, resolveOutputVerbosity = () => OUTPUT_VERBOSITY_DEFAULT, resolveContextMode = () => void 0, resolveCustomContextWindow = () => void 0, catalog, connection, compaction, runNetwork = (_area, operation) => operation() } = {}) {
2884
+ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, resolveOutputVerbosity = () => OUTPUT_VERBOSITY_DEFAULT, resolveInputImageDetail = () => void 0, resolveContextMode = () => void 0, resolveCustomContextWindow = () => void 0, catalog, connection, compaction, runNetwork = (_area, operation) => operation() } = {}) {
2828
2885
  const provider = createOpenAICodexProvider();
2829
2886
  const requestToken = Object.freeze({
2830
2887
  name: "DSH-managed Codex OAuth request token",
@@ -2844,6 +2901,7 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
2844
2901
  const requestedVerbosity = resolveOutputVerbosity();
2845
2902
  const textVerbosity = supportsVerbosity(model) ? requestedVerbosity === "default" ? metadata?.defaultVerbosity ?? "medium" : requestedVerbosity : void 0;
2846
2903
  const fast = resolveSpeedMode() === "fast" && (metadata?.supportsFast ?? supportsCodexFastMode(model?.id));
2904
+ const inputImageDetail = normalizeInputImageDetail(resolveInputImageDetail());
2847
2905
  const onPayload = options.onPayload;
2848
2906
  return {
2849
2907
  ...options,
@@ -2860,10 +2918,11 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
2860
2918
  };
2861
2919
  const managed = compaction?.preparePayload(preferred, model?.contextWindow) ?? preferred;
2862
2920
  const next = await onPayload?.(managed, requestModel);
2921
+ const detailed = inputImageDetail === "auto" ? next ?? managed : withInputImageDetail(next ?? managed, inputImageDetail);
2863
2922
  return {
2864
- ...next ?? managed,
2923
+ ...detailed,
2865
2924
  ...textVerbosity === void 0 ? {} : { text: {
2866
- ...(next ?? managed).text ?? {},
2925
+ ...detailed.text ?? {},
2867
2926
  verbosity: textVerbosity
2868
2927
  } },
2869
2928
  ...fast ? { service_tier: FAST_SERVICE_TIER } : {}
@@ -2951,7 +3010,7 @@ async function readSubscriptionCredentials(getAuth, readCredential, signal) {
2951
3010
  }
2952
3011
  //#endregion
2953
3012
  //#region src/version.js
2954
- const PACKAGE_VERSION = "2.2.4";
3013
+ const PACKAGE_VERSION = "2.2.6";
2955
3014
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
2956
3015
  //#endregion
2957
3016
  //#region src/model-catalog.js
@@ -2969,6 +3028,43 @@ const DEFAULT_REFRESH_TIMEOUT_MS = 1e4;
2969
3028
  const record$4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
2970
3029
  const nonEmpty$2 = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
2971
3030
  const positiveInteger$1 = (value) => Number.isSafeInteger(value) && value > 0 ? value : void 0;
3031
+ function upgradeModelId(value) {
3032
+ return (typeof value.upgrade === "string" ? nonEmpty$2(value.upgrade) : record$4(value.upgrade) ? nonEmpty$2(value.upgrade.model) : void 0) ?? (record$4(value.upgrade_info) ? nonEmpty$2(value.upgrade_info.model) : void 0) ?? (record$4(value.upgradeInfo) ? nonEmpty$2(value.upgradeInfo.model) : void 0);
3033
+ }
3034
+ function retirementMillis(value) {
3035
+ for (const source of [
3036
+ value,
3037
+ value.upgrade,
3038
+ value.upgrade_info,
3039
+ value.upgradeInfo
3040
+ ]) {
3041
+ if (!record$4(source)) continue;
3042
+ for (const raw of [source.retirement_at, source.retirementAt]) {
3043
+ const seconds = positiveInteger$1(raw);
3044
+ if (seconds !== void 0 && Number.isSafeInteger(seconds * 1e3)) return seconds * 1e3;
3045
+ if (typeof raw === "string" && /^\d{4}-\d{2}-\d{2}T[\d:.]+(?:Z|[+-]\d{2}:\d{2})$/u.test(raw)) {
3046
+ const parsed = Date.parse(raw);
3047
+ if (Number.isFinite(parsed) && parsed > 0) return parsed;
3048
+ }
3049
+ }
3050
+ }
3051
+ }
3052
+ function retirementNotice(value, now = Date.now(), targetDisplayName) {
3053
+ if (!record$4(value) || !Number.isFinite(now)) return void 0;
3054
+ const at = retirementMillis(value);
3055
+ if (at === void 0 || at <= now) return void 0;
3056
+ const date = new Date(at);
3057
+ if (!Number.isFinite(date.getTime())) return void 0;
3058
+ const dateText = `${String(date.getUTCFullYear()).padStart(4, "0")}-${String(date.getUTCMonth() + 1).padStart(2, "0")}-${String(date.getUTCDate()).padStart(2, "0")}`;
3059
+ const upgradeTo = upgradeModelId(value);
3060
+ const upgradeName = upgradeTo === void 0 ? void 0 : nonEmpty$2(targetDisplayName) ?? upgradeTo;
3061
+ return {
3062
+ text: `Retires on ${dateText} (UTC).${upgradeName === void 0 ? "" : ` Switch to ${upgradeName} to keep working.`}`,
3063
+ at,
3064
+ upgradeTo,
3065
+ dateText
3066
+ };
3067
+ }
2972
3068
  function reasoningMap(levels) {
2973
3069
  const supported = new Set((Array.isArray(levels) ? levels : []).map((level) => nonEmpty$2(record$4(level) ? level.effort : void 0)).filter(Boolean));
2974
3070
  const map = Object.fromEntries(LEVELS.map((level) => [level, null]));
@@ -2993,7 +3089,7 @@ function unsupportedCapabilities(value) {
2993
3089
  ...speeds.length ? { speeds } : {}
2994
3090
  };
2995
3091
  }
2996
- function visibleModel(value) {
3092
+ function visibleModel(value, displayNames, now) {
2997
3093
  if (!record$4(value)) return void 0;
2998
3094
  const id = nonEmpty$2(value.slug);
2999
3095
  const reserve = id === "gpt-reserve" && ["list", "hide"].includes(value.visibility);
@@ -3004,11 +3100,19 @@ function visibleModel(value) {
3004
3100
  ...value,
3005
3101
  supported_reasoning_levels: supported
3006
3102
  });
3103
+ const upgradeTo = upgradeModelId(value);
3104
+ const retirement = retirementNotice(value, now, displayNames.get(upgradeTo));
3105
+ const notice = retirement?.text;
3106
+ const description = nonEmpty$2(value.description);
3007
3107
  return {
3008
3108
  ...Object.keys(unsupported).length ? { unsupported } : {},
3009
3109
  id,
3010
- name: reserve ? "GPT-Reserve (Experimental)" : nonEmpty$2(value.display_name) ?? id,
3011
- description: nonEmpty$2(value.description),
3110
+ name: `${reserve ? "GPT-Reserve (Experimental)" : nonEmpty$2(value.display_name) ?? id}${retirement === void 0 ? "" : ` (retires ${retirement.dateText})`}`,
3111
+ description: notice === void 0 ? description : description === void 0 ? notice : `${description}\n${notice}`,
3112
+ ...retirement === void 0 ? {} : { retirement: {
3113
+ at: retirement.at,
3114
+ upgradeTo: retirement.upgradeTo
3115
+ } },
3012
3116
  priority: Number.isFinite(value.priority) ? value.priority : 0,
3013
3117
  input: input.length > 0 ? input : ["text"],
3014
3118
  contextWindow: positiveInteger$1(value.context_window) ?? positiveInteger$1(value.max_context_window),
@@ -3024,10 +3128,17 @@ function visibleModel(value) {
3024
3128
  supportsFast: [...Array.isArray(value.additional_speed_tiers) ? value.additional_speed_tiers : [], ...Array.isArray(value.service_tiers) ? value.service_tiers.map((tier) => tier?.id) : []].some((tier) => tier === "fast" || tier === "priority")
3025
3129
  };
3026
3130
  }
3027
- function parseOfficialModelCatalog(value) {
3131
+ function parseOfficialModelCatalog(value, now = Date.now()) {
3028
3132
  if (!record$4(value) || !Array.isArray(value.models)) throw new Error("Codex returned a malformed model catalog");
3133
+ const displayNames = /* @__PURE__ */ new Map();
3134
+ for (const model of value.models) {
3135
+ if (!record$4(model)) continue;
3136
+ const id = nonEmpty$2(model.slug);
3137
+ const name = nonEmpty$2(model.display_name);
3138
+ if (id !== void 0 && name !== void 0 && !displayNames.has(id)) displayNames.set(id, name);
3139
+ }
3029
3140
  const seen = /* @__PURE__ */ new Set();
3030
- return value.models.map(visibleModel).filter((model) => model !== void 0 && !seen.has(model.id) && seen.add(model.id)).sort((left, right) => Number(left.id === "gpt-reserve") - Number(right.id === "gpt-reserve") || right.priority - left.priority);
3141
+ return value.models.map((model) => visibleModel(model, displayNames, now)).filter((model) => model !== void 0 && !seen.has(model.id) && seen.add(model.id)).sort((left, right) => Number(left.id === "gpt-reserve") - Number(right.id === "gpt-reserve") || right.priority - left.priority);
3031
3142
  }
3032
3143
  function mergeModel(baseModels, remote) {
3033
3144
  const base = baseModels.find((model) => model.id === remote.id) ?? baseModels.find((model) => model.id !== "gpt-5.3-codex-spark") ?? baseModels[0];
@@ -3036,6 +3147,7 @@ function mergeModel(baseModels, remote) {
3036
3147
  ...base,
3037
3148
  id: remote.id,
3038
3149
  name: remote.name,
3150
+ ...remote.retirement === void 0 || remote.description === void 0 ? {} : { description: remote.description },
3039
3151
  input: remote.input,
3040
3152
  reasoning: remote.reasoning,
3041
3153
  thinkingLevelMap: remote.thinkingLevelMap,
@@ -3051,12 +3163,14 @@ function mergeModel(baseModels, remote) {
3051
3163
  }
3052
3164
  function createOfficialModelCatalog(options = {}) {
3053
3165
  const fetchCatalog = options.fetch ?? fetch;
3166
+ const getNow = options.now ?? Date.now;
3054
3167
  const scheduleTimeout = options.setTimeout ?? setTimeout;
3055
3168
  const cancelTimeout = options.clearTimeout ?? clearTimeout;
3056
3169
  const timeoutMs = Number.isFinite(options.timeoutMs) && options.timeoutMs > 0 ? options.timeoutMs : DEFAULT_REFRESH_TIMEOUT_MS;
3057
3170
  let models;
3058
3171
  let metadata = /* @__PURE__ */ new Map();
3059
3172
  let etag;
3173
+ let rawCatalog;
3060
3174
  let revision = 0;
3061
3175
  let refreshing;
3062
3176
  let generation = 0;
@@ -3096,10 +3210,19 @@ function createOfficialModelCatalog(options = {}) {
3096
3210
  if (currentGeneration !== generation || requestSignal.aborted) return false;
3097
3211
  if (response.status === 304) {
3098
3212
  outcome = "ok";
3099
- return false;
3213
+ if (rawCatalog === void 0) return false;
3214
+ const remote = parseOfficialModelCatalog(rawCatalog, getNow());
3215
+ const next = remote.map((model) => mergeModel(options.baseModels(), model)).filter(Boolean);
3216
+ if (next.length === 0 || JSON.stringify(next) === JSON.stringify(models)) return false;
3217
+ models = next;
3218
+ metadata = new Map(remote.map((model) => [model.id, model]));
3219
+ revision += 1;
3220
+ options.onUpdated?.();
3221
+ return true;
3100
3222
  }
3101
3223
  if (!response.ok) throw new Error(`Codex model catalog failed (HTTP ${response.status})`);
3102
- const remote = parseOfficialModelCatalog(await response.json());
3224
+ const raw = await response.json();
3225
+ const remote = parseOfficialModelCatalog(raw, getNow());
3103
3226
  if (currentGeneration !== generation || requestSignal.aborted) return false;
3104
3227
  if (remote.length === 0) throw new Error("Codex returned an empty model catalog");
3105
3228
  const baseModels = options.baseModels();
@@ -3107,6 +3230,7 @@ function createOfficialModelCatalog(options = {}) {
3107
3230
  if (next.length === 0) throw new Error("Codex model catalog has no compatible models");
3108
3231
  if (currentGeneration !== generation || requestSignal.aborted) return false;
3109
3232
  models = next;
3233
+ rawCatalog = raw;
3110
3234
  metadata = new Map(remote.map((model) => [model.id, model]));
3111
3235
  etag = nonEmpty$2(response.headers.get("etag")) ?? etag;
3112
3236
  revision += 1;
@@ -3160,6 +3284,7 @@ function createOfficialModelCatalog(options = {}) {
3160
3284
  refreshing = void 0;
3161
3285
  flight?.cancel();
3162
3286
  models = void 0;
3287
+ rawCatalog = void 0;
3163
3288
  metadata = /* @__PURE__ */ new Map();
3164
3289
  etag = void 0;
3165
3290
  refreshStatus = "idle";
@@ -5890,6 +6015,7 @@ function apply(ctx, config = {}) {
5890
6015
  compaction,
5891
6016
  resolveSpeedMode: () => settings.get()[SPEED_MODE_FIELD],
5892
6017
  resolveOutputVerbosity: () => normalizeOutputVerbosity(settings.get()[OUTPUT_VERBOSITY_FIELD]),
6018
+ resolveInputImageDetail: () => settings.get()[INPUT_IMAGE_DETAIL_FIELD],
5893
6019
  resolveContextMode: () => normalizeContextMode(settings.get()[CONTEXT_MODE_FIELD]),
5894
6020
  resolveCustomContextWindow: (modelKey) => {
5895
6021
  const overrides = readCapabilitySettings(settings.get())[CUSTOM_CONTEXT_OVERRIDES_FIELD];
@@ -5914,6 +6040,8 @@ function apply(ctx, config = {}) {
5914
6040
  [SEARCH_PROVIDER_FIELD]: settings.get()[SEARCH_PROVIDER_FIELD],
5915
6041
  [SPEED_MODE_FIELD]: settings.get()[SPEED_MODE_FIELD],
5916
6042
  [OUTPUT_VERBOSITY_FIELD]: normalizeOutputVerbosity(settings.get()[OUTPUT_VERBOSITY_FIELD]),
6043
+ [INPUT_IMAGE_DETAIL_FIELD]: normalizeInputImageDetail(settings.get()[INPUT_IMAGE_DETAIL_FIELD]),
6044
+ [STREAM_IDLE_TIMEOUT_MINUTES_FIELD]: normalizeStreamIdleTimeoutMinutes(settings.get()[STREAM_IDLE_TIMEOUT_MINUTES_FIELD]),
5917
6045
  [CONTEXT_MODE_FIELD]: normalizeContextMode(settings.get()[CONTEXT_MODE_FIELD]),
5918
6046
  [CUSTOM_CONTEXT_WINDOW_FIELD]: normalizeCustomContextWindow(settings.get()[CUSTOM_CONTEXT_WINDOW_FIELD]),
5919
6047
  ...Object.fromEntries(Object.entries(CUSTOM_CONTEXT_MODEL_FIELDS).map(([modelKey, field]) => [field, normalizeCustomContextWindow(settings.get()[field] ?? CUSTOM_CONTEXT_MODEL_DEFAULTS[modelKey], CUSTOM_CONTEXT_MODEL_CAPS[modelKey])])),
@@ -5941,7 +6069,6 @@ function apply(ctx, config = {}) {
5941
6069
  piProvider: provider,
5942
6070
  configuredMaxTokens: /* @__PURE__ */ new Map(),
5943
6071
  modelErrors: /* @__PURE__ */ new Map(),
5944
- streamIdleTimeoutMs: 600 * 1e3,
5945
6072
  maxRequestImageBytes: MAX_REQUEST_IMAGE_BYTES,
5946
6073
  requestImagePixelBudget: REQUEST_IMAGE_PIXEL_BUDGET,
5947
6074
  requestImageMaxBytes: REQUEST_IMAGE_MAX_BYTES,
@@ -5951,15 +6078,21 @@ function apply(ctx, config = {}) {
5951
6078
  let profileKey;
5952
6079
  let profileSnapshot;
5953
6080
  const profiles = () => {
6081
+ const preferences = settings.get();
6082
+ const streamIdleTimeoutMinutes = normalizeStreamIdleTimeoutMinutes(preferences[STREAM_IDLE_TIMEOUT_MINUTES_FIELD]);
5954
6083
  const key = JSON.stringify([
5955
6084
  modelCatalog.revision(),
5956
- normalizeContextMode(settings.get()[CONTEXT_MODE_FIELD]),
5957
- settings.get()[CUSTOM_CONTEXT_OVERRIDES_FIELD],
5958
- ...Object.values(CUSTOM_CONTEXT_MODEL_FIELDS).map((field) => settings.get()[field])
6085
+ streamIdleTimeoutMinutes,
6086
+ normalizeContextMode(preferences[CONTEXT_MODE_FIELD]),
6087
+ preferences[CUSTOM_CONTEXT_OVERRIDES_FIELD],
6088
+ ...Object.values(CUSTOM_CONTEXT_MODEL_FIELDS).map((field) => preferences[field])
5959
6089
  ]);
5960
6090
  if (key !== profileKey) {
5961
6091
  profileKey = key;
5962
- profileSnapshot = /* @__PURE__ */ new Map([[PROVIDER, profile]]);
6092
+ profileSnapshot = /* @__PURE__ */ new Map([[PROVIDER, Object.freeze({
6093
+ ...profile,
6094
+ streamIdleTimeoutMs: streamIdleTimeoutMinutes * 60 * 1e3
6095
+ })]]);
5963
6096
  }
5964
6097
  return profileSnapshot;
5965
6098
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
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",
@@ -77,46 +77,46 @@
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@deepseek-ai/cordis": "4.0.1 || 4.0.2 || 4.0.3 || 4.0.4",
80
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
81
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
82
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
83
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
84
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
85
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
86
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
87
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
88
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
89
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
90
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
91
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
92
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
93
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
94
- "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
80
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
81
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
82
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
83
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
84
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
85
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
86
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
87
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
88
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
89
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
90
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
91
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
92
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
93
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
94
+ "@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.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1",
95
95
  "@deepseek-ai/schemastery": "3.18.1 || ^3.18.2",
96
96
  "@earendil-works/pi-ai": "0.82.1 || 0.85.1",
97
97
  "react": "^18.2.0",
98
98
  "react-dom": "^18.2.0",
99
- "@deepseek-ai/dsh-subagent-codex": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2"
99
+ "@deepseek-ai/dsh-subagent-codex": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@deepseek-ai/cordis": "4.0.4",
103
- "@deepseek-ai/dsh-api-remotes": "0.1.7-rc.2",
104
- "@deepseek-ai/dsh-client-connection": "0.1.7-rc.2",
105
- "@deepseek-ai/dsh-client-locale": "0.1.7-rc.2",
106
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.7-rc.2",
107
- "@deepseek-ai/dsh-client-ui-model-selection": "0.1.7-rc.2",
108
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
109
- "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
110
- "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
111
- "@deepseek-ai/dsh-client-ui-tool": "0.1.7-rc.2",
112
- "@deepseek-ai/dsh-credentials": "0.1.7-rc.2",
113
- "@deepseek-ai/dsh-invariants": "0.1.7-rc.2",
114
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
115
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.7-rc.2",
116
- "@deepseek-ai/dsh-session": "0.1.7-rc.2",
117
- "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
118
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
119
- "@deepseek-ai/dsh-web": "0.1.7-rc.2",
103
+ "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.1",
104
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.1",
105
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.1",
106
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.1",
107
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.2.0-rc.1",
108
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1",
109
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.1",
110
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1",
111
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.0-rc.1",
112
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.1",
113
+ "@deepseek-ai/dsh-invariants": "0.2.0-rc.1",
114
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.1",
115
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.1",
116
+ "@deepseek-ai/dsh-session": "0.2.0-rc.1",
117
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.1",
118
+ "@deepseek-ai/dsh-tools": "0.2.0-rc.1",
119
+ "@deepseek-ai/dsh-web": "0.2.0-rc.1",
120
120
  "@deepseek-ai/schemastery": "3.18.4",
121
121
  "@earendil-works/pi-ai": "0.85.1",
122
122
  "@heroicons/react": "2.2.0",
@@ -125,10 +125,10 @@
125
125
  "react": "18.3.1",
126
126
  "react-dom": "18.3.1",
127
127
  "tsdown": "0.22.2",
128
- "@deepseek-ai/dsh-subagent-codex": "0.1.7-rc.2"
128
+ "@deepseek-ai/dsh-subagent-codex": "0.2.0-rc.1"
129
129
  },
130
130
  "dependencies": {
131
- "@deepseek-ai/dsh-home-paths": "0.1.7-rc.2",
131
+ "@deepseek-ai/dsh-home-paths": "0.2.0-rc.1",
132
132
  "https-proxy-agent": "7.0.6",
133
133
  "ws": "8.21.3"
134
134
  },