# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2025-01-15

### BREAKING CHANGES
- **Anthropic-Only Configuration**: Removed support for OpenAI and Google providers
- **Simplified Provider Architecture**: All agents now use Claude models exclusively
- **Updated Agent Templates**: All base and specialized agent templates converted to Anthropic
- **Configuration Simplification**: Removed multi-provider configuration complexity

### Added
- **Claude 3.5 Sonnet**: Default model for all agents (`claude-3-5-sonnet-20241022`)
- **Claude Model Support**: Full support for Claude 3 Opus, Sonnet, and Haiku models
- **Seamless Claude Desktop Integration**: Optimized for native Claude Desktop usage
- **Simplified Setup**: Single provider configuration reduces setup complexity

### Changed
- **Default Provider**: Changed from `openai` to `anthropic`
- **Default Model**: Changed from `gpt-4.1-2025-04-14` to `claude-3-5-sonnet-20241022`
- **Agent Configurations**: All 20+ agent templates updated to use Claude models
- **API Endpoints**: Available models API now returns only Claude models
- **Setup Scripts**: Simplified to only configure Anthropic API keys
- **Documentation**: Updated README and examples for Anthropic-only usage

### Removed
- **OpenAI Provider**: Removed OpenAI API integration and model support
- **Google Provider**: Removed Google AI API integration and model support
- **Multi-Provider Logic**: Simplified codebase by removing provider switching
- **Provider Selection**: Removed provider choice from setup and configuration

### Fixed
- **Consistent Model Usage**: All agents now use the same model family
- **Reduced Configuration Errors**: Single provider eliminates configuration mismatches
- **Simplified Authentication**: Only one API key required for operation

## [1.0.9] - 2025-01-15

### PERFORMANCE OPTIMIZATIONS
- **Changed default pattern**: Switched from hierarchical to peer-to-peer for faster responses
- **Reduced timeouts**: Decreased from 10 minutes to 2 minutes to force faster execution
- **Lowered temperature**: Reduced from 0.4-0.7 to 0.1-0.3 for more direct answers
- **Simplified system prompts**: Streamlined agent prompts to reduce processing complexity
- **Updated pattern recommendations**: Prioritize simpler patterns (peer-to-peer, iterative) over complex ones
- **Optimized agent creation**: Reduced default agent count and simplified configurations

### Fixed
- Performance issues with long-running tasks
- Overly complex agent behaviors causing delays
- Timeout issues from excessive processing times

## [1.0.8] - 2025-01-11

### 🐛 Critical Bug Fix - Timeout Issue Resolved
- **Fixed 30-Second Timeout Issue**: Resolved the `Anthropic API error: timeout of 30000ms exceeded` error
- **Updated Server Timeout**: Changed from 30,000ms (30 seconds) to 600,000ms (10 minutes)
- **Updated Database Timeout**: Changed from 30,000ms (30 seconds) to 600,000ms (10 minutes)
- **Enhanced MCP Server Configuration**: Added proper configuration file loading and timeout handling

### 🚀 MCP Server Improvements
- **Configuration Loading**: MCP server now loads `config.json` for timeout settings
- **Dynamic Timeout Parameters**: Added `timeout` and `timeLimit` parameters to `delegate_task` tool
- **Improved Error Handling**: Better timeout configuration with proper default fallbacks
- **Configuration Logging**: Added logging for timeout configuration debugging

### 🔧 Technical Enhancements
- **Timeout Parameter Support**: Both milliseconds (`timeout`) and seconds (`timeLimit`) supported
- **Configuration Priority**: Proper timeout resolution with user config override capability
- **Default Fallbacks**: Comprehensive fallback to 10-minute defaults when configuration is missing
- **Config Manager Updates**: Fixed hardcoded timeout values in configuration management

### 📋 API Updates
- **delegate_task Tool**: Now accepts `timeout` (milliseconds) and `timeLimit` (seconds) parameters
- **Configuration Resource**: Updated to show actual timeout values from configuration
- **Improved Metadata**: Delegation results now include timeout information

## [1.0.7] - 2025-01-11

### 🐛 Critical Bug Fixes
- **Fixed MCP Server Startup Issues**: Resolved silent server startup failures caused by missing `StateManager` class export
- **Fixed Import Errors**: Added proper `StateManager` class export to `state-manager.js` to fix delegation manager imports
- **Fixed CLI Start Command**: Completely redesigned `delegator-mcp start` command with proper MCP server guidance

### 🚀 CLI Improvements
- **Claude Desktop Integration Guide**: Added `--help-claude` option with step-by-step setup instructions
- **Server Test Mode**: Added `--test` option to verify server startup without connecting to Claude
- **Stdio Mode**: Added `--stdio` option for proper MCP server operation with Claude Desktop
- **Better Error Messages**: Improved user guidance and error handling for MCP server usage

### 🛠️ Technical Enhancements
- **StateManager Class**: Added complete `StateManager` class with initialization and state management methods
- **Import Resolution**: Fixed all dynamic import issues in server.js that were causing silent failures
- **MCP Server Clarity**: Updated documentation to clarify MCP server usage vs traditional web servers

### 📝 Documentation
- **Usage Instructions**: Clear guidance on how to use `delegator-mcp start` with different modes
- **Integration Guide**: Detailed Claude Desktop MCP server configuration instructions
- **Error Resolution**: Improved error messages and troubleshooting guidance

