feat: add UsageStats schema and type (#8441)

feat: add UsageStats schema and type to cloud.ts

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-10-01 09:50:50 -07:00 committed by GitHub
parent 9bcd9918af
commit c8a8188f8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -721,3 +721,25 @@ export type LeaveResponse = {
taskId?: string
timestamp?: string
}
/**
* UsageStats
*/
export const usageStatsSchema = z.object({
success: z.boolean(),
data: z.object({
dates: z.array(z.string()), // Array of date strings
tasks: z.array(z.number()), // Array of task counts
tokens: z.array(z.number()), // Array of token counts
costs: z.array(z.number()), // Array of costs in USD
totals: z.object({
tasks: z.number(),
tokens: z.number(),
cost: z.number(), // Total cost in USD
}),
}),
period: z.number(), // Period in days (e.g., 30)
})
export type UsageStats = z.infer<typeof usageStatsSchema>