import type { Dispatch, SetStateAction } from 'react';
import type { ConversationMessage, ChatState, JsonValue } from '../../types';
import type { ActionRequestEvent, ActionLoopContext } from './types';
/**
 * Handle the action loop for halting actions.
 *
 * Flow:
 * 1. Display the action in UI
 * 2. Call the frontend handler (which waits for user interaction or returns immediately for display actions)
 * 3. Handler returns body when complete
 * 4. Send body to backend via continueAgentAction
 * 5. Process any subsequent events (may include new action_request for chained actions)
 */
export declare function handleActionLoop(client: ActionLoopContext['client'], initialEvent: ActionRequestEvent, streamState: ActionLoopContext['streamState'], onMessageUpdate: ActionLoopContext['onMessageUpdate'], setState: ActionLoopContext['setState'], widgetId: string, conversationId: string, getMessages: ActionLoopContext['getMessages']): Promise<void>;
/**
 * Setup resume callbacks for incomplete actions after page reload.
 *
 * When a page reloads with an incomplete action, this sets up callbacks
 * so when the user completes the action, we can continue the agent flow.
 */
export declare function setupActionResumeCallbacks(messages: ConversationMessage[], client: ActionLoopContext['client'], conversationId: string, widgetId: string, setState: Dispatch<SetStateAction<ChatState>>, onMessageUpdate: (message: ConversationMessage) => void, createStreamState: () => ActionLoopContext['streamState'], registerCallback: (toolCallId: string, callback: (body: Record<string, JsonValue>) => Promise<void>) => void): void;
//# sourceMappingURL=action-handler.d.ts.map