import { Schema } from "effect"; import { NonNegativeInt, PositiveInt } from "./baseSchemas"; export const ThreadTokenUsageSnapshot = Schema.Struct({ usedTokens: NonNegativeInt, totalProcessedTokens: Schema.optional(NonNegativeInt), maxTokens: Schema.optional(PositiveInt), inputTokens: Schema.optional(NonNegativeInt), cachedInputTokens: Schema.optional(NonNegativeInt), outputTokens: Schema.optional(NonNegativeInt), reasoningOutputTokens: Schema.optional(NonNegativeInt), lastUsedTokens: Schema.optional(NonNegativeInt), lastInputTokens: Schema.optional(NonNegativeInt), lastCachedInputTokens: Schema.optional(NonNegativeInt), lastOutputTokens: Schema.optional(NonNegativeInt), lastReasoningOutputTokens: Schema.optional(NonNegativeInt), toolUses: Schema.optional(NonNegativeInt), durationMs: Schema.optional(NonNegativeInt), compactsAutomatically: Schema.optional(Schema.Boolean), }); export type ThreadTokenUsageSnapshot = typeof ThreadTokenUsageSnapshot.Type;