1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! # Brain HTTP REST API Adapter
//!
//! Exposes Brain's signal processing pipeline over HTTP using axum.
//!
//! ## Routes
//!
//! Unauthenticated:
//! - `GET /` — redirect to `/ui`
//! - `GET /health` — liveness probe
//! - `GET /metrics` — Prometheus-format counters
//! - `GET /ui` — embedded memory explorer web UI
//! - `GET /openapi.json` — OpenAPI 3.0 specification
//! - `GET /api` — Swagger UI
//!
//! Authenticated (`Authorization: Bearer <api-key>`):
//! - `POST /v1/signals` — submit a signal *(scope: write)*
//! - `GET /v1/signals/:id` — retrieve cached signal response *(scope: read)*
//! - `POST /v1/memory/search` — semantic search over stored facts *(scope: read)*
//! - `GET /v1/memory/facts` — paginated fact list *(scope: read)*
//! - `GET /v1/memory/namespaces` — list namespaces with counts *(scope: read)*
//! - `GET /v1/memory/export` — full memory export *(scope: export)*
//! - `POST /v1/memory/import` — import facts/episodes *(scope: write)*
//! - `GET /v1/schedules` — list scheduled intents *(scope: read)*
//! - `DELETE /v1/schedules/:id` — cancel a scheduled intent *(scope: write)*
//! - `GET /v1/events` — SSE stream of signal/notification/brain events *(scope: read)*
//! - `POST /v1/webhooks/:id` — inbound webhook delivery *(scope: write — or a configured signature verifier in lieu of Bearer auth)*
//!
//! ## Authentication
//!
//! A random API key is generated on `brain init` and printed to stdout.
//! Configure additional keys (and their permission scopes) under
//! `access.api_keys[]` in the config; `admin` is treated as an implicit
//! superset of every other scope. Webhook endpoints accept a verifier
//! (HMAC or Ed25519) as an alternative to Bearer auth — see
//! `adapters.http.webhook_verifiers` in the config.
// Re-export primary public types for convenience.
pub use ;
pub use AppState;
pub use HttpAdapterError;