Skip to main content

Crate agent_quota_core

Crate agent_quota_core 

Source
Expand description

Local-credential quota probes for AI coding agents.

Agent Quota reads locally configured accounts, performs the smallest provider-specific check available, and returns a versioned, provider-neutral snapshot. A successful probe and usable quota are represented separately so consumers do not need to infer routing decisions from transport health.

Structs§

AgentQuotaClient
Reusable collector with injectable transport settings.
AgentQuotaConfig
Top-level TOML configuration.
CollectUsageOptions
Options identifying exactly which provider accounts to collect.
ProviderBillableUsage
Optional billable or spend-controlled usage reported by a provider.
ProviderCapabilitiesDocument
Versioned capability document for discovery by tools and user interfaces.
ProviderCapability
Stable capability description for one supported provider.
ProviderCredits
Optional provider credit balance.
ProviderProfile
One locally configured provider account.
ProviderRateLimitResetCredits
Optional summary of credits that can reset a provider rate limit.
ProviderUsageCache
Profile-keyed provider cache for repeated UI or CLI polling.
ProviderUsageCollectionMetadata
Optional collection metadata that does not change provider quota semantics.
ProviderUsageError
Structured probe failure for automation and user interfaces.
ProviderUsageSnapshot
Normalized provider quota snapshot.
ProviderUsageWindow
One provider quota window.
ReadinessSummary
Typed result of evaluating readiness across provider snapshots.

Enums§

AgentQuotaError
Configuration loading or validation error.
ProbeStatus
Health of the provider probe itself.
ProviderCredentialSource
Local credential source required by a provider probe.
ProviderId
Supported quota provider.
ProviderProbeTransport
Transport used by a provider quota probe.
ProviderQuotaSource
Machine-readable source of normalized quota data.
ProviderUsageErrorCode
Stable machine-readable failure category.
ProviderUsageFreshness
Whether a returned snapshot came from a live probe or a cache hit.
ProviderUsageWindowKind
Normalized quota window category.
QuotaState
Whether normalized quota permits another agent run.
ReadinessPolicy
Policy used to evaluate whether selected profiles permit more work.

Constants§

CAPABILITIES_SCHEMA_VERSION
Current serialized provider-capabilities schema.
DEFAULT_CACHE_TTL_SECONDS
Default lifetime of a successful cached provider snapshot.
SNAPSHOT_SCHEMA_VERSION
Current serialized snapshot schema.

Functions§

collect_profile_usage
Collect one configured provider profile.
collect_provider_usage
Collect all conventional local provider profiles.
collect_single_provider_usage
Collect one conventional provider profile.
collect_usage
Collect an explicit selection with production defaults.
default_claude_credentials_path
Conventional Claude Code credentials path for the current user.
provider_capabilities
Return a versioned document describing every supported provider.
provider_capability
Return the stable capability description for one provider.

Type Aliases§

AgentQuotaResult
Result type used for configuration operations.