@ai-capabilities-suite/mcp-debugger-core
Version:
Core debugging engine for Node.js and TypeScript applications. Provides Inspector Protocol integration, breakpoint management, variable inspection, execution control, profiling, hang detection, and source map support.
73 lines (72 loc) • 2.2 kB
TypeScript
/**
* Workspace-aware debugging support for monorepos and multi-package projects
* Handles workspace detection, package.json resolution, and workspace-relative paths
*/
export interface WorkspacePackage {
name: string;
path: string;
packageJson: any;
}
export interface WorkspaceInfo {
root: string;
type: "single" | "npm-workspaces" | "yarn-workspaces" | "pnpm-workspaces" | "lerna" | "nx";
packages: WorkspacePackage[];
}
/**
* Manages workspace-aware debugging for monorepos
*/
export declare class WorkspaceManager {
private workspaceCache;
/**
* Detect workspace structure from a given directory
*/
detectWorkspace(cwd: string): Promise<WorkspaceInfo | null>;
/**
* Find the workspace root by looking for workspace configuration files
*/
private findWorkspaceRoot;
/**
* Analyze workspace to determine type and find all packages
*/
private analyzeWorkspace;
/**
* Get package patterns from nx.json
*/
private getNxPackagePatterns;
/**
* Get package patterns from pnpm-workspace.yaml
*/
private getPnpmWorkspacePatterns;
/**
* Find all packages matching the given patterns
*/
private findPackages;
/**
* Simple glob expansion (supports * wildcard)
*/
private expandGlob;
/**
* Find the package that contains a given file
*/
findPackageForFile(workspaceInfo: WorkspaceInfo, filePath: string): WorkspacePackage | null;
/**
* Resolve a workspace-relative path to an absolute path
*/
resolveWorkspacePath(workspaceInfo: WorkspaceInfo, relativePath: string): string;
/**
* Convert an absolute path to a workspace-relative path
*/
makeWorkspaceRelative(workspaceInfo: WorkspaceInfo, absolutePath: string): string;
/**
* Get all package.json files in the workspace
*/
getAllPackageJsons(workspaceInfo: WorkspaceInfo): string[];
/**
* Find the appropriate working directory for debugging a file
*/
getWorkingDirectoryForFile(workspaceInfo: WorkspaceInfo, filePath: string): string;
/**
* Clear the workspace cache
*/
clearCache(): void;
}