Skip to content

Commit c8a8188

Browse files
feat: add UsageStats schema and type (#8441)
feat: add UsageStats schema and type to cloud.ts Co-authored-by: Roo Code <[email protected]>
1 parent 9bcd991 commit c8a8188

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/types/src/cloud.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,3 +721,25 @@ export type LeaveResponse = {
721721
taskId?: string
722722
timestamp?: string
723723
}
724+
725+
/**
726+
* UsageStats
727+
*/
728+
729+
export const usageStatsSchema = z.object({
730+
success: z.boolean(),
731+
data: z.object({
732+
dates: z.array(z.string()), // Array of date strings
733+
tasks: z.array(z.number()), // Array of task counts
734+
tokens: z.array(z.number()), // Array of token counts
735+
costs: z.array(z.number()), // Array of costs in USD
736+
totals: z.object({
737+
tasks: z.number(),
738+
tokens: z.number(),
739+
cost: z.number(), // Total cost in USD
740+
}),
741+
}),
742+
period: z.number(), // Period in days (e.g., 30)
743+
})
744+
745+
export type UsageStats = z.infer<typeof usageStatsSchema>

0 commit comments

Comments
 (0)