Skip to main content

brainwires_core/
lib.rs

1#![deny(missing_docs)]
2//! # Brainwires Core
3//!
4//! Foundation types, traits, and error handling for the Brainwires Agent Framework.
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/// Content source types for tracking where content originates.
16pub mod content_source;
17/// Embedding provider trait for vector operations.
18pub mod embedding;
19/// Framework error types and result aliases.
20pub mod error;
21/// Knowledge graph types: entities, edges, and trait interfaces.
22pub mod graph;
23/// Lifecycle hooks for intercepting framework events.
24pub mod lifecycle;
25/// Message, role, and streaming types for AI conversations.
26pub mod message;
27/// Structured output parsers for LLM responses.
28#[cfg(feature = "planning")]
29pub mod output_parser;
30/// Permission mode definitions.
31pub mod permission;
32/// Plan metadata, steps, budgets, and serializable plans.
33pub mod plan;
34/// Plan text parser for extracting steps from LLM output.
35#[cfg(feature = "planning")]
36pub mod plan_parser;
37/// Provider configuration and chat options.
38pub mod provider;
39/// Shared search types (SearchResult, ChunkMetadata, DatabaseStats).
40pub mod search;
41/// Task, priority, and agent response types.
42pub mod task;
43/// Tool definitions, schemas, contexts, and idempotency.
44pub mod tool;
45/// Vector store trait for similarity search.
46pub mod vector_store;
47/// Working set for file context management with LRU eviction.
48pub mod working_set;
49
50// Re-export core types at crate root
51pub use content_source::ContentSource;
52pub use embedding::EmbeddingProvider;
53pub use error::*;
54pub use graph::*;
55pub use message::*;
56#[cfg(feature = "planning")]
57pub use output_parser::{JsonListParser, JsonOutputParser, OutputParser, RegexOutputParser};
58pub use permission::*;
59pub use plan::*;
60#[cfg(feature = "planning")]
61pub use plan_parser::{ParsedStep, parse_plan_steps, steps_to_tasks};
62pub use provider::*;
63pub use search::{ChunkMetadata, DatabaseStats, SearchResult};
64pub use task::*;
65pub use tool::*;
66pub use vector_store::{VectorSearchResult, VectorStore};
67pub use working_set::{
68    WorkingSet, WorkingSetConfig, WorkingSetEntry, estimate_tokens, estimate_tokens_from_size,
69};