MCPcopy Create free account
hub / github.com/Noumena-Network/code / buildUsageSessionState

Function buildUsageSessionState

src/components/Settings/usageSession.ts:19–34  ·  view source on GitHub ↗
(
  session: UsageSessionInput,
)

Source from the content-addressed store, hash-verified

17}
18
19export 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
36export function getCurrentUsageSessionState(): UsageSessionState {
37 return buildUsageSessionState(getAuthRuntime().getCurrentSession())

Callers 2

Calls 1

Tested by

no test coverage detected