a-teams
Version:
a-teams by Worksona - worksona agents and agentic teams in claude.ai. Enterprise-grade multi-agent workflow system with 60+ specialized agents, comprehensive template system, and advanced orchestration capabilities for business, technical, and research ta
110 lines (95 loc) • 3.4 kB
JavaScript
import { readFileSync, existsSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import chalk from 'chalk';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const rootDir = join(__dirname, '..');
console.log(chalk.cyan(`
╔═══════════════════════════════════════════╗
║ a-teams Release Preparation ║
╚═══════════════════════════════════════════╝
`));
let hasErrors = false;
// Check required files
const requiredFiles = [
'package.json',
'README.md',
'LICENSE',
'bin/a-teams',
'src/index.js'
];
console.log(chalk.blue('📋 Checking required files...'));
for (const file of requiredFiles) {
const filePath = join(rootDir, file);
if (existsSync(filePath)) {
console.log(chalk.green(`✓ ${file}`));
} else {
console.log(chalk.red(`✗ Missing: ${file}`));
hasErrors = true;
}
}
// Validate package.json
console.log(chalk.blue('\n📦 Validating package.json...'));
try {
const packageJson = JSON.parse(readFileSync(join(rootDir, 'package.json'), 'utf-8'));
const requiredFields = ['name', 'version', 'description', 'main', 'bin', 'author', 'license'];
for (const field of requiredFields) {
if (packageJson[field]) {
console.log(chalk.green(`✓ ${field}: ${JSON.stringify(packageJson[field])}`));
} else {
console.log(chalk.red(`✗ Missing field: ${field}`));
hasErrors = true;
}
}
// Check bin exists
if (packageJson.bin && packageJson.bin['a-teams']) {
const binPath = join(rootDir, packageJson.bin['a-teams']);
if (existsSync(binPath)) {
console.log(chalk.green(`✓ Binary file exists: ${packageJson.bin['a-teams']}`));
} else {
console.log(chalk.red(`✗ Binary file missing: ${packageJson.bin['a-teams']}`));
hasErrors = true;
}
}
} catch (error) {
console.log(chalk.red(`✗ Invalid package.json: ${error.message}`));
hasErrors = true;
}
// Check agents directory
console.log(chalk.blue('\n🤖 Checking agents...'));
const agentsDir = join(rootDir, 'agents');
if (existsSync(agentsDir)) {
console.log(chalk.green('✓ Agents directory exists'));
// Could add more detailed agent validation here
} else {
console.log(chalk.red('✗ Agents directory missing'));
hasErrors = true;
}
// Check workflows directory
console.log(chalk.blue('\n🔄 Checking workflows...'));
const workflowsDir = join(rootDir, 'workflows');
if (existsSync(workflowsDir)) {
console.log(chalk.green('✓ Workflows directory exists'));
} else {
console.log(chalk.red('✗ Workflows directory missing'));
hasErrors = true;
}
// Final result
console.log(chalk.blue('\n📊 Release Validation Summary:'));
if (hasErrors) {
console.log(chalk.red('❌ Release validation failed. Please fix the issues above.'));
process.exit(1);
} else {
console.log(chalk.green('✅ Release validation passed. Package is ready for publishing!'));
console.log(chalk.blue(`
🚀 Next steps:
npm version patch|minor|major # Bump version
npm publish # Publish to npm
📦 Package info:
Name: a-teams
Registry: https://registry.npmjs.org/
Access: public
`));
}