@webdevtoday/grok-cli
Version:
A sophisticated CLI tool for interacting with xAI Grok 4, featuring conversation history, file reference, custom commands, memory system, and genetic development workflows
95 lines • 2.39 kB
TypeScript
/**
* File reference system for @ commands
* Provides file discovery, selection, and reference management
*/
export interface FileReference {
path: string;
relativePath: string;
name: string;
size: number;
modified: Date;
type: 'file' | 'directory';
extension?: string;
isGitTracked?: boolean;
}
export interface FileSearchOptions {
pattern?: string;
maxResults?: number;
includeDirectories?: boolean;
extensions?: string[];
excludePatterns?: string[];
searchDepth?: number;
sortBy?: 'name' | 'modified' | 'size' | 'relevance';
}
/**
* File reference manager for @ command system
*/
export declare class FileReferenceManager {
private baseDir;
private gitTrackedFiles;
private fileCache;
private lastCacheUpdate;
private cacheTimeout;
constructor(baseDir?: string);
/**
* Search for files matching a pattern
*/
searchFiles(query: string, options?: FileSearchOptions): Promise<FileReference[]>;
/**
* Get file suggestions for autocomplete
*/
getFileSuggestions(partial: string): Promise<FileReference[]>;
/**
* Get path-based suggestions
*/
private getPathSuggestions;
/**
* Get file details by path
*/
getFileDetails(path: string): Promise<FileReference | null>;
/**
* Get recently modified files
*/
getRecentFiles(limit?: number): Promise<FileReference[]>;
/**
* Get git tracked files
*/
getGitTrackedFiles(): Promise<FileReference[]>;
/**
* Get files by extension
*/
getFilesByExtension(extension: string): Promise<FileReference[]>;
/**
* Get commonly used file extensions in project
*/
getCommonExtensions(): Promise<string[]>;
/**
* Update file cache if needed
*/
private updateCacheIfNeeded;
/**
* Update the file cache
*/
private updateFileCache;
/**
* Update git tracked files
*/
private updateGitTrackedFiles;
/**
* Fuzzy matching for file names
*/
private fuzzyMatch;
/**
* Sort files based on criteria
*/
private sortFiles;
/**
* Calculate relevance score for file matching
*/
private calculateRelevanceScore;
/**
* Set base directory
*/
setBaseDirectory(dir: string): void;
}
//# sourceMappingURL=file-reference.d.ts.map