/**
 * OAuth Process Execution for CLIProxyAPI
 *
 * Handles the spawning and monitoring of CLIProxy OAuth process.
 * Separated from oauth-handler.ts for modularity.
 */
import { CLIProxyProvider } from '../types';
import { AccountInfo } from '../accounts/account-manager';
import { KiroAuthMethod, ProviderOAuthConfig } from './auth-types';
import { type ProviderTokenSnapshot } from './token-manager';
/** Options for OAuth process execution */
export interface OAuthProcessOptions {
    provider: CLIProxyProvider;
    binaryPath: string;
    args: string[];
    tokenDir: string;
    oauthConfig: ProviderOAuthConfig;
    callbackPort: number | null;
    headless: boolean;
    verbose: boolean;
    isCLI: boolean;
    nickname?: string;
    expectedAccountId?: string;
    authFlowType?: 'device_code' | 'authorization_code';
    kiroMethod?: KiroAuthMethod;
    manualCallback?: boolean;
}
export declare function isLoopbackHost(hostname: string): boolean;
export declare function getExpectedLocalCallback(authUrl: string): {
    origin: string;
    pathname: string;
    state: string | null;
} | null;
export declare function validateManualCallbackUrl(callbackUrl: string, authUrl: string): string | null;
export declare function getKiroBuilderIdSelectionInput(output: string): string | null;
export declare function extractLikelyOAuthAuthorizationUrl(output: string): string | null;
export declare function extractLikelyAuthFailureFromLogs(provider: CLIProxyProvider, logData: string): string | null;
export declare function extractLikelyAuthFailureFromStderr(provider: CLIProxyProvider, stderrData: string): string | null;
export declare function analyzeSuccessfulAuthExit(options: {
    provider: CLIProxyProvider;
    knownTokenFiles: ProviderTokenSnapshot[];
    currentTokenFiles: ProviderTokenSnapshot[];
    expectedAccountId?: string;
    stdoutData: string;
    stderrData: string;
}): {
    tokenSnapshot: ProviderTokenSnapshot | null;
    failureReason: string | null;
};
/**
 * Execute OAuth process and wait for completion
 */
export declare function executeOAuthProcess(options: OAuthProcessOptions): Promise<AccountInfo | null>;
//# sourceMappingURL=oauth-process.d.ts.map