import type { CompatibleRequestHandlerExtra, MCPAnalyticsData, MCPRequestLike, MCPServerLike, SessionInfo, UserIdentity } from '../types'; /** * Bounded LRU cache for session identities, capped at `maxSize` entries so a * long-lived server can't accumulate identities for unboundedly many sessions. * One instance lives on each server's tracking data — it is NOT shared across * server instances, so identities never bleed between servers. */ export declare class IdentityCache { private readonly _cache; private readonly _maxSize; constructor(maxSize?: number); get(sessionId: string): UserIdentity | undefined; set(sessionId: string, identity: UserIdentity): void; has(sessionId: string): boolean; size(): number; } export declare function getServerTrackingData(server: MCPServerLike): MCPAnalyticsData | undefined; export declare function setServerTrackingData(server: MCPServerLike, data: MCPAnalyticsData): void; export declare function areIdentitiesEqual(a: UserIdentity, b: UserIdentity): boolean; export declare function mergeIdentities(previous: UserIdentity | undefined, next: UserIdentity): UserIdentity; /** * Resolves the optional `identify` callback on every request (the resolved * identity is what stamps `distinct_id`/`$set` onto events), but publishes the * `$identify` event at most once per session: at `initialize`, when a * long-lived server first sees the identity, or when it materially changes. */ export declare function handleIdentify(server: MCPServerLike, data: MCPAnalyticsData, sessionId: string, request: MCPRequestLike, requestAttribution: SessionInfo, extra?: CompatibleRequestHandlerExtra, /** * True when this session id came from an agent-carried `conversation_id` * rather than the transport. Such a session is brand new and was never * announced at `initialize`, whatever `data.sessionSource` still says about * the connection. */ sessionFromConversation?: boolean): Promise; export declare function withIdentity(sessionInfo: SessionInfo, identity: UserIdentity | undefined): SessionInfo; /** * Resolves the `eventProperties` callback. Returns null when no callback is * configured, or when it returns nullish or throws — a throw never propagates * into the tool path. */ export declare function resolveEventProperties(data: MCPAnalyticsData, request: MCPRequestLike, extra?: CompatibleRequestHandlerExtra): Promise | null>; //# sourceMappingURL=internal.d.ts.map