Files
openclaw/src/agents/cli-auth.test-support.ts
Peter Steinberger 3ea45589ba refactor(agents): trim CLI and transport export seams (#108309)
* refactor(agents): trim CLI and transport export seams

* chore(deadcode): shrink agents CLI transport baseline
2026-07-15 14:02:29 +01:00

28 lines
655 B
TypeScript

import "./cli-credentials.js";
type CliAuthOptions = {
codexHome?: string;
allowKeychainPrompt?: boolean;
platform?: NodeJS.Platform;
execSync?: (...args: never[]) => unknown;
};
type CliAuthTestApi = {
readCodexAuth(options?: CliAuthOptions): unknown;
resetCaches(): void;
};
function getTestApi(): CliAuthTestApi {
return (globalThis as Record<PropertyKey, unknown>)[
Symbol.for("openclaw.cliCredentialsTestApi")
] as CliAuthTestApi;
}
export function readCodexAuth(options?: CliAuthOptions): unknown {
return getTestApi().readCodexAuth(options);
}
export function resetCliAuthCaches(): void {
getTestApi().resetCaches();
}