Skip to main content

Crate faf

Crate faf 

Source
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]
  • radio — Radio Protocol client for MCPaaS via [faf-radio-rust]

§Ecosystem

CrateWhat
fafThis meta-crate
faf-rust-sdkCore SDK
faf-radio-rustRadio Protocol client
rust-faf-mcpMCP server

Modules§

binary
FAFB Binary Format

Structs§

ContextQuality
Context quality metrics
FafData
Complete FAF file structure
FafFile
Parsed FAF file with convenient accessors
FafbHeader
The 32-byte FAFB file header
Flags
Helper struct for working with flags
HumanContext
Human context - the 6 W’s
InstantContext
Instant context for AI
Preferences
Development preferences
Priority
Priority level with semantic meaning
Project
Project metadata
SectionEntry
A single section entry in the section table
SectionTable
The section table containing all section entries
Stack
Technical stack
State
Project state
ValidationResult
Validation result

Enums§

CompressionLevel
Compression levels
FafError
FAF parsing errors
FafbError
Errors that can occur when working with .fafb files
FindError
Errors from find operations
SectionType
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