graphrt-provider-api
Internal. This crate is published because
graphrt-clidepends on it. Its API may change in any release: depend on it only with an exact version (=x.y.z). The stable Rust surface isgraphrt-core,graphrt-llm,graphrt-plugin-sdkandgraphrt-bundle, see docs/stability.md.
The contract between the graphrt gateway and the platforms it wakes agents on. Its API is still young and may change between minor releases.
What is in it
Provider(run time:wake/release/list) andDeployDriver(deploy time:apply), object safe so the gateway holdsArc<dyn Provider>.- Types:
Capabilities,Addressing(Replica|Url),Scaler,ReleaseMode(Suspend|Stop|ScaleIn),DeploymentRef,ReplicaRef,Endpoint,ReplicaState,DeploymentSpec,SecretRef. ProviderErrorwith kindsCapacity,RateLimited,Auth,NotFound,Transient,Fatal;DeployError.http:TokenBucketper provider API,RetryPolicy(equal-jitter exponential backoff, honoursRetry-After),TokenCache(refresh atexp - 5 min, forced refresh on 401),SecretString(redactedDebug). FeaturehttpaddsProviderHttp, the reqwest client every provider uses.- Feature
conformance(dev-dependency only): the C1–C13 harness (run_conformance), a scriptedFakeServerwith fault injection (401, 429, 5xx, capacity) and request recording, andMemoryProvider, the in-memory reference provider.
Writing a provider
- New crate or module behind its own cargo feature (
gw-<name>), no cloud SDK. - Implement
ProviderwithProviderHttp(pass aStatusClassifierthat maps the platform's capacity errors toCapacity). - In tests, emulate the few API endpoints you call with a
FakeServerhandler, implementConformanceTarget, and assertrun_conformance(&target, &config).await.assert_no_failures().tests/conformance.rsis the template. Gateway-in-the-loop cases (C3, C6, C7, C11, the orphan half of C12) come fromgraphrt-gateway'sGatewayHarness; without it they are reported as skipped.
Contract details (idempotent absolute wake, release of a gone replica is
Ok, Url addressing makes release a no-op) are on the Provider trait docs.