@shuind/dsh-codex-connect 0.2.0 → 0.2.1

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/lib/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { g as lazyApi, i as createProvider, r as createModels, y as __require } from "./models-Brnw-PH4.js";
2
+ import { g as lazyApi, i as createProvider, r as createModels, y as __require } from "./models-DUIoH1lI.js";
3
3
  import { spawn } from "node:child_process";
4
4
  import { realpathSync } from "node:fs";
5
5
  import { createInterface } from "node:readline/promises";
@@ -32,7 +32,7 @@ function publicAuthError(error) {
32
32
  if (/^OpenAI Codex usage request failed with HTTP [1-5][0-9]{2}$/u.test(message)) return message;
33
33
  return "OpenAI Codex operation failed. Please try again.";
34
34
  }
35
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js
35
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js
36
36
  /**
37
37
  * Wraps a dynamically imported `OAuthAuth` so provider definitions can
38
38
  * advertise OAuth without importing the implementation. The flow loads on
@@ -55,9 +55,9 @@ function lazyOAuth(input) {
55
55
  toAuth: async (credential) => (await loaded()).toAuth(credential)
56
56
  };
57
57
  }
58
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js
59
- const openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-DfZMR6a9.js"));
60
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js
58
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js
59
+ const openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-CzSuDkhU.js"));
60
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js
61
61
  var __rewriteRelativeImportExtension = function(path, preserveJsx) {
62
62
  if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
63
63
  return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
@@ -80,7 +80,7 @@ const importOAuthModule = (specifier) => {
80
80
  const loadOpenAICodexOAuth = async () => {
81
81
  return (await importOAuthModule("./openai-codex.ts")).openaiCodexOAuth;
82
82
  };
83
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json
83
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json
84
84
  var openai_codex_default = { "openai-codex-responses": {
85
85
  "chat:gpt-5.6-luna": {
86
86
  "id": "gpt-5.6-luna",
@@ -538,7 +538,7 @@ var openai_codex_default = { "openai-codex-responses": {
538
538
  "type": "chat"
539
539
  }
540
540
  } };
541
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/model-catalog.js
541
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/model-catalog.js
542
542
  function flattenModelCatalog(groups, type) {
543
543
  return Object.fromEntries(Object.values(groups).flatMap((models) => Object.values(models)).filter((model) => model.type === type).map((model) => [model.id, model]));
544
544
  }
@@ -551,11 +551,11 @@ function flattenImageModelCatalog(_provider, groups) {
551
551
  function flattenClassifierModelCatalog(_provider, groups) {
552
552
  return flattenModelCatalog(groups, "classifier");
553
553
  }
554
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js
554
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js
555
555
  const OPENAI_CODEX_MODELS = flattenChatModelCatalog("openai-codex", openai_codex_default);
556
556
  flattenImageModelCatalog("openai-codex", openai_codex_default);
557
557
  flattenClassifierModelCatalog("openai-codex", openai_codex_default);
558
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js
558
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js
559
559
  function openaiCodexProvider() {
560
560
  return createProvider({
561
561
  id: "openai-codex",
@@ -1192,7 +1192,7 @@ const openaiCodexOAuth = {
1192
1192
  return { apiKey: credential.access };
1193
1193
  }
1194
1194
  };
1195
- // node_modules/.pnpm/@deepseek-ai+dsh-atomic-wri_97540a4ec7271d02f1ca3db4cbeacd91/node_modules/@deepseek-ai/dsh-atomic-write/lib/index.js
1195
+ // node_modules/.pnpm/@deepseek-ai+dsh-atomic-write@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-atomic-write/lib/index.js
1196
1196
  /**
1197
1197
  * Zero-dependency atomic file replacement and writer coordination.
1198
1198
  * `writeFileAtomic` writes a random-suffix sibling with exclusive create and
@@ -1406,7 +1406,7 @@ async function withFileLock(filename, operation, options) {
1406
1406
  await rm(lockPath, { force: true });
1407
1407
  }
1408
1408
  }
1409
- // node_modules/.pnpm/@deepseek-ai+dsh-home-paths_c6ce6e5eb963780330378232ee31e411/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js
1409
+ // node_modules/.pnpm/@deepseek-ai+dsh-home-paths@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js
1410
1410
  /**
1411
1411
  * Shared filesystem path helpers for DeepSeek Harness user data.
1412
1412
  *
@@ -2146,7 +2146,7 @@ var OpenAICodexTrustedOriginsStore = class {
2146
2146
  }
2147
2147
  };
2148
2148
  // src/version.ts
2149
- const CODEX_CONNECT_VERSION = "0.2.0";
2149
+ const CODEX_CONNECT_VERSION = "0.2.1";
2150
2150
  // src/platform/runtime/doctor.ts
2151
2151
  /** Lightweight, secret-free local diagnostics and duplicate-provider guidance. */
