Shared instruction-thread tracking helpers for strategy implementations.
Appends :instruction_start / :instruction_end entries when a thread is
present in the agent state and provides a consistent payload shape.
Summary
Functions
Append an :instruction_end thread entry.
Append an :instruction_start thread entry.
Conditionally append :instruction_end when thread tracking is enabled.
Conditionally append :instruction_start when thread tracking is enabled.
Functions
@spec append_instruction_end(Jido.Agent.t(), Jido.Instruction.t(), atom()) :: Jido.Agent.t()
Append an :instruction_end thread entry.
@spec append_instruction_start(Jido.Agent.t(), Jido.Instruction.t()) :: Jido.Agent.t()
Append an :instruction_start thread entry.
@spec maybe_append_instruction_end(Jido.Agent.t(), Jido.Instruction.t() | nil, atom()) :: Jido.Agent.t()
Conditionally append :instruction_end when thread tracking is enabled.
@spec maybe_append_instruction_start(Jido.Agent.t(), Jido.Instruction.t()) :: Jido.Agent.t()
Conditionally append :instruction_start when thread tracking is enabled.