import { ClassProp } from 'class-variance-authority/types'; import { ConversationActionsProps } from './ConversationActions'; import { ConversationInputProps } from './ConversationInput'; import { ConversationMessagesProps } from './ConversationMessages'; import { ConversationStatusProps } from './ConversationStatus'; import { ConversationSuggestionsProps } from './ConversationSuggestions'; import { default as default_2 } from 'react'; import { ReactNode } from 'react'; import { VariantProps } from 'class-variance-authority'; export declare type ActivityBlock = ThinkingBlock | ToolUseBlock | ToolResultBlock; export declare type Article = { id: string; title: string; url: string; }; export declare type Attachment = FileAttachment | PageAttachment | EntityAttachment; export declare type AttachmentAddAction = { type: 'select-entity'; entity: BaseEntity; } | { type: 'select-page'; page: Page; } | { type: 'add-files'; files: File[]; }; export declare type AttachmentBlock = FileAttachmentBlock | EntityAttachmentBlock | PageAttachmentBlock; declare type BaseEntity = { id: string; type: 'collection' | 'article' | 'channel'; title: string; url: string; }; export declare type Channel = { id: string; title: string; url: string; }; export declare type Citation = { id: string; index: number; title: string; url: string; }; declare type Collection = { id: string; title: string; url: string; }; export declare type ContentBlock = TextBlock | AttachmentBlock | ActivityBlock; declare type ContextPill = { id: string; label: string; iconType?: ContextPillIconType; loading?: boolean; progress?: number; }; export declare const ContextPillBadge: ({ pill, onRemove }: ContextPillBadgeProps) => default_2.JSX.Element; declare interface ContextPillBadgeProps { pill: ContextPill; onRemove?: (pill: ContextPill) => void; } export declare type ContextPillIconType = 'image' | 'video' | 'pdf' | 'doc' | 'file' | 'channel' | 'collection' | 'article' | 'page'; export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, pages, acceptedFileTypes, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & { Messages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps) => default_2.JSX.Element; Input: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element; Suggestions: ({ items, className }: ConversationSuggestionsProps) => default_2.JSX.Element | null; Actions: ({ actions, onActionClick, className }: ConversationActionsProps) => default_2.JSX.Element | null; Loading: ({ className, children, variant, }: ConversationStatusProps) => default_2.JSX.Element; }; export declare type ConversationAction = { id: string; label: string; icon?: string; description?: string; }; export declare const ConversationActions: ({ actions, onActionClick, className }: ConversationActionsProps_2) => default_2.JSX.Element | null; declare interface ConversationActionsProps_2 { actions: ConversationAction[]; onActionClick?: (action: ConversationAction) => void; className?: string; } export declare type ConversationCallbacks = { onSend?: (text: string, attachments?: Attachment[]) => void; onStop?: () => void; onSuggestionClick?: (suggestion: Suggestion) => void; onActionClick?: (action: ConversationAction, messageId: string) => void; onCitationClick?: (citation: Citation) => void; onAttachmentAdd?: (action: AttachmentAddAction) => void; onAttachmentRemove?: (attachment: Attachment) => void; onCopy?: (messageId: string, content: string) => void; }; export declare interface ConversationContextValue { messages: Message[]; callbacks: ConversationCallbacks; isStreaming: boolean; } export declare const ConversationInput: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps_2) => default_2.JSX.Element; declare interface ConversationInputProps_2 { placeholder?: string; attachments?: Attachment[]; collections?: Collection[]; pages?: Page[]; acceptedFileTypes?: string[]; disabled?: boolean; isElevated?: boolean; className?: string; } export declare const ConversationMessageAssistant: { ({ message, className }: ConversationMessageAssistantProps): default_2.JSX.Element; displayName: string; }; declare interface ConversationMessageAssistantProps { message: Message; className?: string; } export declare const ConversationMessages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps_2) => default_2.JSX.Element; declare interface ConversationMessagesProps_2 { className?: string; bottomPadding?: number; onContentBehind?: (isBehind: boolean) => void; } export declare const ConversationMessageUser: { ({ message, className }: ConversationMessageUserProps): default_2.JSX.Element; displayName: string; }; declare interface ConversationMessageUserProps { message: Message; className?: string; } declare interface ConversationProps { messages: Message[]; callbacks: ConversationCallbacks; children?: ReactNode; suggestions?: Suggestion[]; actions?: ConversationAction[]; placeholder?: string; attachments?: Attachment[]; collections?: Collection[]; pages?: Page[]; acceptedFileTypes?: string[]; showBranding?: boolean; className?: string; } export declare function ConversationProvider({ messages, callbacks, children }: ConversationProviderProps): default_2.JSX.Element; declare interface ConversationProviderProps { messages: Message[]; callbacks: ConversationCallbacks; children: default_2.ReactNode; } export declare const ConversationStatus: ({ className, children, variant, }: ConversationStatusProps_2) => default_2.JSX.Element; declare interface ConversationStatusProps_2 { className?: string; children?: default_2.ReactNode; variant?: SweepTextVariant; } export declare const ConversationSuggestions: ({ items, className }: ConversationSuggestionsProps_2) => default_2.JSX.Element | null; declare interface ConversationSuggestionsProps_2 { items: Suggestion[]; className?: string; } export declare type EntityAttachment = { id: string; type: 'entity'; entity: BaseEntity; }; export declare type EntityAttachmentBlock = { type: 'entity'; entity: BaseEntity; }; export declare type FileAttachment = { id: string; type: 'file'; raw: File; loading?: boolean; progress?: number; file: { name: string; mimeType: string; url?: string; attachmentId?: string; }; }; export declare type FileAttachmentBlock = { type: 'file'; fileName: string; mimeType: string; attachmentId: string; url?: string; }; /** * Derive the live status label from a message's latest content block, or `null` * when no status should be shown. * * The status reflects only the most recent activity ("latest only"): a tool * call shows its mapped label, thinking shows "Thinking", and a tool result * keeps the originating tool's label so it doesn't flicker to generic between * the result arriving and the next block. * * It is shown before the first answer text and while tools/thinking are in * flight, but hidden once answer text is actively streaming — returning `null` * when the latest block is a text block that already has content. */ export declare function getConversationStatusLabel(message: Message): string | null; export declare type Message = { id: string; role: MessageRole; content: ContentBlock[]; status: MessageStatus; createdAt?: Date; feedback?: 'positive' | 'negative'; }; export declare type MessageRole = 'user' | 'ai'; export declare type MessageStatus = 'pending' | 'streaming' | 'completed' | 'error'; export declare type Page = { url: string; title: string; textContent?: string; }; export declare type PageAttachment = { id: string; type: 'page'; page: Page; }; export declare type PageAttachmentBlock = { type: 'page'; url: string; title: string; textContent?: string; }; export declare type Suggestion = { id: string; text: string; icon?: string; }; declare type SweepTextVariant = NonNullable['variant']>; declare const sweepTextVariants: (props?: ({ variant?: "dark" | "yellowfin" | "dark-subtle" | null | undefined; } & ClassProp) | undefined) => string; export declare type TextBlock = { type: 'text'; text: string; citations?: Citation[]; }; export declare type ThinkingBlock = { type: 'thinking'; thinking: string; }; export declare type ToolResultBlock = { type: 'tool_result'; toolUseId: string; content: string; }; /** A tool invocation. `input` holds the raw (possibly partial) JSON arguments string. */ export declare type ToolUseBlock = { type: 'tool_use'; id: string; name: string; input: string; }; export declare function useConversation(): ConversationContextValue; export { }