1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! The canonical, version-agnostic IR.
//!
//! # What this is for
//!
//! Application code and user handlers see these types. They do not see a
//! revision's wire types, and they never choose a version at compile time. T08
//! adds per-revision codecs that lift the wire into this IR and lower it back
//! out, so the same handler serves every revision and the bridge between them
//! is pure data.
//!
//! # The three properties everything here is built around
//!
//! **Superset.** Every revision's types are a subset of these. Fields a newer
//! revision added are `Option` and absent on older ones, so a `2024-11-05`
//! value and a `2026-07-28` value are both representable, and the difference is
//! visible rather than typed away.
//!
//! **Self-describing requirements.** Every value can report what it needs to be
//! expressed through `required_features()`. Lowering asks that question rather
//! than pattern-matching on a version, so adding a revision does not mean
//! touching every encoder — a new revision turns on the features it defines,
//! and the existing gates do the rest.
//!
//! **Lossless.** Unmodelled fields land in an [`Extensions`] bag instead of
//! being dropped, and an unparseable value lands as `Raw` rather than
//! disappearing. The bridge's `lift(v, lower(v, ir)) == ir` claim is only
//! meaningful because of this, and it is the property the crate exists for.
//!
//! # The layering
//!
//! ```text
//! mod features; // FeatureSet — what a value needs
//! mod json; // JsonObject — arbitrary JSON, validated once
//! mod extensions; // Extensions — the passthrough bag
//! mod content; // Content — content blocks
//! mod message; // IrMessage — the envelope
//! mod tool; // ToolResult — and the downgrade fallback
//! ```
//!
//! Each file holds one concern, and the dependency direction is downward:
//! `content`, `tool`, `codec` and `lower` use `features`, `json` and
//! `extensions`, and nothing uses `content`. `message` sits above the rest
//! and is the only place they are assembled. `codec` and `lower` are public
//! because the adapter layer implements their traits and a bridge reads the
//! reports those traits produce.
pub use Codec;
pub use ;
pub use ;
pub use ;
pub use FeatureSet;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;