export { ConnectionManager, type SocketLike } from './connection.js'; export { ChatStore } from './store.js'; export { PersistentOutbox } from './outbox.js'; export { E2ESession } from './e2e.js'; export { restoreHistory, resolveRelayUrls, httpBaseFromWsUrl } from './history.js'; export { mountChatList, type ChatListEntry, type ChatListHandle, type ChatListOptions } from './chatlist.js'; export { persistentUid } from './uid.js'; export * from './protocol/index.js'; import { ChatStore } from './store.js'; import type { ConversationId, UserId } from './protocol/index.js'; export interface RelayClientOptions { /** Relay URL — ONE url, any scheme. `https://api.relay.paramms.com` is the * recommended form; the WebSocket URL (`wss://…/ws`) and REST base are * derived from it automatically. `wss://`/`ws://`/`http://` also accepted. */ url: string; /** HTTP(S) base for REST calls — only when the REST API lives on a * DIFFERENT origin than the socket. Normally omit. * @deprecated pass a single `url`; kept for back-compat. */ apiUrl?: string; /** Identity: a signed JWT (secure), a stable userId (host-vouched), or omit * for an anonymous per-browser guest (browser environments only). */ token?: string; /** Chatroom id (from the dashboard). Required to open conversations. */ profileId: string; } export interface OpenOptions { /** Support thread scoped to a subject (listing/order/…): one thread per * (user, subject). Omit for the profile's single support thread. */ subjectId?: string; subjectTitle?: string; /** User↔user conversation (requires the chatroom to have signed identity * and `token` to be a valid signed JWT). */ kind?: 'direct'; peerId?: string; /** Display info persisted for agents (support threads only). */ user?: { name?: string; email?: string; avatar?: string; meta?: Record; }; } /** One conversation = one connection + one store. Deliberately thin: the * store is the source of truth, `onChange` is the render signal, everything * else is the same primitives the first-party UIs use. */ export declare class RelayConversation { readonly store: ChatStore; private readonly conn; private readonly listeners; private msgSeq; private _status; private _statusMessage; constructor(opts: RelayClientOptions & OpenOptions & { me: UserId; }); /** Subscribe to any change (message, typing, status). Returns unsubscribe. */ onChange(fn: () => void): () => void; private emit; private _me; /** Our canonical user id as resolved by the server (JWT sub / userId / anon id). */ get me(): UserId | undefined; get conversationId(): ConversationId | undefined; get status(): string; get statusMessage(): string | undefined; send(text: string): void; typing(isTyping: boolean, preview?: string): void; markRead(): void; close(): void; } export declare class RelayClient { private readonly opts; constructor(opts: RelayClientOptions); /** The identity this client will act as: the token's subject (resolved * server-side), the raw userId, or a persistent anonymous browser id. */ me(): UserId; open(open?: OpenOptions): RelayConversation; }