dsh-codex-oauth 0.2.8 → 0.3.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-codex-oauth",
3
- "version": "0.2.8",
4
- "description": "Use a ChatGPT Codex subscription in DeepSeek Harness through standalone OAuth",
3
+ "version": "0.3.0",
4
+ "description": "Use ChatGPT plan models in DeepSeek Harness through native OAuth and Responses",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/eons2long/dsh-codex-oauth.git"
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "keywords": ["dsh-plugin", "deepseek-harness", "openai-codex", "oauth"],
14
14
  "license": "MIT",
15
- "scripts": { "build": "node scripts/build-client.mjs", "test": "npm run build && node test/smoke.mjs && node test/web-auth.mjs" },
15
+ "scripts": { "build": "node scripts/build-client.mjs", "test": "npm run build && node test/smoke.mjs && node --test test/auth.mjs test/adapter.mjs test/web-auth.mjs test/quota.mjs", "test:live": "node scripts/verify-live.mjs" },
16
16
  "type": "module",
17
17
  "main": "lib/index.js",
18
18
  "bin": { "dsh-openai-codex": "bin/dsh-openai-codex.js" },
19
19
  "exports": { ".": "./lib/index.js", "./client": "./lib/client.js", "./cordis.patch.yml": "./cordis.patch.yml", "./package.json": "./package.json" },
20
- "files": ["lib", "bin", "client", "cordis.patch.yml", "README.md", "README.zh.md", "SPEC.md", "LICENSE"],
20
+ "files": ["lib", "bin", "client", "scripts/patch-tui-quota-placement.mjs", "cordis.patch.yml", "README.md", "README.zh.md", "CHANGELOG.md", "SPEC.md", "LICENSE"],
21
21
  "dsh": {
22
22
  "bundle": { "patch": "./cordis.patch.yml" },
23
23
  "client": {
@@ -25,12 +25,11 @@
25
25
  "platform": "web"
26
26
  }
27
27
  },
28
- "devDependencies": { "esbuild": "^0.28.2" },
28
+ "devDependencies": { "esbuild": "^0.28.2", "@deepseek-ai/dsh-compaction-basic": "0.2.0-rc.2" },
29
+ "engines": { "node": ">=22" },
29
30
  "peerDependencies": {
30
- "@earendil-works/pi-ai": "^0.82.1 || ^0.84.1",
31
31
  "@deepseek-ai/cordis": "^4.0.1",
32
- "@deepseek-ai/dsh-atomic-write": "^0.1.1-rc.2",
33
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
34
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.1-rc.2"
32
+ "@deepseek-ai/dsh-atomic-write": "^0.2.0-rc.2",
33
+ "@deepseek-ai/dsh-llm": "^0.2.0-rc.2"
35
34
  }
36
35
  }
@@ -0,0 +1,35 @@
1
+ import { readFile, writeFile, rename } from "node:fs/promises";
2
+ import { dirname, resolve } from "node:path";
3
+ import { homedir } from "node:os";
4
+
5
+ // The public status service places every contribution above the prompt. This
6
+ // local host patch moves only our key into the existing shrinkable footer row.
7
+ const filename = resolve(process.argv[2] ?? `${process.env.DSH_HOME ?? `${homedir()}/.dsh`}/profiles/dsh-tui/node_modules/@deepseek-harness-tui/dsh-tui/lib/types/screens/Chat.js`);
8
+ const statusFilename = resolve(dirname(filename), "StatusLine.js");
9
+ const manifest = JSON.parse(await readFile(resolve(dirname(filename), "../../../package.json"), "utf8"));
10
+ if (manifest.name !== "@deepseek-harness-tui/dsh-tui" || manifest.version !== "0.14.0") {
11
+ throw new Error("Inline quota placement patch supports dsh-tui 0.14.0 only.");
12
+ }
13
+ const [chat, status] = await Promise.all([readFile(filename, "utf8"), readFile(statusFilename, "utf8")]);
14
+ const marker = 'const codexQuotaText = statusEntries.find';
15
+ const statusMarker = "effortPicker, wake, quotaText, activity: projectedActivity,";
16
+ if (chat.includes(marker) && status.includes(statusMarker)) {
17
+ console.log("Inline Codex quota placement patch already applied.");
18
+ } else {
19
+ function replaceOnce(source, from, to) {
20
+ if (source.split(from).length !== 2) throw new Error("Unexpected TUI layout; patch not applied.");
21
+ return source.replace(from, to);
22
+ }
23
+ let updatedChat = replaceOnce(chat, " const statusViews = React.useSyncExternalStore", ' const codexQuotaText = statusEntries.find(entry => entry.key === "dsh-codex-oauth:quota")?.text;\n const abovePromptEntries = statusEntries.filter(entry => entry.key !== "dsh-codex-oauth:quota");\n const statusViews = React.useSyncExternalStore');
24
+ const above = 'statusEntries.length > 0 && (_jsx(Text, { dimColor: true, wrap: "truncate", children: statusEntries.map(entry => entry.text).join(\' · \') }))';
25
+ updatedChat = replaceOnce(updatedChat, above, above.replaceAll("statusEntries", "abovePromptEntries"));
26
+ updatedChat = replaceOnce(updatedChat, '_jsx(StatusLine, { channel: channel, activity: workingActivity,', '_jsx(StatusLine, { channel: channel, quotaText: codexQuotaText, activity: workingActivity,');
27
+ let updatedStatus = replaceOnce(status, "effortPicker, wake, activity: projectedActivity,", statusMarker);
28
+ updatedStatus = replaceOnce(updatedStatus, " ...contextParts,", ' ...contextParts,\n ...(quotaText ? [{ key: "codexQuota", node: _jsx(Text, { dimColor: true, children: quotaText }) }] : []),');
29
+ const changes = [[filename, chat, updatedChat], [statusFilename, status, updatedStatus]];
30
+ for (const [path, original] of changes) await writeFile(`${path}.dsh-codex-oauth.bak`, original, { flag: "wx" });
31
+ // Rename new files rather than modifying pnpm's potentially hard-linked store.
32
+ for (const [path, , updated] of changes) await writeFile(`${path}.dsh-codex-oauth.tmp`, updated);
33
+ for (const [path] of changes) await rename(`${path}.dsh-codex-oauth.tmp`, path);
34
+ console.log("Moved Codex quota into the model/effort footer row; other statuses stay above.");
35
+ }