1package soy.iko.opencode.data.model
3import kotlinx.serialization.SerialName
4import kotlinx.serialization.Serializable
7 * The SSE envelope from `GET /event`: `{ "type": "<event>", "properties": { ... } }`.
8 * Discriminated on `type` (the global discriminator). Unknown events decode to
9 * [UnknownEvent] so the stream never dies on a new event type.
11 * Property shapes are kept lenient (nullable fields + ignoreUnknownKeys) because they
12 * drift across opencode versions; the reducer only reads the fields it needs.
15sealed interface BusEvent
18@SerialName("server.connected")
19data object ServerConnected : BusEvent
22@SerialName("message.updated")
23data class MessageUpdated(val properties: Props) : BusEvent {
25 data class Props(val info: MessageInfo)
29@SerialName("message.part.updated")
30data class MessagePartUpdated(val properties: Props) : BusEvent {
34 val sessionID: String? = null,
35 val messageID: String? = null,
40@SerialName("message.part.removed")
41data class MessagePartRemoved(val properties: Props) : BusEvent {
44 val sessionID: String? = null,
45 val messageID: String? = null,
46 val partID: String? = null,
51@SerialName("message.removed")
52data class MessageRemoved(val properties: Props) : BusEvent {
55 val sessionID: String? = null,
56 val messageID: String? = null,
61@SerialName("session.idle")
62data class SessionIdle(val properties: Props) : BusEvent {
64 data class Props(val sessionID: String? = null)
68@SerialName("session.error")
69data class SessionError(val properties: Props) : BusEvent {
72 val sessionID: String? = null,
73 val error: kotlinx.serialization.json.JsonElement? = null,
78@SerialName("session.updated")
79data class SessionUpdated(val properties: Props) : BusEvent {
81 data class Props(val info: Session)
85@SerialName("session.deleted")
86data class SessionDeleted(val properties: Props) : BusEvent {
88 data class Props(val info: Session? = null, val sessionID: String? = null)
92@SerialName("permission.updated")
93data class PermissionUpdated(val properties: Permission) : BusEvent
96@SerialName("permission.replied")
97data class PermissionReplied(val properties: Props) : BusEvent {
100 val sessionID: String? = null,
101 val permissionID: String? = null,
102 val response: String? = null,
106/** Fallback for any event type we don't model. */
108@SerialName("__unknown")
109data object UnknownEvent : BusEvent
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