feat: publish codex retry gateway

This commit is contained in:
fleetingtime20026
2026-06-26 10:07:55 +08:00
commit 9cc6bc9b31
31 changed files with 4674 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env node
import {
DEFAULT_CODEX_CONFIG_PATH,
DEFAULT_LISTEN_HOST,
DEFAULT_LISTEN_PORT,
DEFAULT_STATE_ROOT,
installForCurrentProvider,
parseOptions,
} from "./admin-lib.mjs";
async function main() {
const options = parseOptions(process.argv);
const result = await installForCurrentProvider({
codexConfigPath: options.codexConfigPath || DEFAULT_CODEX_CONFIG_PATH,
stateRoot: options.stateRoot || DEFAULT_STATE_ROOT,
listenHost: options.listenHost || DEFAULT_LISTEN_HOST,
listenPort: options.listenPort ? Number.parseInt(`${options.listenPort}`, 10) : DEFAULT_LISTEN_PORT,
});
process.stdout.write("Installed Codex Retry Gateway\n");
process.stdout.write(`provider=${result.provider}\n`);
process.stdout.write(`upstream=${result.upstream}\n`);
process.stdout.write(`gateway=${result.gateway}\n`);
process.stdout.write(`config=${result.configPath}\n`);
process.stdout.write(`backup=${result.backupPath}\n`);
}
main().catch((error) => {
process.stderr.write(`${error?.stack || error}\n`);
process.exit(1);
});