Commit Graph

25 Commits

Author SHA1 Message Date
anthonyrawlins
4de45bf450 Merge redundant coordinators into unified coordinator architecture
Major refactoring:
- Created UnifiedCoordinator that combines HiveCoordinator and DistributedCoordinator
- Eliminated code duplication and architectural redundancy
- Unified agent management, task orchestration, and workflow execution
- Single coordinator instance replaces two global coordinators
- Backward compatibility maintained through state aliases

Key features of UnifiedCoordinator:
 Combined agent types: Ollama + CLI agents with unified management
 Dual task modes: Simple tasks + complex distributed workflows
 Performance monitoring: Prometheus metrics + adaptive load balancing
 Background processes: Health monitoring + performance optimization
 Redis integration: Distributed caching and coordination (optional)
 Database integration: Agent loading + task persistence preparation

API updates:
- Updated all API endpoints to use unified coordinator
- Maintained interface compatibility for existing endpoints
- Fixed attribute references for unified agent model
- Simplified dependency injection pattern

Architecture benefits:
- Single point of coordination eliminates race conditions
- Reduced memory footprint (one coordinator vs two)
- Simplified initialization and lifecycle management
- Consistent feature set across all orchestration modes
- Better separation of concerns within single coordinator class

This resolves the critical architectural issue of redundant coordinators
while maintaining full backward compatibility and adding enhanced features.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 08:44:21 +10:00
anthonyrawlins
c90d98dac3 Add comprehensive database rebuild capability with complete unified schema
Features:
- Complete SQL schema file (000_complete_schema.sql) for full database rebuild
- Unified authentication system with UUID-based users, API keys, refresh tokens
- All platform tables: users, agents, workflows, tasks, executions, metrics, alerts
- Comprehensive indexing strategy for performance optimization
- Automated rebuild scripts (Python and Shell) with Docker integration
- Detailed documentation with usage instructions and troubleshooting

Schema capabilities:
 UUID-based design for scalability and consistency
 Complete authentication: JWT, API keys, password hashing, token blacklisting
 Agent management: Ollama and CLI agents with performance metrics
 Workflow orchestration: n8n integration with execution tracking
 Task management: Priority-based assignment and status tracking
 Monitoring: System alerts, performance metrics, health checks
 Default users: admin and developer accounts for immediate access

This provides a single-command database rebuild capability that creates
the complete Hive platform schema from scratch, resolving all previous
schema conflicts and providing a clean foundation for authentication
and full platform functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 08:35:37 +10:00
anthonyrawlins
eda5b2d6d3 Unify database schema: Resolve all User model conflicts and auth table incompatibilities
Major changes:
- Consolidate 3 different User models into single unified model (models/user.py)
- Use UUID primary keys throughout (matches existing database schema)
- Add comprehensive authentication fields while preserving existing data
- Remove duplicate User model from auth.py, keep APIKey/RefreshToken/TokenBlacklist
- Update all imports to use unified User model consistently
- Create database migration (002_add_auth_fields.sql) for safe schema upgrade
- Fix frontend User interface to handle UUID string IDs
- Add backward compatibility fields (name property, role field)
- Maintain relationships for authentication features (api_keys, refresh_tokens)

Schema conflicts resolved:
 Migration schema (UUID, 7 fields) + Basic model (Integer, 6 fields) + Auth model (Integer, 10 fields)
   → Unified model (UUID, 12 fields with full backward compatibility)
 Field inconsistencies (name vs full_name) resolved with compatibility property
 Database foreign key constraints updated for UUID relationships
 JWT token handling fixed for UUID user IDs

This completes the holistic database schema unification requested after quick
patching caused conflicts. All existing data preserved, full auth system functional.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 22:56:14 +10:00
anthonyrawlins
2547a5c2b3 Complete authentication system deployment with full dependency resolution
- Fixed PyJWT dependency issue in requirements.txt
- Added email-validator for pydantic email field validation
- Successfully deployed complete authentication stack
- All services now running (6/6) with authentication system active

Final deployment status:
 Backend: anthonyrawlins/hive-backend:auth-system-final (1/1)
 Frontend: anthonyrawlins/hive-frontend:auth-system (1/1)
 Database: postgres:15 (1/1)
 Redis: redis:7-alpine (1/1)
 Prometheus: prom/prometheus:latest (1/1)
 Grafana: grafana/grafana:latest (1/1)

