/** * Sandbox Chat Utility Module * Handles chat session management, message sending, and polling for responses */ import type { AxiosInstance } from 'axios'; import type { SandboxChatSession, Connector, ConversationAct, ChatDebugInfo } from '../types.js'; /** * Options for selecting which connector to chat through */ export interface ConnectorSelectionOptions { /** Integration IDN to search connectors in (default: 'sandbox') */ integrationIdn?: string; /** Exact connector_idn to use; when omitted, the first running connector is used */ connectorIdn?: string; } /** * List running connectors of an integration (default: sandbox). * Used by `newo sandbox --list-connectors` and connector selection. */ export declare function listRunningSandboxConnectors(client: AxiosInstance, integrationIdn?: string): Promise; /** * Find a sandbox connector from the customer's connectors list. * * Without options, preserves legacy behavior: first running connector of the * 'sandbox' integration. With options.connectorIdn, selects that exact * connector and throws a descriptive error (listing available connectors) * when it is not found or not running. */ export declare function findSandboxConnector(client: AxiosInstance, verbose?: boolean, options?: ConnectorSelectionOptions): Promise; /** * Create a new sandbox chat session */ export declare function createChatSession(client: AxiosInstance, connector: Connector, verbose?: boolean): Promise; /** * Send a message in the chat session * Returns the timestamp when message was sent (for filtering responses) */ export declare function sendMessage(client: AxiosInstance, session: SandboxChatSession, text: string, verbose?: boolean): Promise; /** * Poll for new conversation acts (messages and debug info) * Continues polling until we get an agent response, not just any new message */ export declare function pollForResponse(client: AxiosInstance, session: SandboxChatSession, messageSentAt?: Date | null, verbose?: boolean, timeoutMs?: number): Promise<{ acts: ConversationAct[]; agentPersonaId: string | null; userAct: ConversationAct | null; }>; /** * Extract agent messages from acts */ export declare function extractAgentMessages(acts: ConversationAct[]): ConversationAct[]; /** * Extract debug information from acts */ export declare function extractDebugInfo(acts: ConversationAct[]): ChatDebugInfo[]; /** * Format debug info for display */ export declare function formatDebugInfo(acts: ConversationAct[]): string; //# sourceMappingURL=chat.d.ts.map