import { type SessionIdPayload, type TransportProtocolType } from '@frontmcp/auth'; import { type PlatformDetectionConfig } from '../../../common/types/options/session'; /** * Decrypt a public session ID without signature verification. * Public sessions use authSig: 'public' and isPublic: true. * First checks the cache for potentially updated payload (e.g., platformType). */ export declare function decryptPublicSession(sessionId: string): SessionIdPayload | null; /** * Validates an existing session header OR creates a fresh one. * - Valid: nodeId matches local, authSig matches current Authorization * - On any mismatch/decrypt error → generate new */ export declare function parseSessionHeader(sessionHeader: string | undefined, token: string): { id: string; payload: SessionIdPayload; } | undefined; export interface CreateSessionOptions { /** User-Agent header for pre-initialize platform detection */ userAgent?: string; /** Platform detection configuration from scope */ platformDetectionConfig?: PlatformDetectionConfig; /** * Whether this session is in skills-only mode. * When true, tools/list returns empty array but skills/search and skills/load work normally. * Detected from `?mode=skills_only` query param on connection. */ skillsOnlyMode?: boolean; } export declare function createSessionId(protocol: TransportProtocolType, token: string, options?: CreateSessionOptions): { id: string; payload: SessionIdPayload; }; export declare function generateSessionCookie(sessionId: string, ttlInMinutes?: number): string; export declare function extractSessionFromCookie(cookie?: string): string | undefined; /** * Update a cached session payload with new data and re-encrypt to produce * a new session ID that carries the updated payload. * * This ensures that any node in a distributed system (including Vercel Edge * and Cloudflare Workers) can decrypt the session ID and get the full * payload with initialization data (e.g., supportsElicitation, platformType). * * @param sessionId - The current session ID to update * @param updates - Partial payload updates to merge * @returns The new session ID with the updated payload baked in, or null if session was invalid */ export declare function updateSessionPayload(sessionId: string, updates: Partial): string | null; /** * Retrieve client info (name/version) from a session ID. * Useful for logging, stateless access, or when NotificationService is not available. * * @param sessionId - The encrypted session ID * @returns Client info object or null if session is invalid or has no client info */ export declare function getSessionClientInfo(sessionId: string): { name?: string; version?: string; } | null; //# sourceMappingURL=session-id.utils.d.ts.map