/** * File-based OAuth token storage. * * Stores tokens at ~/.whoop-mcp/tokens.json with secure file permissions. * Pure I/O module — no dependencies on API client or OAuth flow. */ /** Stored OAuth token set with absolute expiry time */ export interface OAuthTokens { access_token: string; refresh_token: string; /** Unix epoch milliseconds — computed at save time: Date.now() + expires_in * 1000 */ expires_at: number; /** Typically "Bearer" */ token_type: string; } /** * Check whether the given tokens are expired (or within the 60s safety buffer). * * Returns `true` if `expires_at <= Date.now() + EXPIRY_BUFFER_MS`. */ export declare function isTokenExpired(tokens: OAuthTokens): boolean; /** Resolve the configured or default directory shared by OAuth state files. */ export declare function resolveTokenDirectory(tokenDir?: string): string; /** * Save tokens to disk. * * Creates the token directory (0700) if it doesn't exist, then writes * the token file with 0600 (user-only read/write) permissions. */ export declare function saveTokens(tokens: OAuthTokens, tokenDir?: string): Promise; /** * Load tokens from disk. * * Returns the parsed `OAuthTokens` if the file exists and contains valid JSON * with the correct shape. Returns `null` if the file is missing, contains * malformed JSON, or has an invalid shape. Logs the reason to stderr for * diagnostics. */ export declare function loadTokens(tokenDir?: string): Promise; /** * Delete the token file from disk. * * No-op if the file does not exist. */ export declare function deleteTokens(tokenDir?: string): Promise; //# sourceMappingURL=token-store.d.ts.map