agentic-qe
Version:
Agentic Quality Engineering Fleet System - AI-driven quality management platform
67 lines • 3.38 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FleetScaleCommand = void 0;
const chalk_1 = __importDefault(require("chalk"));
const fs = __importStar(require("fs-extra"));
class FleetScaleCommand {
static async execute(options) {
// Validate input
if (options.agents < 1 || options.agents > 100) {
throw new Error('Invalid agent count. Must be between 1 and 100');
}
// Load current configuration
const fleetConfig = await fs.readJson('.agentic-qe/config/fleet.json');
const currentAgents = fleetConfig.maxAgents;
console.log(chalk_1.default.blue(`⚙️ Scaling fleet from ${currentAgents} to ${options.agents} agents...`));
// Update fleet configuration
fleetConfig.maxAgents = options.agents;
fleetConfig.lastScaled = new Date().toISOString();
fleetConfig.scalingHistory = fleetConfig.scalingHistory || [];
fleetConfig.scalingHistory.push({
from: currentAgents,
to: options.agents,
timestamp: new Date().toISOString()
});
await fs.writeJson('.agentic-qe/config/fleet.json', fleetConfig, { spaces: 2 });
// Store in coordination
await this.storeScalingOperation(currentAgents, options.agents);
console.log(chalk_1.default.green('✅ Fleet scaled successfully'));
console.log(chalk_1.default.gray(` Previous: ${currentAgents} agents`));
console.log(chalk_1.default.gray(` Current: ${options.agents} agents`));
console.log(chalk_1.default.gray(` Change: ${options.agents > currentAgents ? '+' : ''}${options.agents - currentAgents}`));
}
static async storeScalingOperation(from, to) {
const script = `npx claude-flow@alpha memory store --key "aqe/fleet/scaling" --value '{"from":${from},"to":${to},"timestamp":"${new Date().toISOString()}"}'`;
// Store scaling script for later execution
await fs.writeFile('.agentic-qe/scripts/last-scaling.sh', `#!/bin/bash\n${script}\n`);
await fs.chmod('.agentic-qe/scripts/last-scaling.sh', '755');
}
}
exports.FleetScaleCommand = FleetScaleCommand;
//# sourceMappingURL=scale.js.map