Normandy.Agents.Turn.Server (normandy v1.3.0)

View Source

Asynchronous :gen_statem interpreter of the pure Turn FSM — the async analog of Turn.Driver. Coarse lifecycle states (:running, :awaiting_approval, :idle) hang Tasks and state_timeouts off the turn; they are NOT a re-encoding of the seven Turn.State statuses (the core stays the source of truth). Blocking effects (:call_llm, :dispatch_tools, :execute_approved) run in a monitored Task; non-blocking effects run synchronously in the handler.

Summary

Functions

Deliver approval decisions to a parked server (Task 6).

Run a turn synchronously; replies once the turn finalizes or fails.

Functions

approve(server, decisions)

@spec approve(:gen_statem.server_ref(), %{optional(String.t()) => :approve | :reject}) ::
  :ok

Deliver approval decisions to a parked server (Task 6).

run(server, user_input)

@spec run(:gen_statem.server_ref(), term()) :: {:ok, term()} | {:error, term()}

Run a turn synchronously; replies once the turn finalizes or fails.

start_link(opts)

@spec start_link(keyword()) :: :gen_statem.start_ret()