/**
 * `GET /api/routes` — the URL to handler map, when the project has one.
 *
 * The engine's routing manifest is a flat list of (url, handler, file, line)
 * rows; it deliberately carries no node ids, because its own consumer (the MCP
 * context builder) renders text. A reader needs to *navigate*, so each entry is
 * matched back to its handler's node id here — batched by file, never a lookup
 * per route.
 *
 * `null` from the engine means "fewer than three real routes", i.e. this
 * project is not a routed app. That is reported as an empty manifest with
 * `routed: false` rather than as an error: "this isn't a web app" is an
 * answer, not a failure.
 *
 * Two things about the manifest shape the numbers here have to work around.
 * Its `limit` is applied in SQL *before* the three-route test, so asking for
 * fewer than three would make every routed project look unrouted — hence the
 * floor on the parameter. And its own `totalRoutes` counts only the rows inside
 * that window, so the headline count comes from the graph's `route` nodes
 * instead, which is the number a reader means by "how many routes are there".
 */
import type { CodeGraph } from '../../index';
/** One row of the URL → handler map. */
export interface WireRoute {
    /** The route node's name, verbatim: "POST /v1/users/{id}". */
    url: string;
    /** The verb, when the name leads with one. Null for file-routed pages. */
    method: string | null;
    /** The URL without the verb — the same string as `url` when there is none. */
    path: string;
    handler: string;
    handlerKind: string;
    /** Where the request is SERVED. */
    file: string;
    line: number;
    handlerId: string | null;
    /** Where the URL is REGISTERED — the router file, which is how routes group. */
    routeFile: string;
    routeLine: number;
    routeId: string;
    /** The handler is written inline at the registration: the route stands in for it. */
    inline: boolean;
}
export interface WireRoutes {
    routed: boolean;
    /** Every URL the index holds, whether or not its handler resolved. */
    routeCount: number;
    /** Rows in `entries` — the ones whose handler the manifest could name. */
    shown: number;
    truncated: boolean;
    topHandlerFile: string | null;
    topHandlerFileCount: number;
    entries: WireRoute[];
}
/** "POST /v1/users" -> { method: 'POST', path: '/v1/users' }. */
export declare function splitRouteName(url: string): {
    method: string | null;
    path: string;
};
export declare function buildRoutes(cg: CodeGraph, query: URLSearchParams): WireRoutes;
//# sourceMappingURL=routes.d.ts.map