/** * Finding the prompt files under a directory. * * Three things this deliberately does not do, each because of what it would * mean on a CI runner reading a repository somebody else opened a pull request * against: * * 1. **It does not follow symlinks.** A link is skipped, not resolved. A link * to `/etc` or to a parent directory turns "check the prompts folder" into * reading and printing token counts for files outside the project, and a * link loop turns it into a hang. * 2. **It does not walk without bound.** Depth and file count are capped, and * hitting the cap is reported rather than silently truncating the list — * "0 files over budget" and "I stopped looking" must not read the same. * 3. **It does not guess at what a prompt is.** Only the configured extensions * are read. Everything else is left alone rather than tokenised on the * chance it might be a prompt. */ export declare const MAX_WALK_DEPTH = 12; export declare const MAX_WALK_FILES = 2000; export interface WalkResult { /** Matching files, as paths relative to the root, with `/` separators. */ files: string[]; /** True when a cap stopped the walk early, so the caller can say so. */ truncated: boolean; } export interface WalkOptions { extensions?: readonly string[]; maxFiles?: number; maxDepth?: number; /** * Paths to leave out, as globs against the path relative to the root. * * **Why this had to exist.** Directory mode decided what a prompt was from * the extension alone, and `.txt` in a repository with a test corpus means * *fixtures*. Pointed at this project's own root it read seventy-four * documents — README, changelog, roadmap — and thirty-five test fixtures as * prompts, which is why nobody here had ever committed a baseline of it. A * hard-coded skip list would have been guessing on somebody else's layout; * this is the repository saying which of its files are prompts. * * A directory is skipped whole when the pattern matches it, so an ignored * tree costs one comparison rather than one per file in it. */ ignore?: readonly string[]; } /** * Lists prompt files under `root`, relative to it and sorted. * * Sorted because the output is read by humans and compared between runs: a * report whose row order depends on the filesystem's directory order is one * nobody can diff. */ export declare function walkPrompts(root: string, options?: WalkOptions): Promise; //# sourceMappingURL=walk.d.ts.map