Versions in this module Expand all Collapse all v1 v1.4.0 Oct 20, 2026 Changes in this version + var ErrBudgetExhausted = errors.New("task budget exhausted: new consumption stopped") + var ErrToolArgsInvalid = errors.New("tool arguments are invalid") + var ErrToolExecutionFailed = errors.New("tool execution failed") + func CompareToolVersions(left, right string) int + func LatestVersionPerName(descriptors []store.ToolDescriptor) []store.ToolDescriptor + func NormalizeArgs(paramsSchema json.RawMessage, args []byte, maxBytes int64) (json.RawMessage, [sha256.Size]byte, error) + type ApprovalNotUsableError struct + Err error + Reason ApprovalNotUsableReason + func (e *ApprovalNotUsableError) Error() string + func (e *ApprovalNotUsableError) Unwrap() error + type ApprovalNotUsableReason string + const ApprovalBindingMismatch + const ApprovalExpired + const ApprovalPending + const ApprovalRejected + type ExecutionRequest struct + Action string + Args json.RawMessage + Descriptor store.ToolDescriptor + Resource string + Secret SecretHandle + type ExecutionResult struct + FailureCode string + Output json.RawMessage + type Gateway struct + func NewGateway(policyChecker PolicyChecker, tools store.ToolStore, budget store.BudgetStore, ...) *Gateway + func (g *Gateway) GetToolDescriptor(ctx context.Context, tenantID, name, version string) (store.ToolDescriptor, error) + func (g *Gateway) InvokeTool(ctx context.Context, in InvokeInput) (InvokeResult, error) + func (g *Gateway) ListTools(ctx context.Context, tenantID string) ([]store.ToolDescriptor, error) + type GatewayOption func(*Gateway) + func WithApprovalTTL(ttl time.Duration) GatewayOption + func WithBounds(maxArgsBytes, maxResultBytes int64) GatewayOption + func WithClock(now func() time.Time, newID func() uuid.UUID) GatewayOption + type InvokeInput struct + Action string + AgentVersionRef string + ApprovalID *uuid.UUID + Args json.RawMessage + AttemptID uuid.UUID + FencingToken int64 + IdempotencyKey string + Resource string + RunID uuid.UUID + SecretRef string + TaskID uuid.UUID + TenantID string + ToolName string + ToolVersion string + type InvokeOutcome string + const OutcomeDenied + const OutcomeExecuted + const OutcomeReplayed + const OutcomeRequiresApproval + type InvokeResult struct + ApprovalID *uuid.UUID + DenyReasons []string + Outcome InvokeOutcome + PolicyRevision string + ReceiptOperation string + Result json.RawMessage + ToolCall store.ToolCall + type PolicyChecker interface + EvaluateTool func(context.Context, string, policy.ToolContext) policy.Decision + type ReceiptStore interface + GetRuntimeReceipt func(context.Context, string, uuid.UUID, string, string) (store.RuntimeReceipt, error) + WriteRuntimeReceipt func(context.Context, store.WriteRuntimeReceiptInput) error + type SecretBroker interface + Issue func(context.Context, SecretScope) (SecretHandle, error) + type SecretHandle string + type SecretScope struct + AttemptID string + Resource string + SecretRef string + TenantID string + ToolName string + type ToolExecutionError struct + Code string + Err error + func (e *ToolExecutionError) Error() string + func (e *ToolExecutionError) Unwrap() error + type ToolExecutor interface + Execute func(context.Context, ExecutionRequest) (ExecutionResult, error)