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

Function getCurrentPlanModeSubscriptionState

src/utils/planModeV2.ts:6–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { isInternalBuild } from 'src/capabilities/static.js'
5
6function getCurrentPlanModeSubscriptionState() {
7 const session = getAuthRuntime().getCurrentSession()
8 const isOauthBackedFirstPartySession =
9 session.providerPlan.mode === 'noumena_managed' &&
10 session.headersKind === 'bearer'
11
12 return {
13 subscriptionType: isOauthBackedFirstPartySession
14 ? session.subscription.subscriptionType
15 : null,
16 rateLimitTier: isOauthBackedFirstPartySession
17 ? session.subscription.rateLimitTier
18 : null,
19 }
20}
21
22export function getPlanModeV2AgentCount(): number {
23 // Environment variable override takes precedence

Callers 1

getPlanModeV2AgentCountFunction · 0.85

Calls 2

getAuthRuntimeFunction · 0.85
getCurrentSessionMethod · 0.65

Tested by

no test coverage detected