pub fn public_capabilities(
manifest: &Value,
) -> BTreeMap<String, PublicCapability>Expand description
Reduce a registry manifest to the public capabilities it declares.
A capability that is not public is not part of the contract and is dropped here rather than carried and filtered later, so that nothing downstream can accidentally hold one.
use majordomus_cli::release::surface::public_capabilities;
use serde_json::json;
let caps = public_capabilities(&json!({"capabilities": [
{"id": "a.one", "kind": "query", "visibility": "public"},
{"id": "a.two", "kind": "query", "visibility": "internal"},
{"id": "a.three", "kind": "query"},
]}));
assert!(caps.contains_key("a.one"));
assert!(!caps.contains_key("a.two"), "internal is not a promise to anyone");
assert!(caps.contains_key("a.three"), "the registry's own default is public");