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