import type { UserExtraData } from '@botonic/shared'; import type { HubtypeApiService } from '../../services/hubtype-api-service'; import { BotServerMessage } from '../bot-server-message'; import { BotonicContextInput } from './botonic-context-input'; import type { BotonicContextSession, BotonicSessionUpdate } from './botonic-context-session'; import type { BotonicContextSecrets, BotonicContextSettings } from './botonic-context-settings'; import type { ActionResponse, ResolvedPlugins, SendMessagesOptions, TypingMode } from './types'; /** Result of creating input/session from raw lambda request (used by BotonicContextFactory). */ export interface BotonicContextType { input: BotonicContextInput; session: BotonicContextSession; settings: BotonicContextSettings; secrets: BotonicContextSecrets; } /** Options for handoff to human agent. */ export interface HandoffOptions { queue?: string; on_finish?: string; agent_email?: string; agent_id?: string; case_info?: string; note?: string; shadowing?: boolean; auto_idle_message?: string; force_assign_if_not_available?: boolean; auto_assign_on_waiting?: boolean; case_extra_data?: Record; bot_event?: { format_version: number; flow_id: string; flow_name: string; flow_node_id: string; flow_node_content_id: string; }; subscribe_helpdesk_events?: string[]; } /** Full execution context with input, session, and hubtype service methods. */ export declare class BotonicContext implements BotonicContextType { private readonly hubtypeService; input: BotonicContextInput; session: BotonicContextSession; readonly settings: BotonicContextSettings; readonly secrets: BotonicContextSecrets; defaultDelay: number; defaultTyping: number; defaultTypingMode: TypingMode; params: Record; plugins: TPlugins; response?: ActionResponse; constructor(hubtypeService: HubtypeApiService, base: BotonicContextType, plugins: TPlugins, defaultTyping: number, defaultDelay: number, defaultTypingMode: TypingMode, response?: ActionResponse); /** * Session user setters notify via sync callback; `updateBotSession` is async. * Attach `.catch` so fetch/network failures are logged instead of unhandled rejections. */ private bindSessionUpdateCallback; sendMessages: (messages: BotServerMessage[], options?: SendMessagesOptions) => Promise; doHandoff: (handoffOptions?: HandoffOptions) => Promise; getBotSession: () => Promise>; updateBotSession: (updates: BotonicSessionUpdate) => Promise; }