create-byan-agent 1.2.1 → 1.2.2

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.2] - 2026-02-03
9
+
10
+ ### Fixed
11
+ - **CRITICAL BUG**: Fixed recommender crash when platforms is undefined
12
+ - `recommender.recommend()` now properly handles both direct detection object and options wrapper
13
+ - Added default empty array for platforms parameter in `getRecommendedAgents()`
14
+ - Added null-check before calling `.some()` on platforms array
15
+ - Fixed display of detected platforms in CLI (was showing "[object Object]")
16
+
8
17
  ## [1.2.1] - 2026-02-03
9
18
 
10
19
  ### Changed
package/README.md CHANGED
@@ -846,7 +846,7 @@ SOFTWARE.
846
846
 
847
847
  # šŸ—ļø YANSTALLER - Intelligent BYAN Installer
848
848
 
849
- [![Version](https://img.shields.io/badge/version-1.2.1-blue.svg)](https://www.npmjs.com/package/create-byan-agent)
849
+ [![Version](https://img.shields.io/badge/version-1.2.2-blue.svg)](https://www.npmjs.com/package/create-byan-agent)
850
850
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
851
851
  [![Node](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
852
852
  [![Tests](https://img.shields.io/badge/tests-168%20passing-success.svg)](#tests)
@@ -52,7 +52,8 @@ async function main() {
52
52
  logger.info(chalk.bold('\nšŸ” STEP 1/7: Detection\n'));
53
53
  const detection = await detector.detect({ projectRoot });
54
54
 
55
- logger.info(`āœ“ Platforms detected: ${chalk.cyan(detection.platforms.join(', ') || 'none')}`);
55
+ const platformNames = detection.platforms ? detection.platforms.map(p => p.name).join(', ') : 'none';
56
+ logger.info(`āœ“ Platforms detected: ${chalk.cyan(platformNames)}`);
56
57
  if (detection.projectType) {
57
58
  logger.info(`āœ“ Project type: ${chalk.cyan(detection.projectType)}`);
58
59
  }
@@ -22,11 +22,15 @@ const fileUtils = require('../utils/file-utils');
22
22
  /**
23
23
  * Analyze project and recommend configuration
24
24
  *
25
- * @param {import('./detector').DetectionResult} detection - Detection results
25
+ * @param {Object} options - Options object
26
+ * @param {string} [options.projectRoot] - Project root path
27
+ * @param {import('./detector').DetectionResult} options.detection - Detection results
26
28
  * @returns {Promise<Recommendation>}
27
29
  */
28
- async function recommend(detection) {
29
- const projectRoot = process.cwd();
30
+ async function recommend(options) {
31
+ // Support both old API (direct detection) and new API (options object)
32
+ const detection = options.detection || options;
33
+ const projectRoot = options.projectRoot || process.cwd();
30
34
 
31
35
  // 1. Analyze project type
32
36
  let projectType = 'unknown';
@@ -40,7 +44,8 @@ async function recommend(detection) {
40
44
  }
41
45
 
42
46
  // 2. Recommend agents based on type + platforms
43
- const agents = getRecommendedAgents(projectType, detection.platforms);
47
+ const platforms = detection.platforms || [];
48
+ const agents = getRecommendedAgents(projectType, platforms);
44
49
 
45
50
  // 3. Determine mode
46
51
  const mode = agents.length > 10 ? 'full' : 'minimal';
@@ -167,14 +172,14 @@ function detectFramework(deps) {
167
172
  * Get recommended agents based on project type
168
173
  *
169
174
  * @param {string} projectType - Project type
170
- * @param {Array} platforms - Detected platforms
175
+ * @param {Array} platforms - Detected platforms (array of platform objects)
171
176
  * @returns {string[]} - Agent names
172
177
  */
173
- function getRecommendedAgents(projectType, platforms) {
178
+ function getRecommendedAgents(projectType, platforms = []) {
174
179
  const baseAgents = ['byan', 'rachid', 'patnote', 'carmack'];
175
180
 
176
181
  // Add MARC if Copilot CLI detected
177
- if (platforms.some(p => p.name === 'copilot-cli' && p.detected)) {
182
+ if (platforms && platforms.some(p => p.name === 'copilot-cli' && p.detected)) {
178
183
  baseAgents.push('marc');
179
184
  }
180
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-byan-agent",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "NPX installer for BYAN ecosystem - Agent creators (BYAN, BYAN-Test) with deployment (RACHID), integration (MARC), updates (PATNOTE), and optimization (CARMACK)",
5
5
  "bin": {
6
6
  "create-byan-agent": "bin/create-byan-agent.js"