Something went wrong. Try again.
opencode v2 mirror
Something went wrong. Try again.
TypeScript
12345678910111213141516171819export * as TokenUsage from "./token-usage.js"
import { Schema } from "effect"
export interface Info extends Schema.Schema.Type<typeof Info> {}export const Info = Schema.Struct({ input: Schema.Finite, output: Schema.Finite, reasoning: Schema.Finite, cache: Schema.Struct({ read: Schema.Finite, write: Schema.Finite, }),}).annotate({ identifier: "TokenUsage.Info" })
export function total(tokens: Info) { return tokens.input + tokens.output + tokens.reasoning + tokens.cache.read + tokens.cache.write}