Typed sub-state for tracking approval gates in the Orchestrator.
Replaces flat gated_node_names, approval_policy, rejection_policy,
and gated_calls fields in Orchestrator Strategy.
Summary
Functions
Stores gated call entries in the gate state.
Retrieves a gated call entry by request_id.
Returns true when there are pending gated calls.
Creates a new ApprovalGate from options.
Partitions tool calls into ungated (ready to dispatch) and gated (need approval).
Removes a gated call by request_id. Returns updated gate.
Checks whether a tool call requires approval based on static gating and the dynamic approval policy.
Types
@type t() :: %Jido.Composer.ApprovalGate{ approval_policy: (map(), map() -> :require_approval | term()) | nil, gated_calls: %{ required(String.t()) => %{ request: Jido.Composer.HITL.ApprovalRequest.t(), call: map() } }, gated_node_names: MapSet.t(), rejection_policy: :abort_iteration | :cancel_siblings | :continue_siblings }
Functions
Stores gated call entries in the gate state.
Retrieves a gated call entry by request_id.
Returns true when there are pending gated calls.
Creates a new ApprovalGate from options.
@spec partition_calls(t(), [map()], Jido.Composer.Context.t()) :: {:ok, [map()], %{required(String.t()) => map()}} | {:error, term()}
Partitions tool calls into ungated (ready to dispatch) and gated (need approval).
Returns {ungated_calls, gated_entries_map} where gated_entries_map is
%{request_id => %{request: ApprovalRequest, call: call}}.
Removes a gated call by request_id. Returns updated gate.
@spec requires_approval?(t(), map(), Jido.Composer.Context.t()) :: boolean()
Checks whether a tool call requires approval based on static gating and the dynamic approval policy.