odp-agent
Agent-side discovery and catalog navigation for the Offering Discovery Protocol.
This crate composes Directory discovery with validated Service inspection, Collection and Offering navigation, resource-class caching, bounded concurrency, and non-invoking Action resolution. Its asynchronous client provides a Rustls-backed HTTP transport and permits callers to inject a compatible transport.
Inspect and navigate one Service
use ;
use Representation;
#
# async
The client checks that a Service advertises an operation before calling it. Every returned resource
is validated. ServiceClient uses an in-memory cache by default; callers can inject a shared Cache,
set an authentication-aware cache partition, or override the Service Document, Collection, and
Offering fallback lifetimes.
get_offering_details bundles an Offering with its validated Attribute Schema, validates the
Offering attributes, and normalizes usable Action targets. resolve_action resolves an Action's
request schema or unique OpenAPI 3.1 operation without invoking the target. Supporting documents
are fetched anonymously over HTTPS with independent byte limits and cache entries.
Search across Services
use ;
use ;
use ;
#
# async
The Agent searches the canonical Directory, then queries the selected Services with bounded
concurrency. Result order remains deterministic. Each DiscoveryEvent contains either an Offering
or a Service-specific issue, allowing one unavailable Service to be reported without failing every
successful Service. When the Offering request has no query, filters, refinements, sort, descendant
selection, or Collection identifier, the Agent lists Offerings instead of requiring Service-side
search support.
Actions and protocol composition
get_offering_details returns normalized, usable Action targets and structured issues separately
from the Offering. resolve_action can resolve a request schema or a unique OpenAPI 3.1 operation,
but it never invokes the target. The application uses each Action's authentication requirement and
the Service Document's AEP, MPP, or x402 advertisement to enroll, authenticate, or pay before making
the resolved HTTP request.
See the runnable Agent example for Directory composition, Collection navigation, full Offering details, and Action resolution.
See the workspace guide and the ODP specification.