Skip to main content

rullama_core/
lib.rs

1#![deny(missing_docs)]
2//! # rullama-core
3//!
4//! Foundation types, traits, and error handling for the rullama.
5//!
6//! This crate provides the core data structures used across all framework crates:
7//! - Message types for AI conversations
8//! - Tool definitions and execution results
9//! - Task and agent context types
10//! - Plan metadata and status
11//! - Working set for file context management
12//! - Chat options and provider configuration
13//! - Permission modes
14
15/// Response confidence extraction (CISC heuristics) — used by SEAL learning
16/// and validation policies to score model output quality.
17pub mod confidence;
18/// Content source types for tracking where content originates.
19pub mod content_source;
20/// Embedding provider trait for vector operations.
21pub mod embedding;
22/// Framework error types and result aliases.
23pub mod error;
24/// Unified event trait and `EventEnvelope<E>` with trace IDs and sequence numbers.
25pub mod event;
26/// File chunking + content extraction primitives — `FileContextManager`,
27/// `FileContent`, `FileChunk`. Moved from `rullama-storage` in Phase 9.
28/// Native-only (uses `tokio::fs`).
29#[cfg(not(target_arch = "wasm32"))]
30pub mod file_context;
31/// Knowledge graph types: entities, edges, and trait interfaces.
32pub mod graph;
33/// Lifecycle hooks for intercepting framework events.
34pub mod lifecycle;
35/// Message, role, and streaming types for AI conversations.
36pub mod message;
37/// Platform-specific path helpers — `PlatformPaths`. Moved from
38/// `rullama-storage` in Phase 9.
39pub mod paths;
40/// Permission mode definitions.
41pub mod permission;
42/// Plan metadata, steps, budgets, and serializable plans.
43pub mod plan;
44/// Provider configuration and chat options.
45pub mod provider;
46/// Shared search types (SearchResult, ChunkMetadata, DatabaseStats).
47pub mod search;
48/// Task, priority, and agent response types.
49pub mod task;
50/// Tool definitions, schemas, contexts, and idempotency.
51pub mod tool;
52/// Vector store trait for similarity search.
53pub mod vector_store;
54/// Persistent workflow state for crash-safe agent retry.
55///
56/// Native-only: the filesystem-backed checkpoint store uses `tokio::fs` and
57/// `dirs::home_dir`, neither of which are available on `wasm32-unknown-unknown`.
58#[cfg(not(target_arch = "wasm32"))]
59pub mod workflow_state;
60/// Working set for file context management with LRU eviction.
61pub mod working_set;
62
63// Re-export core types at crate root
64pub use content_source::ContentSource;
65pub use embedding::EmbeddingProvider;
66pub use error::*;
67pub use graph::*;
68pub use message::*;
69pub use permission::*;
70pub use plan::*;
71pub use provider::*;
72pub use search::{ChunkMetadata, DatabaseStats, SearchResult};
73pub use task::*;
74pub use tool::*;
75pub use vector_store::{VectorSearchResult, VectorStore};
76pub use working_set::{
77    WorkingSet, WorkingSetConfig, WorkingSetEntry, estimate_tokens, estimate_tokens_from_size,
78};