Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"serve": "npm run build && npm start",
"preview": "vite preview",
"lint": "oxlint",
"test": "node --test server/lib/range.test.ts server/lib/localhost-intent.test.ts server/lib/localhost.test.ts server/lib/cursor-stamp.test.ts src/lib/types.test.ts src/lib/api.test.ts",
"test": "node --test server/lib/range.test.ts server/lib/localhost-intent.test.ts server/lib/localhost.test.ts server/lib/cursor-stamp.test.ts src/lib/types.test.ts src/lib/api.test.ts src/lib/cumulativeUsage.test.ts",
"setup": "npm run build && npm run launchagent:install",
"launchagent:install": "bash scripts/install-launchagent.sh",
"launchagent:uninstall": "bash scripts/uninstall-launchagent.sh"
Expand Down
8 changes: 5 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ async function buildPayload(
): Promise<DashboardPayload> {
const range = parseRange(typeof rangeRaw === 'string' ? rangeRaw : undefined)
const { data, cached } = await collectRaw(force)
// Dashboard "this billing cycle" follows Cursor's plan cycle when known,
// so Claude's rolling weekly window does not pull the shared range back.
const sharedCycleStart = data.cursor.usageReset?.cycleStart ?? null
const agents = withShares(
[data.cursor, data.claude, data.codex].map((a) => {
const cycleStart = a.usageReset?.cycleStart
const since = rangeStartDate(range, new Date(), cycleStart)
const days = daysInRange(range, new Date(), cycleStart)
const since = rangeStartDate(range, new Date(), sharedCycleStart)
const days = daysInRange(range, new Date(), sharedCycleStart)
return applyRange(a, range, since, days)
}),
)
Expand Down
Loading
Loading