1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
5import kotlinx.serialization.json.JsonElement
6import kotlinx.serialization.json.JsonObject
7import kotlinx.serialization.json.JsonPrimitive
8import kotlinx.serialization.json.jsonArray
11 * A permission request from `permission.updated`. The tool detail lives in [type] +
12 * [pattern] + [metadata]; [pattern] is a string or array of strings on the wire, so
13 * it's kept as a [JsonElement] and flattened for display.
19 val sessionID: String = "",
20 val type: String? = null,
21 val pattern: JsonElement? = null,
22 val messageID: String? = null,
23 val callID: String? = null,
24 val title: String? = null,
25 val metadata: JsonObject? = null,
26 val time: TimeInfo? = null,
28 val patternText: String?
29 get() = when (val p = pattern) {
31 is JsonPrimitive -> p.content
32 else -> p.jsonArray.mapNotNull { (it as? JsonPrimitive)?.content }.joinToString(", ").ifEmpty { null }
36/** Allowed values for the permission response body. */
37enum class PermissionResponse(val wire: String) {
43/** Body for `POST /session/:id/permissions/:permissionID`. */
45data class PermissionReplyBody(val response: String)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list