/** * Async OAuth Handler * * Provides non-blocking OAuth flow with session-based state management. * This allows OAuth flows that require user interaction (browser login) * without blocking the HTTP request. */ import { Hono } from 'hono'; import type { GatewayService } from '../service.js'; import type { Config } from '../../config/schema.js'; import { type CapabilityId } from '../../capabilities/readiness/index.js'; import type { CatalogReadiness } from '../../providers/xopc-cloud-catalog-coordinator.js'; export interface OAuthCompletionReadiness { authorized: true; state: 'connected' | 'connected-degraded'; catalog: CatalogReadiness; capabilities: Record; configuration?: { applied: boolean; error?: string; }; } export declare function buildOAuthCompletionReadiness(config: Config, catalog: CatalogReadiness): OAuthCompletionReadiness; export declare function refreshModelCatalogAfterOAuth(provider: string, service: Pick): Promise; export declare function normalizeDesktopOAuthReturnPath(value: unknown): string | undefined; export declare function buildDesktopOAuthReturnUrl(provider: string, sessionId: string, returnPath: unknown): string | undefined; export declare function resolveOAuthLoginMethodPreference(params: { requestedMethod?: unknown; supportedMethods?: readonly string[]; remote: boolean; }): string | undefined; export declare function createOAuthAsyncHandler(service: GatewayService): Hono;