Authentication features ready:
- JWT Bearer Token system
- API key generation with scopes
- User management with secure authentication
- Complete UI for auth management
- Database initialization with admin user

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 21:39:28 +10:00
anthonyrawlins
bb4d036274 Complete Bearer Token and API key authentication system deployment
- Successfully implemented comprehensive authentication for both UI and API
- Backend: JWT tokens, API keys with scopes, user management, secure endpoints
- Frontend: Login form, API key manager, authentication dashboard
- Database: User models, token blacklisting, API key storage with hashing
- UI Components: Complete authentication flow with token refresh
- Deployment: Tagged and pushed images to registry, deployed to swarm
- Status: Frontend running, backend needs PyJWT dependency added

Features delivered:
 Bearer Token authentication with JWT
 API key generation with granular scopes
 Complete UI for authentication management
 Token refresh and security validation
 Database initialization with admin user
 Production deployment configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 21:25:30 +10:00
anthonyrawlins
9b31997351 Fix remaining TypeScript errors and dependencies
- Replace complex UI components with simple React implementations
- Remove external dependencies (class-variance-authority, @radix-ui)
- Fix TypeScript parameter type in APIKeyManager
- Create working alert, dialog, and checkbox components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
2025-07-10 20:59:21 +10:00
anthonyrawlins
a6a3ebd1a9 Fix TypeScript errors in authentication components
- Update User interface to include backward compatibility fields (name, role)
- Fix authentication components to handle new User model structure
- Create missing UI components (alert, dialog, checkbox)
- Fix login component to handle Promise<void> return type
- Update user references to use full_name or username fallbacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
2025-07-10 20:56:16 +10:00
anthonyrawlins
7af5b47477 Implement complete Bearer Token and API key authentication system
- Create comprehensive authentication backend with JWT and API key support
- Add database models for users, API keys, and tokens with proper security
- Implement authentication middleware and API endpoints
- Build complete frontend authentication UI with:
  - LoginForm component with JWT authentication
  - APIKeyManager for creating and managing API keys
  - AuthDashboard for comprehensive auth management
  - AuthContext for state management and authenticated requests
- Initialize database with default admin user (admin/admin123)
- Add proper token refresh, validation, and blacklisting
- Implement scope-based API key authorization system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 20:52:58 +10:00
anthonyrawlins
d19c9d596f Revert to psycopg2-binary for Docker compatibility
Docker container build requires psycopg2-binary since it lacks PostgreSQL development headers.
Production deployments can use psycopg2 source when properly configured.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 19:26:32 +10:00
anthonyrawlins
cbd78ed5ec Fix backend dependencies and requirements structure
- Update outdated dependencies (FastAPI 0.115.0, SQLAlchemy 2.0.36, etc.)
- Remove duplicate python-multipart dependency
- Replace psycopg2-binary with psycopg2 for production
- Remove redundant aioredis, use redis package only
- Move development dependencies to requirements-dev.txt
- Update all packages to latest stable versions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 18:24:02 +10:00
anthonyrawlins
f3cbb5c6f7 Add environment configuration and local development documentation
- Parameterize CORS_ORIGINS in docker-compose.swarm.yml
- Add .env.example with configuration options
- Create comprehensive LOCAL_DEVELOPMENT.md guide
- Update README.md with environment variable documentation
- Provide alternatives for local development without production domain

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 18:20:52 +10:00
anthonyrawlins
daf0766e29 Update README.md to match actual docker-compose.swarm.yml ports
- Update service URLs to reflect actual ports: 8087, 3001, 3002, 9091, 5433, 6380
- Fix API documentation URLs to use correct backend port
- Update management commands to use Docker Swarm instead of docker-compose
- Fix troubleshooting commands for Docker Swarm services
- Update health check URLs to use correct ports

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 18:18:09 +10:00
anthonyrawlins
c1464349ab Fix hardcoded paths and improve start_hive.sh script
- Replace hardcoded HIVE_ROOT with dynamic path resolution
- Fix docker-compose.yml reference to use docker-compose.swarm.yml
- Add proper error handling for docker commands
- Replace fragile sleep with proper health check loops
- Update service health checks for docker swarm
- Fix service URLs to use HTTPS endpoints
- Add all 6 agents to connectivity tests
- Update management commands for docker stack operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 18:14:17 +10:00
anthonyrawlins
8b32d54e79 Copy CCLI source to backend for Docker builds
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 12:46:52 +10:00
anthonyrawlins
baa48bfcd4 Merge branch 'feature/gemini-cli-integration' 2025-07-10 12:46:38 +10:00
anthonyrawlins
6933a6ccb1 Add CCLI (CLI agent integration) complete implementation
- Complete Gemini CLI agent adapter with SSH execution
- CLI agent factory with connection pooling
- SSH executor with AsyncSSH for remote CLI execution
- Backend integration with CLI agent manager
- MCP server updates with CLI agent tools
- Frontend UI updates for mixed agent types
- Database migrations for CLI agent support
- Docker deployment with CLI source integration
- Comprehensive documentation and testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 12:45:43 +10:00
anthonyrawlins
7cb4ea18f3 🎉 Complete Phase 5: Frontend UI Updates for Mixed Agent Management
CCLI INTEGRATION PROJECT COMPLETE: Successfully implemented comprehensive
frontend interface for hybrid Ollama/CLI agent orchestration.

