tsaur_core/lib.rs
1//! # tsaur-core
2//!
3//! Reference implementation of the **T-saur** archive format (`.tsr`): a content-addressed,
4//! agent-first archive.
5//!
6//! * content-defined chunking (FastCDC) + BLAKE3 identities + deduplication, Merkle root identity
7//! * block mode (default), solid blocks or granular blobs; codecs zstd, zstd + trained dictionary,
8//! xz (LZMA2) and PPMd H, chosen per block; x86 and ARM64 branch filters for machine code
9//! * container awareness: ZIP/OPC members and PDF FlateDecode streams inverted with preflate,
10//! JPEG (files and DCTDecode streams) recoded losslessly with Lepton; always rebuilt bit-exact
11//! * compression by reference: chunks present in a referenced archive are not stored again
12//! * per-blob authenticated encryption (XChaCha20-Poly1305) with an envelope key unlocked by
13//! Argon2id passwords or hybrid X25519 + ML-KEM-768 recipients; Ed25519 signatures
14//! * hard resource limits (anti decompression bomb), path sanitisation by construction
15//! * streaming packer and reader (bounded memory), range reads, canonical views (DOCX, PDF)
16//! * fixed-size pieces + Reed-Solomon parity sidecars for transport verification and recovery
17//!
18//! The format is specified in `docs/spec/`; `tsaur` (the CLI crate) adds the agent-facing
19//! commands and the MCP server.
20
21pub mod canonical;
22pub mod chunk;
23pub mod codec;
24pub mod container;
25pub mod crypto;
26pub mod error;
27pub mod format;
28pub mod manifest;
29pub mod pack;
30pub mod paths;
31pub mod pieces;
32pub mod read;
33pub mod tls;
34pub mod transfer;
35pub mod volumes;
36
37pub use error::{Error, Result};
38pub use pack::{pack, PackOptions, PackReport};
39pub use read::{inspect, Inspect, Reader, VerifyReport};
40
41/// Library version string (matches the crate version).
42pub const VERSION: &str = env!("CARGO_PKG_VERSION");
43/// Identifies the writer line recorded inside archives, views and volume descriptors. It names the
44/// format (v1) and the writer generation, not the crate release, so that the same inputs give the
45/// same bytes across patch releases (the golden archives in `tests/golden/` pin this).
46pub const WRITER: &str = "tsaur-core/1.0";