import { AgentProcessSummary, AgentArtifact, SendMessagePayload, StreamChunk, MessagesPage, DataWithCursor, Activity, ActivitySummary, ActivitySummaryParams, SortOrder } from '../types'; import { AgentChat, AgentConfiguration, AgentMessage, AgentToolCallStatus, MultiUserMessagePayload, MultiUserMessageResponse, ModelOption } from '@multiplayer-app/ai-agent-types'; export interface GetMessagesOptions { limit?: number; before?: string; } export interface StreamMessageOptions { /** * Stable key used to identify/cancel a specific in-flight stream. * Typically the chat id. For unsaved/new chats you may use a placeholder key. */ streamKey?: string; } export type ActivityTreeNode = Activity & { children: ActivityTreeNode[]; }; export interface UpsertAgentPreferencesRequest { tools: Record; } export type UpsertAgentPreferencesResponse = { id: string; userId: string; agentName: string; tools: Record; createdAt: string; updatedAt: string; }; export interface UpsertAgentPreferencesBatchRequest { preferences: Array<{ agentName: string; tools: Record; }>; } export interface UpsertAgentPreferencesBatchResponse { preferences: UpsertAgentPreferencesResponse[]; } export interface AgentTransport { sendMessage(payload: SendMessagePayload): Promise; streamMessage(payload: SendMessagePayload, onChunk: (chunk: StreamChunk) => void, options?: StreamMessageOptions): Promise<{ id: string; messages: AgentMessage[]; } | void>; sendMultiUserMessage?(payload: MultiUserMessagePayload): Promise; /** * Cancels a specific stream if `streamKey` is provided; otherwise cancels all active streams. */ cancelStream?(streamKey?: string): void; listChats(params?: { contextKey?: string; skip?: number; limit?: number; userId?: string; multiUser?: boolean; sortField?: string; sortOrder?: 'asc' | 'desc'; }): Promise>; getChat(chatId: string): Promise; getMessages?(chatId: string, options?: GetMessagesOptions): Promise; deleteChat(chatId: string): Promise; listAgents(): Promise; controlAgent(options: { id: string; action: 'stop' | 'resume' | 'retry'; }): Promise; listArtifacts(chatId: string): Promise; listActivities?(params?: { groupId?: string; parentId?: string; sourceType?: string; skip?: number; limit?: number; sort?: { field: string; order: SortOrder; }; from?: string; to?: string; tenant?: Record | { all?: boolean; }; ownerId?: string; }): Promise>; listActivitySourceTypes?(params?: { groupId?: string; parentId?: string; from?: string; to?: string; tenant?: Record | { all?: boolean; }; ownerId?: string; }): Promise; getActivity?(activityId: string): Promise; getActivitySummary?(params?: ActivitySummaryParams): Promise; /** * Update fields on a specific tool call in a specific message. * Only supported by ProxyTransport (server-backed). DirectTransport may omit it. */ updateToolCall?(input: { chatId: string; messageId: string; toolCallId: string; input?: Record; output?: Record; status?: AgentToolCallStatus; }, options?: { excludeSocketId?: boolean; }): Promise; /** * Persist a tool-call action (generic mechanism used by tool renderers). * Only supported by ProxyTransport (server-backed). DirectTransport may omit it. */ recordToolCallAction?(chatId: string, input: { toolCallId: string; action: string; data?: Record; systemMessage?: string; }, options?: { excludeSocketId?: boolean; }): Promise | void>; /** * Fetch available models from the backend. * Returns empty array for DirectTransport (models come from config). */ listModels?(): Promise; /** * Fetch agent configurations for the current user. * Optional contextKey narrows the result set. */ listAgentConfigurations?(contextKey?: string): Promise; /** * Persist preferences for a single agent. * Only supported by ProxyTransport (server-backed). DirectTransport may omit it. */ upsertAgentPreferences?(agentName: string, input: UpsertAgentPreferencesRequest): Promise; /** * Persist preferences for multiple agents in one request. * Only supported by ProxyTransport (server-backed). DirectTransport may omit it. */ upsertAgentPreferencesBatch?(input: UpsertAgentPreferencesBatchRequest): Promise; /** * Optionally generate a human-friendly title for a new chat based on the first user message. * Implementations may call an LLM, a backend service, or use local heuristics. */ generateTitle?(input: { content: string; contextKey: string; userId?: string; strategy?: 'local' | 'llm'; }): Promise; } //# sourceMappingURL=AgentTransport.d.ts.map