Package-level declarations

Types

Link copied to clipboard
data class DatabaseBrowserActions(val onOpenDatabase: (String) -> Unit, val onOpenTable: (String, String) -> Unit, val onExecuteSql: (String, String) -> Unit)

Grouped callbacks for the Room/SQLite database browser and its SQL console.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Process-local handoff from the full runtime to the SDK-owned Activity.

Link copied to clipboard
data class FileBrowserActions(val onOpenPath: (root: String, relativePath: String) -> Unit, val onPreview: (root: String, relativePath: String) -> Unit, val onClosePreview: () -> Unit, val onDelete: (root: String, relativePath: String) -> Unit, val onShare: (root: String, relativePath: String) -> Unit = { _, _ -> })

Grouped callbacks for the read-only-by-default app file browser. Delete and share are both capability-gated -- share hands the caller a real, unredacted file, the same reasoning that gates the browser's download route behind the files capability.

Link copied to clipboard
sealed interface InspectorAction

User intents dispatched from the Observe and Control surfaces to InspectorViewModel.

Link copied to clipboard

Shape of a captured body preview, mirroring io.devconsole.network.BodyPreview without a sdk:network dependency.

Link copied to clipboard
data class InspectorBreadcrumbUi(val timestampEpochMs: Long, val plugin: String, val type: String, val severity: Int, val summary: String)

One lead-up event captured in a crash/ANR's bounded breadcrumb ring buffer. Already-redacted event summaries only -- no payload bodies -- mirroring the "breadcrumbs" array io.devconsole.CrashCapture serializes into the crash/ANR payload.

Link copied to clipboard
data class InspectorBrowserPrincipalUi(val id: String, val label: String, val sourceIp: String, val expiresAtEpochMs: Long)

One authenticated browser, as shown (and revocable) on the dashboard's Session view and this More surface.

Link copied to clipboard
data class InspectorBrowserUi(val binding: String, val endpoint: String?, val principals: List<InspectorBrowserPrincipalUi> = emptyList(), val sessionCodeUrl: String? = null, val sessionCode: String? = null, val sessionCodeExpiresAtEpochMs: Long? = null, val sessionCodeRemainingTtlMs: Long? = null, val bindAddressChanged: Boolean = false)

Read-only display of the host's current browser policy; changing access is out of scope here.

Link copied to clipboard
data class InspectorCaptureRuleUi(val id: String, val host: String, val method: String? = null, val pathPrefix: String? = null, val enabled: Boolean = true)

A capture exclusion as shown and edited on the Control surface.

Link copied to clipboard
sealed interface InspectorCommandResult
Link copied to clipboard
data class InspectorComposerRequest(val method: String, val url: String, val headers: Map<String, String> = emptyMap(), val body: String? = null)
Link copied to clipboard
data class InspectorCrashUi(val id: String, val kind: String, val summary: String, val thread: String, val timestampEpochMs: Long, val stackTrace: String, val breadcrumbs: List<InspectorBreadcrumbUi> = emptyList())

An uncaught-exception or ANR capture, flattened for the Crashes surface. kind is "UNCAUGHT" or "ANR" -- mirroring the internal CrashKind.name the full runtime tags the event with -- so it reuses logLevelShortLabel/logLevelTint exactly like the Logs tab's crash rows already do. stackTrace is the bounded, explicitly-truncation-marked all-thread dump; an ANR carries every thread, main first, an uncaught exception carries the throwing thread's trace.

Link copied to clipboard
data class InspectorDatabaseListingUi(val name: String, val tables: List<InspectorDatabaseTableUi>, val sizeBytes: Long = 0)
Link copied to clipboard
data class InspectorDatabaseTableUi(val name: String, val rowCount: Long)
Link copied to clipboard
Link copied to clipboard
data class InspectorEditingUi(val requestExecution: Boolean = false, val mocks: Boolean = false, val featureFlags: Boolean = false, val preferences: Boolean = false, val files: Boolean = false, val database: Boolean = false, val captureRules: Boolean = false)
Link copied to clipboard
data class InspectorFeatureFlagUi(val key: String, val value: String, val defaultValue: String, val allowedValues: List<String>, val type: String, val mutable: Boolean, val description: String, val isOverridden: Boolean)
Link copied to clipboard
data class InspectorFileEntryUi(val name: String, val relativePath: String, val isDirectory: Boolean, val sizeBytes: Long, val lastModifiedEpochMs: Long)
Link copied to clipboard
data class InspectorFileListingUi(val root: String, val relativePath: String, val entries: List<InspectorFileEntryUi>)
Link copied to clipboard
sealed interface InspectorFilePreviewUi
Link copied to clipboard
data class InspectorHealthUi(val state: String, val initializationCount: Long, val publishedEventCount: Long, val droppedEventCount: Long)

