/** * GraphClient — the single typed facade the rest of the harness imports. * * All methods return Promise> and NEVER throw for expected * failure modes. Callers branch on `.ok`. (ADR-3) * * Sandbox post-filter is a single chokepoint here — every NodeRef.file * is validated via sandboxNodePath before returning to callers. */ import type { TokensaveMcpClient } from "./mcp-client.js"; import type { GraphArtifactStore } from "./artifact-store.js"; import { type GraphFallback } from "./fallback.js"; import type { IncidentLog } from "./incidents.js"; import type { FallbackHint, GraphFailureReason, GraphResult, GraphSection, ImpactReport, NodeRef, PrefetchSpec, SearchHit } from "./types.js"; type QueryPattern = "callers_of" | "callees_of" | "imports_of" | "tests_for"; export interface SearchOpts { limit?: number; kind?: NodeRef["kind"]; } export declare class GraphClient { private readonly projectRoot; private readonly mcpClient; private readonly artifactStore; private readonly fallback; private readonly incidents; private readonly config; /** Session-level cached staleness verdict. Read once on first method call; * may be invalidated by markFresh() when GraphHookHandler (sprint 8) * signals a sync just completed. */ private staleCache; constructor(projectRoot: string, mcpClient: TokensaveMcpClient, artifactStore: GraphArtifactStore, fallback: GraphFallback, incidents: IncidentLog, config: GraphSection); /** Invalidate the session staleness cache. Called by GraphHookHandler (sprint 8). */ markFresh(): void; /** * Return a user-facing FallbackHint for a given failure reason. * Consumed by GraphMcpTools (sprint 4) to generate fallback guidance. */ hintFor(reason: GraphFailureReason, detail?: string): FallbackHint; search(q: string, opts?: SearchOpts): Promise>; query(pattern: QueryPattern, target: NodeRef): Promise>; impact(target: NodeRef | string): Promise>; reviewContext(nodes: NodeRef[]): Promise>; overview(): Promise>; changes(since?: string): Promise>; prefetch(queries: PrefetchSpec[]): Promise>>; private dispatch; /** * Common path for methods that need NodeRef sandbox filtering. * Runs the MCP call, times it, narrows result, sandboxes nodes, returns GraphResult. */ private runWithSandbox; /** Same as runWithSandbox but the result type is T with no NodeRef post-filter. */ private runRaw; /** Convert a makeGraphError-tagged Error from TokensaveMcpClient.call into a * GraphResult.ok=false. mcp-client.ts:58-63 sets .reason on the Error. */ private toFailureResult; /** One-time staleness probe, cached for the session. */ private checkStaleness; /** Returns true if the node should be kept; false → silently dropped + incident logged. */ private keepNode; private logSandboxDrop; } export {}; //# sourceMappingURL=client.d.ts.map