create-byan-agent 2.11.3 → 2.12.0

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.
@@ -1489,10 +1489,73 @@ async function install() {
1489
1489
  soulSpinner.warn(`Soul setup had issues: ${soulError.message}`);
1490
1490
  console.log(chalk.yellow(' Soul files can be added manually later'));
1491
1491
  }
1492
-
1492
+
1493
1493
  console.log('');
1494
1494
  }
1495
-
1495
+
1496
+ // Step 8.7: BYAN API Backend (optional)
1497
+ console.log('');
1498
+ console.log(chalk.blue('--- BYAN API Backend (optional) ---'));
1499
+ console.log(chalk.gray('Connect this BYAN install to a running byan-api server'));
1500
+ console.log(chalk.gray('(centralized agent state, FD history, ELO, kanban, workflow-scripts).'));
1501
+ console.log('');
1502
+
1503
+ const { apiUrl } = await inquirer.prompt([{
1504
+ type: 'input',
1505
+ name: 'apiUrl',
1506
+ message: 'BYAN API URL (leave empty to skip):',
1507
+ default: process.env.BYAN_API_URL || ''
1508
+ }]);
1509
+
1510
+ let apiToken = '';
1511
+ if (apiUrl.trim()) {
1512
+ const tokenAns = await inquirer.prompt([{
1513
+ type: 'password',
1514
+ name: 'apiToken',
1515
+ message: 'BYAN API token (leave empty for public endpoints only):',
1516
+ mask: '*',
1517
+ default: process.env.BYAN_API_TOKEN || ''
1518
+ }]);
1519
+ apiToken = (tokenAns.apiToken || '').trim();
1520
+ }
1521
+
1522
+ const apiConfigured = Boolean(apiUrl.trim());
1523
+ const apiUrlFinal = apiUrl.trim();
1524
+
1525
+ if (apiConfigured) {
1526
+ const apiSpinner = ora('Configuring BYAN API integration...').start();
1527
+ try {
1528
+ const mcpConfigPath = path.join(projectRoot, '.mcp.json');
1529
+ let mcpConfig = { mcpServers: {} };
1530
+ if (await fs.pathExists(mcpConfigPath)) {
1531
+ try { mcpConfig = await fs.readJson(mcpConfigPath); } catch { /* overwrite invalid */ }
1532
+ if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
1533
+ }
1534
+
1535
+ mcpConfig.mcpServers.byan = {
1536
+ command: 'npx',
1537
+ args: ['-y', 'byan-mcp-server'],
1538
+ env: {
1539
+ BYAN_API_URL: apiUrlFinal,
1540
+ ...(apiToken ? { BYAN_API_TOKEN: apiToken } : {})
1541
+ }
1542
+ };
1543
+
1544
+ await fs.writeJson(mcpConfigPath, mcpConfig, { spaces: 2 });
1545
+ apiSpinner.succeed(`BYAN API configured → .mcp.json (${apiUrlFinal})`);
1546
+ console.log(chalk.gray(' byan-mcp-server will be lazy-installed on first use via npx.'));
1547
+ if (!apiToken) {
1548
+ console.log(chalk.yellow(' Note: no token set — authenticated tools (list_projects, kanban, FD, etc.) will fail.'));
1549
+ }
1550
+ } catch (apiError) {
1551
+ apiSpinner.warn(`API config failed: ${apiError.message}`);
1552
+ console.log(chalk.yellow(' You can configure it manually later by editing .mcp.json'));
1553
+ }
1554
+ } else {
1555
+ console.log(chalk.gray(' Skipped. Configure later by editing .mcp.json.'));
1556
+ }
1557
+ console.log('');
1558
+
1496
1559
  // Step 9: Create package.json script
1497
1560
  const shortcutSpinner = ora('Creating shortcuts...').start();
1498
1561
 
@@ -1527,6 +1590,11 @@ async function install() {
1527
1590
  checks.push({ name: 'Soul file', path: path.join(byanDir, 'soul.md') });
1528
1591
  checks.push({ name: 'Soul memory', path: path.join(byanDir, 'soul-memory.md') });
1529
1592
  }
1593
+
1594
+ // BYAN API backend check
1595
+ if (apiConfigured) {
1596
+ checks.push({ name: 'BYAN API config (.mcp.json)', path: path.join(projectRoot, '.mcp.json') });
1597
+ }
1530
1598
 
1531
1599
  // Platform-specific checks based on installation mode
1532
1600
  if (isManual) {
@@ -1607,6 +1675,7 @@ async function install() {
1607
1675
  console.log(` • Language: ${chalk.cyan(config.language)}`);
1608
1676
  console.log(` • Turbo Whisper: ${chalk.cyan(turboWhisperInstalled ? `Installed (${turboWhisperMode} mode)` : 'Not installed')}`);
1609
1677
  console.log(` • Soul System: ${chalk.cyan(soulMode === 'skip' ? 'Not installed' : `${soulMode} mode`)}`);
1678
+ console.log(` • BYAN API: ${chalk.cyan(apiConfigured ? `${apiUrlFinal}${apiToken ? ' (with token)' : ' (no token)'}` : 'Not configured')}`);
1610
1679
  console.log(` • Model Selector: ${chalk.cyan('Integrated (Auto cost optimization)')}`);
1611
1680
 
1612
1681
  if (isManual && manualSelection) {
@@ -1682,6 +1751,16 @@ async function install() {
1682
1751
  console.log(chalk.gray(' Documentation: TURBO-WHISPER-SETUP.md'));
1683
1752
  }
1684
1753
 
1754
+ // BYAN MCP instructions (if API configured)
1755
+ if (apiConfigured) {
1756
+ console.log('');
1757
+ console.log(chalk.yellow('🔌 BYAN MCP tools (available in Claude Code):'));
1758
+ console.log(chalk.gray(' list_projects, FD lifecycle, kanban, ELO, fact-check,'));
1759
+ console.log(chalk.gray(' peer-review, standup, workflow-node-scripts (9 tools).'));
1760
+ console.log(chalk.gray(' → Restart Claude Code to load the MCP server.'));
1761
+ console.log(chalk.gray(` → First call will npx-install byan-mcp-server automatically.`));
1762
+ }
1763
+
1685
1764
  console.log('');
1686
1765
  console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
1687
1766
  console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-byan-agent",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
4
4
  "description": "BYAN v2.6.1 - Intelligent AI agent creator with ELO trust system + scientific fact-check + Hermes universal dispatcher. Multi-platform (Copilot CLI, Claude Code, Codex). Merise Agile + TDD + 64 Mantras. ~54% LLM cost savings.",
5
5
  "main": "src/index.js",
6
6
  "bin": {