refac tools part 1
This commit is contained in:
parent
1e721f7fd0
commit
34cfdddd3a
|
|
@ -297,14 +297,7 @@ class Installer {
|
||||||
console.log('\n'); // Add spacing before IDE questions
|
console.log('\n'); // Add spacing before IDE questions
|
||||||
|
|
||||||
for (const ide of newlySelectedIdes) {
|
for (const ide of newlySelectedIdes) {
|
||||||
// List of IDEs that have interactive prompts
|
// Get IDE handler and check if it needs interactive configuration
|
||||||
//TODO: Why is this here, hardcoding this list here is bad, fix me!
|
|
||||||
const needsPrompts = ['claude-code', 'github-copilot', 'roo', 'cline', 'auggie', 'codex', 'qwen', 'gemini', 'rovo-dev'].includes(
|
|
||||||
ide,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (needsPrompts) {
|
|
||||||
// Get IDE handler and collect configuration
|
|
||||||
try {
|
try {
|
||||||
// Dynamically load the IDE setup module
|
// Dynamically load the IDE setup module
|
||||||
const ideModule = require(`../ide/${ide}`);
|
const ideModule = require(`../ide/${ide}`);
|
||||||
|
|
@ -327,7 +320,7 @@ class Installer {
|
||||||
|
|
||||||
const ideSetup = new SetupClass();
|
const ideSetup = new SetupClass();
|
||||||
|
|
||||||
// Check if this IDE has a collectConfiguration method
|
// Check if this IDE has a collectConfiguration method (no hardcoding needed!)
|
||||||
if (typeof ideSetup.collectConfiguration === 'function') {
|
if (typeof ideSetup.collectConfiguration === 'function') {
|
||||||
console.log(chalk.cyan(`\nConfiguring ${ide}...`));
|
console.log(chalk.cyan(`\nConfiguring ${ide}...`));
|
||||||
ideConfigurations[ide] = await ideSetup.collectConfiguration({
|
ideConfigurations[ide] = await ideSetup.collectConfiguration({
|
||||||
|
|
@ -342,7 +335,6 @@ class Installer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Log which IDEs are already configured and being kept
|
// Log which IDEs are already configured and being kept
|
||||||
const keptIdes = toolConfig.ides.filter((ide) => previouslyConfiguredIdes.includes(ide));
|
const keptIdes = toolConfig.ides.filter((ide) => previouslyConfiguredIdes.includes(ide));
|
||||||
|
|
|
||||||
|
|
@ -493,11 +493,6 @@ class BaseIdeSetup {
|
||||||
// Replace placeholders
|
// Replace placeholders
|
||||||
let processed = content;
|
let processed = content;
|
||||||
|
|
||||||
// Inject activation block for agent files FIRST (before replacements)
|
|
||||||
if (metadata.name && content.includes('<agent')) {
|
|
||||||
processed = this.xmlHandler.injectActivationSimple(processed, metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only replace {project-root} if a specific projectDir is provided
|
// Only replace {project-root} if a specific projectDir is provided
|
||||||
// Otherwise leave the placeholder intact
|
// Otherwise leave the placeholder intact
|
||||||
// Note: Don't add trailing slash - paths in source include leading slash
|
// Note: Don't add trailing slash - paths in source include leading slash
|
||||||
|
|
|
||||||
|
|
@ -952,7 +952,7 @@ class ModuleManager {
|
||||||
// // Check if content has agent XML and no activation block
|
// // Check if content has agent XML and no activation block
|
||||||
// if (content.includes('<agent') && !content.includes('<activation')) {
|
// if (content.includes('<agent') && !content.includes('<activation')) {
|
||||||
// // Inject the activation block using XML handler
|
// // Inject the activation block using XML handler
|
||||||
// content = this.xmlHandler.injectActivationSimple(content);
|
// // TODO: Reimplement activation injection if needed
|
||||||
// await fs.writeFile(agentFile, content, 'utf8');
|
// await fs.writeFile(agentFile, content, 'utf8');
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const { escapeXml } = require('../../lib/xml-utils');
|
const { escapeXml } = require('./xml-utils');
|
||||||
|
|
||||||
const AgentPartyGenerator = {
|
const AgentPartyGenerator = {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,6 @@ class XmlHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: DELETE THIS METHOD
|
|
||||||
*/
|
|
||||||
injectActivationSimple(agentContent, metadata = {}) {
|
|
||||||
console.error('Error in simple injection:', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build agent from YAML source
|
* Build agent from YAML source
|
||||||
* @param {string} yamlPath - Path to .agent.yaml file
|
* @param {string} yamlPath - Path to .agent.yaml file
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ const path = require('node:path');
|
||||||
const crypto = require('node:crypto');
|
const crypto = require('node:crypto');
|
||||||
const { AgentAnalyzer } = require('./agent-analyzer');
|
const { AgentAnalyzer } = require('./agent-analyzer');
|
||||||
const { ActivationBuilder } = require('./activation-builder');
|
const { ActivationBuilder } = require('./activation-builder');
|
||||||
const { escapeXml } = require('../../../lib/xml-utils');
|
const { escapeXml } = require('../xml-utils');
|
||||||
const {
|
const {
|
||||||
processAgentYaml,
|
processAgentYaml,
|
||||||
extractInstallConfig,
|
extractInstallConfig,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const { escapeXml } = require('../lib/xml-utils');
|
const { escapeXml } = require('../cli/lib/xml-utils');
|
||||||
|
|
||||||
function indentFileContent(content) {
|
function indentFileContent(content) {
|
||||||
if (typeof content !== 'string') {
|
if (typeof content !== 'string') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue