Package-level declarations

Types

Link copied to clipboard
class InMemorySocketStore(maxConnections: Int = DEFAULT_MAX_CONNECTIONS, maxMessagesPerConnection: Int = DEFAULT_MAX_MESSAGES_PER_CONNECTION) : SocketStore

Bounded, thread-safe in-memory store for socket lifecycle and redacted frame previews.

Link copied to clipboard

MQTT topic/qos/retained metadata carried in SocketMessage.contentType rather than as new fields on SocketMessage -- see the design spec's "MQTT capture reuses the socket pipeline" section. The encoding is hand-rolled and dependency-free (no JSON/URL-encoding library pulled into sdk:socket just for this): "application/mqtt; topic=<enc>; qos=<n>; retained=<bool>", where <enc> escapes only the three characters that would otherwise break this format's own delimiters.

Link copied to clipboard
data class SocketConnection(val id: String, val url: String, val openedAtEpochMs: Long, val closedAtEpochMs: Long? = null, val state: SocketConnectionState = SocketConnectionState.OPEN, val error: String? = null, val reconnectAttempt: Int = 0, val messages: List<SocketMessage> = emptyList(), val protocol: SocketProtocol = SocketProtocol.WEBSOCKET)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class SocketLifecycleEvent(val connectionId: String, val type: SocketLifecycleType, val timestampEpochMs: Long, val code: Int? = null, val reason: String? = null, val error: String? = null)
Link copied to clipboard
data class SocketMessage(val connectionId: String, val direction: SocketDirection, val timestampEpochMs: Long, val payload: SocketPayload, val contentType: String? = null)
Link copied to clipboard
data class SocketMessageMetadata(val frameType: SocketFrameType = SocketFrameType.TEXT, val textFormat: SocketTextFormat = SocketTextFormat.TEXT)
Link copied to clipboard
data class SocketMessageQuery(val connectionIds: Set<String> = emptySet(), val directions: Set<SocketDirection> = emptySet(), val frameTypes: Set<SocketFrameType> = emptySet(), val fromEpochMs: Long? = null, val toEpochMs: Long? = null, val query: String? = null, val hasError: Boolean? = null)
Link copied to clipboard
sealed interface SocketPayload
Link copied to clipboard

Discriminates the wire protocol a SocketConnection carries -- plain WebSocket vs MQTT.

Link copied to clipboard
class SocketRecorder(redaction: RedactionEngine, store: SocketStore, enabled: Boolean = true, clock: () -> Long = System::currentTimeMillis)

Manual socket capture API. Every method is fail-open so host socket behavior remains isolated. When enabled is false, every method returns immediately without redacting or touching store.

Link copied to clipboard
interface SocketStore
Link copied to clipboard