fix: standardize on file extension .yaml instead of a mix of yml and yaml
This commit is contained in:
@@ -4,7 +4,7 @@ const yaml = require('js-yaml');
|
||||
|
||||
class ConfigLoader {
|
||||
constructor() {
|
||||
this.configPath = path.join(__dirname, '..', 'config', 'install.config.yml');
|
||||
this.configPath = path.join(__dirname, '..', 'config', 'install.config.yaml');
|
||||
this.config = null;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class ConfigLoader {
|
||||
const agentContent = await fs.readFile(agentPath, 'utf8');
|
||||
|
||||
// Extract YAML block from agent file
|
||||
const yamlMatch = agentContent.match(/```yml\n([\s\S]*?)\n```/);
|
||||
const yamlMatch = agentContent.match(/```yaml\n([\s\S]*?)\n```/);
|
||||
if (yamlMatch) {
|
||||
const yamlContent = yaml.load(yamlMatch[1]);
|
||||
const agentConfig = yamlContent.agent || {};
|
||||
@@ -79,10 +79,10 @@ class ConfigLoader {
|
||||
for (const entry of entries) {
|
||||
if (entry.isDirectory() && !entry.name.startsWith('.')) {
|
||||
const packPath = path.join(expansionPacksDir, entry.name);
|
||||
const configPath = path.join(packPath, 'config.yml');
|
||||
const configPath = path.join(packPath, 'config.yaml');
|
||||
|
||||
try {
|
||||
// Read config.yml
|
||||
// Read config.yaml
|
||||
const configContent = await fs.readFile(configPath, 'utf8');
|
||||
const config = yaml.load(configContent);
|
||||
|
||||
@@ -97,7 +97,7 @@ class ConfigLoader {
|
||||
dependencies: config.dependencies?.agents || []
|
||||
});
|
||||
} catch (error) {
|
||||
// Fallback if config.yml doesn't exist or can't be read
|
||||
// Fallback if config.yaml doesn't exist or can't be read
|
||||
console.warn(`Failed to read config for expansion pack ${entry.name}: ${error.message}`);
|
||||
|
||||
// Try to derive info from directory name as fallback
|
||||
@@ -180,7 +180,7 @@ class ConfigLoader {
|
||||
const teams = [];
|
||||
|
||||
for (const entry of entries) {
|
||||
if (entry.isFile() && entry.name.endsWith('.yml')) {
|
||||
if (entry.isFile() && entry.name.endsWith('.yaml')) {
|
||||
const teamPath = path.join(teamsDir, entry.name);
|
||||
|
||||
try {
|
||||
@@ -189,7 +189,7 @@ class ConfigLoader {
|
||||
|
||||
if (teamConfig.bundle) {
|
||||
teams.push({
|
||||
id: path.basename(entry.name, '.yml'),
|
||||
id: path.basename(entry.name, '.yaml'),
|
||||
name: teamConfig.bundle.name || entry.name,
|
||||
description: teamConfig.bundle.description || 'Team configuration',
|
||||
icon: teamConfig.bundle.icon || '📋'
|
||||
@@ -209,7 +209,7 @@ class ConfigLoader {
|
||||
}
|
||||
|
||||
getTeamPath(teamId) {
|
||||
return path.join(this.getBmadCorePath(), 'agent-teams', `${teamId}.yml`);
|
||||
return path.join(this.getBmadCorePath(), 'agent-teams', `${teamId}.yaml`);
|
||||
}
|
||||
|
||||
async getTeamDependencies(teamId) {
|
||||
@@ -224,7 +224,7 @@ class ConfigLoader {
|
||||
const depPaths = [];
|
||||
|
||||
// Add team config file
|
||||
depPaths.push(`.bmad-core/agent-teams/${teamId}.yml`);
|
||||
depPaths.push(`.bmad-core/agent-teams/${teamId}.yaml`);
|
||||
|
||||
// Add all agents
|
||||
for (const agent of teamDeps.agents) {
|
||||
@@ -236,7 +236,7 @@ class ConfigLoader {
|
||||
|
||||
// Add all resolved resources
|
||||
for (const resource of teamDeps.resources) {
|
||||
const filePath = `.bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yml' : 'md'}`;
|
||||
const filePath = `.bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yaml' : 'md'}`;
|
||||
if (!depPaths.includes(filePath)) {
|
||||
depPaths.push(filePath);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ async function initializeModules() {
|
||||
class FileManager {
|
||||
constructor() {
|
||||
this.manifestDir = ".bmad-core";
|
||||
this.manifestFile = "install-manifest.yml";
|
||||
this.manifestFile = "install-manifest.yaml";
|
||||
}
|
||||
|
||||
async copyFile(source, destination) {
|
||||
@@ -83,15 +83,15 @@ class FileManager {
|
||||
this.manifestFile
|
||||
);
|
||||
|
||||
// Read version from core-config.yml
|
||||
const coreConfigPath = path.join(__dirname, "../../../bmad-core/core-config.yml");
|
||||
// Read version from core-config.yaml
|
||||
const coreConfigPath = path.join(__dirname, "../../../bmad-core/core-config.yaml");
|
||||
let coreVersion = "unknown";
|
||||
try {
|
||||
const coreConfigContent = await fs.readFile(coreConfigPath, "utf8");
|
||||
const coreConfig = yaml.load(coreConfigContent);
|
||||
coreVersion = coreConfig.version || "unknown";
|
||||
} catch (error) {
|
||||
console.warn("Could not read version from core-config.yml, using 'unknown'");
|
||||
console.warn("Could not read version from core-config.yaml, using 'unknown'");
|
||||
}
|
||||
|
||||
const manifest = {
|
||||
@@ -178,7 +178,7 @@ class FileManager {
|
||||
const filePath = path.join(installDir, file.path);
|
||||
|
||||
// Skip checking the manifest file itself - it will always be different due to timestamps
|
||||
if (file.path.endsWith('install-manifest.yml')) {
|
||||
if (file.path.endsWith('install-manifest.yaml')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class IdeSetup {
|
||||
if (this.ideAgentConfig) return this.ideAgentConfig;
|
||||
|
||||
try {
|
||||
const configPath = path.join(__dirname, '..', 'config', 'ide-agent-config.yml');
|
||||
const configPath = path.join(__dirname, '..', 'config', 'ide-agent-config.yaml');
|
||||
const configContent = await fs.readFile(configPath, 'utf8');
|
||||
this.ideAgentConfig = yaml.load(configContent);
|
||||
return this.ideAgentConfig;
|
||||
@@ -98,7 +98,7 @@ class IdeSetup {
|
||||
mdcContent += "## Agent Activation\n\n";
|
||||
mdcContent +=
|
||||
"CRITICAL: Read the full YML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
|
||||
mdcContent += "```yml\n";
|
||||
mdcContent += "```yaml\n";
|
||||
// Extract just the YAML content from the agent file
|
||||
const yamlMatch = agentContent.match(/```ya?ml\n([\s\S]*?)```/);
|
||||
if (yamlMatch) {
|
||||
@@ -180,7 +180,7 @@ class IdeSetup {
|
||||
mdContent += "## Agent Activation\n\n";
|
||||
mdContent +=
|
||||
"CRITICAL: Read the full YML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
|
||||
mdContent += "```yml\n";
|
||||
mdContent += "```yaml\n";
|
||||
// Extract just the YAML content from the agent file
|
||||
const yamlMatch = agentContent.match(/```ya?ml\n([\s\S]*?)```/);
|
||||
if (yamlMatch) {
|
||||
@@ -428,7 +428,7 @@ class IdeSetup {
|
||||
mdContent += "## Role Definition\n\n";
|
||||
mdContent +=
|
||||
"When the user types `@" + agentId + "`, adopt this persona and follow these guidelines:\n\n";
|
||||
mdContent += "```yml\n";
|
||||
mdContent += "```yaml\n";
|
||||
// Extract just the YAML content from the agent file
|
||||
const yamlMatch = agentContent.match(/```ya?ml\n([\s\S]*?)```/);
|
||||
if (yamlMatch) {
|
||||
|
||||
@@ -19,13 +19,13 @@ class Installer {
|
||||
async getCoreVersion() {
|
||||
const yaml = require("js-yaml");
|
||||
const fs = require("fs-extra");
|
||||
const coreConfigPath = path.join(__dirname, "../../../bmad-core/core-config.yml");
|
||||
const coreConfigPath = path.join(__dirname, "../../../bmad-core/core-config.yaml");
|
||||
try {
|
||||
const coreConfigContent = await fs.readFile(coreConfigPath, "utf8");
|
||||
const coreConfig = yaml.load(coreConfigContent);
|
||||
return coreConfig.version || "unknown";
|
||||
} catch (error) {
|
||||
console.warn("Could not read version from core-config.yml, using 'unknown'");
|
||||
console.warn("Could not read version from core-config.yaml, using 'unknown'");
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class Installer {
|
||||
|
||||
// Check for V4 installation (has .bmad-core with manifest)
|
||||
const bmadCorePath = path.join(installDir, ".bmad-core");
|
||||
const manifestPath = path.join(bmadCorePath, "install-manifest.yml");
|
||||
const manifestPath = path.join(bmadCorePath, "install-manifest.yaml");
|
||||
|
||||
if (await fileManager.pathExists(manifestPath)) {
|
||||
state.type = "v4_existing";
|
||||
@@ -713,7 +713,7 @@ class Installer {
|
||||
|
||||
for (const file of filesToRestore) {
|
||||
// Skip the manifest file itself
|
||||
if (file.endsWith('install-manifest.yml')) continue;
|
||||
if (file.endsWith('install-manifest.yaml')) continue;
|
||||
|
||||
const relativePath = file.replace('.bmad-core/', '');
|
||||
const destPath = path.join(installDir, file);
|
||||
@@ -1009,7 +1009,7 @@ class Installer {
|
||||
|
||||
// Check if expansion pack already exists
|
||||
let expansionDotFolder = path.join(installDir, `.${packId}`);
|
||||
const existingManifestPath = path.join(expansionDotFolder, 'install-manifest.yml');
|
||||
const existingManifestPath = path.join(expansionDotFolder, 'install-manifest.yaml');
|
||||
|
||||
if (await fileManager.pathExists(existingManifestPath)) {
|
||||
spinner.stop();
|
||||
@@ -1151,12 +1151,12 @@ class Installer {
|
||||
}
|
||||
}
|
||||
|
||||
// Copy config.yml
|
||||
const configPath = path.join(expansionPackDir, 'config.yml');
|
||||
// Copy config.yaml
|
||||
const configPath = path.join(expansionPackDir, 'config.yaml');
|
||||
if (await fileManager.pathExists(configPath)) {
|
||||
const configDestPath = path.join(expansionDotFolder, 'config.yml');
|
||||
const configDestPath = path.join(expansionDotFolder, 'config.yaml');
|
||||
if (await fileManager.copyFile(configPath, configDestPath)) {
|
||||
installedFiles.push(path.join(`.${packId}`, 'config.yml'));
|
||||
installedFiles.push(path.join(`.${packId}`, 'config.yaml'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1268,7 +1268,7 @@ class Installer {
|
||||
const fs = require('fs').promises;
|
||||
|
||||
// Find all team files in the expansion pack
|
||||
const teamFiles = glob.sync('agent-teams/*.yml', {
|
||||
const teamFiles = glob.sync('agent-teams/*.yaml', {
|
||||
cwd: expansionDotFolder
|
||||
});
|
||||
|
||||
@@ -1330,7 +1330,7 @@ class Installer {
|
||||
const deps = dependencies[depType] || [];
|
||||
|
||||
for (const dep of deps) {
|
||||
const depFileName = dep.endsWith('.md') || dep.endsWith('.yml') ? dep : `${dep}.md`;
|
||||
const depFileName = dep.endsWith('.md') || dep.endsWith('.yaml') ? dep : `${dep}.md`;
|
||||
const expansionDepPath = path.join(expansionDotFolder, depType, depFileName);
|
||||
|
||||
// Check if dependency exists in expansion pack
|
||||
@@ -1360,7 +1360,7 @@ class Installer {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.warn(chalk.yellow(` Warning: Core agent ${agentId} not found for team ${path.basename(teamFile, '.yml')}`));
|
||||
console.warn(chalk.yellow(` Warning: Core agent ${agentId} not found for team ${path.basename(teamFile, '.yaml')}`));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ class Installer {
|
||||
|
||||
if (stats) {
|
||||
// Check if it has a manifest
|
||||
const manifestPath = path.join(folderPath, "install-manifest.yml");
|
||||
const manifestPath = path.join(folderPath, "install-manifest.yaml");
|
||||
if (await fileManager.pathExists(manifestPath)) {
|
||||
const manifest = await fileManager.readExpansionPackManifest(installDir, folder.substring(1));
|
||||
if (manifest) {
|
||||
@@ -1539,8 +1539,8 @@ class Installer {
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Check if it has a config.yml (expansion pack without manifest)
|
||||
const configPath = path.join(folderPath, "config.yml");
|
||||
// Check if it has a config.yaml (expansion pack without manifest)
|
||||
const configPath = path.join(folderPath, "config.yaml");
|
||||
if (await fileManager.pathExists(configPath)) {
|
||||
expansionPacks[folder.substring(1)] = {
|
||||
path: folderPath,
|
||||
@@ -1579,7 +1579,7 @@ class Installer {
|
||||
|
||||
for (const file of filesToRestore) {
|
||||
// Skip the manifest file itself
|
||||
if (file.endsWith('install-manifest.yml')) continue;
|
||||
if (file.endsWith('install-manifest.yaml')) continue;
|
||||
|
||||
const relativePath = file.replace(`.${packId}/`, '');
|
||||
const sourcePath = path.join(pack.packPath, relativePath);
|
||||
@@ -1645,7 +1645,7 @@ class Installer {
|
||||
|
||||
while (currentDir !== path.dirname(currentDir)) {
|
||||
const bmadDir = path.join(currentDir, ".bmad-core");
|
||||
const manifestPath = path.join(bmadDir, "install-manifest.yml");
|
||||
const manifestPath = path.join(bmadDir, "install-manifest.yaml");
|
||||
|
||||
if (await fileManager.pathExists(manifestPath)) {
|
||||
return bmadDir;
|
||||
@@ -1656,7 +1656,7 @@ class Installer {
|
||||
|
||||
// Also check if we're inside a .bmad-core directory
|
||||
if (path.basename(process.cwd()) === ".bmad-core") {
|
||||
const manifestPath = path.join(process.cwd(), "install-manifest.yml");
|
||||
const manifestPath = path.join(process.cwd(), "install-manifest.yaml");
|
||||
if (await fileManager.pathExists(manifestPath)) {
|
||||
return process.cwd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user