a3s_flow/capabilities.rs
1//! Structured capability discovery for `a3s-flow`.
2//!
3//! This module provides a transport-friendly view of the engine's built-in and
4//! custom node catalog so higher layers can expose progressive discovery APIs
5//! without hard-coding node metadata.
6
7use serde::{Deserialize, Serialize};
8
9use crate::registry::NodeDescriptor;
10
11/// Stable capabilities document for a `FlowEngine` instance.
12#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
13pub struct FlowCapabilities {
14 /// Schema/version marker for downstream clients.
15 pub version: String,
16 /// Whether clients should progressively expand into finer-grained
17 /// capabilities instead of assuming a fixed surface.
18 pub progressive_disclosure: bool,
19 /// Short human-readable summary of the current engine capability set.
20 pub summary: String,
21 /// Structured node catalog, sorted by `node_type`.
22 pub nodes: Vec<NodeDescriptor>,
23}
24
25impl FlowCapabilities {
26 /// Build a capabilities document from a node catalog.
27 pub fn from_nodes(nodes: Vec<NodeDescriptor>) -> Self {
28 Self {
29 version: "2026-03-22".to_string(),
30 progressive_disclosure: true,
31 summary: "A3S Flow exposes a discoverable catalog of workflow node capabilities."
32 .to_string(),
33 nodes,
34 }
35 }
36}