## Phase 5 Achievements:
 Mixed agent dashboard with visual distinction (🤖 API vs  CLI)
 Dual registration system with tabbed interface
 Enhanced statistics (5-card layout with agent type breakdown)
 Quick setup button for predefined CLI agents
 Type-specific agent cards with CLI configuration display
 Comprehensive API integration for CLI agent management

## Frontend Features:
- Visual agent type distinction with icons and color coding
- Tabbed registration (Ollama vs CLI agents)
- Enhanced agent cards showing SSH host/Node.js version
- 5-column statistics: Total, Ollama, CLI, Available, Tasks
- Quick CLI setup with predefined agent registration
- Responsive design with comprehensive error handling

## Technical Implementation:
- Extended Agent interface with agent_type and cli_config
- Added CLI agent API methods to agentApi service
- Enhanced registration forms with validation and hints
- Type-safe TypeScript throughout mixed agent operations
- Production build verified (1.2MB optimized bundle)

## User Experience:
 Clear visual hierarchy and agent type identification
 Streamlined registration workflows for both agent types
 One-click predefined CLI agent setup
 Enhanced monitoring with type-specific information
 Responsive design working across all device sizes

## PROJECT STATUS: ALL 5 PHASES COMPLETE
- Phase 1: Connectivity Testing 
- Phase 2: CLI Agent Adapters 
- Phase 3: Backend Integration 
- Phase 4: MCP Server Updates 
- Phase 5: Frontend UI Updates 

Ready for hybrid AI orchestration: 5 Ollama + 2 CLI agents

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 12:26:34 +10:00
anthonyrawlins
2915ee9aa7 🎉 Complete CCLI Integration: Phase 4 (MCP Server Updates)
IMPLEMENTATION COMPLETE: Successfully integrated Google Gemini CLI as
mixed agent type in Hive distributed AI platform.

## Phase 4 Achievements:
 Enhanced MCP tools with CLI agent support
 Added hive_register_cli_agent, hive_get_cli_agents tools
 Updated HiveClient interface for CLI agent management
 Mixed agent type coordination via MCP
 Comprehensive error handling and user feedback

## Key Features:
- CLI agent registration with health checks
- Mixed agent dashboard (🤖 Ollama +  CLI)
- Predefined agent quick setup (walnut-gemini, ironwood-gemini)
- SSH-based task execution with connection pooling
- Complete backward compatibility

## Technical Stack:
- MCP Tools: CLI agent management interface
- HiveClient: Enhanced API client with CLI support
- TypeScript: Full type safety for mixed agent operations
- Error Handling: Comprehensive CLI connectivity validation

## Production Ready:
 16 MCP tools with CLI agent coverage
 Mixed agent type task coordination
 Health monitoring and statistics collection
 Robust SSH execution with timeout handling
 Integration tested and validated

Ready for hybrid AI orchestration: 5 Ollama + 2 CLI agents

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 12:11:27 +10:00
anthonyrawlins
85bf1341f3 Add comprehensive frontend UI and distributed infrastructure
Frontend Enhancements:
- Complete React TypeScript frontend with modern UI components
- Distributed workflows management interface with real-time updates
- Socket.IO integration for live agent status monitoring
- Agent management dashboard with cluster visualization
- Project management interface with metrics and task tracking
- Responsive design with proper error handling and loading states

Backend Infrastructure:
- Distributed coordinator for multi-agent workflow orchestration
- Cluster management API with comprehensive agent operations
- Enhanced database models for agents and projects
- Project service for filesystem-based project discovery
- Performance monitoring and metrics collection
- Comprehensive API documentation and error handling

Documentation:
- Complete distributed development guide (README_DISTRIBUTED.md)
- Comprehensive development report with architecture insights
- System configuration templates and deployment guides

