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
53
54
55
56
57
58
59
60
61
//! Server-side types for the cell-based Myko server.
//!
//! This module contains the tokio-free server types:
//! - `MykoServerContext` — server context for queries, reports, and event publishing
//! - `HandlerRegistry` — registry of item/query/report handlers from inventory
//! - `ClientRegistry` — global WebSocket client writer registry
//! - `ClientSession` — per-connection subscription management
//! - `RelationshipManager` — cascade operations for entity relationships
//! - `Persister` trait — abstraction for event persistence
//! - Protocol serialization helpers
//!
//! The full server runtime (WebSocket accept loop, Postgres, peer registry) lives
//! in the `myko-server` crate.
//!
//! # wasm32
//!
//! This module *compiles* for wasm32 so that `core::capability` can be
//! target-independent — every handler capability reads through
//! `ServerScoped::__server_ctx()`, so a native-only `MykoServerContext` would
//! force a `#[cfg]` onto every capability and, transitively, onto every
//! hand-written handler in consumer entity crates (which do compile to wasm32
//! via the leptos UI cdylibs). Compiling here is what keeps that boilerplate
//! out of consumer apps.
//!
//! It is NOT expected to *run* there. A few call sites compile on wasm32 but
//! panic if executed — `thread::spawn`/`thread::sleep` in `context.rs`
//! (ingest-buffer flush window), `report_cache_stats.rs` and
//! `entity_set_stats.rs` (periodic stats windows), and `Instant::now()` in
//! `persister.rs` and `client_session.rs` (no monotonic clock on
//! wasm32-unknown-unknown). Nothing reaches them today, because constructing a
//! `MykoServerContext` needs a persister and handler registry that no wasm
//! build sets up. If server code ever genuinely runs on wasm, these are the
//! sites to fix first: the timers want a `spawn_after` shim and the clocks
//! want `web_time::Instant`.
pub use ;
pub use ;
pub use Origin;
pub use ;
pub use HandlerRegistry;
pub use ;
pub use ;
pub use ;
pub use RelationshipManager;