Skip to main content

liminal_sdk/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3extern crate alloc;
4
5pub mod channel;
6pub mod connection;
7pub mod conversation;
8pub mod embedded;
9pub mod error;
10pub mod pressure;
11pub mod remote;
12pub mod types;
13
14pub use channel::ChannelHandle;
15pub use connection::{
16    ConnectionEvent, ConnectionEvents, ConnectionLifecycle, ConnectionPool, ConnectionPoolConfig,
17    ConnectionState, DisconnectReason, PoolConnectionId, ResumeRequest, SubscriptionAssignment,
18    SubscriptionId, SubscriptionRecovery,
19};
20pub use conversation::{ConversationEvent, ConversationHandle, ConversationId};
21pub use embedded::{EmbeddedChannelHandle, EmbeddedConfig, EmbeddedConversationHandle};
22pub use error::SdkError;
23#[cfg(feature = "std")]
24pub use liminal::protocol::ProtocolVersion;
25pub use pressure::{DeliveryAck, PressureResponse};
26#[cfg(all(feature = "std", unix))]
27pub use remote::ReadWake;
28pub use remote::{
29    CredentialAttachReissueReason, LostCredentialAttachRefusalReason, PARTICIPANT_PUMP_WINDOW,
30    ParticipantPumpDiagnostics, ParticipantResponseProvenance, ParticipantResumeStore,
31    RecordAdmissionFate, RemoteChannelHandle, RemoteConfig, RemoteConversationHandle,
32    RemoteCredentialAttachRecovery, RemoteDetachReplayOutcome, RemoteExpectedOperationRecovery,
33    RemoteLostOperationResolution, RemoteLostReconnectResolution, RemoteOperationRecordOutcome,
34    RemoteOperationTransportFate, RemoteParticipantError, RemoteParticipantHandle,
35    RemoteParticipantInbound, RemoteParticipantOperation, RemoteParticipantSendOutcome,
36    RemoteReconnectAttemptOutcome, RemoteReconnectPermit, RemoteReconnectPermitOutcome,
37    RemoteReconnectPermitRecovery, RemoteReplayApplyOutcome, RemoteTransportLossOutcome,
38    SdkChannelHandle, SdkConfig, SdkConversationHandle, ServerAddress, build_channel_handle,
39    build_conversation_handle,
40};
41#[cfg(feature = "std")]
42pub use remote::{
43    DEFAULT_PUSH_MAILBOX_BYTES, DEFAULT_PUSH_MAILBOX_FRAMES, DEFAULT_SUBSCRIPTION_MAILBOX_BYTES,
44    DEFAULT_SUBSCRIPTION_MAILBOX_FRAMES, DeliveredMessage, FlushMode, FlushOutcome,
45    MailboxOverflow, MailboxStats, OBSERVABILITY_CHANNEL, PublishRejection, PushClient,
46    PushCloseCause, PushReceiveOutcome, PushReceiver, PushWriter, PushedFrame, SubscriptionStream,
47    WebSocketDeliveredMessage, WebSocketRemoteTransport, WebSocketSubscriptionStream,
48};
49pub use types::{SchemaMetadata, SchemaValidate};
50
51/// Frames a Lys pass token as the credential a `Connect` carries.
52///
53/// ACCESS-001 R2: the Lys record tag, then the token exactly as Lys issued
54/// it. A `WirePassV1` keeps its own record; the two are never combined.
55#[must_use]
56pub fn lys_pass_credential(token: &str) -> Vec<u8> {
57    liminal_protocol::credential::WireCredential::lys_record(token.trim().as_bytes())
58}