From 6b76fa17175231f14eddf2a687601afbbaa930e3 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 1 Oct 2025 16:30:36 +0000 Subject: [PATCH] feat: add UsageStats schema and type to cloud.ts --- packages/types/src/cloud.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/types/src/cloud.ts b/packages/types/src/cloud.ts index 903dfcb93fd..f6acb28c363 100644 --- a/packages/types/src/cloud.ts +++ b/packages/types/src/cloud.ts @@ -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