fix(auth): lazy-load provider oauth helpers

This commit is contained in:
Vincent Koc
2026-03-18 13:40:28 -07:00
parent 6ebcd853be
commit 91d37ccfc3
12 changed files with 53 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
export { loginChutes } from "../commands/chutes-oauth.js";
export { loginOpenAICodexOAuth } from "../plugins/provider-openai-codex-oauth.js";
export { githubCopilotLoginCommand } from "../providers/github-copilot-auth.js";

View File

@@ -1,5 +1,16 @@
// Public interactive auth/login helpers for provider plugins.
export { githubCopilotLoginCommand } from "../providers/github-copilot-auth.js";
export { loginChutes } from "../commands/chutes-oauth.js";
export { loginOpenAICodexOAuth } from "../plugins/provider-openai-codex-oauth.js";
import { createLazyRuntimeMethodBinder, createLazyRuntimeModule } from "../shared/lazy-runtime.js";
const loadProviderAuthLoginRuntime = createLazyRuntimeModule(
() => import("./provider-auth-login.runtime.js"),
);
const bindProviderAuthLoginRuntime = createLazyRuntimeMethodBinder(loadProviderAuthLoginRuntime);
export const githubCopilotLoginCommand = bindProviderAuthLoginRuntime(
(runtime) => runtime.githubCopilotLoginCommand,
);
export const loginChutes = bindProviderAuthLoginRuntime((runtime) => runtime.loginChutes);
export const loginOpenAICodexOAuth = bindProviderAuthLoginRuntime(
(runtime) => runtime.loginOpenAICodexOAuth,
);