//! A minimal resident WebAssembly Component runtime.
//!
//! The runtime intentionally has no network protocol or business capabilities.
//! It provides a restricted WASI compatibility context, links explicitly
//! imported host capabilities, loads a Component that implements the stable
//! service exports, and invokes it through one serial Actor.
//!
//! # Request/response example
//!
//! ```no_run
//! use wasmeld_runtime::{ResourceLimits, Runtime, RuntimeConfig, ServiceManifest};
//!
//! let runtime = Runtime::new(RuntimeConfig::default())?;
//! let manifest = ServiceManifest {
//!     id: "echo".into(),
//!     revision: "1.0.0".into(),
//!     component: "echo.wasm".into(),
//!     world: "component:echo/echo-component@1.0.0".into(),
//!     limits: ResourceLimits::default(),
//! };
//! let bytes = std::fs::read(&manifest.component)?;
//! let key = runtime.register(manifest, bytes)?;
//! let actor = runtime.start(&key, Vec::new())?;
//! assert_eq!(actor.invoke(b"hello".to_vec())?, b"hello");
//! runtime.stop(&key)?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! A started Actor retains Component memory between calls, but Component code
//! is never allowed to monopolize the thread between calls. Active timers,
//! sockets, subscriptions, and other long-lived resources are Host-owned and
//! enter resident Components as bounded events through [`ResidentSession`].

#![warn(missing_docs)]

mod bindings;
mod capability;
mod error;
mod manifest;
mod resident;
mod resident_host;
mod runtime;

pub use capability::{
    CapabilityDescriptor, KV_MAX_KEY_BYTES, KV_MAX_VALUE_BYTES, KvBackend, KvBackendError,
};
pub use error::RuntimeError;
pub use manifest::{ResourceLimits, ServiceKey, ServiceManifest};
pub use resident::{
    ComponentExecution, ResidentEffect, ResidentEvent, ResidentLimits, ResourceId,
    StreamCloseReason,
};
pub use resident_host::{
    NetworkScope, ResidentEndpoint, ResidentHostError, ResidentOperation, ResidentPolicy,
    ResidentResourceInfo, ResidentResourceKind, ResidentResourceMetadata, ResidentResourceState,
    ResidentSession,
};
pub use runtime::{ActorHandle, Runtime, RuntimeConfig, RuntimeStats};
pub use wasmeld_package::SERVICE_WORLD;
