codex-multi-auth 2.17.0 → 2.17.2

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.
Files changed (75) hide show
  1. package/.codex-plugin/plugin.json +9 -9
  2. package/LICENSE +21 -21
  3. package/README.md +487 -484
  4. package/assets/codex-multi-auth-icon.svg +39 -39
  5. package/assets/readme-hero.svg +31 -31
  6. package/config/README.md +31 -31
  7. package/config/codex-legacy.json +1221 -1221
  8. package/config/codex-modern.json +423 -423
  9. package/config/minimal-codex.json +15 -15
  10. package/dist/lib/accounts.d.ts +1 -7
  11. package/dist/lib/accounts.d.ts.map +1 -1
  12. package/dist/lib/accounts.js +3 -14
  13. package/dist/lib/codex-manager/commands/forecast.d.ts +1 -1
  14. package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -1
  15. package/dist/lib/codex-manager/commands/forecast.js +2 -2
  16. package/dist/lib/codex-manager/health-check.js +1 -1
  17. package/dist/lib/codex-manager/login-menu-data.d.ts.map +1 -1
  18. package/dist/lib/codex-manager/login-menu-data.js +7 -3
  19. package/dist/lib/codex-manager/quota-cache-helpers.d.ts +7 -1
  20. package/dist/lib/codex-manager/quota-cache-helpers.d.ts.map +1 -1
  21. package/dist/lib/codex-manager/quota-cache-helpers.js +34 -19
  22. package/dist/lib/codex-manager/repair-commands.js +1 -1
  23. package/dist/lib/context-budget-response.js +8 -8
  24. package/dist/lib/context-overflow.js +10 -10
  25. package/dist/lib/oauth-success.html +125 -125
  26. package/dist/lib/prompts/codex-host-bridge.js +138 -138
  27. package/dist/lib/prompts/codex.js +79 -79
  28. package/dist/lib/quota-cache.d.ts +7 -3
  29. package/dist/lib/quota-cache.d.ts.map +1 -1
  30. package/dist/lib/quota-cache.js +91 -59
  31. package/dist/lib/quota-readiness.d.ts +7 -2
  32. package/dist/lib/quota-readiness.d.ts.map +1 -1
  33. package/dist/lib/quota-readiness.js +25 -4
  34. package/dist/lib/runtime/app-bind.d.ts.map +1 -1
  35. package/dist/lib/runtime/app-bind.js +10 -2
  36. package/dist/lib/runtime/automatic-account-checks.d.ts +5 -1
  37. package/dist/lib/runtime/automatic-account-checks.d.ts.map +1 -1
  38. package/dist/lib/runtime/automatic-account-checks.js +29 -2
  39. package/dist/lib/runtime/automatic-subscription-checks.d.ts +1 -1
  40. package/dist/lib/runtime/automatic-subscription-checks.d.ts.map +1 -1
  41. package/dist/lib/runtime/automatic-subscription-checks.js +13 -16
  42. package/dist/lib/runtime-rotation-proxy.js +3 -3
  43. package/dist/lib/storage/pending-auth.d.ts +1 -0
  44. package/dist/lib/storage/pending-auth.d.ts.map +1 -1
  45. package/dist/lib/storage/pending-auth.js +4 -2
  46. package/dist/lib/storage/record-identity.d.ts +16 -0
  47. package/dist/lib/storage/record-identity.d.ts.map +1 -0
  48. package/dist/lib/storage/record-identity.js +16 -0
  49. package/node_modules/@codex-ai/plugin/dist/index.d.ts +2 -2
  50. package/node_modules/@codex-ai/plugin/dist/index.js +2 -2
  51. package/node_modules/@codex-ai/plugin/dist/tool.d.ts +42 -42
  52. package/node_modules/@codex-ai/plugin/dist/tool.js +29 -29
  53. package/node_modules/@codex-ai/plugin/package.json +9 -9
  54. package/node_modules/@codex-ai/sdk/dist/index.d.ts +4 -4
  55. package/node_modules/@codex-ai/sdk/dist/index.js +2 -2
  56. package/node_modules/@codex-ai/sdk/package.json +8 -8
  57. package/package.json +200 -200
  58. package/scripts/codex-app-launcher.js +653 -653
  59. package/scripts/codex-app-router.js +373 -373
  60. package/scripts/codex-bin-resolver.js +313 -313
  61. package/scripts/codex-multi-auth.js +59 -59
  62. package/scripts/codex-routing.js +62 -62
  63. package/scripts/codex.js +6642 -6642
  64. package/scripts/install-codex-auth-utils.js +213 -213
  65. package/scripts/mcodex.js +367 -367
  66. package/scripts/postinstall.js +114 -114
  67. package/scripts/preuninstall.js +265 -265
  68. package/vendor/codex-ai-plugin/dist/index.d.ts +2 -2
  69. package/vendor/codex-ai-plugin/dist/index.js +2 -2
  70. package/vendor/codex-ai-plugin/dist/tool.d.ts +42 -42
  71. package/vendor/codex-ai-plugin/dist/tool.js +29 -29
  72. package/vendor/codex-ai-plugin/package.json +9 -9
  73. package/vendor/codex-ai-sdk/dist/index.d.ts +4 -4
  74. package/vendor/codex-ai-sdk/dist/index.js +2 -2
  75. package/vendor/codex-ai-sdk/package.json +8 -8
@@ -1,59 +1,59 @@
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
- const { runCodexMultiAuthCli } = await import("../dist/lib/codex-manager.js");
57
- const exitCode = await runCodexMultiAuthCli(args);
58
- process.exitCode = Number.isInteger(exitCode) ? exitCode : 1;
59
- }
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
+ const { runCodexMultiAuthCli } = await import("../dist/lib/codex-manager.js");
57
+ const exitCode = await runCodexMultiAuthCli(args);
58
+ process.exitCode = Number.isInteger(exitCode) ? exitCode : 1;
59
+ }
@@ -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 };