/** * API surface scan service. * * Walks the project for CLI subcommands, service-level public exports, * public types, and module-level constants. Output feeds the tech-doc * "Existing API / Component Inventory" section. Read-only — no writes. * * Pattern follows `libraries-service.ts` (readFileSync + readdir; pure * data shape; no AST parsing). karpathy §2: minimum code, no abstractions. */ export type ApiSurfaceOptions = { projectRoot: string; /** Maximum entries per kind in output (after filtering). */ maxPerKind?: number; /** Comma-separated globs (substring match) to limit the walk. */ includeDirs?: string; }; export type CliEntry = { name: string; description: string; sourceFile: string; }; export type ServiceEntry = { name: string; kind: 'function' | 'class' | 'const'; isAsync: boolean; sourceFile: string; line: number; }; export type TypeEntry = { name: string; kind: 'interface' | 'type' | 'enum'; sourceFile: string; line: number; }; export type ConstantEntry = { name: string; sourceFile: string; line: number; }; export type ApiSurfaceReport = { projectRoot: string; scannedAt: string; counts: { cli: number; service: number; type: number; constant: number; }; cli: CliEntry[]; service: ServiceEntry[]; type: TypeEntry[]; constant: ConstantEntry[]; warnings: string[]; }; /** * Scan the project for API surfaces. Read-only. Never throws; failures * surface as warnings in the report. */ export declare function scanApiSurface(options: ApiSurfaceOptions): Promise; export declare function formatApiSurfaceMarkdown(report: ApiSurfaceReport, opts?: { maxPerKind?: number; truncatedCounts?: { cli: number; service: number; type: number; constant: number; }; }): string;