@startuml
interface RouterFacade
interface RouterRepository
interface RouterContextBuilder
interface RouterReducer
interface Projection

class DefaultRouterFacade
class DefaultRouterRepository
class DefaultRouterContextBuilder
class DefaultRouterReducer
class RouterProjector

class RouterState
class RouterConfig
class RouterResponse
class RouterL2Entry
class RouterTurn
enum WorkflowStatus
enum StageOutcomeKind
enum TurnRole
enum ChatMode

RouterFacade <|.. DefaultRouterFacade
RouterRepository <|.. DefaultRouterRepository
RouterContextBuilder <|.. DefaultRouterContextBuilder
RouterReducer <|.. DefaultRouterReducer
Projection <|.. RouterProjector
RouterProjector --> RouterReducer
DefaultRouterRepository --> RouterProjector
DefaultRouterRepository ..> RouterState

DefaultRouterFacade --> RouterRepository
DefaultRouterFacade --> RouterContextBuilder
DefaultRouterFacade --> RouterConfig
DefaultRouterFacade ..> RouterResponse
DefaultRouterContextBuilder --> RouterConfig
DefaultRouterContextBuilder --> RouterState
DefaultRouterContextBuilder ..> "ContextPack"

RouterState --> "l2Memory" RouterL2Entry
RouterState --> "conversationHistory" RouterTurn
RouterState --> WorkflowStatus
RouterL2Entry --> StageOutcomeKind
RouterTurn --> TurnRole

package "core:events" <<External>> {
  [EventStore]
  [SteeringNoteAddedEvent]
  [WorkflowStartedEvent]
  [WorkflowCompletedEvent]
  [WorkflowFailedEvent]
  [OrchestrationPausedEvent]
  [OrchestrationResumedEvent]
  [StageCompletedEvent]
  [StageFailedEvent]
}
package "core:inference" <<External>> {
  [InferenceRouter]
  [InferenceProvider]
  [InferenceRequest]
}
package "core:context" <<External>> {
  [ContextPack]
}
package "core:sessions" <<External>> {
  [Projection]
  [EventReplayer]
}

DefaultRouterFacade ..> "core:events"
DefaultRouterFacade ..> "core:inference"
DefaultRouterContextBuilder ..> "core:context"
DefaultRouterRepository ..> "core:events"
DefaultRouterRepository ..> "core:sessions"
DefaultRouterReducer ..> "core:events"

@enduml
