( session: UsageSessionInput, )
| 17 | } |
| 18 | |
| 19 | export function buildUsageSessionState( |
| 20 | session: UsageSessionInput, |
| 21 | ): UsageSessionState { |
| 22 | const rateLimitSession = buildRateLimitUiSessionState(session) |
| 23 | const subscriptionType = rateLimitSession.subscriptionType |
| 24 | |
| 25 | return { |
| 26 | subscriptionType, |
| 27 | showSonnetBar: |
| 28 | subscriptionType === 'max' || |
| 29 | subscriptionType === 'team' || |
| 30 | subscriptionType === null, |
| 31 | isProOrMax: |
| 32 | subscriptionType === 'pro' || subscriptionType === 'max', |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export function getCurrentUsageSessionState(): UsageSessionState { |
| 37 | return buildUsageSessionState(getAuthRuntime().getCurrentSession()) |
no test coverage detected