Major Changes
Immutable ToolUse System
ToolUseStateandToolUseStepare now immutable readonly classes- State transitions create new instances instead of modifying existing ones
- Functional composition replaces method chaining
Enhanced Chat Events
- Added
ChatResponseRequestedevent for tracking participant responses - Improved event dispatching with dedicated methods per event type
- Better participant selection and state update event handling
Improved Message Compilation
- Chat participants now handle their own message compilation
CanCompileMessagesinterface used consistently across participants- Default compiler (
AllSections) applied where not specified
Internal Improvements
Processing Pipeline
StepProcessorsrewritten using middleware pattern- State processors use functional composition for better predictability
- Continuation criteria refactored as immutable collections
Code Organization
- Event emission extracted to private methods for better maintainability (selected locations so far)
- Consistent error handling across participant implementations
- Reduced coupling between chat state and compilation logic
Performance
- Immutable structures reduce side effects and improve memory safety
- Functional approach enables better optimization opportunities
- Cleaner separation of concerns reduces object graph complexity
Breaking Changes
- Removed:
ToolUseOptionsclass - configuration now handled directly inToolUseconstructor - Changed:
CanUseTools::useTools()signature now requiresToolsparameter - Removed: Observer interfaces (
ToolUseObserver,ToolsObserver) - replaced with event system CanProcessToolStep::processStep()→CanProcessToolState::process()ToolUsemethods (withOptions(),withTools(),withMessages()) removedChatState::compiledMessages()removed - compilation moved to participants