codex-multi-auth 2.19.0 → 2.20.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/.codex-plugin/plugin.json +9 -9
- package/LICENSE +21 -21
- package/README.md +149 -148
- package/assets/codex-multi-auth-icon.svg +39 -39
- package/assets/readme-hero.svg +31 -31
- package/config/README.md +31 -31
- package/config/codex-legacy.json +1021 -1021
- package/config/codex-modern.json +347 -347
- package/config/minimal-codex.json +15 -15
- package/dist/index.js +1 -1
- package/dist/lib/accounts/rate-limits.js +5 -0
- package/dist/lib/accounts.js +5 -4
- package/dist/lib/auth/account-access.js +2 -2
- package/dist/lib/codex-cli/version.d.ts +22 -0
- package/dist/lib/codex-cli/version.js +78 -0
- package/dist/lib/codex-manager/commands/limits.d.ts +2 -0
- package/dist/lib/codex-manager/commands/limits.js +31 -0
- package/dist/lib/codex-manager/commands/status.js +1 -1
- package/dist/lib/codex-manager/dashboard-settings-data.js +2 -0
- package/dist/lib/codex-manager/formatters/subscription-status.d.ts +2 -2
- package/dist/lib/codex-manager/formatters/text-style.js +4 -1
- package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +1 -1
- package/dist/lib/codex-manager/settings-hub/dashboard.js +4 -0
- package/dist/lib/codex-manager/settings-panels.d.ts +1 -0
- package/dist/lib/codex-manager/settings-panels.js +1 -0
- package/dist/lib/codex-manager/theme-settings-panel.d.ts +2 -1
- package/dist/lib/codex-manager/theme-settings-panel.js +39 -0
- package/dist/lib/codex-manager.js +2 -0
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.js +2 -0
- package/dist/lib/context-budget/model-context-windows.d.ts +1 -1
- package/dist/lib/context-budget/model-context-windows.js +4 -0
- package/dist/lib/context-budget-response.js +8 -8
- package/dist/lib/context-overflow.js +10 -10
- package/dist/lib/dashboard-settings.d.ts +2 -0
- package/dist/lib/dashboard-settings.js +18 -0
- package/dist/lib/luna-reserve.d.ts +26 -0
- package/dist/lib/luna-reserve.js +68 -0
- package/dist/lib/model-route-policy.d.ts +5 -5
- package/dist/lib/oauth-success.html +125 -125
- package/dist/lib/policy/runtime-policy.js +14 -0
- package/dist/lib/prompts/codex-host-bridge.js +138 -138
- package/dist/lib/prompts/codex.js +79 -79
- package/dist/lib/quota-readiness.d.ts +2 -2
- package/dist/lib/request/helpers/model-map.d.ts +1 -1
- package/dist/lib/request/helpers/model-map.js +12 -0
- package/dist/lib/request/response-outcome.d.ts +1 -1
- package/dist/lib/request/response-outcome.js +4 -1
- package/dist/lib/request/url-rewriting.js +3 -1
- package/dist/lib/runtime/account-model-catalog.d.ts +5 -5
- package/dist/lib/runtime/account-reset-credits.d.ts +2 -2
- package/dist/lib/runtime/account-status.js +2 -1
- package/dist/lib/runtime/luna-reserve-usage.d.ts +9 -0
- package/dist/lib/runtime/luna-reserve-usage.js +68 -0
- package/dist/lib/runtime/model-discovery-status.d.ts +11 -7
- package/dist/lib/runtime/model-discovery-status.js +13 -5
- package/dist/lib/runtime/reset-credit-routing.js +4 -1
- package/dist/lib/runtime/reset-credits.d.ts +7 -7
- package/dist/lib/runtime/resume-picker.js +1 -1
- package/dist/lib/runtime/rotation-server-types.d.ts +2 -0
- package/dist/lib/runtime/runtime-observability.d.ts +2 -0
- package/dist/lib/runtime/runtime-observability.js +1 -0
- package/dist/lib/runtime/workspace-model-scopes.d.ts +3 -3
- package/dist/lib/runtime-rotation-proxy.js +200 -32
- package/dist/lib/schemas.d.ts +65 -65
- package/dist/lib/ui/index.d.ts +1 -1
- package/dist/lib/ui/index.js +1 -1
- package/dist/lib/ui/runtime.d.ts +3 -1
- package/dist/lib/ui/runtime.js +11 -1
- package/dist/lib/ui/theme.d.ts +20 -1
- package/dist/lib/ui/theme.js +154 -30
- package/dist/lib/ui/ui-copy.d.ts +3 -2
- package/dist/lib/ui/ui-copy.js +3 -2
- package/dist/lib/usage/pricing.d.ts +1 -1
- package/dist/lib/usage/pricing.js +4 -0
- package/dist/lib/usage/usage-extraction.d.ts +2 -0
- package/dist/lib/usage/usage-extraction.js +25 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/node_modules/@codex-ai/plugin/dist/index.d.ts +2 -2
- package/node_modules/@codex-ai/plugin/dist/index.js +2 -2
- package/node_modules/@codex-ai/plugin/dist/tool.d.ts +42 -42
- package/node_modules/@codex-ai/plugin/dist/tool.js +29 -29
- package/node_modules/@codex-ai/plugin/package.json +9 -9
- package/node_modules/@codex-ai/sdk/dist/index.d.ts +4 -4
- package/node_modules/@codex-ai/sdk/dist/index.js +2 -2
- package/node_modules/@codex-ai/sdk/package.json +8 -8
- package/package.json +207 -206
- package/scripts/codex-app-launcher.js +653 -653
- package/scripts/codex-app-router.js +374 -373
- package/scripts/codex-bin-resolver.js +332 -332
- package/scripts/codex-multi-auth.js +65 -65
- package/scripts/codex-routing.js +62 -62
- package/scripts/codex.js +7006 -7005
- package/scripts/install-codex-auth-utils.js +213 -213
- package/scripts/mcodex.js +367 -367
- package/scripts/postinstall.js +114 -114
- package/scripts/preuninstall.js +265 -265
- package/skills/codex-auth-setup/SKILL.md +73 -73
- package/vendor/codex-ai-plugin/dist/index.d.ts +2 -2
- package/vendor/codex-ai-plugin/dist/index.js +2 -2
- package/vendor/codex-ai-plugin/dist/tool.d.ts +42 -42
- package/vendor/codex-ai-plugin/dist/tool.js +29 -29
- package/vendor/codex-ai-plugin/package.json +9 -9
- package/vendor/codex-ai-sdk/dist/index.d.ts +4 -4
- package/vendor/codex-ai-sdk/dist/index.js +2 -2
- package/vendor/codex-ai-sdk/package.json +8 -8
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// @ts-check
|
|
4
|
-
|
|
5
|
-
import { createRequire } from "node:module";
|
|
6
|
-
import { AUTH_SUBCOMMANDS } from "./codex-routing.js";
|
|
7
|
-
|
|
8
|
-
const versionFlags = new Set(["--version", "-v"]);
|
|
9
|
-
|
|
10
|
-
function resolveCliVersion() {
|
|
11
|
-
const require = createRequire(import.meta.url);
|
|
12
|
-
try {
|
|
13
|
-
const pkg = require("../package.json");
|
|
14
|
-
const version = typeof pkg?.version === "string" ? pkg.version.trim() : "";
|
|
15
|
-
if (version.length > 0) {
|
|
16
|
-
return version;
|
|
17
|
-
}
|
|
18
|
-
} catch {
|
|
19
|
-
// Best effort only.
|
|
20
|
-
}
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @param {string[]} args
|
|
26
|
-
* @returns {string[]}
|
|
27
|
-
*/
|
|
28
|
-
function normalizeStandaloneArgs(args) {
|
|
29
|
-
if (args[0] === "auth") return args;
|
|
30
|
-
const firstArg = args[0] ?? "";
|
|
31
|
-
if (AUTH_SUBCOMMANDS.has(firstArg)) {
|
|
32
|
-
// Keep this exhaustive: generic names here are reserved for auth routing.
|
|
33
|
-
return ["auth", ...args];
|
|
34
|
-
}
|
|
35
|
-
return args;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const args = normalizeStandaloneArgs(process.argv.slice(2));
|
|
39
|
-
const version = resolveCliVersion();
|
|
40
|
-
|
|
41
|
-
if (version.length > 0) {
|
|
42
|
-
process.env.CODEX_MULTI_AUTH_CLI_VERSION = version;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const firstArg = args[0] ?? "";
|
|
46
|
-
|
|
47
|
-
if (args.length === 1 && versionFlags.has(firstArg)) {
|
|
48
|
-
if (version.length > 0) {
|
|
49
|
-
process.stdout.write(`${version}\n`);
|
|
50
|
-
process.exitCode = 0;
|
|
51
|
-
} else {
|
|
52
|
-
process.stderr.write("codex-multi-auth version is unavailable.\n");
|
|
53
|
-
process.exitCode = 1;
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
// The specifier lives in a variable so `tsc -p tsconfig.scripts.json` can
|
|
57
|
-
// check this file without a prior `npm run build`: a literal
|
|
58
|
-
// "../dist/lib/codex-manager.js" specifier forces module resolution against
|
|
59
|
-
// dist/. The imported surface is guarded by Number.isInteger below, so the
|
|
60
|
-
// erased type information costs nothing here.
|
|
61
|
-
const managerModuleSpecifier = "../dist/lib/codex-manager.js";
|
|
62
|
-
const { runCodexMultiAuthCli } = await import(managerModuleSpecifier);
|
|
63
|
-
const exitCode = await runCodexMultiAuthCli(args);
|
|
64
|
-
process.exitCode = Number.isInteger(exitCode) ? exitCode : 1;
|
|
65
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// @ts-check
|
|
4
|
+
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
import { AUTH_SUBCOMMANDS } from "./codex-routing.js";
|
|
7
|
+
|
|
8
|
+
const versionFlags = new Set(["--version", "-v"]);
|
|
9
|
+
|
|
10
|
+
function resolveCliVersion() {
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
try {
|
|
13
|
+
const pkg = require("../package.json");
|
|
14
|
+
const version = typeof pkg?.version === "string" ? pkg.version.trim() : "";
|
|
15
|
+
if (version.length > 0) {
|
|
16
|
+
return version;
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
// Best effort only.
|
|
20
|
+
}
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {string[]} args
|
|
26
|
+
* @returns {string[]}
|
|
27
|
+
*/
|
|
28
|
+
function normalizeStandaloneArgs(args) {
|
|
29
|
+
if (args[0] === "auth") return args;
|
|
30
|
+
const firstArg = args[0] ?? "";
|
|
31
|
+
if (AUTH_SUBCOMMANDS.has(firstArg)) {
|
|
32
|
+
// Keep this exhaustive: generic names here are reserved for auth routing.
|
|
33
|
+
return ["auth", ...args];
|
|
34
|
+
}
|
|
35
|
+
return args;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const args = normalizeStandaloneArgs(process.argv.slice(2));
|
|
39
|
+
const version = resolveCliVersion();
|
|
40
|
+
|
|
41
|
+
if (version.length > 0) {
|
|
42
|
+
process.env.CODEX_MULTI_AUTH_CLI_VERSION = version;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const firstArg = args[0] ?? "";
|
|
46
|
+
|
|
47
|
+
if (args.length === 1 && versionFlags.has(firstArg)) {
|
|
48
|
+
if (version.length > 0) {
|
|
49
|
+
process.stdout.write(`${version}\n`);
|
|
50
|
+
process.exitCode = 0;
|
|
51
|
+
} else {
|
|
52
|
+
process.stderr.write("codex-multi-auth version is unavailable.\n");
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
// The specifier lives in a variable so `tsc -p tsconfig.scripts.json` can
|
|
57
|
+
// check this file without a prior `npm run build`: a literal
|
|
58
|
+
// "../dist/lib/codex-manager.js" specifier forces module resolution against
|
|
59
|
+
// dist/. The imported surface is guarded by Number.isInteger below, so the
|
|
60
|
+
// erased type information costs nothing here.
|
|
61
|
+
const managerModuleSpecifier = "../dist/lib/codex-manager.js";
|
|
62
|
+
const { runCodexMultiAuthCli } = await import(managerModuleSpecifier);
|
|
63
|
+
const exitCode = await runCodexMultiAuthCli(args);
|
|
64
|
+
process.exitCode = Number.isInteger(exitCode) ? exitCode : 1;
|
|
65
|
+
}
|
package/scripts/codex-routing.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
const AUTH_SUBCOMMANDS = new Set([
|
|
2
|
-
"login",
|
|
3
|
-
"list",
|
|
4
|
-
"status",
|
|
5
|
-
"limits",
|
|
6
|
-
"switch",
|
|
7
|
-
"unpin",
|
|
8
|
-
"workspace",
|
|
9
|
-
"best",
|
|
10
|
-
"check",
|
|
11
|
-
"features",
|
|
12
|
-
"usage",
|
|
13
|
-
"resets",
|
|
14
|
-
"verify-flagged",
|
|
15
|
-
"verify",
|
|
16
|
-
"forecast",
|
|
17
|
-
"report",
|
|
18
|
-
"fix",
|
|
19
|
-
"doctor",
|
|
20
|
-
"uninstall",
|
|
21
|
-
"account",
|
|
22
|
-
"budget",
|
|
23
|
-
"bridge",
|
|
24
|
-
"integrations",
|
|
25
|
-
"models",
|
|
26
|
-
"monitor",
|
|
27
|
-
"rotation",
|
|
28
|
-
"why-selected",
|
|
29
|
-
"history",
|
|
30
|
-
"config",
|
|
31
|
-
"init-config",
|
|
32
|
-
"debug",
|
|
33
|
-
]);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @param {string[]} args
|
|
37
|
-
* @returns {string[]}
|
|
38
|
-
*/
|
|
39
|
-
export function normalizeAuthAlias(args) {
|
|
40
|
-
if (args.length >= 2 && args[0] === "multi" && args[1] === "auth") {
|
|
41
|
-
return ["auth", ...args.slice(2)];
|
|
42
|
-
}
|
|
43
|
-
if (args.length >= 1 && (args[0] === "multi-auth" || args[0] === "multiauth")) {
|
|
44
|
-
return ["auth", ...args.slice(1)];
|
|
45
|
-
}
|
|
46
|
-
return args;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @param {string[]} args
|
|
51
|
-
* @returns {boolean}
|
|
52
|
-
*/
|
|
53
|
-
export function shouldHandleMultiAuthAuth(args) {
|
|
54
|
-
if (args[0] !== "auth") return false;
|
|
55
|
-
if (args.length === 1) return true;
|
|
56
|
-
const subcommand = args[1];
|
|
57
|
-
if (typeof subcommand !== "string") return false;
|
|
58
|
-
if (subcommand.startsWith("-")) return true;
|
|
59
|
-
return AUTH_SUBCOMMANDS.has(subcommand);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { AUTH_SUBCOMMANDS };
|
|
1
|
+
const AUTH_SUBCOMMANDS = new Set([
|
|
2
|
+
"login",
|
|
3
|
+
"list",
|
|
4
|
+
"status",
|
|
5
|
+
"limits",
|
|
6
|
+
"switch",
|
|
7
|
+
"unpin",
|
|
8
|
+
"workspace",
|
|
9
|
+
"best",
|
|
10
|
+
"check",
|
|
11
|
+
"features",
|
|
12
|
+
"usage",
|
|
13
|
+
"resets",
|
|
14
|
+
"verify-flagged",
|
|
15
|
+
"verify",
|
|
16
|
+
"forecast",
|
|
17
|
+
"report",
|
|
18
|
+
"fix",
|
|
19
|
+
"doctor",
|
|
20
|
+
"uninstall",
|
|
21
|
+
"account",
|
|
22
|
+
"budget",
|
|
23
|
+
"bridge",
|
|
24
|
+
"integrations",
|
|
25
|
+
"models",
|
|
26
|
+
"monitor",
|
|
27
|
+
"rotation",
|
|
28
|
+
"why-selected",
|
|
29
|
+
"history",
|
|
30
|
+
"config",
|
|
31
|
+
"init-config",
|
|
32
|
+
"debug",
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {string[]} args
|
|
37
|
+
* @returns {string[]}
|
|
38
|
+
*/
|
|
39
|
+
export function normalizeAuthAlias(args) {
|
|
40
|
+
if (args.length >= 2 && args[0] === "multi" && args[1] === "auth") {
|
|
41
|
+
return ["auth", ...args.slice(2)];
|
|
42
|
+
}
|
|
43
|
+
if (args.length >= 1 && (args[0] === "multi-auth" || args[0] === "multiauth")) {
|
|
44
|
+
return ["auth", ...args.slice(1)];
|
|
45
|
+
}
|
|
46
|
+
return args;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string[]} args
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
53
|
+
export function shouldHandleMultiAuthAuth(args) {
|
|
54
|
+
if (args[0] !== "auth") return false;
|
|
55
|
+
if (args.length === 1) return true;
|
|
56
|
+
const subcommand = args[1];
|
|
57
|
+
if (typeof subcommand !== "string") return false;
|
|
58
|
+
if (subcommand.startsWith("-")) return true;
|
|
59
|
+
return AUTH_SUBCOMMANDS.has(subcommand);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { AUTH_SUBCOMMANDS };
|