2152
2152
  const MAX_PATCH_BYTES = 524288;
package/lib/client.js CHANGED
@@ -266,7 +266,7 @@ window.__ModuleLoader__.load({
266
266
  };
267
267
  }
268
268
  // src/version.ts
269
- const CODEX_CONNECT_VERSION = "0.2.0";
269
+ const CODEX_CONNECT_VERSION = "0.2.1";
270
270
  // src/client/locales/en.ts
271
271
  /** English copy for the OpenAI Codex Plugin UI. */
272
272
  const en = {
@@ -494,12 +494,8 @@ window.__ModuleLoader__.load({
494
494
  nativeCompactionSavedOff: "Saved setting: disabled",
495
495
  nativeCompactionPending: "Change not saved",
496
496
  imageModelHint: "Image model",
497
- imageModel26Flare: "GPT-Image-2.6 Flare (default · fast)",
498
- imageModel26Sunburst: "GPT-Image-2.6 Sunburst (detail)",
499
- imageModelCustomOption: "Custom model ID…",
500
- imageModelCustomLabel: "Custom image model ID",
501
- imageModelHintDefault: "Leave blank for default (gpt-image-2.6-flare)",
502
- imageModelHintHelp: "Uses GPT-Image-2.6 Flare by default; switch to Sunburst for higher detail and editing precision.",
497
+ imageModelHintDefault: "Leave blank for default (routes to GPT-Image-2.6 Sunburst)",
498
+ imageModelHintHelp: "Testing shows the Codex subscription endpoint routes requests to GPT-Image-2.6 Sunburst (sending gpt-image-2 by default; passing other slugs such as Flare does not switch the backend model). Leave blank unless testing a custom request model slug.",
503
499
  invalidImageModelHint: "Use an empty value or 1–128 ASCII letters, digits, dots, underscores, or hyphens, starting with a letter or digit.",
504
500
  generating: "Generating image",
505
501
  generatingDetail: "Image generation is in progress. Stopping cancels the current turn.",
@@ -812,12 +808,8 @@ window.__ModuleLoader__.load({
812
808
  nativeCompactionSavedOff: "当前已保存:关闭",
813
809
  nativeCompactionPending: "更改尚未保存",
814
810
  imageModelHint: "生图模型",
815
- imageModel26Flare: "GPT-Image-2.6 Flare(默认 · 快速)",
816
- imageModel26Sunburst: "GPT-Image-2.6 Sunburst(精细)",
817
- imageModelCustomOption: "自定义模型名…",
818
- imageModelCustomLabel: "自定义生图模型名",
819
- imageModelHintDefault: "留空默认 gpt-image-2.6-flare",
820
- imageModelHintHelp: "默认使用 GPT-Image-2.6 Flare;需要更高细节或编辑精度时可切到 Sunburst。",
811
+ imageModelHintDefault: "留空默认(实测路由至 GPT-Image-2.6 Sunburst)",
812
+ imageModelHintHelp: "实测 Codex 订阅端会统一路由至 GPT-Image-2.6 Sunburst(请求默认发送 gpt-image-2,客户端传入其他模型名如 Flare 实际不会切换后端模型);通常留空即可,仅在需要测试自定义请求体 model 字段时填写。",
821
813
  invalidImageModelHint: "请输入空值,或输入 1–128 个 ASCII 字母、数字、点、下划线或连字符,且必须以字母或数字开头。",
822
814
  generating: "正在生成图片",
823
815
  generatingDetail: "图片生成正在进行中。停止操作会取消当前回合。",
@@ -2363,7 +2355,6 @@ window.__ModuleLoader__.load({
2363
2355
  });
2364
2356
  }
2365
2357
  // src/client/settings/CapabilitiesSection.tsx
2366
- /** Grouped settings cards: web search (with accuracy reference) and context & images. */
2367
2358
  const BROWSECOMP_ENTRIES = [{
2368
2359
  modelId: "gpt-6.2-sol",
2369
2360
  label: "GPT-6.2",
@@ -2400,25 +2391,8 @@ window.__ModuleLoader__.load({
2400
2391
  }
2401
2392
  ];
2402
2393
  const KAGGLE_FACTS_URL = "https://www.kaggle.com/benchmarks/google/facts";
2403
- const DEFAULT_IMAGE_MODEL = "gpt-image-2.6-flare";
2404
- const CUSTOM_IMAGE_MODEL_VALUE = "__custom__";
2405
- const IMAGE_MODEL_PRESETS = [{
2406
- id: "gpt-image-2.6-flare",
2407
- labelKey: "imageModel26Flare"
2408
- }, {
2409
- id: "gpt-image-2.6-sunburst",
2410
- labelKey: "imageModel26Sunburst"
2411
- }];
2412
- function normalizePresetImageModel(value) {
2413
- if (value === "" || value === DEFAULT_IMAGE_MODEL) return DEFAULT_IMAGE_MODEL;
2414
- return IMAGE_MODEL_PRESETS.some((preset) => preset.id === value) ? value : void 0;
2415
- }
2416
2394
  function CapabilitiesSection({ panelPrefix, visible, draft, savedNativeCompaction, validModel, validTokens, validImageModelHint, t, onUpdate }) {
2417
2395
  const activeSearchModel = draft.searchModel.trim();
2418
- const [customInputFor, setCustomInputFor] = (0, react.useState)(() => normalizePresetImageModel(draft.imageModelHint) !== void 0 ? null : draft.imageModelHint);
2419
- const normalizedImageModel = normalizePresetImageModel(draft.imageModelHint);
2420
- const showCustomImageModel = normalizedImageModel === void 0 || customInputFor === draft.imageModelHint;
2421
- const imageModelSelectValue = showCustomImageModel ? CUSTOM_IMAGE_MODEL_VALUE : normalizedImageModel;
2422
2396
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2423
2397
  id: `${panelPrefix}-capabilities`,
2424
2398
  role: "tabpanel",
@@ -2874,50 +2848,24 @@ window.__ModuleLoader__.load({
2874
2848
  style: subPanelStyle,
2875
2849
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2876
2850
  style: formFieldStyle,
2877
- children: [
2878
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
2879
- style: formFieldStyle,
2880
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2881
- style: labelStyle,
2882
- children: t("imageModelHint")
2883
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
2884
- className: "cc-input",
2885
- value: imageModelSelectValue,
2886
- onChange: (event) => {
2887
- const next = event.currentTarget.value;
2888
- if (next === CUSTOM_IMAGE_MODEL_VALUE) {
2889
- setCustomInputFor(draft.imageModelHint);
2890
- return;
2891
- }
2892
- setCustomInputFor(null);
2893
- onUpdate("imageModelHint", next === DEFAULT_IMAGE_MODEL ? "" : next);
2894
- },
2895
- children: [IMAGE_MODEL_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
2896
- value: preset.id,
2897
- children: t(preset.labelKey)
2898
- }, preset.id)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
2899
- value: CUSTOM_IMAGE_MODEL_VALUE,
2900
- children: t("imageModelCustomOption")
2901
- })]
2902
- })]
2903
- }),
2904
- showCustomImageModel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2851
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
2852
+ style: formFieldStyle,
2853
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2854
+ style: labelStyle,
2855
+ children: t("imageModelHint")
2856
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2905
2857
  className: "cc-input",
2906
- "aria-label": t("imageModelCustomLabel"),
2907
2858
  value: draft.imageModelHint,
2908
2859
  placeholder: t("imageModelHintDefault"),
2909
2860
  "aria-invalid": !validImageModelHint,
2910
2861
  onChange: (event) => {
2911
- const next = event.currentTarget.value;
2912
- setCustomInputFor(next);
2913
- onUpdate("imageModelHint", next);
2862
+ onUpdate("imageModelHint", event.currentTarget.value);
2914
2863
  }
2915
- }) : null,
2916
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2917
- style: bodyStyle,
2918
- children: t("imageModelHintHelp")
2919
- })
2920
- ]
2864
+ })]
2865
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2866
+ style: bodyStyle,
2867
+ children: t("imageModelHintHelp")
2868
+ })]
2921
2869
  })
