import type { Database } from "better-sqlite3"; export interface Card { id: string; flow: string; title: string; content: string; card_type: string; source_files: string; source_repos: string; tags: string; valid_branches: string | null; commit_sha: string | null; created_by: string | null; stale: number; usage_count: number; specificity_score: number; /** Space-separated class names and route signatures for BM25 identifier matching. */ identifiers: string; created_at: string; updated_at: string; } export interface FileIndexEntry { path: string; repo: string; branch: string; commit_sha: string; parsed_data: string; /** Normalized git commit frequency 0.0 (cold) – 1.0 (hot). Migration v18. */ heat_score: number; updated_at: string; } export interface GraphEdge { id: number; source_file: string; target_file: string; relation: string; metadata: string; repo: string; } export interface Metric { id: number; timestamp: string; dev_id: string | null; query: string; query_embedding: Buffer | null; response_cards: string; response_tokens: number; cache_hit: number; latency_ms: number; branch: string | null; } export interface BranchEvent { id: number; timestamp: string; dev_id: string | null; repo: string; branch: string; event_type: string; from_branch: string | null; commit_sha: string | null; } export interface ProjectDoc { id: string; repo: string; doc_type: "readme" | "about" | "architecture" | "code_style" | "rules" | "styles" | "api_contracts" | "specialist" | "changelog" | "memory" | "pages" | "be_overview"; title: string; content: string; stale: number; source_file_paths: string; /** SHA-1 of the frameworkBaseline string used during generation. * TODO: populate in upsertDoc once baseline-staleness detection is implemented (migration v17). */ applied_baseline_hash?: string | null; /** Filesystem path where this doc was last written under /ai-codeprism/. Migration v18. */ file_path?: string | null; created_at: string; updated_at: string; } export interface TranscriptImport { id: string; file_path: string; content_hash: string; imported_at: string; source_type: "cursor" | "claude_code" | "markdown"; } export interface ExtractedInsight { id: string; transcript_id: string; card_id: string | null; category: "coding_rule" | "anti_pattern" | "architecture_decision" | "domain_knowledge" | "team_preference" | "gotcha"; statement: string; evidence_quote: string; confidence: number; scope: string; trust_score: number; code_consistency_score: number | null; verification_basis: string | null; aspirational: number; extracted_at: string; } export interface TeamRule { id: string; name: string; description: string; severity: "error" | "warning" | "info"; scope: string | null; repos: string | null; enabled: number; created_by: string | null; created_at: string; updated_at: string; } export interface RuleViolation { rule_id: string; rule_name: string; severity: "error" | "warning" | "info"; file: string; line: number | null; snippet: string; explanation: string; } export interface RuleCheckResult { violations: RuleViolation[]; checked_rules: number; files_checked: number; passed: boolean; } export interface RepoProfile { repo: string; primary_language: string; frameworks: string; is_lambda: number; package_manager: string; skill_ids: string; detected_at: string; } export interface CardInteraction { id: number; timestamp: string; query: string; card_id: string; outcome: "viewed" | "insight_saved"; session_id: string | null; } export interface PrImport { id: string; github_repo: string; local_repo: string; pr_number: number; pr_title: string; pr_body: string; pr_url: string; branch: string; merged_at: string; card_id: string | null; imported_at: string; } export interface GeneratedDoc { id: string; flow: string; audience: "user" | "dev"; title: string; content: string; source_repos: string; card_count: number; generated_at: string; updated_at: string; } /** * Creates the complete canonical schema from scratch. * Virtual-table DDL (FTS5, vec0) runs outside the regular TABLES block since * SQLite does not allow creating virtual tables inside a transaction. */ export declare function initSchema(db: Database): void; //# sourceMappingURL=schema.d.ts.map