The public API surface

In one line
Nine always-present modules, two gated modules, and 148 re-exported items at the crate root, grouped by the feature that gates them
You need
Nothing; this page mirrors src/lib.rs
Read this if
You are looking for the import path of a type, or which feature makes it exist

src/lib.rs opens with #![forbid(unsafe_code)], so no unsafe block compiles anywhere in the crate. A build with no provider feature stops at a compile_error!; see The feature matrix.

Modules

ModuleVisibilityGateHolds
typespubnonethe unified wire types shared by every provider adapter
errorpubnoneCucaError and PluginError
requestpubnonethe normalized request and response contracts
sessionpubnonethe append-only session audit-trail model
ssepubnonethe SSE stream parser
pluginpubnonethe CucaPlugin and SessionStorePlugin traits
pluginspubnoneplugin implementations, one gated submodule per plugin-* feature
servicespubnoneservice implementations, one gated submodule per service-* feature
clientpubnonethe builder, the client and the plugin-instrumented stream
exportpubplugin-memory or service-prompt-cachethe versioned cuca-export envelope
cost_otelpubplugin-cost and plugin-telemetrythe cost ledger to OpenTelemetry bridge
providerpub(crate)nonethe provider adapters; not part of the public surface
canonicalpub(crate)plugin-session-log or service-prompt-cachecanonical JSON encoding for storage records and digest input
tokenizepub(crate)plugin-memory or plugin-costtiktoken encoder resolution

Ungated re-exports

Available in every build that compiles. There are 17.

GroupItems
ClientCucaClient, CucaClientBuilder, ResponseHandle
ErrorsCucaError, PluginError
Request and responseAgentResponseStream, PromptCacheBreakpoint, PromptCacheDirective, PromptCacheUsage, ThinkingConfig, ThinkingEffort, ThinkingParams, TokenUsage, UnifiedRequest, UnifiedResponse
SessionSessionEvent, SessionRecord

PromptCacheBreakpoint, PromptCacheDirective and PromptCacheUsage are ungated although service-prompt-cache is gated. They are fields of UnifiedRequest and UnifiedResponse, so they exist wherever those do. TokenUsage is ungated for the same reason.

Items outside the crate root

PathItems
cuca::typesMessageContentBlock, MessageRole, ProviderEndpoint, ToolDefinition, UnifiedMessage
cuca::sseSseEvent, SseStreamParser
cuca::pluginCucaPlugin, SessionStorePlugin
cuca::services::orchestratorPoolTurnExecutor, which is pub but not re-exported at the root

LlamaCppConfig and OAuthPkceConfig live in the pub(crate) provider module and have no public path.

Feature-gated re-exports

There are 131, in 21 groups.

