agent-first-data 0.41.0

Self-describing data and structured CLI contracts for AI agents — field-name suffixes for units and secrets, the afdata CLI for rendering, validation, path guards, and reading or editing structured documents (JSON, TOML, YAML, dotenv, INI, Markdown), plus libraries for Rust, Go, Python, TypeScript, and Bash.
Documentation
//! Format-independent document values: dot-path get/set/add/remove, type-directed
//! CLI-string coercion, keyed-list (slug-addressed array) helpers, and typed
//! serde adapters, backed by pluggable JSON/TOML/YAML/dotenv/INI format readers
//! and writers, plus a read-only CommonMark block reader.
//!
//! # Features
//!
//! JSON support is always compiled in — `agent_first_data` already depends on
//! `serde_json` as a core dependency.
//!
//! - **toml**: Enable TOML format support (format-preserving with toml_edit)
//! - **yaml**: Enable YAML format support with CST-backed source-preserving mutation
//! - **dotenv**: Enable source-preserving dotenv format support
//! - **ini**: Enable INI Core v1 format support
//! - **markdown**: Enable the read-only CommonMark block reader
//! - **schema**: Enable the `CliSchema` trait and documentation rendering
//! - **libc**: Enable nonblocking and atomic no-follow document opens on unix
//!
//! This module never redacts values on decode/encode/save — it returns and
//! saves raw values as-is; redaction is the caller's responsibility.

pub mod coerce;
pub mod error;
pub mod file;
pub mod keyed;
pub mod path;
pub mod traverse;
pub mod typed;
pub mod value;

pub mod format;

#[cfg(feature = "schema")]
pub mod schema;

pub use coerce::{
    BareOverwrite, ScalarKind, ValueType, coerce_toward, coerce_values_toward,
    guard_bare_overwrite, scalar_kind, value_from_type, value_matches_type,
};
pub use error::{DocumentError, DocumentResult};
#[cfg(feature = "cli")]
pub use file::read_capped_file;
pub use file::{CreateMode, CreateOptions, Document, DocumentFile, SymlinkPolicy};
pub use keyed::{
    Addressing, ArrayRule, KeyedList, MatchKind, add_keyed, remove_keyed, validate_array_slug,
};
pub use path::{PathStep, PatternSegment, join_path, parse_path, parse_path_pattern};
pub use traverse::{
    Located, MissingContainer, expand_path_pattern, get_path, get_path_ref, locate,
    locate_with_route, resolve_path, set_path, unset_path,
};
pub(crate) use traverse::{append_position_refused, keyed_prefix_matches};
pub use typed::{from_value, to_value};
pub use value::Value;
pub(crate) use value::non_finite_spelling;

pub use format::Format;

#[cfg(feature = "schema")]
pub use schema::{
    CliSchema, FieldDef, render_annotated_toml, render_annotated_yaml, render_doc_markdown,
};