/** * Frame storage interface * * Main export for database operations with connection pooling and graceful shutdown. * * Usage: * import { getDb, saveFrame, getFrameById, searchFrames } from '@smartergpt/lex/store'; * * const db = getDb(); * await saveFrame(db, myFrame); * const frame = await getFrameById(db, 'frame-001'); * const results = await searchFrames(db, 'auth deadlock'); */ import Database from "better-sqlite3-multiple-ciphers"; export type { FrameRow, CodeAtlasRunRow } from "./db.js"; export type { BehaviorRuleRow } from "./lexsona-queries.js"; export type { Frame, FrameStatusSnapshot } from "../frames/types.js"; export type { SearchResult, ExportFramesOptions } from "./queries.js"; export type { FrameStore, FrameSearchCriteria, FrameListOptions, FrameListResult, SaveResult, StoreStats, TurnCostMetrics, } from "./frame-store.js"; export type { CodeAtlasStore } from "./code-atlas-store.js"; export { SqliteFrameStore } from "./sqlite/index.js"; export { MemoryFrameStore } from "./memory/index.js"; import type { FrameStore } from "./frame-store.js"; /** * Create a FrameStore instance with the default SQLite implementation. * * This factory function provides a clean interface for CLI commands to obtain * a FrameStore, enabling easy testing by allowing injection of alternative * implementations (e.g., MemoryFrameStore). * * @param dbPath - Optional database path (defaults to standard ~/.lex/frames.db) * @returns A FrameStore instance configured with the specified database path. */ export declare function createFrameStore(dbPath?: string): FrameStore; export { saveFrame, getFrameById, searchFrames, getFramesByBranch, getFramesByJira, getFramesByModuleScope, getAllFrames, getFramesForExport, deleteFrame, getFrameCount, } from "./queries.js"; export { saveCodeAtlasRun, getCodeAtlasRunById, getCodeAtlasRunsByRepo, getAllCodeAtlasRuns, deleteCodeAtlasRun, getCodeAtlasRunCount, } from "./code-atlas-runs.js"; export type { CodeUnitRow, ListOptions, CodeUnitQueryOptions, PaginatedResult, BatchInsertResult, BatchDeleteResult, } from "./code-unit-queries.js"; export { saveCodeUnit, updateCodeUnit, insertCodeUnitBatch, getCodeUnitById, queryCodeUnits, listCodeUnitsByRepo, listCodeUnitsByFile, listCodeUnitsByKind, searchCodeUnitsBySymbol, deleteCodeUnit, deleteCodeUnitsByRepo, getCodeUnitCount, } from "./code-unit-queries.js"; export type { ReceiptRow, FailureStats, ModuleFailureStats, RecoverySuccessRate, } from "./receipt-queries.js"; export { storeReceipt, getReceiptById, getReceiptsBySession, getMostCommonFailureMode, getFailureModesBySession, deleteReceiptsBySession, } from "./receipt-queries.js"; export { saveBehaviorRule, getBehaviorRuleById, getAllBehaviorRules, deleteBehaviorRule, getBehaviorRuleCount, reinforceRule, counterExampleRule, createBehaviorRule, getRulesByContext, findRuleByContext, savePersona, getPersona, listPersonas, deletePersona, upsertPersona, getPersonaChecksum, } from "./lexsona-queries.js"; export type { BehaviorRule, BehaviorRuleWithConfidence, RuleScope, RuleSeverity, RuleContext, Correction, GetRulesOptions, PersonaRecord, PersonaSource, ListPersonasFilter, } from "./lexsona-types.js"; export { LEXSONA_DEFAULTS } from "./lexsona-types.js"; /** * Get or create the database instance * @param customPath Optional custom database path (defaults to ~/.lex/frames.db) */ export declare function getDb(customPath?: string): Database.Database; /** * Close the database connection gracefully */ export declare function closeDb(): void; export { createDatabase, getDefaultDbPath, deriveEncryptionKey, getEncryptionKey, validatePassphraseStrength, FRAME_STORE_SCHEMA_VERSION, } from "./db.js"; export type { PassphraseValidationResult } from "./db.js"; export { SqliteCodeAtlasStore } from "./sqlite/index.js"; export { AttachmentManager } from "./attachments.js"; export type { AttachmentRef } from "./attachments.js";