/** * Project documentation generator. * * Generates structured documentation (About, Architecture, CodeStyle, Rules, * Styles, README) for each repository BEFORE card generation. The docs are * persisted in `project_docs` and injected as context into every card prompt, * giving the LLM high-level business understanding of the codebase. */ /** Call this once at the start of indexing with the absolute workspace root. */ export declare function setWorkspaceRoot(root: string): void; import type { LLMProvider } from "../llm/provider.js"; import type { ParsedFile } from "./types.js"; import { type DocType } from "./doc-prompts.js"; import type { StackProfile } from "./stack-profiler.js"; import type { GitSignals } from "./git-signals.js"; /** * Reads the first existing README from a repo root directory (no LLM, no cost). * Returns up to 2000 chars to use as a prompt seed. */ export declare function seedFromReadme(repoAbsPath: string): Promise; /** * Sorts parsed files by git heat descending and filters out stale directories. * Hot files (touched recently and often) float to the top of LLM prompts. */ export declare function selectByHeat(files: ParsedFile[], signals: GitSignals | null, max?: number): ParsedFile[]; /** * Analyzes FE nav and page files with the LLM to produce a "pages" doc and * returns the list of discovered page names so route-extractor can use them * instead of a hardcoded NAV_SKIP_LABELS list. * * No-ops when LLM is unavailable or the doc already exists and is fresh. * Returns an empty array in those cases so the caller can fall back gracefully. */ export declare function discoverFrontendPages(repoName: string, repoPath: string, parsedFiles: ParsedFile[], llm: LLMProvider | null): Promise; /** * Analyzes BE routes and controllers with the LLM to produce a "be_overview" doc. * Runs before flow detection so the doc is available early for the UI. * * No-ops when LLM is unavailable or the doc already exists and is fresh. */ export declare function discoverBeOverview(repoName: string, repoPath: string, parsedFiles: ParsedFile[], llm: LLMProvider | null, fePagesContext?: string, branchContext?: import("./doc-prompts.js").BranchContext): Promise; export interface GeneratedProjectDoc { docType: DocType; title: string; content: string; sourceFilePaths: string[]; } export interface ProjectDocOptions { skipExisting?: boolean; forceRegenerate?: boolean; isFrontend?: boolean; skillLabel?: string; stackProfile?: StackProfile; /** Branch diff context — injected into prompts when indexing a non-base branch */ branchContext?: import("./doc-prompts.js").BranchContext; } /** * Generates all project documentation for a single repository. * Returns the list of generated docs (may be empty if all were skipped). * * @param skillLabel - Stack/skill label (e.g. "ruby, rails") passed to specialist generation. */ export declare function generateProjectDocs(repoName: string, repoPath: string, parsedFiles: ParsedFile[], llm: LLMProvider, options?: ProjectDocOptions): Promise; /** * Loads about, architecture, specialist and memory docs for a repo from the * DB and formats them as a project context string to inject into card prompts. * Specialist is preferred over about+architecture when available. */ export declare function loadProjectContext(repoName: string): string; /** * Generates a Business.md doc capturing operational context, critical workflows, * and business invariants. Sources from about + rules + service objects. */ export declare function generateBusinessDoc(repoName: string, llm: LLMProvider, readmeSeed?: string, options?: { skipExisting?: boolean; forceRegenerate?: boolean; }): Promise; /** * Generates a Product.md doc documenting user journeys from the FE router, * navigation, and active page components. */ export declare function generateProductDoc(repoName: string, repoPath: string, parsedFiles: ParsedFile[], llm: LLMProvider, readmeSeed?: string, options?: { skipExisting?: boolean; forceRegenerate?: boolean; }): Promise; /** * Generates a workspace-level CrossRepo.md that maps FE pages/journeys to BE * API endpoints. Stored under repo = '_workspace' for workspace-level retrieval. */ export declare function generateCrossRepoDoc(feRepoName: string, beRepoName: string, llm: LLMProvider, options?: { skipExisting?: boolean; forceRegenerate?: boolean; }): Promise; /** * Regenerates the global team memory doc from recent dev_insight cards and * query patterns. Called automatically as a fire-and-forget background job * every time a dev_insight count crosses a multiple of 10. * * Stores the result under repo = '__memory__'. */ export declare function patchMemoryDoc(): Promise; /** * Generates a workspace-level specialist doc that understands relationships * between all repos in the monorepo. Stored under repo = '__workspace__'. * * Requires at least one per-repo specialist doc to already exist. */ export declare function generateWorkspaceSpecialist(allRepoNames: string[], llm: LLMProvider): Promise; //# sourceMappingURL=doc-generator.d.ts.map