agent-contracts

API Reference (Public)

This document organizes the public API of agent_contracts using the template: Purpose → Signature → Minimal Example → Key Arguments/Returns → Notes.


Core Types

version

NodeContract

TriggerCondition

NodeInputs

NodeOutputs

ModularNode

InteractiveNode

BaseRequestSlice / BaseResponseSlice / BaseInternalSlice

BaseAgentState

get_slice

merge_slice_updates

StateAccessor

Internal / Request / Response

reset_response / increment_turn / set_error / clear_error

RoutingDecision / RoutingReason / MatchedRule

SupervisorDecision

BaseActionRouter

ContractValidator / ValidationResult

ContractVisualizer

ContractDiffReport / NodeChange / diff_contracts

ContractViolationError


Registry & Build

NodeRegistry

TriggerMatch

get_node_registry / reset_registry

GenericSupervisor

GraphBuilder

build_graph_from_registry


Runtime

RequestContext

ExecutionResult

RuntimeHooks / DefaultHooks

SessionStore / InMemorySessionStore

AgentRuntime


Subgraphs (v0.6.0)

SubgraphContract

SubgraphDefinition


Hierarchical Runtime Types (v0.6.0)

Budgets

CallStackFrame

DecisionTraceItem


Public API List

This list fixes the public classes/functions that appear in the README and Getting Started guide.

Nodes and Contracts

Registry and Graph

Subgraphs (v0.6.0)

Supervisor and Context

Runtime

Hierarchical Runtime (v0.6.0)

Validation, Visualization, and Config