Compare commits

...

3 Commits

Author SHA1 Message Date
Vidit Bhavsar d2e4bca0ea
Merge 6143754b13 into df176d4206 2026-02-04 13:07:41 +09:00
Brian Madison df176d4206 installer remove double tool questioning 2026-02-03 21:36:21 -06:00
ViditBee 6143754b13 Fixed: https://github.com/bmad-code-org/BMAD-METHOD/issues/929 2026-01-28 23:57:11 +05:30
2 changed files with 32 additions and 110 deletions

View File

@ -1,4 +1,5 @@
const path = require('node:path');
const YAML = require('yaml');
const { BaseIdeSetup } = require('./_base-ide');
const chalk = require('chalk');
const { AgentCommandGenerator } = require('./shared/agent-command-generator');
@ -92,43 +93,31 @@ class KiloSetup extends BaseIdeSetup {
* Create a mode entry for an agent
*/
async createModeEntry(artifact, projectDir) {
// Extract metadata from launcher content
const titleMatch = artifact.content.match(/title="([^"]+)"/);
const title = titleMatch ? titleMatch[1] : this.formatTitle(artifact.name);
const title = artifact.content.match(/title="([^"]+)"/)?.[1] ?? this.formatTitle(artifact.name);
const iconMatch = artifact.content.match(/icon="([^"]+)"/);
const icon = iconMatch ? iconMatch[1] : '🤖';
const icon = artifact.content.match(/icon="([^"]+)"/)?.[1] ?? '🤖';
const whenToUseMatch = artifact.content.match(/whenToUse="([^"]+)"/);
const whenToUse = whenToUseMatch ? whenToUseMatch[1] : `Use for ${title} tasks`;
const whenToUse = artifact.content.match(/whenToUse="([^"]+)"/)?.[1] ?? `Use for ${title} tasks`;
const roleDefinition =
artifact.content.match(/roleDefinition="([^"]+)"/)?.[1] ?? `You are a ${title} specializing in ${title.toLowerCase()} tasks.`;
// Get the activation header from central template
const activationHeader = await this.getAgentCommandHeader();
const roleDefinitionMatch = artifact.content.match(/roleDefinition="([^"]+)"/);
const roleDefinition = roleDefinitionMatch
? roleDefinitionMatch[1]
: `You are a ${title} specializing in ${title.toLowerCase()} tasks.`;
// Get relative path
const relativePath = path.relative(projectDir, artifact.sourcePath).replaceAll('\\', '/');
// Build mode entry (KiloCode uses same schema as Roo)
const slug = `bmad-${artifact.module}-${artifact.name}`;
let modeEntry = ` - slug: ${slug}\n`;
modeEntry += ` name: '${icon} ${title}'\n`;
modeEntry += ` roleDefinition: ${roleDefinition}\n`;
modeEntry += ` whenToUse: ${whenToUse}\n`;
modeEntry += ` customInstructions: |\n`;
modeEntry += ` ${activationHeader} Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode\n`;
modeEntry += ` groups:\n`;
modeEntry += ` - read\n`;
modeEntry += ` - edit\n`;
modeEntry += ` - browser\n`;
modeEntry += ` - command\n`;
modeEntry += ` - mcp\n`;
const entry = {
slug: `bmad-${artifact.module}-${artifact.name}`,
name: `${icon} ${title}`,
roleDefinition,
whenToUse,
customInstructions:
`${activationHeader}` +
`Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode`,
groups: ['read', 'edit', 'browser', 'command', 'mcp'],
};
return modeEntry;
return YAML.stringify([entry], { indent: 2 });
}
/**

View File

@ -435,95 +435,29 @@ class UI {
}
// ─────────────────────────────────────────────────────────────────────────────
// NEW INSTALL: Show recommended tools first with "Browse All" option
// NEW INSTALL: Show all tools with search
// ─────────────────────────────────────────────────────────────────────────────
const recommendedOptions = preferredIdes.map((ide) => {
const isConfigured = configuredPreferred.includes(ide.value);
const allTools = [...preferredIdes, ...otherIdes];
const allToolOptions = allTools.map((ide) => {
const isPreferred = preferredIdes.some((p) => p.value === ide.value);
let label = ide.name;
if (isPreferred) label += ' ⭐';
return {
label: isConfigured ? `${ide.name} ⭐ ✅` : `${ide.name}`,
label,
value: ide.value,
};
});
// Add "browse all" option at the end if there are additional tools
if (otherIdes.length > 0) {
const totalTools = preferredIdes.length + otherIdes.length;
recommendedOptions.push({
label: `→ Browse all supported tools (${totalTools} total)...`,
value: '__BROWSE_ALL__',
});
}
// Pre-select previously configured preferred tools
const recommendedInitialValues = configuredPreferred.length > 0 ? configuredPreferred : undefined;
const recommendedSelected = await prompts.multiselect({
message: `Integrate with ${chalk.dim('(↑/↓ to navigate • SPACE: select • ENTER: confirm)')}:`,
options: recommendedOptions,
initialValues: recommendedInitialValues,
const selectedIdes = await prompts.autocompleteMultiselect({
message: 'Select tools:',
options: allToolOptions,
initialValues: configuredIdes.length > 0 ? configuredIdes : undefined,
required: false,
maxItems: 8,
});
const selectedRecommended = recommendedSelected || [];
// ─────────────────────────────────────────────────────────────────────────────
// STEP 2: Handle "Browse All" selection - show additional tools if requested
// ─────────────────────────────────────────────────────────────────────────────
const wantsBrowseAll = selectedRecommended.includes('__BROWSE_ALL__');
const filteredRecommended = selectedRecommended.filter((v) => v !== '__BROWSE_ALL__');
// Show additional tools if:
// 1. User explicitly chose "Browse All", OR
// 2. User has previously configured "other" tools, OR
// 3. User selected no recommended tools (allow them to pick from other tools)
const showAdditionalTools = wantsBrowseAll || configuredOther.length > 0 || filteredRecommended.length === 0;
let selectedAdditionalOrAll = [];
if (showAdditionalTools) {
// Show ALL tools if:
// - User explicitly chose "Browse All", OR
// - User selected nothing from recommended (so they can pick from everything)
// Otherwise, show only "other" tools as additional options
const showAllTools = wantsBrowseAll || filteredRecommended.length === 0;
const toolsToShow = showAllTools ? [...preferredIdes, ...otherIdes] : otherIdes;
if (toolsToShow.length > 0) {
const allToolOptions = toolsToShow.map((ide) => {
const isConfigured = configuredIdes.includes(ide.value);
const isPreferred = preferredIdes.some((p) => p.value === ide.value);
let label = ide.name;
if (isPreferred) label += ' ⭐';
if (isConfigured) label += ' ✅';
return {
label,
value: ide.value,
};
});
// Pre-select: previously configured tools + any recommended tools already selected
const initialValues = [...configuredIdes, ...filteredRecommended].filter((v, i, arr) => arr.indexOf(v) === i); // dedupe
// Use "additional" only if user already selected some recommended tools
const isAdditional = !wantsBrowseAll && filteredRecommended.length > 0;
console.log('');
const selected = await prompts.autocompleteMultiselect({
message: isAdditional ? 'Select additional tools:' : 'Select tools:',
options: allToolOptions,
initialValues: initialValues.length > 0 ? initialValues : undefined,
required: false,
maxItems: 8,
});
selectedAdditionalOrAll = selected || [];
}
}
// Combine selections:
// - If "Browse All" was used, the second prompt contains ALL selections
// - Otherwise, combine recommended + additional
const allSelectedIdes = wantsBrowseAll ? selectedAdditionalOrAll : [...filteredRecommended, ...selectedAdditionalOrAll];
const allSelectedIdes = selectedIdes || [];
// ─────────────────────────────────────────────────────────────────────────────
// STEP 3: Confirm if no tools selected
@ -547,7 +481,6 @@ class UI {
}
// Display selected tools
const allTools = [...preferredIdes, ...otherIdes];
this.displaySelectedTools(allSelectedIdes, preferredIdes, allTools);
return {