Versions in this module Expand all Collapse all v0 v0.12.3 Aug 10, 2026 Changes in this version + const ApprovalBillableExternal + const CapabilityImageGenerate + const CapabilityWebSearch + func CanonicalJSON(raw string, target any) (string, error) + func Fingerprint(value string) string + func NewOperationID() (string, error) + func RunIDFromContext(ctx context.Context) string + func StableID(parts ...string) string + func WithBillableIntent(ctx context.Context, intent BillableIntent) context.Context + func WithRunID(ctx context.Context, runID string) context.Context + type BillableIntent struct + CapabilityKey string + ConfigEpoch string + Count int + CredentialFingerprint string + IdempotencyKey string + Model string + NormalizedArgs string + OperationID string + Provider string + ToolCallID string + func BillableIntentFromContext(ctx context.Context) (BillableIntent, bool) + type BillableIntentPreparer interface + PrepareBillableIntent func(ctx context.Context, argsJSON, toolCallID string) (BillableIntent, error) + type UsageLedger struct + func NewUsageLedger(maxPerRun, maxPerSession, initialDispatched int) *UsageLedger + func (l *UsageLedger) Reserve(runID, operationID string) (*UsageReservation, error) + func (l *UsageLedger) ReserveRun(runID, operationID string) (*UsageReservation, error) + func (l *UsageLedger) ResetSession(initialDispatched int) + func (l *UsageLedger) SetLimits(maxPerRun, maxPerSession int) + type UsageReservation struct + func (r *UsageReservation) Commit() + func (r *UsageReservation) Release()