Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Oct 1, 2025

Adds UsageStats schema and type to packages/types/src/cloud.ts for tracking usage statistics including tasks, tokens, and costs over a specified period.


Important

Adds usageStatsSchema and UsageStats type to cloud.ts for tracking usage statistics.

  • Schema and Type Addition:
    • Adds usageStatsSchema to cloud.ts for tracking usage statistics including dates, tasks, tokens, costs, and totals.
    • Defines UsageStats type as an inference of usageStatsSchema.

This description was created by Ellipsis for 6b76fa1. You can customize this summary. It will automatically update as commits are pushed.

@roomote roomote bot requested review from cte, jr and mrubens as code owners October 1, 2025 16:32
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Enhancement New feature or request labels Oct 1, 2025
cost: z.number(), // Total cost in USD
}),
}),
period: z.number(), // Period in days (e.g., 30)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider validating 'period' as a positive integer (e.g. use z.number().int().positive()) to prevent invalid period values.

Suggested change
period: z.number(), // Period in days (e.g., 30)
period: z.number().int().positive(), // Period in days (e.g., 30)

* UsageStats
*/

export const usageStatsSchema = z.object({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding nonnegative validations for numeric fields (tasks, tokens, costs, and totals) to ensure usage stats cannot be negative.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 1, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 1, 2025
@jr jr merged commit c8a8188 into main Oct 1, 2025
29 of 30 checks passed
@jr jr deleted the feature/add-usage-stats-schema branch October 1, 2025 16:50
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 1, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants