dsh-codex-subscription 1.7.2 → 1.7.3

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/AGENTS.md CHANGED
@@ -6,7 +6,7 @@ Use this guide when a user asks an Agent to install, update, verify, or remove
6
6
  ## Safety
7
7
 
8
8
  - Confirm the target DSH installation and profile. Use `web` only when it is the user's target.
9
- - Use the exact `1.7.2` package below; do not install a moving branch.
9
+ - Use the exact `1.7.3` package below; do not install a moving branch.
10
10
  - Never print OAuth credentials, account IDs, authorization callbacks, or credential-store contents.
11
11
  - Preserve the DSH profile, unrelated plugins, sessions, and saved sign-in.
12
12
  - Do not start, stop, or restart DSH without explicit permission.
@@ -34,13 +34,13 @@ For an official DSH installation run through npm, keep the complete `npx` prefix
34
34
  run command does not create a global `dsh` command:
35
35
 
36
36
  ```sh
37
- npx -y @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add dsh-codex-subscription@1.7.2
37
+ npx -y @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add dsh-codex-subscription@1.7.3
38
38
  ```
39
39
 
40
40
  With an existing global `dsh` command:
41
41
 
42
42
  ```sh
43
- dsh plugin --profile web add dsh-codex-subscription@1.7.2
43
+ dsh plugin --profile web add dsh-codex-subscription@1.7.3
44
44
  ```
45
45
 
46
46
  Use the same `add` command to update or repair. This is the complete package-changing operation.
@@ -58,7 +58,7 @@ dsh --profile web --dump-config
58
58
 
59
59
  For the official npm route, run the same checks with `npx -y @deepseek-ai/dsh@0.1.1-rc.2` in place of `dsh`.
60
60
 
61
- 1. `dsh-codex-subscription` version `1.7.2` appears exactly once.
61
+ 1. `dsh-codex-subscription` version `1.7.3` appears exactly once.
62
62
  2. `codex-subscription` appears exactly once in the composed config.
63
63
  3. No unrelated plugin or profile was changed and DSH was not restarted.
64
64
 
