Major WHOOSH system refactoring and feature enhancements
- Migrated from HIVE branding to WHOOSH across all components - Enhanced backend API with new services: AI models, BZZZ integration, templates, members - Added comprehensive testing suite with security, performance, and integration tests - Improved frontend with new components for project setup, AI models, and team management - Updated MCP server implementation with WHOOSH-specific tools and resources - Enhanced deployment configurations with production-ready Docker setups - Added comprehensive documentation and setup guides - Implemented age encryption service and UCXL integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
66
mcp-server/dist/index.js
vendored
66
mcp-server/dist/index.js
vendored
@@ -1,26 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Hive MCP Server
|
||||
* WHOOSH MCP Server
|
||||
*
|
||||
* Exposes the Hive Distributed AI Orchestration Platform via Model Context Protocol (MCP)
|
||||
* Exposes the WHOOSH Distributed AI Orchestration Platform via Model Context Protocol (MCP)
|
||||
* Allows AI assistants like Claude to directly orchestrate distributed development tasks
|
||||
*/
|
||||
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
||||
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
||||
import { HiveClient } from './hive-client.js';
|
||||
import { HiveTools } from './hive-tools.js';
|
||||
import { HiveResources } from './hive-resources.js';
|
||||
class HiveMCPServer {
|
||||
import { WHOOSHClient } from './whoosh-client.js';
|
||||
import { WHOOSHTools } from './whoosh-tools.js';
|
||||
import { WHOOSHResources } from './whoosh-resources.js';
|
||||
class WHOOSHMCPServer {
|
||||
server;
|
||||
hiveClient;
|
||||
hiveTools;
|
||||
hiveResources;
|
||||
whooshClient;
|
||||
whooshTools;
|
||||
whooshResources;
|
||||
discoveryInterval;
|
||||
isDaemonMode = false;
|
||||
constructor() {
|
||||
this.server = new Server({
|
||||
name: 'hive-mcp-server',
|
||||
name: 'whoosh-mcp-server',
|
||||
version: '1.0.0',
|
||||
}, {
|
||||
capabilities: {
|
||||
@@ -28,32 +28,32 @@ class HiveMCPServer {
|
||||
resources: {},
|
||||
},
|
||||
});
|
||||
// Initialize Hive client and handlers
|
||||
this.hiveClient = new HiveClient();
|
||||
this.hiveTools = new HiveTools(this.hiveClient);
|
||||
this.hiveResources = new HiveResources(this.hiveClient);
|
||||
// Initialize WHOOSH client and handlers
|
||||
this.whooshClient = new WHOOSHClient();
|
||||
this.whooshTools = new WHOOSHTools(this.whooshClient);
|
||||
this.whooshResources = new WHOOSHResources(this.whooshClient);
|
||||
this.setupHandlers();
|
||||
}
|
||||
setupHandlers() {
|
||||
// Tools handler - exposes Hive operations as MCP tools
|
||||
// Tools handler - exposes WHOOSH operations as MCP tools
|
||||
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
return {
|
||||
tools: this.hiveTools.getAllTools(),
|
||||
tools: this.whooshTools.getAllTools(),
|
||||
};
|
||||
});
|
||||
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const { name, arguments: args } = request.params;
|
||||
return await this.hiveTools.executeTool(name, args || {});
|
||||
return await this.whooshTools.executeTool(name, args || {});
|
||||
});
|
||||
// Resources handler - exposes Hive cluster state as MCP resources
|
||||
// Resources handler - exposes WHOOSH cluster state as MCP resources
|
||||
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
||||
return {
|
||||
resources: await this.hiveResources.getAllResources(),
|
||||
resources: await this.whooshResources.getAllResources(),
|
||||
};
|
||||
});
|
||||
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
||||
const { uri } = request.params;
|
||||
return await this.hiveResources.readResource(uri);
|
||||
return await this.whooshResources.readResource(uri);
|
||||
});
|
||||
// Error handling
|
||||
this.server.onerror = (error) => {
|
||||
@@ -71,19 +71,19 @@ class HiveMCPServer {
|
||||
});
|
||||
}
|
||||
async start() {
|
||||
console.log('🐝 Starting Hive MCP Server...');
|
||||
console.log('🐝 Starting WHOOSH MCP Server...');
|
||||
// Check for daemon mode
|
||||
this.isDaemonMode = process.argv.includes('--daemon');
|
||||
if (this.isDaemonMode) {
|
||||
console.log('🔧 Running in daemon mode');
|
||||
}
|
||||
// Test connection to Hive backend
|
||||
// Test connection to WHOOSH backend
|
||||
try {
|
||||
await this.hiveClient.testConnection();
|
||||
console.log('✅ Connected to Hive backend successfully');
|
||||
await this.whooshClient.testConnection();
|
||||
console.log('✅ Connected to WHOOSH backend successfully');
|
||||
}
|
||||
catch (error) {
|
||||
console.error('❌ Failed to connect to Hive backend:', error);
|
||||
console.error('❌ Failed to connect to WHOOSH backend:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
// Auto-discover and register agents on startup
|
||||
@@ -100,7 +100,7 @@ class HiveMCPServer {
|
||||
this.setupPeriodicDiscovery();
|
||||
}
|
||||
if (this.isDaemonMode) {
|
||||
console.log('🚀 Hive MCP Server running in daemon mode');
|
||||
console.log('🚀 WHOOSH MCP Server running in daemon mode');
|
||||
console.log('🔗 Monitoring cluster and auto-discovering agents...');
|
||||
// Keep the process alive in daemon mode
|
||||
setInterval(() => {
|
||||
@@ -110,7 +110,7 @@ class HiveMCPServer {
|
||||
else {
|
||||
const transport = new StdioServerTransport();
|
||||
await this.server.connect(transport);
|
||||
console.log('🚀 Hive MCP Server running on stdio');
|
||||
console.log('🚀 WHOOSH MCP Server running on stdio');
|
||||
console.log('🔗 AI assistants can now orchestrate your distributed cluster!');
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,8 @@ class HiveMCPServer {
|
||||
}, interval);
|
||||
}
|
||||
async autoDiscoverAgents() {
|
||||
// Use the existing hive_bring_online functionality
|
||||
const result = await this.hiveTools.executeTool('hive_bring_online', {
|
||||
// Use the existing whoosh_bring_online functionality
|
||||
const result = await this.whooshTools.executeTool('whoosh_bring_online', {
|
||||
force_refresh: false,
|
||||
subnet_scan: true
|
||||
});
|
||||
@@ -139,20 +139,20 @@ class HiveMCPServer {
|
||||
}
|
||||
}
|
||||
async shutdown() {
|
||||
console.log('🛑 Shutting down Hive MCP Server...');
|
||||
console.log('🛑 Shutting down WHOOSH MCP Server...');
|
||||
if (this.discoveryInterval) {
|
||||
clearInterval(this.discoveryInterval);
|
||||
console.log('✅ Stopped periodic auto-discovery');
|
||||
}
|
||||
await this.server.close();
|
||||
console.log('✅ Hive MCP Server stopped');
|
||||
console.log('✅ WHOOSH MCP Server stopped');
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
// Start the server
|
||||
const server = new HiveMCPServer();
|
||||
const server = new WHOOSHMCPServer();
|
||||
server.start().catch((error) => {
|
||||
console.error('Failed to start Hive MCP Server:', error);
|
||||
console.error('Failed to start WHOOSH MCP Server:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user