/** Stores MCP OAuth state used to bind hosted-auth callbacks back to runtime sessions. */
import type { OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
import type { AuthCredential, AuthStorageData } from './auth-storage.js';
export interface OAuthClientInformationRecord {
    clientId: string;
    clientSecret?: string;
}
export type OAuthDiscoveryRecord = OAuthDiscoveryState;
export interface McpOAuthAgentSettings {
    credentialsStoreMode?: 'file' | 'keychain' | 'auto';
    callbackPort?: number;
    callbackUrl?: string;
}
type OAuthStorageManifest = Record<string, 'keychain'>;
export interface ParsedMcpOAuthState {
    credentials: AuthStorageData;
    clientInfo: Record<string, OAuthClientInformationRecord>;
    discoveryInfo: Record<string, OAuthDiscoveryRecord>;
    storageManifest: OAuthStorageManifest;
}
export interface StoredMcpOAuthPayload {
    credential?: AuthCredential;
    clientInfo?: OAuthClientInformationRecord;
    discoveryInfo?: OAuthDiscoveryRecord;
}
export declare class McpOAuthPersistence {
    private readonly isManagedProvider;
    private settings;
    constructor(isManagedProvider?: (provider: string) => boolean);
    configure(settings: McpOAuthAgentSettings | undefined): void;
    getSettings(): Required<McpOAuthAgentSettings>;
    shouldUseKeychain(provider: string): boolean;
    load(content: string | undefined): ParsedMcpOAuthState;
    loadOrEmpty(content: string | undefined): ParsedMcpOAuthState;
    loadProviderPayload(provider: string): StoredMcpOAuthPayload | undefined;
    getProviderPayload(state: ParsedMcpOAuthState, provider: string): StoredMcpOAuthPayload;
    writeProviderPayload(baseState: ParsedMcpOAuthState, provider: string, nextPayload: StoredMcpOAuthPayload): string;
    private resolveStoreMode;
    private empty;
    private hydrate;
    private parse;
    private serialize;
}
export {};
//# sourceMappingURL=mcp-oauth-state.d.ts.map