The platform now provides a complete web interface for managing the distributed AI cluster
with real-time monitoring, workflow orchestration, and agent coordination capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 08:41:59 +10:00
anthonyrawlins
fc0eec91ef Complete Hive platform functionality and expand cluster to 7 agents
Major Features Added:
- Fix Socket.IO connectivity by updating Dockerfile to use socket_app
- Resolve distributed workflows API to return arrays instead of errors
- Expand agent coverage from 3 to 7 agents (added OAK and ROSEWOOD)
- Create comprehensive systemd service for MCP server with auto-discovery
- Add daemon mode with periodic agent discovery every 5 minutes
- Implement comprehensive test suite with 100% pass rate

Infrastructure Improvements:
- Enhanced database connection handling with retry logic
- Improved agent registration with persistent storage
- Added proper error handling for distributed workflows endpoint
- Created management scripts for service lifecycle operations

Agent Cluster Expansion:
- ACACIA: deepseek-r1:7b (kernel_dev)
- WALNUT: starcoder2:15b (pytorch_dev)
- IRONWOOD: deepseek-coder-v2 (profiler)
- OAK: codellama:latest (docs_writer)
- OAK-TESTER: deepseek-r1:latest (tester)
- ROSEWOOD: deepseek-coder-v2:latest (kernel_dev)
- ROSEWOOD-VISION: llama3.2-vision:11b (tester)

System Status: All 7 agents healthy, Socket.IO operational, MCP server fully functional

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 08:41:34 +10:00
anthonyrawlins
8c3adf6d8f Implement single domain architecture for Hive platform
- Replace separate hive-api.home.deepblack.cloud subdomain with unified hive.home.deepblack.cloud
- Update Traefik routing: /api/* → backend, /* → frontend with proper priorities
- Add /api/health endpoint while maintaining /health for Docker health checks
- Update Socket.IO configuration to use single domain
- Fix CORS settings for consolidated domain
- Update MCP server endpoint to use /api path prefix
- Update all documentation to reflect single domain architecture

System now fully operational with simplified routing and proper SSL certificates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 21:52:03 +10:00
anthonyrawlins
dba1eac6b1 Update MCP server to use domain-specific endpoints
Changes:
- Updated default endpoints to use https://hive.home.deepblack.cloud
- Added support for HIVE_TIMEOUT environment variable
- Created .env.example with multiple deployment configurations
- Updated Claude Desktop configuration for production/development
- Updated README with comprehensive configuration guide

Production endpoints:
- API: https://hive.home.deepblack.cloud
- WebSocket: wss://hive.home.deepblack.cloud

Development fallback to localhost still available via env vars.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 22:33:26 +10:00
anthonyrawlins
962fbbd4b5 Fix Hive frontend and backend service issues
Backend fixes:
- Remove --reload flag to prevent dev mode cycling
- Add curl for health checks
- Configure PostgreSQL connection properly
- Fix Docker CMD for production deployment

Frontend fixes:
- Use serve for production static file serving
- Add curl for health checks (installed as root before user switch)
- Configure proper host binding for containers
- Fix Dockerfile layer ordering

Results:
-  Backend: 1/2 replicas running, health checks passing
-  Frontend: 2/2 replicas running, serving requests
-  Health endpoints responding correctly
-  Services stable and persistent

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 22:24:29 +10:00
anthonyrawlins
39539ded40 Deploy Hive to Docker Swarm with Docker Hub images
- Created swarm-compatible docker-compose.swarm.yml
- Pushed images to Docker Hub (anthonyrawlins/hive-backend, anthonyrawlins/hive-frontend)
- Configured Traefik labels for SSL and routing
- Removed local volume mounts for swarm compatibility
- Added deployment scripts for automation

Infrastructure status:
-  PostgreSQL database running (1/1)
-  Redis cache running (1/1)
-  Prometheus metrics running (1/1)
-  Grafana dashboard running (1/1)
- 🔄 Backend/Frontend services deploying

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 22:04:01 +10:00
anthonyrawlins
d7ad321176 Initial commit: Complete Hive distributed AI orchestration platform
This comprehensive implementation includes:
- FastAPI backend with MCP server integration
- React/TypeScript frontend with Vite
- PostgreSQL database with Redis caching
- Grafana/Prometheus monitoring stack
- Docker Compose orchestration
- Full MCP protocol support for Claude Code integration

Features:
- Agent discovery and management across network
- Visual workflow editor and execution engine
- Real-time task coordination and monitoring
- Multi-model support with specialized agents
- Distributed development task allocation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 21:44:31 +10:00