import { AgentStatus as PersistedAgentStatus, AgentChat, AgentMessage, AgentToolCall, AgentArtifact, AgentAttachment } from '@multiplayer-app/ai-agent-types';

export interface QueuedComposerMessage {
    id: string;
    content: string;
    attachments?: AgentAttachment[];
    createdAt: string;
}
export declare enum UiChatStatus {
    Idle = "idle",
    Sending = "sending",
    Streaming = "streaming"
}
export declare const mapPersistedStatusToUiStatus: (status?: PersistedAgentStatus) => UiChatStatus;
export interface ChatStateEntry {
    reasoning: string[];
    messages: AgentMessage[];
    artifacts: AgentArtifact[];
    pendingAssistant: AgentMessage | undefined;
    messageQueue: QueuedComposerMessage[];
    composerDraft: {
        value: string;
        attachments: AgentAttachment[];
    };
    composerError: string | undefined;
    pageContextDismissed: boolean;
    status: UiChatStatus;
}
/** Default transient state for a chat. Use when reading chatState[key] that may be undefined. */
export declare const defaultChatState: () => ChatStateEntry;
export interface AgentStoreState {
    contextKey: string;
    activeChatId?: string;
    draftChatKey: string;
    chats: Record<string, AgentChat>;
    chatState: Record<string, ChatStateEntry>;
    isChatHistoryOpen: boolean;
    composer: {
        model?: string;
        temperature: number;
    };
}
export interface AgentStoreActions {
    setContextKey: (contextKey: string) => void;
    setActiveChat: (chatId?: string) => void;
    upsertChat: (chat: AgentChat) => void;
    upsertChatState: (chatId: string, state: ChatStateEntry | ((prev: ChatStateEntry) => ChatStateEntry)) => void;
    hydrateChats: (chats: AgentChat[]) => void;
    removeChat: (chatId: string) => void;
    pushReasoning: (chatId: string, fragment: string) => void;
    setArtifacts: (chatId: string, artifacts: AgentArtifact[]) => void;
    setComposerOptions: (options: Partial<AgentStoreState['composer']>) => void;
    setComposerDraft: (chatKey: string, draft: {
        value: string;
        attachments: AgentAttachment[];
    }) => void;
    setComposerValue: (chatKey: string, value: string) => void;
    addComposerAttachments: (chatKey: string, attachments: AgentAttachment[]) => void;
    removeComposerAttachment: (chatKey: string, attachmentId: string) => void;
    clearComposerDraft: (chatKey: string) => void;
    setComposerError: (chatKey: string, error?: string) => void;
    setPageContextDismissed: (chatKey: string, dismissed: boolean) => void;
    setChatStatus: (chatKey: string, status: UiChatStatus) => void;
    setPendingAssistant: (chatKey: string, message?: AgentMessage) => void;
    commitPendingAssistant: (chatId: string) => void;
    appendSystemMessage: (chatId: string, content: string) => void;
    upsertToolCall: (chatId: string, call: AgentToolCall) => void;
    enqueueQueuedMessage: (chatKey: string, content: string, attachments?: AgentAttachment[]) => void;
    removeQueuedMessage: (chatKey: string, id: string) => void;
    moveChatKeyState: (fromChatKey: string, toChatKey: string) => void;
    setChatHistoryOpen: (isOpen: boolean) => void;
    toggleChatHistory: () => void;
    setChatMessages: (chatId: string, messages: AgentMessage[] | ((prev: AgentMessage[]) => AgentMessage[])) => void;
    appendMessagesToChat: (chatId: string, messages: AgentMessage[]) => void;
}
export type AgentStore = AgentStoreState & AgentStoreActions;
/** Get transient chat state, with defaults when the key has no entry. */
export declare const getChatState: (state: AgentStoreState, key: string) => ChatStateEntry;
export declare const createAgentStore: (initialContextKey: string) => import('zustand').UseBoundStore<import('zustand').StoreApi<AgentStore>>;
//# sourceMappingURL=useAgentStore.d.ts.map