klieo-core 3.3.0

Core traits + runtime for the klieo agent framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Live capture hook for recording LLM I/O for later replay (ADR-048).

use crate::llm::{ChatRequest, ChatResponse};

/// Sink the run loop calls once per successful LLM call so a recorder can build
/// a replayable capture. Without a sink the hook is skipped and a run records no
/// LLM I/O — today's behaviour.
///
/// Contract: invoked only on the success path, after post-LLM guardrails pass
/// and before tool dispatch; never on the error path. Implementations must not
/// fail or block the run — buffer in memory and drain after the run completes.
/// Future methods (e.g. tool-call capture) will carry default impls so existing
/// implementors keep compiling.
pub trait CaptureSink: Send + Sync {
    /// Records one successful LLM call for replay. Fire-and-forget — no failure
    /// may propagate to the run; buffer in memory and drain after it completes.
    fn record_llm_call(&self, request: &ChatRequest, response: &ChatResponse);
}