import { PKCECodes } from './pkce'; import { OAuthTokenStorage } from './store'; /** * Claude OAuth flow — port từ CLIProxyAPI `internal/auth/claude/anthropic_auth.go`. * * Constants giống y nguyên Claude Code CLI để Anthropic nhận diện là Claude Code: * - ClientID: 9d1c250a-e61b-44d9-88ed-5944d1962f5e * - Scope: user:profile user:inference user:sessions:claude_code * user:mcp_servers user:file_upload * - Redirect: http://localhost:54545/callback */ export declare const CLAUDE_AUTH_URL = "https://claude.ai/oauth/authorize"; export declare const CLAUDE_TOKEN_URL = "https://api.anthropic.com/v1/oauth/token"; export declare const CLAUDE_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e"; export declare const CLAUDE_REDIRECT_URI = "http://localhost:54545/callback"; export declare const CLAUDE_SCOPE = "user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload"; export interface ClaudeAuthSession { authUrl: string; state: string; pkce: PKCECodes; } /** Khởi tạo OAuth session — trả URL để mở browser. */ export declare function startClaudeAuth(): ClaudeAuthSession; /** * Đổi authorization code lấy access + refresh token. */ export declare function exchangeCodeForTokens(authCode: string, pkce: PKCECodes, state: string, account?: string): Promise; /** Refresh access token bằng refresh_token (không cần PKCE). */ export declare function refreshClaudeToken(current: OAuthTokenStorage): Promise;