import type { OAuthAuth } from '../core/api/provider-config.js'; type EnsureOpts = { forceReacquireIfRefreshFails?: boolean; openBrowser?: boolean; forceReauthorize?: boolean; forceRefresh?: boolean; }; declare function isProcessAlive(pid: number): boolean; export declare function ensureValidOAuthToken(providerType: string, auth: OAuthAuth, opts?: EnsureOpts): Promise; export declare function handleUpstreamInvalidOAuthToken(providerType: string, auth: OAuthAuth, upstreamError: unknown, options?: { /** * When false, interactive OAuth repair must not block the current request. * The repair flow will be started in the background (subject to cooldown), * and this function will return `false` so the router can failover. */ allowBlocking?: boolean; /** * Test-only injection: override ensureValidOAuthToken implementation. */ ensureValidOAuthToken?: typeof ensureValidOAuthToken; }): Promise; export declare function shouldTriggerInteractiveOAuthRepair(providerType: string, upstreamError: unknown): boolean; export declare const __oauthLifecycleTestables: { isProcessAlive: typeof isProcessAlive; }; export {};