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/// Revision 2 requires declared App access levels and Core enforcement.
9/// Source ownership (first/third party) is separate from this protocol boundary.
10pub fn first_party_core_protocol_version(node_type: &str) -> Option<u32> {
11    match node_type {
12        "camera" => Some(2),
13        "matter" => Some(2),
14        "llm" => Some(2),
15        "storage" => Some(2),
16        "audiobridge" => Some(2),
17        "mac" => Some(2),
18        _ => None,
19    }
20}
21
22#[cfg(test)]
23mod admission_tests {
24    #[test]
25    fn first_party_contracts_include_mac_but_do_not_assign_extension_revisions() {
26        for node_type in ["camera", "matter", "llm", "storage", "audiobridge", "mac"] {
27            assert_eq!(super::first_party_core_protocol_version(node_type), Some(2));
28        }
29        assert_eq!(
30            super::first_party_core_protocol_version("third-party"),
31            None
32        );
33    }
34}