klieo-core 0.6.0

Core traits + runtime for the klieo agent framework.
Documentation
#![deny(missing_docs)]
#![deny(rust_2018_idioms)]

//! Core traits and runtime for the klieo agent framework.
//!
//! See the spec at
//! `docs/superpowers/specs/2026-05-04-agent-framework-foundation-design.md`.

pub mod agent;
pub mod bus;
pub mod error;
pub mod guardrail;
pub mod ids;
pub mod llm;
pub mod memory;
pub mod rate_limit;
pub mod response;
pub mod runtime;
pub mod summarize;
pub mod tool;

pub use agent::{Agent, AgentContext};
pub use bus::{
    AckHandle, AckHandleImpl, ClaimHandle, ClaimHandleImpl, ClaimedJob, Headers, Job, JobQueue,
    KvEntry, KvStore, Lease, LeaseImpl, Msg, MsgStream, Pubsub, RequestReply, Revision,
};
pub use error::{BusError, ConfigError, Error, LlmError, MemoryError, ToolError};
pub use guardrail::{
    Guardrail, GuardrailOutcome, MaxResponseLengthGuardrail, RefusalKeywordGuardrail,
};
pub use ids::{DurableName, FactId, JobId, RunId, ThreadId};
pub use llm::{
    Capabilities, CapabilitiesBuilder, ChatChunk, ChatRequest, ChatResponse, ChunkStream,
    Embedding, FinishReason, LlmClient, Message, ResponseFormat, Role, ToolCall, ToolDef, Usage,
};
pub use memory::{
    Episode, EpisodicMemory, Fact, LongTermMemory, RunFilter, RunSummary, Scope, ShortTermMemory,
    ToolResult,
};
pub use response::{parse_structured, KlieoResponse};
pub use runtime::{run_steps, run_steps_streaming, RunOptions};
pub use summarize::{summarize_history, SummarizeOptions};
pub use tool::{Tool, ToolCtx, ToolInvoker};

#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;

/// Re-exports used exclusively by the `klieo-macros` proc-macro
/// expansions (W3.A18). Macro-generated code targets
/// `::klieo_core::__macro_support::...` rather than per-module paths
/// such as `::klieo_core::tool::Tool` so an upstream rename of a
/// submodule does not break downstream `#[tool]` invocations.
///
/// Not part of the public API. Items here may be renamed or removed
/// without a semver bump as long as the corresponding klieo-macros
/// version moves in lockstep.
#[doc(hidden)]
pub mod __macro_support {
    pub use crate::error::ToolError;
    pub use crate::response::{parse_structured, KlieoResponse};
    pub use crate::tool::{Tool, ToolCtx};
}