import type { ProjectIndexServerActivity, ProjectServerClientMessage, ProjectServerMessage } from './project-server-protocol.js'; import { type ServerQueryCaches } from './project-server-query-cache.js'; import type { ActiveFullIndex, ClientState } from './project-server-types.js'; import type { IndexOpArgs, OpShapes } from './worker-protocol.js'; export interface OperationContext { projectRoot: string; indexDir: string; queryCaches: ServerQueryCaches; getActivity: () => ProjectIndexServerActivity; withIndexWrite: (job: (onProgress: (currentFile: number, totalFiles: number) => void) => Promise, options: { preserveCaches: boolean; }) => Promise; send: (state: ClientState, message: ProjectServerMessage) => void; getActiveFullIndex: () => ActiveFullIndex | null; setActiveFullIndex: (active: ActiveFullIndex | null) => void; } /** * Cache policy at write-run completion. * * A run with an explicit targeted file list (edit/watcher reindex) makes a * per-file surgical change, so — on success — every previous-generation entry * stays valid as a stale answer for the NEXT refresh. On failure the run's * transaction rolls back, which equally leaves the cached entries describing * the on-disk truth. (Precision: the rollback is per-file — a multi-file * targeted run commits the files that parsed and rolls back only the failed * one — but each file's slice is atomic, and queries never straddle slices, * so cached answers stay correct.) Anything else (full scan, force rebuild, * langs/ignore-filtered scan) can reshape the whole index, so its caches are * dropped on completion and on failure alike. */ export declare function preservesQueryCaches(args: IndexOpArgs): boolean; export declare function isShareableFullIndex(args: IndexOpArgs): boolean; export declare function runFullIndex(ctx: OperationContext, state: ClientState, id: number, args: IndexOpArgs): Promise; export declare function dispatchOperation(ctx: OperationContext, state: ClientState, message: Extract): Promise; //# sourceMappingURL=project-server-operations.d.ts.map