/**
 * The read-only JSON API the viewer reads its screens from.
 *
 * Thirteen endpoints, one per screen, each answering in a single round-trip —
 * the same principle as `codegraph_explore`: return enough that the caller does
 * not have to ask a follow-up question — plus one that does not answer at all
 * and stays open instead (`/api/events`), so a screen learns that its answer
 * went stale rather than waiting to be asked again.
 *
 * All but one are *readers* of the existing schema; nothing here indexes or
 * resolves. The exception is `/api/trails`, which saves the reader's own named
 * walks as JSON under `.codegraph/ui/trails/` — the only write the viewer makes,
 * to the only directory it may write to, and refused outright under
 * `--read-only`. See `./trail-store.ts`.
 *
 * ```
 * GET /api/stats                     what this index is and how much to trust it
 * GET /api/search?q=                 the search palette
 * GET /api/node/<id>                 the Symbol view: rails, members, hierarchy, tests, blast
 * GET /api/nodes?id=&id=             names for ids you already have (the trail)
 * GET /api/source?file=&from=&to=    verbatim source, with a drift verdict
 * GET /api/file/<path>               the File view: outline and import rails
 * GET /api/filecode/<path>           the whole-file view: ports, arcs, callee rail
 * GET /api/routes                    the URL to handler map, when there is one
 * GET /api/entrypoints               where to start reading: routes, roots, tests, hubs
 * GET /api/map?root=&depth=          the module map: modules, links, cycles
 * GET /api/deadcode                  symbols nothing reaches, and what was excluded
 * GET /api/flow?from=&to=            the flow strip: one card per hop
 * GET /api/events                    the live channel (SSE): drift and refresh
 * GET /api/trails                    saved trails, re-resolved against the index
 * POST /api/trails                   save one   (refused under --read-only)
 * DELETE /api/trails/<id>            remove one (refused under --read-only)
 * ```
 *
 * It mounts on the `api` seam of `startUiServer`, which means it sits *behind*
 * the loopback boundary in `security.ts`: the `Host` allowlist, the absence of
 * CORS headers and the method restriction are already enforced by the time a
 * handler here runs — including the extra shape a write has to have. The one
 * obligation that remains ours is the path chokepoint, `resolveProjectFile` for
 * anything that touches the repository. Two modules here reach the filesystem
 * and no others: `source.ts` reads the project's code, and `trail-store.ts`
 * reads and writes `.codegraph/ui/trails/`.
 */
import type { UiApiHandler } from '../index';
export { GraphSession } from './session';
export { ApiError } from './respond';
export * from './wire';
export type { WireEntryPoints, WireEntryFile, WireEntryTest, WireEntryHub, } from './entrypoints';
export type { WireRoute, WireRoutes } from './routes';
export type { WireHierarchy, WireHierarchyNode, WireOverride } from './hierarchy';
export { MAX_HIERARCHY_ANCESTORS, MAX_HIERARCHY_DESCENDANTS } from './hierarchy';
export type { WireNodeRefs } from './nodes';
export type { WireFlowPayload, WireFlow, WireFlowHop, WireFlowEdge, WireFlowSource, WireFlowCallRef, WireFlowAmbiguity, } from './flow';
export type { WireFileCodePayload, WireFileCall, WireFileOutsideRef, } from './filecode';
export { EventHub, MAX_EVENT_FILES, HEARTBEAT_MS } from './events';
export type { WireEvent, WireEventHello, WireEventChanged, WireEventIndex, WireEventDegraded, WireIndexRevision, } from './events';
export type { WireMapPayload, WireMapModule, WireMapLink, WireMapCycle, } from './map';
export type { WireDeadCode, WireDeadCodeExclusion, WireDeadCodeGroup, WireDeadCodeRow, } from './deadcode';
export { MAX_DEAD_CODE_MEMBERS, MAX_DEAD_CODE_ROWS } from './deadcode';
export type { WireTrail, WireTrailHop, WireTrailHopStatus, WireTrails, SaveTrailRequest, TrailsOptions, } from './trails';
export { buildTrails, encodeResolvedRun, resolveHop, resolveTrail } from './trails';
export type { StoredHop, StoredTrail } from './trail-store';
export { MAX_TRAILS, MAX_TRAIL_HOPS, MAX_TRAIL_NAME, MAX_TRAIL_NOTE, TRAILS_RELATIVE_DIR, TRAIL_FORMAT_VERSION, isTrailId, listStoredTrails, parseTrail, slugify, } from './trail-store';
/**
 * A mounted API, plus the handle it holds open.
 *
 * `close()` releases the index; the CLI calls it on Ctrl-C so the process does
 * not exit with a live SQLite connection.
 */
export interface GraphApi {
    handler: UiApiHandler;
    close(): void;
}
export interface GraphApiOptions {
    /** Absolute path of the indexed project to read. */
    projectRoot: string;
    /**
     * Refuse every write, so the viewer is a pure reader again.
     *
     * The one thing it would otherwise write is a saved trail into
     * `.codegraph/ui/trails/`. Turning this on is for a checkout that must not
     * change (a review sandbox, a read-only mount, a shared machine); the viewer
     * still lists trails that are already there, and says why Save is gone.
     */
    readOnly?: boolean;
    /** The sentence shown in place of Save. Defaults to a generic one. */
    readOnlyReason?: string;
}
export declare function createGraphApi(options: GraphApiOptions): GraphApi;
//# sourceMappingURL=index.d.ts.map