feat(cursor): show remaining included usage from dashboard limits API - #273
Open
florianbehrend wants to merge 3 commits into
Open
florianbehrend wants to merge 3 commits into
florianbehrend wants to merge 3 commits into
Conversation
Fixes chattymin#272. Fetches Cursor's monthly included allowance from the undocumented Connect RPC endpoint GetCurrentPeriodUsage on api2.cursor.sh, using the same local Cursor login as usage events. - CursorRateLimitsProvider with Bearer JWT auth and refresh retry - Popover limits section: monthly %, remaining dollars, auto/API split - Menu bar limit line when Cursor was used today - README privacy/docs updated for api2.cursor.sh (en/ko/ja)
Swift requires memberwise initializer arguments to follow declaration order; CI failed on totalPercentUsed before includedSpend.
Resolve README conflicts in all three locales: keep main's Aside provider in the on-device list and re-add the api2.cursor.sh outbound host from this branch (twelve -> thirteen hosts).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #272. Adds Cursor official limits to the popover — monthly included allowance, remaining dollars, and auto/API usage split — fetched from Cursor's undocumented Connect RPC endpoint on
api2.cursor.sh.POST /aiserver.v1.DashboardService/GetCurrentPeriodUsage(Bearer JWT +Connect-Protocol-Version: 1)cursorAuth/accessTokeninstate.vscdb, orCURSOR_SESSION_TOKEN); on 401 retries once viacursorAuth/refreshTokenCURSOR_USAGE_API=0(shared with usage-events fetch)api2.cursor.shin en/ko/ja (13 outbound hosts)Type of change
Checklist
swift buildpasses locallyCursorLimitsTests: JSON parsing, Bearer/Connect headers, used-percent fallback)Test plan
swift buildsucceeds on macOS 14+CURSOR_USAGE_API=0skips both usage events and limits fetchCursor NN%when Cursor has usage today and limit display is enabledOut of scope
/auth/usagerequest-bucket plansspendLimitUsage) UI