import { CursorCloudIndexAdapter, type CursorCloudEnsureResult, type CursorCloudSearchDiagnostic, type CursorCloudSearchOutcome } from "./cursor-index-cloud"; import { type WorkspaceContextOptions } from "./workspace-context"; import type { CursorCloudCodeResult } from "./cursor-index-wire"; export type CursorIndexMode = "cloud" | "watching" | "fallback"; export type CursorCloudReadiness = "disabled" | "initializing" | "ready" | "degraded" | "unavailable"; export type CursorCloudFreshness = "unknown" | "current-at-bootstrap" | "stale-after-local-change"; export interface CursorIndexStatus { cloudReadiness: CursorCloudReadiness; cloudFreshness: CursorCloudFreshness; bootstrapOutcome?: CursorCloudEnsureResult["outcome"]; } export interface CursorIndexSearchResult { adapterSessionId: string; body: string; matchCount: number; cloudReadiness: CursorCloudReadiness; cloudFreshness: CursorCloudFreshness; cloudQueryOutcome: CursorCloudSearchOutcome; cloudDiagnostic: CursorCloudSearchDiagnostic; bootstrapOutcome?: CursorCloudEnsureResult["outcome"]; servingSource: "cloud" | "local-fallback" | "merged"; scope: "workspace" | "target-directories" | "post-filtered-cloud-top-k"; } export interface CursorCodebaseSearchArgs { query: string; targetDirectories?: string[]; explanation?: string; } export interface CursorIndexManager { search(args: CursorCodebaseSearchArgs): Promise; dispose(): void; getMode(): CursorIndexMode; getStatus(): CursorIndexStatus; ensureCloudIndex(): Promise; } export interface FileRecord { path: string; text: string; } export interface LocalWorkspaceIndex { readRecords(root: string, limit: number, workspaceRoot: string): Promise; } declare function readRecordsViaWalk(root: string, limit?: number, workspaceRoot?: string): Promise; declare function discoverRgCandidates(): string[]; declare function validateRgCandidate(candidate: string, timeoutMs?: number): Promise; declare function runRgFiles(candidate: string, dir: string, timeoutMs?: number, maxBytes?: number, maxLines?: number): Promise; declare function resetRgCandidateCacheForTest(): void; declare function getRgCandidateCacheForTest(): { hasCached: boolean; cached: string | undefined; pending: boolean; }; declare function setRgCandidateMocksForTest(overrides: { validate?: ((candidate: string, timeoutMs?: number) => Promise) | undefined; discover?: (() => string[]) | undefined; }): () => void; declare function readRecordsViaRg(root: string, limit?: number, workspaceRoot?: string): Promise; export declare function createLocalWorkspaceIndex(): LocalWorkspaceIndex; export declare const __localIndexTest: { readRecordsViaWalk: typeof readRecordsViaWalk; readRecordsViaRg: typeof readRecordsViaRg; discoverRgCandidates: typeof discoverRgCandidates; validateRgCandidate: typeof validateRgCandidate; runRgFiles: typeof runRgFiles; resetRgCandidateCache: typeof resetRgCandidateCacheForTest; getRgCandidateCache: typeof getRgCandidateCacheForTest; setRgCandidateMocks: typeof setRgCandidateMocksForTest; }; export declare function isIgnoredWatchPathForTest(path: string): boolean; declare function setWatchDelaysForTest(debounceMs: number, minRefreshMs: number): () => void; declare function setCloudAdapterForTest(manager: CursorIndexManager, fake: unknown): void; declare function createFakeCloudAdapterForTest(results: CursorCloudCodeResult[], outcome?: CursorCloudSearchOutcome, extra?: Partial): CursorCloudIndexAdapter; export declare const __test: { setWatchDelaysForTest: typeof setWatchDelaysForTest; setCloudAdapterForTest: typeof setCloudAdapterForTest; createFakeCloudAdapterForTest: typeof createFakeCloudAdapterForTest; }; export declare function renderCursorIndexSearchResult(result: CursorIndexSearchResult): string; export declare function startCursorIndexManager(options?: WorkspaceContextOptions): CursorIndexManager; export declare function getCursorIndexManager(options?: WorkspaceContextOptions): CursorIndexManager; export declare function stopCursorIndexManager(options?: WorkspaceContextOptions): void; export {};