dsh-codex-subscription 2.5.6 → 2.5.7

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
@@ -8,7 +8,7 @@
8
8
 
9
9
  **Use your ChatGPT / Codex subscription directly in DeepSeek Harness**
10
10
 
11
- No OpenAI API key or Codex CLI. Models, search, quota, and image generation stay inside DSH.
11
+ Sign in with ChatGPT Plus / Pro to use GPT-6 and other Codex models, quota, web search, and image generation inside DSH. No OpenAI API key or Codex CLI.
12
12
 
13
13
  [![CI](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml/badge.svg)](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml)
14
14
  [![npm](https://img.shields.io/npm/v/dsh-codex-subscription?logo=npm&label=npm)](https://www.npmjs.com/package/dsh-codex-subscription)
@@ -106,7 +106,7 @@ This plugin supports the latest DeepSeek Harness release recorded in its package
106
106
  2. Paste this package name, with its version, into the **Package name or address** field:
107
107
 
108
108
  ```text
109
- dsh-codex-subscription@2.5.6
109
+ dsh-codex-subscription@2.5.7
110
110
  ```
111
111
 
112
112
  3. Click **Install** and wait for completion. Follow the page instructions; save your work before restarting if requested.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  **把 ChatGPT / Codex 订阅直接接入 DeepSeek Harness**
10
10
 
11
- 登录已有订阅,即可在 DSH 中选模型、查额度、搜索和生图。无需 API Key,也不依赖 Codex CLI。
11
+ 用 ChatGPT Plus / Pro 订阅登录,即可在 DSH 中使用 GPT-6 等 Codex 模型、查额度、联网搜索和生图。无需 OpenAI API Key,也不依赖 Codex CLI。
12
12
 
13
13
  [![CI](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml/badge.svg)](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml)
14
14
  [![npm](https://img.shields.io/npm/v/dsh-codex-subscription?logo=npm&label=npm)](https://www.npmjs.com/package/dsh-codex-subscription)
@@ -106,7 +106,7 @@
106
106
  2. 在 **包名或地址** 输入框中粘贴下面的包名(已带版本号):
107
107
 
108
108
  ```text
109
- dsh-codex-subscription@2.5.6
109
+ dsh-codex-subscription@2.5.7
110
110
  ```
111
111
 
112
112
  3. 点击 **安装**,等待安装完成;按页面提示操作,需要重启时先保存工作。
package/lib/client.js CHANGED
@@ -5781,15 +5781,18 @@ window.__ModuleLoader__.load({
5781
5781
  unlimited: "不限额",
5782
5782
  monthlyCreditLimit: "Credits 月度消费上限",
5783
5783
  resetCredits: "额度重置",
5784
+ resetCreditsHint: "使用重置可恢复短周期额度、每周额度,或两者同时恢复。",
5785
+ resetAvailableTab: "可用",
5786
+ resetFull: "完全重置",
5784
5787
  resetCreditsAvailable: "额度重置(可用 {count} 次)",
5785
5788
  resetCreditDefaultName: "额度重置",
5786
- resetUse: "使用",
5789
+ resetUse: "使用重置",
5787
5790
  resetPreparing: "准备中…",
5788
5791
  resetConfirmTitle: "确认使用额度重置",
5789
5792
  resetWarning: "执行后会消耗 1 次,且无法撤销。",
5790
5793
  resetEarlyWarning: "当前额度未用尽,服务可能不执行重置。",
5791
5794
  resetAcknowledge: "我知道这次操作可能立即消耗 1 次重置",
5792
- resetCreditExpires: "到期:{value}",
5795
+ resetCreditExpires: "有效期至:{value}",
5793
5796
  resetCreditExpiryUnknown: "到期时间未提供",
5794
5797
  resetCreditExpiryLoading: "正在读取到期时间…",
5795
5798
  resetCreditExpiryFailed: "无法读取到期时间",
@@ -6350,15 +6353,18 @@ window.__ModuleLoader__.load({
6350
6353
  unlimited: "Unlimited",
6351
6354
  monthlyCreditLimit: "Monthly Credits spending cap",
6352
6355
  resetCredits: "Quota resets",
6356
+ resetCreditsHint: "A reset restores your short-window limit, weekly limit, or both.",
6357
+ resetAvailableTab: "Available",
6358
+ resetFull: "Full reset",
6353
6359
  resetCreditsAvailable: "Quota resets ({count} available)",
6354
6360
  resetCreditDefaultName: "Quota reset",
6355
- resetUse: "Use",
6361
+ resetUse: "Use reset",
6356
6362
  resetPreparing: "Preparing…",
6357
6363
  resetConfirmTitle: "Confirm quota reset",
6358
6364
  resetWarning: "This consumes one reset and cannot be undone.",
6359
6365
  resetEarlyWarning: "Quota remains. The service may decline the reset.",
6360
6366
  resetAcknowledge: "I understand this may consume one reset now",
6361
- resetCreditExpires: "Expires {value}",
6367
+ resetCreditExpires: "Valid until {value}",
6362
6368
  resetCreditExpiryUnknown: "Expiration time not provided",
6363
6369
  resetCreditExpiryLoading: "Reading expiration…",
6364
6370
  resetCreditExpiryFailed: "Could not read expiration",
@@ -6634,9 +6640,21 @@ window.__ModuleLoader__.load({
6634
6640
  .codexSubscriptionCreditBalance strong{font:600 18px/24px ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
6635
6641
  .codexSubscriptionCreditRows{display:flex;flex-direction:column;gap:6px}
6636
6642
  .codexSubscriptionResetMeta{display:flex;min-width:0;flex-direction:column;gap:1px}
6637
- .codexSubscriptionResetDisclosure>summary{cursor:pointer;width:fit-content;color:var(--dsw-alias-label-primary);border-radius:6px}
6638
- .codexSubscriptionResetDisclosure>summary:focus-visible{outline:2px solid currentColor;outline-offset:4px}
6639
- .codexSubscriptionResetDisclosure[open]>summary{margin-bottom:10px}
6643
+ .codexSubscriptionResetPanel{display:flex;flex-direction:column;gap:10px;margin-top:6px}
6644
+ .codexSubscriptionResetHead{display:flex;flex-direction:column;gap:2px}
6645
+ .codexSubscriptionResetHead strong{font-size:14px;line-height:20px;font-weight:600;color:var(--dsw-alias-label-primary)}
6646
+ .codexSubscriptionResetHead span{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
6647
+ .codexSubscriptionResetBox{border:1px solid var(--dsw-alias-border-l2);border-radius:12px;padding:6px 14px 2px}
6648
+ .codexSubscriptionResetTabs{display:flex;gap:8px;padding:6px 0 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}
6649
+ .codexSubscriptionResetTabs span{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:8px;background:var(--dsw-alias-bg-module-platform);font-size:12px;line-height:18px;font-weight:600;color:var(--dsw-alias-label-primary)}
6650
+ .codexSubscriptionResetTabs b{font-weight:400;color:var(--dsw-alias-label-secondary)}
6651
+ .codexSubscriptionResetBox .codexSubscriptionResetBalance{gap:0}
6652
+ .codexSubscriptionResetBox .codexSubscriptionResetCard{padding:12px 0;border:0;border-radius:0;background:none}
6653
+ .codexSubscriptionResetBox .codexSubscriptionResetCard+.codexSubscriptionResetCard{border-top:1px solid var(--dsw-alias-border-l2)}
6654
+ .codexSubscriptionResetBox .codexSubscriptionResetCard strong{font-size:13px;line-height:20px;font-weight:600}
6655
+ .codexSubscriptionResetBox .codexSubscriptionResetExpiry{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
6656
+ .codexSubscriptionResetBox .codexSubscriptionResetUse{min-height:28px;padding:0 12px;border:0!important;border-radius:8px;background:var(--dsw-alias-bg-module-platform);font-size:12px;font-weight:600}
6657
+ .codexSubscriptionResetBox>.codexSubscriptionResetBalance>.codexSubscriptionCreditNote{padding:12px 0}
6640
6658
  .codexSubscriptionResetBalance{display:flex;flex-direction:column;gap:8px}
6641
6659
  .codexSubscriptionResetCard{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;padding:9px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-module-platform)}
6642
6660
  .codexSubscriptionResetCard{flex-wrap:wrap}
@@ -8531,7 +8549,7 @@ window.__ModuleLoader__.load({
8531
8549
  }
8532
8550
  //#endregion
8533
8551
  //#region src/version.js
8534
- const PACKAGE_VERSION = "2.5.6";
8552
+ const PACKAGE_VERSION = "2.5.7";
8535
8553
  //#endregion
8536
8554
  //#region src/client-recovery.js
8537
8555
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
@@ -11247,7 +11265,10 @@ window.__ModuleLoader__.load({
11247
11265
  children: date === void 0 ? t("resetCreditExpiryUnknown") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
11248
11266
  dateTime: date.toISOString(),
11249
11267
  title: date.toLocaleString(),
11250
- children: fill(t("resetCreditExpires"), { value: date.toLocaleString() })
11268
+ children: fill(t("resetCreditExpires"), { value: date.toLocaleDateString(void 0, {
11269
+ month: "long",
11270
+ day: "numeric"
11271
+ }) })
11251
11272
  })
11252
11273
  });
11253
11274
  }
@@ -11349,7 +11370,7 @@ window.__ModuleLoader__.load({
11349
11370
  children: [
11350
11371
  challenge === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11351
11372
  className: "codexSubscriptionResetMeta",
11352
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: credit.name ?? t("resetCreditDefaultName") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditExpiry, {
11373
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: credit.name === void 0 ? t("resetCreditDefaultName") : /^full reset$/iu.test(credit.name) ? t("resetFull") : credit.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditExpiry, {
11353
11374
  expiresAt: credit.expiresAt,
11354
11375
  t
11355
11376
  })]
@@ -11626,17 +11647,27 @@ window.__ModuleLoader__.load({
11626
11647
  cloud: visibleUsage.credits.approxCloudMessages ? `${count(visibleUsage.credits.approxCloudMessages[0])}–${count(visibleUsage.credits.approxCloudMessages[1])}` : t("unavailable")
11627
11648
  })
11628
11649
  }) : null,
11629
- visibleUsage?.resetCredits?.availableCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
11630
- className: "codexSubscriptionCreditBalance codexSubscriptionResetDisclosure",
11631
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: fill(t("resetCreditsAvailable"), { count: visibleUsage.resetCredits.availableCount }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditList, {
11632
- rpc,
11633
- t,
11634
- count: visibleUsage.resetCredits.availableCount,
11635
- nextExpiresAt: visibleUsage.resetCredits.nextExpiresAt,
11636
- initialCredits: visibleUsage.resetCredits.credits,
11637
- refreshKey: `${resetKey}:${usageRefreshGeneration}`,
11638
- hasExhaustedQuota: exhausted,
11639
- onConsumed: () => load(true)
11650
+ visibleUsage?.resetCredits?.availableCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
11651
+ className: "codexSubscriptionResetPanel",
11652
+ "aria-label": t("resetCredits"),
11653
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11654
+ className: "codexSubscriptionResetHead",
11655
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("resetCredits") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("resetCreditsHint") })]
11656
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11657
+ className: "codexSubscriptionResetBox",
11658
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11659
+ className: "codexSubscriptionResetTabs",
11660
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t("resetAvailableTab"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: visibleUsage.resetCredits.availableCount })] })
11661
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditList, {
11662
+ rpc,
11663
+ t,
11664
+ count: visibleUsage.resetCredits.availableCount,
11665
+ nextExpiresAt: visibleUsage.resetCredits.nextExpiresAt,
11666
+ initialCredits: visibleUsage.resetCredits.credits,
11667
+ refreshKey: `${resetKey}:${usageRefreshGeneration}`,
11668
+ hasExhaustedQuota: exhausted,
11669
+ onConsumed: () => load(true)
11670
+ })]
11640
11671
  })]
