mirror of
https://github.com/7836246/cursor2api.git
synced 2026-09-03 07:20:02 +08:00
Capture the actual input/output token counts from Cursor API's finish event (messageMetadata.usage) and use them in place of tiktoken estimates where available. Fall back to tiktoken if not present. - src/types.ts: extend CursorSSEEvent with finishReason/messageMetadata - src/handler.ts: capture finish event usage in streaming paths, pass real counts to updateSummary with tiktoken fallback - src/logger.ts: add inputTokens/outputTokens fields to RequestSummary - vue-ui: show ↑/↓ Cursor tokens in RequestList, DetailPanel, PayloadView - public/logs.js: show ↑/↓ Cursor tokens in scard and prompts summary