import type { Flow } from "./flow-detector.js"; import type { ParsedFile, FileRole } from "./types.js"; import type { GraphEdge } from "./graph-builder.js"; import type { LLMProvider } from "../llm/provider.js"; /** * Computes the average git heat score for a flow by averaging the heat of * all its constituent files. Files absent from the thermal map score 0. */ export declare function getFlowHeat(flowFiles: string[], thermalMap: Map): number; /** * Maps a heat score to a card quality tier: * premium (> 0.6) — full LLM card, 1500 tokens * standard (0.3–0.6) — standard LLM card, 800 tokens * structural (< 0.3) — structural markdown only, no LLM call */ export declare function cardTier(heat: number): "premium" | "standard" | "structural"; export interface GeneratedCard { id: string; flow: string; title: string; content: string; contentHash: string; /** Class names and route identifiers for BM25 — stored in its own DB column, * NOT appended to content, so the semantic embedding stays uncontaminated. */ identifiers: string; cardType: "flow" | "model" | "cross_service" | "hub" | "auto_generated"; sourceFiles: string[]; sourceRepos: string[]; tags: string[]; validBranches: string[] | null; commitSha: string | null; } /** * Computes a SHA-256 hash of the card title + content for deduplication. * Cards with the same hash across multiple repos will be merged. */ export declare function computeContentHash(title: string, content: string): string; /** * Builds a plain-text identifiers string from class names and route signatures. * Stored in the dedicated `identifiers` DB column (not appended to content), * so the semantic embedding vector stays uncontaminated by noisy identifier tokens. * FTS5 indexes this column so class-name / route queries get keyword credit. * * Class names are stored in two forms so the FTS5 Porter stemmer can apply * to individual words: * original: "useAlertGeneratedEvent" (one FTS token — for any exact-match paths) * split: "use Alert Generated Event" (four tokens — Porter-stemmed per word) * Without pre-splitting, the entire camelCase name is one token in the FTS * inverted index and query-time splitting (in sanitizeFts5Query) can only match * individual split words, which never appear in the index. */ export declare function buildIdentifiers(files: ParsedFile[]): string; /** @deprecated Use buildIdentifiers — returns plain text for identifiers column. */ export declare function buildIdentifierAppendix(files: ParsedFile[]): string; /** * Generates knowledge cards from detected flows and graph data. * * Produces four card types: * - **flow** — one per non-hub flow * - **model** — one per important model (≥2 associations, top 20) * - **cross_service** — one per FE→BE connection (top 15) * - **hub** — one per hub flow * * When an `llm` provider is supplied, each card is enriched via LLM. * On LLM failure the generator falls back to structural markdown. * LLM calls are sequential to respect rate limits. */ export declare function generateCards(flows: Flow[], parsedFiles: ParsedFile[], edges: GraphEdge[], llm?: LLMProvider | null, /** Project context strings keyed by repo name. Injected into every card prompt. */ projectContextByRepo?: Map, /** HEAD commit SHA per repo, used to stamp source_commit on generated cards. */ commitShaByRepo?: Map, /** Git thermal map — drives quality tiering. Hot flows get premium LLM cards. */ thermalMap?: Map): Promise; /** * Returns true for file roles that should contribute to card content. * Tests, configs, and pure entry-points are indexed but excluded from * the card embedding text to keep semantic signals clean. */ export declare function isDomainRelevant(role: FileRole): boolean; export declare function computeTags(sourceFiles: ParsedFile[], sourceRepos: string[]): string[]; //# sourceMappingURL=card-generator.d.ts.map