/** Interactive-shell auth workflow for login, token storage, and session-bound auth checks. */
import { getOAuthProviders } from '../../ai/utils/oauth/index.js';
import type { Component } from '../../tui/index.js';
import type { AuthWorkflowSessionClient } from '../session-client.js';
type SelectorCreate = (done: () => void) => {
    component: Component;
    focus: Component;
};
interface OAuthSelectorFactoryArgs {
    mode: 'login' | 'logout';
    authStorage: AuthWorkflowSessionClient['modelRegistry']['authStorage'];
    providerOrder?: string[];
    onSelect: (providerId: string) => void | Promise<void>;
    onCancel: () => void;
}
interface LoginDialogLike extends Component {
    signal: AbortSignal;
    showAuth(url: string, instructions?: string): void;
    showWaiting(message: string): void;
    showPrompt(message: string, placeholder?: string): Promise<string | undefined>;
    showProgress(message: string): void;
}
export interface AuthWorkflowDependencies {
    session: AuthWorkflowSessionClient;
    showSelector(create: SelectorCreate): void;
    editorContainer: {
        clear(): void;
        addChild(component: Component): void;
    };
    ui: {
        setFocus(component: Component): void;
        requestRender(): void;
    };
    getEditor(): Component;
    restoreEditorToContainer(): void;
    showStatus(message: string): void;
    showError(message: string): void;
    updateAvailableProviderCount(): Promise<void>;
    refreshCreditBalance(): Promise<void>;
    onModelChanged(): void;
    onProviderLoginStarted?: (providerId: string) => Promise<void> | void;
    onProviderLoggedIn?: (providerId: string, userId?: string) => Promise<void> | void;
    onProviderLoginFailed?: (providerId: string, message: string) => Promise<void> | void;
    onProviderLoggedOut?: (providerId: string) => Promise<void> | void;
    oauthProviderOrder?: string[];
    createOAuthSelector?: (args: OAuthSelectorFactoryArgs) => {
        component: Component;
        focus: Component;
    };
    createLoginDialog?: (providerId: string) => LoginDialogLike;
    getOAuthProviders?: typeof getOAuthProviders;
}
export declare class AuthWorkflow {
    private readonly deps;
    private readonly createOAuthSelectorImpl;
    private readonly createLoginDialogImpl;
    private readonly getOAuthProvidersImpl;
    constructor(deps: AuthWorkflowDependencies);
    showOAuthSelector(mode: 'login' | 'logout'): Promise<void>;
    ensureShortcutAuth(): Promise<void>;
    promptWithLoginRetry(fn: () => Promise<void>): Promise<boolean>;
    showLoginDialog(providerId: string): Promise<void>;
    logoutProvider(providerId: string): Promise<void>;
    autoSwitchToProvider(providerId: string): Promise<void>;
}
export {};
//# sourceMappingURL=auth-workflow.d.ts.map