dsh-codex-share 0.3.1 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/dist/index.mjs +29 -60
  3. package/package.json +22 -24
package/README.md CHANGED
@@ -4,7 +4,7 @@ A DeepSeek Harness LLM adapter that uses the same ChatGPT subscription login as
4
4
 
5
5
  ## Requirements
6
6
 
7
- - DeepSeek Harness `0.1.7-rc.2` or a compatible later release (0.1.5 releases are no longer supported), with Node.js `^22.19.0 || >=24`.
7
+ - DeepSeek Harness `0.2.0-rc.2` (earlier releases are no longer supported), with Node.js `^22.19.0 || >=24`.
8
8
  - Codex CLI signed in with a ChatGPT account and configured for **file credential storage**. Run `codex login` and check `codex login status`. Codex must be able to read and update `$CODEX_HOME/auth.json` (default `~/.codex/auth.json`).
9
9
  - The harness process must run as the same OS user, or have read access to that same credential file. A keyring-only Codex login is not supported.
10
10
 
@@ -24,7 +24,7 @@ For development from this checkout, from its directory:
24
24
  dsh plugin --profile web add .
25
25
  ```
26
26
 
27
- Restart the profile after installation or update. The bundle mounts one provider route, `openai-codex-local`, with the model catalog supplied by pi-ai plus GPT-6 Sol (`gpt-6-sol`) and GPT-6 Luna (`gpt-6-luna`), whose metadata is taken from pi-ai 0.87 because the harness's pi-ai adapter still runs on pi-ai 0.85. This route replaces the plugin's earlier `openai-codex` route, which collides with pi-ai's configurable provider directory; update any saved model selection to `openai-codex-local`. The plugin appears in **Settings → Plugins → Plugin list**. Open **Settings → Models** and use **Edit model IDs** in the OpenAI Codex row to add subscription model IDs (one per line). The IDs are saved as `additionalModelIds` on the `llm-codex-share` entry in the profile's `cordis.patch.yml` and take effect without a restart. The installed catalog remains available; clearing the additional IDs restores it. For example, enter a model ID that your account can use but the catalog does not list yet. An unrecognized ID can be listed, but requests to it will fail if the Codex endpoint rejects it. Select a listed model in the model picker or agent preset. For a local Codex home outside the default location, set the absolute `CODEX_HOME` path in the environment that launches the harness. Direct Cordis composition can configure `codexHome` on the `dsh-codex-share` plugin instead.
27
+ Restart the profile after installation or update. The bundle mounts one provider route, `openai-codex-local`, with the model catalog supplied by pi-ai 0.87, including GPT-6 Astra, Sol, and Luna, plus GPT-6.1 Sol (`gpt-6.1-sol`). GPT-6.1 Sol uses Codex’s default 272K context and supports low through max reasoning; its pricing follows [OpenAI’s model documentation](https://developers.openai.com/api/docs/models/gpt-6.1-sol). GPT-6.1 Luna is not listed in the current OpenAI or Codex catalogs; use `gpt-6-luna` for Luna. This route replaces the plugin's earlier `openai-codex` route, which collides with pi-ai's configurable provider directory; update any saved model selection to `openai-codex-local`. The plugin appears in **Settings → Plugins → Plugin list**. Open **Settings → Models** and use **Edit model IDs** in the OpenAI Codex row to add subscription model IDs (one per line). The IDs are saved as `additionalModelIds` on the `llm-codex-share` entry in the profile's `cordis.patch.yml` and take effect without a restart. The installed catalog remains available; clearing the additional IDs restores it. For example, enter a model ID that your account can use but the catalog does not list yet. An unrecognized ID can be listed, but requests to it will fail if the Codex endpoint rejects it. Select a listed model in the model picker or agent preset. For a local Codex home outside the default location, set the absolute `CODEX_HOME` path in the environment that launches the harness. Direct Cordis composition can configure `codexHome` on the `dsh-codex-share` plugin instead.
28
28
 
29
29
  The plugin intentionally does not refresh a stale token. When Codex writes a replacement, the next harness request reads it. When Codex's current access token has expired, harness calls fail until Codex refreshes its own login. An API-key-only Codex login is rejected; this route never falls back to `OPENAI_API_KEY`.
30
30
 
package/dist/index.mjs CHANGED
@@ -48,54 +48,6 @@ const Config = z.object({
48
48
  codexHome: z.string(),
49
49
  additionalModelIds: z.array(z.string().min(1)).default([]).volatile()
50
50
  });
51
- /**
52
- * GPT-6 Sol and Luna as pi-ai 0.87 catalogs them. pi-ai 0.87 providers take a
53
- * different stream context than the dsh 0.1.7 adapter (built on 0.85) sends,
54
- * so the dependency stays on 0.85 and these entries are added on top of its
55
- * GPT-6 Astra entry. An installed catalog that already lists an ID wins.
56
- */
57
- const GPT6_MODELS = [{
58
- id: "gpt-6-sol",
59
- name: "GPT-6 Sol",
60
- cost: {
61
- input: 2,
62
- output: 10,
63
- cacheRead: .2,
64
- cacheWrite: 2.5,
65
- tiers: [{
66
- inputTokensAbove: 272e3,
67
- input: 4,
68
- output: 15,
69
- cacheRead: .4,
70
- cacheWrite: 5
71
- }]
72
- }
73
- }, {
74
- id: "gpt-6-luna",
75
- name: "GPT-6 Luna",
76
- cost: {
77
- input: .1,
78
- output: .5,
79
- cacheRead: .01,
80
- cacheWrite: .125,
81
- tiers: [{
82
- inputTokensAbove: 272e3,
83
- input: .2,
84
- output: .75,
85
- cacheRead: .02,
86
- cacheWrite: .25
87
- }]
88
- }
89
- }];
90
- const GPT6_THINKING = {
91
- off: "none",
92
- minimal: "low",
93
- low: "low",
94
- medium: "medium",
95
- high: "high",
96
- xhigh: "xhigh",
97
- max: "max"
98
- };
99
51
  function validateModelIds(ids) {
100
52
  if (new Set(ids).size !== ids.length || ids.some((id) => id.trim() !== id)) throw new TypeError("Additional Codex model IDs must be unique, non-empty, and trimmed");
101
53
  }
@@ -110,17 +62,34 @@ function apply(ctx, config = Config({})) {
110
62
  let lastIds;
111
63
  let profiles;
112
64
  const upstream = openaiCodexProvider();
113
- const installed = upstream.getModels();
114
- const astra = installed.find((model) => model.id === "gpt-6-astra");
115
- const catalog = astra === void 0 ? installed : [...installed, ...GPT6_MODELS.filter((extra) => !installed.some((model) => model.id === extra.id)).map((extra) => ({
116
- ...astra,
117
- ...extra,
118
- thinkingLevelMap: GPT6_THINKING,
119
- cost: {
120
- ...extra.cost,
121
- tiers: [...extra.cost.tiers]
122
- }
123
- }))];
65
+ const catalog = [...upstream.getModels()];
66
+ if (!catalog.some((model) => model.id === "gpt-6.1-sol")) {
67
+ const sol = catalog.find((model) => model.id === "gpt-6-sol");
68
+ if (sol === void 0) throw new TypeError("The Codex catalog must include GPT-6 Sol");
69
+ catalog.push({
70
+ ...sol,
71
+ id: "gpt-6.1-sol",
72
+ name: "GPT-6.1 Sol",
73
+ thinkingLevelMap: {
74
+ ...sol.thinkingLevelMap,
75
+ off: null,
76
+ minimal: null
77
+ },
78
+ cost: {
79
+ input: 2,
80
+ output: 10,
81
+ cacheRead: .1,
82
+ cacheWrite: 2.5,
83
+ tiers: [{
84
+ inputTokensAbove: 272e3,
85
+ input: 4,
86
+ output: 15,
87
+ cacheRead: .2,
88
+ cacheWrite: 5
89
+ }]
90
+ }
91
+ });
92
+ }
124
93
  const profileBase = {
125
94
  provider: PROVIDER,
126
95
  displayName: "OpenAI Codex (local login)",
@@ -145,7 +114,7 @@ function apply(ctx, config = Config({})) {
145
114
  if (configured === lastIds && profiles !== void 0) return profiles;
146
115
  const ids = configured.filter((id) => !catalog.some((model) => model.id === id));
147
116
  const models = [...catalog, ...ids.map((id) => {
148
- const family = id.endsWith("-luna") ? "gpt-5.6-luna" : id.endsWith("-sol") ? "gpt-5.6-sol" : "gpt-6-astra";
117
+ const family = id.endsWith("-luna") ? "gpt-6-luna" : id.endsWith("-sol") ? "gpt-6-sol" : "gpt-6-astra";
149
118
  return {
150
119
  ...catalog.find((model) => model.id === family) ?? catalog[0],
151
120
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-share",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "Use the local Codex CLI ChatGPT subscription login as a DeepSeek Harness LLM provider",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,31 +25,23 @@
25
25
  "engines": {
26
26
  "node": "^22.19.0 || >=24.0.0"
27
27
  },
28
- "packageManager": "pnpm@11.7.0",
29
- "scripts": {
30
- "build": "tsdown src/index.ts --dts --platform node --format esm && pnpm build:client",
31
- "build:client": "tsdown src/client/index.ts --platform browser --format cjs --out-dir lib --no-clean --external react --external @deepseek-ai/cordis --external @deepseek-ai/dsh-client-ui-slots && node scripts/wrap-client.mjs",
32
- "typecheck": "tsc --noEmit",
33
- "test": "vitest run",
34
- "prepack": "pnpm build"
35
- },
36
28
  "peerDependencies": {
37
- "@deepseek-ai/cordis": "^4.0.2",
38
- "@deepseek-ai/dsh-attachment": "^0.1.7-rc.2",
39
- "@deepseek-ai/dsh-fs": "^0.1.7-rc.2",
40
- "@deepseek-ai/dsh-llm": "^0.1.7-rc.2",
41
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.7-rc.2",
42
- "@deepseek-ai/schemastery": "^3.18.2"
29
+ "@deepseek-ai/cordis": "~4.0.4",
30
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
31
+ "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
32
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
33
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
34
+ "@deepseek-ai/schemastery": "^3.18.4"
43
35
  },
44
36
  "dependencies": {
45
- "@deepseek-ai/cordis": "^4.0.2",
46
- "@deepseek-ai/dsh-attachment": "^0.1.7-rc.2",
47
- "@deepseek-ai/dsh-credentials": "^0.1.7-rc.2",
48
- "@deepseek-ai/dsh-launch-environment": "^0.1.7-rc.2",
49
- "@deepseek-ai/dsh-llm": "^0.1.7-rc.2",
50
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.7-rc.2",
51
- "@deepseek-ai/schemastery": "^3.18.2",
52
- "@earendil-works/pi-ai": "^0.85.1"
37
+ "@deepseek-ai/cordis": "~4.0.4",
38
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
39
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
40
+ "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2",
41
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
42
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
43
+ "@deepseek-ai/schemastery": "^3.18.4",
44
+ "@earendil-works/pi-ai": "~0.87.1"
53
45
  },
54
46
  "devDependencies": {
55
47
  "@deepseek-ai/cordis": "link:../deepseek-harness/vendor/cordis",
@@ -82,5 +74,11 @@
82
74
  "bundle": {
83
75
  "patch": "./cordis.patch.yml"
84
76
  }
77
+ },
78
+ "scripts": {
79
+ "build": "tsdown src/index.ts --dts --platform node --format esm && pnpm build:client",
80
+ "build:client": "tsdown src/client/index.ts --platform browser --format cjs --out-dir lib --no-clean --external react --external @deepseek-ai/cordis --external @deepseek-ai/dsh-client-ui-slots && node scripts/wrap-client.mjs",
81
+ "typecheck": "tsc --noEmit",
82
+ "test": "vitest run"
85
83
  }
86
- }
84
+ }