archivist-core 0.2.0

Platform-neutral core for the FicHub companion bot: FicHub REST API client, search/recommendation/download command logic, intent classification, pagination cache, and the PlatformMessage IR. Shared by every platform adapter (Discord, Telegram, Matrix, Slack, IRC, fediverse, CLI, web).
Documentation
//! # archivist-core
//!
//! Platform-neutral core for the FicHub companion bot.
//!
//! This crate contains ALL business logic shared by every platform adapter:
//!
//! - `api` — typed FicHub REST API client (`FichubClient`)
//! - `model` — response/request structs
//! - `cache` — Redis pagination + response cache shared with FicHub
//! - `store` — token store (`/link` flow) + pending-link codes
//! - `config` — environment-driven `BotConfig`
//! - `error` — `BotError` (no platform-specific variants)
//! - `util` — URL detection, word formatting, truncation
//! - `core` — the platform-neutral `PlatformMessage` IR + `RichItem` + buttons
//! - `dispatch` — `CoreCtx` + every `do_*` command (search, ask, quote, body,
//!   recs, roll, download, bookmark, metadata, help, kudos)
//! - `intent` — free-form natural-language classification (optional LLM via
//!   Ollama, heuristic fallback)
//! - `lemmy` — Lemmy/Piefed community monitor (poll-based)
//! - `ratelimit` — cross-platform rate limiting (shared Redis buckets)
//! - `debug` — diagnostics
//!
//! Adapters (fanfic-archivist-discord, -matrix, -telegram, -slack, -irc,
//! -fediverse, CLI, web) depend on this crate and render `PlatformMessage`
//! natively. This crate never imports a platform SDK.

pub mod api;
pub mod cache;
pub mod config;
pub mod core;
pub mod debug;
pub mod dispatch;
pub mod error;
pub mod intent;
pub mod lemmy;
pub mod model;
pub mod ratelimit;
pub mod store;
pub mod util;

pub use config::BotConfig;
pub use error::{BotError, Result};

/// Version of the bot core.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");