(part: (typeof SessionV1.Event.PartUpdated.Type)["data"]["part"] | unknown)
| 34 | } |
| 35 | |
| 36 | function usage(part: (typeof SessionV1.Event.PartUpdated.Type)["data"]["part"] | unknown): Usage | undefined { |
| 37 | if (typeof part !== "object" || part === null) return undefined |
| 38 | const value = part as Record<string, unknown> |
| 39 | if (value.type !== "step-finish") return undefined |
| 40 | if (!("cost" in value) || !("tokens" in value)) return undefined |
| 41 | return { cost: value.cost as Usage["cost"], tokens: value.tokens as Usage["tokens"] } |
| 42 | } |
| 43 | |
| 44 | function sessionRow(info: SessionV1.SessionInfo): typeof SessionTable.$inferInsert { |
| 45 | return { |
no outgoing calls
no test coverage detected