Skip to main content

faf_rust_sdk/
lib.rs

1//! FAF Rust SDK — the facade over the FAF kernel.
2//!
3//! `faf-rust-sdk` re-exports two crates so downstream code has one dependency
4//! for the whole Rust FAF surface:
5//!
6//! - [`faf-kernel`](https://docs.rs/faf-kernel) — parse, validate, and score
7//!   `.faf` files (the kernel).
8//! - [`faf-fafb`](https://docs.rs/faf-fafb) — the compiled binary form,
9//!   re-exported here under the [`binary`] module.
10//!
11//! As of 3.0 the SDK contains no logic of its own; it is a stable import
12//! surface. The kernel is the single source of truth — the same `faf-kernel`
13//! object scores in the CLI, the MCP server, WASM, and the edge worker, so
14//! parity is a property of the build, not a test that has to be re-run.
15//!
16//! # Example
17//!
18//! ```rust
19//! use faf_rust_sdk::{parse, score};
20//!
21//! let content = r#"
22//! faf_version: 2.5.0
23//! project:
24//!   name: my-project
25//!   goal: Build something great
26//! "#;
27//!
28//! let faf = parse(content).unwrap();
29//! assert_eq!(faf.project_name(), "my-project");
30//!
31//! let result = score(content).unwrap();
32//! assert!(result.score <= 100);
33//! ```
34
35#[cfg(feature = "axum")]
36pub mod axum;
37
38/// The compiled binary form of `.faf` — FAFb v2 (re-export of `faf-fafb`).
39pub mod binary {
40    pub use faf_fafb::*;
41}
42
43// Kernel re-exports — parse, validate, score, compress, discover, plus all
44// FAF data types.
45pub use faf_kernel::*;
46
47// Binary-format types at the crate root (back-compat with pre-3.0 paths).
48pub use faf_fafb::{FafbError, FafbHeader, Flags, Priority, SectionEntry, SectionTable};
49
50/// Library version
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");