import { type CodegraphProcessRunner } from './codegraph-service.js'; import { type CodegraphPreflightResult, type CodegraphStructureFileEntry, type CodegraphStructureRenderOptions, type CodegraphStructureSummary } from './codegraph-preflight-structure.js'; export { CODEGRAPH_STRUCTURE_MAX_DIRS, CODEGRAPH_STRUCTURE_MAX_ROOT_FILES } from './codegraph-preflight-structure.js'; export type { CodegraphPreflightResult, CodegraphStructureFileEntry, CodegraphStructureRenderOptions, CodegraphStructureSummary } from './codegraph-preflight-structure.js'; /** * Pure renderer: turn the codegraph `files --json` payload into a bounded * `## Codegraph structure` block. Files are aggregated into a directory * histogram (immediate parent dir; bare root files bucket separately), * sorted by file count descending then name ascending, and capped at * `maxDirs` rows / `maxRootFiles` root entries. Exported separately so the * bounded-output contract is unit-testable without a filesystem. */ export declare function renderCodegraphStructureBlock(files: readonly CodegraphStructureFileEntry[], options?: CodegraphStructureRenderOptions): CodegraphStructureSummary; /** * Pre-dispatch codegraph preflight. Returns a `## Codegraph structure` * block when the index is (or becomes) readable; otherwise an * `{ available: false, note }` result. NEVER throws — the caller must be * able to degrade gracefully on every failure path. * * Behavior matrix (acceptance criteria): * - `.codegraph/` absent → init + index (best-effort), then read. * - `.codegraph/` present with peaks-loop marker AND `codegraph.db` → * skip init/index (fresh), read directly. No redundant re-index on * every dispatch. * - `.codegraph/` present with peaks-loop marker but NO `codegraph.db` * (dangling) → init + index (self-heal), then read. * - `.codegraph/` present WITHOUT marker (foreign schema) → fail-soft; * never clobber a foreign store. * * The optional `runner` mirrors `CodegraphProcessRunner` and is the ONLY * injected boundary (tests fake the upstream binary). */ export declare function buildCodegraphPreflightBlock(projectRoot: string, runner?: CodegraphProcessRunner): Promise;