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
79
//! ChannelSpec: immutable, format-agnostic description of a Channel (pure pipe).
//!
//! # Purpose
//! Represents the minimal set of attributes required to instantiate a Channel.
//! Parsing (YAML / future JSON / XML) is delegated to format-specific parsers in
//! `channel_spec_yaml.rs` (and future siblings). Instantiation is handled by DSL builders.
//!
//! # Invariants
//! * `id` is optional; if omitted a runtime builder will generate a unique id.
//! * If `id` is present it must not be the empty string (builders enforce).
//! * `kind` enumerates supported implementations; currently only `queue`.
//!
//! # Adding New Channel Kinds
//! 1. Extend `ChannelKindSpec` enum (e.g. `Kafka`, `Redis`).
//! 2. Add validation + mapping logic inside each format parser.
//! 3. Update the component builder to match on the new variant.
//! 4. Provide user-facing documentation and tests (spec + builder).
//!
//! # Programmatic Example
//! ```rust
//! use allora_runtime::spec::ChannelSpec;
//! let spec = ChannelSpec::queue().id("orders-events");
//! assert_eq!(spec.channel_id(), Some("orders-events"));
//! ```
//!
//! Combined Channel specification & YAML translator (v1, pure pipe).
//! This file merges previous channel_dsl.rs (YAML DSL) and channel_spec.rs (programmatic spec).
//! See top-level docs in spec/mod.rs for overarching concepts.
use Deserialize;
/// Programmatic Channel specification (pure pipe).
/// Supported channel kinds (extend as more implementations are introduced).