Format tools/ with Prettier
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
544ddcb76f
commit
5230b1249f
|
|
@ -152,8 +152,7 @@ class BaseIdeSetup {
|
|||
const agentName = path.basename(filePath, '.md');
|
||||
return {
|
||||
name: this.formatTitle(agentName),
|
||||
description: agentName.includes('saga') ? 'Strategic Analyst' :
|
||||
agentName.includes('freya') ? 'Designer' : '',
|
||||
description: agentName.includes('saga') ? 'Strategic Analyst' : agentName.includes('freya') ? 'Designer' : '',
|
||||
icon: '📋',
|
||||
slug: agentName.split('-')[0],
|
||||
};
|
||||
|
|
@ -176,8 +175,7 @@ class BaseIdeSetup {
|
|||
* @returns {string} Launcher content
|
||||
*/
|
||||
formatAgentLauncher(agentName, agentPath) {
|
||||
const relativePath = path.relative(process.cwd(), agentPath)
|
||||
.replaceAll('\\', '/'); // Convert Windows paths to forward slashes
|
||||
const relativePath = path.relative(process.cwd(), agentPath).replaceAll('\\', '/'); // Convert Windows paths to forward slashes
|
||||
|
||||
return `<!-- WDS Agent Launcher -->
|
||||
<!-- This file references the compiled agent. Do not edit directly. -->
|
||||
|
|
|
|||
|
|
@ -67,9 +67,7 @@ class ClineSetup extends BaseIdeSetup {
|
|||
const contentWithoutFrontmatter = content.replace(frontmatterRegex, '');
|
||||
|
||||
// Add title header for Cline
|
||||
const title = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const title = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
return `# ${title}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ class CrushSetup extends BaseIdeSetup {
|
|||
}
|
||||
|
||||
processContent(content, metadata = {}) {
|
||||
const title = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const title = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
return `# ${title}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ class CursorSetup extends BaseIdeSetup {
|
|||
const frontmatterRegex = /^---\s*\n[\s\S]*?\n---\s*\n/;
|
||||
const contentWithoutFrontmatter = content.replace(frontmatterRegex, '');
|
||||
|
||||
const description = metadata.name ?
|
||||
`WDS Agent: ${metadata.name} - ${metadata.description}` :
|
||||
`WDS Agent: ${metadata.description || 'Agent'}`;
|
||||
const description = metadata.name
|
||||
? `WDS Agent: ${metadata.name} - ${metadata.description}`
|
||||
: `WDS Agent: ${metadata.description || 'Agent'}`;
|
||||
|
||||
// Create Cursor MDC metadata header
|
||||
const mdcHeader = `---
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@ class GeminiSetup extends BaseIdeSetup {
|
|||
}
|
||||
|
||||
processContent(content, metadata = {}) {
|
||||
const description = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const description = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
// Escape content for TOML multi-line string
|
||||
const escapedContent = content.replaceAll('"""', String.raw`\"\"\"`);
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ class IFlowSetup extends BaseIdeSetup {
|
|||
}
|
||||
|
||||
processContent(content, metadata = {}) {
|
||||
const title = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const title = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
return `# ${title}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@ class KiloSetup extends BaseIdeSetup {
|
|||
modesContent += `\n roleDefinition: "${agent.metadata.description || 'WDS Agent'}"`;
|
||||
modesContent += `\n customInstructions: |`;
|
||||
// Indent launcher content for YAML block
|
||||
const indented = launcher.split('\n').map(line => ` ${line}`).join('\n');
|
||||
const indented = launcher
|
||||
.split('\n')
|
||||
.map((line) => ` ${line}`)
|
||||
.join('\n');
|
||||
modesContent += `\n${indented}\n`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ class KiroCliSetup extends BaseIdeSetup {
|
|||
description: agent.metadata.description || 'WDS Agent',
|
||||
prompt: `./${agent.slug}-prompt.md`,
|
||||
};
|
||||
await this.writeFile(
|
||||
path.join(targetDir, `${agent.slug}.json`),
|
||||
JSON.stringify(jsonConfig, null, 2)
|
||||
);
|
||||
await this.writeFile(path.join(targetDir, `${agent.slug}.json`), JSON.stringify(jsonConfig, null, 2));
|
||||
|
||||
// Write markdown prompt
|
||||
await this.writeFile(path.join(targetDir, `${agent.slug}-prompt.md`), launcher);
|
||||
|
|
|
|||
|
|
@ -37,11 +37,7 @@ class IdeManager {
|
|||
// Get all JS files in the IDE directory
|
||||
const files = fs.readdirSync(ideDir).filter((file) => {
|
||||
// Skip base class, manager, and utility files (starting with _)
|
||||
return (
|
||||
file.endsWith('.js') &&
|
||||
!file.startsWith('_') &&
|
||||
file !== 'manager.js'
|
||||
);
|
||||
return file.endsWith('.js') && !file.startsWith('_') && file !== 'manager.js';
|
||||
});
|
||||
|
||||
// Sort alphabetically for consistent ordering
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@ class QwenSetup extends BaseIdeSetup {
|
|||
}
|
||||
|
||||
processContent(content, metadata = {}) {
|
||||
const description = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const description = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
// Escape content for TOML multi-line string
|
||||
const escapedContent = content.replaceAll('"""', String.raw`\"\"\"`);
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ class TraeSetup extends BaseIdeSetup {
|
|||
}
|
||||
|
||||
processContent(content, metadata = {}) {
|
||||
const title = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const title = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
return `# ${title}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@ class WindsurfSetup extends BaseIdeSetup {
|
|||
* @returns {string} Processed content with Windsurf YAML frontmatter
|
||||
*/
|
||||
processContent(content, metadata = {}) {
|
||||
const description = metadata.name ?
|
||||
`${metadata.name} - ${metadata.description}` :
|
||||
metadata.description || 'WDS Agent';
|
||||
const description = metadata.name ? `${metadata.name} - ${metadata.description}` : metadata.description || 'WDS Agent';
|
||||
|
||||
return `---
|
||||
description: ${description}
|
||||
|
|
|
|||
|
|
@ -49,17 +49,17 @@ class Installer {
|
|||
}
|
||||
|
||||
// Handle update vs fresh for existing target path
|
||||
if (action === 'update' && await fs.pathExists(wdsDir)) {
|
||||
if (action === 'update' && (await fs.pathExists(wdsDir))) {
|
||||
// Preserve config.yaml during update
|
||||
const configPath = path.join(wdsDir, 'config.yaml');
|
||||
if (!config._savedConfigYaml && await fs.pathExists(configPath)) {
|
||||
if (!config._savedConfigYaml && (await fs.pathExists(configPath))) {
|
||||
config._savedConfigYaml = await fs.readFile(configPath, 'utf8');
|
||||
}
|
||||
|
||||
const removeSpinner = ora('Updating WDS files...').start();
|
||||
await fs.remove(wdsDir);
|
||||
removeSpinner.succeed('Old files cleared');
|
||||
} else if (action === 'fresh' && await fs.pathExists(wdsDir)) {
|
||||
} else if (action === 'fresh' && (await fs.pathExists(wdsDir))) {
|
||||
const removeSpinner = ora('Removing existing WDS installation...').start();
|
||||
await fs.remove(wdsDir);
|
||||
removeSpinner.succeed('Old installation removed');
|
||||
|
|
@ -71,7 +71,9 @@ class Installer {
|
|||
const savedData = yaml.load(config._savedConfigYaml);
|
||||
if (!config.ides && savedData.ides) config.ides = savedData.ides;
|
||||
if (!config.root_folder && savedData.output_folder) config.root_folder = savedData.output_folder;
|
||||
} catch { /* ignore parse errors, defaults will apply */ }
|
||||
} catch {
|
||||
/* ignore parse errors, defaults will apply */
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure parent directory exists (for _bmad/wds/)
|
||||
|
|
@ -116,18 +118,13 @@ class Installer {
|
|||
const { IdeManager } = require('../installers/lib/ide/manager');
|
||||
const ideManager = new IdeManager();
|
||||
|
||||
const results = await ideManager.setup(
|
||||
projectDir,
|
||||
wdsDir,
|
||||
config.ides,
|
||||
{
|
||||
logger: {
|
||||
log: (msg) => {}, // Suppress detailed logs during spinner
|
||||
warn: (msg) => console.log(msg),
|
||||
},
|
||||
wdsFolderName: wdsFolder,
|
||||
}
|
||||
);
|
||||
const results = await ideManager.setup(projectDir, wdsDir, config.ides, {
|
||||
logger: {
|
||||
log: (msg) => {}, // Suppress detailed logs during spinner
|
||||
warn: (msg) => console.log(msg),
|
||||
},
|
||||
wdsFolderName: wdsFolder,
|
||||
});
|
||||
|
||||
const successCount = results.success.length;
|
||||
const failedCount = results.failed.length;
|
||||
|
|
@ -285,12 +282,7 @@ class Installer {
|
|||
const docsPath = path.join(projectDir, rootFolder);
|
||||
|
||||
// Simplified 4-phase structure
|
||||
const folders = [
|
||||
'A-Product-Brief',
|
||||
'B-Trigger-Map',
|
||||
'C-UX-Scenarios',
|
||||
'D-Design-System',
|
||||
];
|
||||
const folders = ['A-Product-Brief', 'B-Trigger-Map', 'C-UX-Scenarios', 'D-Design-System'];
|
||||
|
||||
for (const folder of folders) {
|
||||
const folderPath = path.join(docsPath, folder);
|
||||
|
|
@ -313,7 +305,6 @@ class Installer {
|
|||
await fs.ensureDir(progressPath);
|
||||
await fs.ensureDir(path.join(progressPath, 'agent-experiences'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = { Installer };
|
||||
|
|
|
|||
Loading…
Reference in New Issue