//! # kb-core: KOGRAL Core Library
//!
//! Core library for a Logseq-inspired KOGRAL system.
//!
//! ## Features
//!
//! - **Graph-based storage**: Nodes (notes, decisions, guidelines, patterns)
//!   and edges (relationships)
//! - **Multiple backends**: Filesystem (git-friendly, Logseq-compatible),
//!   `SurrealDB`, in-memory
//! - **Configuration-driven**: Nickel schemas → JSON → Rust structs
//! - **Semantic search**: Vector embeddings via rig-core (Claude, `OpenAI`,
//!   Ollama) or fastembed
//! - **Template system**: Tera templates for document generation and export
//! - **Inheritance**: Guideline resolution from shared → local with overrides
//! - **Logseq compatibility**: Markdown with wikilinks, YAML frontmatter,
//!   export/import
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │                         kb-core                              │
//! ├─────────────────────────────────────────────────────────────┤
//! │  Config (Nickel) → Models → Storage → Query → Export        │
//! │                                                              │
//! │  Backends: Filesystem | SurrealDB | Memory                  │
//! │  Search: Text + Semantic (rig-core/fastembed)               │
//! │  Templates: Tera (generation + export)                      │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Example
//!
//! ```no_run
//! use kogral_core::models::{Node, NodeType, Graph};
//!
//! // Create a graph
//! let mut graph = Graph::new("my-project".to_string());
//!
//! // Add a note
//! let mut note = Node::new(NodeType::Note, "Rust Best Practices".to_string());
//! note.content = "Always use Result<T> for error handling".to_string();
//! note.add_tag("rust".to_string());
//! graph.add_node(note).unwrap();
//!
//! // Query
//! let rust_nodes = graph.nodes_by_tag("rust");
//! assert_eq!(rust_nodes.len(), 1);
//! ```

#![forbid(unsafe_code)]
#![warn(missing_docs)]
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

pub mod block_parser;
pub mod config;
pub mod embeddings;
pub mod error;
pub mod export;
pub mod import;
pub mod inheritance;
pub mod models;
pub mod parser;
pub mod query;
pub mod storage;
pub mod sync;

#[cfg(feature = "nats-events")]
pub mod events;

#[cfg(feature = "orchestration")]
pub mod orchestration;

mod regex_patterns;

// Re-exports for convenience
pub use error::{KbError, Result};
pub use models::{
    Block, BlockProperties, Edge, EdgeType, Graph, Node, NodeStatus, NodeType, TaskStatus,
};
