Expand description
Chat Engine module — public crate surface.
The wire-level types live in cf-chat-engine-sdk; this crate consumes
the SDK and exposes:
ChatEngineModule— the#[toolkit::module]-annotated entrypoint used bycyberware-example-servervia theinventory-based registrator.- The re-exported SDK types every downstream test / consumer needs so a
single
use chat_engine::*;import suffices.
Internal modules (api, config, domain, infra) are marked
#[doc(hidden)] so they do not pollute the public docs surface; they
remain pub because the integration tests in tests/ reach into them.
Re-exports§
pub use module::ChatEngineModule;
Modules§
- module
ChatEngineModule— Phase 15 integration entrypoint.
Structs§
- Capability
- Schema declaration of a capability supported by a backend plugin.
- Capability
Value - A concrete capability value chosen by the client for a specific call.
- Message
- A message node in the immutable conversation tree.
- Message
Plugin Ctx - Context passed to message-handling plugin methods.
- Plugin
Call Context - Shared context attached to every plugin invocation.
- Session
- A chat session: the top-level container that groups a conversation’s messages, tenant/user ownership, backend plugin binding, and lifecycle.
- Session
Plugin Ctx - Session
Type - A registered session type — pairs a human-readable name with the backend plugin instance that will process its sessions’ messages.
- Streaming
Chunk Event - A single text fragment appended to the assistant message in flight.
- Streaming
Complete Event - Signals the assistant message is fully persisted and the stream is closing.
- Streaming
Error Event - Signals a mid-stream failure; the assistant message may be incomplete.
- Streaming
Start Event - Opens a stream for a given assistant message.
- Tenant
Id - Tenant identifier. Opaque string from the auth token, used to scope all
queries. Newtype distinguishes it from
UserIdat compile time so call sites cannot accidentally swap tenant and user arguments. - UserId
- End-user identifier (opaque string from the auth token). Newtype
distinguishes it from
TenantIdat compile time. - Variant
Info - Summary of one variant at a given tree position — returned when listing variants for a message so clients can render navigation UI.
Enums§
- Health
Status - Plugin health status returned by
ChatEngineBackendPlugin::health_check. - Lifecycle
State - Lifecycle state of a session.
- Memory
Strategy - Per-session memory strategy controlling how much conversation history is sent to the backend plugin on each call.
- Message
Role - Message author role.
- Plugin
Error - Errors returned by
ChatEngineBackendPluginmethods. - Retention
Policy - Message retention policy — when messages in a session should be cleaned up.
- Streaming
Event - NDJSON streaming event emitted by a plugin during response generation.
Traits§
Functions§
- empty_
stream - Helper to build an empty plugin stream (default no-op responses).
- stream_
from_ events - Helper to build a plugin stream from a pre-collected vector of events.
Type Aliases§
- Plugin
Stream - A boxed async stream of streaming events from a plugin.