/**
 * Route Discovery - READ-ONLY AST analysis
 *
 * Discovers routes by scanning src/api/**\/*.ts files or by following
 * explicit router mounts from createApp({ router }).
 * Extracts route definitions WITHOUT mutating source files.
 */
import type { Logger } from '../../../types';
import { type AppRouterDetection } from '../app-router-detector';
export interface RouteMetadata {
    id: string;
    filename: string;
    path: string;
    method: string;
    version: string;
    type: 'api' | 'sms' | 'email' | 'cron' | 'websocket' | 'sse' | 'stream';
    agentIds?: string[];
    config?: Record<string, unknown>;
    schema?: {
        input?: string;
        output?: string;
    };
}
export interface RouteInfo {
    method: string;
    path: string;
    filename: string;
    hasValidator: boolean;
    routeType: 'api' | 'sms' | 'email' | 'cron' | 'websocket' | 'sse' | 'stream';
    agentVariable?: string;
    agentImportPath?: string;
    agentName?: string;
    agentDescription?: string;
    inputSchemaVariable?: string;
    outputSchemaVariable?: string;
    inputSchemaImportPath?: string;
    inputSchemaImportedName?: string;
    outputSchemaImportPath?: string;
    outputSchemaImportedName?: string;
    inputSchemaCode?: string;
    outputSchemaCode?: string;
    stream?: boolean;
    pathParams?: string[];
    /**
     * When a route is mounted via .route(), its filename is set to the parent file
     * (for dedup filtering). schemaSourceFile preserves the actual file where the
     * route's schema variables are defined/exported, so registry imports resolve correctly.
     */
    schemaSourceFile?: string;
}
/**
 * Extract path parameters from a route path.
 * Matches patterns like :id, :userId, :id?, *path, etc.
 */
export declare function extractPathParams(path: string): string[];
/**
 * Discover all routes — tries explicit router detection first, falls back to file-based.
 *
 * When `createApp({ router })` is detected in app.ts, routes are discovered by
 * following the router imports with code-derived mount paths. Otherwise, falls back
 * to scanning src/api/**\/*.ts with filesystem-derived paths.
 */
export declare function discoverRoutes(srcDir: string, projectId: string, deploymentId: string, logger: Logger): Promise<{
    routes: RouteMetadata[];
    routeInfoList: RouteInfo[];
    /** Whether explicit router was detected (vs file-based fallback) */
    explicitRouter?: AppRouterDetection;
}>;
export interface RouteConflict {
    type: 'duplicate';
    routes: Array<{
        method: string;
        path: string;
        filename: string;
    }>;
    message: string;
}
/**
 * Detect conflicts between routes
 */
export declare function detectRouteConflicts(routes: Array<{
    method: string;
    path: string;
    filename: string;
}>): RouteConflict[];
//# sourceMappingURL=route-discovery.d.ts.map