Skip to main content

ferrik_core/
lib.rs

1//! Core runtime for the Ferrik web framework.
2//!
3//! Provides the triple-response engine (`ActionResponse<T>`), AI discovery protocol,
4//! multi-database SeaORM helpers, unified error handling, and the `testing` harness.
5
6pub mod auth;
7pub mod config;
8pub mod db;
9pub mod discovery;
10pub mod error;
11pub mod extract;
12pub mod mcp;
13pub mod response;
14pub mod testing;
15
16/// Framework version string.
17pub const VERSION: &str = env!("CARGO_PKG_VERSION");
18
19/// Re-exports of commonly used crates and Ferrik primitives.
20pub mod prelude {
21    pub use crate::auth::{
22        generate_agent_key, hash_agent_key, parse_scopes, AgentKeyStore, AgentPrincipal, AuthActor,
23        HasAgentKeyStore, OAuthTokenRequest, OAuthTokenResponse, UserSession, AGENT_KEY_PREFIX,
24    };
25    pub use crate::config::{AppConfig, DatabaseConfig};
26    pub use crate::db;
27    pub use crate::discovery::{
28        discovery_link_header, discovery_router, AgentEndpoint, AgentManifest,
29    };
30    pub use crate::error::{format_errors_middleware, AppError, FormattedError};
31    pub use crate::extract::{
32        deserialize_bool_from_anything, deserialize_datetime_from_anything,
33        validation_errors_to_vec, ActionInput,
34    };
35    pub use crate::mcp::{mcp_router, mount_mcp, McpServer};
36    pub use crate::response::{ActionAffordance, ActionResponse, Format, ResponseFormat};
37    pub use askama::Template;
38    pub use async_trait::async_trait;
39    pub use axum::http::StatusCode;
40    pub use axum::response::IntoResponse;
41    pub use axum::routing::{delete, get, post, put};
42    pub use axum::Router;
43    pub use schemars::JsonSchema;
44    pub use serde::{Deserialize, Serialize};
45    pub use validator::Validate;
46}
47
48pub use askama;
49pub use async_trait;
50pub use axum;
51pub use chrono;
52pub use rust_decimal;
53pub use schemars;
54pub use sea_orm;
55pub use serde;
56pub use serde_json;
57pub use tokio;
58pub use tower;
59pub use tower_http;
60pub use tracing;
61pub use tracing_subscriber;
62pub use validator;