/**
 * Where the graph stops — the boundary report, as data.
 *
 * When a flow does not connect, the honest answer is not "no path": it is the
 * dispatch site where the static path ends. `src/mcp/dynamic-boundaries.ts`
 * finds those sites in a body with deterministic regex; this module is the
 * graph-aware layer on top of it — it reads the bodies off disk, shortlists the
 * candidate runtime targets for a statically-visible dispatch key, and collects
 * the continuations out of the stopping symbol that the search did not follow.
 *
 * It exists for the same reason `named-symbol-flow.ts` does. `codegraph_explore`
 * announces boundaries in prose ("**Dynamic boundaries** … candidates for key
 * `save`: …") and the viewer's Flow strip draws the same verdict as an end cap
 * (design spec §3.5). Two derivations of "where does this stop" would eventually
 * disagree, and a reader who had both on screen would have no way to tell which
 * one was lying. So the *verdict* lives here once, and each caller renders it:
 * `ToolHandler.buildDynamicBoundaries` turns it into markdown, `/api/flow` turns
 * it into `WireFlowBoundary`.
 *
 * Everything here is query-time and read-only. The graph is never mutated, no
 * edge is ever guessed, and a fully connected flow never reaches this module —
 * silence beats a wrong edge (#687).
 */
import type CodeGraph from '../index';
import type { Node } from '../types';
import { type BoundaryMatch } from '../mcp/dynamic-boundaries';
/** Below this resolution confidence an edge is a name-only guess, not a call. */
export declare const UNCERTAIN_BELOW = 0.6;
/** Dispatch sites reported across one scan. Matches explore's bullet budget. */
export declare const MAX_BOUNDARY_SITES = 4;
/** One plausible runtime target of a keyed dispatch. */
export interface BoundaryCandidate {
    node: Node;
    /**
     * How the candidate should be named. Usually `qualifiedName`, but a typed-bus
     * key resolves to a CLASS whose real target is its handler method, so the
     * display names that method (`CreateTodoCommandHandler.Handle`) and `node` is
     * the method too — a row the reader clicks must open what it claims.
     */
    display: string;
    /** The reader already named this symbol: "you were right, here's the wiring". */
    named: boolean;
}
/** A dispatch site: the detector's verdict plus what the graph knows about it. */
export interface BoundarySite extends BoundaryMatch {
    /** Runtime targets for {@link BoundaryMatch.key}. Empty when the key is a runtime value. */
    candidates: BoundaryCandidate[];
    /**
     * Why there is no shortlist, when a key was visible but nothing could be
     * narrowed down: "key `id` is too generic to shortlist (12+ matches)".
     */
    candidateNote: string | null;
}
/** Every dispatch site found in one symbol's body. */
export interface NodeBoundary {
    node: Node;
    sites: BoundarySite[];
}
/** One call out of the stopping symbol, and how sure the resolver was of it. */
export interface BoundaryContinuation {
    node: Node;
    line: number | null;
    confidence: number | null;
}
/**
 * The calls recorded out of a symbol, split by whether the resolver believed
 * them. `uncertain` is the part a flow search deliberately does not follow.
 */
export interface BoundaryContinuations {
    resolved: BoundaryContinuation[];
    uncertain: BoundaryContinuation[];
}
export interface BoundaryScanOptions {
    /** Dispatch sites returned in total. Default {@link MAX_BOUNDARY_SITES}. */
    maxSites?: number;
    /** Symbols the reader named — candidates matching one are marked and sort first. */
    named?: ReadonlyMap<string, Node>;
}
/**
 * Scan the given symbols' bodies for dynamic-dispatch sites, in order.
 *
 * `scanList` is a priority order, not a set: the caller puts the place the flow
 * actually stopped first (the chain's dead end), then the symbols that were
 * asked for and never reached. Scanning stops at the first of three budgets —
 * sites found, bodies read, characters read — so a question about a god
 * function costs the same as any other.
 *
 * Returns one entry per symbol that yielded at least one site; a symbol with a
 * clean body is simply absent, because "nothing dynamic here" is not a finding.
 */
export declare function findDynamicBoundaries(cg: CodeGraph, scanList: readonly Node[], opts?: BoundaryScanOptions): NodeBoundary[];
/**
 * Shortlist the runtime targets a dispatch key could reach.
 *
 * Exact conventional names first (`save` → `onSave` / `handleSave`;
 * `CreateCmd` → `CreateCmdHandler`), then FTS, with a normalized-containment
 * post-filter — FTS camel-splitting is fuzzier than a candidate list should be,
 * and a shortlist that is mostly wrong is worse than none. Symbols the caller
 * already named sort first and are marked.
 *
 * A key too short or too common to narrow down returns no candidates and a
 * `note` saying so, rather than four arbitrary rows.
 */
export declare function shortlistBoundaryCandidates(cg: CodeGraph, key: string, keyIsType: boolean, named: ReadonlyMap<string, Node>, selfId: string): {
    candidates: BoundaryCandidate[];
    note: string | null;
};
/**
 * The calls recorded out of a symbol, minus the ones already on the path.
 *
 * This is the other half of an honest end cap. A flow that stops somewhere has
 * two kinds of unexplored exit: calls the resolver was sure of and the path
 * simply did not need, and name-only matches under {@link UNCERTAIN_BELOW} that
 * the search deliberately refused to follow. Listing the second kind is the
 * point — an unfollowed guess that stays invisible reads as "there is nothing
 * here", which is the one thing it does not mean.
 *
 * Deduped by target, keeping the first line each was recorded at.
 */
export declare function continuationsFrom(cg: CodeGraph, node: Node, exclude?: ReadonlySet<string>): BoundaryContinuations;
//# sourceMappingURL=dynamic-boundary-report.d.ts.map