Skip to main content

fluers_core/
lib.rs

1//! # fluers-core
2//!
3//! Core agent primitives and model abstractions for Fluers.
4//!
5//! This crate is the native Rust stand-in for Flue's two foundational
6//! TypeScript dependencies:
7//!
8//! - [`@earendil-works/pi-agent-core`][piac] — the agent loop: messages,
9//!   tool definitions, tool calls/results, thinking levels.
10//! - [`@earendil-works/pi-ai`][piai] — the model/provider abstraction:
11//!   `Model`, `ImageContent`, streaming, provider calls.
12//!
13//! Flue itself is a *harness* layer on top of these two. Neither has a
14//! published Rust crate, so a faithful native Rust port must re-implement
15//! this foundation first. Everything else (`fluers-runtime`, `fluers-cli`,
16//! …) builds on the traits defined here.
17//!
18//! [piac]: https://github.com/earendil-works/pi-agent-core
19//! [piai]: https://github.com/earendil-works/pi-ai
20
21#![forbid(unsafe_code)]
22#![warn(missing_docs)]
23// Test code may use unwrap/expect/panic for clarity (project policy).
24#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used, clippy::panic))]
25
26pub mod error;
27pub mod event;
28pub mod message;
29#[cfg(test)]
30mod message_tests;
31pub mod model;
32pub mod policy;
33pub mod request;
34pub mod runner;
35pub mod subagent;
36pub mod thinking;
37pub mod tool;
38
39pub use error::{CoreError, Result};
40pub use event::{EventSink, NullEventSink, RunEvent, RunHooks};
41pub use message::{AgentMessage, ContentBlock, ImageContent, Role, SignalMessage};
42pub use model::{Model, ModelProvider, ModelRequest, ModelResponse, StreamEvent};
43pub use policy::{PolicyVerdict, ToolPolicy};
44pub use request::{ToolFactory, ToolRequestContext};
45pub use runner::{run_agent, run_agent_streaming, FanoutTurnSink, RunConfig, RunOutcome, TurnSink};
46pub use subagent::{
47    SubagentOptions, SubagentProfile, TaskTool, DEFAULT_MAX_DELEGATIONS, DEFAULT_MAX_DEPTH,
48};
49pub use thinking::ThinkingLevel;
50pub use tool::{
51    InvokeContext, JsonValue, ParameterSchema, Tool, ToolCall, ToolDefinition, ToolResult,
52};
53
54/// Re-export of [`serde_json::Value`] under a domain-friendly alias.
55pub use serde_json::Value as Json;