- Add comprehensive project scanning with 4-phase analysis - Integrate @ast-grep/cli for advanced syntax tree analysis - Support AI-powered project understanding with fallback - Generate structured JSON output with file/directory summaries - Add configurable include/exclude patterns and scan depth - Provide transparent logging for each analysis phase - Create task-master scan command with full CLI options This addresses issue #78 by enabling quick project structure analysis for easier Task Master adoption on existing projects. Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com>
61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
/**
|
|
* Configuration classes for project scanning functionality
|
|
*/
|
|
|
|
/**
|
|
* Configuration object for scan operations
|
|
*/
|
|
export class ScanConfig {
|
|
constructor({
|
|
projectRoot,
|
|
outputPath = null,
|
|
includeFiles = [],
|
|
excludeFiles = ['node_modules', '.git', 'dist', 'build', '*.log'],
|
|
scanDepth = 5,
|
|
mcpLog = false,
|
|
reportProgress = false,
|
|
debug = false
|
|
} = {}) {
|
|
this.projectRoot = projectRoot;
|
|
this.outputPath = outputPath;
|
|
this.includeFiles = includeFiles;
|
|
this.excludeFiles = excludeFiles;
|
|
this.scanDepth = scanDepth;
|
|
this.mcpLog = mcpLog;
|
|
this.reportProgress = reportProgress;
|
|
this.debug = debug;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Logging configuration for scan operations
|
|
*/
|
|
export class ScanLoggingConfig {
|
|
constructor(mcpLog = false, reportProgress = false) {
|
|
this.mcpLog = mcpLog;
|
|
this.reportProgress = reportProgress;
|
|
}
|
|
|
|
report(message, level = 'info') {
|
|
if (this.reportProgress || this.mcpLog) {
|
|
const prefix = this.mcpLog ? '[MCP]' : '[SCAN]';
|
|
console.log(`${prefix} ${level.toUpperCase()}: ${message}`);
|
|
}
|
|
}
|
|
|
|
debug(message) {
|
|
this.report(message, 'debug');
|
|
}
|
|
|
|
info(message) {
|
|
this.report(message, 'info');
|
|
}
|
|
|
|
warn(message) {
|
|
this.report(message, 'warn');
|
|
}
|
|
|
|
error(message) {
|
|
this.report(message, 'error');
|
|
}
|
|
} |