git.iko.soy/opencode-android
on fb38d12 help sign in
38 lines 980 B history raw
1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
6/** Entry from `GET /file?path=` (directory listing). */
7@Immutable
8@Serializable
9data class FileNode(
10 val name: String = "",
11 val path: String = "",
12 val type: String? = null,
13) {
14 val isDirectory: Boolean get() = type == "directory"
17/** Response of `GET /file/content?path=`. */
18@Immutable
19@Serializable
20data class FileContent(
21 val type: String? = null, // "text" | "binary"
22 val content: String = "",
23 val diff: String? = null,
24 val mimeType: String? = null,
25 val encoding: String? = null,
26) {
27 val isBinary: Boolean get() = type == "binary" || encoding == "base64"
30/** Entry from `GET /file/status` (VCS status). */
31@Immutable
32@Serializable
33data class FileStatusEntry(
34 val path: String = "",
35 val added: Int = 0,
36 val removed: Int = 0,
37 val status: String? = null, // "added" | "deleted" | "modified"