Mirrors io.devconsole.server.api.SdkHealthSnapshot's counter types (all Long, plus state).

Link copied to clipboard
data class InspectorLogUi(val id: String, val kind: String, val source: String, val summary: String, val timestampEpochMs: Long, val detail: String? = null)
Link copied to clipboard
data class InspectorMockRuleUi(val id: String, val method: String? = null, val pathPattern: String = ".*", val actionLabel: String = "", val scheme: String? = null, val host: String? = null, val priority: Int = 0, val scope: String = "SESSION", val statusCode: Int = 200, val body: String = "", val enabled: Boolean = true, val headers: Map<String, String> = emptyMap(), val delayMs: Long? = null, val hitCount: Long = 0, val lastHitEpochMs: Long? = null, val sourceBodySnapshot: String? = null)
Link copied to clipboard
data class InspectorPreferenceEntryUi(val key: String, val value: String, val type: String, val redacted: Boolean = false)
Link copied to clipboard
Link copied to clipboard
data class InspectorPushUi(val provider: String, val messageId: String? = null, val lifecycle: String, val simulated: Boolean, val receivedAtEpochMs: Long, val dataPreview: Map<String, String> = emptyMap())
Link copied to clipboard
data class InspectorQueryResultUi(val columns: List<String>, val rows: List<List<String>>, val truncated: Boolean)
Link copied to clipboard
data class InspectorRetentionUi(val maxSessions: Int, val maxAgeMs: Long, val maxBytes: Long)

Mirrors io.devconsole.api.RetentionPolicy's configured caps, for display next to actual usage.

Link copied to clipboard
data class InspectorSessionUi(val id: String, val startedAtEpochMs: Long, val label: String, val status: String = "UNKNOWN", val recordCount: Long = 0, val estimatedBytes: Long = 0)
Link copied to clipboard
data class InspectorSnapshot(val available: Boolean = false, val transactions: List<InspectorTransactionUi> = emptyList(), val capabilities: InspectorEditingUi = InspectorEditingUi(), val mocksEnabled: Boolean = false, val mockRules: List<InspectorMockRuleUi> = emptyList(), val captureRules: List<InspectorCaptureRuleUi> = emptyList(), val sockets: List<InspectorSocketUi> = emptyList(), val pushEvents: List<InspectorPushUi> = emptyList(), val logs: List<InspectorLogUi> = emptyList(), val crashes: List<InspectorCrashUi> = emptyList(), val featureFlags: List<InspectorFeatureFlagUi> = emptyList(), val stateProviders: List<InspectorStateProviderUi> = emptyList(), val preferenceFiles: List<InspectorPreferenceFileUi> = emptyList(), val fileRoots: List<String> = emptyList(), val databases: List<String> = emptyList(), val sessions: List<InspectorSessionUi> = emptyList(), val health: InspectorHealthUi? = null, val browser: InspectorBrowserUi? = null, val retention: InspectorRetentionUi? = null, val keepAlivePromptNeeded: Boolean = false, val captureCategories: Set<CaptureCategory> = CaptureCategory.all())
Link copied to clipboard
data class InspectorSocketFrameUi(val direction: String, val frameType: String, val preview: String?, val timestampEpochMs: Long, val byteLength: Long? = null, val truncated: Boolean = false, val topic: String? = null, val qos: Int? = null)
Link copied to clipboard
data class InspectorSocketUi(val id: String, val url: String, val state: String, val sentCount: Int, val receivedCount: Int, val openedAtEpochMs: Long, val closedAtEpochMs: Long? = null, val error: String? = null, val frames: List<InspectorSocketFrameUi> = emptyList(), val protocol: String = "websocket")
Link copied to clipboard
sealed interface InspectorSqlResultUi
Link copied to clipboard
data class InspectorState(val available: Boolean = false, val serverControlSupported: Boolean = false, val transactions: List<InspectorTransactionUi> = emptyList(), val capabilities: InspectorEditingUi = InspectorEditingUi(), val mocksEnabled: Boolean = false, val mockRules: List<InspectorMockRuleUi> = emptyList(), val captureRules: List<InspectorCaptureRuleUi> = emptyList(), val lastCommandResult: InspectorCommandResult? = null, val sockets: List<InspectorSocketUi> = emptyList(), val pushEvents: List<InspectorPushUi> = emptyList(), val logs: List<InspectorLogUi> = emptyList(), val crashes: List<InspectorCrashUi> = emptyList(), val flaggedTransactionIds: Set<String> = emptySet(), val flaggedCrashIds: Set<String> = emptySet(), val observeTab: ObserveTab = ObserveTab.TRAFFIC, val selectedTransactionIds: Set<String> = emptySet(), val featureFlags: List<InspectorFeatureFlagUi> = emptyList(), val stateProviders: List<InspectorStateProviderUi> = emptyList(), val preferenceFiles: List<InspectorPreferenceFileUi> = emptyList(), val fileRoots: List<String> = emptyList(), val fileListing: InspectorFileListingUi? = null, val filePreview: InspectorFilePreviewUi? = null, val pendingShareFilePath: String? = null, val databases: List<String> = emptyList(), val databaseListing: InspectorDatabaseListingUi? = null, val queryResult: InspectorQueryResultUi? = null, val sqlResult: InspectorSqlResultUi? = null, val sessions: List<InspectorSessionUi> = emptyList(), val selectedSessionId: String? = null, val sessionLogsLoading: Boolean = false, val health: InspectorHealthUi? = null, val browser: InspectorBrowserUi? = null, val retention: InspectorRetentionUi? = null, val lastScreenshotResult: ScreenshotResult? = null, val keepAlivePromptNeeded: Boolean = false, val captureCategories: Set<CaptureCategory> = CaptureCategory.all())

