oc-chatgpt-multi-auth 5.3.0 → 5.3.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.
package/package.json CHANGED
@@ -1,106 +1,106 @@
1
- {
2
- "name": "oc-chatgpt-multi-auth",
3
- "version": "5.3.0",
4
- "description": "Multi-account rotation plugin for ChatGPT Plus/Pro (OAuth / Codex backend)",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "type": "module",
8
- "license": "MIT",
9
- "author": "Numman Ali",
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/ndycode/oc-chatgpt-multi-auth.git"
13
- },
14
- "keywords": [
15
- "opencode",
16
- "openai",
17
- "codex",
18
- "chatgpt",
19
- "oauth",
20
- "gpt-5",
21
- "plugin",
22
- "auth",
23
- "chatgpt-plus",
24
- "chatgpt-pro",
25
- "multi-account"
26
- ],
27
- "homepage": "https://github.com/ndycode/oc-chatgpt-multi-auth#readme",
28
- "bugs": {
29
- "url": "https://github.com/ndycode/oc-chatgpt-multi-auth/issues"
30
- },
31
- "scripts": {
32
- "build": "tsc && node scripts/copy-oauth-success.js",
33
- "typecheck": "tsc --noEmit",
34
- "lint": "npm run lint:ts && npm run lint:scripts",
35
- "lint:ts": "eslint . --ext .ts",
36
- "lint:scripts": "eslint scripts --ext .js",
37
- "lint:fix": "npm run lint:ts:fix && npm run lint:scripts:fix",
38
- "lint:ts:fix": "eslint . --ext .ts --fix",
39
- "lint:scripts:fix": "eslint scripts --ext .js --fix",
40
- "test": "vitest run",
41
- "test:watch": "vitest",
42
- "test:ui": "vitest --ui",
43
- "test:coverage": "vitest run --coverage",
44
- "coverage": "vitest run --coverage",
45
- "audit:prod": "npm audit --omit=dev --audit-level=high",
46
- "audit:all": "npm audit --audit-level=high",
47
- "audit:dev:allowlist": "node scripts/audit-dev-allowlist.js",
48
- "audit:ci": "npm run audit:prod && npm run audit:dev:allowlist",
49
- "prepublishOnly": "npm run build",
50
- "prepare": "husky"
51
- },
52
- "bin": {
53
- "oc-chatgpt-multi-auth": "scripts/install-opencode-codex-auth.js"
54
- },
55
- "files": [
56
- "dist/",
57
- "assets/",
58
- "config/",
59
- "scripts/",
60
- "README.md",
61
- "LICENSE"
62
- ],
63
- "lint-staged": {
64
- "*.ts": [
65
- "eslint --max-warnings=0 --fix --no-warn-ignored"
66
- ],
67
- "scripts/**/*.js": [
68
- "eslint --max-warnings=0 --fix --no-warn-ignored"
69
- ]
70
- },
71
- "engines": {
72
- "node": ">=18.0.0"
73
- },
74
- "peerDependencies": {
75
- "typescript": "^5"
76
- },
77
- "devDependencies": {
78
- "@fast-check/vitest": "^0.2.4",
79
- "@opencode-ai/sdk": "^1.2.10",
80
- "@types/node": "^25.3.0",
81
- "@typescript-eslint/eslint-plugin": "^8.56.0",
82
- "@typescript-eslint/parser": "^8.56.0",
83
- "@vitest/coverage-v8": "^4.0.18",
84
- "@vitest/ui": "^4.0.18",
85
- "eslint": "^10.0.0",
86
- "fast-check": "^4.5.3",
87
- "husky": "^9.1.7",
88
- "lint-staged": "^16.2.7",
89
- "typescript": "^5.9.3",
90
- "typescript-language-server": "^5.1.3",
91
- "vitest": "^4.0.18"
92
- },
93
- "dependencies": {
94
- "@openauthjs/openauth": "^0.4.3",
95
- "@opencode-ai/plugin": "^1.2.9",
96
- "hono": "^4.12.0",
97
- "zod": "^4.3.6"
98
- },
99
- "overrides": {
100
- "hono": "^4.12.0",
101
- "vite": "^7.3.1",
102
- "@typescript-eslint/typescript-estree": {
103
- "minimatch": "^9.0.5"
104
- }
105
- }
106
- }
1
+ {
2
+ "name": "oc-chatgpt-multi-auth",
3
+ "version": "5.3.2",
4
+ "description": "Multi-account rotation plugin for ChatGPT Plus/Pro (OAuth / Codex backend)",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "type": "module",
8
+ "license": "MIT",
9
+ "author": "Numman Ali",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/ndycode/oc-chatgpt-multi-auth.git"
13
+ },
14
+ "keywords": [
15
+ "opencode",
16
+ "openai",
17
+ "codex",
18
+ "chatgpt",
19
+ "oauth",
20
+ "gpt-5",
21
+ "plugin",
22
+ "auth",
23
+ "chatgpt-plus",
24
+ "chatgpt-pro",
25
+ "multi-account"
26
+ ],
27
+ "homepage": "https://github.com/ndycode/oc-chatgpt-multi-auth#readme",
28
+ "bugs": {
29
+ "url": "https://github.com/ndycode/oc-chatgpt-multi-auth/issues"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc && node scripts/copy-oauth-success.js",
33
+ "typecheck": "tsc --noEmit",
34
+ "lint": "npm run lint:ts && npm run lint:scripts",
35
+ "lint:ts": "eslint . --ext .ts",
36
+ "lint:scripts": "eslint scripts --ext .js",
37
+ "lint:fix": "npm run lint:ts:fix && npm run lint:scripts:fix",
38
+ "lint:ts:fix": "eslint . --ext .ts --fix",
39
+ "lint:scripts:fix": "eslint scripts --ext .js --fix",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
42
+ "test:ui": "vitest --ui",
43
+ "test:coverage": "vitest run --coverage",
44
+ "coverage": "vitest run --coverage",
45
+ "audit:prod": "npm audit --omit=dev --audit-level=high",
46
+ "audit:all": "npm audit --audit-level=high",
47
+ "audit:dev:allowlist": "node scripts/audit-dev-allowlist.js",
48
+ "audit:ci": "npm run audit:prod && npm run audit:dev:allowlist",
49
+ "prepublishOnly": "npm run build",
50
+ "prepare": "husky"
51
+ },
52
+ "bin": {
53
+ "oc-chatgpt-multi-auth": "scripts/install-opencode-codex-auth.js"
54
+ },
55
+ "files": [
56
+ "dist/",
57
+ "assets/",
58
+ "config/",
59
+ "scripts/",
60
+ "README.md",
61
+ "LICENSE"
62
+ ],
63
+ "lint-staged": {
64
+ "*.ts": [
65
+ "eslint --max-warnings=0 --fix --no-warn-ignored"
66
+ ],
67
+ "scripts/**/*.js": [
68
+ "eslint --max-warnings=0 --fix --no-warn-ignored"
69
+ ]
70
+ },
71
+ "engines": {
72
+ "node": ">=18.0.0"
73
+ },
74
+ "peerDependencies": {
75
+ "typescript": "^5"
76
+ },
77
+ "devDependencies": {
78
+ "@fast-check/vitest": "^0.2.4",
79
+ "@opencode-ai/sdk": "^1.2.10",
80
+ "@types/node": "^25.3.0",
81
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
82
+ "@typescript-eslint/parser": "^8.56.0",
83
+ "@vitest/coverage-v8": "^4.0.18",
84
+ "@vitest/ui": "^4.0.18",
85
+ "eslint": "^10.0.0",
86
+ "fast-check": "^4.5.3",
87
+ "husky": "^9.1.7",
88
+ "lint-staged": "^16.2.7",
89
+ "typescript": "^5.9.3",
90
+ "typescript-language-server": "^5.1.3",
91
+ "vitest": "^4.0.18"
92
+ },
93
+ "dependencies": {
94
+ "@openauthjs/openauth": "^0.4.3",
95
+ "@opencode-ai/plugin": "^1.2.9",
96
+ "hono": "^4.12.0",
97
+ "zod": "^4.3.6"
98
+ },
99
+ "overrides": {
100
+ "hono": "^4.12.0",
101
+ "vite": "^7.3.1",
102
+ "@typescript-eslint/typescript-estree": {
103
+ "minimatch": "^9.0.5"
104
+ }
105
+ }
106
+ }
@@ -1,114 +1,114 @@
1
- #!/usr/bin/env node
2
-
3
- import { execSync } from "node:child_process";
4
-
5
- const ALLOWED_HIGH_OR_CRITICAL_PACKAGES = new Set([
6
- "eslint",
7
- "ajv",
8
- "@eslint-community/eslint-utils",
9
- "@typescript-eslint/eslint-plugin",
10
- "@typescript-eslint/parser",
11
- "@typescript-eslint/type-utils",
12
- "@typescript-eslint/typescript-estree",
13
- "@typescript-eslint/utils",
14
- "minimatch",
15
- ]);
16
-
17
- function summarizeVia(via) {
18
- if (!Array.isArray(via)) return [];
19
- return via
20
- .map((item) => {
21
- if (typeof item === "string") return item;
22
- if (!item || typeof item !== "object") return "unknown";
23
- const name = typeof item.name === "string" ? item.name : "unknown";
24
- const range = typeof item.range === "string" ? item.range : "";
25
- return range ? `${name}:${range}` : name;
26
- })
27
- .slice(0, 5);
28
- }
29
-
30
- let rawAuditOutput = "";
31
- try {
32
- rawAuditOutput = execSync("npm audit --json", {
33
- encoding: "utf8",
34
- stdio: ["ignore", "pipe", "pipe"],
35
- }).trim();
36
- } catch (error) {
37
- const execError = error;
38
- const stdout =
39
- execError &&
40
- typeof execError === "object" &&
41
- "stdout" in execError &&
42
- typeof execError.stdout === "string"
43
- ? execError.stdout
44
- : "";
45
- const stderr =
46
- execError &&
47
- typeof execError === "object" &&
48
- "stderr" in execError &&
49
- typeof execError.stderr === "string"
50
- ? execError.stderr
51
- : "";
52
- rawAuditOutput = stdout.trim() || stderr.trim();
53
- }
54
-
55
- if (!rawAuditOutput) {
56
- console.error("Failed to read npm audit JSON output.");
57
- process.exit(1);
58
- }
59
-
60
- let auditJson;
61
- try {
62
- auditJson = JSON.parse(rawAuditOutput.replace(/^\uFEFF/, ""));
63
- } catch (error) {
64
- console.error("Failed to parse npm audit JSON output.");
65
- console.error(error instanceof Error ? error.message : String(error));
66
- process.exit(1);
67
- }
68
-
69
- const vulnerabilities =
70
- auditJson && typeof auditJson === "object" && auditJson.vulnerabilities && typeof auditJson.vulnerabilities === "object"
71
- ? auditJson.vulnerabilities
72
- : {};
73
-
74
- const unexpected = [];
75
- const allowlisted = [];
76
-
77
- for (const [name, details] of Object.entries(vulnerabilities)) {
78
- if (!details || typeof details !== "object") continue;
79
- const severity = typeof details.severity === "string" ? details.severity : "unknown";
80
- if (severity !== "high" && severity !== "critical") continue;
81
-
82
- const entry = {
83
- name,
84
- severity,
85
- via: summarizeVia(details.via),
86
- fixAvailable: details.fixAvailable ?? false,
87
- };
88
-
89
- if (ALLOWED_HIGH_OR_CRITICAL_PACKAGES.has(name)) {
90
- allowlisted.push(entry);
91
- continue;
92
- }
93
- unexpected.push(entry);
94
- }
95
-
96
- if (unexpected.length > 0) {
97
- console.error("Unexpected high/critical vulnerabilities detected in dev dependency audit:");
98
- for (const entry of unexpected) {
99
- console.error(
100
- `- ${entry.name} (${entry.severity}) via ${entry.via.join(", ") || "unknown"} fixAvailable=${String(entry.fixAvailable)}`,
101
- );
102
- }
103
- process.exit(1);
104
- }
105
-
106
- if (allowlisted.length > 0) {
107
- console.warn("Allowlisted high/critical dev vulnerabilities detected:");
108
- for (const entry of allowlisted) {
109
- console.warn(
110
- `- ${entry.name} (${entry.severity}) via ${entry.via.join(", ") || "unknown"} fixAvailable=${String(entry.fixAvailable)}`,
111
- );
112
- }
113
- console.warn("No unexpected high/critical vulnerabilities found.");
114
- }
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync } from "node:child_process";
4
+
5
+ const ALLOWED_HIGH_OR_CRITICAL_PACKAGES = new Set([
6
+ "eslint",
7
+ "ajv",
8
+ "@eslint-community/eslint-utils",
9
+ "@typescript-eslint/eslint-plugin",
10
+ "@typescript-eslint/parser",
11
+ "@typescript-eslint/type-utils",
12
+ "@typescript-eslint/typescript-estree",
13
+ "@typescript-eslint/utils",
14
+ "minimatch",
15
+ ]);
16
+
17
+ function summarizeVia(via) {
18
+ if (!Array.isArray(via)) return [];
19
+ return via
20
+ .map((item) => {
21
+ if (typeof item === "string") return item;
22
+ if (!item || typeof item !== "object") return "unknown";
23
+ const name = typeof item.name === "string" ? item.name : "unknown";
24
+ const range = typeof item.range === "string" ? item.range : "";
25
+ return range ? `${name}:${range}` : name;
26
+ })
27
+ .slice(0, 5);
28
+ }
29
+
30
+ let rawAuditOutput = "";
31
+ try {
32
+ rawAuditOutput = execSync("npm audit --json", {
33
+ encoding: "utf8",
34
+ stdio: ["ignore", "pipe", "pipe"],
35
+ }).trim();
36
+ } catch (error) {
37
+ const execError = error;
38
+ const stdout =
39
+ execError &&
40
+ typeof execError === "object" &&
41
+ "stdout" in execError &&
42
+ typeof execError.stdout === "string"
43
+ ? execError.stdout
44
+ : "";
45
+ const stderr =
46
+ execError &&
47
+ typeof execError === "object" &&
48
+ "stderr" in execError &&
49
+ typeof execError.stderr === "string"
50
+ ? execError.stderr
51
+ : "";
52
+ rawAuditOutput = stdout.trim() || stderr.trim();
53
+ }
54
+
55
+ if (!rawAuditOutput) {
56
+ console.error("Failed to read npm audit JSON output.");
57
+ process.exit(1);
58
+ }
59
+
60
+ let auditJson;
61
+ try {
62
+ auditJson = JSON.parse(rawAuditOutput.replace(/^\uFEFF/, ""));
63
+ } catch (error) {
64
+ console.error("Failed to parse npm audit JSON output.");
65
+ console.error(error instanceof Error ? error.message : String(error));
66
+ process.exit(1);
67
+ }
68
+
69
+ const vulnerabilities =
70
+ auditJson && typeof auditJson === "object" && auditJson.vulnerabilities && typeof auditJson.vulnerabilities === "object"
71
+ ? auditJson.vulnerabilities
72
+ : {};
73
+
74
+ const unexpected = [];
75
+ const allowlisted = [];
76
+
77
+ for (const [name, details] of Object.entries(vulnerabilities)) {
78
+ if (!details || typeof details !== "object") continue;
79
+ const severity = typeof details.severity === "string" ? details.severity : "unknown";
80
+ if (severity !== "high" && severity !== "critical") continue;
81
+
82
+ const entry = {
83
+ name,
84
+ severity,
85
+ via: summarizeVia(details.via),
86
+ fixAvailable: details.fixAvailable ?? false,
87
+ };
88
+
89
+ if (ALLOWED_HIGH_OR_CRITICAL_PACKAGES.has(name)) {
90
+ allowlisted.push(entry);
91
+ continue;
92
+ }
93
+ unexpected.push(entry);
94
+ }
95
+
96
+ if (unexpected.length > 0) {
97
+ console.error("Unexpected high/critical vulnerabilities detected in dev dependency audit:");
98
+ for (const entry of unexpected) {
99
+ console.error(
100
+ `- ${entry.name} (${entry.severity}) via ${entry.via.join(", ") || "unknown"} fixAvailable=${String(entry.fixAvailable)}`,
101
+ );
102
+ }
103
+ process.exit(1);
104
+ }
105
+
106
+ if (allowlisted.length > 0) {
107
+ console.warn("Allowlisted high/critical dev vulnerabilities detected:");
108
+ for (const entry of allowlisted) {
109
+ console.warn(
110
+ `- ${entry.name} (${entry.severity}) via ${entry.via.join(", ") || "unknown"} fixAvailable=${String(entry.fixAvailable)}`,
111
+ );
112
+ }
113
+ console.warn("No unexpected high/critical vulnerabilities found.");
114
+ }
@@ -1,37 +1,37 @@
1
- import { promises as fs } from "node:fs";
2
- import { dirname, join, 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 normalizePathForCompare(path) {
9
- const resolved = resolve(path);
10
- return process.platform === "win32" ? resolved.toLowerCase() : resolved;
11
- }
12
-
13
- function getDefaultPaths() {
14
- const src = join(__dirname, "..", "lib", "oauth-success.html");
15
- const dest = join(__dirname, "..", "dist", "lib", "oauth-success.html");
16
- return { src, dest };
17
- }
18
-
19
- export async function copyOAuthSuccessHtml(options = {}) {
20
- const defaults = getDefaultPaths();
21
- const src = options.src ?? defaults.src;
22
- const dest = options.dest ?? defaults.dest;
23
-
24
- await fs.mkdir(dirname(dest), { recursive: true });
25
- await fs.copyFile(src, dest);
26
-
27
- return { src, dest };
28
- }
29
-
30
- const isDirectRun = (() => {
31
- if (!process.argv[1]) return false;
32
- return normalizePathForCompare(process.argv[1]) === normalizePathForCompare(__filename);
33
- })();
34
-
35
- if (isDirectRun) {
36
- await copyOAuthSuccessHtml();
37
- }
1
+ import { promises as fs } from "node:fs";
2
+ import { dirname, join, 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 normalizePathForCompare(path) {
9
+ const resolved = resolve(path);
10
+ return process.platform === "win32" ? resolved.toLowerCase() : resolved;
11
+ }
12
+
13
+ function getDefaultPaths() {
14
+ const src = join(__dirname, "..", "lib", "oauth-success.html");
15
+ const dest = join(__dirname, "..", "dist", "lib", "oauth-success.html");
16
+ return { src, dest };
17
+ }
18
+
19
+ export async function copyOAuthSuccessHtml(options = {}) {
20
+ const defaults = getDefaultPaths();
21
+ const src = options.src ?? defaults.src;
22
+ const dest = options.dest ?? defaults.dest;
23
+
24
+ await fs.mkdir(dirname(dest), { recursive: true });
25
+ await fs.copyFile(src, dest);
26
+
27
+ return { src, dest };
28
+ }
29
+
30
+ const isDirectRun = (() => {
31
+ if (!process.argv[1]) return false;
32
+ return normalizePathForCompare(process.argv[1]) === normalizePathForCompare(__filename);
33
+ })();
34
+
35
+ if (isDirectRun) {
36
+ await copyOAuthSuccessHtml();
37
+ }