11641
11672
  }) : null,
11642
11673
  visibleUsage?.individualLimit ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
package/lib/index.js CHANGED
@@ -2049,7 +2049,7 @@ function inheritedOriginalImageRef(session, assetId) {
2049
2049
  }
2050
2050
  //#endregion
2051
2051
  //#region src/version.js
2052
- const PACKAGE_VERSION = "2.5.6";
2052
+ const PACKAGE_VERSION = "2.5.7";
2053
2053
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
2054
2054
  //#endregion
2055
2055
  //#region src/codex-images.js
@@ -3590,6 +3590,8 @@ function withInputImageDetail(payload, detail) {
3590
3590
  }
3591
3591
  const DSH_REVIEW_POLICY_PREFIX = "REVIEW_POLICY\nYou are the final authorization reviewer";
3592
3592
  const REVIEW_MODEL_SESSION = "session";
3593
+ const REVIEW_RETRIES = 2;
3594
+ const TRANSIENT_REVIEW_FAILURE = /stream ended (?:before|without)|\b(?:network|connection|socket)\b|\bECONN[A-Z]+\b|other side closed|premature close|\bterminated\b|WebSocket closed (?:1006|1011|1012|1013)/iu;
3593
3595
  function systemText(context) {
3594
3596
  if (typeof context?.systemPrompt === "string") return context.systemPrompt;
3595
3597
  const first = Array.isArray(context?.messages) ? context.messages[0] : void 0;
@@ -3683,7 +3685,8 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
3683
3685
  const review = {
3684
3686
  requests: 0,
3685
3687
  routed: 0,
3686
- sessionModel: 0
3688
+ sessionModel: 0,
3689
+ retries: 0
3687
3690
  };
3688
3691
  const reviewRoute = (model, context) => {
3689
3692
  if (resolveReviewModel() !== "official" || !isDshAutoReview(context)) return void 0;
@@ -3710,6 +3713,34 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
3710
3713
  }
3711
3714
  };
