import type { Backend } from '../../agent-adapter/types.js'; import { type ResolvedProfile } from '../agents/profile-manager.js'; import { type LoadPiRuntimeOptions, type PiRuntimeLoadResult } from './pi-runtime.js'; export type AuthType = 'oauth' | 'api_key'; export type AuthAccountState = 'logged-in' | 'expiring' | 'expired' | 'logged-out' | 'unknown'; export interface AuthCredentialStatus { authType: AuthType; state: AuthAccountState; source: string | null; expiresAt: string | null; refreshExpiresAt: string | null; manageable: boolean; detail?: string; } export interface AuthAccountStatus { backend: 'claude' | 'pi'; provider: string; label: string; capabilities: AuthType[]; authType: AuthType | null; state: AuthAccountState; source: string | null; expiresAt: string | null; refreshExpiresAt: string | null; inUse: boolean; credentials: AuthCredentialStatus[]; detail?: string; } export interface AuthStatusSnapshot { generatedAt: string; accounts: AuthAccountStatus[]; piRuntime: { available: boolean; version: string | null; entry: string | null; error: string | null; }; } export declare function preferredAuthType(snapshot: AuthStatusSnapshot, backend: 'claude' | 'pi', provider: string): AuthType | null; interface ActiveProfileReference { backend: Backend; provider: string | null; } export interface GetAuthStatusOptions { now?: () => Date; claudeCredentialsPath?: string; piAuthPath?: string; loadPiRuntime?: (options?: LoadPiRuntimeOptions) => Promise; getSavedApiEnv?: () => { ANTHROPIC_API_KEY: string | undefined; ANTHROPIC_BASE_URL: string | undefined; CLAUDE_CODE_OAUTH_TOKEN?: string | undefined; CLAUDE_CODE_OAUTH_TOKEN_EXPIRES_AT?: string | undefined; }; getClaudeMode?: () => string; getActiveBackend?: () => Backend; listProfiles?: () => ResolvedProfile[]; getActiveProfileConfig?: () => ActiveProfileReference; } export declare function getAuthStatus(options?: GetAuthStatusOptions): Promise; export {};