Skip to main content

crabtalk_runtime/
lib.rs

1mod conversation;
2mod engine;
3pub mod env;
4pub mod hook;
5
6pub use conversation::Conversation;
7pub use engine::{Runtime, SharedMemory, SwitchOutcome};
8pub use env::Env;
9pub use hook::Hook;
10pub use wcore::{MemoryConfig, TasksConfig};
11
12/// Opaque persistent handle to a conversation. Re-exported from the
13/// storage trait so runtime callers don't need to speak the storage
14/// layer's "session" vocabulary.
15pub type ConversationHandle = wcore::storage::SessionHandle;
16
17use crabllm_core::Provider;
18use wcore::storage::Storage;
19
20/// Configuration trait bundling the associated types for a runtime.
21///
22/// Each binary defines one `Config` impl that ties together the
23/// concrete storage, LLM provider, and env implementations.
24pub trait Config: Send + Sync + 'static {
25    /// Persistence backend (sessions, agents, memory, skills).
26    type Storage: Storage;
27
28    /// LLM provider for agent execution.
29    type Provider: Provider + 'static;
30
31    /// Node environment — event broadcasting, instruction discovery,
32    /// and composite hook for tool dispatch.
33    type Env: Env + wcore::ToolDispatcher + 'static;
34}