import { Auth } from './auth'; import { KamanDoRequest } from './types'; interface ChatOptions { baseUrl?: string; apiKey?: string; token?: string; mockMode?: boolean; internal?: boolean; } export declare class ChatAPI extends Auth { private baseUrl; private mockMode; private internal; constructor(options?: ChatOptions); getHistory(messageId: string): Promise; /** * Get all chat sessions for the current user with pagination */ getSessions(expertId?: string, limit?: number, skip?: number): Promise<{ total: number; limit: number; skip: number; data: any[]; }>; getFileIdByChunkId(chunkId: string): Promise; getSession(sessionId: string): Promise; /** * Delete a chat session */ deleteSession(sessionId: string): Promise; /** * Update a chat session (e.g., rename it) */ updateSession(sessionId: string, updates: any): Promise; /** * Send a message to the chat API using Server-Sent Events * Returns an async generator that yields messages as they come in */ sendMessage(options: KamanDoRequest): AsyncGenerator; /** * Check if a session has an active (in-progress) stream on the backend */ checkSessionActive(sessionId: string): Promise; /** * Resume an active SSE stream for a session that's still being processed. * Returns an async generator yielding messages in the same format as sendMessage. */ resumeStream(sessionId: string): AsyncGenerator; respondToTool(sessionId: string, id: string, data: any): Promise; /** * Stop an active chat session * @param sessionId The session ID to stop */ stopChat(sessionId: string): Promise<{ success: boolean; message: string; }>; /** * Respond to a tool confirmation request * @param sessionId The session ID * @param action The action to take: 'approve', 'approve_session', or 'reject' * @param toolName The name of the tool being confirmed/rejected * @param alternativePrompt Optional alternative prompt if rejecting */ respondToToolConfirmation(sessionId: string, action: 'approve' | 'approve_session' | 'reject', toolName: string, alternativePrompt?: string): Promise<{ success: boolean; message: string; }>; /** * Fetch sub-agent message history * @param threadId The sub-agent thread ID (e.g., "subagent__") */ fetchSubAgentMessages(threadId: string): Promise; fetchArtifact(artifactId: string): Promise; fetchModels(): Promise; fetchExpertList(): Promise; fetchExpertDetails(expertId: string): Promise; /** * Get the base URL for constructing artifact URLs */ getBaseUrl(): string; getArtifacts(sessionId: string): Promise; /** * Get avatar configuration with signed model URL * @param agentId The agent ID (without the _0 suffix) */ getAvatarConfig(agentId: string): Promise; /** * Submit feedback for a message (thumbs up/down) * @param sessionId The session ID * @param messageId The message ID being rated * @param feedbackType "positive" or "negative" * @param comment Optional comment about the feedback */ submitFeedback(sessionId: string, messageId: string, feedbackType: "positive" | "negative", comment?: string): Promise<{ success: boolean; }>; } export {};