MCPcopy Index your code
hub / github.com/callstack/agent-device / summarizeCliSession

Function summarizeCliSession

src/cli/auth-session.ts:320–346  ·  view source on GitHub ↗
(options: { stateDir: string; now?: () => number })

Source from the content-addressed store, hash-verified

318}
319
320export function summarizeCliSession(options: { stateDir: string; now?: () => number }): {
321 authenticated: boolean;
322 source: 'cli-session' | 'none';
323 sessionId?: string;
324 cloudBaseUrl?: string;
325 workspaceId?: string;
326 accountId?: string;
327 name?: string;
328 createdAt?: string;
329 expiresAt?: string;
330 expired?: boolean;
331} {
332 const session = readCliSession({ stateDir: options.stateDir });
333 if (!session) return { authenticated: false, source: 'none' };
334 return {
335 authenticated: true,
336 source: 'cli-session',
337 sessionId: session.id,
338 cloudBaseUrl: session.cloudBaseUrl,
339 workspaceId: session.workspaceId,
340 accountId: session.accountId,
341 name: session.name,
342 createdAt: session.createdAt,
343 expiresAt: session.expiresAt,
344 expired: isExpired(session.expiresAt, options.now),
345 };
346}
347
348async function resolveCliSessionAccess(options: {
349 stateDir: string;

Callers 2

authCommandFunction · 0.90

Calls 2

readCliSessionFunction · 0.85
isExpiredFunction · 0.85

Tested by

no test coverage detected