### 🔧 Configuration
- **Default Timeout**: Maintained 10-minute (600-second) timeout configuration across all patterns
- **Structured Query Support**: Enhanced timeout handling in structured queries
- **Pattern Compatibility**: Ensured all 6 delegation patterns work correctly with the fixed server

## [1.0.6] - 2025-01-11

### 🎯 Major Features
- **Comprehensive 10-Minute Timeout Configuration System**: Implemented dynamic timeout management with 600-second (10-minute) defaults across all delegation patterns
- **Structured Query Support**: Added `handleStructuredQuery()` function for programmatic control with configuration parameters
- **Complete Pattern Implementation Status**: All 6 delegation patterns are now fully implemented and documented

### ⚙️ Configuration Enhancements
- Updated all default timeouts to 600 seconds (10 minutes) across the entire codebase
- Added dynamic timeout configuration utilities in `src/core/query-processor.js`:
  - `getTimeoutFromConfig()` - Extracts timeout from user configuration
  - `applyTimeoutConfig()` - Applies timeout configuration to execution context
- Enhanced delegation manager with user-configurable timeouts and proper timeout propagation
- Added timeout priority handling: `timeLimit` (seconds) → `timeout` (ms) → `delegationTimeout` (ms) → default (600000ms)

### 🏛️ Delegation Pattern Completion
- **✅ Hierarchical**: Central coordinator with specialized workers - *Fully implemented*
- **✅ Competitive**: Multiple agents competing for best solution - *Fully implemented*
- **✅ Peer-to-Peer**: Collaborative agents working together - *Fully implemented*
- **✅ Iterative**: Sequential refinement pipeline - *Fully implemented*
- **✅ Federation**: Multi-level hierarchy with domain coordinators - *Fully implemented*
- **✅ Adaptive**: Dynamic pattern selection based on complexity - *Fully implemented*

### 🔧 Technical Improvements
- Enhanced `src/delegation/delegation-manager.js` with timeout configuration support
- Updated all delegation strategy handlers with consistent timeout management
- Added structured query configuration with `maxAgents`, `focusAreas`, `temperature`, and `timeLimit` parameters
- Improved error handling and timeout recovery across all patterns
- Added comprehensive logging for timeout configuration and pattern execution

### 📚 Documentation Updates
- Updated README.md with structured query examples and configuration options
- Added timeout configuration documentation with priority explanation
- Completed delegation pattern implementation status documentation
- Enhanced configuration options table with timeout parameters
- Added usage examples for all 6 delegation patterns

### 🛠️ Files Modified
- `config.json` - Updated default timeout values
- `scripts/config-manager.js` - Enhanced configuration validation and defaults
- `worksona.js` - Updated delegation timeout to 10 minutes
- `app.js` - Added structured query support and timeout handling
- `pattern-builder.js` - Updated UI timeout defaults
- `scripts/setup.js` - Updated setup wizard defaults
- `src/core/query-processor.js` - Added timeout configuration utilities
- `src/delegation/delegation-manager.js` - Enhanced with timeout support
- `README.md` - Comprehensive documentation updates

### 🎯 User Experience
- Consistent 10-minute timeout across all delegation patterns
- Dynamic timeout configuration via user parameters
- Better error messages and timeout feedback
- Programmatic access via `window.handleStructuredQuery`
- Improved pattern selection and configuration options

## [1.0.5] - 2025-01-11

### Added
- Fixed agent creation functionality with proper imports
- Added missing functions to query processor:
  - `parseTasksFromResponse()` - Parses tasks from delegator responses
  - `createWorkersForTasks()` - Creates worker agents for tasks  
  - `generateSequenceDiagram()` - Generates delegation flow diagrams
- Resolved delegation strategy handler import issues
- Enhanced error handling for agent creation failures

### Technical Details
- Completed delegation system functionality
- All delegation patterns now work correctly
- Proper agent coordination and task processing
- Comprehensive logging and monitoring

## [1.0.4] - 2025-01-11

### Added
- 4 new specialized agent configurations:
  - `synthesizer-agent.json` - Dr. Marcus Williams, Information synthesis specialist
  - `report-reviewer-agent.json` - Dr. Sarah Thompson, Quality assurance expert  
  - `market-researcher-agent.json` - Dr. Jennifer Kim, Consumer behavior analyst
  - `fullstack-coder-entrepreneur-agent.json` - Alex Rodriguez, Technical architecture expert

### Enhanced
- Each agent includes unique personality traits, knowledge areas, and professional backgrounds
- Optimized maxTokens settings (3000-5000) based on agent complexity
- Temperature settings tailored for each agent's role
- Comprehensive system prompts and example interactions

## [1.0.3] - 2025-01-11

### Added
- Created comprehensive analyst agent configuration
- Added Dr. Alexandra Chen as specialized analyst agent
- Enhanced pattern recognition and statistical analysis capabilities
- Improved strategic insights and data interpretation features

## [1.0.2] - 2025-01-11

### Added
- Enhanced delegation system architecture
- Improved agent coordination mechanisms
- Added comprehensive logging and monitoring
- Optimized task distribution algorithms

## [1.0.1] - 2025-01-11

### Added
- Initial delegation patterns implementation
- Basic agent framework
- Core MCP server functionality
- Multi-LLM provider support

## [1.0.0] - 2025-01-11

### Added
- Initial release of Worksona Delegator MCP
- Basic task delegation functionality
- Agent management system
- MCP protocol implementation 