1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
6/** A session as returned by `GET /session` and `POST /session`. */
11 val parentID: String? = null,
12 val title: String? = null,
13 val version: String? = null,
14 val time: TimeInfo? = null,
15 // The absolute worktree/directory the agent runs in for this session. Set server-side
16 // from the `directory` query param at creation; persisted per session so the client
17 // needn't re-send it on follow-up calls (see OpencodeApiClient.createSession).
18 val directory: String? = null,
19 val projectID: String? = null,
21 val displayTitle: String get() = title?.takeIf { it.isNotBlank() } ?: "Untitled session"
23 /** A compact form of [directory] for list/subtitle display: the last path segment,
24 * or the full path when it has no separators. Null/blank when no directory is set. */
25 val displayDirectory: String?
26 get() = directory?.takeIf { it.isNotBlank() }?.trimEnd('/')?.substringAfterLast('/')?.takeIf { it.isNotBlank() }
29/** Body for `POST /session`. */
31data class CreateSessionRequest(
32 val parentID: String? = null,
33 val title: String? = null,
36/** Body for `PATCH /session/:id`. */
38data class UpdateSessionRequest(
39 val title: String? = null,
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