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,EAAQ,SAAW,CAC9B,CAGA,QAAQ,QAAQ,YAAY,SAAS,YAAY,gDAGjD,IAAK,MAAO,EAAM,KAAQ,OAAO,QAAQ,UAAW,CAClD,MAAM,EAAU,QAAQ,QAAQ,GAAM,YAAY,EAAI,aAGtD,IAAK,MAAM,KAAU,EAAI,SAAW,GAClC,EAAQ,UAAU,GAIpB,EAAQ,OAAO,EAAI,OACrB,CAGA,QAAQ,MAAM,QAAQ,MAGe,IAAjC,QAAQ,KAAK,MAAM,GAAG,QACxB,QAAQ","file":"/npm/bmad-method@6.0.4/tools/cli/bmad-cli.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/bmad-method@6.0.4/tools/cli/bmad-cli.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const { program } = require('commander');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst { execSync } = require('node:child_process');\nconst semver = require('semver');\nconst prompts = require('./lib/prompts');\n\n// The installer flow uses many sequential @clack/prompts, each adding keypress\n// listeners to stdin. Raise the limit to avoid spurious EventEmitter warnings.\nif (process.stdin?.setMaxListeners) {\n  const currentLimit = process.stdin.getMaxListeners();\n  process.stdin.setMaxListeners(Math.max(currentLimit, 50));\n}\n\n// Check for updates - do this asynchronously so it doesn't block startup\nconst packageJson = require('../../package.json');\nconst packageName = 'bmad-method';\ncheckForUpdate().catch(() => {\n  // Silently ignore errors - version check is best-effort\n});\n\nasync function checkForUpdate() {\n  try {\n    // For beta versions, check the beta tag; otherwise check latest\n    const isBeta =\n      packageJson.version.includes('Beta') ||\n      packageJson.version.includes('beta') ||\n      packageJson.version.includes('alpha') ||\n      packageJson.version.includes('rc');\n    const tag = isBeta ? 'beta' : 'latest';\n\n    const result = execSync(`npm view ${packageName}@${tag} version`, {\n      encoding: 'utf8',\n      stdio: 'pipe',\n      timeout: 5000,\n    }).trim();\n\n    if (result && semver.gt(result, packageJson.version)) {\n      const color = await prompts.getColor();\n      const updateMsg = [\n        `You are using version ${packageJson.version} but ${result} is available.`,\n        '',\n        'To update, exit and first run:',\n        `  npm cache clean --force && npx bmad-method@${tag} install`,\n      ].join('\\n');\n      await prompts.box(updateMsg, 'Update Available', {\n        rounded: true,\n        formatBorder: color.yellow,\n      });\n    }\n  } catch {\n    // Silently fail - network issues or npm not available\n  }\n}\n\n// Fix for stdin issues when running through npm on Windows\n// Ensures keyboard interaction works properly with CLI prompts\nif (process.stdin.isTTY) {\n  try {\n    process.stdin.resume();\n    process.stdin.setEncoding('utf8');\n\n    // On Windows, explicitly reference the stdin stream to ensure it's properly initialized\n    if (process.platform === 'win32') {\n      process.stdin.on('error', () => {\n        // Ignore stdin errors - they can occur when the terminal is closing\n      });\n    }\n  } catch {\n    // Silently ignore - some environments may not support these operations\n  }\n}\n\n// Load all command modules\nconst commandsPath = path.join(__dirname, 'commands');\nconst commandFiles = fs.readdirSync(commandsPath).filter((file) => file.endsWith('.js'));\n\nconst commands = {};\nfor (const file of commandFiles) {\n  const command = require(path.join(commandsPath, file));\n  commands[command.command] = command;\n}\n\n// Set up main program\nprogram.version(packageJson.version).description('BMAD Core CLI - Universal AI agent framework');\n\n// Register all commands\nfor (const [name, cmd] of Object.entries(commands)) {\n  const command = program.command(name).description(cmd.description);\n\n  // Add options\n  for (const option of cmd.options || []) {\n    command.option(...option);\n  }\n\n  // Set action\n  command.action(cmd.action);\n}\n\n// Parse arguments\nprogram.parse(process.argv);\n\n// Show help if no command provided\nif (process.argv.slice(2).length === 0) {\n  program.outputHelp();\n}\n"]}