fix: resolve custom module.yaml from installed location during manifest generation
- resolveInstalledModuleYaml now checks _bmad/<module>/module.yaml first so freshly-installed custom/community modules are found immediately - manifest-generator passes bmadDir to resolveInstalledModuleYaml for lookup - removes 'could not locate module.yaml' warnings during custom module install - allows agents declared in custom module.yaml to be registered in config.toml
This commit is contained in:
parent
fe6eb043d4
commit
8c0f856839
|
|
@ -244,7 +244,7 @@ class ManifestGenerator {
|
||||||
const debug = process.env.BMAD_DEBUG_MANIFEST === 'true';
|
const debug = process.env.BMAD_DEBUG_MANIFEST === 'true';
|
||||||
|
|
||||||
for (const moduleName of this.updatedModules) {
|
for (const moduleName of this.updatedModules) {
|
||||||
const moduleYamlPath = await resolveInstalledModuleYaml(moduleName);
|
const moduleYamlPath = await resolveInstalledModuleYaml(moduleName, this.bmadDir);
|
||||||
if (!moduleYamlPath) {
|
if (!moduleYamlPath) {
|
||||||
// External modules live in ~/.bmad/cache/external-modules, not src/modules.
|
// External modules live in ~/.bmad/cache/external-modules, not src/modules.
|
||||||
// Warn rather than silently skip so missing agent rosters don't vanish
|
// Warn rather than silently skip so missing agent rosters don't vanish
|
||||||
|
|
@ -439,7 +439,7 @@ class ManifestGenerator {
|
||||||
// from module.yaml, so TOML sections use [modules.<code>] not [modules.<name>].
|
// from module.yaml, so TOML sections use [modules.<code>] not [modules.<name>].
|
||||||
const codeByModuleName = {};
|
const codeByModuleName = {};
|
||||||
for (const moduleName of this.updatedModules) {
|
for (const moduleName of this.updatedModules) {
|
||||||
const moduleYamlPath = await resolveInstalledModuleYaml(moduleName);
|
const moduleYamlPath = await resolveInstalledModuleYaml(moduleName, this.bmadDir);
|
||||||
if (!moduleYamlPath) {
|
if (!moduleYamlPath) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[warn] writeCentralConfig: could not locate module.yaml for '${moduleName}'. ` +
|
`[warn] writeCentralConfig: could not locate module.yaml for '${moduleName}'. ` +
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,15 @@ function getExternalModuleCachePath(moduleName, ...segments) {
|
||||||
* @param {string} moduleName
|
* @param {string} moduleName
|
||||||
* @returns {Promise<string|null>} Absolute path to module.yaml, or null if not found.
|
* @returns {Promise<string|null>} Absolute path to module.yaml, or null if not found.
|
||||||
*/
|
*/
|
||||||
async function resolveInstalledModuleYaml(moduleName) {
|
async function resolveInstalledModuleYaml(moduleName, bmadDir = null) {
|
||||||
|
// First: check _bmad/<moduleName>/module.yaml (installed location)
|
||||||
|
// This is written by installFromResolution during install, so check it
|
||||||
|
// before caches to find freshly-installed custom/community modules.
|
||||||
|
if (bmadDir) {
|
||||||
|
const installedPath = path.join(bmadDir, moduleName, 'module.yaml');
|
||||||
|
if (await fs.pathExists(installedPath)) return installedPath;
|
||||||
|
}
|
||||||
|
|
||||||
const builtIn = path.join(getModulePath(moduleName), 'module.yaml');
|
const builtIn = path.join(getModulePath(moduleName), 'module.yaml');
|
||||||
if (await fs.pathExists(builtIn)) return builtIn;
|
if (await fs.pathExists(builtIn)) return builtIn;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue