import * as _copilotkit_react_core_dist_types_coagent_state from '@copilotkit/react-core/dist/types/coagent-state';
import * as _copilotkit_react_core_dist_hooks_use_tree from '@copilotkit/react-core/dist/hooks/use-tree';
import * as _copilotkit_shared from '@copilotkit/shared';
import { Message, CopilotKitError } from '@copilotkit/shared';
import * as _copilotkit_react_core_dist_copilot_context_256f9020 from '@copilotkit/react-core/dist/copilot-context-256f9020';
import * as _copilotkit_react_core_dist_types_coagent_action from '@copilotkit/react-core/dist/types/coagent-action';
import * as _copilotkit_react_core from '@copilotkit/react-core';
import { SuggestionItem, SystemMessageFunction, HintFunction } from '@copilotkit/react-core';
import * as _copilotkit_runtime_client_gql from '@copilotkit/runtime-client-gql';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { CopilotChatIcons, CopilotChatLabels } from './ChatContext.js';
import React__default from 'react';
import { ComponentsMap, AssistantMessageProps, UserMessageProps, MessagesProps, RenderMessageProps, RenderSuggestionsListProps, InputProps, ImageRendererProps, CopilotObservabilityHooks } from './props.js';
import '../../types/suggestions.js';

/**
 * The type of suggestions to use in the chat.
 *
 * `auto` - Suggestions are generated automatically.
 * `manual` - Suggestions are controlled programmatically.
 * `SuggestionItem[]` - Static suggestions array.
 */
type ChatSuggestions = "auto" | "manual" | SuggestionItem[];
/**
 * Props for CopilotChat component.
 */
