Expand description
.treeship package builder and reader.
A .treeship package is a directory (or tar archive) containing:
receipt.json– the canonical Session Receiptmerkle.json– standalone Merkle tree datarender.json– Explorer render hintsartifacts/– referenced artifact payloadsproofs/– inclusion proofs and zk proofspreview.html– static preview (optional)
Structs§
- Approvals
Bundle - Optional approval evidence to embed in the package alongside the
receipt + artifacts. None means “no approvals consumed during this
session, or none worth exporting.” Empty vectors mean “we looked and
found nothing”; the resulting package omits the
approvals/dir entirely so absence is unambiguous. - Approvals
Index approvals/index.json– top-level inventory of evidence in the package. Lets a consumer pre-flight what’s there before opening every file; doubles as a stable shape for downstream tooling.- Package
Output - Result of building a package.
- Verify
Check - A single verification check result.
Enums§
- Package
Error - Errors from package operations.
- Verify
Status - Status of a verification check.
Functions§
- build_
package - Build a
.treeshippackage directory from a composed receipt. - build_
package_ with_ approvals - Like
build_packagebut also embeds approval evidence (PR 4 of v0.9.9).bundle = Noneis identical tobuild_package; theapprovals/directory is omitted entirely so absence stays unambiguous. - read_
approvals_ bundle - Read approval evidence embedded in a package, if any. Returns
Ok(ApprovalsBundle::default())when the package has noapprovals/directory (the typical case for sessions that didn’t consume any scoped approvals). Errors only on malformed JSON inside files that the index claims exist. - read_
package - Read and parse a
.treeshippackage from disk. - render_
preview_ html - Generate a self-contained preview.html that embeds the receipt JSON and runs Merkle verification client-side using Web Crypto API.
- verify_
package - Verify a
.treeshippackage locally. - verify_
package_ with_ trust - Like
verify_packagebut takes an explicitTrustRootStoreso the caller can verify with a constructed-in-memory trust set (tests) or a non-default location (CLI--trust-roots).