giga-code
Version:
A personal AI CLI assistant powered by Grok for local development.
59 lines (58 loc) • 1.72 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from 'events';
interface IndexingJob {
id: string;
type: 'full' | 'incremental' | 'file';
filePaths?: string[];
status: 'pending' | 'running' | 'completed' | 'failed';
startTime?: Date;
endTime?: Date;
error?: string;
stats?: {
filesProcessed: number;
chunksCreated: number;
duration: number;
};
}
export declare class IndexingService extends EventEmitter {
private ragService;
private projectPath;
private fileWatcher;
private isWatching;
private jobQueue;
private currentJob;
private jobIdCounter;
private lastFullIndexTime;
private pendingChanges;
private changeDebounceTimer;
private readonly DEBOUNCE_DELAY;
constructor(projectPath?: string);
initialize(): Promise<void>;
startWatching(): Promise<void>;
stopWatching(): Promise<void>;
private shouldWatchFile;
private globToRegex;
private handleFileChange;
private processFileChanges;
scheduleFullIndex(): string;
scheduleIncrementalIndex(filePaths: string[]): string;
scheduleFileIndex(filePath: string): string;
private processJobQueue;
private executeJob;
getCurrentJob(): IndexingJob | null;
getJobQueue(): IndexingJob[];
getJobHistory(): IndexingJob[];
getIndexingStatus(): Promise<{
isWatching: boolean;
currentJob: IndexingJob | null;
queueLength: number;
lastFullIndex: Date | null;
indexInfo: {
count: number;
enabled: boolean;
};
}>;
clearIndex(): Promise<void>;
static createAndStart(projectPath?: string): Promise<IndexingService>;
}
export {};