1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
6/** Entry from `GET /agent`. */
10 // Defaulted so one name-less element in GET /agent doesn't fail the whole list decode
11 // (emptying the agent picker) — matches the resilient-decoding philosophy. A blank name is
12 // degraded but recoverable; a thrown decode is not.
13 val name: String = "",
14 val description: String? = null,
15 val mode: String? = null,
16 val builtIn: Boolean = false,
17 val prompt: String? = null,
19 val isPrimary: Boolean get() = mode == "primary"
20 val displayDescription: String get() = description?.takeIf { it.isNotBlank() } ?: "Custom agent"
23/** Entry from `GET /command`. */
27 // Defaulted so one name-less element in GET /command doesn't fail the whole list decode
28 // (emptying the command picker) — matches the resilient-decoding philosophy.
29 val name: String = "",
30 val description: String? = null,
31 val agent: String? = null,
32 val model: String? = null,
33 val template: String = "",
34 val subtask: Boolean = false,
36 val displayDescription: String get() = description?.takeIf { it.isNotBlank() } ?: template.take(80)
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