git.iko.soy/opencode-android
on d643c13 help sign in
32 lines 888 B history raw
1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
6/** Entry from `GET /agent`. */
7@Immutable
8@Serializable
9data class Agent(
10 val name: String,
11 val description: String? = null,
12 val mode: String? = null,
13 val builtIn: Boolean = false,
14 val prompt: String? = null,
15) {
16 val isPrimary: Boolean get() = mode == "primary"
17 val displayDescription: String get() = description?.takeIf { it.isNotBlank() } ?: "Custom agent"
20/** Entry from `GET /command`. */
21@Immutable
22@Serializable
23data class Command(
24 val name: String,
25 val description: String? = null,
26 val agent: String? = null,
27 val model: String? = null,
28 val template: String = "",
29 val subtask: Boolean = false,
30) {
31 val displayDescription: String get() = description?.takeIf { it.isNotBlank() } ?: template.take(80)