remcode
Version:
Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.
85 lines (84 loc) • 2.3 kB
TypeScript
export interface RemcodeState {
version: string;
created: string;
updated: string;
repository?: {
url?: string;
path?: string;
branch?: string;
commit?: string;
};
processing: {
status: 'idle' | 'analyzing' | 'vectorizing' | 'updating' | 'completed' | 'failed';
lastCommit?: string;
lastUpdated?: string;
stats?: any;
};
vectorization: {
model?: string;
chunks?: number;
vectors?: number;
lastUpdated?: string;
pineconeIndex?: string;
pineconeNamespace?: string;
};
configuration: {
includeTests?: boolean;
includeComments?: boolean;
chunkStrategy?: string;
[key: string]: any;
};
}
export declare class StateManager {
private configPath;
private filePath;
constructor(repoPath?: string);
/**
* Check if the .remcode file exists
*/
exists(): Promise<boolean>;
/**
* Load the current state from the .remcode file
*/
loadState(): Promise<RemcodeState | null>;
/**
* Create initial state file if it doesn't exist
*/
initializeState(initialState?: Partial<RemcodeState>): Promise<RemcodeState>;
/**
* Save state to .remcode file
*/
private saveState;
/**
* Update the state with new values
*/
updateState(updates: Partial<RemcodeState>): Promise<RemcodeState>;
/**
* Update processing status in the state
*/
updateProcessingStatus(status: RemcodeState['processing']['status'], lastCommit?: string): Promise<void>;
/**
* Update processing statistics
*/
updateStatistics(stats: any): Promise<void>;
/**
* Update vectorization info
*/
updateVectorizationInfo(info: Partial<RemcodeState['vectorization']>): Promise<void>;
/**
* Update repository information
*/
updateRepositoryInfo(info: Partial<RemcodeState['repository']>): Promise<void>;
/**
* Update configuration
*/
updateConfiguration(config: Partial<RemcodeState['configuration']>): Promise<void>;
/**
* Helper method to deep merge objects
*/
private deepMerge;
/**
* Helper method to check if value is an object
*/
private isObject;
}