dsh-codex-share 0.4.3 → 0.5.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/README.md +8 -2
- package/dist/index.mjs +33 -41
- package/package.json +15 -15
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.2.
|
|
7
|
+
- DeepSeek Harness `0.2.1-alpha.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,10 +24,16 @@ 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 0
|
|
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 1.0, including GPT-6 Astra, Sol, and Luna, and GPT-6.1 Sol (`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
|
|
|
31
|
+
## Daybreak Blue
|
|
32
|
+
|
|
33
|
+
The Codex model picker also lists **Daybreak Blue** (`gpt-daybreak-blue-latest`). [OpenAI's model page](https://developers.openai.com/api/docs/models/gpt-daybreak-blue-latest) documents this alias, currently targeting GPT-5.6 Sol, and marks it deprecated. Listing it does not grant Daybreak access or confirm that your ChatGPT plan or the Codex subscription endpoint supports it; requests may be rejected. OpenAI's Platform API approval and access-program settings do not establish availability through this subscription route.
|
|
34
|
+
|
|
35
|
+
When pi-ai does not supply this model, the fallback inherits GPT-5.6 Sol's Codex transport, reasoning, text/image input, 272K context, and 128K maximum output as conservative capability assumptions. These are subscription-catalog limits, rather than the public API's documented 1.05M context. Fallback pricing is unestimated (zero cost fields do not imply free usage). Upstream model metadata takes precedence when available, and the alias is listed only once, including when entered in **Edit model IDs**.
|
|
36
|
+
|
|
31
37
|
## Optional GLM Coding Plan (global)
|
|
32
38
|
|
|
33
39
|
When `GLM_API_KEY` is non-empty in the Harness launch environment, this plugin also adds **GLM Coding Plan (global)** to the model picker under the `glm-coding-global` provider route. It uses pi-ai's installed Z.AI model catalog and the global Coding Plan endpoint, `https://api.z.ai/api/coding/paas/v4` (not the China endpoint or the standard pay-as-you-go API).
|
package/dist/index.mjs
CHANGED
|
@@ -55,6 +55,27 @@ const Config = z.object({
|
|
|
55
55
|
function validateModelIds(ids) {
|
|
56
56
|
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");
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Re-route an upstream provider under a Harness route with its own catalog.
|
|
60
|
+
* Only the wire streams are delegated: pi-ai 1.x `Models` prefers
|
|
61
|
+
* `getAllModels()` and may refresh the catalog, which would bypass the
|
|
62
|
+
* route-stamped models, so those upstream members are deliberately dropped.
|
|
63
|
+
*/
|
|
64
|
+
function routeProvider(base, id, name, apiKeyLabel, models) {
|
|
65
|
+
return {
|
|
66
|
+
id,
|
|
67
|
+
name,
|
|
68
|
+
...base.baseUrl === void 0 ? {} : { baseUrl: base.baseUrl },
|
|
69
|
+
...base.headers === void 0 ? {} : { headers: base.headers },
|
|
70
|
+
auth: { apiKey: envApiKeyAuth(apiKeyLabel, []) },
|
|
71
|
+
getModels: () => models.map((model) => ({
|
|
72
|
+
...model,
|
|
73
|
+
provider: id
|
|
74
|
+
})),
|
|
75
|
+
stream: (model, context, options) => base.stream(model, context, options),
|
|
76
|
+
streamSimple: (model, context, options) => base.streamSimple(model, context, options)
|
|
77
|
+
};
|
|
78
|
+
}
|
|
58
79
|
/** Register the Codex subscription model catalog and stream adapter. */
|
|
59
80
|
function apply(ctx, config = Config({})) {
|
|
60
81
|
validateModelIds(config.additionalModelIds.get());
|
|
@@ -67,30 +88,18 @@ function apply(ctx, config = Config({})) {
|
|
|
67
88
|
let profiles;
|
|
68
89
|
const upstream = openaiCodexProvider();
|
|
69
90
|
const catalog = [...upstream.getModels()];
|
|
70
|
-
if (!catalog.some((model) => model.id === "gpt-
|
|
71
|
-
const sol = catalog.find((model) => model.id === "gpt-6-sol");
|
|
72
|
-
if (sol === void 0) throw new TypeError("The Codex catalog must include GPT-6 Sol");
|
|
91
|
+
if (!catalog.some((model) => model.id === "gpt-daybreak-blue-latest")) {
|
|
92
|
+
const sol = catalog.find((model) => model.id === "gpt-5.6-sol");
|
|
93
|
+
if (sol === void 0) throw new TypeError("The Codex catalog must include GPT-5.6 Sol");
|
|
73
94
|
catalog.push({
|
|
74
95
|
...sol,
|
|
75
|
-
id: "gpt-
|
|
76
|
-
name: "
|
|
77
|
-
thinkingLevelMap: {
|
|
78
|
-
...sol.thinkingLevelMap,
|
|
79
|
-
off: null,
|
|
80
|
-
minimal: null
|
|
81
|
-
},
|
|
96
|
+
id: "gpt-daybreak-blue-latest",
|
|
97
|
+
name: "Daybreak Blue",
|
|
82
98
|
cost: {
|
|
83
|
-
input:
|
|
84
|
-
output:
|
|
85
|
-
cacheRead:
|
|
86
|
-
cacheWrite:
|
|
87
|
-
tiers: [{
|
|
88
|
-
inputTokensAbove: 272e3,
|
|
89
|
-
input: 4,
|
|
90
|
-
output: 15,
|
|
91
|
-
cacheRead: .2,
|
|
92
|
-
cacheWrite: 5
|
|
93
|
-
}]
|
|
99
|
+
input: 0,
|
|
100
|
+
output: 0,
|
|
101
|
+
cacheRead: 0,
|
|
102
|
+
cacheWrite: 0
|
|
94
103
|
}
|
|
95
104
|
});
|
|
96
105
|
}
|
|
@@ -135,16 +144,7 @@ function apply(ctx, config = Config({})) {
|
|
|
135
144
|
...profileBase,
|
|
136
145
|
provider: "glm-coding-global",
|
|
137
146
|
displayName: "GLM Coding Plan (global)",
|
|
138
|
-
piProvider:
|
|
139
|
-
...glmUpstream,
|
|
140
|
-
id: "glm-coding-global",
|
|
141
|
-
name: "GLM Coding Plan (global)",
|
|
142
|
-
auth: { apiKey: envApiKeyAuth("GLM Coding Plan API key", []) },
|
|
143
|
-
getModels: () => glmCatalog.map((model) => ({
|
|
144
|
-
...model,
|
|
145
|
-
provider: "glm-coding-global"
|
|
146
|
-
}))
|
|
147
|
-
}
|
|
147
|
+
piProvider: routeProvider(glmUpstream, "glm-coding-global", "GLM Coding Plan (global)", "GLM Coding Plan API key", glmCatalog)
|
|
148
148
|
};
|
|
149
149
|
const resolveProfiles = () => {
|
|
150
150
|
const configured = config.additionalModelIds.get();
|
|
@@ -157,16 +157,8 @@ function apply(ctx, config = Config({})) {
|
|
|
157
157
|
id,
|
|
158
158
|
name: id
|
|
159
159
|
};
|
|
160
|
-
})]
|
|
161
|
-
|
|
162
|
-
provider: PROVIDER
|
|
163
|
-
}));
|
|
164
|
-
const provider = {
|
|
165
|
-
...upstream,
|
|
166
|
-
id: PROVIDER,
|
|
167
|
-
auth: { apiKey: envApiKeyAuth("Codex CLI login", []) },
|
|
168
|
-
getModels: () => models
|
|
169
|
-
};
|
|
160
|
+
})];
|
|
161
|
+
const provider = routeProvider(upstream, PROVIDER, upstream.name, "Codex CLI login", models);
|
|
170
162
|
profiles = new Map([[PROVIDER, {
|
|
171
163
|
...profileBase,
|
|
172
164
|
piProvider: provider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-codex-share",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"node": "^22.19.0 || >=24.0.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
30
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
31
|
-
"@deepseek-ai/dsh-fs": "0.2.
|
|
32
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
33
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.2.
|
|
34
|
-
"@deepseek-ai/schemastery": "
|
|
29
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
30
|
+
"@deepseek-ai/dsh-attachment": "0.2.1-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.1-alpha.2",
|
|
34
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
38
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
39
|
-
"@deepseek-ai/dsh-credentials": "0.2.
|
|
40
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.
|
|
41
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
42
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.2.
|
|
43
|
-
"@deepseek-ai/schemastery": "
|
|
44
|
-
"@earendil-works/pi-ai": "
|
|
37
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
38
|
+
"@deepseek-ai/dsh-attachment": "0.2.1-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.1-alpha.2",
|
|
43
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1",
|
|
44
|
+
"@earendil-works/pi-ai": "^1.0.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@deepseek-ai/cordis": "link:../../deepseek-harness/vendor/cordis",
|