2922
2870
  }) : null]
2923
2871
  })
package/lib/index.js CHANGED
@@ -1268,7 +1268,7 @@ var OpenAICodexTrustedOriginsStore = class {
1268
1268
  }
1269
1269
  };
1270
1270
  // src/version.ts
1271
- const CODEX_CONNECT_VERSION = "0.2.0";
1271
+ const CODEX_CONNECT_VERSION = "0.2.1";
1272
1272
  // src/platform/runtime/doctor.ts
1273
1273
  /** Lightweight, secret-free local diagnostics and duplicate-provider guidance. */
1274
1274
  const MAX_PATCH_BYTES = 524288;
@@ -1666,8 +1666,35 @@ function parseOpenAICodexUpdateResult(value) {
1666
1666
  }
1667
1667
  const OPENAI_CODEX_UPDATE_MAX_METADATA_BYTES = 65536;
1668
1668
  const OPENAI_CODEX_UPDATE_MAX_RELEASE_BYTES = 65536;
1669
- const PLUGIN_ROOT = fileURLToPath(new URL("../../..", import.meta.url));
1670
- const DSH_HOST_VERSION_PACKAGE = "@deepseek-ai/dsh-llm";
1669
+ const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
1670
+ const DSH_HOST_VERSION_PACKAGES = ["@deepseek-ai/dsh-llm", "@deepseek-ai/dsh"];
1671
+ const DESKTOP_APPLICATION_ROOTS = [
1672
+ "app.asar.unpacked",
1673
+ "app.asar",
1674
+ "app"
1675
+ ];
1676
+ const MAX_ROOT_WALK_DEPTH = 6;
1677
+ async function isPluginRoot(dir) {
1678
+ try {
1679
+ const raw = await readFile(join(dir, "package.json"), "utf8");
1680
+ const parsed = JSON.parse(raw);
1681
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return false;
1682
+ return parsed["name"] === OPENAI_CODEX_PACKAGE_NAME;
1683
+ } catch {
1684
+ return false;
1685
+ }
1686
+ }
1687
+ /** Walk upward from the current module directory to find this plugin's root in both src and bundled lib layouts. */
1688
+ async function resolveOpenAICodexPluginRoot(startDir = MODULE_DIR) {
1689
+ let current = startDir;
1690
+ for (let depth = 0; depth <= MAX_ROOT_WALK_DEPTH; depth += 1) {
1691
+ if (await isPluginRoot(current)) return current;
1692
+ const parent = dirname(current);
1693
+ if (parent === current) break;
1694
+ current = parent;
1695
+ }
1696
+ return startDir;
1697
+ }
1671
1698
  function dependencyRoots(packageDir) {
1672
1699
  const roots = [join(packageDir, "node_modules")];
1673
1700
  const parent = dirname(packageDir);
@@ -1675,18 +1702,62 @@ function dependencyRoots(packageDir) {
1675
1702
  else if (basename(parent).startsWith("@") && basename(dirname(parent)) === "node_modules") roots.push(dirname(parent));
1676
1703
  return roots;
1677
1704
  }
1678
- /** Read the installed DSH host version from peer package metadata without executing code. */
1679
- async function readInstalledDshVersion(packageDir = PLUGIN_ROOT) {
1680
- for (const root of dependencyRoots(packageDir)) try {
1681
- const raw = await readFile(join(root, DSH_HOST_VERSION_PACKAGE, "package.json"), "utf8");
1705
+ function runtimeCandidateManifests(resourcesPath, entryScript) {
1706
+ const candidates = /* @__PURE__ */ new Set();
1707
+ const addNodeModules = (baseDir) => {
1708
+ for (const pkg of DSH_HOST_VERSION_PACKAGES) candidates.add(join(baseDir, "node_modules", pkg, "package.json"));
1709
+ };
1710
+ if (typeof resourcesPath === "string" && resourcesPath.length > 0) for (const appRoot of DESKTOP_APPLICATION_ROOTS) {
1711
+ const base = join(resourcesPath, appRoot);
1712
+ addNodeModules(base);
1713
+ addNodeModules(join(base, "dsh"));
1714
+ }
1715
+ if (typeof entryScript === "string" && entryScript.length > 0) {
1716
+ let current = resolve(dirname(entryScript));
1717
+ for (let depth = 0; depth < 8; depth += 1) {
1718
+ addNodeModules(current);
1719
+ const parent = dirname(current);
1720
+ if (parent === current) break;
1721
+ current = parent;
1722
+ }
1723
+ }
1724
+ return [...candidates];
1725
+ }
1726
+ async function readDshVersionFromManifest(manifestPath) {
1727
+ try {
1728
+ const raw = await readFile(manifestPath, "utf8");
1682
1729
  const parsed = JSON.parse(raw);
1683
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) continue;
1730
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
1684
1731
  const record = parsed;
1685
- if (record["name"] !== DSH_HOST_VERSION_PACKAGE || typeof record["version"] !== "string") continue;
1732
+ if (typeof record["name"] !== "string" || !DSH_HOST_VERSION_PACKAGES.includes(record["name"]) || typeof record["version"] !== "string") return;
1686
1733
  const trimmed = record["version"].trim();
1687
- if (parseOpenAICodexVersion(trimmed) !== void 0) return normalizeOpenAICodexVersion(trimmed);
1734
+ return parseOpenAICodexVersion(trimmed) !== void 0 ? normalizeOpenAICodexVersion(trimmed) : void 0;
1688
1735
  } catch {
1689
- continue;
1736
+ return;
1737
+ }
1738
+ }
1739
+ /** Read the installed DSH host version from peer or host runtime package metadata without executing code. */
1740
+ async function readInstalledDshVersion(packageDir, runtimePaths) {
1741
+ const rootDir = packageDir ?? await resolveOpenAICodexPluginRoot();
1742
+ for (const root of dependencyRoots(rootDir)) for (const pkg of DSH_HOST_VERSION_PACKAGES) {
1743
+ const version = await readDshVersionFromManifest(join(root, pkg, "package.json"));
1744
+ if (version !== void 0) return version;
1745
+ }
1746
+ if (packageDir !== void 0 && runtimePaths === void 0) return void 0;
1747
+ if (runtimePaths === void 0) try {
1748
+ const req = createRequire(import.meta.url);
1749
+ for (const pkg of DSH_HOST_VERSION_PACKAGES) try {
1750
+ const version = await readDshVersionFromManifest(req.resolve(`${pkg}/package.json`));
1751
+ if (version !== void 0) return version;
1752
+ } catch {
1753
+ continue;
1754
+ }
1755
+ } catch {}
1756
+ const resourcesPath = runtimePaths !== void 0 ? runtimePaths.resourcesPath : process.resourcesPath;
1757
+ const entryScript = runtimePaths !== void 0 ? runtimePaths.entryScript : process.argv[1];
1758
+ for (const manifestPath of runtimeCandidateManifests(resourcesPath, entryScript)) {
1759
+ const version = await readDshVersionFromManifest(manifestPath);
1760
+ if (version !== void 0) return version;
1690
1761
  }
1691
1762
  }
1692
1763
  function boundedText(value, maxBytes) {
@@ -2793,8 +2864,8 @@ const OPENAI_CODEX_IMAGE_MAX_ERROR_BYTES = 65536;
2793
2864
  const OPENAI_CODEX_IMAGE_MAX_COUNT = 4;
2794
2865
  /** Local prompt limit enforced before any credential or network work. */
2795
2866
  const OPENAI_CODEX_IMAGE_PROMPT_MAX_LENGTH = 32e3;
2796
- /** Default subscription image generation model when imageModelHint is empty. */
2797
- const IMAGE_ROUTE_HINT_MODEL = "gpt-image-2.6-flare";
2867
+ /** Default wire model field aligned with official openai/codex; the subscription endpoint routes to GPT-Image-2.6 Sunburst. */
2868
+ const IMAGE_ROUTE_HINT_MODEL = "gpt-image-2";
2798
2869
  /** Stable, secret-free transport errors consumed structurally by companion packages. */
2799
2870
  const OPENAI_CODEX_TRANSPORT_ERROR_CODES = {
2800
2871
  invalidRequest: "OPENAI_CODEX_INVALID_REQUEST",
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
2
2
  // \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
4
4
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
5
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js
5
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js
6
6
  var FifoQueue = class {
7
7
  incoming = [];
8
8
  outgoing = [];
@@ -96,7 +96,7 @@ var AssistantMessageEventStream = class extends EventStream {
96
96
  message.durationMs = Math.max(0, Math.round(performance.now() - this.#startedAtMonotonic));
97
97
  }
98
98
  };
99
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/lazy.js
99
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/lazy.js
100
100
  function createSetupErrorMessage(model, error, timestamp, stopReason) {
101
101
  return {
102
102
  role: "assistant",
@@ -184,7 +184,7 @@ function lazyApi(load, capabilities) {
184
184
  };
185
185
  return api;
186
186
  }
187
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/context.js
187
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/context.js
188
188
  var __rewriteRelativeImportExtension = function(path, preserveJsx) {
189
189
  if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
190
190
  return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
@@ -218,7 +218,7 @@ function defaultProviderAuthContext() {
218
218
  }
219
219
  };
220
220
  }
221
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/abort.js
221
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/abort.js
222
222
  function abortReason(signal) {
223
223
  if (signal.reason !== void 0) return signal.reason;
224
224
  const error = /* @__PURE__ */ new Error("The operation was aborted");
@@ -262,7 +262,7 @@ function raceWithAbortSignal(operation, signal) {
262
262
  if (signal.aborted) onAbort();
263
263
  });
264
264
  }
265
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js
265
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js
266
266
  /**
267
267
  * Default in-memory credential store. Apps inject persistent stores.
268
268
  * Keyed by `Provider.id`, one credential per provider; see `CredentialStore`.
@@ -313,7 +313,7 @@ var InMemoryCredentialStore = class {
313
313
  }, options);
314
314
  }
315
315
  };
316
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
316
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
317
317
  function formatThrownValue(value) {
318
318
  if (value instanceof Error) return value.message || value.name;
319
319
  if (typeof value === "string") return value;
@@ -343,7 +343,7 @@ function createAssistantMessageDiagnostic(type, error, details) {
343
343
  function appendAssistantMessageDiagnostic(message, diagnostic) {
344
344
  message.diagnostics = [...message.diagnostics ?? [], diagnostic];
345
345
  }
346
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/models-error.js
346
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/models-error.js
347
347
  var ModelsError = class extends Error {
348
348
  code;
349
349
  constructor(code, message, options) {
@@ -359,7 +359,7 @@ function withCauseDetail(message, cause) {
359
359
  if (!detail || message.includes(detail)) return message;
360
360
  return `${message}: ${detail}`;
361
361
  }
362
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js
362
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js
363
363
  /**
364
364
  * Auth resolution shared by all operations in a `Models` collection.
365
365
  * A stored credential owns the provider: ambient/env is consulted only when
@@ -485,7 +485,7 @@ async function readCredential(credentials, providerId, signal) {
485
485
  throw new ModelsError("auth", `Credential store read failed for ${providerId}`, { cause: error });
486
486
  }
487
487
  }
488
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/models-store.js
488
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/models-store.js
489
489
  var InMemoryModelsStore = class {
490
490
  entries = /* @__PURE__ */ new Map();
491
491
  async read(providerId, options) {
@@ -561,7 +561,7 @@ function bindTypedSpanStarter(telemetryContext) {
561
561
  function createTypedSpanStarter(telemetryContext, _schemas) {
562
562
  return bindTypedSpanStarter(telemetryContext);
563
563
  }
564
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/text.js
564
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/text.js
565
565
  /** Extract and join text from message content. */
566
566
  function contentText(content, separator = "\n") {
567
567
  if (typeof content === "string") return content;
@@ -594,7 +594,7 @@ function renderSystemMessageUpdate(message) {
594
594
  function ownedSlice(text, start, end = text.length) {
595
595
  return `${text.slice(start, end)} `.slice(0, -1);
596
596
  }
597
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/telemetry.js
597
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/telemetry.js
598
598
  const provider = {
599
599
  type: "string",
600
600
  description: "Provider identifier.",
@@ -880,7 +880,7 @@ function observeModelRequest(requestedModel, options, poll) {
880
880
  }
881
881
  };
882
882
  }
883
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/identity.js
883
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/identity.js
884
884
  const NVIDIA_NIM_HOST = "integrate.api.nvidia.com";
885
885
  const OPENCODE_HOST = "opencode.ai";
886
886
  /** Merge identities field by field; later sources win and undefined fields are skipped. */
@@ -961,7 +961,7 @@ function getIdentityHeaders(target, identity) {
961
961
  ...getAttributionHeaders(target, identity)
962
962
  };
963
963
  }
964
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js
964
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js
965
965
  /** The type of a model. Models without `type` are chat models. */
966
966
  function getModelType(model) {
967
967
  return model.type ?? "chat";
@@ -1005,7 +1005,7 @@ function classifierErrorResult(model, error, aborted = false) {
1005
1005
  timestamp: Date.now()
1006
1006
  };
1007
1007
  }
1008
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js
1008
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js
1009
1009
  /**
1010
1010
  * Build the leading system message for a prompt and tool set. Returns undefined when
1011
1011
  * both are empty, so an empty transcript stays empty.
@@ -1137,7 +1137,7 @@ function resolveTranscriptTools(messages, support) {
1137
1137
  foldedSystemMessages: folded
1138
1138
  };
1139
1139
  }
1140
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/models.js
1140
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/models.js
1141
1141
  const KNOWN_MODEL_TYPES = {
1142
1142
  chat: true,
1143
1143
  image: true,
@@ -1,5 +1,5 @@
1
- import { _ as AssistantMessageEventStream, a as getDeclaredTools, c as resolveTranscriptTools, d as ownedSlice, f as renderSystemMessageUpdate, h as formatThrownValue, l as getIdentityHeaders, m as createAssistantMessageDiagnostic, n as clampThinkingLevel, o as normalizeContext, p as appendAssistantMessageDiagnostic, s as resolveTranscript, t as calculateCost, u as getSystemMessageText, v as __commonJSMin, y as __require } from "./models-Brnw-PH4.js";
2
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js
1
+ import { _ as AssistantMessageEventStream, a as getDeclaredTools, c as resolveTranscriptTools, d as ownedSlice, f as renderSystemMessageUpdate, h as formatThrownValue, l as getIdentityHeaders, m as createAssistantMessageDiagnostic, n as clampThinkingLevel, o as normalizeContext, p as appendAssistantMessageDiagnostic, s as resolveTranscript, t as calculateCost, u as getSystemMessageText, v as __commonJSMin, y as __require } from "./models-DUIoH1lI.js";
2
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js
3
3
  let procEnvCache = null;
4
4
  /**
5
5
  * Fallback for https://github.com/oven-sh/bun/issues/27802.
@@ -406,7 +406,7 @@ function parseToolCallArguments(json) {
406
406
  };
407
407
  }
408
408
  }
409
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js
409
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js
410
410
  /**
411
411
  * Incremental, tolerant parsing of JSON text that arrives in pieces, such as streamed tool-call arguments.
412
412
  *
@@ -887,7 +887,7 @@ function setMember(members, key, value) {
887
887
  });
888
888
  else members[key] = value;
889
889
  }
890
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/session-resources.js
890
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/session-resources.js
891
891
  const sessionResourceCleanups = /* @__PURE__ */ new Set();
892
892
  function registerSessionResourceCleanup(cleanup) {
893
893
  sessionResourceCleanups.add(cleanup);
@@ -895,7 +895,7 @@ function registerSessionResourceCleanup(cleanup) {
895
895
  sessionResourceCleanups.delete(cleanup);
896
896
  };
897
897
  }
898
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js
898
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js
899
899
  const MAX_UUID_V7_TIMESTAMP = 0xffffffffffff;
900
900
  const MAX_SEQUENCE = (1n << 41n) - 1n;
901
901
  let lastOrdinaryTimestamp = -1;
@@ -924,7 +924,7 @@ function uuidv7(timestampMs) {
924
924
  const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
925
925
  return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
926
926
  }
927
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js
927
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js
928
928
  function combineAbortSignals(signals) {
929
929
  const activeSignals = signals.filter((signal) => signal !== void 0);
930
930
  if (activeSignals.length === 0) return { cleanup: () => {} };
@@ -956,7 +956,7 @@ function combineAbortSignals(signals) {
956
956
  }
957
957
  };
958
958
  }
959
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js
959
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js
960
960
  const MAX_PROVIDER_ERROR_BODY_CHARS = 4e3;
961
961
  function normalizeProviderError(error) {
962
962
  if (!(error instanceof Error)) return {
@@ -1077,13 +1077,13 @@ function safeJsonStringify$1(value) {
1077
1077
  return String(value);
1078
1078
  }
1079
1079
  }
1080
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/headers.js
1080
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/headers.js
1081
1081
  function headersToRecord(headers) {
1082
1082
  const result = {};
1083
1083
  for (const [key, value] of headers.entries()) result[key] = value;
1084
1084
  return result;
1085
1085
  }
1086
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js
1086
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js
1087
1087
  const DEFAULT_PROXY_PORTS = {
1088
1088
  ftp: 21,
1089
1089
  gopher: 70,
@@ -1187,7 +1187,7 @@ function resolveHttpProxyUrlForTarget(targetUrl, env) {
1187
1187
  if (proxyUrl.protocol !== "http:" && proxyUrl.protocol !== "https:") throw new Error(`${UNSUPPORTED_PROXY_PROTOCOL_MESSAGE} Got ${proxyUrl.protocol}`);
1188
1188
  return proxyUrl;
1189
1189
  }
1190
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js
1190
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js
1191
1191
  var UnsupportedStrictJsonSchemaError = class extends Error {};
1192
1192
  const UNSUPPORTED_STRICT_SCHEMA_KEYS = [
1193
1193
  "$ref",
@@ -1364,7 +1364,7 @@ function clampOpenAIPromptCacheKey(key) {
1364
1364
  if (chars.length <= 64) return key;
1365
1365
  return chars.slice(0, 64).join("");
1366
1366
  }
1367
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/hash.js
1367
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/hash.js
1368
1368
  /** Fast deterministic hash to shorten long strings */
1369
1369
  function shortHash(str) {
1370
1370
  let h1 = 3735928559;
@@ -1378,7 +1378,7 @@ function shortHash(str) {
1378
1378
  h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
1379
1379
  return (h2 >>> 0).toString(36) + (h1 >>> 0).toString(36);
1380
1380
  }
1381
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js
1381
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js
1382
1382
  /**
1383
1383
  * Removes unpaired Unicode surrogate characters from a string.
1384
1384
  *
@@ -1402,7 +1402,7 @@ function shortHash(str) {
1402
1402
  function sanitizeSurrogates(text) {
1403
1403
  return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
1404
1404
  }
1405
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js
1405
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js
1406
1406
  const NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)";
1407
1407
  const NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)";
1408
1408
  function replaceImagesWithPlaceholder(content, placeholder) {
@@ -1550,7 +1550,7 @@ function transformMessages(messages, model, normalizeToolCallId) {
1550
1550
  closePendingToolCalls();
1551
1551
  return result;
1552
1552
  }
1553
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js
1553
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js
1554
1554
  function encodeTextSignatureV1(id, phase) {
1555
1555
  const payload = {
1556
1556
  v: 1,
@@ -2226,7 +2226,7 @@ function mapStopReason(status, incompleteReason) {
2226
2226
  default: throw new Error(`Unhandled stop reason: ${status}`);
2227
2227
  }
2228
2228
  }
2229
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js
2229
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js
2230
2230
  const CHARS_PER_TOKEN = 3.5;
2231
2231
  const ESTIMATED_IMAGE_CHARS = 4800;
2232
2232
  function calculateContextTokens(usage) {
@@ -2304,7 +2304,7 @@ function estimateToolsTokens(tools) {
2304
2304
  if (!tools || tools.length === 0) return 0;
2305
2305
  return estimateTextTokens(safeJsonStringify(tools));
2306
2306
  }
2307
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js
2307
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js
2308
2308
  const CONTEXT_SAFETY_TOKENS = 4096;
2309
2309
  const CONTEXT_SAFETY_RATIO = .15;
2310
2310
  const MIN_OUTPUT_WITH_RATIO_MARGIN = 32768;
@@ -2354,7 +2354,7 @@ function buildBaseOptions(model, context, options, apiKey) {
2354
2354
  env: options?.env
2355
2355
  };
2356
2356
  }
2357
- // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js
2357
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.6.0_@aws-sdk+credential-provider-node@3.972.98_@smithy+signatur_3204f39f3ad26528ec3165fb3f7546e0/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js
2358
2358
  const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
2359
2359
  const JWT_CLAIM_PATH = "https://api.openai.com/auth";
2360
2360
  const DEFAULT_MAX_RETRIES = 0;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shuind/dsh-codex-connect",
3
3
  "displayName": "Codex Connect",
4
4
  "description": "ChatGPT OAuth and Codex models for DeepSeek Harness.",
5
- "version": "0.2.0",
5
+ "version": "0.2.1",
6
6
  "author": "shuind",
7
7
  "contributors": [
8
8
  "Frank Song (original dsh-codex-connect author)",