create-byan-agent 1.2.0 → 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 +32 -0
- package/README.md +7 -1
- package/bin/create-byan-agent.js +114 -280
- package/lib/yanstaller/recommender.js +12 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ 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
|
+
|
|
17
|
+
## [1.2.1] - 2026-02-03
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Attribution** - Added BMAD origin and author attribution
|
|
21
|
+
- README.md and README-YANSTALLER.md now mention "Basé sur BMAD" with link to original repository
|
|
22
|
+
- Made by section updated to "Yan de Acadenice" with link to https://acadenice.fr/
|
|
23
|
+
- Version badge updated to 1.2.1
|
|
24
|
+
|
|
8
25
|
## [1.2.0] - 2026-02-03
|
|
9
26
|
|
|
10
27
|
### Added
|
|
@@ -37,11 +54,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
54
|
- 20 tests: backuper.test.js
|
|
38
55
|
- 10 tests: interviewer-wizard.test.js
|
|
39
56
|
|
|
57
|
+
- **CLI Entry Point Rewrite** - bin/create-byan-agent.js now orchestrates full YANSTALLER flow
|
|
58
|
+
- 7-step installation pipeline (detect → recommend → interview → backup → install → validate → wizard)
|
|
59
|
+
- CLI options: --silent, --agents, --platforms, --mode, --dry-run, --verbose
|
|
60
|
+
- Reduced from 323 lines to ~100 lines (modular architecture)
|
|
61
|
+
|
|
40
62
|
### Fixed
|
|
41
63
|
- **CRITICAL**: Added `lib/` to package.json files array
|
|
42
64
|
- Core YANSTALLER modules now included in npm package
|
|
43
65
|
- Previous versions were missing all yanstaller/*.js files
|
|
44
66
|
|
|
67
|
+
- **CRITICAL**: Entry point now uses YANSTALLER modules correctly
|
|
68
|
+
- Replaced monolithic code with modular orchestration
|
|
69
|
+
- Interview now uses interviewer.js (7 questions instead of 2)
|
|
70
|
+
- Recommendations based on project analysis
|
|
71
|
+
- Wizard provides post-install actions
|
|
72
|
+
|
|
45
73
|
- **NPM Package Configuration**
|
|
46
74
|
- Updated .npmignore to exclude tests and dev files
|
|
47
75
|
- Package now includes: bin/, lib/, templates/, README.md, CHANGELOG.md, LICENSE
|
|
@@ -53,6 +81,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
53
81
|
- Added detailed module descriptions with code examples
|
|
54
82
|
- Added usage guide (Interview mode + Programmatic API)
|
|
55
83
|
|
|
84
|
+
- **Version** - Bumped to 1.2.0 (minor) to reflect new YANSTALLER features
|
|
85
|
+
- Major new functionality: complete intelligent installer
|
|
86
|
+
- Not just a BYAN agent installer anymore
|
|
87
|
+
|
|
56
88
|
## [1.1.3] - 2026-02-03
|
|
57
89
|
|
|
58
90
|
### Fixed
|
package/README.md
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
**YANSTALLER** est l'installateur intelligent pour l'écosystème **BYAN** (Builder of YAN). Il détecte automatiquement votre environnement de développement, recommande les agents appropriés, et les installe avec support multi-plateforme.
|
|
9
9
|
|
|
10
|
+
> 📦 **Basé sur [BMAD](https://github.com/yanb94/byan)** - Business Modeling & Agent Development Platform
|
|
11
|
+
> ✍️ **Made by [Yan de Acadenice](https://acadenice.fr/)**
|
|
12
|
+
|
|
10
13
|
**Méthodologie :** Merise Agile + TDD + 64 Mantras
|
|
11
14
|
**Langues :** 🇫🇷 Français | 🇬🇧 English ([See below](#english-version))
|
|
12
15
|
|
|
@@ -843,13 +846,16 @@ SOFTWARE.
|
|
|
843
846
|
|
|
844
847
|
# 🏗️ YANSTALLER - Intelligent BYAN Installer
|
|
845
848
|
|
|
846
|
-
[](https://www.npmjs.com/package/create-byan-agent)
|
|
847
850
|
[](LICENSE)
|
|
848
851
|
[](https://nodejs.org)
|
|
849
852
|
[](#tests)
|
|
850
853
|
|
|
851
854
|
**YANSTALLER** is the intelligent installer for the **BYAN** (Builder of YAN) ecosystem. It automatically detects your development environment, recommends appropriate agents, and installs them with multi-platform support.
|
|
852
855
|
|
|
856
|
+
> 📦 **Based on [BMAD](https://github.com/yanb94/byan)** - Business Modeling & Agent Development Platform
|
|
857
|
+
> ✍️ **Made by [Yan de Acadenice](https://acadenice.fr/)**
|
|
858
|
+
|
|
853
859
|
**Methodology:** Merise Agile + TDD + 64 Mantras
|
|
854
860
|
**Languages:** 🇬🇧 English | 🇫🇷 Français
|
|
855
861
|
|
package/bin/create-byan-agent.js
CHANGED
|
@@ -1,322 +1,156 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const fs = require('fs-extra');
|
|
4
3
|
const path = require('path');
|
|
5
4
|
const { program } = require('commander');
|
|
6
|
-
const inquirer = require('inquirer');
|
|
7
5
|
const chalk = require('chalk');
|
|
8
|
-
const ora = require('ora');
|
|
9
|
-
const yaml = require('js-yaml');
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
// YANSTALLER Modules
|
|
8
|
+
const detector = require('../lib/yanstaller/detector');
|
|
9
|
+
const recommender = require('../lib/yanstaller/recommender');
|
|
10
|
+
const interviewer = require('../lib/yanstaller/interviewer');
|
|
11
|
+
const installer = require('../lib/yanstaller/installer');
|
|
12
|
+
const validator = require('../lib/yanstaller/validator');
|
|
13
|
+
const wizard = require('../lib/yanstaller/wizard');
|
|
14
|
+
const backuper = require('../lib/yanstaller/backuper');
|
|
15
|
+
const logger = require('../lib/utils/logger');
|
|
16
|
+
|
|
17
|
+
const YANSTALLER_VERSION = '1.2.0';
|
|
12
18
|
|
|
13
19
|
// ASCII Art Banner
|
|
14
20
|
const banner = `
|
|
15
21
|
${chalk.blue('╔════════════════════════════════════════════════════════════╗')}
|
|
16
22
|
${chalk.blue('║')} ${chalk.blue('║')}
|
|
17
|
-
${chalk.blue('║')} ${chalk.bold('🏗️
|
|
18
|
-
${chalk.blue('║')} ${chalk.gray('
|
|
23
|
+
${chalk.blue('║')} ${chalk.bold('🏗️ YANSTALLER v' + YANSTALLER_VERSION)} ${chalk.blue('║')}
|
|
24
|
+
${chalk.blue('║')} ${chalk.gray('Intelligent BYAN Installer')} ${chalk.blue('║')}
|
|
19
25
|
${chalk.blue('║')} ${chalk.blue('║')}
|
|
20
26
|
${chalk.blue('║')} ${chalk.gray('Methodology: Merise Agile + TDD + 64 Mantras')} ${chalk.blue('║')}
|
|
27
|
+
${chalk.blue('║')} ${chalk.gray('29 Agents • Multi-Platform • Auto-Fix')} ${chalk.blue('║')}
|
|
21
28
|
${chalk.blue('║')} ${chalk.blue('║')}
|
|
22
29
|
${chalk.blue('╚════════════════════════════════════════════════════════════╝')}
|
|
23
30
|
`;
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
console.log(
|
|
41
|
-
return devPath;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ❌ Fallback: This shouldn't happen in production
|
|
45
|
-
console.error(chalk.red('⚠️ WARNING: Template directory not found!'));
|
|
46
|
-
console.error(chalk.red(` Searched: ${npmPackagePath}`));
|
|
47
|
-
console.error(chalk.red(` Also searched: ${devPath}`));
|
|
48
|
-
return null;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Main installer
|
|
52
|
-
async function install() {
|
|
53
|
-
console.clear();
|
|
54
|
-
console.log(banner);
|
|
55
|
-
|
|
56
|
-
const projectRoot = process.cwd();
|
|
57
|
-
|
|
58
|
-
// Step 1: Detect project type
|
|
59
|
-
const spinner = ora('Detecting project type...').start();
|
|
60
|
-
|
|
61
|
-
const isGitRepo = await fs.pathExists(path.join(projectRoot, '.git'));
|
|
62
|
-
const hasPackageJson = await fs.pathExists(path.join(projectRoot, 'package.json'));
|
|
63
|
-
const hasPyProject = await fs.pathExists(path.join(projectRoot, 'pyproject.toml'));
|
|
64
|
-
|
|
65
|
-
if (!isGitRepo && !hasPackageJson && !hasPyProject) {
|
|
66
|
-
spinner.warn('Not in a recognized project directory');
|
|
32
|
+
/**
|
|
33
|
+
* Main YANSTALLER Installation Flow
|
|
34
|
+
*
|
|
35
|
+
* Orchestrates the 7-step intelligent installation:
|
|
36
|
+
* 1. DETECT - Platform & project analysis
|
|
37
|
+
* 2. RECOMMEND - Intelligent agent recommendations
|
|
38
|
+
* 3. INTERVIEW - 7-question personalization
|
|
39
|
+
* 4. BACKUP - Pre-install safety (optional)
|
|
40
|
+
* 5. INSTALL - Core installation
|
|
41
|
+
* 6. VALIDATE - 10 automated checks
|
|
42
|
+
* 7. WIZARD - Post-install actions
|
|
43
|
+
*/
|
|
44
|
+
async function main() {
|
|
45
|
+
try {
|
|
46
|
+
console.clear();
|
|
47
|
+
console.log(banner);
|
|
67
48
|
|
|
68
|
-
const
|
|
69
|
-
{
|
|
70
|
-
type: 'confirm',
|
|
71
|
-
name: 'continueAnyway',
|
|
72
|
-
message: 'BYAN works best in a project with version control. Continue anyway?',
|
|
73
|
-
default: false
|
|
74
|
-
}
|
|
75
|
-
]);
|
|
49
|
+
const projectRoot = process.cwd();
|
|
76
50
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
spinner.succeed('Project detected');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Step 2: Platform selection
|
|
86
|
-
const { platform } = await inquirer.prompt([
|
|
87
|
-
{
|
|
88
|
-
type: 'list',
|
|
89
|
-
name: 'platform',
|
|
90
|
-
message: 'Select platform to install for:',
|
|
91
|
-
choices: [
|
|
92
|
-
{ name: 'GitHub Copilot CLI', value: 'copilot' },
|
|
93
|
-
{ name: 'VSCode', value: 'vscode' },
|
|
94
|
-
{ name: 'Claude Code', value: 'claude' },
|
|
95
|
-
{ name: 'Codex', value: 'codex' },
|
|
96
|
-
{ name: 'All platforms', value: 'all' }
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
]);
|
|
100
|
-
|
|
101
|
-
// Step 3: User configuration
|
|
102
|
-
const config = await inquirer.prompt([
|
|
103
|
-
{
|
|
104
|
-
type: 'input',
|
|
105
|
-
name: 'userName',
|
|
106
|
-
message: 'Your name:',
|
|
107
|
-
default: 'Developer'
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
type: 'list',
|
|
111
|
-
name: 'language',
|
|
112
|
-
message: 'Communication language:',
|
|
113
|
-
choices: ['Francais', 'English'],
|
|
114
|
-
default: 'English'
|
|
115
|
-
}
|
|
116
|
-
]);
|
|
117
|
-
|
|
118
|
-
// Step 4: Create directory structure
|
|
119
|
-
const installSpinner = ora('Creating directory structure...').start();
|
|
120
|
-
|
|
121
|
-
const bmadDir = path.join(projectRoot, '_bmad');
|
|
122
|
-
const bmbDir = path.join(bmadDir, 'bmb');
|
|
123
|
-
const githubAgentsDir = path.join(projectRoot, '.github', 'agents');
|
|
124
|
-
|
|
125
|
-
await fs.ensureDir(path.join(bmadDir, 'bmb', 'agents'));
|
|
126
|
-
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'steps'));
|
|
127
|
-
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'templates'));
|
|
128
|
-
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'data'));
|
|
129
|
-
await fs.ensureDir(path.join(bmadDir, 'core'));
|
|
130
|
-
await fs.ensureDir(path.join(bmadDir, '_config'));
|
|
131
|
-
await fs.ensureDir(path.join(bmadDir, '_memory'));
|
|
132
|
-
await fs.ensureDir(path.join(bmadDir, '_output'));
|
|
133
|
-
await fs.ensureDir(githubAgentsDir);
|
|
134
|
-
|
|
135
|
-
installSpinner.succeed('Directory structure created');
|
|
136
|
-
|
|
137
|
-
// Step 5: Copy BYAN files from template
|
|
138
|
-
const copySpinner = ora('Installing BYAN files...').start();
|
|
139
|
-
|
|
140
|
-
const templateDir = getTemplateDir();
|
|
141
|
-
|
|
142
|
-
// ✅ FIX #3: Validate template directory before proceeding
|
|
143
|
-
if (!templateDir) {
|
|
144
|
-
copySpinner.fail('❌ Template directory not found! Cannot proceed.');
|
|
145
|
-
console.error(chalk.red('\nInstallation failed: Missing template files.'));
|
|
146
|
-
console.error(chalk.yellow('This usually means the package was not installed correctly.'));
|
|
147
|
-
console.error(chalk.yellow('Try reinstalling: npm install -g create-byan-agent'));
|
|
148
|
-
process.exit(1);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
try {
|
|
152
|
-
// ✅ FIX #4: Copy agent files from _bmad/bmb/agents
|
|
153
|
-
const agentsSource = path.join(templateDir, '_bmad', 'bmb', 'agents');
|
|
154
|
-
const agentsDest = path.join(bmbDir, 'agents');
|
|
51
|
+
// STEP 1: DETECT - Platform & Project Analysis
|
|
52
|
+
logger.info(chalk.bold('\n🔍 STEP 1/7: Detection\n'));
|
|
53
|
+
const detection = await detector.detect({ projectRoot });
|
|
155
54
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
55
|
+
const platformNames = detection.platforms ? detection.platforms.map(p => p.name).join(', ') : 'none';
|
|
56
|
+
logger.info(`✓ Platforms detected: ${chalk.cyan(platformNames)}`);
|
|
57
|
+
if (detection.projectType) {
|
|
58
|
+
logger.info(`✓ Project type: ${chalk.cyan(detection.projectType)}`);
|
|
59
|
+
}
|
|
60
|
+
if (detection.framework) {
|
|
61
|
+
logger.info(`✓ Framework: ${chalk.cyan(detection.framework)}`);
|
|
162
62
|
}
|
|
163
63
|
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
const
|
|
64
|
+
// STEP 2: RECOMMEND - Intelligent Agent Selection
|
|
65
|
+
logger.info(chalk.bold('\n🎯 STEP 2/7: Recommendations\n'));
|
|
66
|
+
const recommendations = await recommender.recommend({
|
|
67
|
+
projectRoot,
|
|
68
|
+
detection
|
|
69
|
+
});
|
|
167
70
|
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
copySpinner.text = 'Copied workflow files...';
|
|
171
|
-
console.log(chalk.green(` ✓ Workflows: ${workflowsSource} → ${workflowsDest}`));
|
|
172
|
-
} else {
|
|
173
|
-
copySpinner.warn(`⚠ Workflow source not found: ${workflowsSource}`);
|
|
71
|
+
if (recommendations.agents && recommendations.agents.length > 0) {
|
|
72
|
+
logger.info(`✓ Recommended agents: ${chalk.cyan(recommendations.agents.join(', '))}`);
|
|
174
73
|
}
|
|
175
74
|
|
|
176
|
-
//
|
|
177
|
-
|
|
75
|
+
// STEP 3: INTERVIEW - 7-Question Personalization
|
|
76
|
+
logger.info(chalk.bold('\n🎙️ STEP 3/7: Interview\n'));
|
|
77
|
+
const answers = await interviewer.ask(recommendations);
|
|
178
78
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
79
|
+
// STEP 4: BACKUP (optional)
|
|
80
|
+
if (answers.createBackup) {
|
|
81
|
+
logger.info(chalk.bold('\n💾 STEP 4/7: Backup\n'));
|
|
82
|
+
try {
|
|
83
|
+
const backup = await backuper.backup({ projectRoot });
|
|
84
|
+
logger.info(`✓ Backup created: ${chalk.cyan(backup.backupPath)}`);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
logger.warn(`⚠ Backup failed (non-critical): ${error.message}`);
|
|
87
|
+
}
|
|
183
88
|
} else {
|
|
184
|
-
|
|
89
|
+
logger.info(chalk.bold('\n⏭️ STEP 4/7: Backup (skipped)\n'));
|
|
185
90
|
}
|
|
186
91
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const configContent = {
|
|
198
|
-
bmb_creations_output_folder: "{project-root}/_bmad-output/bmb-creations",
|
|
199
|
-
user_name: config.userName,
|
|
200
|
-
communication_language: config.language,
|
|
201
|
-
document_output_language: config.language,
|
|
202
|
-
output_folder: "{project-root}/_bmad-output",
|
|
203
|
-
platform: platform
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const configPath = path.join(bmbDir, 'config.yaml');
|
|
207
|
-
await fs.writeFile(configPath, yaml.dump(configContent), 'utf8');
|
|
208
|
-
|
|
209
|
-
configSpinner.succeed('Configuration generated');
|
|
210
|
-
|
|
211
|
-
// Step 7: Create package.json script
|
|
212
|
-
const shortcutSpinner = ora('Creating shortcuts...').start();
|
|
213
|
-
|
|
214
|
-
if (hasPackageJson) {
|
|
215
|
-
const pkgPath = path.join(projectRoot, 'package.json');
|
|
216
|
-
const pkg = await fs.readJson(pkgPath);
|
|
92
|
+
// STEP 5: INSTALL - Core Installation
|
|
93
|
+
logger.info(chalk.bold('\n🚀 STEP 5/7: Installation\n'));
|
|
94
|
+
const installResult = await installer.install({
|
|
95
|
+
projectRoot,
|
|
96
|
+
agents: answers.agents,
|
|
97
|
+
platforms: answers.targetPlatforms,
|
|
98
|
+
userName: answers.userName,
|
|
99
|
+
language: answers.language,
|
|
100
|
+
mode: answers.mode
|
|
101
|
+
});
|
|
217
102
|
|
|
218
|
-
|
|
103
|
+
logger.info(`✓ Installed ${chalk.cyan(installResult.installedAgents.length)} agents`);
|
|
104
|
+
logger.info(`✓ Created ${chalk.cyan(installResult.createdDirectories)} directories`);
|
|
105
|
+
logger.info(`✓ Generated ${chalk.cyan(installResult.generatedStubs)} platform stubs`);
|
|
219
106
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
} else {
|
|
228
|
-
shortcutSpinner.succeed('Shortcuts created');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Step 8: Verification
|
|
232
|
-
const verifySpinner = ora('Verifying installation...').start();
|
|
233
|
-
|
|
234
|
-
const checks = [
|
|
235
|
-
{ name: 'Agents directory', path: path.join(bmbDir, 'agents') },
|
|
236
|
-
{ name: 'BYAN agent', path: path.join(bmbDir, 'agents', 'byan.md') },
|
|
237
|
-
{ name: 'RACHID agent', path: path.join(bmbDir, 'agents', 'rachid.md') },
|
|
238
|
-
{ name: 'MARC agent', path: path.join(bmbDir, 'agents', 'marc.md') },
|
|
239
|
-
{ name: 'Workflows', path: path.join(bmbDir, 'workflows', 'byan') },
|
|
240
|
-
{ name: 'Config', path: configPath },
|
|
241
|
-
{ name: 'GitHub agents dir', path: githubAgentsDir },
|
|
242
|
-
{ name: 'BYAN stub', path: path.join(githubAgentsDir, 'bmad-agent-byan.md') },
|
|
243
|
-
{ name: 'RACHID stub', path: path.join(githubAgentsDir, 'bmad-agent-rachid.md') },
|
|
244
|
-
{ name: 'MARC stub', path: path.join(githubAgentsDir, 'bmad-agent-marc.md') }
|
|
245
|
-
];
|
|
246
|
-
|
|
247
|
-
let passed = 0;
|
|
248
|
-
let failed = [];
|
|
249
|
-
|
|
250
|
-
for (const check of checks) {
|
|
251
|
-
if (await fs.pathExists(check.path)) {
|
|
252
|
-
passed++;
|
|
107
|
+
// STEP 6: VALIDATE - 10 Automated Checks
|
|
108
|
+
logger.info(chalk.bold('\n✅ STEP 6/7: Validation\n'));
|
|
109
|
+
const validation = await validator.validate({ projectRoot });
|
|
110
|
+
|
|
111
|
+
if (validation.valid) {
|
|
112
|
+
logger.info(chalk.green('✓ All validation checks passed!'));
|
|
253
113
|
} else {
|
|
254
|
-
|
|
114
|
+
logger.warn(chalk.yellow(`⚠ ${validation.errors.length} errors, ${validation.warnings.length} warnings`));
|
|
115
|
+
if (validation.errors.length > 0) {
|
|
116
|
+
validation.errors.forEach(err => logger.error(` ✗ ${err}`));
|
|
117
|
+
}
|
|
118
|
+
if (validation.warnings.length > 0) {
|
|
119
|
+
validation.warnings.forEach(warn => logger.warn(` ⚠ ${warn}`));
|
|
120
|
+
}
|
|
255
121
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
122
|
+
|
|
123
|
+
// STEP 7: WIZARD - Post-Install Actions
|
|
124
|
+
logger.info(chalk.bold('\n🧙 STEP 7/7: Post-Install Wizard\n'));
|
|
125
|
+
await wizard.show({
|
|
126
|
+
installedAgents: installResult.installedAgents,
|
|
127
|
+
platforms: answers.targetPlatforms,
|
|
128
|
+
userName: answers.userName,
|
|
129
|
+
language: answers.language
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
} catch (error) {
|
|
133
|
+
logger.error(chalk.red('\n❌ Installation failed:\n'));
|
|
134
|
+
logger.error(error.message);
|
|
135
|
+
if (error.stack) {
|
|
136
|
+
logger.error(chalk.gray(error.stack));
|
|
264
137
|
}
|
|
138
|
+
process.exit(1);
|
|
265
139
|
}
|
|
266
|
-
|
|
267
|
-
// Success message
|
|
268
|
-
console.log('');
|
|
269
|
-
console.log(chalk.green('╔════════════════════════════════════════════════════════════╗'));
|
|
270
|
-
console.log(chalk.green('║ ║'));
|
|
271
|
-
console.log(chalk.green('║ ✅ BYAN INSTALLATION COMPLETE! ║'));
|
|
272
|
-
console.log(chalk.green('║ ║'));
|
|
273
|
-
console.log(chalk.green('╚════════════════════════════════════════════════════════════╝'));
|
|
274
|
-
console.log('');
|
|
275
|
-
|
|
276
|
-
console.log(chalk.bold('Installation Summary:'));
|
|
277
|
-
console.log(` • Platform: ${chalk.cyan(platform)}`);
|
|
278
|
-
console.log(` • Installation Directory: ${chalk.cyan(bmbDir)}`);
|
|
279
|
-
console.log(` • Configuration: ${chalk.cyan(configPath)}`);
|
|
280
|
-
console.log(` • User: ${chalk.cyan(config.userName)}`);
|
|
281
|
-
console.log(` • Language: ${chalk.cyan(config.language)}`);
|
|
282
|
-
console.log(` • Agents Installed: ${chalk.cyan('BYAN, RACHID, MARC')}`);
|
|
283
|
-
console.log('');
|
|
284
|
-
|
|
285
|
-
console.log(chalk.bold('Next Steps:'));
|
|
286
|
-
console.log('');
|
|
287
|
-
console.log(chalk.yellow('1. Activate agents in GitHub Copilot CLI:'));
|
|
288
|
-
console.log(` ${chalk.blue('copilot')}`);
|
|
289
|
-
console.log(` Then type: ${chalk.blue('/agent')}`);
|
|
290
|
-
console.log(` Select: ${chalk.cyan('byan')} (create agents)`);
|
|
291
|
-
console.log(` ${chalk.cyan('rachid')} (NPM deployment)`);
|
|
292
|
-
console.log(` ${chalk.cyan('marc')} (Copilot CLI integration)`);
|
|
293
|
-
console.log('');
|
|
294
|
-
|
|
295
|
-
console.log(chalk.yellow('2. Create your first agent with BYAN:'));
|
|
296
|
-
console.log(' [INT] Start Intelligent Interview (30-45 min)');
|
|
297
|
-
console.log(' [QC] Quick Create (10 min)');
|
|
298
|
-
console.log('');
|
|
299
|
-
|
|
300
|
-
console.log(chalk.yellow('3. Deploy with RACHID:'));
|
|
301
|
-
console.log(' Use RACHID to publish BYAN to npm');
|
|
302
|
-
console.log(' Validate package.json and dependencies');
|
|
303
|
-
console.log('');
|
|
304
|
-
|
|
305
|
-
console.log(chalk.yellow('4. Integrate with MARC:'));
|
|
306
|
-
console.log(' Use MARC to test /agent detection');
|
|
307
|
-
console.log(' Validate .github/agents/ structure');
|
|
308
|
-
console.log('');
|
|
309
|
-
|
|
310
|
-
console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
|
|
311
|
-
console.log('');
|
|
312
|
-
console.log(chalk.blue('Happy agent building! 🏗️'));
|
|
313
140
|
}
|
|
314
141
|
|
|
315
142
|
// CLI Program
|
|
316
143
|
program
|
|
317
144
|
.name('create-byan-agent')
|
|
318
|
-
.description('
|
|
319
|
-
.version(
|
|
320
|
-
.
|
|
145
|
+
.description('YANSTALLER - Intelligent installer for BYAN ecosystem (29 agents, multi-platform)')
|
|
146
|
+
.version(YANSTALLER_VERSION)
|
|
147
|
+
.option('--silent', 'Silent installation (no prompts)')
|
|
148
|
+
.option('--agents <agents>', 'Comma-separated list of agents to install')
|
|
149
|
+
.option('--platforms <platforms>', 'Comma-separated list of platforms (copilot-cli,vscode,claude-code,codex)')
|
|
150
|
+
.option('--mode <mode>', 'Installation mode: recommended, custom, minimal, full')
|
|
151
|
+
.option('--no-backup', 'Skip pre-install backup')
|
|
152
|
+
.option('--dry-run', 'Simulate installation without making changes')
|
|
153
|
+
.option('--verbose', 'Verbose logging')
|
|
154
|
+
.action(main);
|
|
321
155
|
|
|
322
156
|
program.parse(process.argv);
|
|
@@ -22,11 +22,15 @@ const fileUtils = require('../utils/file-utils');
|
|
|
22
22
|
/**
|
|
23
23
|
* Analyze project and recommend configuration
|
|
24
24
|
*
|
|
25
|
-
* @param {
|
|
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(
|
|
29
|
-
|
|
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
|
|
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.
|
|
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"
|