Presentation state for the Observe and Control surfaces. Both surfaces read the same InspectorViewModel since they are two views over one polled snapshot.

Link copied to clipboard
data class InspectorStateEntryUi(val key: String, val value: String, val redacted: Boolean)
Link copied to clipboard
data class InspectorStateProviderUi(val id: String, val entries: List<InspectorStateEntryUi>)
Link copied to clipboard
data class InspectorTimingPhasesUi(val dnsMs: Long? = null, val connectMs: Long? = null, val tlsMs: Long? = null, val sendMs: Long? = null, val waitMs: Long? = null, val receiveMs: Long? = null)

Mirrors io.devconsole.network.NetworkTimingPhases without a sdk:network dependency. Every phase is legitimately null in normal operation -- a pooled connection does no DNS/connect, a plaintext request has no TLS, a cached response does no network work -- so a null phase must never be rendered as a zero-length bar; it must be omitted. All-null means no per-phase timing was captured for this transaction (an adapter that predates this field, or a transport that never wires up phase timing), in which case a caller should fall back to the total duration.

Link copied to clipboard
data class InspectorTrafficQuery(val search: String = "", val method: String? = null, val statusClass: TrafficStatusClass = TrafficStatusClass.ALL)

Caller-supplied filter for the network-transaction page in InspectorDataSource.snapshot. Owned by the UI layer (not io.devconsole.network.NetworkTransactionQuery) so this module never takes a dependency on sdk:network; adapters translate it into their own engine query type.

Link copied to clipboard
data class InspectorTransactionUi(val id: String, val method: String, val host: String, val path: String, val statusCode: Int?, val durationMs: Long?, val startedAtEpochMs: Long = 0, val requestHeaders: Map<String, String> = emptyMap(), val responseHeaders: Map<String, String> = emptyMap(), val requestPreview: String? = null, val responsePreview: String? = null, val error: String? = null, val url: String = "", val requestBodyKind: InspectorBodyKind = InspectorBodyKind.ABSENT, val requestBodyTruncated: Boolean = false, val timingPhases: InspectorTimingPhasesUi = InspectorTimingPhasesUi(), val isMocked: Boolean = false, val mockRuleId: String? = null)
Link copied to clipboard
class InspectorViewModel @JvmOverloads constructor(dataSource: InspectorDataSource = DevConsoleInspectorBridge.source(), dispatcher: CoroutineDispatcher = Dispatchers.IO) : ViewModel

Presentation-layer MVI store for the Observe and Control surfaces. Reads go through dispatcher so the polled InspectorDataSource snapshot never blocks the main thread; the capability gate for InspectorAction.ExecuteComposer and InspectorAction.SetMocksEnabled is checked synchronously against the last-loaded InspectorState.capabilities before a coroutine is even launched, so a disabled tool never reaches dataSource.

Link copied to clipboard

Sub-surfaces of the Observe workspace: live traffic plus the other captured signal sources.

Link copied to clipboard

Coarse status bucket for the Observe traffic tab's status filter chips.

Functions

Link copied to clipboard
fun DevConsolePanel(state: DevConsoleState, onStart: () -> Unit, onStop: () -> Unit, modifier: Modifier = Modifier, endpoint: BrowserEndpoint? = null)

Optional Compose launcher. Callbacks keep server lifecycle ownership in the host application. endpoint is not derived from state -- DevConsoleState.Running carries no payload -- so the host must capture it from the StartResult.Started its own onStart receives (and clear it back to null once it calls onStop) for the running address to be displayed here.

Link copied to clipboard
fun DevConsoleStatusChip(state: DevConsoleState, modifier: Modifier = Modifier, endpoint: BrowserEndpoint? = null)
Link copied to clipboard