Expand description
§FAF — Foundational AI-context Format
Project DNA for any AI. IANA-registered as application/vnd.faf+yaml.
This is the meta-crate for the FAF Rust ecosystem. It re-exports the core SDK and optionally the Radio Protocol client.
§Quick Start
[dependencies]
faf = "0.1"use faf::FafDocument;
let yaml = std::fs::read_to_string("project.faf").unwrap();
let doc = FafDocument::from_yaml(&yaml).unwrap();
println!("{}: {}", doc.name(), doc.score());§Features
sdk(default) — Parse, validate, and compile .faf files via [faf-rust-sdk]axum— Axum middleware: inject project context into every requestradio— Radio Protocol client for MCPaaS via [faf-radio-rust]
§Ecosystem
| Crate | What |
|---|---|
faf | This meta-crate |
faf-rust-sdk | Core SDK |
faf-radio-rust | Radio Protocol client |
rust-faf-mcp | MCP server |
Modules§
- binary
- FAFB Binary Format
Structs§
- Context
Quality - Context quality metrics
- FafData
- Complete FAF file structure
- FafFile
- Parsed FAF file with convenient accessors
- Fafb
Header - The 32-byte FAFB file header
- Flags
- Helper struct for working with flags
- Human
Context - Human context - the 6 W’s
- Instant
Context - Instant context for AI
- Preferences
- Development preferences
- Priority
- Priority level with semantic meaning
- Project
- Project metadata
- Section
Entry - A single section entry in the section table
- Section
Table - The section table containing all section entries
- Stack
- Technical stack
- State
- Project state
- Validation
Result - Validation result
Enums§
- Compression
Level - Compression levels
- FafError
- FAF parsing errors
- Fafb
Error - Errors that can occur when working with .fafb files
- Find
Error - Errors from find operations
- Section
Type - Section type with display name
Constants§
- VERSION
- Library version
Functions§
- compress
- Compress FAF to specified level
- estimate_
tokens - Get estimated token count for compression level
- find_
and_ parse - Find and parse FAF file in one call
- find_
faf_ file - Find FAF file starting from given directory, walking up to parents
- parse
- Parse FAF content from string
- parse_
file - Parse FAF from file path
- stringify
- Serialize FAF back to YAML string
- validate
- Validate FAF file structure