ol.llx.agent.loop
platforms: clj, cljs
handle-command
clj
platforms: clj
(handle-command state cmd)
Pure command handler. Takes state + command, returns [state' signals].
Handles global state mutations directly and translates FSM-driving
commands into signals for the graph.
Commands that only mutate state (e.g. `:ol.llx.agent.command/steer`) return an empty signals vector. Commands that drive the FSM (e.g. `:ol.llx.agent.command/prompt`) return one or more signals to be fed into the transition functions.
cljs
platforms: cljs
(handle-command state cmd)
Pure command handler. Takes state + command, returns [state' signals].
Handles global state mutations directly and translates FSM-driving
commands into signals for the graph.
Commands that only mutate state (e.g. `:ol.llx.agent.command/steer`) return an empty signals vector. Commands that drive the FSM (e.g. `:ol.llx.agent.command/prompt`) return one or more signals to be fed into the transition functions.
graph
clj
platforms: clj
Agent state machine as data.
Transitions: `(state, msg) -> [state', effects]` Pure transition fns. Take current state and a signal, return new state and a vector of effect descriptions to execute.
Routes: `(state') -> phase-key` Pure routing fns. Take the post-transition state and return the keyword of the next phase to enter.
cljs
platforms: cljs
Agent state machine as data.
Transitions: `(state, msg) -> [state', effects]` Pure transition fns. Take current state and a signal, return new state and a vector of effect descriptions to execute.
Routes: `(state') -> phase-key` Pure routing fns. Take the post-transition state and return the keyword of the next phase to enter.
step
clj
platforms: clj
(step state input)
(step g state input)
Pure step function. Takes state + input (command or signal), returns [state' effects].
Commands are processed by `handle-command` which may produce signals. Signals are processed by the graph transition + routing fns.
Emits `:ol.llx.agent.event/agent-end` automatically when the agent transitions from a non-idle phase back to `::idle`.
cljs
platforms: cljs
(step state input)
(step g state input)
Pure step function. Takes state + input (command or signal), returns [state' effects].
Commands are processed by `handle-command` which may produce signals. Signals are processed by the graph transition + routing fns.
Emits `:ol.llx.agent.event/agent-end` automatically when the agent transitions from a non-idle phase back to `::idle`.