/** * Project scanning and file detection utilities */ export interface ProjectFile { path: string; relativePath: string; name: string; extension: string; size: number; isDirectory: boolean; } export interface ProjectContext { root: string; name: string; type: string; structure: string; keyFiles: string[]; fileCount: number; summary: string; hasWriteAccess?: boolean; } export interface DetectedFile { path: string; content: string; truncated: boolean; } /** * Check if current directory is a project (has package.json or other markers) */ export declare function isProjectDirectory(dir?: string): boolean; /** * Get project type based on config files */ export declare function getProjectType(dir?: string): string; /** * Scan directory recursively up to specified depth */ export declare function scanDirectory(dir: string, maxDepth?: number, currentDepth?: number, rootDir?: string): ProjectFile[]; /** * Generate directory tree structure string */ export declare function generateTreeStructure(files: ProjectFile[], maxLines?: number): string; /** * Read a project file with size limit */ export declare function readProjectFile(filePath: string, maxSize?: number): DetectedFile | null; /** * Write content to a project file */ export declare function deleteProjectFile(filePath: string): { success: boolean; error?: string; }; export declare function writeProjectFile(filePath: string, content: string): { success: boolean; error?: string; }; /** * Parse file changes from AI response * Supports multiple formats: * 1. ```filepath:path/to/file.ts\ncode\n``` * 2. Box format with :filename on second line * 3. Delete format: ```delete:path/to/file.ts``` */ export declare function parseFileChanges(response: string): Array<{ path: string; content: string; action?: 'create' | 'edit' | 'delete'; }>; /** * Detect file paths mentioned in text */ export declare function detectFilePaths(text: string, projectRoot?: string): string[]; /** * Get full project context for AI */ export declare function getProjectContext(dir?: string): ProjectContext | null; /** * Get project summary for display */ export declare function getProjectSummary(dir?: string): { name: string; type: string; fileCount: number; hasReadme: boolean; } | null; /** * Project feature detection */ export interface ProjectFeatures { hasGit: boolean; hasPackageJson: boolean; hasTypescript: boolean; hasPython: boolean; hasDocker: boolean; hasTests: boolean; hasCargo: boolean; hasGoMod: boolean; projectType: string; } /** * Suggested command based on project features */ export interface ProjectSuggestion { command: string; description: string; reason: string; priority: number; } /** * Detect project features */ export declare function detectProjectFeatures(dir?: string): ProjectFeatures; /** * Get smart suggestions based on project type */ export declare function getProjectSuggestions(dir?: string): ProjectSuggestion[]; /** * Get a brief tip message for the project type */ export declare function getProjectTip(dir?: string): string | null;