refactor(installer): remove dead .agent.yaml/.xml fallback logic (#2084)
This commit is contained in:
parent
93a1e1dc46
commit
ad9cb7a177
|
|
@ -704,21 +704,12 @@ class ManifestGenerator {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this looks like a module (has agents, workflows, or tasks directory)
|
// Check if this looks like a module (has agents directory or skill manifests)
|
||||||
const modulePath = path.join(bmadDir, entry.name);
|
const modulePath = path.join(bmadDir, entry.name);
|
||||||
const hasAgents = await fs.pathExists(path.join(modulePath, 'agents'));
|
const hasAgents = await fs.pathExists(path.join(modulePath, 'agents'));
|
||||||
const hasWorkflows = await fs.pathExists(path.join(modulePath, 'workflows'));
|
const hasSkills = await this._hasSkillMdRecursive(modulePath);
|
||||||
const hasTasks = await fs.pathExists(path.join(modulePath, 'tasks'));
|
|
||||||
const hasTools = await fs.pathExists(path.join(modulePath, 'tools'));
|
|
||||||
|
|
||||||
// Check for native-entrypoint-only modules: recursive scan for SKILL.md
|
if (hasAgents || hasSkills) {
|
||||||
let hasSkills = false;
|
|
||||||
if (!hasAgents && !hasWorkflows && !hasTasks && !hasTools) {
|
|
||||||
hasSkills = await this._hasSkillMdRecursive(modulePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it has any of these directories or skill manifests, it's likely a module
|
|
||||||
if (hasAgents || hasWorkflows || hasTasks || hasTools || hasSkills) {
|
|
||||||
modules.push(entry.name);
|
modules.push(entry.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ async function loadSkillManifest(dirPath) {
|
||||||
/**
|
/**
|
||||||
* Get the canonicalId for a specific file from a loaded skill manifest.
|
* Get the canonicalId for a specific file from a loaded skill manifest.
|
||||||
* @param {Object|null} manifest - Loaded manifest (from loadSkillManifest)
|
* @param {Object|null} manifest - Loaded manifest (from loadSkillManifest)
|
||||||
* @param {string} filename - Source filename to look up (e.g., 'pm.md', 'help.md', 'pm.agent.yaml')
|
* @param {string} filename - Source filename to look up (e.g., 'pm.md', 'help.md')
|
||||||
* @returns {string} canonicalId or empty string
|
* @returns {string} canonicalId or empty string
|
||||||
*/
|
*/
|
||||||
function getCanonicalId(manifest, filename) {
|
function getCanonicalId(manifest, filename) {
|
||||||
|
|
@ -36,12 +36,6 @@ function getCanonicalId(manifest, filename) {
|
||||||
if (manifest.__single) return manifest.__single.canonicalId || '';
|
if (manifest.__single) return manifest.__single.canonicalId || '';
|
||||||
// Multi-entry: look up by filename directly
|
// Multi-entry: look up by filename directly
|
||||||
if (manifest[filename]) return manifest[filename].canonicalId || '';
|
if (manifest[filename]) return manifest[filename].canonicalId || '';
|
||||||
// Fallback: try alternate extensions for compiled files
|
|
||||||
const baseName = filename.replace(/\.(md|xml)$/i, '');
|
|
||||||
const agentKey = `${baseName}.agent.yaml`;
|
|
||||||
if (manifest[agentKey]) return manifest[agentKey].canonicalId || '';
|
|
||||||
const xmlKey = `${baseName}.xml`;
|
|
||||||
if (manifest[xmlKey]) return manifest[xmlKey].canonicalId || '';
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,12 +51,6 @@ function getArtifactType(manifest, filename) {
|
||||||
if (manifest.__single) return manifest.__single.type || null;
|
if (manifest.__single) return manifest.__single.type || null;
|
||||||
// Multi-entry: look up by filename directly
|
// Multi-entry: look up by filename directly
|
||||||
if (manifest[filename]) return manifest[filename].type || null;
|
if (manifest[filename]) return manifest[filename].type || null;
|
||||||
// Fallback: try alternate extensions for compiled files
|
|
||||||
const baseName = filename.replace(/\.(md|xml)$/i, '');
|
|
||||||
const agentKey = `${baseName}.agent.yaml`;
|
|
||||||
if (manifest[agentKey]) return manifest[agentKey].type || null;
|
|
||||||
const xmlKey = `${baseName}.xml`;
|
|
||||||
if (manifest[xmlKey]) return manifest[xmlKey].type || null;
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,12 +66,6 @@ function getInstallToBmad(manifest, filename) {
|
||||||
if (manifest.__single) return manifest.__single.install_to_bmad !== false;
|
if (manifest.__single) return manifest.__single.install_to_bmad !== false;
|
||||||
// Multi-entry: look up by filename directly
|
// Multi-entry: look up by filename directly
|
||||||
if (manifest[filename]) return manifest[filename].install_to_bmad !== false;
|
if (manifest[filename]) return manifest[filename].install_to_bmad !== false;
|
||||||
// Fallback: try alternate extensions for compiled files
|
|
||||||
const baseName = filename.replace(/\.(md|xml)$/i, '');
|
|
||||||
const agentKey = `${baseName}.agent.yaml`;
|
|
||||||
if (manifest[agentKey]) return manifest[agentKey].install_to_bmad !== false;
|
|
||||||
const xmlKey = `${baseName}.xml`;
|
|
||||||
if (manifest[xmlKey]) return manifest[xmlKey].install_to_bmad !== false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue