/** * Login Manager * * Handles the OAuth PKCE login flow and API key authentication * for Cursor's authentication system. */ export declare const CURSOR_WEBSITE_URL = "https://cursor.com"; export declare const CURSOR_API_BASE_URL = "https://api2.cursor.sh"; export declare const POLLING_ENDPOINT = "https://api2.cursor.sh/auth/poll"; export interface AuthResult { accessToken: string; refreshToken: string; } export interface AuthParams { uuid: string; challenge: string; verifier: string; loginUrl: string; } export interface LoginMetadata { uuid: string; verifier: string; } /** * Generate authentication parameters (PKCE flow) */ export declare function generateAuthParams(): AuthParams; /** * Open a URL in the default browser */ export declare function openBrowser(url: string): Promise; export declare class LoginManager { /** * Start the OAuth login flow * Returns metadata needed for polling and the URL to open in browser */ startLogin(): { metadata: LoginMetadata; loginUrl: string; }; /** * Poll for authentication result * This waits for the user to complete the browser login */ waitForResult(metadata: LoginMetadata, options?: { maxAttempts?: number; onProgress?: (attempt: number) => void; }): Promise; /** * Exchange API key for access/refresh tokens */ loginWithApiKey(apiKey: string, options?: { endpoint?: string; }): Promise; }