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
use Value;
use HashMap;
use Arc;
/// Minimal session context for JSON-RPC handlers.
///
/// Provides basic session information without imposing a transport.
/// Designed to be passed by value (it is `Clone`) into handlers.
///
/// ## Field semantics
///
/// - `session_id`: opaque session identifier; format is caller's choice.
/// - `metadata`: free-form key/value bag, persisted by the caller's
/// session storage if any.
/// - `broadcaster`: optional type-erased back-channel installed by the
/// transport. Stored as `Arc<dyn Any + Send + Sync>` so this crate does
/// not depend on any specific notification channel implementation.
/// Downstream code (e.g. an MCP server) downcasts to its own concrete
/// type.
/// - `timestamp`: Unix milliseconds when the context was created.
/// - `extensions`: request-scoped key/value bag for auth claims, middleware
/// data, etc. Populated by the transport layer; never persisted.