package/lib/client.js CHANGED
@@ -436,6 +436,7 @@ window.__ModuleLoader__.load({
436
436
  .codexSubscriptionCreditSection{display:flex;flex-direction:column;gap:7px}.codexSubscriptionCreditNote{font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary)}.codexSubscriptionCreditRows{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.codexSubscriptionCreditBalance,.codexSubscriptionSpendLimit{min-width:0;border-radius:10px;padding:12px 14px;background:var(--dsw-alias-bg-module-platform)}
437
437
  .codexSubscriptionCreditBalance{display:flex;flex-direction:column;gap:6px}.codexSubscriptionCreditBalance span,.codexSubscriptionCreditLabel{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}.codexSubscriptionCreditBalance strong{font:600 18px/24px ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
438
438
  .codexSubscriptionResetSummary{display:flex;align-items:center;justify-content:space-between;gap:10px}.codexSubscriptionResetMeta{display:flex;min-width:0;flex-direction:column;gap:1px}.codexSubscriptionResetBalance{display:flex;flex-direction:column;gap:8px}.codexSubscriptionResetBalance .codexSubscriptionActions{justify-content:flex-start}.codexSubscriptionResetFlow{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--dsw-alias-border-l2);padding-top:10px}.codexSubscriptionResetFlow h4{margin:0;font-size:13px;line-height:20px;font-weight:500}.codexSubscriptionResetWarning{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}.codexSubscriptionResetExpiry{font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary)}.codexSubscriptionResetCheck{display:flex;align-items:flex-start;gap:8px;padding:9px 10px;border-radius:8px;background:var(--dsw-alias-bg-module-platform);font-size:12px;line-height:18px;color:var(--dsw-alias-label-primary);cursor:pointer}.codexSubscriptionResetCheck input{margin:3px 0 0;accent-color:var(--dsw-alias-label-primary)}.codexSubscriptionResetFinal{border-color:var(--dsw-alias-state-error-primary)!important;color:var(--dsw-alias-state-error-primary)!important}.codexSubscriptionResetResult{font-size:12px;line-height:18px;color:var(--dsw-alias-state-success-primary)}
439
+ .codexSubscriptionResetUse:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.codexSubscriptionResetUse:focus-visible{outline:2px solid var(--dsw-alias-border-l3);outline-offset:1px}
439
440
  .codexSubscriptionSpendLimit{display:flex;flex-direction:column;gap:8px}.codexSubscriptionSpendTop{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.codexSubscriptionSpendTop strong{font:600 16px/22px ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums}.codexSubscriptionSpendLimit progress{width:100%;height:6px;border:0;border-radius:999px;overflow:hidden;background:var(--dsw-alias-border-l3);accent-color:var(--dsw-alias-brand-primary,#3964fe);-webkit-appearance:none;appearance:none}.codexSubscriptionSpendLimit progress::-webkit-progress-bar{background:var(--dsw-alias-border-l3);border-radius:999px}.codexSubscriptionSpendLimit progress::-webkit-progress-value{background:var(--dsw-alias-brand-primary,#3964fe);border-radius:999px}.codexSubscriptionSpendLimit progress::-moz-progress-bar{background:var(--dsw-alias-brand-primary,#3964fe);border-radius:999px}
440
441
  .codexComposerQuota{display:inline-flex;align-items:center;flex:0 0 auto;height:28px;box-sizing:border-box;padding:0;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;line-height:20px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap;user-select:none}.codexComposerQuotaBar{display:block;width:40px;height:4px;border:0;border-radius:999px;overflow:hidden;background:var(--dsw-alias-border-l3);accent-color:var(--dsw-alias-label-secondary);-webkit-appearance:none;appearance:none}.codexComposerQuotaBar::-webkit-progress-bar{background:var(--dsw-alias-border-l3);border-radius:999px}.codexComposerQuotaBar::-webkit-progress-value{background:var(--dsw-alias-label-secondary);border-radius:999px}.codexComposerQuotaBar::-moz-progress-bar{background:var(--dsw-alias-label-secondary);border-radius:999px}
441
442
  .codexModelSelect{position:relative;min-width:0}.codexModelSelectTrigger{display:flex;align-items:center;gap:4px;min-width:0;max-width:min(360px,45cqw);height:28px;padding:0 4px 0 8px;border:0;border-radius:24px;outline:0;background:transparent;color:var(--dsw-alias-label-secondary);font-size:13px;font-weight:500;line-height:20px;cursor:pointer}.codexModelSelectTrigger:hover:not(:disabled),.codexModelSelectTrigger[aria-expanded=true]{background:var(--dsw-alias-interactive-bg-hover)}.codexModelSelectTrigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}.codexModelSelectTrigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.codexModelSelectBolt{display:block;flex:none;width:14px;height:14px;color:var(--dsw-alias-label-primary)}.codexModelSelectLabel{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.codexModelSelectEffort{flex:none;color:var(--dsw-alias-label-caption)}.codexModelSelectChevron{flex:none;color:var(--dsw-alias-label-caption);transition:transform 120ms}.codexModelSelectTrigger[aria-expanded=true] .codexModelSelectChevron{transform:rotate(180deg)}
@@ -1385,6 +1386,7 @@ window.__ModuleLoader__.load({
1385
1386
  return () => window.clearInterval(timer);
1386
1387
  }, [flow?.id, flow?.phase]);
1387
1388
  const begin = (method) => {
1389
+ setFlow(void 0);
1388
1390
  setBusy(true);
1389
1391
  setError(void 0);
1390
1392
  call("login/start", {
@@ -1744,6 +1746,7 @@ window.__ModuleLoader__.load({
1744
1746
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1745
1747
  className: "codexSubscriptionActions",
1746
1748
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1749
+ className: "codexSubscriptionResetUse",
1747
1750
  type: "button",
1748
1751
  variant: "outline",
1749
1752
  disabled: resetBusy,
package/lib/index.js CHANGED
@@ -218,6 +218,14 @@ const publicPrompt = (prompt) => ({
218
218
  message: String(prompt.message ?? ""),
219
219
  ...typeof prompt.placeholder === "string" ? { placeholder: prompt.placeholder } : {}
220
220
  });
221
+ function classifyLoginFailure(error) {
222
+ const message = error instanceof Error ? error.message : "";
223
+ if (/token exchange failed/iu.test(message)) return "token-exchange";
224
+ if (/extract accountId|account[_ -]?id/iu.test(message)) return "account-claim";
225
+ if (/credential|credentials-local|OAuth JSON/iu.test(message)) return "credential-store";
226
+ if (/Missing authorization code|State mismatch|callback/iu.test(message)) return "callback";
227
+ return "provider";
228
+ }
221
229
  /** Own one host-side login without exposing tokens to the browser client. */
222
230
  var CodexLoginCoordinator = class {
223
231
  #sessions = /* @__PURE__ */ new Map();
@@ -234,13 +242,23 @@ var CodexLoginCoordinator = class {
234
242
  if (active === void 0) return { phase: "idle" };
235
243
  return {
236
244
  method: active.view.method,
237
- phase: active.view.phase
245
+ phase: active.view.phase,
246
+ ...active.view.phase === "failed" ? { failure: classifyLoginFailure(active.hostError) } : {}
238
247
  };
239
248
  }
240
249
  async start({ method }) {
241
250
  if (!LOGIN_METHODS.has(method)) throw new Error(`unsupported Codex login method: ${String(method)}`);
242
251
  const active = this.#activeId === void 0 ? void 0 : this.#sessions.get(this.#activeId);
243
- if (active !== void 0 && !TERMINAL_PHASES.has(active.view.phase)) throw new Error("a Codex login is already active");
252
+ if (active !== void 0 && !TERMINAL_PHASES.has(active.view.phase)) {
253
+ active.view = {
254
+ id: active.view.id,
255
+ provider: "openai-codex",
256
+ method: active.view.method,
257
+ phase: "cancelled",
258
+ authenticated: false
259
+ };
260
+ active.controller.abort(/* @__PURE__ */ new Error("Codex login replaced by a new attempt"));
261
+ }
244
262
  if (active !== void 0) this.#sessions.delete(active.view.id);
245
263
  const id = this.createId();
246
264
  const ready = deferred();
@@ -259,7 +277,7 @@ var CodexLoginCoordinator = class {
259
277
  };
260
278
  this.#sessions.set(id, session);
261
279
  this.#activeId = id;
262
- const publishReady = () => ready.resolve(this.read(id));
280
+ const publishReady = () => ready.resolve(publicClone(session.view));
263
281
  const interaction = {
264
282
  signal: controller.signal,
265
283
  prompt: async (prompt) => {
@@ -526,7 +544,7 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0 } = {
526
544
  }
527
545
  //#endregion
528
546
  //#region src/version.js
529
- const PACKAGE_VERSION = "1.7.2";
547
+ const PACKAGE_VERSION = "1.7.3";
530
548
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
531
549
  //#endregion
532
550
  //#region src/codex-search.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
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",