Skip to main content

core_api/node/contracts/
mod.rs

1pub mod agent_gateway;
2pub mod audiobridge;
3pub mod camera;
4pub mod llm;
5
6/// Revisions are per Node type. Bump only the affected entry when its Core-facing
7/// protocol breaks. Private UI/CLI APIs do not change these revisions.
8/// Source ownership (first/third party) is separate from this protocol boundary.
9pub fn first_party_core_protocol_version(node_type: &str) -> Option<u32> {
10    match node_type {
11        "camera" => Some(1),
12        "matter" => Some(1),
13        "llm" => Some(1),
14        "storage" => Some(1),
15        "audiobridge" => Some(1),
16        "mac" => Some(1),
17        _ => None,
18    }
19}
20
21#[cfg(test)]
22mod admission_tests {
23    #[test]
24    fn first_party_contracts_include_mac_but_do_not_assign_extension_revisions() {
25        for node_type in ["camera", "matter", "llm", "storage", "audiobridge", "mac"] {
26            assert_eq!(super::first_party_core_protocol_version(node_type), Some(1));
27        }
28        assert_eq!(
29            super::first_party_core_protocol_version("third-party"),
30            None
31        );
32    }
33}