bmad-method 6.3.1-next.3 → 6.3.1-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core-skills/module.yaml +1 -0
- package/tools/installer/cli-utils.js +0 -137
- package/tools/installer/core/manifest.js +0 -577
- package/tools/installer/ide/shared/path-utils.js +0 -145
- package/tools/installer/modules/custom-module-manager.js +0 -27
- package/tools/installer/modules/external-manager.js +0 -40
- package/tools/installer/modules/official-modules.js +2 -50
- package/tools/installer/modules/registry-client.js +0 -11
- package/tools/installer/prompts.js +0 -106
- package/tools/installer/ui.js +44 -11
- package/tools/installer/ide/shared/module-injections.js +0 -136
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const path = require('node:path');
|
|
2
|
-
const fs = require('fs-extra');
|
|
3
|
-
const yaml = require('yaml');
|
|
4
|
-
const { glob } = require('glob');
|
|
5
|
-
const { getSourcePath } = require('../../project-root');
|
|
6
|
-
|
|
7
|
-
async function loadModuleInjectionConfig(handler, moduleName) {
|
|
8
|
-
const sourceModulesPath = getSourcePath('modules');
|
|
9
|
-
const handlerBaseDir = path.join(sourceModulesPath, moduleName, 'sub-modules', handler);
|
|
10
|
-
const configPath = path.join(handlerBaseDir, 'injections.yaml');
|
|
11
|
-
|
|
12
|
-
if (!(await fs.pathExists(configPath))) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const configContent = await fs.readFile(configPath, 'utf8');
|
|
17
|
-
const config = yaml.parse(configContent) || {};
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
config,
|
|
21
|
-
handlerBaseDir,
|
|
22
|
-
configPath,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function shouldApplyInjection(injection, subagentChoices) {
|
|
27
|
-
if (!subagentChoices || subagentChoices.install === 'none') {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (subagentChoices.install === 'all') {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (subagentChoices.install === 'selective') {
|
|
36
|
-
const selected = subagentChoices.selected || [];
|
|
37
|
-
|
|
38
|
-
if (injection.requires === 'any' && selected.length > 0) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (injection.requires) {
|
|
43
|
-
const required = `${injection.requires}.md`;
|
|
44
|
-
return selected.includes(required);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (injection.point) {
|
|
48
|
-
const selectedNames = selected.map((file) => file.replace('.md', ''));
|
|
49
|
-
return selectedNames.some((name) => injection.point.includes(name));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function filterAgentInstructions(content, selectedFiles) {
|
|
57
|
-
if (!selectedFiles || selectedFiles.length === 0) {
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const selectedAgents = selectedFiles.map((file) => file.replace('.md', ''));
|
|
62
|
-
const lines = content.split('\n');
|
|
63
|
-
const filteredLines = [];
|
|
64
|
-
|
|
65
|
-
for (const line of lines) {
|
|
66
|
-
if (line.includes('<llm') || line.includes('</llm>')) {
|
|
67
|
-
filteredLines.push(line);
|
|
68
|
-
} else if (line.includes('subagent')) {
|
|
69
|
-
let shouldInclude = false;
|
|
70
|
-
for (const agent of selectedAgents) {
|
|
71
|
-
if (line.includes(agent)) {
|
|
72
|
-
shouldInclude = true;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (shouldInclude) {
|
|
78
|
-
filteredLines.push(line);
|
|
79
|
-
}
|
|
80
|
-
} else if (line.includes('When creating PRDs') || line.includes('ACTIVELY delegate')) {
|
|
81
|
-
filteredLines.push(line);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (filteredLines.length > 2) {
|
|
86
|
-
return filteredLines.join('\n');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return '';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async function resolveSubagentFiles(handlerBaseDir, subagentConfig, subagentChoices) {
|
|
93
|
-
if (!subagentConfig || !subagentConfig.files) {
|
|
94
|
-
return [];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (!subagentChoices || subagentChoices.install === 'none') {
|
|
98
|
-
return [];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
let filesToCopy = subagentConfig.files;
|
|
102
|
-
|
|
103
|
-
if (subagentChoices.install === 'selective') {
|
|
104
|
-
filesToCopy = subagentChoices.selected || [];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const sourceDir = path.join(handlerBaseDir, subagentConfig.source || '');
|
|
108
|
-
const resolved = [];
|
|
109
|
-
|
|
110
|
-
for (const file of filesToCopy) {
|
|
111
|
-
// Use forward slashes for glob pattern (works on both Windows and Unix)
|
|
112
|
-
// Convert backslashes to forward slashes for glob compatibility
|
|
113
|
-
const normalizedSourceDir = sourceDir.replaceAll('\\', '/');
|
|
114
|
-
const pattern = `${normalizedSourceDir}/**/${file}`;
|
|
115
|
-
const matches = await glob(pattern);
|
|
116
|
-
|
|
117
|
-
if (matches.length > 0) {
|
|
118
|
-
const absolutePath = matches[0];
|
|
119
|
-
resolved.push({
|
|
120
|
-
file,
|
|
121
|
-
absolutePath,
|
|
122
|
-
relativePath: path.relative(sourceDir, absolutePath),
|
|
123
|
-
sourceDir,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return resolved;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
module.exports = {
|
|
132
|
-
loadModuleInjectionConfig,
|
|
133
|
-
shouldApplyInjection,
|
|
134
|
-
filterAgentInstructions,
|
|
135
|
-
resolveSubagentFiles,
|
|
136
|
-
};
|