Cost budget enforcement for Workshop agents.
Configurable budgets at global and per-agent levels. When a budget
is exceeded, ask/2 and cast/2 return {:error, :budget_exceeded}.
Usage
configure(max_cost_usd: 10.00)
agent(:impl, "Coder", max_cost_usd: 2.00)
budget() # show global remaining
budget(:impl) # show per-agent remaining
reset_budget() # reset global tracking
Summary
Functions
Check if spending cost for agent would exceed any budget.
Clear budget limits (does not reset cost tracking — costs are in ETS agent entries).
Get budget info for a specific agent or global.
Set a per-agent budget limit.
Set a global budget limit.
Functions
Check if spending cost for agent would exceed any budget.
Returns :ok or {:error, :budget_exceeded, reason}.
@spec clear() :: :ok
Clear budget limits (does not reset cost tracking — costs are in ETS agent entries).
Get budget info for a specific agent or global.
Set a per-agent budget limit.
@spec set_global(float()) :: :ok
Set a global budget limit.