Skip to main content

plexus_core/plexus/
mod.rs

1// Guidance system removed during caller-wraps streaming architecture refactor
2// pub mod guidance;
3
4pub mod auth;
5/// AUTH-5: the `auth` activation and what a service supplies it.
6pub mod auth_activation;
7pub mod auth_params;
8/// AUTH-5: a reference in-memory backend and stores for the `auth` activation.
9pub mod auth_memory;
10pub mod test_validator;
11/// MACRO-20: a hub sees through its activations' static children.
12pub mod children;
13pub mod context;
14/// NEST-21: a service's configuration at runtime — settings, the library,
15/// the `config` activation.
16pub mod config;
17// RETURNS-10: canonical schema JSON and the SHA-256/16 hash every schema hash is.
18pub mod content_hash;
19pub mod credential_envelope;
20pub mod dispatch;
21/// BIDIR-8 (BIDIR-5's rule): the gate over a duplex call — open, admit,
22/// re-verify on the gate's grants generation, answer, audit.
23pub mod duplex_gate;
24pub(crate) mod held;
25pub mod errors;
26pub mod forward_registry;
27/// AUTH-2: the grant gate in dispatch, and the task-local reach.
28pub mod grant_gate;
29pub mod hub_context;
30/// RETURNS-40: the IR a service writes of itself — IR 3.0, as synapse builds it.
31pub mod ir;
32// MACRO-2.B3: the in-process transport for the macro-generated typed client.
33pub mod in_process;
34/// BIDIR-6: `Input<T>`, the input half of a call.
35pub mod input;
36/// LOCAL-6: a whole hub, called in memory.
37pub mod hub_transport;
38pub mod method_enum;
39pub mod middleware;
40pub mod parent;
41pub mod path;
42pub mod plexus;
43/// DYNAUTH-8: frame logs never carry a credential.
44pub mod redact;
45/// DYNAUTH-12: tokens a service signs for the peers it forwards calls to.
46#[cfg(not(target_arch = "wasm32"))]
47pub mod peer_token;
48// POLYGLOT-5: the child seam's second implementation — a process or a socket.
49// PLEXUS-45: native only. A browser has no processes, and a ws child waits
50// for a browser-WebSocket transport (a later ticket); on wasm32 the module
51// would compile to a child with no way to reach it.
52#[cfg(not(target_arch = "wasm32"))]
53pub mod remote_child;
54pub mod schema;
55// NEST-11: which service a call is routed in.
56pub mod service_scope;
57/// NEST-15: the service root — a table of peers answered by `peer(name)`.
58pub mod service_root;
59/// NEST-5: slot types and slot grants.
60pub mod slots;
61/// NEST-7: the primitive — an activation returns an activation.
62pub mod peer;
63mod schema_sites;
64pub(crate) mod scope_gate;
65pub mod streaming;
66pub mod types;
67/// AUTH-4: the caller's view of a gated hub.
68pub mod view;
69/// PERF-7: the item path — each item encoded once, straight into the frame
70/// its socket writes.
71pub mod wire;
72
73// AuthContext + SessionValidator + the sealed Principal / VerifiedUser /
74// ServiceIdentity types are re-exported from plexus-auth-core via
75// plexus::auth. New code should import directly from plexus_auth_core.
76pub use auth::{AuthContext, Principal, ServiceIdentity, SessionValidator, VerifiedUser, Anonymous, CallSite, ForwardDerivation, ForwardPolicy, ForwardPolicyName, IdentityOnly, MethodPath, MethodPathError, PassThrough, ANONYMOUS_NAME, IDENTITY_ONLY_NAME, PASS_THROUGH_NAME};
77pub use test_validator::TestSessionValidator;
78pub use context::PlexusContext;
79pub use in_process::InProcessTransport;
80pub use input::{Delivered, Input, InputTable};
81pub use hub_transport::HubTransport;
82#[cfg(not(target_arch = "wasm32"))]
83pub use remote_child::{check_ws_url, is_loopback_host, Backoff, ChildError, ChildMethods, ChildOptions, ChildSpec, ChildStats, Consented, MountTimings, PeerIdentity, RemoteChild};
84#[cfg(all(feature = "clap", not(target_arch = "wasm32")))]
85pub use remote_child::ChildArgs;
86#[deprecated(note = "Use GuidanceErrorType and GuidanceSuggestion from stream events instead")]
87pub use errors::{GuidedError, GuidedErrorData, TryRequest};
88pub use forward_registry::{ForwardPolicyRegistry, SameService, SAME_SERVICE_NAME};
89pub use grant_gate::{current_reach, require_everywhere, with_reach, ForbiddenItem};
90pub use view::View;
91pub use service_scope::WeakService;
92pub use service_root::{RootError, ServiceRoot};
93pub use peer::{Contract, FindPeer, Interface, ListPeers, Peer, PeerError, PeerRouter, PeerSlot, PeerTransport, RouterPeer, Stamp};
94pub use auth_activation::{
95    AuthActivation, AuthBackend, AuthClient, AuthEvent, AuthFailure, AuthSetup, LoginAnswer, LoginFlow, MembershipEntry, MembershipStore,
96    Provider, ProviderKind, Requirement, RoleStore, Session, SignupAnswer, StoreError, Waiting, SIGNED_IN_GRANTS,
97};
98pub use auth_memory::{MemoryAuthBackend, MemoryMemberships, MemoryRoles};
99// AUTH-2: the grant model, re-exported so an activation needs only plexus-core.
100pub use plexus_auth_core::grants::{
101    Ceiling, Gate, Grant, GrantSet, Membership, Memberships, Reach, Refusal, Resolve, RoleOrGrant,
102    RoleTable, Roles, ScopeRef, ADMIN, CEILING_KEY,
103};
104#[deprecated(note = "Middleware removed - guidance provided via PlexusStreamEvent::Guidance")]
105pub use middleware::{ActivationRegistry, GuidedErrorMiddleware};
106pub use path::Provenance;
107#[allow(deprecated)]
108pub use plexus::{error_item, Activation, ActivationInfo, AuthzDenyReason, ChildCapabilities, ChildRouter, DynamicHub, PlexusError, TransportErrorKind, plexus_error_to_jsonrpc, route_to_child, PLEXUS_NOTIF_METHOD};
109// RETURNS-6: the wire's typed call failure, re-exported so server code (and
110// the code `#[activation]` emits) names it through plexus-core.
111pub use plexus_client::{DenyReason, ParamProblem, RemoteError};
112// RETURNS-8: a method's progress vocabulary, named by the code
113// `#[plexus_macros::method]` emits (the default `P` of `Progress<T>` is `Note`).
114pub use plexus_client::{Note, Progress};
115pub use crate::types::Handle;
116pub use schema::{
117    AuthPosture, Cardinality, ChildHashes, ChildSummary, DeprecationInfo, MethodExample, MethodRole,
118    MethodSchema, ParamSchema, PluginHashes, PluginSchema, RequiredCredential, Schema,
119    Need, SchemaParams, SchemaProperty, SchemaResult, SchemaType, ViewKind, JSON_TYPES,
120    X_PLEXUS_VALUES,
121};
122pub use types::{PlexusStreamItem, StreamMetadata};
123pub use wire::Shared;
124pub use method_enum::MethodEnumSchema;
125pub use streaming::{PlexusStream, wrap_stream, error_stream, done_stream, progress_stream};
126// RETURNS-8: one wrapper per signature form (`wrap_stream` is the plain-T stream's).
127pub use streaming::{wrap_one, wrap_one_result, wrap_result_stream, wrap_progress_stream, wrap_result_progress_stream};
128// Note: Method enum is auto-generated by hub_macro and exported from plexus module
129pub use dispatch::{HubDispatch, StreamItem, from_dispatch_stream};
130pub use crate::request::PlexusRequestField;
131pub use hub_context::{HubContext, ParentAware, NoParent};
132// NEST-16: a graft that knows its parent.
133pub use parent::{NeedsMiss, Notice, Parent, ParentTransport, Upward, UpwardError};