1package soy.iko.opencode.data.model
3import kotlinx.serialization.Serializable
4import kotlinx.serialization.json.JsonElement
5import kotlinx.serialization.json.JsonObject
6import kotlinx.serialization.json.JsonPrimitive
7import kotlinx.serialization.json.jsonArray
10 * A permission request from `permission.updated`. The tool detail lives in [type] +
11 * [pattern] + [metadata]; [pattern] is a string or array of strings on the wire, so
12 * it's kept as a [JsonElement] and flattened for display.
17 val sessionID: String = "",
18 val type: String? = null,
19 val pattern: JsonElement? = null,
20 val messageID: String? = null,
21 val callID: String? = null,
22 val title: String? = null,
23 val metadata: JsonObject? = null,
24 val time: TimeInfo? = null,
26 val patternText: String?
27 get() = when (val p = pattern) {
29 is JsonPrimitive -> p.content
30 else -> runCatching { p.jsonArray.joinToString(", ") { (it as JsonPrimitive).content } }.getOrNull()
34/** Allowed values for the permission response body. */
35enum class PermissionResponse(val wire: String) {
41/** Body for `POST /session/:id/permissions/:permissionID`. */
43data 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