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