interface CopilotChatProps {
    /**
     * Custom instructions to be added to the system message. Use this property to
     * provide additional context or guidance to the language model, influencing
     * its responses. These instructions can include specific directions,
     * preferences, or criteria that the model should consider when generating
     * its output, thereby tailoring the conversation more precisely to the
     * user's needs or the application's requirements.
     */
    instructions?: string;
    /**
     * Controls the behavior of suggestions in the chat interface.
     *
     * `auto` (default) - Suggestions are generated automatically:
     *   - When the chat is first opened (empty state)
     *   - After each message exchange completes
     *   - Uses configuration from `useCopilotChatSuggestions` hooks
     *
     * `manual` - Suggestions are controlled programmatically:
     *   - Use `setSuggestions()` to set custom suggestions
     *   - Use `generateSuggestions()` to trigger AI generation
     *   - Access via `useCopilotChat` hook
     *
     * `SuggestionItem[]` - Static suggestions array:
     *   - Always shows the same suggestions
     *   - No AI generation involved
     */
    suggestions?: ChatSuggestions;
    /**
     * A callback that gets called when the in progress state changes.
     */
    onInProgress?: (inProgress: boolean) => void;
    /**
     * A callback that gets called when a new message it submitted.
     */
    onSubmitMessage?: (message: string) => void | Promise<void>;
    /**
     * A custom stop generation function.
     */
    onStopGeneration?: OnStopGeneration;
    /**
     * A custom reload messages function.
     */
    onReloadMessages?: OnReloadMessages;
    /**
     * A callback function to regenerate the assistant's response
     */
    onRegenerate?: (messageId: string) => void;
    /**
     * A callback function when the message is copied
     */
    onCopy?: (message: string) => void;
    /**
     * A callback function for thumbs up feedback
     */
    onThumbsUp?: (message: Message) => void;
    /**
     * A callback function for thumbs down feedback
     */
    onThumbsDown?: (message: Message) => void;
    /**
     * A list of markdown components to render in assistant message.
     * Useful when you want to render custom elements in the message (e.g a reference tag element)
     */
    markdownTagRenderers?: ComponentsMap;
    /**
     * Icons can be used to set custom icons for the chat window.
     */
    icons?: CopilotChatIcons;
    /**
     * Labels can be used to set custom labels for the chat window.
     */
    labels?: CopilotChatLabels;
    /**
     * Enable image upload button (image inputs only supported on some models)
     */
    imageUploadsEnabled?: boolean;
    /**
     * The 'accept' attribute for the file input used for image uploads.
     * Defaults to "image/*".
     */
    inputFileAccept?: string;
    /**
     * A function that takes in context string and instructions and returns
     * the system message to include in the chat request.
     * Use this to completely override the system message, when providing
     * instructions is not enough.
     */
    makeSystemMessage?: SystemMessageFunction;
    /**
     * A custom assistant message component to use instead of the default.
     */
    AssistantMessage?: React__default.ComponentType<AssistantMessageProps>;
    /**
     * A custom user message component to use instead of the default.
     */
    UserMessage?: React__default.ComponentType<UserMessageProps>;
    /**
     * A custom Messages component to use instead of the default.
     */
    Messages?: React__default.ComponentType<MessagesProps>;
    /**
     * @deprecated - use RenderMessage instead
     */
    RenderTextMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * @deprecated - use RenderMessage instead
     */
    RenderActionExecutionMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * @deprecated - use RenderMessage instead
     */
    RenderAgentStateMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * @deprecated - use RenderMessage instead
     */
    RenderResultMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * @deprecated - use RenderMessage instead
     */
    RenderImageMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * A custom RenderMessage component to use instead of the default.
     *
     * **Warning**: This is a break-glass solution to allow for custom
     * rendering of messages. You are most likely looking to swap out
     * the AssistantMessage and UserMessage components instead which
     * are also props.
     */
    RenderMessage?: React__default.ComponentType<RenderMessageProps>;
    /**
     * A custom suggestions list component to use instead of the default.
     */
    RenderSuggestionsList?: React__default.ComponentType<RenderSuggestionsListProps>;
    /**
     * A custom Input component to use instead of the default.
     */
    Input?: React__default.ComponentType<InputProps>;
    /**
     * A custom image rendering component to use instead of the default.
     */
    ImageRenderer?: React__default.ComponentType<ImageRendererProps>;
    /**
     * A class name to apply to the root element.
     */
    className?: string;
    /**
     * Children to render.
     */
    children?: React__default.ReactNode;
    hideStopButton?: boolean;
    /**
     * Event hooks for CopilotKit chat events.
     * These hooks only work when publicApiKey is provided.
     */
    observabilityHooks?: CopilotObservabilityHooks;
    /**
     * Custom error renderer for chat-specific errors.
     * When provided, errors will be displayed inline within the chat interface.
     */
    renderError?: (error: {
        message: string;
        operation?: string;
        timestamp: number;
        onDismiss: () => void;
        onRetry?: () => void;
    }) => React__default.ReactNode;
}
interface OnStopGenerationArguments {
    /**
     * The name of the currently executing agent.
     */
    currentAgentName: string | undefined;
    /**
     * The messages in the chat.
     */
    messages: Message[];
    /**
     * Set the messages in the chat.
     */
    setMessages: (messages: Message[]) => void;
    /**
     * Stop chat generation.
     */
    stopGeneration: () => void;
    /**
     * Restart the currently executing agent.
     */
    restartCurrentAgent: () => void;
    /**
     * Stop the currently executing agent.
     */
    stopCurrentAgent: () => void;
    /**
     * Run the currently executing agent.
     */
    runCurrentAgent: (hint?: HintFunction) => Promise<void>;
    /**
     * Set the state of the currently executing agent.
     */
    setCurrentAgentState: (state: any) => void;
}
type OnReloadMessagesArguments = OnStopGenerationArguments & {
    /**
     * The message on which "regenerate" was pressed
     */
    messageId: string;
};
type OnStopGeneration = (args: OnStopGenerationArguments) => void;
type OnReloadMessages = (args: OnReloadMessagesArguments) => void;
type ImageUpload = {
    contentType: string;
    bytes: string;
};
declare function CopilotChat({ instructions, suggestions, onSubmitMessage, makeSystemMessage, onInProgress, onStopGeneration, onReloadMessages, onRegenerate, onCopy, onThumbsUp, onThumbsDown, markdownTagRenderers, Messages, RenderMessage, RenderSuggestionsList, Input, className, icons, labels, AssistantMessage, UserMessage, ImageRenderer, imageUploadsEnabled, inputFileAccept, hideStopButton, observabilityHooks, renderError, RenderTextMessage, RenderActionExecutionMessage, RenderAgentStateMessage, RenderResultMessage, RenderImageMessage, }: CopilotChatProps): react_jsx_runtime.JSX.Element;
declare function WrappedCopilotChat({ children, icons, labels, className, }: {
    children: React__default.ReactNode;
    icons?: CopilotChatIcons;
    labels?: CopilotChatLabels;
    className?: string;
}): react_jsx_runtime.JSX.Element;
declare const useCopilotChatLogic: (chatSuggestions: ChatSuggestions, makeSystemMessage?: SystemMessageFunction, onInProgress?: (isLoading: boolean) => void, onSubmitMessage?: (messageContent: string) => Promise<void> | void, onStopGeneration?: OnStopGeneration, onReloadMessages?: OnReloadMessages) => {
    messages: Message[];
    isLoading: boolean;
    suggestions: SuggestionItem[];
    sendMessage: (messageContent: string, imagesToUse?: Array<{
        contentType: string;
        bytes: string;
    }>) => Promise<Message>;
    stopGeneration: () => void;
    reloadMessages: (messageId: string) => void;
    resetSuggestions: () => void;
    context: {
        messages: _copilotkit_runtime_client_gql.Message[];
        setMessages: React__default.Dispatch<React__default.SetStateAction<_copilotkit_runtime_client_gql.Message[]>>;
        suggestions: SuggestionItem[];
        setSuggestions: React__default.Dispatch<React__default.SetStateAction<SuggestionItem[]>>;
        actions: Record<string, _copilotkit_react_core.FrontendAction<any>>;
        setAction: (id: string, action: _copilotkit_react_core.FrontendAction<any>) => void;
        removeAction: (id: string) => void;
        coAgentStateRenders: Record<string, _copilotkit_react_core_dist_types_coagent_action.CoAgentStateRender<any>>;
        setCoAgentStateRender: (id: string, stateRender: _copilotkit_react_core_dist_types_coagent_action.CoAgentStateRender<any>) => void;
        removeCoAgentStateRender: (id: string) => void;
        chatComponentsCache: React__default.RefObject<_copilotkit_react_core_dist_copilot_context_256f9020.j>;
        getFunctionCallHandler: (customEntryPoints?: Record<string, _copilotkit_react_core.FrontendAction<any>>) => _copilotkit_shared.FunctionCallHandler;
        addContext: (context: string, parentId?: string, categories?: string[]) => _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId;
        removeContext: (id: _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId) => void;
        getAllContext: () => _copilotkit_react_core.Tree;
        getContextString: (documents: _copilotkit_react_core.DocumentPointer[], categories: string[]) => string;
        addDocumentContext: (documentPointer: _copilotkit_react_core.DocumentPointer, categories?: string[]) => _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId;
        removeDocumentContext: (documentId: string) => void;
        getDocumentsContext: (categories: string[]) => _copilotkit_react_core.DocumentPointer[];
        isLoading: boolean;
        setIsLoading: React__default.Dispatch<React__default.SetStateAction<boolean>>;
        chatSuggestionConfiguration: {
            [key: string]: _copilotkit_react_core.CopilotChatSuggestionConfiguration;
        };
        addChatSuggestionConfiguration: (id: string, suggestion: _copilotkit_react_core.CopilotChatSuggestionConfiguration) => void;
        removeChatSuggestionConfiguration: (id: string) => void;
        chatInstructions: string;
        setChatInstructions: React__default.Dispatch<React__default.SetStateAction<string>>;
        additionalInstructions?: string[];
        setAdditionalInstructions: React__default.Dispatch<React__default.SetStateAction<string[]>>;
        copilotApiConfig: _copilotkit_react_core.CopilotApiConfig;
        showDevConsole: boolean;
        coagentStates: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>;
        setCoagentStates: React__default.Dispatch<React__default.SetStateAction<Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>>>;
        coagentStatesRef: React__default.RefObject<Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>>;
        setCoagentStatesWithRef: (value: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState> | ((prev: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>) => Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>)) => void;
        agentSession: _copilotkit_react_core_dist_copilot_context_256f9020.A | null;
        setAgentSession: React__default.Dispatch<React__default.SetStateAction<_copilotkit_react_core_dist_copilot_context_256f9020.A | null>>;
        agentLock: string | null;
        threadId: string;
        setThreadId: React__default.Dispatch<React__default.SetStateAction<string>>;
        runId: string | null;
        setRunId: React__default.Dispatch<React__default.SetStateAction<string | null>>;
        chatAbortControllerRef: React__default.MutableRefObject<AbortController | null>;
        runtimeClient: _copilotkit_runtime_client_gql.CopilotRuntimeClient;
        forwardedParameters?: Partial<Pick<_copilotkit_runtime_client_gql.ForwardedParametersInput, "temperature">>;
        availableAgents: _copilotkit_runtime_client_gql.Agent[];
        authStates_c?: Record<_copilotkit_react_core_dist_copilot_context_256f9020.k, _copilotkit_react_core_dist_copilot_context_256f9020.f>;
        setAuthStates_c?: React__default.Dispatch<React__default.SetStateAction<Record<_copilotkit_react_core_dist_copilot_context_256f9020.k, _copilotkit_react_core_dist_copilot_context_256f9020.f>>>;
        authConfig_c?: {
            SignInComponent: React__default.ComponentType<{
                onSignInComplete: (authState: _copilotkit_react_core_dist_copilot_context_256f9020.f) => void;
            }>;
        };
        extensions: _copilotkit_runtime_client_gql.ExtensionsInput;
        setExtensions: React__default.Dispatch<React__default.SetStateAction<_copilotkit_runtime_client_gql.ExtensionsInput>>;
        langGraphInterruptAction: _copilotkit_react_core_dist_copilot_context_256f9020.L | null;
        setLangGraphInterruptAction: _copilotkit_react_core_dist_copilot_context_256f9020.d;
        removeLangGraphInterruptAction: () => void;
        onError?: _copilotkit_shared.CopilotErrorHandler;
        bannerError: CopilotKitError | null;
        setBannerError: React__default.Dispatch<React__default.SetStateAction<CopilotKitError | null>>;
    };
    actions: Record<string, _copilotkit_react_core.FrontendAction<any>>;
};

export { ChatSuggestions, CopilotChat, CopilotChatProps, ImageUpload, OnReloadMessages, OnReloadMessagesArguments, OnStopGeneration, WrappedCopilotChat, useCopilotChatLogic };
