git.iko.soy/opencode-android
on d518ef7 help sign in
41 lines 1.1 kB history raw
1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
4import kotlinx.serialization.Serializable
6@Immutable
7@Serializable
8data class TimeInfo(
9 val created: Long? = null,
10 val updated: Long? = null,
11 val completed: Long? = null,
14/** Timing carried by message parts and tool states. The opencode server sends `time: { start,
15 * end?, compacted? }` for these (unlike Session/MessageInfo/Permission, which use the
16 * created/updated/completed shape of [TimeInfo]). With `ignoreUnknownKeys`, modelling these
17 * fields with [TimeInfo] would silently discard start/end/compacted — every part/tool time
18 * would decode to all-nulls — so this separate shape exists for them. */
19@Immutable
20@Serializable
21data class PartTimeInfo(
22 val start: Long? = null,
23 val end: Long? = null,
24 val compacted: Long? = null,
27@Immutable
28@Serializable
29data class Tokens(
30 val input: Long = 0,
31 val output: Long = 0,
32 val reasoning: Long = 0,
33 val cache: Cache = Cache(),
34) {
35 @Serializable
36 @Immutable
37 data class Cache(
38 val read: Long = 0,
39 val write: Long = 0,
40 )