/** * Codebase scanner for the AIDLC Discovery Engine. * * Static analysis only — no build, no execution (Req 15.7). * Detects languages, frameworks, conventions and architecture. * Writes Context_Docs to `.aidlc/context/`. * * Requirements: 15.1, 15.2, 15.5 */ export interface LanguageEntry { name: string; fileCount: number; percentage: number; } export interface ScanResult { languages: LanguageEntry[]; frameworks: string[]; conventions: { indentation: string; naming: string; importStyle: string; }; architecture: { structure: string; entryPoints: string[]; configApproach: string; }; filesScanned: number; } /** * Scan a codebase and produce a structured scan result. * Static analysis only — no build, no execution (Req 15.7). * * @param projectRoot - Absolute path to the project root. * @returns Structured scan result with languages, frameworks, conventions, and architecture. */ export declare function scanCodebase(projectRoot: string): ScanResult; /** * Render a style-guide.md Context_Doc from scan results. * Includes `generated_by: aidlc-discover` frontmatter. */ export declare function renderStyleGuide(result: ScanResult): string; /** * Render an architecture.md Context_Doc from scan results. * Includes `generated_by: aidlc-discover` frontmatter. */ export declare function renderArchitectureDoc(result: ScanResult): string; export interface WriteContextDocsResult { /** Paths written, relative to projectRoot. */ written: string[]; /** Paths left alone because a human owns them, relative to projectRoot. */ preserved: string[]; /** * Paths `--force` asked to overwrite and was refused, relative to projectRoot. * * Separate from `preserved` because the operator asked for the overwrite here. * Reporting them together would make a declined `--force` indistinguishable from * a run that never tried, which is the same ambiguity that let the original * unconditional write go unnoticed. */ declined: string[]; } /** * Write generated Context_Docs to `.aidlc/context/`. * Creates the directory if it doesn't exist. * Total output ≤ 100KB, ≤ 10 files (Req 15.5, 17.2). * * **Only overwrites docs it generated.** These files are injected verbatim into the * Guidance section of every compiled phase skill, so they are resident context on * every turn of every phase — which makes a hand-written one expensive to produce * and worth keeping. Before this, `writeFileSync` ran unconditionally and the next * `aidlc discover` silently destroyed any edit, so nobody could improve on what a * directory-name scan could infer. The scanner cannot describe a seam; a person can. * * `force` restores the old behaviour for a deliberate regeneration. * * @param projectRoot - Absolute path to the project root. * @param result - Scan result to render. * @param opts.force - Overwrite even hand-edited docs. * @returns Which paths were written and which were preserved. */ export declare function writeContextDocs(projectRoot: string, result: ScanResult, opts?: { force?: boolean; /** * Asked once, before any write, when `force` would destroy hand-owned docs. * * `force` is one flag away from the unrecoverable case: the better text exists * nowhere but git history, and nothing re-running produces it again. Declining * is recoverable, overwriting is not, so an absent callback under `--force` * declines rather than proceeding — the caller must opt in to being asked * (update-overwrites-authored-context/AC-13, NFR-3). */ confirmOverwrite?: (paths: string[]) => Promise; }): Promise; //# sourceMappingURL=scanner.d.ts.map