@sunshaobei/dsh-codex-auth 3.0.7 → 3.0.9

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.
Files changed (2) hide show
  1. package/lib/client.js +5 -5
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -337,6 +337,7 @@ window.__ModuleLoader__.load({
337
337
  return () => { observer.disconnect(); marked.forEach(button => button.classList.remove("codex-auth-nav")); };
338
338
  }, "dsh-codex-auth: ChatGPT navigation icon");
339
339
  // ---- plugin detail page (plugins.bundle.config, same as dsh-context) ----
340
+ const CFG_KEY = "@sunshaobei/dsh-codex-auth"; // 必须等于包名:页面按 configured = bundles.has(pkg.name) 判断
340
341
  const settingsStore = (() => {
341
342
  let form; let state = {}; const listeners = new Set();
342
343
  const notify = () => listeners.forEach((fn) => fn());
@@ -349,14 +350,13 @@ window.__ModuleLoader__.load({
349
350
  })();
350
351
  const registerPluginsPageCard = (env) => {
351
352
  const cf = env && env.configForms;
352
- if (!cf || typeof cf.get !== "function" || typeof cf.whileServed !== "function") return;
353
- ctx.effect(() => settingsStore.attach(cf.get(NS)), "dsh-codex-auth: config forms");
354
- ctx.effect(() => cf.whileServed([NS], () => ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
353
+ if (cf && typeof cf.get === "function") { try { settingsStore.attach(cf.get(CFG_KEY)); } catch {} }
354
+ ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
355
355
  name: "plugins.bundle.config",
356
- key: NS,
356
+ key: CFG_KEY,
357
357
  locale: NS,
358
358
  inject: () => ({ hooks: { codexAuth: settingsStore }, set: (k, v) => settingsStore.set(k, v) })
359
- }, () => React.createElement(StatusCard, { t: t, call: call })))), "dsh-codex-auth: plugins-page card");
359
+ }, () => React.createElement(StatusCard, { t: t, call: call })));
360
360
  };
361
361
  if (typeof ctx.inject === "function") ctx.inject(["configForms"], registerPluginsPageCard);
362
362
  else registerPluginsPageCard(ctx);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sunshaobei/dsh-codex-auth",
3
3
  "description": "Codex 订阅授权管理 for the dsh web surface: a dedicated settings page (authorization status, validity/expiry, one-click browser OAuth) plus an expired-credential modal when a GPT model is selected. Host half runs the full OpenAI OAuth flow (PKCE S256, localhost:1455 callback) and writes the llm-pi-ai/openai-codex grant record through ctx.credentials.",
4
- "version": "3.0.7",
4
+ "version": "3.0.9",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",