/**
 * MCP Auth Storage Module
 *
 * Handles secure storage of OAuth credentials, tokens, client information,
 * and PKCE state for MCP servers. Maintains backward compatibility with
 * per-server directory structure.
 *
 * Token storage location: $MCP_OAUTH_DIR/<server>/tokens.json when set,
 * otherwise <Pi agent dir>/mcp-oauth/<server>/tokens.json
 */
/** OAuth token storage format */
export interface StoredTokens {
    accessToken: string;
    refreshToken?: string;
    expiresAt?: number;
    scope?: string;
}
/** OAuth client information from dynamic or static registration */
export interface StoredClientInfo {
    clientId: string;
    clientSecret?: string;
    clientIdIssuedAt?: number;
    clientSecretExpiresAt?: number;
}
/** Complete auth entry for a server */
export interface AuthEntry {
    tokens?: StoredTokens;
    clientInfo?: StoredClientInfo;
    codeVerifier?: string;
    oauthState?: string;
    serverUrl?: string;
}
/**
 * Get auth entry for a server.
 */
export declare function getAuthEntry(serverName: string): AuthEntry | undefined;
/**
 * Get auth entry and validate it's for the correct URL.
 * Returns undefined if URL has changed (credentials are invalid).
 */
export declare function getAuthForUrl(serverName: string, serverUrl: string): AuthEntry | undefined;
/**
 * Save auth entry for a server.
 */
export declare function saveAuthEntry(serverName: string, entry: AuthEntry, serverUrl?: string): void;
/**
 * Remove auth entry for a server.
 * Also removes the server directory if empty.
 */
export declare function removeAuthEntry(serverName: string): void;
/**
 * Update tokens for a server.
 */
export declare function updateTokens(serverName: string, tokens: StoredTokens, serverUrl?: string): void;
/**
 * Update client info for a server.
 */
export declare function updateClientInfo(serverName: string, clientInfo: StoredClientInfo, serverUrl?: string): void;
/**
 * Update code verifier for a server.
 */
export declare function updateCodeVerifier(serverName: string, codeVerifier: string): void;
/**
 * Clear code verifier for a server.
 */
export declare function clearCodeVerifier(serverName: string): void;
/**
 * Update OAuth state for a server.
 */
export declare function updateOAuthState(serverName: string, state: string): void;
/**
 * Get OAuth state for a server.
 */
export declare function getOAuthState(serverName: string): string | undefined;
/**
 * Clear OAuth state for a server.
 */
export declare function clearOAuthState(serverName: string): void;
/**
 * Check if stored tokens are expired.
 * Returns null if no tokens exist, false if no expiry or not expired, true if expired.
 */
export declare function isTokenExpired(serverName: string): boolean | null;
/**
 * Check if a server has stored tokens.
 */
export declare function hasStoredTokens(serverName: string): boolean;
/**
 * Clear all credentials for a server.
 */
export declare function clearAllCredentials(serverName: string): void;
/**
 * Clear only client info for a server.
 */
export declare function clearClientInfo(serverName: string): void;
/**
 * Clear only tokens for a server.
 */
export declare function clearTokens(serverName: string): void;
//# sourceMappingURL=mcp-auth.d.ts.map