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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
//! # Plexus RPC — umbrella crate
//!
//! The single dependency to add when building a Plexus backend. Re-exports
//! the verified-compatible subcrate set:
//!
//! - [`auth_core`] — sealed identity, credential, tenant, forwarding, and audit
//! primitives (`plexus-auth-core`).
//! - [`core`] — `DynamicHub`, dispatch, `MethodSchema`, the `Activation` trait,
//! credential wire envelope, ChildRouter (`plexus-core`).
//! - [`macros`] — procedural macros for activations, methods, child routers,
//! credentials, and auth resolvers (`plexus-macros`).
//! - [`transport`] (feature `transport`, on by default) — WebSocket / HTTP / SSE
//! server runtime (`plexus-transport`).
//!
//! ## Why one crate
//!
//! Tracking three or four subcrate version bumps across coordinated releases is
//! error-prone. Depending on `plexus-rpc` pins the whole set at once:
//!
//! ```toml
//! [dependencies]
//! plexus-rpc = "0.1"
//! ```
//!
//! ## Capability manifest
//!
//! Backends embed [`CAPABILITIES`] in their `_info` response so generic clients
//! (synapse CLI, generated SDKs, agents) can negotiate features instead of
//! guessing from version strings. The manifest names every bundled subcrate
//! version plus a list of named feature flags shipped in this release. See
//! `plans/UMB/UMB-3.md` for the full design.
//!
//! ## Doc-comment example (current canonical shape)
//!
//! ```ignore
//! use plexus_rpc::macros::{activation, method};
//!
//! pub struct Echo;
//!
//! #[activation(namespace = "echo", version = "1.0.0")]
//! impl Echo {
//! /// Echo a message back the specified number of times.
//! #[method]
//! async fn echo(
//! &self,
//! /// The message to echo
//! message: String,
//! /// Number of times to repeat
//! count: u32,
//! ) -> impl futures::Stream<Item = EchoEvent> + Send + 'static {
//! async_stream::stream! {
//! for _ in 0..count {
//! yield EchoEvent::Echo { message: message.clone() };
//! }
//! }
//! }
//! }
//! ```
/// Plexus RPC umbrella crate version, populated at compile time.
pub const VERSION: &str = env!;
// ---------------------------------------------------------------------------
// Subcrate re-exports.
// ---------------------------------------------------------------------------
/// Sealed identity, credential, tenant, forwarding, and audit primitives.
///
/// Re-export of the `plexus-auth-core` crate. The types here are
/// structurally sealed — third crates cannot fabricate `AuthContext`,
/// `Principal`, `Credential<T>`, `Tenant`, etc. Construction is the
/// framework's responsibility; activation code only ever receives sealed
/// references.
pub use plexus_auth_core as auth_core;
/// Core dispatch and schema machinery.
///
/// Re-export of the `plexus-core` crate. Contains `DynamicHub`,
/// `Activation`, `MethodSchema`, the credential wire envelope, the
/// `ChildRouter` trait, and the `with_auth_capabilities` / `with_forward_policy`
/// hub builders.
pub use plexus_core as core;
/// Procedural macros for activations, methods, child routers, credentials,
/// and auth resolvers.
///
/// Re-export of the `plexus-macros` crate. The canonical entry points are
/// `#[plexus_rpc::macros::activation(...)]` on an `impl` block,
/// `#[plexus_rpc::macros::method]` on each method, and
/// `#[derive(plexus_rpc::macros::Credentials)]` on credential-bearing
/// return types.
pub use plexus_macros as macros;
/// WebSocket / HTTP / SSE server runtime (feature `transport`, default on).
///
/// Re-export of the `plexus-transport` crate. Drop the `transport` feature
/// when building embedded / ahead-of-time codegen / WASM consumers that
/// only need the type and dispatch surface.
pub use plexus_transport as transport;
// ---------------------------------------------------------------------------
// Capability manifest (UMB-3).
// ---------------------------------------------------------------------------
/// Compile-time capability manifest describing the subcrate versions and
/// feature flags bundled in this release of `plexus-rpc`.
///
/// Backends embed [`CAPABILITIES`] in their `_info` response. Synapse +
/// synapse-cc decode it and branch on `features` rather than version
/// strings, so adding a new feature is one entry on this struct and one
/// branch in tooling — no version-string parsing involved.
///
/// `Capabilities` is **emit-only** — it holds `&'static` slices so it can
/// be a `const`, which precludes `Deserialize`. Consumers should mirror
/// the wire shape in their own owning struct.
/// The canonical compile-time capability manifest for this build of
/// `plexus-rpc`.
///
/// Backends embed this in their `_info` payload so tooling (synapse,
/// synapse-cc, generated SDKs) can branch on capability rather than
/// inferring features from subcrate version strings.
pub const CAPABILITIES: Capabilities = Capabilities ;
/// The named feature flags this release of `plexus-rpc` advertises. Tooling
/// (synapse, synapse-cc, generated SDKs) branches on these strings rather
/// than parsing version numbers. New features get added to this list as
/// they land.
///
/// Current entries reflect wave 2 (May 2026) of the AUTHZ epic:
///
/// - `"auth_capabilities"` — backend advertises auth mechanisms at `_info`
/// (AUTHZ-CORE-3).
/// - `"forward_policy"` — per-namespace `ForwardPolicy` consulted on every
/// cross-boundary call (AUTHLANG-2 + AUTHLANG-3).
/// - `"credentials"` — `Credential<T>` wire envelope (sentinel + sidecar)
/// with `MethodSchema` projection (AUTHZ-CRED-CORE-1, -2, -3 +
/// `#[derive(Credentials)]`).
/// - `"tenant"` — sealed `Tenant` identity + `ClaimTenantResolver` +
/// `Tenanted<S>` storage wrapper (AUTHZ-DATA-1-TYPES + WRAPPER).
/// - `"audit"` — `AuditRecord` + `AuditSink` primitives + `TracingAuditSink`
/// default (AUTHZ-PRIVACY-1).
/// - `"doc_comments"` — `///` on function and parameters feeds the schema
/// (AUTHZ-MACRO-PARAM-DOC-1).
/// - `"optional_auth"` — `auth: Option<&AuthContext>` codegen support
/// (AUTHZ-MACRO-OPTIONAL-AUTH-1).
const FEATURES: & = &;