/**
 * The call path among a bag of named symbols — the one path finder.
 *
 * `codegraph_explore` leads its answer with a "Flow" section: the longest call
 * chain among the symbols an agent named, riding synthesized dynamic-dispatch
 * edges so a controller reaches its implementation through the interface. The
 * viewer's Flow strip (`/api/flow`, design spec §3.5) draws the same thing as
 * cards. They must never disagree, so the search lives here once and both
 * callers ride it: same token parsing, same overload disambiguation, same
 * bridge budget, same edges.
 *
 * What differs between the two callers is expressed as OPTIONS, not as a second
 * implementation:
 *
 * - **`mode: 'named'`** is exactly what explore does. Every resolved symbol is
 *   both a possible start and a possible end, at most ONE unnamed symbol may
 *   bridge two named ones ({@link DEFAULT_MAX_BRIDGE}), and the LONGEST chain
 *   wins. The bridge cap is what stops the search wandering a god-function's
 *   fan-out: the agent's own naming is the evidence that a hop is on-topic.
 * - **`mode: 'directed'`** is "how does X reach Y", which the agent has no way
 *   to ask and the viewer's search box does. Both ends are pinned, so the
 *   evidence the bridge cap was standing in for is already there and the search
 *   bridges freely — a two-token query under the named rules could never return
 *   more than three cards. The SHORTEST path wins, because with both ends fixed
 *   a longer route is a detour rather than a fuller answer.
 *
 * Overloads are handled differently for the same reason. A bare ambiguous name
 * in `named` mode is filtered by CO-NAMING (keep `list` only where the agent
 * also named its class); in `directed` mode every candidate for both endpoints
 * is tried and the pair that actually connects is the answer — which is a
 * better disambiguator than co-naming and the only one available when the
 * whole query is two words.
 */
import type CodeGraph from '../index';
import type { Node, Edge } from '../types';
export { RUST_PATH_PREFIXES, lastQualifierPart, matchesSymbol } from './symbol-lookup';
/**
 * Find ALL symbols matching a name. Used by callers/callees/impact to aggregate
 * results across all matching symbols (e.g., multiple classes with an `execute` method).
 *
 * Exact matches only (#1473): a missing / mistyped name must NOT silently
 * resolve to the top fuzzy FTS hit under the caller's typed label. Closest
 * hits may appear in `note` as a did-you-mean hint when `nodes` is empty.
 */
export declare function findAllSymbols(cg: CodeGraph, symbol: string): {
    nodes: Node[];
    note: string;
};
/** Node kinds that can sit on a call chain. */
export declare const FLOW_CALLABLE_KINDS: ReadonlySet<string>;
/**
 * Edge kinds a flow may ride. `navigates` is a screen transition (Expo Router
 * `router.push('/x')` → the route node) — a hop in the user's flow exactly as
 * a call is a hop in the program's.
 */
export declare const FLOW_EDGE_KINDS: ReadonlySet<string>;
/** Chain length ceiling, in NODES. Explore's Flow section has always used 7. */
export declare const DEFAULT_MAX_HOPS = 7;
/**
 * Longer ceiling for a directed question.
 *
 * "How does X reach Y" is asked about two symbols that a reader believes are
 * connected, and a real call path between a CLI entry point and a storage
 * primitive runs deeper than seven frames. Explore's ceiling stays where it is:
 * there, a longer chain is a bigger guess, because nothing pins the far end.
 */
export declare const DIRECTED_MAX_HOPS = 12;
/** At most one consecutive UNNAMED hop may bridge two named symbols. */
export declare const DEFAULT_MAX_BRIDGE = 1;
export interface FlowStep {
    node: Node;
    /** The edge INTO this node from the previous step; null on the first. */
    edge: Edge | null;
}
export interface FlowChain {
    steps: FlowStep[];
    /** For each node on the chain, the line where it calls the NEXT one. */
    callSites: Map<string, number>;
}
export interface NamedSymbolFlowOptions {
    /** `named` = explore's rules; `directed` = a pinned from → to question. */
    mode?: 'named' | 'directed';
    /** Required in `directed` mode: the token the path must start at. */
    from?: string;
    /** Required in `directed` mode: the token the path must end at. */
    to?: string;
    maxHops?: number;
    /** Consecutive unnamed hops allowed. `Infinity` in directed mode. */
    maxBridge?: number;
    /** Distinct chains to return. Explore only ever looks at the first. */
    maxChains?: number;
}
export interface NamedSymbolFlow {
    /** The query's symbol tokens, in the order they were written. */
    tokens: string[];
    /** Every CALLABLE the tokens resolved to, by node id. */
    named: Map<string, Node>;
    /** Non-callable endpoints of synthesized edges (RTK thunks and friends). */
    dynNamed: Map<string, Node>;
    /** token → the node ids it resolved to. */
    tokenNodes: Map<string, string[]>;
    /** token → its whole same-name callable family, before the container filter. */
    tokenFamily: Map<string, Node[]>;
    /** Ids whose token was a (near-)unique callable name — at most 3 defs. */
    uniqueNamedNodeIds: Set<string>;
    /** Ids resolved from a shape-precise token (camelCase, dotted, PascalCase…). */
    preciseNamedIds: Set<string>;
    /** Chains found, best first. Empty when nothing connects. */
    chains: FlowChain[];
}
/** The symbol-shaped tokens of a query, deduped and capped. */
export declare function flowTokens(query: string): string[];
/**
 * Resolve a query's tokens to nodes, with the overload rules described in the
 * module header. No graph traversal happens here.
 */
export declare function resolveNamedTokens(cg: CodeGraph, query: string, opts?: NamedSymbolFlowOptions): NamedSymbolFlow;
/**
 * The call path among a query's named symbols. See the module header for what
 * the two modes mean and why they differ.
 */
export declare function resolveNamedSymbolFlow(cg: CodeGraph, query: string, opts?: NamedSymbolFlowOptions): NamedSymbolFlow;
/** The token spelling {@link flowTokens} would have produced for one word. */
export declare function normalizeToken(token: string): string;
//# sourceMappingURL=named-symbol-flow.d.ts.map