pulsehive_core/lib.rs
1//! Core traits and types for PulseHive multi-agent SDK.
2//!
3//! This crate defines the public API surface: Agent, Tool, Lens, LlmProvider,
4//! HiveEvent, ApprovalHandler, and shared error types. No runtime logic lives here.
5//!
6//! Most consumers should use the `pulsehive` meta-crate instead of depending
7//! on this crate directly.
8
9pub mod agent;
10pub mod approval;
11pub mod context;
12pub mod embedding;
13pub mod error;
14pub mod event;
15pub mod export;
16pub mod lens;
17pub mod llm;
18pub mod tool;
19
20/// Re-exports of the most commonly used types.
21///
22/// ```rust
23/// use pulsehive_core::prelude::*;
24/// ```
25pub mod prelude {
26 // ── Core traits ──────────────────────────────────────────────────
27 pub use crate::approval::ApprovalHandler;
28 pub use crate::embedding::EmbeddingProvider;
29 pub use crate::export::EventExporter;
30 pub use crate::llm::LlmProvider;
31 pub use crate::tool::Tool;
32
33 // ── Agent types ──────────────────────────────────────────────────
34 pub use crate::agent::{
35 AgentDefinition, AgentKind, AgentKindTag, AgentOutcome, ExperienceExtractor,
36 ExtractionContext, LlmAgentConfig,
37 };
38
39 // ── Approval types ───────────────────────────────────────────────
40 pub use crate::approval::{ApprovalResult, AutoApprove, PendingAction};
41
42 // ── Context types ────────────────────────────────────────────────
43 pub use crate::context::ContextBudget;
44
45 // ── Error types ──────────────────────────────────────────────────
46 pub use crate::error::{PulseHiveError, Result};
47
48 // ── Event types ──────────────────────────────────────────────────
49 pub use crate::event::{EventBus, EventEmitter, HiveEvent};
50
51 // ── Lens types ───────────────────────────────────────────────────
52 pub use crate::lens::{ExperienceTypeTag, Lens, RecencyCurve};
53
54 // ── LLM types ────────────────────────────────────────────────────
55 pub use crate::llm::{
56 LlmChunk, LlmConfig, LlmResponse, Message, TokenUsage, ToolCall, ToolDefinition,
57 };
58
59 // ── Tool types ───────────────────────────────────────────────────
60 pub use crate::tool::{ToolContext, ToolResult};
61
62 // ── PulseDB re-exports ───────────────────────────────────────────
63 pub use pulsedb::{
64 CollectiveId, Experience, ExperienceId, ExperienceType, InsightId, NewExperience,
65 PulseDBSubstrate, RelationId, SubstrateProvider,
66 };
67}