Package-level declarations

Types

Link copied to clipboard
sealed interface BodyPreview
Link copied to clipboard
data class CaptureBodyMetadata(val declaredLength: Long? = null, val capturedBytes: Int = 0, val truncated: Boolean = false, val omittedReason: String? = null)
Link copied to clipboard
data class CapturedRequest(val method: String, val url: NetworkUrl, val headers: Map<String, String>, val body: BodyPreview, val contentType: String?, val correlationId: String?, val pluginId: String)
Link copied to clipboard
data class CapturedRequestMetadata(val threadName: String? = null, val body: CaptureBodyMetadata, val tags: Map<String, String> = emptyMap())
Link copied to clipboard
data class CapturedResponse(val statusCode: Int, val headers: Map<String, String>, val body: BodyPreview, val contentType: String?, val protocol: String?, val error: String?)
Link copied to clipboard
data class CapturedResponseMetadata(val body: CaptureBodyMetadata, val timings: NetworkTimingPhases = NetworkTimingPhases(), val fromCache: Boolean = false, val exceptionClass: String? = null)
Link copied to clipboard
sealed interface ExportSelection

Shared selection of which captured network transactions an export (HAR, Postman) should include. Declared once here -- rather than separately in sdk:server-ktor and sdk:full -- so the browser export routes and the Android in-app exporter can never select a different set of rows for what a caller intends to be the same export. Mirrors the shape of io.devconsole.export.ExportScope (whole/time-range/explicit-ids), which plays the same role for timeline-event ZIP exports; the two are kept as separate types because they select over different id spaces (transaction ids here, event ids there), not because the selection dimensions differ.

Link copied to clipboard
class InMemoryNetworkTransactionStore(cursorCodec: NetworkCursorCodec, maxTransactions: Int = DEFAULT_MAX_TRANSACTIONS) : NetworkTransactionStore

Bounded, thread-safe transaction store for the live network inspector.

Link copied to clipboard
class NetworkAttachmentPayload(val transactionId: String, val role: NetworkAttachmentRole, val contentType: String, bytes: ByteArray, val originalLength: Long, val truncated: Boolean)

A bounded body copy that has already passed through capture-time redaction. The byte array returned by bytes is defensive so an integration cannot mutate another sink's payload.

Link copied to clipboard

Which side of an HTTP exchange owns a persisted payload attachment.

Link copied to clipboard
fun interface NetworkAttachmentSink

Persists already-redacted payloads on the recorder's background worker.

Link copied to clipboard
data class NetworkCapture(val request: CapturedRequest, val response: CapturedResponse?)
Link copied to clipboard
data class NetworkCaptureContext(val tags: Map<String, String> = emptyMap())

Adapter-neutral metadata that integrations attach without mutating outgoing HTTP headers.

Link copied to clipboard
class NetworkCaptureFactory(redaction: RedactionEngine, limits: NetworkCaptureLimits = NetworkCaptureLimits())
Link copied to clipboard
fun interface NetworkCaptureGate

Consulted before a transaction is queued for capture, so an excluded request is never redacted, serialized, persisted, or exported. Implementations must be cheap and side-effect free: they run on the caller's (host application) thread.

Link copied to clipboard
data class NetworkCaptureLimits(val requestBodyPreviewBytes: Int = 256 * 1024, val responseBodyPreviewBytes: Int = 512 * 1024, val maxHeaderCount: Int = 100, val maxHeaderValueChars: Int = 16 * 1024)
Link copied to clipboard

Signed, scope-bound cursor so a cursor cannot be reused with different filters.

Link copied to clipboard

Exports captured network transactions. Inputs are NetworkCapture values rather than raw requests, so all output is constrained to the capture pipeline's redacted fields.