GateItems
provider-localDownloadProgress, DownloadProgressCallback, DraftStats, DrafterSource, GpuAdapter, LocalCapabilities, LocalDevice, LocalModel, LocalModelConfig, ModelPreset, ModelSource, SamplingConfig
plugin-costCostConfig, CostEntry, CostObserver, CostPlugin, CostUsage, ModelRates, PricingResolver, PricingTable, UnpricedModelPolicy
plugin-guardrailsJsonGuardrailPlugin
plugin-hitlApprovalChannel, ApprovalDecision, ApprovalRequest, HitlPlugin, OneshotApprovalChannel, Risk
plugin-mcpMcpPlugin, McpTransport
plugin-memoryBudget, CompactionStrategy, CompressionAction, CompressionReport, ContextUsage, ContextUsageObserver, ContextWindowResolver, GRAPH_RENDER_MARKER, GraphContextConfig, GraphDirection, GraphImportReport, GraphNode, GraphRelationship, GraphSnapshot, MemoryConfig, MemoryGraph, MemoryPlugin, MergePolicy, MergeReport, Summarizer, VectorStore
plugin-redactionRedacted, RedactionConfig, RedactionPlugin, RedactionRule
plugin-sandboxSandboxConfig, SandboxPlugin, SandboxResult
plugin-session-logFileBackend, InMemoryBackend, SessionBackend, SessionLogPlugin
plugin-skillsSkill, SkillsConfig, SkillsPlugin
plugin-subagentSubagentPlugin, SubagentResult, SubagentRunner, SubagentSpec, WorktreeConfig
plugin-telemetryOpenTelemetryPlugin
plugin-web-searchSearchResult, WebSearchConfig, WebSearchPlugin, WebSearchProvider
service-entity-extractionCandidateEntity, CandidateRelationship, EntityExtractionCandidate, EntityExtractionModel, EntityExtractionReport, EntityExtractionSchema, EntityExtractor, EntityReference, EntityTable, PropertyColumn, PropertyType, RelationshipTable
service-prompt-cachePromptCache, PromptCacheConfig, PromptCacheEntry, PromptCacheError, PromptCacheImportReport, PromptCacheSnapshot
service-rate-limitRateLimitConfig, RateLimitError, RateLimitObserver, RateLimitPermit, RateLimitUsage, RateLimiter
service-replayReplayCompletion, ReplayConfig, ReplayNote, ReplayTrajectory, ReplayTurn, ReplayUsage, SessionReplay
service-speculativeClientPool, Complexity, ComplexityEvaluator, DraftValidator, JsonToolDraftValidator, ModelOrchestrator, SwappableModelPair, TurnExecutor
service-vector-storeEmbedder, InMemoryVectorStore, RECALL_RENDER_MARKER, RecallInjection, RetrievalReport, RetrievedTurn, VectorStoreConfig, VectorStoreError, VectorStoreUsage
plugin-memory or service-prompt-cacheCUCA_EXPORT_FORMAT, CUCA_EXPORT_VERSION, CucaExport, CucaExportError, CucaImportReport, GraphExportSection, PromptCacheExportSection
plugin-cost and plugin-telemetryOtelCostObserver

Export envelope constants

ConstantTypeValue
CUCA_EXPORT_FORMAT&strcuca-export
CUCA_EXPORT_VERSIONu321

Client surface

CucaClientBuilder methods, in declaration order:

MethodGate
newnone
with_llamacpp_configprovider-llamacpp
with_local_modelprovider-local
with_providernone
with_base_urlnone
with_api_keynone
with_bearer_tokenprovider-anthropic
with_anthropic_oauthprovider-anthropic
register_pluginnone
with_orchestratorservice-speculative
with_prompt_cache_configservice-prompt-cache
with_prompt_cache_serviceservice-prompt-cache
buildnone
  • with_provider is required. build fails with CucaError::Config without it.
  • With ProviderEndpoint::Local, build also fails with CucaError::Config unless with_local_model attached a model.
  • with_bearer_token and with_api_key are mutually exclusive at dispatch time. When both are set, the bearer token wins.
  • with_prompt_cache_service takes precedence over with_prompt_cache_config. A validation error in the config surfaces from build.
  • with_base_url and with_api_key configure this client, not the tier clients of a ModelOrchestrator.

CucaClient methods, in declaration order:

MethodGate
buildernone
selected_providernone
base_urlnone
api_keynone
bearer_tokenprovider-anthropic
oauth_configprovider-anthropic
llamacpp_configprovider-llamacpp
local_modelprovider-local
orchestratorservice-speculative
prompt_cacheservice-prompt-cache
prompt_cache_snapshotservice-prompt-cache
replace_prompt_cache_snapshotservice-prompt-cache
http_clientany of the seven HTTP provider-* features
pluginsnone
generate_streamnone
generate_stream_with_responsenone

generate_stream_with_response returns the stream and a ResponseHandle. After the stream yields None, ResponseHandle::take returns the aggregated UnifiedResponse of that call.

The re-export contract is tested

tests/public_exports.rs imports from cuca by name and constructs the types it names, so a removed or renamed re-export fails compilation. Its own gate is any(provider-openai, provider-llamacpp). Its nested modules are gated on service-prompt-cache, service-rate-limit, plugin-redaction, plugin-memory, plugin-cost, the combination of cost and telemetry, either of memory or prompt cache, service-replay and service-vector-store.

↑↓ to navigate ↵ to open esc to close