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
//! [`CapabilityGrant`] — one capability actually granted to a route.

use serde::{Deserialize, Serialize};

use crate::CapabilityScope;

/// One capability granted to a component's route, by name and scope.
///
/// A component's `ComponentManifest.capabilities` declares what it wants;
/// a `Vec<CapabilityGrant>` is what the deployer actually grants for that
/// route. `ComponentValidator` rejects any declared capability with no
/// matching entry here — deny-by-default (ADR-001).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CapabilityGrant {
    /// The capability name, e.g. `"http-egress"`. Looked up in a
    /// `CapabilityRegistry` to resolve the host import it wires to.
    pub name: String,
    /// This grant's scope — bounds what the named capability may reach.
    pub scope: CapabilityScope,
}