Link copied to clipboard
data class NetworkRequestInput(val method: String, val url: String, val headers: Map<String, String> = emptyMap(), val body: ByteArray? = null, val contentType: String? = null, val correlationId: String? = null, val pluginId: String = "network")
Link copied to clipboard
data class NetworkRequestMetadata(val threadName: String? = null, val bodyLength: Long? = null, val bodyOmittedReason: String? = null, val tags: Map<String, String> = emptyMap())
Link copied to clipboard
data class NetworkResponseInput(val statusCode: Int, val headers: Map<String, String> = emptyMap(), val body: ByteArray? = null, val contentType: String? = null, val protocol: String? = null, val error: String? = null)
Link copied to clipboard
data class NetworkResponseMetadata(val bodyLength: Long? = null, val bodyOmittedReason: String? = null, val timings: NetworkTimingPhases = NetworkTimingPhases(), val fromCache: Boolean = false, val exceptionClass: String? = null)
Link copied to clipboard
data class NetworkTimingPhases(val dnsMs: Long? = null, val connectMs: Long? = null, val tlsMs: Long? = null, val sendMs: Long? = null, val waitMs: Long? = null, val receiveMs: Long? = null)
Link copied to clipboard
data class NetworkTransaction(val id: String, val startedAtEpochMs: Long, val completedAtEpochMs: Long?, val capture: NetworkCapture)
Link copied to clipboard
data class NetworkTransactionFilters(val fromEpochMs: Long? = null, val toEpochMs: Long? = null, val paths: Set<String> = emptySet(), val contentTypes: Set<String> = emptySet(), val minDurationMs: Long? = null, val maxDurationMs: Long? = null, val statusFrom: Int? = null, val statusTo: Int? = null, val hasError: Boolean? = null, val tags: Map<String, String> = emptyMap(), val query: String? = null)
Link copied to clipboard
data class NetworkTransactionPage(val transactions: List<NetworkTransaction>, val nextCursor: String?, val hasMore: Boolean, val invalidCursor: Boolean = false)
Link copied to clipboard
data class NetworkTransactionQuery(val limit: Int = DEFAULT_PAGE_LIMIT, val cursor: String? = null, val methods: Set<String> = emptySet(), val hosts: Set<String> = emptySet(), val statuses: Set<Int> = emptySet(), val correlationId: String? = null)
Link copied to clipboard
class NetworkTransactionRecorder(factory: NetworkCaptureFactory, store: NetworkTransactionStore, enabled: Boolean = true, idProvider: () -> String = { UUID.randomUUID().toString() }, maxQueueSize: Int = DEFAULT_MAX_QUEUE_SIZE, executor: Executor = DEFAULT_EXECUTOR, maxQueuedBytes: Long = DEFAULT_MAX_QUEUED_BYTES)

Bridges redacted capture to the bounded transaction store without affecting host behavior. When enabled is false, record returns immediately without building a capture or touching store — the disabled build never redacts, serializes, or stores a payload. Processing (URL parsing, redaction, and store persistence) is offloaded asynchronously from caller threads via a bounded queue (drop-oldest strategy on overflow).

Link copied to clipboard
Link copied to clipboard
data class NetworkUrl(val scheme: String, val host: String, val path: String, val query: Map<String, String>)

Functions

Link copied to clipboard
fun isTextualContentType(contentType: String?): Boolean

Whether contentType identifies a body worth treating as text. Shared with the OkHttp/Ktor adapter modules so a response (or request) body is never buffered into memory on the host's calling thread only to be discarded here as binary -- adapters call this before reading any bytes to decide whether reading is worth doing at all. NetworkCaptureFactory itself still runs the same check (plus a UTF-8 decodability fallback for a body an adapter did read despite an absent content-type) once bytes are actually in hand.

Link copied to clipboard
fun NetworkTransactionStore.resolveExportSelection(selection: ExportSelection, baseQuery: NetworkTransactionQuery = NetworkTransactionQuery(limit = NetworkTransactionQuery.MAX_PAGE_LIMIT)): List<NetworkTransaction>?

Resolves selection against this store, bounded to NetworkTransactionQuery.MAX_PAGE_LIMIT rows. baseQuery supplies any additional filters (method, host, status, free-text search, ...) layered on top of ExportSelection.All or ExportSelection.TimeRange; it is ignored for ExportSelection.Ids, which is always an exact match regardless of filters -- a caller who picked specific rows expects exactly those rows back, not a filtered subset of them.