3712
3715
  };
3716
+ const reviewIterable = (create) => {
3717
+ let replay;
3718
+ const run = async function* () {
3719
+ for (let attempt = 0;; attempt += 1) {
3720
+ const events = [];
3721
+ let failure;
3722
+ let thrown;
3723
+ try {
3724
+ for await (const event of create()) {
3725
+ events.push(event);
3726
+ if (event?.type === "error") failure = event.error?.errorMessage;
3727
+ }
3728
+ } catch (error) {
3729
+ thrown = error;
3730
+ failure = error?.message;
3731
+ }
3732
+ if (failure !== void 0 && attempt < REVIEW_RETRIES && TRANSIENT_REVIEW_FAILURE.test(failure)) {
3733
+ review.retries += 1;
3734
+ continue;
3735
+ }
3736
+ if (thrown !== void 0 && events.length === 0) throw thrown;
3737
+ yield* events;
3738
+ if (thrown !== void 0) throw thrown;
3739
+ return;
3740
+ }
3741
+ };
3742
+ return { [Symbol.asyncIterator]: () => replay ??= run() };
3743
+ };
3713
3744
  const networkIterable = (factory, options, direct = false) => {
3714
3745
  let iterator;
3715
3746
  let prepared;
@@ -3739,6 +3770,11 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
3739
3770
  throw: (error) => iterator ? step("throw", error) : Promise.reject(error)
3740
3771
  };
