@hivetechs/hive-ai
Version:
Real-time streaming AI consensus platform with HTTP+SSE MCP integration for Claude Code, VS Code, Cursor, and Windsurf - powered by OpenRouter's unified API
69 lines โข 3.47 kB
JavaScript
/**
* Setup Expert Profiles - Clean System Setup
*
* This script:
* 1. Cleans up all old-format profiles (OpenRouter ID format)
* 2. Creates only the 10 expert profiles using internal IDs
* 3. Sets a sensible default profile
*/
import { cleanupOldProfiles, enforceExpertProfilesOnly, setDefaultPipelineProfile } from '../storage/unified-database.js';
import { ExpertTemplateManager, EXPERT_TEMPLATES } from './expert-profile-templates.js';
async function setupExpertProfiles() {
console.log('๐ Setting Up Expert Profile System');
console.log('โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ\n');
try {
// Step 1: Clean up old profiles
console.log('๐งน Step 1: Cleaning up old-format profiles...');
const cleanedOld = await cleanupOldProfiles();
console.log(` โ
Removed ${cleanedOld} old-format profiles\n`);
// Step 2: Enforce expert profiles only
console.log('๐ฏ Step 2: Enforcing expert profiles only...');
await enforceExpertProfilesOnly();
console.log(' โ
Non-expert profiles removed\n');
// Step 3: Create all 10 expert profiles
console.log('๐จโ๐ป Step 3: Creating expert profiles...');
const manager = new ExpertTemplateManager();
for (const template of EXPERT_TEMPLATES) {
try {
console.log(` ๐ Creating: ${template.name}...`);
await manager.createProfileFromTemplate(template.id, `${template.name} Profile`);
console.log(` โ
Created: ${template.name} Profile`);
}
catch (error) {
console.log(` โ ๏ธ Failed to create ${template.name}: ${error}`);
console.log(` ๐ก This may be because models are not synced - run 'hive sync' first`);
}
}
// Step 4: Set a good default profile
console.log('\nโญ Step 4: Setting default profile...');
try {
await setDefaultPipelineProfile('Startup MVP Profile');
console.log(' โ
Set "Startup MVP Profile" as default');
}
catch (error) {
console.log(' โ ๏ธ Could not set default profile - will use first available');
}
console.log('\n๐ Expert Profile Setup Complete!');
console.log('โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
console.log('โ
Only expert profiles with internal IDs are now available');
console.log('๐ก Use "hive profiles list" to see available profiles');
console.log('๐ Use "hive profiles switch <name>" to change active profile');
}
catch (error) {
console.error('\nโ Expert profile setup failed:', error);
console.error('๐ก Try running "hive sync" first to ensure models are available');
throw error;
}
}
// Run if called directly
if (import.meta.url === `file://${process.argv[1]}`) {
setupExpertProfiles()
.then(() => process.exit(0))
.catch((error) => {
console.error('Setup failed:', error);
process.exit(1);
});
}
export { setupExpertProfiles };
//# sourceMappingURL=setup-expert-profiles.js.map