@startuml
actor User
participant CLI
participant "Server\n(REST)" as REST
participant "Server\n(WS)" as WS

User -> CLI: correx run --workflow wf.toml
CLI -> REST: POST /sessions {workflowId}
REST --> CLI: sessionId
CLI -> WS: ws /sessions/{id}/stream
loop until SessionCompleted/Failed
  WS --> CLI: StageStarted/Completed
  WS --> CLI: ToolStarted/Completed/Failed
  WS --> CLI: ApprovalRequired
  User -> CLI: approve/reject/steer
  CLI -> WS: ApprovalResponse
end
WS --> CLI: SessionCompleted/Failed
@enduml
