/** * Workspace Intelligence public facade. * * Provides a single entry point for building, refreshing, querying and * diagnosing a durable workspace index. The index is always a disposable, * rebuildable projection of the authoritative current workspace. */ import { embeddingSummary, type WorkspaceIndexConfig } from "./config.js"; import { type ResolvedWorkspaceIdentity } from "./identity.js"; import { type BuildOptions, type BuildReport } from "./indexer.js"; import type { RetrievalPlan, WorkspaceRetrievalResult } from "./types.js"; export interface IndexStatus { workspaceId: string; root: string; storageDir: string; hasReadyGeneration: boolean; currentGeneration?: string; generationCount: number; schemaVersion: number; embedding: ReturnType; fileCount?: number; chunkCount?: number; symbolCount?: number; embeddingCount?: number; freshnessCheck?: "current" | "possibly_stale" | "stale" | "unknown"; } export interface SearchOptions { query: string; mode?: "lexical" | "semantic" | "symbol" | "hybrid" | "path"; limit?: number; languageFilters?: string[]; fileClassFilters?: string[]; pathFilter?: string; currentFile?: string; currentSymbol?: string; freshOnly?: boolean; taskRole?: string; } export declare class WorkspaceIndex { readonly identity: ResolvedWorkspaceIdentity; readonly config: WorkspaceIndexConfig; readonly storageDir: string; private db; private embedding?; constructor(cwd: string, config?: Partial); close(): void; /** Resolve the configured embedding backend, or a supplied override for tests. */ private getEmbedding; build(opts?: BuildOptions): Promise; refresh(opts?: BuildOptions): Promise; status(): IndexStatus; generations(): Array<{ generationId: string; status: string; createdAt: string; fileCount: number; chunkCount: number; }>; inspectGeneration(generationId: string): object | undefined; search(opts: SearchOptions): { plan: RetrievalPlan; results: WorkspaceRetrievalResult[]; }; /** Revalidate a result's content hash against the current file. */ revalidate(result: WorkspaceRetrievalResult): WorkspaceRetrievalResult["freshness"]; verify(deep?: boolean): { valid: boolean; issues: string[]; checks: Array<{ name: string; status: string; }>; }; /** Prune superseded/failed generations and stale data. */ prune(opts: { preview?: boolean; keepAudit?: number; activeEvidence?: Set; }): { removed: string[]; preview: boolean; }; private deleteGenerationData; /** Discard all index state for the workspace (rebuild from source). */ rebuild(opts?: BuildOptions): Promise; /** Delete the entire index directory (destructive, user-invoked). */ destroy(): void; /** List indexed file records for a generation (bounded). */ files(generationId?: string): Array<{ path: string; classification: string; languageId?: string; }>; symbols(generationId?: string, limit?: number): Array<{ name: string; kind: string; path: string; startLine: number; }>; stats(): { files: number; chunks: number; symbols: number; embeddings: number; byLanguage: Record; }; } export type { WorkspaceIndexConfig } from "./config.js"; export { resolveWorkspaceIdentity, workspaceIndexDir } from "./identity.js"; export { executeRetrieval, type RetrieveOptions, revalidateResult } from "./retrieve.js"; /** Doctor checks for the workspace index subsystem (read-only). */ type WsCheckStatus = "pass" | "fail" | "warn" | "unavailable" | "skipped"; export declare function workspaceDoctorChecks(cwd: string): Array<{ checkId: string; component: string; status: WsCheckStatus; reasonCode: string; summary: string; }>; //# sourceMappingURL=index.d.ts.map