export declare const STICKY_SESSION_HEADER = "x-llm-relay-session"; export declare const STICKY_PROVENANCE_HEADER = "x-llm-relay-sticky"; export type SessionRequestHeaders = Readonly>; export interface SessionPin { readonly targetSpec: string; readonly pinnedAt: number; lastUsedAt: number; useCount: number; } export interface StickySessionManagerOptions { ttlMs?: number; maxSessions?: number; } export declare const DEFAULT_STICKY_TTL_MS: number; export declare const DEFAULT_STICKY_MAX_SESSIONS = 1000; /** Ephemeral, metadata-only sliding-TTL session affinity. */ export declare class StickySessionManager { private readonly pins; private readonly ttlMs; private readonly maxSessions; constructor(options?: StickySessionManagerOptions); getPin(key: string, now?: number): string | null; setPin(key: string, targetSpec: string, now?: number): void; deletePin(key: string): void; clear(): void; private prune; } /** * Derive a session key without retaining request content. * * The only explicit base header is relay-owned and opt-in. No client session header is accepted * until this repository has evidence that the client actually emits it. Claude Code's documented * agent id is a qualifier only: it keeps a child from overwriting its parent's affinity. */ export declare function deriveSessionKey(headers: SessionRequestHeaders | undefined, reqJson: unknown): string | null;