feat(http): initialize alknet-http crate with module skeleton
Add crates/alknet-http with Cargo.toml, src/lib.rs, and the five subsystem modules (server, gateway, client, adapters, websocket) per ADR-039 (server + client host colocated). The mcp feature gate pulls in rmcp with streamable HTTP transport features only (ADR-037 — no stdio); h3/WebTransport is absent (deferred per ADR-044). alknet-core and alknet-call use workspace path deps. The crate is added to the workspace members list.
This commit is contained in:
40
crates/alknet-http/Cargo.toml
Normal file
40
crates/alknet-http/Cargo.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
[package]
|
||||
name = "alknet-http"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description = "HTTP interface for alknet: serves HTTP/1.1 + HTTP/2 on standard ALPNs (with WebSocket upgrade for browser bidirectional access) and hosts the HTTP-backed call-protocol adapters"
|
||||
repository.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "alknet_http"
|
||||
|
||||
[features]
|
||||
default = ["h2", "http1"]
|
||||
mcp = ["dep:rmcp"]
|
||||
h2 = ["dep:hyper"]
|
||||
http1 = ["dep:hyper"]
|
||||
|
||||
[dependencies]
|
||||
alknet-core = { path = "../alknet-core" }
|
||||
alknet-call = { path = "../alknet-call" }
|
||||
axum = { version = "0.8", features = ["ws"] }
|
||||
hyper = { version = "1", optional = true, features = ["server", "http1", "http2"] }
|
||||
reqwest = { version = "0.13", default-features = false, features = ["json", "stream"] }
|
||||
reqwest-middleware = "0.5"
|
||||
reqwest-retry = "0.9"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
async-trait = "0.1"
|
||||
tracing = "0.1"
|
||||
thiserror = "2"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
futures = "0.3"
|
||||
openapiv3 = "2"
|
||||
rmcp = { version = "1.8", optional = true, default-features = false, features = [
|
||||
"client",
|
||||
"server",
|
||||
"transport-streamable-http-client-reqwest",
|
||||
"transport-streamable-http-server",
|
||||
] }
|
||||
11
crates/alknet-http/src/adapters/mod.rs
Normal file
11
crates/alknet-http/src/adapters/mod.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
//! HTTP-backed call-protocol adapters: `from_openapi`, `to_openapi`,
|
||||
//! `from_mcp`, `to_mcp`.
|
||||
//!
|
||||
//! `from_openapi`/`from_mcp` are the no-env-vars credential injection point
|
||||
//! (ADR-014); `to_openapi`/`to_mcp` are projections of the local registry
|
||||
//! (ADR-017). `from_mcp`/`to_mcp` are feature-gated behind `mcp`
|
||||
//! (streamable HTTP only — ADR-037). See
|
||||
//! `docs/architecture/crates/http/http-adapters.md` and
|
||||
//! `docs/architecture/crates/http/http-mcp.md`.
|
||||
|
||||
// TODO: implement
|
||||
6
crates/alknet-http/src/client/mod.rs
Normal file
6
crates/alknet-http/src/client/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
//! Shared HTTP client (`ClientWithMiddleware`): reqwest + retry middleware
|
||||
//! stack, used by `from_openapi`/`from_mcp` forwarding handlers.
|
||||
//!
|
||||
//! See `docs/architecture/crates/http/http-adapters.md` and OQ-40.
|
||||
|
||||
// TODO: implement
|
||||
7
crates/alknet-http/src/gateway/mod.rs
Normal file
7
crates/alknet-http/src/gateway/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
//! Gateway: shared dispatch spine (`GatewayDispatch`) and error mapping.
|
||||
//!
|
||||
//! The 5 fixed gateway endpoints (`/search`, `/schema`, `/call`, `/batch`,
|
||||
//! `/subscribe`) are the sole HTTP invoke path (ADR-042/047). See
|
||||
//! `docs/architecture/crates/http/http-server.md`.
|
||||
|
||||
// TODO: implement
|
||||
13
crates/alknet-http/src/lib.rs
Normal file
13
crates/alknet-http/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
//! alknet-http: HTTP interface for alknet — serves HTTP/1.1 + HTTP/2 on
|
||||
//! standard ALPNs (with WebSocket upgrade for browser bidirectional access)
|
||||
//! and hosts the HTTP-backed call-protocol adapters.
|
||||
//!
|
||||
//! Two roles in one crate (ADR-039): HTTP server (HttpAdapter, a
|
||||
//! ProtocolHandler for h2/http1.1 + WS upgrade) and HTTP client host
|
||||
//! (from_openapi/from_mcp forwarding, to_openapi/to_mcp projections).
|
||||
|
||||
pub mod adapters;
|
||||
pub mod client;
|
||||
pub mod gateway;
|
||||
pub mod server;
|
||||
pub mod websocket;
|
||||
9
crates/alknet-http/src/server/mod.rs
Normal file
9
crates/alknet-http/src/server/mod.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
//! HTTP server: `HttpAdapter`, axum-over-QUIC, gateway routes, `/healthz`,
|
||||
//! decoy, and custom routes.
|
||||
//!
|
||||
//! Implements `alknet_core::types::ProtocolHandler` for the standard HTTP
|
||||
//! ALPNs (`h2`, `http/1.1`) with WebSocket upgrade for browser
|
||||
//! bidirectional access (ADR-044). See
|
||||
//! `docs/architecture/crates/http/http-server.md`.
|
||||
|
||||
// TODO: implement
|
||||
7
crates/alknet-http/src/websocket/mod.rs
Normal file
7
crates/alknet-http/src/websocket/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
//! WebSocket upgrade handler, framing, and dispatch handoff.
|
||||
//!
|
||||
//! WebSocket is the browser bidirectional path (ADR-044) and carries the
|
||||
//! native `EventEnvelope` call-protocol session, not the gateway shape
|
||||
//! (ADR-048). See `docs/architecture/crates/http/websocket.md`.
|
||||
|
||||
// TODO: implement
|
||||
Reference in New Issue
Block a user