MCPcopy Create free account
hub / github.com/arctic-cli/interface / resolveAccountId

Function resolveAccountId

packages/arctic/src/provider/usage.ts:846–852  ·  view source on GitHub ↗
(accountId: string | undefined, tokenSource: string)

Source from the content-addressed store, hash-verified

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

Callers 1

resolveCodexCredentialsFunction · 0.85

Calls 1

decodeJWTFunction · 0.90

Tested by

no test coverage detected