Semantic payment directive.
Carries the spend metadata an agent runtime hook (SpendingHook) needs
to authorize before the side effect runs: amount and domain. The
side effect itself is a zero-arity perform closure that returns
{:ok, result} or {:error, reason}.
Result messages
Results land at the agent's update/2 as:
{:command_result, {:pay_result, result}}on{:ok, result}{:command_result, {:pay_error, reason}}on{:error, reason}{:command_result, {:pay_error, {:exception, message}}}on raise
Example
Raxol.Payments.Directive.Pay.new(
amount: Decimal.new("0.05"),
domain: "api.openai.com",
agent_id: :research_bot,
perform: fn ->
Req.post("https://api.openai.com/...")
end
)