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

Function makeSession

src/utils/planModeV2.test.ts:6–53  ·  view source on GitHub ↗
(
  overrides: Partial<ResolvedAuthSession> = {},
)

Source from the content-addressed store, hash-verified

4import { getPlanModeV2AgentCount } from './planModeV2.js'
5
6function makeSession(
7 overrides: Partial<ResolvedAuthSession> = {},
8): ResolvedAuthSession {
9 return {
10 principalKind: 'noumena_account',
11 principalSource: 'managed_oauth',
12 sessionState: 'usable',
13 headersKind: 'bearer',
14 providerAuthKind: 'noumena_first_party',
15 providerPlan: {
16 mode: 'noumena_managed',
17 source: 'managed_principal',
18 staticKeyEnvVarName: null,
19 },
20 isInteractive: true,
21 canRefresh: true,
22 canReauthenticateInteractively: true,
23 identity: {
24 email: 'user@example.com',
25 accountUuid: 'acct-123',
26 organizationUuid: 'org-123',
27 organizationName: 'Test Org',
28 },
29 subscription: {
30 subscriptionName: 'Noumena Max',
31 subscriptionType: 'max',
32 rateLimitTier: 'default_claude_max_20x',
33 },
34 scopes: ['user:profile', 'user:inference'],
35 hasUsableToken: true,
36 hasUsableApiKey: false,
37 accessToken: 'oauth-token',
38 accessTokenExpiresAt: Date.now() + 10 * 60 * 1_000,
39 refreshTokenPresent: true,
40 apiKey: null,
41 rawAuthTokenSource: 'noumena.com',
42 rawApiKeySource: null,
43 recoveryAction: 'none',
44 recoveryMessage: null,
45 sourceDetails: {
46 usedLegacyCompat: false,
47 usedEnvVar: false,
48 usedFileDescriptor: false,
49 usedHelper: false,
50 },
51 ...overrides,
52 }
53}
54
55function withMockCurrentSession<T>(
56 session: ResolvedAuthSession,

Callers 1

planModeV2.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected