Support the new type-safe event system
Updated for Type-Safe Engine API
This release updates the CLI to support the new type-safe event system introduced in dialectus-engine v0.3.0.
Changes
Engine Compatibility
- Updated to require
dialectus-engine>=0.3.0 - Adopted new type-safe event callback system with enum-based event types
- Migrated from string-based event types to
PhaseEventTypeandMessageEventTypeenums
Internal Improvements
- Type-Safe Callbacks: Event handlers now use strongly-typed enum values instead of string literals
- Enhanced Type Checking: Full support for Pyright/mypy type validation
- Better IDE Support: Improved autocomplete and inline documentation for event handling
Code Example
The CLI now uses the new type-safe API internally:
from dialectus.engine.debate_engine.types import (
MessageEventType,
PhaseEventType,
PhaseStartedEventData,
MessageCompleteEventData,
)
async def phase_callback(
event: PhaseEventType,
data: PhaseStartedEventData
):
if event == PhaseEventType.PHASE_STARTED:
# Handle phase start
...
async def message_callback(
event: MessageEventType,
data: MessageStartEventData | MessageCompleteEventData,
):
if event == MessageEventType.MESSAGE_COMPLETE:
# Handle message completion
...User-Facing Features
No changes to CLI commands or user interface - all updates are internal improvements that maintain full backward compatibility with existing debate configurations and usage patterns.
Requirements
- Python >= 3.12
- dialectus-engine >= 0.3.0 (breaking change in engine)
Upgrade Notes
If you're upgrading from v0.1.x:
- The CLI will automatically use the new engine when you update
- No changes needed to your
debate_config.jsonfiles - All CLI commands work exactly as before
# Upgrade to latest versions
pip install --upgrade dialectus-cli
# Or with uv
uv pip install --upgrade dialectus-cliThis release maintains CLI functionality while adopting the improved type safety of the underlying engine, providing a more robust foundation for future development.