import type { OpenLoreConfig } from '../../types/index.js'; import type { LLMContext } from './artifact-generator.js'; export interface IndexReport { index: 'function' | 'text' | 'spec'; status: 'start' | 'complete' | 'skip' | 'warning'; detail?: string; } export interface IndexReporter { report(event: IndexReport): void; } export interface AnalysisIndexResult { functionIndex: 'built' | 'skipped' | 'degraded'; textIndex: 'built' | 'skipped'; specIndex: 'built' | 'skipped'; degraded: Array<{ index: IndexReport['index']; reason: string; }>; } export interface BuildAnalysisIndexesOptions { rootPath: string; outputPath: string; config: OpenLoreConfig | null; llmContext?: LLMContext | null; force?: boolean; keywordOnly?: boolean; freshSpecDirectory?: boolean; include?: string[]; exclude?: string[]; reporter?: IndexReporter; /** Analysis generation this index set consumes; enables verified cache reuse. */ generationId?: string; /** * Wait for another process's index mutation instead of failing on contention. * Off by default: a silent wait on a hung holder is how a build appears to hang. */ waitForLock?: boolean; } export interface BuildSpecIndexOptions { rootPath: string; outputPath: string; config: OpenLoreConfig | null; keywordOnly?: boolean; reporter?: IndexReporter; } /** Spec-only fast path used by `analyze --reindex-specs`. */ export declare function buildSpecIndex(options: BuildSpecIndexOptions): Promise<'built' | 'skipped'>; /** A semantic-index failure recorded for the surfaces that report index state. */ export interface IndexEmbedFailure { /** ISO timestamp of the failure. */ at: string; /** Message, already sanitized by the caller. */ reason: string; /** The configured endpoint, when the failure was a remote one. */ endpoint?: string; } /** * Why a receipt that passed the generation and configuration checks was still not reused. * Returned so the caller can SAY so: an invalidation nobody can see is how a repository * serves keyword results under a semantic configuration for weeks. */ export type IndexReuseRejection = 'configured-but-unrealized' | 'vectors-without-provider'; /** * Record a semantic-index failure that happened outside a full build, so `doctor`, * `status` and the freshness lease can report it. Best-effort: a failure to record a * failure must never take down the watcher. */ export declare function recordIndexEmbedFailure(outputPath: string, failure: Omit & { at?: string; }): Promise; /** Clear a recorded embed failure once the same path succeeds. */ export declare function clearIndexEmbedFailure(outputPath: string): Promise; /** The index's recorded self-state: what the last build produced, and any failure since. */ export declare function readIndexReceipt(outputPath: string): Promise<{ degraded: AnalysisIndexResult['degraded']; embedFailure?: IndexEmbedFailure; } | null>; /** Build indexes one-at-a-time per canonical output directory for every frontend. */ export declare function buildAnalysisIndexes(options: BuildAnalysisIndexesOptions): Promise; //# sourceMappingURL=analysis-indexes.d.ts.map