valent-pipeline 0.2.9 → 0.2.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valent-pipeline",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -100,40 +100,36 @@ export async function init(options = {}) {
100
100
  }
101
101
 
102
102
  // 7b. Install browser automation MCP for UI projects
103
- const projectType = config.project?.type || 'fullstack-web';
104
103
  const uiProjectTypes = ['fullstack-web', 'frontend-only'];
105
- if (uiProjectTypes.includes(projectType)) {
104
+ const shouldInstallMcp = options.yes
105
+ ? uiProjectTypes.includes(config.project?.type || 'fullstack-web')
106
+ : config.install_browser_mcp;
107
+ if (shouldInstallMcp) {
106
108
  const mcpName = config.tech_stack?.browser_automation_mcp || 'playwright-mcp';
107
- const installMcp = options.yes || await confirmPrompt(
108
- `Install browser automation MCP (${mcpName}) for visual validation?`,
109
- true
110
- );
111
- if (installMcp) {
112
- console.log(` Installing ${mcpName}...`);
113
- const { execSync } = await import('child_process');
109
+ console.log(` Installing ${mcpName}...`);
110
+ const { execSync } = await import('child_process');
111
+ try {
112
+ execSync(`npm install -g @anthropic-ai/${mcpName}`, { stdio: 'pipe' });
113
+ console.log(` Installed ${mcpName}`);
114
+ } catch (err) {
115
+ console.warn(` Warning: Failed to install ${mcpName}. Run "npm install -g @anthropic-ai/${mcpName}" manually.`);
116
+ }
117
+ // Register in .claude/settings.json mcpServers
118
+ const mcpSettingsPath = join(projectRoot, '.claude', 'settings.json');
119
+ let mcpSettings = {};
120
+ if (fileExists(mcpSettingsPath)) {
114
121
  try {
115
- execSync(`npm install -g @anthropic-ai/${mcpName}`, { stdio: 'pipe' });
116
- console.log(` Installed ${mcpName}`);
117
- } catch (err) {
118
- console.warn(` Warning: Failed to install ${mcpName}. Run "npm install -g @anthropic-ai/${mcpName}" manually.`);
119
- }
120
- // Register in .claude/settings.json mcpServers
121
- const mcpSettingsPath = join(projectRoot, '.claude', 'settings.json');
122
- let mcpSettings = {};
123
- if (fileExists(mcpSettingsPath)) {
124
- try {
125
- mcpSettings = JSON.parse(readFileSync(mcpSettingsPath, 'utf-8'));
126
- } catch { /* start fresh if parse fails */ }
127
- }
128
- if (!mcpSettings.mcpServers) mcpSettings.mcpServers = {};
129
- if (!mcpSettings.mcpServers[mcpName]) {
130
- mcpSettings.mcpServers[mcpName] = {
131
- command: 'npx',
132
- args: [`@anthropic-ai/${mcpName}`]
133
- };
134
- writeFileSafe(mcpSettingsPath, JSON.stringify(mcpSettings, null, 2) + '\n');
135
- console.log(` Registered ${mcpName} in .claude/settings.json`);
136
- }
122
+ mcpSettings = JSON.parse(readFileSync(mcpSettingsPath, 'utf-8'));
123
+ } catch { /* start fresh if parse fails */ }
124
+ }
125
+ if (!mcpSettings.mcpServers) mcpSettings.mcpServers = {};
126
+ if (!mcpSettings.mcpServers[mcpName]) {
127
+ mcpSettings.mcpServers[mcpName] = {
128
+ command: 'npx',
129
+ args: [`@anthropic-ai/${mcpName}`]
130
+ };
131
+ writeFileSafe(mcpSettingsPath, JSON.stringify(mcpSettings, null, 2) + '\n');
132
+ console.log(` Registered ${mcpName} in .claude/settings.json`);
137
133
  }
138
134
  }
139
135
 
@@ -167,14 +163,6 @@ export async function init(options = {}) {
167
163
  console.log('');
168
164
  }
169
165
 
170
- async function confirmPrompt(message, defaultValue = true) {
171
- const inquirer = (await import('inquirer')).default;
172
- const { answer } = await inquirer.prompt([{
173
- type: 'confirm', name: 'answer', message, default: defaultValue,
174
- }]);
175
- return answer;
176
- }
177
-
178
166
  async function runWizard() {
179
167
  const inquirer = (await import('inquirer')).default;
180
168
  const config = JSON.parse(JSON.stringify(defaults));
@@ -229,6 +217,17 @@ async function runWizard() {
229
217
  }]);
230
218
  config.tech_stack.test_framework_e2e = testE2e;
231
219
 
220
+ // Browser automation MCP (UI projects only)
221
+ if (['fullstack-web', 'frontend-only'].includes(projectType)) {
222
+ const { installBrowserMcp } = await inquirer.prompt([{
223
+ type: 'confirm',
224
+ name: 'installBrowserMcp',
225
+ message: 'Install browser automation MCP (playwright-mcp) for visual validation?',
226
+ default: true,
227
+ }]);
228
+ config.install_browser_mcp = installBrowserMcp;
229
+ }
230
+
232
231
  // Knowledge mode
233
232
  const { knowledgeMode } = await inquirer.prompt([{
234
233
  type: 'list',