alkhttp/lib.rs
1//! alkhttp: HTTP interface for the alk stack — serves HTTP/1.1 + HTTP/2 on
2//! standard ALPNs (with WebSocket upgrade carrying the channels protocol)
3//! and hosts the HTTP-backed call-protocol adapters.
4//!
5//! # Feature sides
6//!
7//! The crate serves two independent use cases, selectable via features:
8//!
9//! - `server` — the producer side: the axum `Router` host
10//! ([`server`]), the gateway routes ([`gateway`]), the WebSocket
11//! upgrade path ([`websocket`]), `to_openapi`, and `to_mcp` (with
12//! `mcp`).
13//! - `client` — the consumer side: the shared outbound client host
14//! ([`client`]) and the import adapters (`from_jsonschema`,
15//! `from_openapi`, `from_mcp` with `mcp`).
16//!
17//! Both default on; lean builds take `default-features = false` with
18//! the side they need. The shared OpenAPI document model rides behind
19//! `openapi` (implied by both sides); `openapi_spec` and `to_openapi`
20//! compile with it alone.
21//!
22//! # Documentation gate (HY-02)
23//!
24//! Public-API items must be documented: this crate is pre-crates.io and
25//! docs.rs renders straight from the rustdoc. The deny below keeps the
26//! gate from regressing.
27
28#![deny(missing_docs)]
29
30/// The HTTP-backed call-protocol adapters: `from_openapi` /
31/// `from_jsonschema` / `from_mcp` (credential-injecting consumers) and
32/// `to_openapi` / `to_mcp` (gateway projections of local operations).
33pub mod adapters;
34/// The shared outbound client host: hot-reloadable reqwest stack with
35/// same-host-only redirects, idempotent-only retries, and TLS config.
36#[cfg(feature = "client")]
37pub mod client;
38/// The 6 fixed gateway endpoints and their shared dispatch spine —
39/// the sole HTTP invoke path.
40#[cfg(feature = "server")]
41pub mod gateway;
42/// The HTTP server host: the `HttpAdapter` router, auth, stealth decoy,
43/// `/healthz`, `/openapi.json`.
44#[cfg(feature = "server")]
45pub mod server;
46/// The WebSocket upgrade path carrying the native call-protocol
47/// session (browsers; ADR-044, ADR-048). The `upgrade` submodule
48/// compiles under `server`; the shared byte-stream adapter also under
49/// `wss` (the `from_wss` consumer seam).
50#[cfg(any(feature = "server", feature = "wss", test))]
51pub mod websocket;
52
53#[cfg(feature = "server")]
54pub use server::{decoy_fallback, decoy_method_not_allowed, healthz, DecoyConfig};