3741
3772
  };
3773
+ const routed = (method, model, context, options) => {
3774
+ const route = reviewRoute(model, context);
3775
+ const create = () => route === void 0 ? networkIterable((prepared) => provider[method](model, context, prepared), withPreferences(model, options)) : networkIterable((prepared) => provider[method](model, context, prepared), withReview(route, options), true);
3776
+ return isDshAutoReview(context) ? reviewIterable(create) : create();
3777
+ };
3742
3778
  return Object.freeze({
3743
3779
  ...provider,
3744
3780
  auth: Object.freeze({
@@ -3746,14 +3782,8 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
3746
3782
  apiKey: requestToken
3747
3783
  }),
3748
3784
  getModels,
3749
- stream: (model, context, options) => {
3750
- const route = reviewRoute(model, context);
3751
- return route === void 0 ? networkIterable((prepared) => provider.stream(model, context, prepared), withPreferences(model, options)) : networkIterable((prepared) => provider.stream(model, context, prepared), withReview(route, options), true);
3752
- },
3753
- streamSimple: (model, context, options) => {
3754
- const route = reviewRoute(model, context);
3755
- return route === void 0 ? networkIterable((prepared) => provider.streamSimple(model, context, prepared), withPreferences(model, options)) : networkIterable((prepared) => provider.streamSimple(model, context, prepared), withReview(route, options), true);
3756
- },
3785
+ stream: (model, context, options) => routed("stream", model, context, options),
3786
+ streamSimple: (model, context, options) => routed("streamSimple", model, context, options),
3757
3787
  reviewCounters: () => ({ ...review })
3758
3788
  });
3759
3789
  }
@@ -4759,7 +4789,8 @@ async function createSubscriptionDiagnostics({ auth, preferences, login = { phas
4759
4789
  () => typeof review?.reviewCounters === "function" ? safeCounters({ snapshot: () => review.reviewCounters() }, [
4760
4790
  "requests",
4761
4791
  "routed",
4762
- "sessionModel"
4792
+ "sessionModel",
4793
+ "retries"
4763
4794
  ]) : void 0
4764
4795
  ],
4765
4796
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
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",