diff --git a/tools/builders/web-builder.js b/tools/builders/web-builder.js index bac8ea0c..9ed8bd99 100644 --- a/tools/builders/web-builder.js +++ b/tools/builders/web-builder.js @@ -519,9 +519,32 @@ class WebBuilder { * Ensure sample update directory exists */ ensureSampleUpdateDirectory() { + // Clean existing files in web-bundles subdirectories + const teamsDir = path.join(this.sampleUpdatePath, 'teams'); + const agentsDir = path.join(this.sampleUpdatePath, 'agents'); + + // Remove existing .txt files in teams directory + if (fs.existsSync(teamsDir)) { + const teamFiles = fs.readdirSync(teamsDir).filter(f => f.endsWith('.txt')); + teamFiles.forEach(file => { + fs.unlinkSync(path.join(teamsDir, file)); + }); + console.log(`🧹 Cleaned ${teamFiles.length} files from web-bundles/teams`); + } + + // Remove existing .txt files in agents directory + if (fs.existsSync(agentsDir)) { + const agentFiles = fs.readdirSync(agentsDir).filter(f => f.endsWith('.txt')); + agentFiles.forEach(file => { + fs.unlinkSync(path.join(agentsDir, file)); + }); + console.log(`🧹 Cleaned ${agentFiles.length} files from web-bundles/agents`); + } + + // Ensure directories exist this.ensureDirectory(this.sampleUpdatePath); - this.ensureDirectory(path.join(this.sampleUpdatePath, 'teams')); - this.ensureDirectory(path.join(this.sampleUpdatePath, 'agents')); + this.ensureDirectory(teamsDir); + this.ensureDirectory(agentsDir); } } diff --git a/web-bundles/teams/team-all.txt b/web-bundles/teams/team-all.txt index 292567fc..e6bdfac2 100644 --- a/web-bundles/teams/team-all.txt +++ b/web-bundles/teams/team-all.txt @@ -87,7 +87,7 @@ - + ==================== START: agent-config ==================== diff --git a/web-bundles/teams/team-fullstack.txt b/web-bundles/teams/team-fullstack.txt index e82f9f44..5bc8ec7c 100644 --- a/web-bundles/teams/team-fullstack.txt +++ b/web-bundles/teams/team-fullstack.txt @@ -67,7 +67,7 @@ - + ==================== START: agent-config ==================== diff --git a/web-bundles/teams/team-no-ui.txt b/web-bundles/teams/team-no-ui.txt index 178540aa..ace4dfec 100644 --- a/web-bundles/teams/team-no-ui.txt +++ b/web-bundles/teams/team-no-ui.txt @@ -61,7 +61,7 @@ - + ==================== START: agent-config ==================== diff --git a/web-bundles/teams/team-scrum.txt b/web-bundles/teams/team-scrum.txt index 03f0dbc2..0e8cdf4d 100644 --- a/web-bundles/teams/team-scrum.txt +++ b/web-bundles/teams/team-scrum.txt @@ -60,7 +60,7 @@ - + ==================== START: agent-config ==================== diff --git a/web-bundles/teams/team-technical.txt b/web-bundles/teams/team-technical.txt index 767d3412..99120317 100644 --- a/web-bundles/teams/team-technical.txt +++ b/web-bundles/teams/team-technical.txt @@ -58,7 +58,7 @@ - + ==================== START: agent-config ====================