Builds a unified Jido.Signal.Router from strategy, agent, and plugin routes.
This module is responsible for:
- Collecting routes from all sources (strategy, agent, plugins)
- Normalizing route specs with appropriate priorities
- Building the trie-based router for efficient signal routing
Priority Levels
| Source | Default Priority | Range |
|---|---|---|
| Strategy | 50 | 50-100 |
| Agent | 0 | -25 to 25 |
| Plugin | -10 | -50 to -10 |
Route Spec Formats
Routes can be specified in several formats:
{path, target}- Simple route with default priority{path, target, priority}- Route with explicit priority{path, match_fn, target}- Route with match function{path, match_fn, target, priority}- Route with match function and priority
Target Types
module()- Action module, params = signal.data{module(), map()}- Action module with static params{:strategy_cmd, atom()}- Strategy command
Summary
Functions
Builds a unified router from all route sources in the agent state.
Functions
@spec build(Jido.AgentServer.State.t()) :: Jido.Signal.Router.Router.t()
Builds a unified router from all route sources in the agent state.
Collects routes from:
- Strategy routes (priority 50+) via
strategy.signal_routes/1 - Agent routes (priority 0) via
agent_module.signal_routes/1 - Plugin routes (priority -10) via plugin
signal_patternsandsignal_routes/1
Returns an empty router if no routes are found or if building fails.