LemonRouter. Router
(lemon_router v0.1.0)
View Source
Main router for handling inbound messages and control plane requests.
The router is responsible for:
- Normalizing inbound messages from different channels
- Routing to the appropriate session
- Handling abort requests
- Applying pending compaction for all channels
Summary
Functions
Abort all runs for a session.
Abort a specific run by ID.
Handle a control plane agent request.
Handle an inbound message from a channel.
Apply a watchdog keepalive decision to a specific run.
Functions
Abort all runs for a session.
Abort a specific run by ID.
@spec handle_control_agent(params :: map(), ctx :: map()) :: {:ok, %{run_id: binary(), session_key: binary()}} | {:error, %{code: binary(), message: binary(), details: term()}}
Handle a control plane agent request.
Returns the run_id and session_key for tracking.
@spec handle_inbound(LemonCore.InboundMessage.t()) :: :ok
Handle an inbound message from a channel.
Normalizes the message and submits it to the orchestrator. Before submission, applies any pending compaction marker for the session.
@spec keep_run_alive(run_id :: binary(), decision :: :continue | :cancel) :: :ok
Apply a watchdog keepalive decision to a specific run.