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:
anthonyrawlins
2025-08-27 08:34:48 +10:00
parent 0e9844ef13
commit 268214d971
399 changed files with 57390 additions and 2045 deletions

View File

@@ -1,6 +1,6 @@
"""
CLI Agent Manager for Hive Backend
Integrates CCLI agents with the Hive coordinator system.
CLI Agent Manager for WHOOSH Backend
Integrates CCLI agents with the WHOOSH coordinator system.
"""
import asyncio
@@ -20,9 +20,9 @@ from agents.cli_agent_factory import CliAgentFactory
class CliAgentManager:
"""
Manages CLI agents within the Hive backend system
Manages CLI agents within the WHOOSH backend system
Provides a bridge between the Hive coordinator and CCLI agents,
Provides a bridge between the WHOOSH coordinator and CCLI agents,
handling lifecycle management, task execution, and health monitoring.
"""
@@ -84,33 +84,33 @@ class CliAgentManager:
"""Get a CLI agent by ID"""
return self.active_agents.get(agent_id)
async def execute_cli_task(self, agent_id: str, hive_task: Any) -> Dict[str, Any]:
async def execute_cli_task(self, agent_id: str, whoosh_task: Any) -> Dict[str, Any]:
"""
Execute a Hive task on a CLI agent
Execute a WHOOSH task on a CLI agent
Args:
agent_id: ID of the CLI agent
hive_task: Hive Task object
whoosh_task: WHOOSH Task object
Returns:
Dictionary with execution results compatible with Hive format
Dictionary with execution results compatible with WHOOSH format
"""
agent = self.get_cli_agent(agent_id)
if not agent:
raise ValueError(f"CLI agent {agent_id} not found")
try:
# Convert Hive task to CLI task format
cli_task = self._convert_hive_task_to_cli(hive_task)
# Convert WHOOSH task to CLI task format
cli_task = self._convert_whoosh_task_to_cli(whoosh_task)
# Execute on CLI agent
cli_result = await agent.execute_task(cli_task)
# Convert CLI result back to Hive format
hive_result = self._convert_cli_result_to_hive(cli_result)
# Convert CLI result back to WHOOSH format
whoosh_result = self._convert_cli_result_to_whoosh(cli_result)
self.logger.info(f"CLI task {cli_task.task_id} executed on {agent_id}: {cli_result.status.value}")
return hive_result
return whoosh_result
except Exception as e:
self.logger.error(f"CLI task execution failed on {agent_id}: {e}")
@@ -120,10 +120,10 @@ class CliAgentManager:
"agent_id": agent_id
}
def _convert_hive_task_to_cli(self, hive_task: Any) -> CliTaskRequest:
"""Convert Hive Task to CLI TaskRequest"""
# Build prompt from Hive task context
context = hive_task.context
def _convert_whoosh_task_to_cli(self, whoosh_task: Any) -> CliTaskRequest:
"""Convert WHOOSH Task to CLI TaskRequest"""
# Build prompt from WHOOSH task context
context = whoosh_task.context
prompt_parts = []
if 'objective' in context:
@@ -143,17 +143,17 @@ class CliAgentManager:
return CliTaskRequest(
prompt=prompt,
task_id=hive_task.id,
priority=hive_task.priority,
task_id=whoosh_task.id,
priority=whoosh_task.priority,
metadata={
"hive_task_type": hive_task.type.value,
"hive_context": context
"whoosh_task_type": whoosh_task.type.value,
"whoosh_context": context
}
)
def _convert_cli_result_to_hive(self, cli_result: CliTaskResult) -> Dict[str, Any]:
"""Convert CLI TaskResult to Hive result format"""
# Map CLI status to Hive format
def _convert_cli_result_to_whoosh(self, cli_result: CliTaskResult) -> Dict[str, Any]:
"""Convert CLI TaskResult to WHOOSH result format"""
# Map CLI status to WHOOSH format
status_mapping = {
"completed": "completed",
"failed": "failed",
@@ -162,11 +162,11 @@ class CliAgentManager:
"running": "in_progress"
}
hive_status = status_mapping.get(cli_result.status.value, "failed")
whoosh_status = status_mapping.get(cli_result.status.value, "failed")
result = {
"response": cli_result.response,
"status": hive_status,
"status": whoosh_status,
"execution_time": cli_result.execution_time,
"agent_id": cli_result.agent_id,
"model": cli_result.model
@@ -236,29 +236,29 @@ class CliAgentManager:
except Exception as e:
self.logger.error(f"❌ CLI Agent Manager shutdown error: {e}")
def register_hive_agent_from_cli_config(self, agent_id: str, cli_config: Dict[str, Any]) -> Dict[str, Any]:
def register_whoosh_agent_from_cli_config(self, agent_id: str, cli_config: Dict[str, Any]) -> Dict[str, Any]:
"""
Create agent registration data for Hive coordinator from CLI config
Create agent registration data for WHOOSH coordinator from CLI config
Returns agent data compatible with Hive Agent dataclass
Returns agent data compatible with WHOOSH Agent dataclass
"""
# Map CLI specializations to Hive AgentTypes
# Map CLI specializations to WHOOSH AgentTypes
specialization_mapping = {
"general_ai": "general_ai",
"reasoning": "reasoning",
"code_analysis": "profiler", # Map to existing Hive type
"code_analysis": "profiler", # Map to existing WHOOSH type
"documentation": "docs_writer",
"testing": "tester"
}
cli_specialization = cli_config.get("specialization", "general_ai")
hive_specialty = specialization_mapping.get(cli_specialization, "general_ai")
whoosh_specialty = specialization_mapping.get(cli_specialization, "general_ai")
return {
"id": agent_id,
"endpoint": f"cli://{cli_config['host']}",
"model": cli_config.get("model", "gemini-2.5-pro"),
"specialty": hive_specialty,
"specialty": whoosh_specialty,
"max_concurrent": cli_config.get("max_concurrent", 2),
"current_tasks": 0,
"agent_type": "cli",