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
//! Host-composition entry point (ADR-191 D6, ADR-192 S4).
//!
//! `kkernel`'s own linked pack set is discovered at link time through
//! `inventory` (`crates/kkernel/src/lib.rs`'s `_pack_links` force-link
//! anchor). A pack compiled outside this repository against a pinned
//! revision — the D6 extension seam — has no presence in that inventory
//! short of its own host binary's own force-link anchor, and S4's
//! credential providers and request hooks are composed the same way: "a
//! downstream composition is one function call: base packs, extra packs,
//! credential providers, request hooks." This module is that one function
//! call for pack factories: it constructs a `VerbRegistry` from kkernel's
//! linked set plus caller-supplied `&'static dyn PackFactory` values,
//! exactly as `khive-mcp/src/serve.rs`'s multi-backend boot path constructs
//! one from the linked set alone
//! (`khive_runtime::PackRegistry::register_packs_with_runtimes`) — this
//! entry point is a thin wrapper over the sibling function that also
//! accepts extras
//! (`khive_runtime::PackRegistry::register_packs_with_runtimes_with_extra_factories`).
use HashMap;
use ;
/// Build a `VerbRegistry` from `names`, resolving each against kkernel's
/// linked pack set plus `extra_factories`.
///
/// `runtimes` maps a pack name to the `KhiveRuntime` it should write
/// through (one per configured backend, mirroring
/// `resolve_pack_backend_config`'s per-pack routing); `default_runtime`
/// covers any name absent from that map, and also supplies the registry's
/// gate, default namespace, visible namespaces, and actor id — the same
/// fields `khive_runtime::PackRegistry::build_ingest_registry` reads off a
/// single runtime for its own one-shot registry construction. The returned
/// registry's aggregated edge rules are installed back onto `default_runtime`
/// and onto every runtime in `runtimes`, mirroring
/// `build_registry_for_multi_backend_inner`'s post-`build()` step in
/// `khive-mcp/src/serve.rs`.
///
/// An inventory-discovered pack always wins a name collision with an
/// `extra_factories` entry — see
/// `register_packs_with_runtimes_with_extra_factories` for the full
/// collision rule.