Skip to main content

chat_engine/
lib.rs

1//! Chat Engine module — public crate surface.
2//!
3//! The wire-level types live in `cf-chat-engine-sdk`; this crate consumes
4//! the SDK and exposes:
5//!
6//! - [`ChatEngineModule`] — the `#[toolkit::module]`-annotated entrypoint
7//!   used by `cyberware-example-server` via the `inventory`-based
8//!   registrator.
9//! - The re-exported SDK types every downstream test / consumer needs so a
10//!   single `use chat_engine::*;` import suffices.
11//!
12//! Internal modules (`api`, `config`, `domain`, `infra`) are marked
13//! `#[doc(hidden)]` so they do not pollute the public docs surface; they
14//! remain `pub` because the integration tests in `tests/` reach into them.
15//
16// @cpt-cf-chat-engine-public-surface:p15
17
18#![allow(clippy::module_name_repetitions)]
19#![allow(clippy::struct_field_names)]
20#![allow(clippy::struct_excessive_bools)]
21#![allow(clippy::similar_names)]
22#![allow(clippy::must_use_candidate)]
23#![allow(clippy::missing_errors_doc)]
24#![allow(clippy::missing_panics_doc)]
25#![allow(clippy::too_many_arguments)]
26#![allow(clippy::too_many_lines)]
27#![allow(clippy::cognitive_complexity)]
28#![allow(clippy::option_if_let_else)]
29#![allow(clippy::map_unwrap_or)]
30#![allow(clippy::if_not_else)]
31#![allow(clippy::unnested_or_patterns)]
32#![allow(clippy::single_match_else)]
33#![allow(clippy::items_after_statements)]
34#![allow(clippy::uninlined_format_args)]
35#![allow(clippy::empty_structs_with_brackets)]
36#![allow(clippy::ifs_same_cond)]
37#![allow(clippy::trivially_copy_pass_by_ref)]
38#![allow(clippy::format_push_string)]
39#![allow(clippy::match_same_arms)]
40#![allow(clippy::manual_let_else)]
41#![allow(clippy::doc_markdown)]
42#![allow(clippy::redundant_clone)]
43#![allow(clippy::needless_pass_by_value)]
44#![allow(clippy::cast_possible_wrap)]
45#![allow(clippy::cast_possible_truncation)]
46#![allow(clippy::cast_sign_loss)]
47#![allow(clippy::implicit_hasher)]
48#![allow(clippy::ignored_unit_patterns)]
49#![allow(clippy::unnecessary_wraps)]
50#![allow(clippy::if_then_some_else_none)]
51#![allow(clippy::str_to_string)]
52#![allow(clippy::needless_late_init)]
53#![allow(clippy::unused_self)]
54#![allow(clippy::used_underscore_binding)]
55#![allow(clippy::inconsistent_struct_constructor)]
56#![allow(clippy::branches_sharing_code)]
57#![allow(clippy::useless_let_if_seq)]
58
59#[doc(hidden)]
60pub mod api;
61#[doc(hidden)]
62pub mod config;
63#[doc(hidden)]
64pub mod domain;
65#[doc(hidden)]
66pub mod infra;
67
68pub mod module;
69
70pub use module::ChatEngineModule;
71
72// Re-export the chat-engine-sdk public surface so downstream phases (and external
73// consumers) can depend on a single `chat_engine::*` import for domain types.
74pub use chat_engine_sdk::{
75    Capability, CapabilityValue, ChatEngineBackendPlugin, HealthStatus, LifecycleState,
76    MemoryStrategy, Message, MessagePluginCtx, MessageRole, PluginCallContext, PluginError,
77    PluginStream, RetentionPolicy, Session, SessionPluginCtx, SessionType, StreamingChunkEvent,
78    StreamingCompleteEvent, StreamingErrorEvent, StreamingEvent, StreamingStartEvent, TenantId,
79    UserId, VariantInfo, empty_stream, stream_from_events,
80};