Skip to main content

Crate brainos_backends

Crate brainos_backends 

Source
Expand description

Action backends and resilience primitives for Brain OS.

Extracted from the CLI crate so they can be reused by adapters and tests.

Re-exports§

pub use baseline::BaselineProvider;
pub use baseline::CapabilitySummary;
pub use capabilities::native_capabilities;
pub use error::BackendInitError;
pub use fetch::BasicUrlFetcher;
pub use logs::LogAnalysis;
pub use memory::DefaultMemoryBackend;
pub use messaging::json_escape;
pub use messaging::render_message_template;
pub use messaging::WebhookMessageBackend;
pub use messaging::DEFAULT_MESSAGE_BODY;
pub use net::NetDiagnostics;
pub use resilience::resilient_send;
pub use resilience::ResilientSendError;
pub use scheduling::DefaultSchedulingBackend;
pub use search::CustomSearchBackend;
pub use search::DuckDuckGoSearchBackend;
pub use search::SearxngSearchBackend;
pub use search::TavilySearchBackend;
pub use security::ConfigSecurityAuditor;

Modules§

baseline
System baseline + drift detection — the executor behind brain baseline capture/diff/list and the baseline.capture/diff/list native capabilities.
capabilities
The declarative capability-registration substrate.
error
Typed errors for backend construction.
fetch
URL-fetch backend — bounded HTTP GET + HTML→text reduction.
logs
Log pattern analysis — the executor behind brain logs analyze and the logs.analyze native capability.
memory
Memory backend for the action dispatcher.
messaging
Message backend — webhook delivery with resilience.
net
Network diagnostics — the executor behind brain net check/trace/cert and the net.check / net.trace / net.cert native capabilities (Issue 139).
resilience
Resilience helpers for HTTP backends — pairs the canonical resilience::CircuitBreaker with retry + reqwest-aware transient-error detection. Re-exports CircuitBreaker so existing backend code keeps the use crate::resilience::CircuitBreaker import shape.
scheduling
Scheduling backend — persists scheduled intents to SQLite.
search
Web search backends — DuckDuckGo (zero-config built-in), SearXNG, Tavily, and custom endpoint providers.
security
Security-posture audit — the executor behind brain security audit and the security.audit native capability (Issue 140).

Structs§

CircuitBreaker
Per-target circuit breaker. The tool_id is opaque to the breaker but is what consumers (the capability router, audit log, Live tab) key on, so it is included in every emitted BrainEvent::BreakerStateChange.

Traits§

Breaker
The circuit-breaker contract callers depend on, so resilience consumers (backends::resilient_send, the per-tool registry, tests) can be written against the behaviour rather than the concrete CircuitBreaker struct — the SOLID dependency-inversion seam for the breaker.