codex-multi-auth 2.1.8 → 2.1.10
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 +413 -411
- package/dist/lib/accounts.d.ts +2 -0
- package/dist/lib/accounts.d.ts.map +1 -1
- package/dist/lib/accounts.js +26 -2
- package/dist/lib/accounts.js.map +1 -1
- package/dist/lib/auth/device-auth.d.ts +1 -0
- package/dist/lib/auth/device-auth.d.ts.map +1 -1
- package/dist/lib/auth/device-auth.js +6 -2
- package/dist/lib/auth/device-auth.js.map +1 -1
- package/dist/lib/codex-manager/commands/forecast.d.ts +5 -1
- package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/forecast.js +14 -1
- package/dist/lib/codex-manager/commands/forecast.js.map +1 -1
- package/dist/lib/codex-manager/commands/report.d.ts +2 -0
- package/dist/lib/codex-manager/commands/report.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/report.js +17 -1
- package/dist/lib/codex-manager/commands/report.js.map +1 -1
- package/dist/lib/codex-manager/commands/rotation.d.ts +1 -1
- package/dist/lib/codex-manager/commands/rotation.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/rotation.js +71 -1
- package/dist/lib/codex-manager/commands/rotation.js.map +1 -1
- package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -1
- package/dist/lib/codex-manager/repair-commands.js +35 -0
- package/dist/lib/codex-manager/repair-commands.js.map +1 -1
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +36 -2
- package/dist/lib/codex-manager.js.map +1 -1
- package/dist/lib/forecast.d.ts +9 -0
- package/dist/lib/forecast.d.ts.map +1 -1
- package/dist/lib/forecast.js +36 -0
- package/dist/lib/forecast.js.map +1 -1
- package/dist/lib/runtime/runtime-observability.d.ts +17 -0
- package/dist/lib/runtime/runtime-observability.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-observability.js +48 -0
- package/dist/lib/runtime/runtime-observability.js.map +1 -1
- package/dist/lib/runtime-rotation-proxy.d.ts +1 -0
- package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -1
- package/dist/lib/runtime-rotation-proxy.js +119 -20
- package/dist/lib/runtime-rotation-proxy.js.map +1 -1
- package/package.json +193 -185
- package/scripts/audit-dev-allowlist.js +0 -220
- package/scripts/bench-format/codex-host.mjs +0 -275
- package/scripts/bench-format/hashline-v2.mjs +0 -642
- package/scripts/bench-format/models.mjs +0 -110
- package/scripts/bench-format/render.mjs +0 -496
- package/scripts/bench-format/stats.mjs +0 -54
- package/scripts/bench-format/tasks.mjs +0 -151
- package/scripts/benchmark-edit-formats.mjs +0 -1164
- package/scripts/benchmark-render-dashboard.mjs +0 -49
- package/scripts/benchmark-runtime-path.mjs +0 -166
- package/scripts/check-pack-budget-lib.js +0 -157
- package/scripts/check-pack-budget.mjs +0 -10
- package/scripts/copy-oauth-success.js +0 -76
- package/scripts/install-codex-auth.js +0 -258
- package/scripts/repo-hygiene.js +0 -320
- package/scripts/test-all-models.sh +0 -7
- package/scripts/test-model-matrix.js +0 -687
- package/scripts/update-vendor-provenance.mjs +0 -96
- package/scripts/validate-model-map.sh +0 -7
- package/scripts/verify-vendor-provenance.mjs +0 -53
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
4
|
-
|
|
5
|
-
const components = [
|
|
6
|
-
{
|
|
7
|
-
name: "@codex-ai/plugin",
|
|
8
|
-
root: "vendor/codex-ai-plugin",
|
|
9
|
-
source: "vendored dist shim",
|
|
10
|
-
files: [
|
|
11
|
-
"vendor/codex-ai-plugin/package.json",
|
|
12
|
-
"vendor/codex-ai-plugin/dist/index.js",
|
|
13
|
-
"vendor/codex-ai-plugin/dist/index.d.ts",
|
|
14
|
-
"vendor/codex-ai-plugin/dist/tool.js",
|
|
15
|
-
"vendor/codex-ai-plugin/dist/tool.d.ts",
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "@codex-ai/sdk",
|
|
20
|
-
root: "vendor/codex-ai-sdk",
|
|
21
|
-
source: "vendored dist shim",
|
|
22
|
-
files: [
|
|
23
|
-
"vendor/codex-ai-sdk/package.json",
|
|
24
|
-
"vendor/codex-ai-sdk/dist/index.js",
|
|
25
|
-
"vendor/codex-ai-sdk/dist/index.d.ts",
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
async function loadExistingManifest() {
|
|
31
|
-
try {
|
|
32
|
-
const content = await readFile("vendor/provenance.json", "utf8");
|
|
33
|
-
const parsed = JSON.parse(content);
|
|
34
|
-
return Array.isArray(parsed?.components) ? parsed : { components: [] };
|
|
35
|
-
} catch {
|
|
36
|
-
return { components: [] };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function hashFile(path) {
|
|
41
|
-
const content = await readFile(path);
|
|
42
|
-
return createHash("sha256").update(content).digest("hex");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const existingManifest = await loadExistingManifest();
|
|
46
|
-
const existingFiles = Object.fromEntries(
|
|
47
|
-
existingManifest.components.flatMap((component) =>
|
|
48
|
-
Array.isArray(component.files)
|
|
49
|
-
? component.files
|
|
50
|
-
.filter(
|
|
51
|
-
(file) =>
|
|
52
|
-
file &&
|
|
53
|
-
typeof file === "object" &&
|
|
54
|
-
typeof file.path === "string",
|
|
55
|
-
)
|
|
56
|
-
.map((file) => [file.path, file])
|
|
57
|
-
: [],
|
|
58
|
-
),
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const manifest = {
|
|
62
|
-
generatedAt: new Date().toISOString().slice(0, 10),
|
|
63
|
-
components: [],
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
for (const component of components) {
|
|
67
|
-
const packageJson = JSON.parse(
|
|
68
|
-
await readFile(`${component.root}/package.json`, "utf8"),
|
|
69
|
-
);
|
|
70
|
-
manifest.components.push({
|
|
71
|
-
name: component.name,
|
|
72
|
-
version: packageJson.version,
|
|
73
|
-
source: component.source,
|
|
74
|
-
root: component.root,
|
|
75
|
-
files: await Promise.all(
|
|
76
|
-
component.files.map(async (path) => {
|
|
77
|
-
const prior = existingFiles[path] ?? {};
|
|
78
|
-
const { path: _priorPath, sha256: _priorHash, ...extra } = prior;
|
|
79
|
-
return {
|
|
80
|
-
path,
|
|
81
|
-
sha256: await hashFile(path),
|
|
82
|
-
...extra,
|
|
83
|
-
};
|
|
84
|
-
}),
|
|
85
|
-
),
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
await writeFile(
|
|
90
|
-
"vendor/provenance.json",
|
|
91
|
-
`${JSON.stringify(manifest, null, 2)}\n`,
|
|
92
|
-
"utf8",
|
|
93
|
-
);
|
|
94
|
-
console.log(
|
|
95
|
-
`Updated vendor/provenance.json for ${manifest.components.length} component(s)`,
|
|
96
|
-
);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
-
|
|
5
|
-
const manifest = JSON.parse(
|
|
6
|
-
await readFile(new URL("../vendor/provenance.json", import.meta.url), "utf8"),
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
if (!manifest || !Array.isArray(manifest.components)) {
|
|
10
|
-
throw new Error("vendor/provenance.json is missing a valid components array");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
for (const component of manifest.components) {
|
|
14
|
-
if (
|
|
15
|
-
!component ||
|
|
16
|
-
!Array.isArray(component.files) ||
|
|
17
|
-
component.files.length === 0
|
|
18
|
-
) {
|
|
19
|
-
throw new Error(
|
|
20
|
-
`Component provenance entry is invalid: ${JSON.stringify(component)}`,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
for (const file of component.files) {
|
|
24
|
-
if (!file?.path || !file?.sha256) {
|
|
25
|
-
throw new Error(`Invalid file provenance entry in ${component.name}`);
|
|
26
|
-
}
|
|
27
|
-
let content;
|
|
28
|
-
try {
|
|
29
|
-
content = await readFile(new URL(`../${file.path}`, import.meta.url));
|
|
30
|
-
} catch (error) {
|
|
31
|
-
const code =
|
|
32
|
-
error && typeof error === "object"
|
|
33
|
-
? /** @type {{ code?: string }} */ (error).code
|
|
34
|
-
: undefined;
|
|
35
|
-
if (code === "ENOENT") {
|
|
36
|
-
throw new Error(
|
|
37
|
-
`Vendor file not found in ${component.name}: ${file.path} (${code})`,
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
const actual = createHash("sha256").update(content).digest("hex");
|
|
43
|
-
if (actual !== file.sha256) {
|
|
44
|
-
throw new Error(
|
|
45
|
-
`Vendor provenance mismatch for ${file.path}: expected ${file.sha256}, got ${actual}`,
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.log(
|
|
52
|
-
`Vendor provenance ok: ${manifest.components.length} component(s), ${manifest.components.reduce((/** @type {number} */ sum, /** @type {{ files?: unknown[] }} */ component) => sum + (Array.isArray(component.files) ? component.files.length : 0), 0)} file(s) verified`,
|
|
53
|
-
);
|