1package soy.iko.opencode.data.model
3import kotlinx.serialization.SerialName
4import kotlinx.serialization.Serializable
6/** Body for `POST /session/:id/message`. */
8data class PromptRequest(
9 val parts: List<PromptPart>,
10 val model: ModelRef? = null,
11 val agent: String? = null,
15 * An input part for a prompt — a discriminated union on `type` (the global class
16 * discriminator). We compose text and file (image/document attachment) parts; the server
17 * models more (agent, subtask) that this client doesn't send.
20sealed interface PromptPart
24data class TextPromptPart(val text: String) : PromptPart
27 * A file/image attachment. [url] must be a data URL carrying the base64 payload —
28 * `data:<mime>;base64,<bytes>` — which is how the server embeds media for the model to
29 * see (see opencode's message-v2.ts). [mime] must match the payload; the server forwards
30 * it as the model's mediaType.
34data class FilePromptPart(
37 val filename: String? = null,
40/** Body for `POST /session/:id/command`. */
42data class CommandRequest(
44 val arguments: String = "",
45 val agent: String? = null,
48/** Body for `POST /session/:id/revert`. */
50data class RevertRequest(
51 val messageID: String,
52 val partID: String? = null,
55/** Body for `POST /session/:id/summarize`. */
57data class SummarizeRequest(
58 val providerID: String,
62/** Body for `POST /session/:id/shell`. */
64data class ShellRequest(
67 val model: ModelRef? = 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