fix: skip internal tools in manifest generation and improve Windows path handling in command generator

This commit is contained in:
Davor Racić 2026-02-02 11:16:20 +01:00
parent 6f99092be1
commit 5d470b2de3
2 changed files with 8 additions and 1 deletions

View File

@ -479,6 +479,11 @@ class ManifestGenerator {
const filePath = path.join(dirPath, file); const filePath = path.join(dirPath, file);
const content = await fs.readFile(filePath, 'utf8'); const content = await fs.readFile(filePath, 'utf8');
// Skip internal tools (same as tasks)
if (content.includes('internal="true"')) {
continue;
}
let name = file.replace(/\.(xml|md)$/, ''); let name = file.replace(/\.(xml|md)$/, '');
let displayName = name; let displayName = name;
let description = ''; let description = '';

View File

@ -164,7 +164,9 @@ class TaskToolCommandGenerator {
// Extract relative path from absolute paths (Windows or Unix) // Extract relative path from absolute paths (Windows or Unix)
// Look for _bmad/ or bmad/ in the path and extract everything after it // Look for _bmad/ or bmad/ in the path and extract everything after it
// Match patterns like: /_bmad/core/tasks/... or /bmad/core/tasks/... // Match patterns like: /_bmad/core/tasks/... or /bmad/core/tasks/...
const bmadMatch = itemPath.match(/\/_bmad\/(.+)$/) || itemPath.match(/\/bmad\/(.+)$/); // Use [/\\] to handle both Unix forward slashes and Windows backslashes,
// and also paths without a leading separator (e.g., C:/_bmad/...)
const bmadMatch = itemPath.match(/[/\\]_bmad[/\\](.+)$/) || itemPath.match(/[/\\]bmad[/\\](.+)$/);
if (bmadMatch) { if (bmadMatch) {
// Found /_bmad/ or /bmad/ - use relative path after it // Found /_bmad/ or /bmad/ - use relative path after it
itemPath = `{project-root}/${this.bmadFolderName}/${bmadMatch[1]}`; itemPath = `{project-root}/${this.bmadFolderName}/${bmadMatch[1]}`;