/** * Elicitation Fallback Helpers * * Handles fallback logic when clients don't support native MCP elicitation. * Used by CallToolFlow to choose between waiting and fire-and-forget patterns. * * @module elicitation/helpers/fallback.helper */ import { type FrontMcpLogger } from '../../common'; import { type ElicitationFallbackRequired } from '../../errors'; import { type Scope } from '../../scope'; /** * Dependencies required by fallback handler functions. */ export interface FallbackHandlerDeps { /** The scope instance with notification service and elicitation store */ scope: Scope; /** Session ID for the current request */ sessionId: string; /** Logger for diagnostic output */ logger: FrontMcpLogger; } /** * Check if notifications can be delivered to this session. * * Returns true if the client is registered with at least one defined capability, * indicating it's a full MCP client that can process notifications. * Clients with empty capabilities (e.g., `{}`) or all-undefined values are * assumed to be minimal clients that cannot process notification-based flows. * * @param scope - The scope with notification service * @param sessionId - The session to check * @returns true if notifications can be delivered */ export declare function canDeliverNotifications(scope: Scope, sessionId: string): boolean; /** * Send a fallback notification to inform the LLM about elicitation requirements. * * This notification tells the LLM to call the `sendElicitationResult` tool * with the collected user input. * * @param deps - Dependencies including scope, sessionId, and logger * @param error - The ElicitationFallbackRequired error with elicitation details */ export declare function sendFallbackNotification(deps: FallbackHandlerDeps, error: ElicitationFallbackRequired): void; /** * Handle elicitation fallback using the waiting pattern. * * For streamable-http with notification support: * 1. Send notification with fallback instructions BEFORE waiting * 2. Subscribe to pub/sub channel for the result * 3. Wait for result with timeout * 4. Return the actual tool result (not fallback instructions) * * @param deps - Dependencies including scope, sessionId, and logger * @param error - The ElicitationFallbackRequired error with elicitation details * @returns Promise that resolves with the tool result when sendElicitationResult is called */ export declare function handleWaitingFallback(deps: FallbackHandlerDeps, error: ElicitationFallbackRequired): Promise; //# sourceMappingURL=fallback.helper.d.ts.map