Skip to main content

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 lens;
16pub mod llm;
17pub mod tool;
18
19/// Re-exports of the most commonly used types.
20///
21/// ```rust
22/// use pulsehive_core::prelude::*;
23/// ```
24pub mod prelude {
25    // ── Core traits ──────────────────────────────────────────────────
26    pub use crate::approval::ApprovalHandler;
27    pub use crate::embedding::EmbeddingProvider;
28    pub use crate::llm::LlmProvider;
29    pub use crate::tool::Tool;
30
31    // ── Agent types ──────────────────────────────────────────────────
32    pub use crate::agent::{
33        AgentDefinition, AgentKind, AgentKindTag, AgentOutcome, ExperienceExtractor,
34        ExtractionContext, LlmAgentConfig,
35    };
36
37    // ── Approval types ───────────────────────────────────────────────
38    pub use crate::approval::{ApprovalResult, AutoApprove, PendingAction};
39
40    // ── Context types ────────────────────────────────────────────────
41    pub use crate::context::ContextBudget;
42
43    // ── Error types ──────────────────────────────────────────────────
44    pub use crate::error::{PulseHiveError, Result};
45
46    // ── Event types ──────────────────────────────────────────────────
47    pub use crate::event::{EventBus, EventEmitter, HiveEvent};
48
49    // ── Lens types ───────────────────────────────────────────────────
50    pub use crate::lens::{ExperienceTypeTag, Lens, RecencyCurve};
51
52    // ── LLM types ────────────────────────────────────────────────────
53    pub use crate::llm::{
54        LlmChunk, LlmConfig, LlmResponse, Message, TokenUsage, ToolCall, ToolDefinition,
55    };
56
57    // ── Tool types ───────────────────────────────────────────────────
58    pub use crate::tool::{ToolContext, ToolResult};
59
60    // ── PulseDB re-exports ───────────────────────────────────────────
61    pub use pulsedb::{
62        CollectiveId, Experience, ExperienceId, ExperienceType, InsightId, NewExperience,
63        PulseDBSubstrate, RelationId, SubstrateProvider,
64    };
65}