ma-agents 3.4.4 → 3.4.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.
Files changed (2) hide show
  1. package/lib/bmad.js +43 -4
  2. package/package.json +1 -1
package/lib/bmad.js CHANGED
@@ -3,6 +3,7 @@ const path = require('path');
3
3
  const os = require('os');
4
4
  const { execSync } = require('child_process');
5
5
  const chalk = require('chalk');
6
+ const yaml = require('yaml');
6
7
 
7
8
  const BMAD_DIR = '_bmad';
8
9
  const CONFIG_DIR = path.join(BMAD_DIR, '_config', 'agents');
@@ -206,10 +207,10 @@ async function updateBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = pr
206
207
  // the files-manifest, finds module "custom", and fails because it can't locate
207
208
  // the source for a module named "custom". Fix: strip stale "custom" module
208
209
  // entries from the manifest so the module gets cleanly reinstalled via --custom-content.
209
- const manifestPath = path.join(projectRoot, BMAD_DIR, '_config', 'files-manifest.csv');
210
- if (fs.existsSync(manifestPath)) {
210
+ const filesManifestPath = path.join(projectRoot, BMAD_DIR, '_config', 'files-manifest.csv');
211
+ if (fs.existsSync(filesManifestPath)) {
211
212
  try {
212
- let csv = await fs.readFile(manifestPath, 'utf-8');
213
+ let csv = await fs.readFile(filesManifestPath, 'utf-8');
213
214
  const before = csv.split('\n').length;
214
215
  csv = csv.split('\n').filter(line => {
215
216
  const fields = line.split(',');
@@ -217,7 +218,7 @@ async function updateBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = pr
217
218
  }).join('\n');
218
219
  const after = csv.split('\n').length;
219
220
  if (after < before) {
220
- await fs.writeFile(manifestPath, csv, 'utf-8');
221
+ await fs.writeFile(filesManifestPath, csv, 'utf-8');
221
222
  console.log(chalk.gray(` Cleaned ${before - after} stale "custom" module entries from files-manifest.csv`));
222
223
  }
223
224
  } catch (err) {
@@ -225,6 +226,44 @@ async function updateBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = pr
225
226
  }
226
227
  }
227
228
 
229
+ // The real trigger: manifest.yaml lists "custom" and "bmb" as previously
230
+ // installed modules. In --yes (non-interactive) mode, bmad-method preserves
231
+ // all previously installed modules and tries to reinstall them. "custom" has
232
+ // no source (it's actually "ma-skills"), and "bmb" has a broken directory
233
+ // structure in 6.2.2. Fix: remove both from manifest.yaml before update.
234
+ const yamlManifestPath = path.join(projectRoot, BMAD_DIR, '_config', 'manifest.yaml');
235
+ if (fs.existsSync(yamlManifestPath)) {
236
+ try {
237
+ const yamlContent = await fs.readFile(yamlManifestPath, 'utf-8');
238
+ const manifest = yaml.parse(yamlContent);
239
+ if (manifest?.modules && Array.isArray(manifest.modules)) {
240
+ const staleModules = ['custom', 'bmb'];
241
+ const before = manifest.modules.length;
242
+ manifest.modules = manifest.modules.filter(
243
+ m => !staleModules.includes(typeof m === 'string' ? m : m.name)
244
+ );
245
+ const removed = before - manifest.modules.length;
246
+ if (removed > 0) {
247
+ await fs.writeFile(yamlManifestPath, yaml.stringify(manifest), 'utf-8');
248
+ console.log(chalk.gray(` Cleaned ${removed} stale module(s) from manifest.yaml`));
249
+ }
250
+ }
251
+ } catch (err) {
252
+ // Non-fatal
253
+ }
254
+ }
255
+
256
+ // Remove stale _config/custom/ cache directory that can confuse module scanning
257
+ const customCacheDir = path.join(projectRoot, BMAD_DIR, '_config', 'custom');
258
+ if (fs.existsSync(customCacheDir)) {
259
+ try {
260
+ await fs.remove(customCacheDir);
261
+ console.log(chalk.gray(' Removed stale _config/custom/ cache directory'));
262
+ } catch (err) {
263
+ // Non-fatal
264
+ }
265
+ }
266
+
228
267
  console.log(chalk.gray(` Running: ${command}`));
229
268
  try {
230
269
  runCommand(command, { cwd: projectRoot, env: { ...process.env, GIT_TERMINAL_PROMPT: '0' } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ma-agents",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
4
4
  "description": "NPX tool to install skills for AI coding agents (Claude Code, Gemini, Copilot, Kilocode, Cline, Cursor, Roo Code)",
5
5
  "main": "index.js",
6
6
  "bin": {