/** * Brief codebase map: what already exists, so "reuse first" costs no search (T13666). * * One line per folder listing its exported names, inside a character budget, * shared code (utils, lib, services, core, …) first and tests skipped. The * names come from the nexus graph (parsed by tree-sitter, exact) when the * project is indexed, else from a regex walk of git-tracked files. The idea * and the fallback's patterns are adapted from Ponytail 5.1.0's * `ponytail-map.js` (DietrichGebert, MIT). * * @task T13666 * @epic T13418 */ import type { BriefMapFile, BriefMapReport } from '@cleocode/contracts'; /** Default character budget (Ponytail's default). */ export declare const BRIEF_MAP_DEFAULT_BUDGET = 2000; /** What `cleo briefing` prints instead of a map when the project has no code index. */ export declare const BRIEF_MAP_NO_INDEX = "no code index; run `cleo nexus analyze`"; /** Whether a repo-relative path is source worth mapping (not a test, generated or vendored file). */ export declare function isMappableSource(file: string): boolean; /** * Render the map from per-file names: one line per folder, shared folders * first, within `budget` characters. * * @param files - files with their exported names. * @param budget - character budget for the folder lines. * @returns the text, and how many folders were listed and skipped. */ export declare function formatBriefMap(files: readonly BriefMapFile[], budget?: number): { text: string; folders: number; skipped: number; }; /** * Exported top-level names in one source file, by regex. * shortcut: regex, not a parser (misses nested or dynamic exports), use the nexus graph when indexed * * @param file - repo-relative path (its extension picks the patterns). * @param text - file contents. */ export declare function namesInSource(file: string, text: string): string[]; /** * Build the brief map from the nexus graph only, never walking the tree, so it * is cheap enough for `cleo briefing`. * * @param projectRoot - the project root. * @param budget - character budget (default {@link BRIEF_MAP_DEFAULT_BUDGET}). * @returns the report, or `null` when the project has no code index. * @throws when the code index exists but cannot be read. */ export declare function buildNexusBriefMap(projectRoot: string, budget?: number): Promise; /** * Build the brief map for a project: from the nexus graph when indexed, else * from a git-tracked regex walk. * * @param projectRoot - the project root. * @param budget - character budget (default {@link BRIEF_MAP_DEFAULT_BUDGET}). */ export declare function buildBriefMap(projectRoot: string, budget?: number): Promise; //# sourceMappingURL=brief-map.d.ts.map