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;
11pub mod bidirectional;
12/// MACRO-20: a hub sees through its activations' static children.
13pub mod children;
14pub mod context;
15// RETURNS-10: canonical schema JSON and the SHA-256/16 hash every schema hash is.
16pub mod content_hash;
17pub mod credential_envelope;
18pub mod dispatch;
19/// BIDIR-8 (BIDIR-5's rule): the gate over a duplex call — open, admit,
20/// re-verify on the gate's grants generation, answer, audit.
21pub mod duplex_gate;
22pub mod errors;
23pub mod forward_registry;
24/// AUTH-2: the grant gate in dispatch, and the task-local reach.
25pub mod grant_gate;
26pub mod hub_context;
27/// RETURNS-40: the IR a service writes of itself — IR 3.0, as synapse builds it.
28pub mod ir;
29// MACRO-2.B3: the in-process transport for the macro-generated typed client.
30pub mod in_process;
31/// BIDIR-6: `Input<T>`, the input half of a call.
32pub mod input;
33/// LOCAL-6: a whole hub, called in memory.
34pub mod hub_transport;
35pub mod method_enum;
36pub mod middleware;
37pub mod path;
38pub mod plexus;
39// POLYGLOT-5: the child seam's second implementation — a process or a socket.
40pub mod remote_child;
41pub mod schema;
42mod schema_sites;
43pub(crate) mod scope_gate;
44pub mod streaming;
45pub mod types;
46/// AUTH-4: the caller's view of a gated hub.
47pub mod view;
48/// PERF-7: the item path — each item encoded once, straight into the frame
49/// its socket writes.
50pub mod wire;
51
52// AuthContext + SessionValidator + the sealed Principal / VerifiedUser /
53// ServiceIdentity types are re-exported from plexus-auth-core via
54// plexus::auth. New code should import directly from plexus_auth_core.
55pub use auth::{AuthContext, Principal, ServiceIdentity, SessionValidator, VerifiedUser, Anonymous, CallSite, ForwardDerivation, ForwardPolicy, ForwardPolicyName, IdentityOnly, MethodPath, MethodPathError, PassThrough, ANONYMOUS_NAME, IDENTITY_ONLY_NAME, PASS_THROUGH_NAME};
56pub use test_validator::TestSessionValidator;
57pub use bidirectional::{BidirChannel, BidirError, SelectOption, StandardBidirChannel, StandardRequest, StandardResponse};
58pub use context::PlexusContext;
59pub use in_process::InProcessTransport;
60pub use input::{Delivered, Input, InputTable};
61pub use hub_transport::HubTransport;
62pub use remote_child::{Backoff, ChildError, ChildMethods, ChildOptions, ChildSpec, ChildStats, MountTimings, RemoteChild};
63#[cfg(feature = "clap")]
64pub use remote_child::ChildArgs;
65#[deprecated(note = "Use GuidanceErrorType and GuidanceSuggestion from stream events instead")]
66pub use errors::{GuidedError, GuidedErrorData, TryRequest};
67pub use forward_registry::{ForwardPolicyRegistry, SameService, SAME_SERVICE_NAME};
68pub use grant_gate::{current_reach, with_reach, ForbiddenItem};
69pub use view::View;
70pub use auth_activation::{
71    Auth, AuthActivation, AuthBackend, AuthClient, AuthEvent, AuthFailure, AuthSetup, LoginAnswer, LoginFlow, MembershipEntry, MembershipStore,
72    Provider, ProviderKind, Requirement, RoleStore, Session, SignupAnswer, StoreError, Waiting, SIGNED_IN_GRANTS,
73};
74pub use auth_memory::{MemoryAuthBackend, MemoryMemberships, MemoryRoles};
75// AUTH-2: the grant model, re-exported so an activation needs only plexus-core.
76pub use plexus_auth_core::grants::{
77    Ceiling, Gate, Grant, GrantSet, Membership, Memberships, Reach, Refusal, Resolve, RoleOrGrant,
78    RoleTable, Roles, ScopeRef, ADMIN, CEILING_KEY,
79};
80#[deprecated(note = "Middleware removed - guidance provided via PlexusStreamEvent::Guidance")]
81pub use middleware::{ActivationRegistry, GuidedErrorMiddleware};
82pub use path::Provenance;
83#[allow(deprecated)]
84pub use plexus::{error_item, Activation, ActivationInfo, AuthzDenyReason, ChildCapabilities, ChildRouter, DynamicHub, PlexusError, TransportErrorKind, plexus_error_to_jsonrpc, route_to_child, PLEXUS_NOTIF_METHOD};
85// RETURNS-6: the wire's typed call failure, re-exported so server code (and
86// the code `#[activation]` emits) names it through plexus-core.
87pub use plexus_client::{DenyReason, ParamProblem, RemoteError};
88// RETURNS-8: a method's progress vocabulary, named by the code
89// `#[plexus_macros::method]` emits (the default `P` of `Progress<T>` is `Note`).
90pub use plexus_client::{Note, Progress};
91pub use crate::types::Handle;
92pub use schema::{
93    AuthPosture, Cardinality, ChildHashes, ChildSummary, DeprecationInfo, MethodExample, MethodRole,
94    MethodSchema, ParamSchema, PluginHashes, PluginSchema, RequiredCredential, Schema,
95    SchemaParams, SchemaProperty, SchemaResult, SchemaType, ViewKind, JSON_TYPES,
96    X_PLEXUS_VALUES,
97};
98pub use types::{PlexusStreamItem, StreamMetadata};
99pub use wire::Shared;
100pub use method_enum::MethodEnumSchema;
101pub use streaming::{PlexusStream, wrap_stream, wrap_stream_with_bidir, create_bidir_stream, error_stream, done_stream, progress_stream};
102// RETURNS-8: one wrapper per signature form (`wrap_stream` is the plain-T stream's).
103pub use streaming::{wrap_one, wrap_one_result, wrap_result_stream, wrap_progress_stream, wrap_result_progress_stream};
104// Note: Method enum is auto-generated by hub_macro and exported from plexus module
105pub use dispatch::{HubDispatch, StreamItem, from_dispatch_stream};
106pub use crate::request::PlexusRequestField;
107pub use hub_context::{HubContext, ParentAware, NoParent};