(accountId: string | undefined, tokenSource: string)
| 844 | } |
| 845 | |
| 846 | function resolveAccountId(accountId: string | undefined, tokenSource: string): string { |
| 847 | if (accountId) return accountId |
| 848 | const decoded = decodeJWT(tokenSource) |
| 849 | const claims = decoded?.[JWT_CLAIM_PATH] as { chatgpt_account_id?: string } | undefined |
| 850 | if (claims?.chatgpt_account_id) return claims.chatgpt_account_id |
| 851 | throw new Error("Could not determine your ChatGPT account ID. Run `arctic auth codex` to refresh your login.") |
| 852 | } |
| 853 | |
| 854 | async function fetchGithubCopilotUsageWrapper(input: { |
| 855 | provider: Provider.Info |
no test coverage detected