From 5d470b2de3a68a8756c6955162b0071d9b0300b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davor=20Raci=C4=87?= Date: Mon, 2 Feb 2026 11:16:20 +0100 Subject: [PATCH] fix: skip internal tools in manifest generation and improve Windows path handling in command generator --- tools/cli/installers/lib/core/manifest-generator.js | 5 +++++ .../installers/lib/ide/shared/task-tool-command-generator.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cli/installers/lib/core/manifest-generator.js b/tools/cli/installers/lib/core/manifest-generator.js index a78bbd5f..a0d4b7ec 100644 --- a/tools/cli/installers/lib/core/manifest-generator.js +++ b/tools/cli/installers/lib/core/manifest-generator.js @@ -479,6 +479,11 @@ class ManifestGenerator { const filePath = path.join(dirPath, file); 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 displayName = name; let description = ''; diff --git a/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js b/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js index 18f37770..60eb5468 100644 --- a/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +++ b/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js @@ -164,7 +164,9 @@ class TaskToolCommandGenerator { // Extract relative path from absolute paths (Windows or Unix) // Look for _bmad/ or bmad/ in the path and extract everything after it // 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) { // Found /_bmad/ or /bmad/ - use relative path after it itemPath = `{project-root}/${this.bmadFolderName}/${bmadMatch[1]}`;