export interface SetupTokenPrompt { url: string; prompt: string; } export declare const SETUP_TOKEN_PROMPT = "Paste code here if prompted"; export declare const SETUP_TOKEN_AUTH_URLS: readonly ["https://claude.ai/oauth/authorize", "https://claude.com/cai/oauth/authorize"]; export declare const SETUP_TOKEN_REDIRECT_URI = "https://platform.claude.com/oauth/code/callback"; export declare const SETUP_TOKEN_URL_QUERY_KEYS: readonly ["client_id", "code", "code_challenge", "code_challenge_method", "redirect_uri", "response_type", "scope", "state"]; /** * Parses Claude `setup-token` login output. Removes the terminal control * sequences first, so colored and hyperlinked output reads the same as plain * output. The parser finds the URL preamble, then a physical line that starts the * authorization URL within {@link MAX_PREAMBLE_TO_URL_GAP} characters of the * preamble, then reassembles the wrapped URL and validates the final string, then * binds the browser-code prompt on the dedicated line after the URL block. So the * URL binds to the login context and the prompt binds to the URL. Returns the * authorization URL and the browser-code prompt when both are present and valid. * Returns null for any other input, including a non-string input, an absent * preamble, a URL with a wrong host, path, query, or fragment, an API-key-shaped * URL, and a missing or misplaced prompt. Never throws on input, and never puts * any input byte into a log or an error. This phase returns no token. */ export declare function parseSetupTokenPrompt(text: string): SetupTokenPrompt | null; export declare const SETUP_TOKEN_PREFIX = "sk-ant-oat01-"; export declare const SETUP_TOKEN_BEFORE_ANCHOR = "Your OAuth token (valid for 1 year):"; export declare const SETUP_TOKEN_AFTER_ANCHOR = "Store this token securely. You won't be able to see it again."; /** * Parses the Claude `setup-token` success screen and returns the minted OAuth * token, or null. The parser removes the terminal control sequences first, then * binds the token to the exact success record. It requires the before-anchor * line {@link SETUP_TOKEN_BEFORE_ANCHOR} and the after-anchor line * {@link SETUP_TOKEN_AFTER_ANCHOR}, in that order, exactly one time each. It * reads only the lines between the two anchors. It de-wraps the token: it joins * the fragment lines with no separator, the same way the terminal split one * token across the physical lines. It validates the joined value against the * token shape. * * The parser fails closed for any other input. It returns null for a * token-shaped value outside the two anchors (before submit, in retry or error * text, or after a cancellation), a duplicate success block, an anchor out of * order, a missing anchor, extra text on a token line, a stray prose line * between the anchors, a wrong prefix, and a value that does not match the token * shape. It never logs any input byte and never puts any input byte into a * thrown error. The parser is a pure function. */ export declare function parseSetupTokenCredential(text: string): string | null; //# sourceMappingURL=setup-token-parse.d.ts.map