import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { type ClientApps } from "./clientApps"; /** * What a client's initialize decided, carried in the Mcp-Session-Id the * client echoes on every later request: the HTTP server keeps no state, and * nothing after initialize names the client otherwise. */ export interface ClientSession { apps: ClientApps; clientName: string; } export declare const UNKNOWN_CLIENT = "unknown"; export declare function clientName(rawName: string | undefined): string; /** A new session id: the apps token, the encoded client name, then a UUID. */ export declare function mintSessionId(session: ClientSession): string; /** The session behind an Mcp-Session-Id header; unknown on both for an absent or foreign one. */ export declare function parseSessionId(sessionId: string | undefined): ClientSession; /** * The session behind a request after initialize. A client that sends no * Mcp-Session-Id, as ChatGPT does on its tool calls, is named by its raw User-Agent. */ export declare function requestSession(sessionId: string | undefined, userAgent: string | undefined): ClientSession; /** * Who made a tool call, for the logs: the client's name from its initialize over * stdio, or from the Mcp-Session-Id over stateless HTTP, and its User-Agent. */ export declare function callerForLog(server: McpServer, extra: { requestInfo?: { headers: Record; }; }): { client: string; user_agent: string | string[] | undefined; }; //# sourceMappingURL=clientSession.d.ts.map