mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
93 lines • 2.99 kB
TypeScript
/**
* File system utilities for MCP ADR Analysis Server
* Generates prompts for AI-driven file discovery, reading, and analysis operations
* Enhanced with Chain-of-Thought prompting to reduce LLM confusion
*/
export interface FileInfo {
path: string;
name: string;
extension: string;
size: number;
directory: string;
content?: string;
}
export interface ProjectStructure {
rootPath: string;
files: FileInfo[];
directories: string[];
totalFiles: number;
totalDirectories: number;
}
export interface ProjectAnalysisPrompt {
prompt: string;
instructions: string;
context: {
projectPath: string;
absoluteProjectPath: string;
filePatterns: string[];
};
}
/**
* Generate prompt for AI-driven project structure analysis
*/
export declare function analyzeProjectStructure(projectPath: string): Promise<ProjectAnalysisPrompt>;
/**
* Generate prompt for AI-driven file content reading
*/
export declare function readFileContent(filePath: string): Promise<{
prompt: string;
instructions: string;
context: any;
}>;
/**
* Generate prompt for AI-driven file discovery
*/
export declare function findFiles(projectPath: string, patterns: string[], options?: {
includeContent?: boolean;
}): Promise<{
prompt: string;
instructions: string;
context: any;
}>;
/**
* Generate prompt for AI-driven file existence check
*/
export declare function fileExists(filePath: string): Promise<{
prompt: string;
instructions: string;
context: any;
}>;
/**
* Generate prompt for AI-driven directory creation
*/
export declare function ensureDirectory(dirPath: string): Promise<{
prompt: string;
instructions: string;
context: any;
}>;
/**
* Generate prompt for AI-driven file writing with directory creation
*/
export declare function writeFile(filePath: string, content: string): Promise<{
prompt: string;
instructions: string;
context: any;
}>;
/**
* Get file extension patterns for different file types
*/
export declare const FILE_PATTERNS: {
readonly config: readonly ["package.json", "tsconfig.json", "*.config.js", "*.config.ts", ".env*", "Dockerfile", "docker-compose.yml"];
readonly typescript: readonly ["**/*.ts", "**/*.tsx"];
readonly javascript: readonly ["**/*.js", "**/*.jsx"];
readonly python: readonly ["**/*.py"];
readonly java: readonly ["**/*.java"];
readonly csharp: readonly ["**/*.cs"];
readonly go: readonly ["**/*.go"];
readonly rust: readonly ["**/*.rs"];
readonly documentation: readonly ["**/*.md", "**/*.rst", "**/*.txt", "**/README*"];
readonly adrs: readonly ["docs/adrs/**/*.md", "adrs/**/*.md", "decisions/**/*.md"];
readonly build: readonly ["Makefile", "*.mk", "build.gradle", "pom.xml", "Cargo.toml"];
readonly ci: readonly [".github/workflows/**/*.yml", ".github/workflows/**/*.yaml", ".gitlab-ci.yml", "azure-pipelines.yml"];
};
//# sourceMappingURL=file-system.d.ts.map