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
//! The named capability registry: a higher-level catalog of capabilities
//! addressable by name.
//!
//! This layer is deliberately distinct from the harness'
//! [`crate::harness::model::ModelRegistry`] and
//! [`crate::harness::tool::ToolRegistry`], which are per-run executable stores.
//! The [`CapabilityRegistry`] is a *capability catalog*: it owns named models,
//! tools, graph blueprints, routers, and reducers so declarative `.rag`/`.ragsh`
//! sources can be bound by name, then validated against what Rust has actually
//! registered and allowed.
use HashMap;
use Arc;
use crateChatModel;
use crateTool;
use crateBlueprint;
use crate;
/// A name-addressable catalog of registered capabilities.
///
/// The registry is generic over the application `State` because models and
/// tools are generic over it. The default `State = ()` matches the common case
/// of stateless capabilities.
///
/// Storage is partitioned by [`ComponentKind`]:
///
/// - **Models, tools, graphs** keep an executable/serializable value.
/// - **Routers, reducers** (and the reserved store/agent kinds) are name-only
/// descriptors for now: enough for the `.rag` resolver to answer "is this
/// name registered?".
///
/// The [`metadata`](CapabilityRegistry::metadata) map is the source of truth for
/// *presence*: every successful registration records a
/// [`ComponentMetadata`] entry keyed by `(kind, name)`, so
/// [`has`](CapabilityRegistry::has) and [`names`](CapabilityRegistry::names)
/// work uniformly across kinds.