oc-codex-multi-auth 6.1.7 → 6.1.9
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 +311 -125
- package/config/README.md +10 -6
- package/config/minimal-opencode.json +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
- package/dist/lib/request/fetch-helpers.js +44 -12
- package/dist/lib/request/fetch-helpers.js.map +1 -1
- package/dist/lib/request/request-transformer.d.ts.map +1 -1
- package/dist/lib/request/request-transformer.js +7 -2
- package/dist/lib/request/request-transformer.js.map +1 -1
- package/dist/lib/runtime.d.ts +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/tools/codex-export.js +2 -2
- package/dist/lib/tools/codex-export.js.map +1 -1
- package/dist/lib/tools/codex-help.js +3 -3
- package/dist/lib/tools/codex-help.js.map +1 -1
- package/dist/lib/tools/codex-remove.js +3 -3
- package/dist/lib/tools/codex-remove.js.map +1 -1
- package/dist/lib/tools/index.d.ts +8 -14
- package/dist/lib/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/index.js +4 -6
- package/dist/lib/tools/index.js.map +1 -1
- package/package.json +27 -12
- package/scripts/clean-dist.js +27 -0
- package/scripts/install-oc-codex-multi-auth-core.js +19 -1
- package/scripts/install-oc-codex-multi-auth.js +15 -3
- package/dist/lib/tools/_shared.d.ts +0 -16
- package/dist/lib/tools/_shared.d.ts.map +0 -1
- package/dist/lib/tools/_shared.js +0 -21
- package/dist/lib/tools/_shared.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-codex-multi-auth",
|
|
3
|
-
"version": "6.1.
|
|
4
|
-
"description": "OpenCode plugin for
|
|
3
|
+
"version": "6.1.9",
|
|
4
|
+
"description": "OpenCode plugin for ChatGPT Plus/Pro OAuth with Codex/GPT-5 routing, multi-account rotation, account switching, health checks, diagnostics, and recovery tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -22,29 +22,41 @@
|
|
|
22
22
|
"url": "git+https://github.com/ndycode/oc-codex-multi-auth.git"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
|
-
"typescript",
|
|
26
|
-
"nodejs",
|
|
27
25
|
"opencode",
|
|
28
26
|
"opencode-plugin",
|
|
27
|
+
"opencode-auth",
|
|
29
28
|
"openai",
|
|
30
29
|
"chatgpt",
|
|
31
30
|
"chatgpt-plus",
|
|
32
31
|
"chatgpt-pro",
|
|
33
32
|
"oauth",
|
|
34
33
|
"oauth2",
|
|
34
|
+
"oauth-login",
|
|
35
35
|
"pkce",
|
|
36
|
-
"gpt-5",
|
|
37
36
|
"codex",
|
|
37
|
+
"codex-auth",
|
|
38
|
+
"codex-oauth",
|
|
39
|
+
"gpt-5",
|
|
40
|
+
"gpt-5-5",
|
|
38
41
|
"multi-account",
|
|
42
|
+
"account-rotation",
|
|
43
|
+
"account-switching",
|
|
44
|
+
"account-health",
|
|
45
|
+
"health-checks",
|
|
46
|
+
"quota-management",
|
|
47
|
+
"diagnostics",
|
|
48
|
+
"recovery-tools",
|
|
49
|
+
"terminal-ui",
|
|
39
50
|
"developer-tools",
|
|
40
|
-
"
|
|
51
|
+
"typescript",
|
|
52
|
+
"nodejs"
|
|
41
53
|
],
|
|
42
54
|
"homepage": "https://github.com/ndycode/oc-codex-multi-auth#readme",
|
|
43
55
|
"bugs": {
|
|
44
56
|
"url": "https://github.com/ndycode/oc-codex-multi-auth/issues"
|
|
45
57
|
},
|
|
46
58
|
"scripts": {
|
|
47
|
-
"build": "tsc && node scripts/copy-oauth-success.js",
|
|
59
|
+
"build": "node scripts/clean-dist.js && tsc && node scripts/copy-oauth-success.js",
|
|
48
60
|
"typecheck": "tsc --noEmit",
|
|
49
61
|
"lint": "npm run lint:ts && npm run lint:scripts",
|
|
50
62
|
"lint:ts": "eslint . --ext .ts",
|
|
@@ -109,16 +121,16 @@
|
|
|
109
121
|
"@napi-rs/keyring": "~1.2.0",
|
|
110
122
|
"@openauthjs/openauth": "^0.4.3",
|
|
111
123
|
"@opencode-ai/plugin": "^1.14.22",
|
|
112
|
-
"@opentui/core": "
|
|
113
|
-
"@opentui/solid": "
|
|
114
|
-
"hono": "4.12.
|
|
124
|
+
"@opentui/core": "0.2.6",
|
|
125
|
+
"@opentui/solid": "0.2.6",
|
|
126
|
+
"hono": "4.12.18",
|
|
115
127
|
"solid-js": "^1.9.11",
|
|
116
128
|
"web-tree-sitter": "^0.25.10",
|
|
117
129
|
"zod": "^4.3.6"
|
|
118
130
|
},
|
|
119
131
|
"overrides": {
|
|
120
132
|
"flatted": "3.4.2",
|
|
121
|
-
"hono": "4.12.
|
|
133
|
+
"hono": "4.12.18",
|
|
122
134
|
"rollup": "4.60.0",
|
|
123
135
|
"vite": "^7.3.2",
|
|
124
136
|
"yaml": "^2.8.3",
|
|
@@ -130,6 +142,9 @@
|
|
|
130
142
|
"picomatch@>=4.0.0 <4.0.4": "^4.0.4",
|
|
131
143
|
"@typescript-eslint/typescript-estree": {
|
|
132
144
|
"minimatch": "^9.0.7"
|
|
133
|
-
}
|
|
145
|
+
},
|
|
146
|
+
"uuid": "13.0.1",
|
|
147
|
+
"diff": "8.0.3",
|
|
148
|
+
"file-type": "21.3.1"
|
|
134
149
|
}
|
|
135
150
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import { dirname, relative, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
7
|
+
|
|
8
|
+
function normalizeRelativePath(path) {
|
|
9
|
+
return path.replaceAll("\\", "/");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function cleanDist(options = {}) {
|
|
13
|
+
const repoRoot = resolve(options.repoRoot ?? resolve(__dirname, ".."));
|
|
14
|
+
const distDir = resolve(options.distDir ?? resolve(repoRoot, "dist"));
|
|
15
|
+
const relativeDist = normalizeRelativePath(relative(repoRoot, distDir));
|
|
16
|
+
|
|
17
|
+
if (relativeDist !== "dist") {
|
|
18
|
+
throw new Error(`Refusing to clean non-dist path: ${distDir}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
await fs.rm(distDir, { recursive: true, force: true });
|
|
22
|
+
return { distDir };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (process.argv[1] && resolve(process.argv[1]) === __filename) {
|
|
26
|
+
await cleanDist();
|
|
27
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
2
|
import { copyFile, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -18,6 +18,24 @@ function getManagedPackageNames() {
|
|
|
18
18
|
return [PACKAGE_NAME, ...LEGACY_PACKAGE_NAMES];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
export function normalizePathForCompare(path, resolveRealPath = realpathSync) {
|
|
22
|
+
const resolved = resolve(path);
|
|
23
|
+
try {
|
|
24
|
+
const realPath = resolveRealPath(resolved);
|
|
25
|
+
return process.platform === "win32" ? realPath.toLowerCase() : realPath;
|
|
26
|
+
} catch {
|
|
27
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function isDirectRunPath(argvPath, modulePath, resolveRealPath = realpathSync) {
|
|
32
|
+
if (!argvPath || !modulePath) return false;
|
|
33
|
+
return (
|
|
34
|
+
normalizePathForCompare(argvPath, resolveRealPath) ===
|
|
35
|
+
normalizePathForCompare(modulePath, resolveRealPath)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
function printHelp() {
|
|
22
40
|
console.log(`Usage: ${PACKAGE_NAME} [--modern|--full|--legacy] [--dry-run] [--no-cache-clear]\n\n` +
|
|
23
41
|
"Default behavior:\n" +
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
isDirectRunPath as isDirectRunPathCore,
|
|
6
|
+
runInstaller,
|
|
7
|
+
} from "./install-oc-codex-multi-auth-core.js";
|
|
6
8
|
|
|
7
9
|
export * from "./install-oc-codex-multi-auth-core.js";
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
|
|
13
|
+
export function isDirectRunPath(
|
|
14
|
+
argvPath = process.argv[1],
|
|
15
|
+
modulePath = __filename,
|
|
16
|
+
resolveRealPath,
|
|
17
|
+
) {
|
|
18
|
+
return isDirectRunPathCore(argvPath, modulePath, resolveRealPath);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (isDirectRunPath()) {
|
|
10
22
|
runInstaller().catch((error) => {
|
|
11
23
|
const message = error instanceof Error ? error.message : String(error);
|
|
12
24
|
console.error(`Installer failed: ${message}`);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers re-exported for codex-* tool modules.
|
|
3
|
-
*
|
|
4
|
-
* As RC-1 extracts the 18 inline tools from `index.ts` into per-file modules
|
|
5
|
-
* under `lib/tools/<name>.ts`, each tool will import its pure, closure-free
|
|
6
|
-
* helpers from this barrel. Helpers that depend on the plugin closure
|
|
7
|
-
* (e.g. `resolveUiRuntime`, `cachedAccountManager`, `formatCommandAccountLabel`)
|
|
8
|
-
* will be threaded through a `ToolContext` factory argument once the full
|
|
9
|
-
* split lands.
|
|
10
|
-
*
|
|
11
|
-
* See `docs/audits/07-refactoring-plan.md#rc-1` and
|
|
12
|
-
* `docs/audits/13-phased-roadmap.md` §2.1.
|
|
13
|
-
*/
|
|
14
|
-
export { normalizeToolOutputFormat, renderJsonOutput, type ToolOutputFormat, } from "../runtime.js";
|
|
15
|
-
export { formatRoutingValue, formatExplainabilitySummary, serializeSelectionExplainability, type SerializedSelectionExplainability, type RoutingVisibilitySnapshot, type SelectionSnapshot, type RuntimeMetrics, } from "../runtime.js";
|
|
16
|
-
//# sourceMappingURL=_shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../../lib/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACN,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,gBAAgB,GACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,gCAAgC,EAChC,KAAK,iCAAiC,EACtC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACnB,MAAM,eAAe,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers re-exported for codex-* tool modules.
|
|
3
|
-
*
|
|
4
|
-
* As RC-1 extracts the 18 inline tools from `index.ts` into per-file modules
|
|
5
|
-
* under `lib/tools/<name>.ts`, each tool will import its pure, closure-free
|
|
6
|
-
* helpers from this barrel. Helpers that depend on the plugin closure
|
|
7
|
-
* (e.g. `resolveUiRuntime`, `cachedAccountManager`, `formatCommandAccountLabel`)
|
|
8
|
-
* will be threaded through a `ToolContext` factory argument once the full
|
|
9
|
-
* split lands.
|
|
10
|
-
*
|
|
11
|
-
* See `docs/audits/07-refactoring-plan.md#rc-1` and
|
|
12
|
-
* `docs/audits/13-phased-roadmap.md` §2.1.
|
|
13
|
-
*/
|
|
14
|
-
export { normalizeToolOutputFormat, renderJsonOutput, } from "../runtime.js";
|
|
15
|
-
export { formatRoutingValue, formatExplainabilitySummary, serializeSelectionExplainability, } from "../runtime.js";
|
|
16
|
-
// Note: `toolOutputFormatSchema` and `toolSensitiveJsonSchema` cannot be
|
|
17
|
-
// exported from `lib/runtime.ts` because their Zod return type cannot be
|
|
18
|
-
// named without a path into the plugin's bundled zod copy (TS2742). They
|
|
19
|
-
// remain inline inside `index.ts`. Per-tool files moved out of `index.ts`
|
|
20
|
-
// during the next RC-1 follow-up will receive them via `ToolContext`.
|
|
21
|
-
//# sourceMappingURL=_shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../../lib/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACN,yBAAyB,EACzB,gBAAgB,GAEhB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,gCAAgC,GAKhC,MAAM,eAAe,CAAC;AAEvB,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,sEAAsE"}
|