/** * MCP Context Helper Functions * * Helper functions for progress handling and context utilities. */ import type { Logger } from 'pino'; import type { ProgressInput } from './context.js'; /** * Progress notification data structure */ export interface ProgressNotification { /** Unique token identifying this progress stream */ progressToken: string; /** Human-readable progress message */ message: string; /** Current progress value (optional) */ progress?: number; /** Total progress value (optional) */ total?: number; /** Additional metadata */ metadata?: Record; } /** * Enhanced progress reporter that forwards through MCP notifications */ export type EnhancedProgressReporter = (message: string, progress?: number, total?: number, metadata?: Record) => Promise; /** * Extract progress token from MCP request * * Per MCP spec, progress token is in params._meta.progressToken * @see https://modelcontextprotocol.io/specification#progress */ export declare function extractProgressToken(request: unknown): string | undefined; /** * Creates a progress reporter that forwards notifications through the MCP protocol */ export declare function createProgressReporter(progressToken?: string | number, logger?: Logger, sendNotification?: (notification: unknown) => Promise): EnhancedProgressReporter | undefined; /** * Extract progress reporter from progress token. * * Takes a simple progress token (string/number) and creates a progress reporter * that sends MCP notifications. * * @param progress - Progress token from MCP protocol * @param logger - Logger for creating progress reporter * @param sendNotification - MCP notification callback for progress updates * @returns ProgressReporter function or undefined */ export declare function extractProgressReporter(progress: ProgressInput, logger: Logger, sendNotification?: (notification: unknown) => Promise): EnhancedProgressReporter | undefined; //# sourceMappingURL=context-helpers.d.ts.map