import type { AgUiClient, Id, ConversationDoc, MessageDoc } from '../types'; export interface SdkAgentOptions { baseUrl: string; headers?: Record; agentEndpoint?: string; conversationsEndpoint?: string; getConversationState?: (conversationId: string) => any; getGlobalState?: () => any; customFetch?: typeof fetch; } /** * SDK-compliant AG-UI client with conversation management */ export declare class SdkAgClient implements AgUiClient { private agent; private baseUrl; private headers; private conversationsEndpoint; private agentEndpointPath; private getConversationState?; private getGlobalState?; private customFetch?; private listeners; private threadId; private conversationHistoryByThread; private streamingContent; private streamingToolCalls; private toolCallsInProgress; private activeSubscriptions; private activeRunByMessageId; constructor(options: SdkAgentOptions); private subscribeToAgentEvents; on(type: E, handler: Function): () => void; off(type: E, handler: Function): void; emit(type: E, payload: any): void; createConversation(title?: string, metadata?: Record): Promise; listConversations(): Promise; getConversation(id: Id): Promise; updateConversation(id: Id, updates: Partial): Promise; archiveConversation(id: Id): Promise; /** * Set the active thread/conversation * This should be called when switching conversations to ensure proper context */ setActiveThread(threadId: string): void; sendMessage(conversationId: Id | null, text: string, options?: { attachments?: Id[]; metadata?: Record; onEvent?: (event: { type: string; data: any; }) => void; }): Promise; /** * Sync loaded messages to the conversation history Map * This ensures the SDK client has the full history when sending new messages * * IMPORTANT: We exclude tool calls from the synced history because: * - Tool calls are stored for UI display only * - When sent back to the API, they would create duplicate tool_use IDs * - The API reconstructs tool interactions from tool result messages */ private syncMessagesToHistory; getMessages(conversationId: Id): Promise; cancelMessage(conversationId: Id, messageId: Id): Promise; close(): void; } /** * Factory function for creating SDK agent */ export declare function createSdkAgent(options: SdkAgentOptions): AgUiClient; export default createSdkAgent; //# sourceMappingURL=sdk-agent.d.ts.map