@knath2000/codebase-indexing-mcp
Version:
MCP server for codebase indexing with Voyage AI embeddings and Qdrant vector storage
110 lines (109 loc) • 3.07 kB
TypeScript
import { EventEmitter } from 'events';
export interface WorkspaceInfo {
id: string;
name: string;
rootPath: string;
type: 'single' | 'multi-root' | 'git' | 'npm' | 'unknown';
folders: string[];
gitRemote?: string;
packageName?: string;
lastAccessed: Date;
collectionName: string;
}
export interface WorkspaceProfile {
id: string;
name: string;
excludePatterns: string[];
supportedExtensions: string[];
chunkSize: number;
enableLLMReranking: boolean;
customSettings: Record<string, any>;
}
/**
* Enhanced Workspace Manager that provides superior multi-workspace handling
* compared to Cursor's built-in capabilities
*/
export declare class WorkspaceManager extends EventEmitter {
private workspaces;
private currentWorkspace;
private workspaceProfiles;
constructor();
/**
* Detect and register current workspace with enhanced intelligence
*/
detectCurrentWorkspace(workspacePath?: string): Promise<WorkspaceInfo>;
/**
* Detect VSCode multi-root workspace from .code-workspace files
*/
private detectMultiRootWorkspace;
/**
* Detect Git workspace with remote tracking
*/
private detectGitWorkspace;
/**
* Detect npm workspace from package.json
*/
private detectNpmWorkspace;
/**
* Create basic directory workspace as fallback
*/
private createDirectoryWorkspace;
/**
* Generate cryptographic workspace ID for perfect isolation
*/
private generateWorkspaceId;
/**
* Register workspace and set as current
*/
private registerWorkspace;
/**
* Get current workspace info
*/
getCurrentWorkspace(): WorkspaceInfo | null;
/**
* Get workspace by ID
*/
getWorkspace(id: string): WorkspaceInfo | null;
/**
* List all registered workspaces
*/
getAllWorkspaces(): WorkspaceInfo[];
/**
* Switch to a different workspace
*/
switchToWorkspace(workspaceId: string): Promise<WorkspaceInfo | null>;
/**
* Create workspace profile for custom settings
*/
createWorkspaceProfile(workspace: WorkspaceInfo, customSettings: Partial<WorkspaceProfile>): WorkspaceProfile;
/**
* Get workspace profile with fallbacks
*/
getWorkspaceProfile(workspaceId: string): WorkspaceProfile | null;
/**
* Clean up stale workspaces (not accessed in 30 days)
*/
cleanupStaleWorkspaces(): Promise<string[]>;
/**
* Get workspace statistics
*/
getWorkspaceStats(): {
totalWorkspaces: number;
currentWorkspace: string | null;
recentWorkspaces: string[];
};
/**
* Export workspace configuration for backup/sync
*/
exportConfiguration(): {
workspaces: WorkspaceInfo[];
profiles: WorkspaceProfile[];
};
/**
* Import workspace configuration from backup/sync
*/
importConfiguration(config: {
workspaces: WorkspaceInfo[];
profiles: WorkspaceProfile[];
}): void;
}