faf_kernel/lib.rs
1//! faf-kernel — the FAF kernel.
2//!
3//! Parse, validate, and score `.faf` files (IANA-registered
4//! `application/vnd.faf+yaml`). This crate is the single source of truth
5//! consumed by every FAF shell — CLI, MCP server, WASM, edge worker.
6//!
7//! # Example
8//!
9//! ```rust
10//! use faf_kernel::{parse, score};
11//!
12//! let content = r#"
13//! faf_version: 2.5.0
14//! project:
15//! name: my-project
16//! goal: Build something great
17//! "#;
18//!
19//! let faf = parse(content).unwrap();
20//! assert_eq!(faf.project_name(), "my-project");
21//!
22//! let result = score(content).unwrap();
23//! assert!(result.score <= 100);
24//! ```
25
26mod compress;
27mod discovery;
28mod parser;
29mod score;
30mod types;
31mod validator;
32
33pub use compress::{CompressionLevel, compress, estimate_tokens};
34pub use discovery::{FindError, find_and_parse, find_faf_file};
35pub use parser::{FafError, FafFile, parse, parse_file, stringify};
36pub use score::{Mk4Result, Mk4Scorer, SlotState, TOTAL_SLOTS, score, tier_name, tier_symbol};
37pub use types::*;
38pub use validator::{ValidationResult, validate};
39
40/// Library version
41pub const VERSION: &str = env!("CARGO_PKG_VERSION");