dsh-codex-share 0.3.0 → 0.4.0
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 +6 -4
- package/dist/index.mjs +2 -60
- package/package.json +22 -17
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.
|
|
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
|
|
|
@@ -16,13 +16,15 @@ Install the bundle into a harness profile:
|
|
|
16
16
|
dsh plugin --profile web add dsh-codex-share
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
On a fresh profile, pnpm may stop with `ERR_PNPM_IGNORED_BUILDS` for the pi-ai dependency tree. In `$DSH_HOME/profiles/web/pnpm-workspace.yaml` (default `~/.dsh/profiles/web/pnpm-workspace.yaml`), set the generated `allowBuilds` entries for `@google/genai` and `protobufjs` to `false`, as the harness source workspace does. Then run `dsh plugin --profile web remove dsh-codex-share` followed by the add command again; a failed add can leave the package installed without activating its bundle layer.
|
|
20
|
+
|
|
21
|
+
For development from this checkout, from its directory:
|
|
20
22
|
|
|
21
23
|
```sh
|
|
22
24
|
dsh plugin --profile web add .
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
Restart the profile after installation or update. The bundle mounts one provider route, `openai-codex-local`, with the model catalog supplied by pi-ai
|
|
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. 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.
|
|
26
28
|
|
|
27
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`.
|
|
28
30
|
|
|
@@ -36,4 +38,4 @@ pnpm build
|
|
|
36
38
|
pnpm pack
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
The development links in `package.json` point to the adjacent `../deepseek-harness` checkout. Replace those
|
|
41
|
+
The development links in `package.json` and local overrides in `pnpm-workspace.yaml` point to the adjacent `../deepseek-harness` checkout. Replace those paths when developing elsewhere; consumers of the published package use the versioned runtime dependencies instead.
|
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,7 @@ function apply(ctx, config = Config({})) {
|
|
|
110
62
|
let lastIds;
|
|
111
63
|
let profiles;
|
|
112
64
|
const upstream = openaiCodexProvider();
|
|
113
|
-
const
|
|
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();
|
|
124
66
|
const profileBase = {
|
|
125
67
|
provider: PROVIDER,
|
|
126
68
|
displayName: "OpenAI Codex (local login)",
|
|
@@ -145,7 +87,7 @@ function apply(ctx, config = Config({})) {
|
|
|
145
87
|
if (configured === lastIds && profiles !== void 0) return profiles;
|
|
146
88
|
const ids = configured.filter((id) => !catalog.some((model) => model.id === id));
|
|
147
89
|
const models = [...catalog, ...ids.map((id) => {
|
|
148
|
-
const family = id.endsWith("-luna") ? "gpt-
|
|
90
|
+
const family = id.endsWith("-luna") ? "gpt-6-luna" : id.endsWith("-sol") ? "gpt-6-sol" : "gpt-6-astra";
|
|
149
91
|
return {
|
|
150
92
|
...catalog.find((model) => model.id === family) ?? catalog[0],
|
|
151
93
|
id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-codex-share",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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,24 +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": "
|
|
38
|
-
"@deepseek-ai/dsh-attachment": "
|
|
39
|
-
"@deepseek-ai/dsh-fs": "
|
|
40
|
-
"@deepseek-ai/dsh-llm": "
|
|
41
|
-
"@deepseek-ai/dsh-llm-pi-ai": "
|
|
42
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
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
|
-
"@
|
|
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"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@deepseek-ai/cordis": "link:../deepseek-harness/vendor/cordis",
|
|
@@ -75,5 +74,11 @@
|
|
|
75
74
|
"bundle": {
|
|
76
75
|
"patch": "./cordis.patch.yml"
|
|
77
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"
|
|
78
83
|
}
|
|
79
|
-
}
|
|
84
|
+
}
|