MCPcopy
hub / github.com/codeaashu/claude-code / getAvailableUpgrade

Function getAvailableUpgrade

src/utils/model/contextWindowUpgradeCheck.ts:9–30  ·  view source on GitHub ↗

* Get available model upgrade for more context * Returns null if no upgrade available or user already has max context

()

Source from the content-addressed store, hash-verified

7 * Returns null if no upgrade available or user already has max context
8 */
9function getAvailableUpgrade(): {
10 alias: string
11 name: string
12 multiplier: number
13} | null {
14 const currentModelSetting = getUserSpecifiedModelSetting()
15 if (currentModelSetting === 'opus' && checkOpus1mAccess()) {
16 return {
17 alias: 'opus[1m]',
18 name: 'Opus 1M',
19 multiplier: 5,
20 }
21 } else if (currentModelSetting === 'sonnet' && checkSonnet1mAccess()) {
22 return {
23 alias: 'sonnet[1m]',
24 name: 'Sonnet 1M',
25 multiplier: 5,
26 }
27 }
28
29 return null
30}
31
32/**
33 * Get upgrade message for different contexts

Callers 1

getUpgradeMessageFunction · 0.85

Calls 3

checkOpus1mAccessFunction · 0.85
checkSonnet1mAccessFunction · 0.85

Tested by

no test coverage detected