wasm-capability-contract 0.3.0

Generic, domain-agnostic capability pattern: CapabilityEngine/CapabilityRegistry/CapabilityDispatcher trait shapes + component/capability types. Trait definitions only -- see wasm-capability-core for this pattern's own default implementation, extracted from agent-runtime's ADR-001 (agent-runtime#31, ADR-011).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! [`CapabilityRegistry`] — resolves a capability name to its dispatch descriptor.

use crate::CapabilityDescriptor;

/// Resolves a capability name (e.g. `"http-egress"`, or a deployer-scoped
/// instance like `"grpc-egress:inventory-svc"`) to the descriptor
/// describing how it dispatches.
///
/// Data assembled at `Builder` composition time, not a compiled-in
/// `match` — a deployer can register additional named capabilities
/// without editing this crate's source (ADR-001). Zero implementation
/// here.
pub trait CapabilityRegistry: Send + Sync {
    /// Look up `capability`'s descriptor, if registered.
    fn descriptor(&self, capability: &str) -> Option<&CapabilityDescriptor>;
}