feat: can now select different web bundles from what ide agents are installed
This commit is contained in:
@@ -210,7 +210,7 @@ async function promptInstallation() {
|
||||
{
|
||||
type: 'list',
|
||||
name: 'team',
|
||||
message: 'Select a team to install:',
|
||||
message: 'Select a team to install in your IDE project folder:',
|
||||
choices: teams.map(t => ({
|
||||
name: `${t.icon || '📋'} ${t.name}: ${t.description}`,
|
||||
value: t.id
|
||||
@@ -294,12 +294,80 @@ async function promptInstallation() {
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'includeWebBundles',
|
||||
message: 'Would you like to include pre-built web bundles? (standalone agent/team files)',
|
||||
message: 'Would you like to include pre-built web bundles? (standalone files for ChatGPT, Claude, Gemini)',
|
||||
default: true
|
||||
}
|
||||
]);
|
||||
|
||||
if (includeWebBundles) {
|
||||
console.log(chalk.cyan('\n📦 Web bundles are standalone files perfect for web AI platforms.'));
|
||||
console.log(chalk.dim(' You can choose different teams/agents than your IDE installation.\n'));
|
||||
|
||||
const { webBundleType } = await inquirer.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'webBundleType',
|
||||
message: 'What web bundles would you like to include?',
|
||||
choices: [
|
||||
{
|
||||
name: 'All available bundles (agents, teams, expansion packs)',
|
||||
value: 'all'
|
||||
},
|
||||
{
|
||||
name: 'Specific teams only',
|
||||
value: 'teams'
|
||||
},
|
||||
{
|
||||
name: 'Individual agents only',
|
||||
value: 'agents'
|
||||
},
|
||||
{
|
||||
name: 'Custom selection',
|
||||
value: 'custom'
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
answers.webBundleType = webBundleType;
|
||||
|
||||
// If specific teams, let them choose which teams
|
||||
if (webBundleType === 'teams' || webBundleType === 'custom') {
|
||||
const teams = await installer.getAvailableTeams();
|
||||
const { selectedTeams } = await inquirer.prompt([
|
||||
{
|
||||
type: 'checkbox',
|
||||
name: 'selectedTeams',
|
||||
message: 'Select team bundles to include:',
|
||||
choices: teams.map(t => ({
|
||||
name: `${t.icon || '📋'} ${t.name}: ${t.description}`,
|
||||
value: t.id,
|
||||
checked: webBundleType === 'teams' // Check all if teams-only mode
|
||||
})),
|
||||
validate: (answer) => {
|
||||
if (answer.length < 1) {
|
||||
return 'You must select at least one team.';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
]);
|
||||
answers.selectedWebBundleTeams = selectedTeams;
|
||||
}
|
||||
|
||||
// If custom selection, also ask about individual agents
|
||||
if (webBundleType === 'custom') {
|
||||
const { includeIndividualAgents } = await inquirer.prompt([
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'includeIndividualAgents',
|
||||
message: 'Also include individual agent bundles?',
|
||||
default: true
|
||||
}
|
||||
]);
|
||||
answers.includeIndividualAgents = includeIndividualAgents;
|
||||
}
|
||||
|
||||
const { webBundlesDirectory } = await inquirer.prompt([
|
||||
{
|
||||
type: 'input',
|
||||
|
||||
@@ -327,7 +327,7 @@ class Installer {
|
||||
// Install web bundles if requested
|
||||
if (config.includeWebBundles && config.webBundlesDirectory) {
|
||||
spinner.text = "Installing web bundles...";
|
||||
await this.installWebBundles(config.webBundlesDirectory, spinner);
|
||||
await this.installWebBundles(config.webBundlesDirectory, config, spinner);
|
||||
}
|
||||
|
||||
// Set up IDE integration if requested
|
||||
@@ -580,7 +580,8 @@ class Installer {
|
||||
}
|
||||
|
||||
if (config.includeWebBundles && config.webBundlesDirectory) {
|
||||
console.log(chalk.green(`✓ Web bundles installed to: ${config.webBundlesDirectory}`));
|
||||
const bundleInfo = this.getWebBundleInfo(config);
|
||||
console.log(chalk.green(`✓ Web bundles (${bundleInfo}) installed to: ${config.webBundlesDirectory}`));
|
||||
}
|
||||
|
||||
if (ides.length > 0) {
|
||||
@@ -809,7 +810,33 @@ class Installer {
|
||||
return installedFiles;
|
||||
}
|
||||
|
||||
async installWebBundles(webBundlesDirectory, spinner) {
|
||||
getWebBundleInfo(config) {
|
||||
const webBundleType = config.webBundleType || 'all';
|
||||
|
||||
switch (webBundleType) {
|
||||
case 'all':
|
||||
return 'all bundles';
|
||||
case 'agents':
|
||||
return 'individual agents only';
|
||||
case 'teams':
|
||||
return config.selectedWebBundleTeams ?
|
||||
`teams: ${config.selectedWebBundleTeams.join(', ')}` :
|
||||
'selected teams';
|
||||
case 'custom':
|
||||
const parts = [];
|
||||
if (config.selectedWebBundleTeams && config.selectedWebBundleTeams.length > 0) {
|
||||
parts.push(`teams: ${config.selectedWebBundleTeams.join(', ')}`);
|
||||
}
|
||||
if (config.includeIndividualAgents) {
|
||||
parts.push('individual agents');
|
||||
}
|
||||
return parts.length > 0 ? parts.join(' + ') : 'custom selection';
|
||||
default:
|
||||
return 'selected bundles';
|
||||
}
|
||||
}
|
||||
|
||||
async installWebBundles(webBundlesDirectory, config, spinner) {
|
||||
// Ensure modules are initialized
|
||||
await initializeModules();
|
||||
|
||||
@@ -825,10 +852,56 @@ class Installer {
|
||||
// Ensure web bundles directory exists
|
||||
await fileManager.ensureDirectory(webBundlesDirectory);
|
||||
|
||||
// Copy the entire dist directory structure to web bundles directory
|
||||
await fileManager.copyDirectory(distDir, webBundlesDirectory);
|
||||
const webBundleType = config.webBundleType || 'all';
|
||||
|
||||
console.log(chalk.green(`✓ Installed web bundles to: ${webBundlesDirectory}`));
|
||||
if (webBundleType === 'all') {
|
||||
// Copy the entire dist directory structure
|
||||
await fileManager.copyDirectory(distDir, webBundlesDirectory);
|
||||
console.log(chalk.green(`✓ Installed all web bundles to: ${webBundlesDirectory}`));
|
||||
} else {
|
||||
let copiedCount = 0;
|
||||
|
||||
// Copy specific selections based on type
|
||||
if (webBundleType === 'agents' || (webBundleType === 'custom' && config.includeIndividualAgents)) {
|
||||
const agentsSource = path.join(distDir, 'agents');
|
||||
const agentsTarget = path.join(webBundlesDirectory, 'agents');
|
||||
if (await fileManager.pathExists(agentsSource)) {
|
||||
await fileManager.copyDirectory(agentsSource, agentsTarget);
|
||||
console.log(chalk.green(`✓ Copied individual agent bundles`));
|
||||
copiedCount += 10; // Approximate count for agents
|
||||
}
|
||||
}
|
||||
|
||||
if (webBundleType === 'teams' || webBundleType === 'custom') {
|
||||
if (config.selectedWebBundleTeams && config.selectedWebBundleTeams.length > 0) {
|
||||
const teamsSource = path.join(distDir, 'teams');
|
||||
const teamsTarget = path.join(webBundlesDirectory, 'teams');
|
||||
await fileManager.ensureDirectory(teamsTarget);
|
||||
|
||||
for (const teamId of config.selectedWebBundleTeams) {
|
||||
const teamFile = `${teamId}.txt`;
|
||||
const sourcePath = path.join(teamsSource, teamFile);
|
||||
const targetPath = path.join(teamsTarget, teamFile);
|
||||
|
||||
if (await fileManager.pathExists(sourcePath)) {
|
||||
await fileManager.copyFile(sourcePath, targetPath);
|
||||
copiedCount++;
|
||||
console.log(chalk.green(`✓ Copied team bundle: ${teamId}`));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Always copy expansion packs if they exist
|
||||
const expansionSource = path.join(distDir, 'expansion-packs');
|
||||
const expansionTarget = path.join(webBundlesDirectory, 'expansion-packs');
|
||||
if (await fileManager.pathExists(expansionSource)) {
|
||||
await fileManager.copyDirectory(expansionSource, expansionTarget);
|
||||
console.log(chalk.green(`✓ Copied expansion pack bundles`));
|
||||
}
|
||||
|
||||
console.log(chalk.green(`✓ Installed ${copiedCount} selected web bundles to: ${webBundlesDirectory}`));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(chalk.red(`Failed to install web bundles: ${error.message}`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user