import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import react__default, { ReactNode, Component, ErrorInfo, FC, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react'; import { Icon, File as File$1 } from '@phosphor-icons/react'; import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, T as TenantContext$1, U as UserContext$1 } from '../index-Cs_xWkhC.cjs'; /** * Split data source interfaces for BiChat. * * ChatDataSource was a single interface mixing CRUD, streaming, artifacts, * and admin. These focused interfaces let consumers implement only what * they need. ChatDataSource keeps the same shape (with optional artifact * and admin methods) for backwards compatibility — it is NOT a strict * intersection of these interfaces. */ interface SessionStore { createSession(): Promise; fetchSession(id: string): Promise<{ session: Session$1; turns: ConversationTurn$1[]; pendingQuestion?: PendingQuestion$1 | null; } | null>; listSessions(options?: { limit?: number; offset?: number; includeArchived?: boolean; }): Promise; archiveSession(sessionId: string): Promise; unarchiveSession(sessionId: string): Promise; pinSession(sessionId: string): Promise; unpinSession(sessionId: string): Promise; deleteSession(sessionId: string): Promise; renameSession(sessionId: string, title: string): Promise; regenerateSessionTitle(sessionId: string): Promise; clearSessionHistory(sessionId: string): Promise<{ success: boolean; deletedMessages: number; deletedArtifacts: number; }>; compactSessionHistory(sessionId: string): Promise; } interface MessageTransport { sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator; submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; rejectPendingQuestion(sessionId: string): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; } interface ArtifactStore { fetchSessionArtifacts(sessionId: string, options?: { limit?: number; offset?: number; }): Promise<{ artifacts: SessionArtifact[]; hasMore?: boolean; nextOffset?: number; }>; uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{ artifacts: SessionArtifact[]; }>; renameSessionArtifact(artifactId: string, name: string, description?: string): Promise; deleteSessionArtifact(artifactId: string): Promise; } interface AdminStore { listUsers(): Promise; listAllSessions(options?: { limit?: number; offset?: number; includeArchived?: boolean; userId?: string | null; }): Promise<{ sessions: Session$1[]; total: number; hasMore: boolean; }>; listSessionMembers(sessionId: string): Promise; addSessionMember(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise; updateSessionMemberRole(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise; removeSessionMember(sessionId: string, userId: string): Promise; } /** * Type definitions for BI-Chat UI components */ interface Session$1 { id: string; title: string; status: "active" | "archived"; pinned: boolean; createdAt: string; updatedAt: string; owner?: SessionUser$1; isGroup?: boolean; memberCount?: number; access?: SessionAccess$1; } interface SessionAccess$1 { role: "owner" | "editor" | "viewer" | "read_all" | "none"; source: "owner" | "member" | "permission" | "none"; canRead: boolean; canWrite: boolean; canManageMembers: boolean; } /** * A conversation turn groups a user message with its assistant response. * This provides a cleaner mental model than flat message lists. */ interface ConversationTurn$1 { id: string; sessionId: string; userTurn: UserTurn$1; assistantTurn?: AssistantTurn$1; createdAt: string; } /** * Content of a user's message in a conversation turn */ interface UserTurn$1 { id: string; content: string; attachments: Attachment$1[]; author?: SessionUser$1; createdAt: string; } /** * Assistant turn lifecycle used by renderers to distinguish completed output * from HITL checkpoints that require user input. */ type AssistantTurnLifecycle = "complete" | "waiting_for_human_input"; /** * Content of an assistant's response in a conversation turn */ interface AssistantTurn$1 { id: string; role: MessageRole; content: string; explanation?: string; citations: Citation$1[]; toolCalls?: ToolCall$1[]; charts?: ChartData[]; renderTables?: RenderTableData[]; artifacts: Artifact$1[]; codeOutputs: CodeOutput$1[]; lifecycle: AssistantTurnLifecycle; debug?: DebugTrace$1; createdAt: string; } /** * Role of a message in a conversation */ declare enum MessageRole { User = "user", Assistant = "assistant", System = "system", Tool = "tool" } /** * A tool/function call made by the assistant */ interface ToolCall$1 { id: string; name: string; arguments: string; result?: string; error?: string; durationMs?: number; } /** * Citation with position information for inline replacement */ interface Citation$1 { id: string; /** Type of citation (e.g., "url_citation") */ type: string; /** Title of the cited source */ title: string; /** URL of the cited source */ url: string; /** Starting character index in the message content where this citation is referenced */ startIndex: number; /** Ending character index in the message content where this citation is referenced */ endIndex: number; /** Optional excerpt from the source */ excerpt?: string; } interface Attachment$1 { id?: string; clientKey: string; uploadId?: number; filename: string; mimeType: string; sizeBytes: number; base64Data?: string; url?: string; preview?: string; } type ImageAttachment = Attachment$1 & { base64Data: string; preview: string; }; /** * Output from code interpreter tool */ interface CodeOutput$1 { type: "image" | "text" | "error"; content: string; /** File metadata for downloadable outputs */ filename?: string; mimeType?: string; sizeBytes?: number; } /** * Queued message for offline/loading state */ interface QueuedMessage { content: string; attachments: Attachment$1[]; } /** * Chart visualization data for ApexCharts */ interface ChartData { /** Type of chart: line, bar, pie, area, or donut */ chartType: "line" | "bar" | "area" | "pie" | "donut"; /** Chart title displayed above the chart */ title: string; /** Data series (multiple allowed for line/bar/area, single for pie/donut) */ series: ChartSeries[]; /** X-axis category labels or segment labels for pie/donut */ labels?: string[]; /** Hex color codes for series (e.g., '#4CAF50') */ colors?: string[]; /** Chart height in pixels */ height?: number; /** Optional original Apex options (used by richer renderers) */ options?: Record; /** Optional logarithmic Y-axis hint */ logarithmic?: boolean; } /** * A single data series in a chart */ interface ChartSeries { /** Display name for this series */ name: string; /** Numeric data values */ data: number[]; } interface RenderTableExport { url: string; filename: string; rowCount?: number; fileSizeKB?: number; } interface RenderTableData { id: string; title?: string; query: string; columns: string[]; columnTypes?: string[]; headers: string[]; rows: unknown[][]; totalRows: number; pageSize: number; truncated: boolean; truncatedReason?: string; export?: RenderTableExport; exportPrompt?: string; } interface Artifact$1 { type: "excel" | "pdf"; filename: string; url: string; sizeReadable?: string; rowCount?: number; description?: string; } interface SessionArtifact { id: string; sessionId: string; messageId?: string; uploadId?: number; type: string; name: string; description?: string; mimeType?: string; url?: string; sizeBytes: number; metadata?: Record; createdAt: string; } interface PendingQuestion$1 { id: string; turnId: string; agentName?: string; questions: Question[]; status: "PENDING" | "ANSWER_SUBMITTED" | "REJECT_SUBMITTED" | "ANSWER_RESUME_FAILED" | "REJECT_RESUME_FAILED" | "ANSWERED" | "REJECTED" | "CANCELLED"; } interface Question { id: string; text: string; type: "SINGLE_CHOICE" | "MULTIPLE_CHOICE"; options?: QuestionOption[]; required?: boolean; } interface QuestionOption { id: string; label: string; value: string; } /** * Answer data for a single question, including predefined options and custom "Other" text. */ interface QuestionAnswerData { /** Selected predefined options (option IDs) */ options: string[]; /** Custom text entered for an "Other" answer; mutually exclusive with options */ customText?: string; } /** * Map of question IDs to answer data. * Supports both multi-select options and custom "Other" text input. */ interface QuestionAnswers { [questionId: string]: QuestionAnswerData; } /** * A single step in the ephemeral activity trace shown during streaming. * Steps represent thinking, tool calls, or sub-agent delegations. */ interface ActivityStep { id: string; type: "thinking" | "tool" | "agent_delegation"; toolName: string; /** Raw tool arguments JSON string (used for label interpolation, e.g., delegation agent name). */ arguments?: string; agentName?: string; status: "active" | "completed" | "failed"; startedAt: number; completedAt?: number; durationMs?: number; error?: string; } type StreamEvent = { type: "content"; content: string; } | { type: "thinking"; content: string; } | { type: "tool_start"; tool: StreamToolPayload; } | { type: "tool_end"; tool: StreamToolPayload; } | { type: "usage"; usage: DebugUsage$1; } | { type: "user_message"; sessionId: string; } | { type: "interrupt"; interrupt: StreamInterruptPayload; sessionId?: string; } | { type: "text_block_end"; seq: number; } | { type: "done"; sessionId?: string; generationMs?: number; } | { type: "error"; error: string; }; /** Partial state when resuming a stream after refresh */ interface StreamSnapshotPayload { partialContent?: string; partialMetadata?: Record; } /** Active stream status for a session (from GET /stream/status) */ interface StreamStatus { active: boolean; runId?: string; snapshot?: StreamSnapshotPayload; startedAt?: number; } interface AsyncRunAccepted { accepted: true; operation: "question_submit" | "question_reject" | "session_compact"; sessionId: string; runId: string; startedAt: number; } /** * @deprecated Use `StreamEvent` instead. `StreamChunk` is kept for backwards * compatibility but the flat all-optional shape is unsound. */ interface StreamChunk { type: "chunk" | "content" | "thinking" | "tool_start" | "tool_end" | "usage" | "done" | "error" | "user_message" | "interrupt" | "snapshot" | "stream_started" | "text_block_end"; content?: string; error?: string; sessionId?: string; usage?: DebugUsage$1; tool?: StreamToolPayload; interrupt?: StreamInterruptPayload; generationMs?: number; timestamp?: number; snapshot?: StreamSnapshotPayload; /** Set when type is 'stream_started'; client should store for refresh-safe resume */ runId?: string; /** * Zero-based ordinal of the assistant text segment that just ended. * Populated only when type === "text_block_end". Used to split the * accumulated assistant content into distinct blocks interleaved with * tool_call UI (text → tool → text → tool → final_text). */ textBlockSeq?: number; } /** * Per-tenant active-run status event. Delivered via the * GET /bi-chat/stream/active-runs SSE endpoint. The first batch after * connect carries `event === "snapshot"` for each currently-running * session; subsequent rows carry `event === "update"` as runs * transition (queued → streaming → completed / cancelled / failed). */ interface ActiveRunDelivery { event: "snapshot" | "update"; sessionId: string; runId: string; status: "queued" | "streaming" | "completed" | "cancelled" | "failed"; updatedAt: number; } interface StreamInterruptPayload { checkpointId: string; agentName?: string; questions: StreamInterruptQuestion[]; } interface StreamInterruptQuestion { id: string; text: string; type: string; options: Array<{ id: string; label: string; }>; } interface DebugUsage$1 { promptTokens: number; completionTokens: number; totalTokens: number; cachedTokens?: number; cost?: number; } interface StreamToolPayload { callId?: string; name: string; arguments?: string; result?: string; error?: string; durationMs?: number; agentName?: string; } interface DebugTrace$1 { schemaVersion?: string; startedAt?: string; completedAt?: string; generationMs?: number; usage?: DebugUsage$1; tools: StreamToolPayload[]; attempts?: DebugGeneration$1[]; spans?: DebugSpan$1[]; events?: DebugEvent$1[]; traceId?: string; traceUrl?: string; sessionId?: string; thinking?: string; observationReason?: string; } interface DebugGeneration$1 { id?: string; requestId?: string; model?: string; provider?: string; finishReason?: string; promptTokens?: number; completionTokens?: number; totalTokens?: number; cachedTokens?: number; cost?: number; latencyMs?: number; input?: string; output?: string; thinking?: string; observationReason?: string; startedAt?: string; completedAt?: string; toolCalls?: StreamToolPayload[]; } interface DebugSpan$1 { id?: string; parentId?: string; generationId?: string; name?: string; type?: string; status?: string; level?: string; callId?: string; toolName?: string; input?: string; output?: string; error?: string; durationMs?: number; startedAt?: string; completedAt?: string; attributes?: Record; } interface DebugEvent$1 { id?: string; name?: string; type?: string; level?: string; message?: string; reason?: string; spanId?: string; generationId?: string; timestamp?: string; attributes?: Record; } interface DebugLimits { policyMaxTokens: number; modelMaxTokens: number; effectiveMaxTokens: number; completionReserveTokens: number; } interface SessionDebugUsage { promptTokens: number; completionTokens: number; totalTokens: number; turnsWithUsage: number; latestPromptTokens: number; latestCompletionTokens: number; latestTotalTokens: number; } interface SendMessageOptions { debugMode?: boolean; replaceFromMessageID?: string; reasoningEffort?: string; model?: string; /** * Client-generated idempotency key. Duplicate sends sharing the same * requestId within the backend's dedupe window (~30 min) converge on * a single server-side run. Omit to disable dedupe for a particular * send; the data source auto-generates one per call otherwise. */ requestId?: string; } interface SessionListResult$1 { sessions: Session$1[]; total: number; hasMore: boolean; } interface SessionUser$1 { id: string; firstName: string; lastName: string; initials: string; } interface SessionMember$1 { user: SessionUser$1; role: "owner" | "editor" | "viewer"; createdAt: string; updatedAt: string; } interface SessionGroup { name: string; sessions: Session$1[]; } /** * Full data source interface for BiChat. * * Combines session CRUD, message transport, and optional artifact/admin * methods. Existing implementations satisfy this without changes. * * For new code, prefer the focused interfaces (`SessionStore`, * `MessageTransport`, `ArtifactStore`, `AdminStore`) when you only need a * subset of capabilities. */ interface ChatDataSource { createSession(): Promise; fetchSession(id: string): Promise<{ session: Session$1; turns: ConversationTurn$1[]; pendingQuestion?: PendingQuestion$1 | null; } | null>; fetchSessionArtifacts?(sessionId: string, options?: { limit?: number; offset?: number; }): Promise<{ artifacts: SessionArtifact[]; hasMore?: boolean; nextOffset?: number; }>; uploadSessionArtifacts?(sessionId: string, files: File[]): Promise<{ artifacts: SessionArtifact[]; }>; renameSessionArtifact?(artifactId: string, name: string, description?: string): Promise; deleteSessionArtifact?(artifactId: string): Promise; sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator; clearSessionHistory(sessionId: string): Promise<{ success: boolean; deletedMessages: number; deletedArtifacts: number; }>; compactSessionHistory(sessionId: string): Promise; submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; rejectPendingQuestion(sessionId: string): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; /** * Stops the active stream for the given session. No partial assistant message is persisted. * Optional for backward compatibility with data sources that do not support stop. */ stopGeneration?(sessionId: string): Promise; /** * Returns active stream status for the session (for refresh-safe resume). * Optional; if absent, no resume/passive flow is used. */ getStreamStatus?(sessionId: string): Promise; /** * Resumes an active stream: delivers snapshot then new chunks. Use when getStreamStatus * reported active and the client has the same-browser run marker. * Optional; if absent, resume is not supported. */ resumeStream?(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise; /** * Tail a run via native EventSource against GET /stream/events. Honours * Last-Event-ID for auto-reconnect on wifi drops / tab sleep. Prefer * over resumeStream when connecting to a run that was started by * another tab (same request_id) or that needs to survive a reload * via cursor-based replay. Optional; data sources that don't * implement it fall back to resumeStream. */ subscribeRunEvents?(sessionId: string, runId: string, options: { lastEventId?: string; onChunk: (chunk: StreamChunk) => void; onError?: (event: Event) => void; signal?: AbortSignal; }): Promise; /** * Subscribe to the per-tenant active-run fan-out * (GET /stream/active-runs). Emits one "snapshot" event per * currently-running session on connect, then live "update" deltas. * Optional; data sources that don't implement it fall back to * per-session polling via getStreamStatus. */ subscribeActiveRuns?(options: { onEvent: (event: ActiveRunDelivery) => void; onError?: (event: Event) => void; signal?: AbortSignal; }): Promise; listSessions(options?: { limit?: number; offset?: number; includeArchived?: boolean; }): Promise; archiveSession(sessionId: string): Promise; unarchiveSession(sessionId: string): Promise; pinSession(sessionId: string): Promise; unpinSession(sessionId: string): Promise; deleteSession(sessionId: string): Promise; renameSession(sessionId: string, title: string): Promise; regenerateSessionTitle(sessionId: string): Promise; listUsers?(): Promise; listAllSessions?(options?: { limit?: number; offset?: number; includeArchived?: boolean; userId?: string | null; }): Promise<{ sessions: Session$1[]; total: number; hasMore: boolean; }>; listSessionMembers?(sessionId: string): Promise; addSessionMember?(sessionId: string, userId: string, role: "editor" | "viewer"): Promise; updateSessionMemberRole?(sessionId: string, userId: string, role: "editor" | "viewer"): Promise; removeSessionMember?(sessionId: string, userId: string): Promise; } interface ChatSessionStateValue { session: Session$1 | null; currentSessionId?: string; fetching: boolean; error: string | null; errorRetryable: boolean; debugMode: boolean; sessionDebugUsage: SessionDebugUsage; debugLimits: DebugLimits | null; reasoningEffort: string | undefined; reasoningEffortOptions: string[] | undefined; model: string | undefined; setError: (error: string | null) => void; retryFetchSession: () => void; setReasoningEffort: (effort: string) => void; setModel: (model: string | undefined) => void; } interface ChatMessagingStateValue { turns: ConversationTurn$1[]; streamingContent: string; isStreaming: boolean; streamError: string | null; streamErrorRetryable: boolean; loading: boolean; pendingQuestion: PendingQuestion$1 | null; codeOutputs: CodeOutput$1[]; isCompacting: boolean; compactionSummary: string | null; /** Bumped when artifacts should be refetched (e.g. tool_end for artifact-producing tools). */ artifactsInvalidationTrigger: number; /** Ephemeral reasoning/thinking content, cleared when final answer arrives. */ thinkingContent: string; /** Ephemeral activity steps (tools, thinking, delegations), cleared on done. */ activeSteps: ActivityStep[]; showActivityTrace: boolean; showTypingIndicator: boolean; sendMessage: (content: string, attachments?: Attachment$1[]) => Promise; handleRegenerate?: (turnId: string, model?: string) => Promise; handleEdit?: (turnId: string, newContent: string) => Promise; handleCopy: (text: string) => Promise; handleSubmitQuestionAnswers: (answers: QuestionAnswers) => void; handleRejectPendingQuestion: () => Promise; retryLastMessage: () => Promise; clearStreamError: () => void; cancel: () => void; setCodeOutputs: (outputs: CodeOutput$1[]) => void; } interface ChatInputStateValue { message: string; inputError: string | null; messageQueue: QueuedMessage[]; setMessage: (message: string) => void; setInputError: (error: string | null) => void; handleSubmit: (e: { preventDefault: () => void; }, attachments?: Attachment$1[]) => void; handleUnqueue: () => { content: string; attachments: Attachment$1[]; } | null; enqueueMessage: (content: string, attachments: Attachment$1[]) => boolean; removeQueueItem: (index: number) => void; updateQueueItem: (index: number, content: string) => void; } interface ChatSessionContextValue extends ChatSessionStateValue, ChatMessagingStateValue, ChatInputStateValue { /** * @deprecated Use `retryLastMessage` from `ChatMessagingStateValue` instead. * This field is not populated by the current ChatMachine-based provider and * will always be `undefined` at runtime. */ handleRetry?: () => Promise; } /** * Per-session rate limiter * Prevents excessive requests within a time window */ interface RateLimiterConfig { maxRequests: number; windowMs: number; } declare class RateLimiter { private timestamps; private maxRequests; private windowMs; constructor(config: RateLimiterConfig); /** * Check if a request can be made * Updates internal state if request is allowed */ canMakeRequest(): boolean; /** * Get milliseconds until next request is allowed * Returns 0 if request can be made immediately */ getTimeUntilNextRequest(): number; /** * Reset the rate limiter state */ reset(): void; } interface ChatSessionProps { dataSource: ChatDataSource; sessionId?: string; /** Optional rate limiter to throttle sendMessage */ rateLimiter?: RateLimiter; /** * Called when a new session is created (e.g. on first message in a "new * chat"). Use this to navigate your SPA router to the new session URL. */ onSessionCreated?: (sessionId: string) => void; /** Alias for isReadOnly (preferred) */ readOnly?: boolean; isReadOnly?: boolean; /** Custom render function for user turns */ renderUserTurn?: (turn: ConversationTurn$1) => ReactNode; /** Custom render function for assistant turns */ renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode; className?: string; /** Custom content to display as header */ headerSlot?: ReactNode; /** Custom welcome screen component (replaces default WelcomeContent) */ welcomeSlot?: ReactNode; /** Custom logo for the header */ logoSlot?: ReactNode; /** Custom action buttons for the header */ actionsSlot?: ReactNode; /** Custom content rendered above the message input (e.g., model selector) */ inputHeaderSlot?: ReactNode; /** Callback when user navigates back */ onBack?: () => void; /** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */ thinkingVerbs?: string[]; /** Callback invoked after an archived session is restored (e.g. to navigate or refresh) */ onSessionRestored?: (sessionId: string) => void; /** Enables the built-in right-side artifacts panel for persisted session artifacts */ showArtifactsPanel?: boolean; /** Initial expanded state for artifacts panel when no persisted preference exists */ artifactsPanelDefaultExpanded?: boolean; /** localStorage key for artifacts panel expanded/collapsed state */ artifactsPanelStorageKey?: string; } declare function ChatSession(props: ChatSessionProps): react_jsx_runtime.JSX.Element; declare function ModelSelector(): react_jsx_runtime.JSX.Element | null; interface SessionArtifactsPanelProps { dataSource: ChatDataSource; sessionId: string; isStreaming: boolean; allowDrop?: boolean; className?: string; /** When provided, used instead of useChatMessaging().artifactsInvalidationTrigger (allows use outside SDK ChatSessionProvider). */ artifactsInvalidationTrigger?: number; } declare function SessionArtifactsPanel({ dataSource, sessionId, isStreaming, allowDrop, className, artifactsInvalidationTrigger: artifactsInvalidationTriggerProp, }: SessionArtifactsPanelProps): react_jsx_runtime.JSX.Element; interface SessionArtifactListProps { artifacts: SessionArtifact[]; selectedArtifactId?: string; onSelect: (artifact: SessionArtifact) => void; } declare function SessionArtifactList({ artifacts, selectedArtifactId, onSelect, }: SessionArtifactListProps): react_jsx_runtime.JSX.Element; interface SessionArtifactPreviewProps { artifact: SessionArtifact; } declare function SessionArtifactPreview({ artifact }: SessionArtifactPreviewProps): react_jsx_runtime.JSX.Element; interface ChatHeaderProps { session: Session$1 | null; onBack?: () => void; readOnly?: boolean; /** Custom logo component to display */ logoSlot?: ReactNode; /** Custom action buttons */ actionsSlot?: ReactNode; /** Members to display in avatar stack for group chats */ members?: Array<{ firstName: string; lastName: string; initials?: string; }>; /** Callback when avatar stack is clicked (to open members modal) */ onMembersClick?: () => void; } declare function ChatHeader({ session, onBack, readOnly, logoSlot, actionsSlot, members, onMembersClick }: ChatHeaderProps): react_jsx_runtime.JSX.Element; interface MessageListProps { renderUserTurn?: (turn: ConversationTurn$1) => ReactNode; renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode; thinkingVerbs?: string[]; readOnly?: boolean; } declare function MessageList({ renderUserTurn, renderAssistantTurn, thinkingVerbs, readOnly }: MessageListProps): react_jsx_runtime.JSX.Element; interface UserMessageAvatarSlotProps { /** Default initials */ initials: string; } interface UserMessageContentSlotProps { /** Message content text */ content: string; } interface UserMessageAttachmentsSlotProps { /** Message attachments */ attachments: Attachment$1[]; /** Handler to open image viewer */ onView: (index: number) => void; } interface UserMessageActionsSlotProps { /** Copy content to clipboard */ onCopy: () => void; /** Edit message (if available) */ onEdit?: () => void; /** Formatted timestamp */ timestamp: string; /** Whether copy action is available */ canCopy: boolean; /** Whether edit action is available */ canEdit: boolean; } interface UserMessageSlots { /** Custom avatar renderer */ avatar?: ReactNode | ((props: UserMessageAvatarSlotProps) => ReactNode); /** Custom content renderer */ content?: ReactNode | ((props: UserMessageContentSlotProps) => ReactNode); /** Custom attachments renderer */ attachments?: ReactNode | ((props: UserMessageAttachmentsSlotProps) => ReactNode); /** Custom actions renderer */ actions?: ReactNode | ((props: UserMessageActionsSlotProps) => ReactNode); } interface UserMessageClassNames { /** Root container */ root?: string; /** Inner content wrapper */ wrapper?: string; /** Avatar container */ avatar?: string; /** Message bubble */ bubble?: string; /** Content text */ content?: string; /** Attachments container */ attachments?: string; /** Actions container */ actions?: string; /** Action button */ actionButton?: string; /** Timestamp */ timestamp?: string; } interface UserMessageProps { /** User turn data */ turn: UserTurn$1; /** Turn ID for edit operations */ turnId?: string; /** User initials for avatar */ initials?: string; /** Optional sender name for shared/group chats */ authorName?: string; /** Slot overrides */ slots?: UserMessageSlots; /** Class name overrides */ classNames?: UserMessageClassNames; /** Copy handler */ onCopy?: (content: string) => Promise | void; /** Edit handler */ onEdit?: (turnId: string, newContent: string) => void; /** Hide avatar */ hideAvatar?: boolean; /** Hide actions */ hideActions?: boolean; /** Hide timestamp */ hideTimestamp?: boolean; /** Whether edit action should be available */ allowEdit?: boolean; } declare function UserMessage({ turn, turnId, initials, authorName, slots, classNames: classNameOverrides, onCopy, onEdit, hideAvatar, hideActions, hideTimestamp, allowEdit, }: UserMessageProps): react_jsx_runtime.JSX.Element; interface UserTurnViewProps { /** The conversation turn containing the user message */ turn: ConversationTurn$1; /** Slot overrides for customization */ slots?: UserMessageSlots; /** Class name overrides */ classNames?: UserMessageClassNames; /** User initials for avatar */ initials?: string; /** Hide avatar */ hideAvatar?: boolean; /** Hide actions */ hideActions?: boolean; /** Hide timestamp */ hideTimestamp?: boolean; /** Whether edit action should be available */ allowEdit?: boolean; /** Show sender identity label above the message bubble */ showAuthorName?: boolean; } declare function UserTurnView({ turn, slots, classNames, initials, hideAvatar, hideActions, hideTimestamp, allowEdit, showAuthorName, }: UserTurnViewProps): react_jsx_runtime.JSX.Element; interface AssistantMessageAvatarSlotProps { /** Default text */ text: string; } interface AssistantMessageContentSlotProps { /** Message content (markdown) */ content: string; /** Citations */ citations?: Citation$1[]; /** Whether streaming is active */ isStreaming: boolean; } interface AssistantMessageSourcesSlotProps { /** Citations to display */ citations: Citation$1[]; } interface AssistantMessageChartsSlotProps { /** Chart data array */ charts: ChartData[]; } interface AssistantMessageCodeOutputsSlotProps { /** Code execution outputs */ outputs: CodeOutput$1[]; } interface AssistantMessageTablesSlotProps { /** Interactive table payloads */ tables: RenderTableData[]; } interface AssistantMessageArtifactsSlotProps { /** Downloadable artifacts */ artifacts: Artifact$1[]; } interface AssistantMessageActionsSlotProps { /** Copy content to clipboard */ onCopy: () => void; /** Regenerate response, optionally with a specific model id */ onRegenerate?: (model?: string) => void; /** Available models that can be picked for regenerate */ regenerateModels?: RegenerateModelOption[]; /** Formatted timestamp */ timestamp: string; /** Whether copy action is available */ canCopy: boolean; /** Whether regenerate action is available */ canRegenerate: boolean; } interface RegenerateModelOption { /** Model id passed to onRegenerate */ id: string; /** Translation key (or label) shown in the picker */ label: string; } interface AssistantMessageExplanationSlotProps { /** Explanation content (markdown) */ explanation: string; /** Whether expanded */ isExpanded: boolean; /** Toggle expansion */ onToggle: () => void; } interface AssistantMessageSlots { /** Custom avatar renderer */ avatar?: ReactNode | ((props: AssistantMessageAvatarSlotProps) => ReactNode); /** Custom content renderer */ content?: ReactNode | ((props: AssistantMessageContentSlotProps) => ReactNode); /** Custom sources renderer */ sources?: ReactNode | ((props: AssistantMessageSourcesSlotProps) => ReactNode); /** Custom charts renderer */ charts?: ReactNode | ((props: AssistantMessageChartsSlotProps) => ReactNode); /** Custom code outputs renderer */ codeOutputs?: ReactNode | ((props: AssistantMessageCodeOutputsSlotProps) => ReactNode); /** Custom table renderer */ tables?: ReactNode | ((props: AssistantMessageTablesSlotProps) => ReactNode); /** Custom artifacts renderer */ artifacts?: ReactNode | ((props: AssistantMessageArtifactsSlotProps) => ReactNode); /** Custom actions renderer */ actions?: ReactNode | ((props: AssistantMessageActionsSlotProps) => ReactNode); /** Custom explanation renderer */ explanation?: ReactNode | ((props: AssistantMessageExplanationSlotProps) => ReactNode); } interface AssistantMessageClassNames { /** Root container */ root?: string; /** Inner content wrapper */ wrapper?: string; /** Avatar container */ avatar?: string; /** Message bubble */ bubble?: string; /** Code outputs container */ codeOutputs?: string; /** Charts container */ charts?: string; /** Tables container */ tables?: string; /** Artifacts container */ artifacts?: string; /** Sources container */ sources?: string; /** Explanation container */ explanation?: string; /** Actions container */ actions?: string; /** Action button */ actionButton?: string; /** Timestamp */ timestamp?: string; } interface AssistantMessageProps { /** Assistant turn data */ turn: AssistantTurn$1; /** Turn ID for regenerate operations */ turnId?: string; /** When true, this is the last turn (Regenerate button shown only on last assistant message) */ isLastTurn?: boolean; /** Whether response is being streamed */ isStreaming?: boolean; /** Pending question for HITL */ pendingQuestion?: PendingQuestion$1 | null; /** Slot overrides */ slots?: AssistantMessageSlots; /** Class name overrides */ classNames?: AssistantMessageClassNames; /** Copy handler */ onCopy?: (content: string) => Promise | void; /** Regenerate handler. The optional `model` argument is the id chosen from the * Fast/Deep picker; when omitted the current session model is used. */ onRegenerate?: (turnId: string, model?: string) => Promise | void; /** Models offered when the user clicks the regenerate button. When two or more * options are provided a Fast/Deep picker is shown; otherwise regenerate is * triggered immediately with the active model. */ regenerateModels?: RegenerateModelOption[]; /** Send message handler (for markdown links) */ onSendMessage?: (content: string) => void; /** Whether sending is disabled */ sendDisabled?: boolean; /** Hide avatar */ hideAvatar?: boolean; /** Hide actions */ hideActions?: boolean; /** Hide timestamp */ hideTimestamp?: boolean; /** Show debug panel */ showDebug?: boolean; } declare function AssistantMessage({ turn, turnId, isLastTurn, isStreaming, pendingQuestion, slots, classNames: classNameOverrides, onCopy, onRegenerate, regenerateModels, onSendMessage, sendDisabled, hideAvatar, hideActions, hideTimestamp, showDebug, }: AssistantMessageProps): react_jsx_runtime.JSX.Element; interface AssistantTurnViewProps { /** The conversation turn containing the assistant response */ turn: ConversationTurn$1; /** When true, this is the last turn in the list (Regenerate button shown only on last assistant message) */ isLastTurn?: boolean; /** Whether the response is currently being streamed */ isStreaming?: boolean; /** Slot overrides for customization */ slots?: AssistantMessageSlots; /** Class name overrides */ classNames?: AssistantMessageClassNames; /** Hide avatar */ hideAvatar?: boolean; /** Hide actions */ hideActions?: boolean; /** Hide timestamp */ hideTimestamp?: boolean; /** Whether regenerate action should be available */ allowRegenerate?: boolean; } declare function AssistantTurnView({ turn, isLastTurn, isStreaming, slots, classNames, hideAvatar, hideActions, hideTimestamp, allowRegenerate, }: AssistantTurnViewProps): react_jsx_runtime.JSX.Element | null; interface TurnBubbleClassNames { /** Root container */ root?: string; /** User turn wrapper */ userTurn?: string; /** Assistant turn wrapper */ assistantTurn?: string; } interface TurnBubbleProps { /** The conversation turn containing user and optional assistant content */ turn: ConversationTurn$1; /** When true, this turn is the last in the list (e.g. Regenerate shows only on last assistant message) */ isLastTurn?: boolean; /** Custom render function for user turn (full control) */ renderUserTurn?: (turn: ConversationTurn$1) => ReactNode; /** Custom render function for assistant turn (full control) */ renderAssistantTurn?: (turn: ConversationTurn$1) => ReactNode; /** Props passed to UserTurnView (when not using custom renderer) */ userTurnProps?: Omit; /** Props passed to AssistantTurnView (when not using custom renderer) */ assistantTurnProps?: Omit; /** Slots for user message customization */ userMessageSlots?: UserMessageSlots; /** Slots for assistant message customization */ assistantMessageSlots?: AssistantMessageSlots; /** Class names for user message */ userMessageClassNames?: UserMessageClassNames; /** Class names for assistant message */ assistantMessageClassNames?: AssistantMessageClassNames; /** Class names for turn bubble container */ classNames?: TurnBubbleClassNames; /** Whether assistant response is streaming */ isStreaming?: boolean; } declare function TurnBubble({ turn, isLastTurn, renderUserTurn, renderAssistantTurn, userTurnProps, assistantTurnProps, userMessageSlots, assistantMessageSlots, userMessageClassNames, assistantMessageClassNames, classNames, isStreaming, }: TurnBubbleProps): react_jsx_runtime.JSX.Element; interface MarkdownRendererProps { /** Markdown content to render */ content: string; /** Optional citations to process and display */ citations?: Citation$1[] | null; /** Optional function to send messages (enables table export) */ sendMessage?: (content: string) => void; /** Whether message sending is disabled */ sendDisabled?: boolean; /** Copy button label for code blocks */ copyLabel?: string; /** Copied confirmation label for code blocks */ copiedLabel?: string; /** Export button label for tables */ exportLabel?: string; } declare function MarkdownRenderer({ content, citations, sendMessage, sendDisabled, copyLabel, copiedLabel, exportLabel, }: MarkdownRendererProps): react_jsx_runtime.JSX.Element; declare const MemoizedMarkdownRenderer: react.MemoExoticComponent; /** External container control. When provided, the card runs in embedded mode. */ interface ChartCardHost { isFullscreen: boolean; } interface ChartCardProps { chartData: ChartData; onExportError?: (error: string) => void; /** When provided, the card runs in embedded mode — strips outer chrome, fills container height in fullscreen. */ host?: ChartCardHost; } /** * ChartCard renders a single chart visualization with optional PNG export. */ declare function ChartCard({ chartData, onExportError, host }: ChartCardProps): react_jsx_runtime.JSX.Element; interface SourcesPanelProps { citations: Citation$1[]; } declare function SourcesPanel({ citations }: SourcesPanelProps): react_jsx_runtime.JSX.Element | null; interface DownloadCardProps { artifact: Artifact$1; } declare function DownloadCard({ artifact }: DownloadCardProps): react_jsx_runtime.JSX.Element; interface InlineQuestionFormProps { pendingQuestion: PendingQuestion$1; } declare function InlineQuestionForm({ pendingQuestion, }: InlineQuestionFormProps): react_jsx_runtime.JSX.Element; interface MessageInputRef { focus: () => void; clear: () => void; } interface MessageInputProps { message: string; loading: boolean; isStreaming?: boolean; fetching?: boolean; disabled?: boolean; commandError?: string | null; debugMode?: boolean; debugSessionUsage?: SessionDebugUsage; debugLimits?: DebugLimits | null; messageQueue?: QueuedMessage[]; onClearCommandError?: () => void; onMessageChange: (value: string) => void; onSubmit: (e: React.FormEvent, attachments: Attachment$1[]) => void; onCancelStreaming?: () => void; onUnqueue?: () => { content: string; attachments: Attachment$1[]; } | null; onRemoveQueueItem?: (index: number) => void; onUpdateQueueItem?: (index: number, content: string) => void; placeholder?: string; maxFiles?: number; maxFileSize?: number; containerClassName?: string; formClassName?: string; reasoningEffortOptions?: string[]; reasoningEffort?: string; onReasoningEffortChange?: (effort: string) => void; } declare const MessageInput: react.ForwardRefExoticComponent>; interface AttachmentGridProps { attachments: Attachment$1[]; onRemove?: (index: number) => void; onView?: (index: number) => void; className?: string; readonly?: boolean; maxDisplay?: number; maxCapacity?: number; emptyMessage?: string; showCount?: boolean; /** Number of files currently being processed (shows shimmer placeholders) */ pendingCount?: number; } declare function AttachmentGrid({ attachments, onRemove, onView, className, readonly, maxDisplay, maxCapacity, emptyMessage, showCount, pendingCount, }: AttachmentGridProps): react_jsx_runtime.JSX.Element | null; declare const MemoizedAttachmentGrid: react__default.MemoExoticComponent; interface ImageModalProps { isOpen: boolean; onClose: () => void; attachment: ImageAttachment; allAttachments?: ImageAttachment[]; currentIndex?: number; onNavigate?: (direction: 'prev' | 'next') => void; } declare function ImageModal({ isOpen, onClose, attachment, allAttachments, currentIndex, onNavigate, }: ImageModalProps): react_jsx_runtime.JSX.Element; interface WelcomeContentProps { onPromptSelect?: (prompt: string) => void; title?: string; description?: string; disabled?: boolean; /** Custom prompts to replace the default i18n prompts. Icons cycle from defaults if not provided. */ prompts?: Array<{ category: string; text: string; icon?: Icon; }>; } declare function WelcomeContent({ onPromptSelect, title, description, disabled, prompts: customPrompts, }: WelcomeContentProps): react_jsx_runtime.JSX.Element; interface CodeOutputsPanelProps { outputs: CodeOutput$1[]; } declare function CodeOutputsPanel({ outputs }: CodeOutputsPanelProps): react_jsx_runtime.JSX.Element | null; /** * StreamingCursor Component * Animated cursor shown during AI response streaming */ declare function StreamingCursor(): react_jsx_runtime.JSX.Element; /** * ScrollToBottomButton Component * Floating button to scroll chat to bottom, shown when user scrolls up */ interface ScrollToBottomButtonProps { show: boolean; onClick: () => void; unreadCount?: number; disabled?: boolean; /** When set, renders a pill-style button with this label (e.g. "New messages") */ label?: string; } declare function ScrollToBottomButton({ show, onClick, unreadCount, disabled, label, }: ScrollToBottomButtonProps): react_jsx_runtime.JSX.Element; interface CompactionDoodleProps { title: string; subtitle: string; } declare function CompactionDoodle({ title, subtitle }: CompactionDoodleProps): react_jsx_runtime.JSX.Element; interface EmptyStateProps { /** Optional icon to display */ icon?: ReactNode; /** Main title text */ title: string; /** Optional description text */ description?: string; /** Optional action element (button, link, etc.) */ action?: ReactNode; /** Additional CSS classes */ className?: string; /** Size variant */ size?: 'sm' | 'md' | 'lg'; } declare function EmptyState({ icon, title, description, action, className, size, }: EmptyStateProps): react_jsx_runtime.JSX.Element; declare const MemoizedEmptyState: react.MemoExoticComponent; /** * EditableText Component * Inline editable text with double-click to edit * Features: auto-focus, auto-select, Enter to save, Escape to cancel * Can be triggered programmatically via ref.startEditing() */ interface EditableTextProps { /** Current text value */ value: string; /** Callback when text is saved */ onSave: (newValue: string) => void; /** Maximum character length */ maxLength?: number; /** Whether the component is in loading state */ isLoading?: boolean; /** Placeholder text when empty */ placeholder?: string; /** Additional CSS classes for the text display */ className?: string; /** Additional CSS classes for the input */ inputClassName?: string; /** Font size variant */ size?: 'sm' | 'md' | 'lg'; } interface EditableTextRef { /** Programmatically start editing mode */ startEditing: () => void; /** Programmatically cancel editing */ cancelEditing: () => void; } declare const MemoizedEditableText: react.MemoExoticComponent>>; /** * SearchInput Component * Reusable search input with icon, clear button, and keyboard shortcuts */ interface SearchInputProps { /** Current search value */ value: string; /** Callback when value changes */ onChange: (value: string) => void; /** Placeholder text */ placeholder?: string; /** Auto-focus on mount */ autoFocus?: boolean; /** Callback when Enter is pressed */ onSubmit?: (value: string) => void; /** Callback when Escape is pressed */ onEscape?: () => void; /** Additional CSS classes for the container */ className?: string; /** Size variant */ size?: 'sm' | 'md' | 'lg'; /** Disable the input */ disabled?: boolean; /** ARIA label for accessibility */ ariaLabel?: string; } declare function SearchInput({ value, onChange, placeholder, autoFocus, onSubmit, onEscape, className, size, disabled, ariaLabel, }: SearchInputProps): react_jsx_runtime.JSX.Element; declare const MemoizedSearchInput: react.MemoExoticComponent; /** * Skeleton Component * Reusable loading skeleton with multiple variants */ interface SkeletonProps { /** Skeleton variant */ variant?: 'text' | 'circular' | 'rectangular' | 'rounded'; /** Width (CSS value or number for pixels) */ width?: string | number; /** Height (CSS value or number for pixels) */ height?: string | number; /** Additional CSS classes */ className?: string; /** Enable animation */ animate?: boolean; } interface SkeletonGroupProps { /** Number of skeleton items to render */ count?: number; /** Gap between items */ gap?: 'sm' | 'md' | 'lg'; /** Additional CSS classes for the container */ className?: string; /** Render function for each skeleton item */ children?: (index: number) => React.ReactNode; } declare function Skeleton({ variant, width, height, className, animate, }: SkeletonProps): react_jsx_runtime.JSX.Element; /** * SkeletonGroup - Renders multiple skeleton items */ declare function SkeletonGroup({ count, gap, className, children, }: SkeletonGroupProps): react_jsx_runtime.JSX.Element; /** * SkeletonText - Text line skeleton with configurable width */ declare function SkeletonText({ lines, className, }: { lines?: number; className?: string; }): react_jsx_runtime.JSX.Element; /** * SkeletonAvatar - Circular avatar skeleton */ declare function SkeletonAvatar({ size, className, }: { size?: number; className?: string; }): react_jsx_runtime.JSX.Element; /** * SkeletonCard - Card-shaped skeleton */ declare function SkeletonCard({ width, height, className, }: { width?: string | number; height?: string | number; className?: string; }): react_jsx_runtime.JSX.Element; /** * ListItemSkeleton - Common list item skeleton with icon and text */ declare function ListItemSkeleton({ className }: { className?: string; }): react_jsx_runtime.JSX.Element; declare const MemoizedSkeleton: react.MemoExoticComponent; /** * CodeBlock Component * Syntax highlighted code blocks with copy functionality and dark mode support */ interface CodeBlockProps { /** Programming language for syntax highlighting */ language: string; /** Code content to display */ value: string; /** Whether to render as inline code */ inline?: boolean; /** Copy button label (defaults to "Copy") */ copyLabel?: string; /** Copied confirmation label (defaults to "Copied!") */ copiedLabel?: string; } declare function CodeBlock({ language, value, inline, copyLabel, copiedLabel, }: CodeBlockProps): react_jsx_runtime.JSX.Element; declare const MemoizedCodeBlock: react.MemoExoticComponent; /** * LoadingSpinner Component * Displays animated loading indicators */ type SpinnerVariant = 'spinner' | 'dots' | 'pulse'; interface LoadingSpinnerProps { variant?: SpinnerVariant; size?: 'sm' | 'md' | 'lg'; message?: string; } declare function LoadingSpinner({ variant, size, message }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element; declare const MemoizedLoadingSpinner: react.MemoExoticComponent; /** * TableExportButton Component * Small inline button for exporting markdown tables to Excel */ interface TableExportButtonProps { /** Click handler for export action */ onClick: () => void; /** Whether the button should be disabled */ disabled?: boolean; /** Export button label (defaults to "Export") */ label?: string; /** Disabled tooltip text */ disabledTooltip?: string; } declare const TableExportButton: react.NamedExoticComponent; interface TableWithExportProps { /** The table content to render */ children: ReactNode; /** Function to send a message (from chat context) */ sendMessage?: (content: string) => void; /** Whether sending is disabled (loading or streaming) */ disabled?: boolean; /** Custom export message to send */ exportMessage?: string; /** Export button label */ exportLabel?: string; } declare const TableWithExport: react.NamedExoticComponent; type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'url' | 'null'; interface FormattedCell { display: string; raw: unknown; type: ColumnType; isNull: boolean; } interface ColumnMeta { index: number; name: string; header: string; type: ColumnType; width: number | null; visible: boolean; } interface SortState { columnIndex: number; direction: 'asc' | 'desc'; } interface ColumnStats { sum: number; avg: number; min: number; max: number; count: number; nullCount: number; } interface DataTableOptions { defaultPageSize?: number; enableSearch?: boolean; enableSort?: boolean; enableResize?: boolean; enableColumnVisibility?: boolean; } interface UseDataTableReturn { columns: ColumnMeta[]; visibleColumns: ColumnMeta[]; page: number; pageSize: number; totalPages: number; totalFilteredRows: number; pageSizeOptions: number[]; pageRows: unknown[][]; setPage: (page: number) => void; setPageSize: (size: number) => void; sort: SortState | null; toggleSort: (columnIndex: number) => void; clearSort: () => void; searchQuery: string; setSearchQuery: (query: string) => void; columnStats: Map; toggleColumnVisibility: (columnIndex: number) => void; resetColumnVisibility: () => void; setColumnWidth: (columnIndex: number, width: number) => void; formatCell: (value: unknown, columnIndex: number) => FormattedCell; getCellAlignment: (columnIndex: number) => 'left' | 'right'; getTableAsTSV: () => string; } declare function useDataTable(table: RenderTableData, options?: DataTableOptions): UseDataTableReturn; /** External container control. When provided, the card runs in embedded mode. */ interface TableCardHost { onToggleFullscreen: () => void; isFullscreen: boolean; } interface InteractiveTableCardProps { table: RenderTableData; onSendMessage?: (content: string) => void; sendDisabled?: boolean; options?: DataTableOptions; /** When provided, the card runs in embedded mode — strips outer chrome, hides header, delegates fullscreen to the host. */ host?: TableCardHost; } declare const InteractiveTableCard: react.NamedExoticComponent; interface TabbedTableGroupProps { tables: RenderTableData[]; onSendMessage?: (content: string) => void; sendDisabled?: boolean; } declare const TabbedTableGroup: react.NamedExoticComponent; interface TabbedChartGroupProps { charts: ChartData[]; } declare const TabbedChartGroup: react.NamedExoticComponent; /** * useToast Hook * Manages toast notification state */ type ToastType = 'success' | 'error' | 'info' | 'warning'; interface ToastAction { label: string; onClick: () => void; } interface ToastItem { id: string; type: ToastType; message: string; duration?: number; action?: ToastAction; } interface UseToastReturn { toasts: ToastItem[]; success: (msg: string, duration?: number, action?: ToastAction) => void; error: (msg: string, duration?: number, action?: ToastAction) => void; info: (msg: string, duration?: number, action?: ToastAction) => void; warning: (msg: string, duration?: number, action?: ToastAction) => void; dismiss: (id: string) => void; dismissAll: () => void; } /** * Hook for managing toast notifications * * @example * ```tsx * const { toasts, success, error, dismiss } = useToast() * * // Show a success toast * success('Operation completed!') * * // Show an error toast with custom duration * error('Something went wrong', 10000) * * // Render toasts * * ``` */ declare function useToast(): UseToastReturn; interface ToastProps { id: string; type: ToastType; message: string; duration?: number; onDismiss: (id: string) => void; /** Label for dismiss button (defaults to "Dismiss") */ dismissLabel?: string; /** Optional action button rendered in the toast */ action?: ToastAction; } declare function Toast({ id, type, message, duration, onDismiss, dismissLabel, action, }: ToastProps): react_jsx_runtime.JSX.Element; interface ToastContainerProps { toasts: ToastItem[]; onDismiss: (id: string) => void; /** Label for dismiss buttons */ dismissLabel?: string; } declare function ToastContainer({ toasts, onDismiss, dismissLabel }: ToastContainerProps): react_jsx_runtime.JSX.Element | null; /** * ConfirmModal Component * Polished confirmation dialog with contextual icon, refined typography, * and smooth micro-interactions. * Uses @headlessui/react Dialog for accessible modal behavior. */ interface ConfirmModalProps { /** Whether the modal is open */ isOpen: boolean; /** Modal title */ title: string; /** Modal message/description */ message: string; /** Callback when user confirms */ onConfirm: () => void; /** Callback when user cancels */ onCancel: () => void; /** Confirm button text (defaults to "Confirm") */ confirmText?: string; /** Cancel button text (defaults to "Cancel") */ cancelText?: string; /** Whether this is a danger/destructive action (red confirm button) */ isDanger?: boolean; } declare function ConfirmModalBase({ isOpen, title, message, onConfirm, onCancel, confirmText, cancelText, isDanger, }: ConfirmModalProps): react_jsx_runtime.JSX.Element; declare const ConfirmModal: react.MemoExoticComponent; /** * UserAvatar Component * Displays user initials with deterministic color from a color palette */ interface UserAvatarProps { /** User's first name */ firstName: string; /** User's last name */ lastName: string; /** Override initials (defaults to first letters of first and last name) */ initials?: string; /** Avatar size */ size?: 'xs' | 'sm' | 'md' | 'lg'; /** Additional CSS classes */ className?: string; } declare function UserAvatar({ firstName, lastName, initials: providedInitials, size, className, }: UserAvatarProps): react_jsx_runtime.JSX.Element; declare const MemoizedUserAvatar: react.MemoExoticComponent; /** * AvatarStack Component * Displays overlapping user avatars with an overflow "+N" indicator. * Used in ChatHeader and SessionItem for group chat visualization. */ interface AvatarStackProps { /** List of users to display */ users: Array<{ firstName: string; lastName: string; initials?: string; }>; /** Maximum avatars to show before "+N" (default: 3) */ max?: number; /** Avatar size */ size?: 'xs' | 'sm'; /** Click handler — makes the stack interactive */ onClick?: () => void; /** Additional CSS classes */ className?: string; } declare function AvatarStackInner({ users, max, size, onClick, className, }: AvatarStackProps): react_jsx_runtime.JSX.Element; declare const AvatarStack: react.MemoExoticComponent; interface SessionMembersModalProps { isOpen: boolean; sessionId?: string; dataSource: ChatDataSource; onClose: () => void; } declare function SessionMembersModal({ isOpen, sessionId, dataSource, onClose }: SessionMembersModalProps): react_jsx_runtime.JSX.Element; interface PermissionGuardProps { /** Permission names to check */ permissions: string[]; /** Check mode: 'all' requires all permissions (AND), 'any' requires at least one (OR) */ mode?: 'all' | 'any'; /** Function to check if user has a specific permission */ hasPermission: (permission: string) => boolean; /** Fallback to render when permissions are not satisfied */ fallback?: ReactNode; /** Children to render when permissions are satisfied */ children: ReactNode; } /** * Permission guard component. * Conditionally renders children based on permission checks. */ declare function PermissionGuard({ permissions, mode, hasPermission, fallback, children, }: PermissionGuardProps): react_jsx_runtime.JSX.Element; interface ErrorBoundaryProps { children: ReactNode; /** Optional custom error UI */ fallback?: ReactNode | ((error: Error | null, reset: () => void) => ReactNode); /** Callback when an error is caught */ onError?: (error: Error, errorInfo: ErrorInfo) => void; /** Pre-translated strings for the emergency fallback (hook-free). Cache these before errors occur. */ emergencyStrings?: { title: string; fallback: string; retry: string; }; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; } /** * Default error UI component */ declare function DefaultErrorContent({ error, onReset, resetLabel, errorTitle, }: { error: Error | null; onReset?: () => void; resetLabel?: string; errorTitle?: string; }): react_jsx_runtime.JSX.Element; declare class ErrorBoundary extends Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): ErrorBoundaryState; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; handleReset: () => void; handleFallbackError: (error: Error, errorInfo: ErrorInfo) => void; render(): string | number | boolean | Iterable | react_jsx_runtime.JSX.Element | null | undefined; } /** * TypingIndicator Component * Displays rotating verbs with shimmer animation to show AI is thinking/processing. * Verbs are configurable via props. When not provided, defaults are pulled from translations. */ interface TypingIndicatorProps { /** Custom thinking verbs to rotate through */ verbs?: string[]; /** Verb rotation interval in ms (defaults to 3000) */ rotationInterval?: number; /** Additional CSS classes */ className?: string; } declare function TypingIndicator({ verbs: verbsProp, rotationInterval, className, }: TypingIndicatorProps): react_jsx_runtime.JSX.Element; declare const MemoizedTypingIndicator: react.MemoExoticComponent; interface ActivityTraceProps { thinkingContent: string; activeSteps: ActivityStep[]; /** Consumer tool label prefix (e.g. 'Ali.Tools') for custom tool translations. */ toolLabelPrefix?: string; className?: string; } declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null; declare const ActivityTrace: react.MemoExoticComponent; type ActiveTab = 'my-chats' | 'all-chats'; interface SidebarProps { dataSource: ChatDataSource; onSessionSelect: (sessionId: string) => void; onNewChat: () => void; onArchivedView?: () => void; activeSessionId?: string; creating?: boolean; showAllChatsTab?: boolean; isOpen?: boolean; onClose?: () => void; headerSlot?: react__default.ReactNode; footerSlot?: react__default.ReactNode; className?: string; /** Controlled active tab. When provided, overrides internal state. */ activeTab?: ActiveTab; /** Called when tab changes. Use with activeTab for controlled mode. */ onTabChange?: (tab: ActiveTab) => void; } declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, activeTab: controlledActiveTab, onTabChange, }: SidebarProps): react_jsx_runtime.JSX.Element; /** * SessionItem Component * Individual chat session item in the sidebar with actions menu * Router-agnostic: uses onSelect callback instead of Link */ interface SessionItemProps { session: Session$1; isActive: boolean; mode?: 'active' | 'archived'; onSelect: (sessionId: string) => void; onArchive?: () => void; onRestore?: () => void; onPin?: () => void; onRename?: (newTitle: string) => void; onRegenerateTitle?: () => void; onDelete?: () => void; testIdPrefix?: string; className?: string; } declare const SessionItem: react__default.NamedExoticComponent; interface ArchivedChatListProps { dataSource: ChatDataSource; onBack: () => void; onSessionSelect: (sessionId: string) => void; activeSessionId?: string; className?: string; toast?: UseToastReturn; } declare function ArchivedChatList({ dataSource, onBack, onSessionSelect, activeSessionId, className, toast: toastFromProps, }: ArchivedChatListProps): react_jsx_runtime.JSX.Element; interface AllChatsListProps { dataSource: ChatDataSource; onSessionSelect: (sessionId: string) => void; activeSessionId?: string; } declare function AllChatsList({ dataSource, onSessionSelect, activeSessionId }: AllChatsListProps): react_jsx_runtime.JSX.Element; interface UserFilterProps { users: SessionUser$1[]; selectedUser: SessionUser$1 | null; onUserChange: (user: SessionUser$1 | null) => void; loading?: boolean; } declare function UserFilter({ users, selectedUser, onUserChange, loading }: UserFilterProps): react_jsx_runtime.JSX.Element; declare const MemoizedUserFilter: react.MemoExoticComponent; interface DateGroupHeaderProps { groupName: string; count: number; } /** * Sticky header for date-based session groups * Displays group name and session count */ declare function DateGroupHeader({ groupName, count }: DateGroupHeaderProps): react_jsx_runtime.JSX.Element; interface SessionSkeletonProps { count?: number; } declare function SessionSkeleton({ count }: SessionSkeletonProps): react_jsx_runtime.JSX.Element; /** * useSidebarState — mobile breakpoint detection + drawer open/close state. * SSR-safe. Auto-closes drawer when resizing to desktop. */ interface UseSidebarStateReturn { isMobile: boolean; isMobileOpen: boolean; openMobile: () => void; closeMobile: () => void; toggleMobile: () => void; } declare function useSidebarState(): UseSidebarStateReturn; interface SidebarDrawerProps { onClose?: () => void; } interface BiChatLayoutProps { /** Render function for the sidebar. Receives `{ onClose }` when in mobile drawer mode. */ renderSidebar: (props: SidebarDrawerProps) => react__default.ReactNode; /** Main page content */ children: react__default.ReactNode; /** Callback for Cmd+N keyboard shortcut */ onNewChat?: () => void; /** Key for AnimatePresence page transitions (e.g. location.pathname). Omit to disable transitions. */ routeKey?: string; /** Custom class for the root container */ className?: string; } declare function BiChatLayout({ renderSidebar, children, onNewChat, routeKey, className, }: BiChatLayoutProps): react_jsx_runtime.JSX.Element; interface SystemMessageProps { content: string; createdAt: string; onCopy?: (content: string) => Promise | void; hideActions?: boolean; hideTimestamp?: boolean; } declare function SystemMessage({ content, createdAt, onCopy, hideActions, hideTimestamp, }: SystemMessageProps): react_jsx_runtime.JSX.Element; interface DebugPanelProps { trace?: DebugTrace$1; } declare function DebugPanel({ trace }: DebugPanelProps): react_jsx_runtime.JSX.Element; /** * Alert Component * Standardized error/success/warning/info messages with retry capability */ type AlertVariant = 'error' | 'success' | 'warning' | 'info'; interface AlertProps { variant?: AlertVariant; message: string; title?: string; onDismiss?: () => void; onRetry?: () => void; show?: boolean; dismissible?: boolean; } declare function Alert({ variant, message, title, onDismiss, onRetry, show, dismissible, }: AlertProps): react_jsx_runtime.JSX.Element; declare const _default$1: react.MemoExoticComponent; /** * Archive Banner Component * Displays when a chat session is archived and provides a restore button */ interface ArchiveBannerProps { show?: boolean; onRestore?: () => Promise; restoring?: boolean; onRestoreComplete?: () => void; } declare function ArchiveBanner({ show, onRestore, restoring, onRestoreComplete, }: ArchiveBannerProps): react_jsx_runtime.JSX.Element; declare const _default: react.MemoExoticComponent; /** * RetryActionArea Component * Displays a retry action area inline where the assistant message would appear * (typically after an interrupted request or connection loss) * * Styled to match assistant message positioning (left-aligned) so users see * the retry button contextually in the conversation flow. */ interface RetryActionAreaProps { /** Callback when retry button is clicked */ onRetry: () => void; } declare const RetryActionArea: react.NamedExoticComponent; /** * StreamError Component * Error recovery UI for streaming failures */ interface StreamErrorProps { /** Error message to display */ error: string; /** Callback to retry the failed operation */ onRetry?: () => void; /** Callback to regenerate the message */ onRegenerate?: () => void; /** Callback to dismiss the error */ onDismiss?: () => void; /** Whether to show compact mode (less padding) */ compact?: boolean; } declare function StreamError({ error, onRetry, onRegenerate, onDismiss, compact, }: StreamErrorProps): react_jsx_runtime.JSX.Element; interface ActionableMessage { id: string; role: MessageRole; content: string; } interface MessageActionsProps { message: ActionableMessage; onCopy: (text: string) => Promise; onRegenerate?: (messageId: string) => Promise; onEdit?: (message: ActionableMessage) => void; } declare function MessageActions({ message, onCopy, onRegenerate, onEdit, }: MessageActionsProps): react_jsx_runtime.JSX.Element; interface AttachmentPreviewProps { /** The attachment to display */ attachment: ImageAttachment; /** Optional callback when remove button is clicked */ onRemove?: () => void; /** Optional callback when thumbnail is clicked (for enlargement) */ onClick?: () => void; /** If true, hide remove button and disable click interactions */ readonly?: boolean; } declare const AttachmentPreview: react.NamedExoticComponent; interface AttachmentUploadProps { /** Callback fired when files are successfully converted and validated */ onAttachmentsSelected: (attachments: Attachment$1[]) => void; /** Maximum number of attachments allowed (default: 10) */ maxAttachments?: number; /** Maximum file size in bytes (default: 20 MB) */ maxSizeBytes?: number; /** Whether the component is disabled */ disabled?: boolean; } declare const AttachmentUpload: react.NamedExoticComponent; interface ScreenReaderAnnouncerProps { message: string; politeness?: 'polite' | 'assertive'; clearAfter?: number; } /** * Screen reader announcer component for live region updates * Uses ARIA live regions to announce dynamic content changes * * @param message - The message to announce * @param politeness - 'polite' (wait for pause) or 'assertive' (immediate) * @param clearAfter - Optional milliseconds to clear message after announcement * * @example * */ declare function ScreenReaderAnnouncer({ message, politeness, clearAfter, }: ScreenReaderAnnouncerProps): react_jsx_runtime.JSX.Element; /** * Skip to main content link for keyboard navigation * Hidden by default, visible on keyboard focus * Allows users to skip navigation and go directly to main content */ declare function SkipLink(): react_jsx_runtime.JSX.Element; interface ContextMenuItem { id: string; label: string; icon?: ReactNode; onClick: () => void; variant?: 'default' | 'danger'; disabled?: boolean; } interface TouchContextMenuProps { items: ContextMenuItem[]; isOpen: boolean; onClose: () => void; anchorRect: DOMRect | null; } declare const TouchContextMenu: FC; interface QuestionFormProps { pendingQuestion: PendingQuestion$1; sessionId: string; onSubmit: (answers: QuestionAnswers) => Promise; onCancel: () => void; } declare function QuestionForm({ pendingQuestion, onSubmit, onCancel, }: QuestionFormProps): react_jsx_runtime.JSX.Element; interface QuestionStepProps { question: Question; selectedAnswers: QuestionAnswers; onAnswer: (answerData: QuestionAnswerData) => void; } declare function QuestionStep({ question, selectedAnswers, onAnswer, }: QuestionStepProps): react_jsx_runtime.JSX.Element; interface ConfirmationStepProps { questions: Question[]; answers: QuestionAnswers; } declare function ConfirmationStep({ questions, answers, }: ConfirmationStepProps): react_jsx_runtime.JSX.Element; interface SlotProps extends HTMLAttributes { children?: ReactNode; } /** * Slot component that merges its props with its child element's props * Used for the asChild pattern to allow consumers to customize the rendered element */ declare const Slot: react.ForwardRefExoticComponent>; /** * Helper type for components that support asChild * Extends the HTML attributes while adding asChild option */ type AsChildProps = HTMLAttributes> = T & { /** Merge props with child element instead of rendering wrapper */ asChild?: boolean; }; /** * Get children count (flattens fragments) */ declare function getValidChildren(children: ReactNode): ReactElement[]; interface TurnContextValue { /** Turn identifier */ turnId?: string; } declare function useTurnContext(): TurnContextValue; type TurnRootProps = AsChildProps> & { /** Turn identifier for tracking */ turnId?: string; }; type TurnUserProps = AsChildProps>; type TurnAssistantProps = AsChildProps>; type TurnTimestampProps = AsChildProps> & { /** ISO date string or Date object */ date?: string | Date; /** Custom formatter */ formatter?: (date: Date) => string; }; type TurnActionsProps = AsChildProps>; declare const Turn: { Root: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Turn identifier for tracking */ turnId?: string; } & react.RefAttributes>; User: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Assistant: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Timestamp: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** ISO date string or Date object */ date?: string | Date; /** Custom formatter */ formatter?: (date: Date) => string; } & react.RefAttributes>; Actions: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; }; type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error'; interface AvatarContextValue { imageLoadingStatus: ImageLoadingStatus; setImageLoadingStatus: (status: ImageLoadingStatus) => void; } declare function useAvatarContext(): AvatarContextValue; type AvatarRootProps = AsChildProps>; type AvatarImageProps = AsChildProps> & { /** Called when loading status changes */ onLoadingStatusChange?: (status: ImageLoadingStatus) => void; }; type AvatarFallbackProps = AsChildProps> & { /** Delay before showing fallback (in ms) */ delayMs?: number; }; declare const Avatar: { Root: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Image: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Called when loading status changes */ onLoadingStatusChange?: (status: ImageLoadingStatus) => void; } & react.RefAttributes>; Fallback: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Delay before showing fallback (in ms) */ delayMs?: number; } & react.RefAttributes>; }; type BubbleVariant = 'user' | 'assistant' | 'system'; interface BubbleContextValue { variant?: BubbleVariant; } declare function useBubbleContext(): BubbleContextValue; type BubbleRootProps = AsChildProps> & { /** Bubble variant (affects data attribute for styling) */ variant?: BubbleVariant; }; type BubbleContentProps = AsChildProps>; type BubbleHeaderProps = AsChildProps>; type BubbleFooterProps = AsChildProps>; type BubbleMetadataProps = AsChildProps>; declare const Bubble: { Root: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Bubble variant (affects data attribute for styling) */ variant?: BubbleVariant; } & react.RefAttributes>; Content: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Header: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Footer: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Metadata: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; }; interface ActionButtonContextValue { isHovered: boolean; isFocused: boolean; isPressed: boolean; isDisabled: boolean; } declare function useActionButtonContext(): ActionButtonContextValue; type ActionButtonRootProps = AsChildProps>; type ActionButtonIconProps = AsChildProps>; type ActionButtonLabelProps = AsChildProps> & { /** Visually hidden but accessible to screen readers */ srOnly?: boolean; }; type ActionButtonTooltipProps = AsChildProps> & { /** Position relative to button */ position?: 'top' | 'bottom' | 'left' | 'right'; /** Only show when hovered */ showOnHover?: boolean; }; declare const ActionButton: { Root: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Icon: react.ForwardRefExoticComponent & { asChild?: boolean; } & react.RefAttributes>; Label: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Visually hidden but accessible to screen readers */ srOnly?: boolean; } & react.RefAttributes>; Tooltip: react.ForwardRefExoticComponent & { asChild?: boolean; } & { /** Position relative to button */ position?: "top" | "bottom" | "left" | "right"; /** Only show when hovered */ showOnHover?: boolean; } & react.RefAttributes>; }; /** * useStreaming hook * BiChat-specific streaming hook that composes on top of applet-core's useStreaming. * Adds content accumulation, error state, and chunk type dispatch. */ interface UseStreamingOptions { onChunk?: (content: string) => void; onError?: (error: string) => void; onDone?: () => void; } declare function useStreaming(options?: UseStreamingOptions): { content: string; isStreaming: boolean; error: Error | null; processStream: (stream: AsyncGenerator, signal?: AbortSignal) => Promise; cancel: () => void; reset: () => void; }; /** * useActiveRuns — live map of per-session generation status. * * Subscribes to the data source's `subscribeActiveRuns` channel * (`GET /bi-chat/stream/active-runs`) and maintains a * sessionId → status dictionary so the sidebar can render a status * dot next to each session card without polling /stream/status per * session. * * The hook is a no-op when: * - the data source does not implement subscribeActiveRuns (older * backends without the active-run index); * - `enabled` is false (e.g. the user is offline). */ interface ActiveRunSnapshot { runId: string; status: ActiveRunDelivery['status']; updatedAt: number; } interface UseActiveRunsOptions { enabled?: boolean; /** Optional hook for raw SSE errors. */ onError?: (event: Event) => void; /** * Keep terminal-status entries in the map for this many milliseconds * before pruning them. Default 0 preserves the previous behaviour * (synchronous delete). Useful when consumers want to render a * "completed" pulse animation before the dot disappears. */ retainTerminalMs?: number; /** * How long to wait for an initial snapshot batch before declaring * the hook `ready` when the server has zero active runs. * Default 250ms. */ emptyStateTimeoutMs?: number; } interface UseActiveRunsResult { /** sessionId → current live status. Terminal statuses are emitted then the entry is removed. */ runs: Record; /** True once the initial HGETALL snapshot is delivered. */ ready: boolean; /** Convenience: undefined when not active. */ status: (sessionId: string) => ActiveRunDelivery['status'] | undefined; } declare function useActiveRuns(dataSource: Pick, options?: UseActiveRunsOptions): UseActiveRunsResult; /** * Translation hook using locale from IotaContext */ declare function useTranslation(): { t: (key: string, params?: Record) => string; locale: string; }; declare function useModalLock(isOpen: boolean): void; /** * Hook to trap focus within a container (for modals, sidebars) * Ensures Tab and Shift+Tab cycle through focusable elements only * * @param containerRef - React ref to the container element * @param isActive - Whether the focus trap is currently active * @param restoreFocusOnDeactivate - Element to restore focus to when deactivated * * @example * const modalRef = useRef(null) * useFocusTrap(modalRef, isOpen) */ declare function useFocusTrap(containerRef: RefObject, isActive: boolean, restoreFocusOnDeactivate?: HTMLElement | null): void; /** * useImageGallery Hook * Manages image modal/gallery state and navigation */ interface UseImageGalleryOptions { /** Initial images to display */ images?: ImageAttachment[]; /** Wrap navigation at boundaries (default: false) */ wrap?: boolean; /** Callback when modal opens */ onOpen?: (index: number) => void; /** Callback when modal closes */ onClose?: () => void; /** Callback when navigation occurs */ onNavigate?: (index: number, direction: 'prev' | 'next') => void; } interface UseImageGalleryReturn { /** Whether the gallery modal is open */ isOpen: boolean; /** Current image index */ currentIndex: number; /** Current image (or undefined if none) */ currentImage: ImageAttachment | undefined; /** All images in the gallery */ images: ImageAttachment[]; /** Whether there's a previous image */ hasPrev: boolean; /** Whether there's a next image */ hasNext: boolean; /** Open gallery at specific index */ open: (index: number, newImages?: ImageAttachment[]) => void; /** Close the gallery */ close: () => void; /** Navigate to previous image */ prev: () => void; /** Navigate to next image */ next: () => void; /** Navigate to specific index */ goTo: (index: number) => void; /** Set images without opening */ setImages: (images: ImageAttachment[]) => void; } /** * Hook for managing image gallery/modal state * * @example * ```tsx * const gallery = useImageGallery({ images: attachments }) * * // Open gallery * * * // Render gallery * {gallery.isOpen && ( * * )} * ``` */ declare function useImageGallery(options?: UseImageGalleryOptions): UseImageGalleryReturn; /** * useAutoScroll Hook * Manages auto-scroll behavior for chat containers */ interface UseAutoScrollOptions { /** Threshold in pixels from bottom to consider "at bottom" (default: 100) */ threshold?: number; /** Smooth scroll behavior (default: true) */ smooth?: boolean; /** Callback when scroll position changes */ onScroll?: (isAtBottom: boolean) => void; } interface UseAutoScrollReturn { /** Ref to attach to the scrollable container */ containerRef: React.RefObject; /** Whether the container is scrolled to the bottom */ isAtBottom: boolean; /** Whether auto-scroll should be active */ shouldAutoScroll: boolean; /** Manually scroll to bottom */ scrollToBottom: (smooth?: boolean) => void; /** Enable/disable auto-scroll */ setAutoScroll: (enabled: boolean) => void; /** Handle scroll event (attach to container if not using ref) */ handleScroll: (e: React.UIEvent) => void; } /** * Hook for managing auto-scroll behavior in chat containers * * @example * ```tsx * const scroll = useAutoScroll({ threshold: 50 }) * * // Attach to container *
* {messages.map(msg => )} *
* * // Scroll button * {!scroll.isAtBottom && ( * * )} * ``` */ declare function useAutoScroll(options?: UseAutoScrollOptions): UseAutoScrollReturn; /** * useMessageActions Hook * Provides copy, regenerate, and edit functionality for messages */ interface UseMessageActionsOptions { /** Callback when copy succeeds */ onCopy?: (content: string) => void; /** Callback when copy fails */ onCopyError?: (error: Error) => void; /** Callback when regenerate is triggered */ onRegenerate?: () => void | Promise; /** Callback when edit is triggered */ onEdit?: (content: string) => void | Promise; /** Duration to show "copied" state in ms (default: 2000) */ copiedDuration?: number; } interface UseMessageActionsReturn { /** Whether content was recently copied */ isCopied: boolean; /** Whether regenerate is in progress */ isRegenerating: boolean; /** Whether edit is in progress */ isEditing: boolean; /** Copy content to clipboard */ copy: (content: string) => Promise; /** Trigger regenerate action */ regenerate: () => Promise; /** Trigger edit action */ edit: (content: string) => Promise; /** Reset all states */ reset: () => void; } /** * Hook for managing message actions (copy, regenerate, edit) * * @example * ```tsx * const actions = useMessageActions({ * onRegenerate: () => chatContext.regenerateMessage(messageId), * onEdit: (content) => chatContext.editMessage(messageId, content), * onCopy: () => toast.success('Copied!'), * }) * * * * * ``` */ declare function useMessageActions(options?: UseMessageActionsOptions): UseMessageActionsReturn; /** * useAttachments Hook * Manages file upload state, validation, and preview */ interface FileValidationError { file: File; reason: 'size' | 'type' | 'count' | 'custom'; message: string; } interface UseAttachmentsOptions { /** Maximum number of files (default: 10) */ maxFiles?: number; /** Maximum file size in bytes (default: 20MB) */ maxFileSize?: number; /** Allowed MIME types (default: attachment allowlist) */ allowedTypes?: string[]; /** Custom validation function */ validate?: (file: File) => string | null; /** Callback when files are added */ onAdd?: (files: Attachment$1[]) => void; /** Callback when a file is removed */ onRemove?: (file: Attachment$1) => void; /** Callback when validation fails */ onError?: (errors: FileValidationError[]) => void; } interface UseAttachmentsReturn { /** Current attachments */ files: Attachment$1[]; /** Validation errors from last operation */ errors: FileValidationError[]; /** Whether files are being processed */ isProcessing: boolean; /** Whether max file limit is reached */ isMaxReached: boolean; /** Number of remaining slots */ remainingSlots: number; /** Add files (validates and processes) */ add: (files: FileList | File[]) => Promise; /** Remove a specific file */ remove: (fileOrId: Attachment$1 | string) => void; /** Clear all files */ clear: () => void; /** Clear errors */ clearErrors: () => void; /** Set files directly (for controlled mode) */ setFiles: (files: Attachment$1[]) => void; } /** * Hook for managing file attachments * * @example * ```tsx * const attachments = useAttachments({ * maxFiles: 5, * maxFileSize: 5 * 1024 * 1024, // 5MB * onError: (errors) => errors.forEach(e => toast.error(e.message)), * }) * * attachments.add(e.target.files)} * /> * * {attachments.files.map(file => ( * attachments.remove(file)} * /> * ))} * * {attachments.errors.length > 0 && ( * * )} * ``` */ declare function useAttachments(options?: UseAttachmentsOptions): UseAttachmentsReturn; /** * useMarkdownCopy Hook * Manages copy-to-clipboard state for code blocks in markdown */ interface UseMarkdownCopyOptions { /** Duration to show "copied" state in ms (default: 2000) */ copiedDuration?: number; /** Callback when copy succeeds */ onCopy?: (content: string, language?: string) => void; /** Callback when copy fails */ onError?: (error: Error) => void; } interface UseMarkdownCopyReturn { /** Map of copied states by block ID */ copiedStates: Map; /** Check if a specific block is in copied state */ isCopied: (blockId: string) => boolean; /** Copy content with block ID tracking */ copy: (blockId: string, content: string, language?: string) => Promise; /** Reset copied state for a specific block */ reset: (blockId: string) => void; /** Reset all copied states */ resetAll: () => void; } /** * Hook for managing copy states for multiple code blocks * * @example * ```tsx * const markdownCopy = useMarkdownCopy({ * onCopy: (content, lang) => console.log(`Copied ${lang} code`), * }) * * function CodeBlock({ id, code, language }) { * return ( *
*
{code}
* *
* ) * } * ``` */ declare function useMarkdownCopy(options?: UseMarkdownCopyOptions): UseMarkdownCopyReturn; /** * useScrollToBottom Hook * Manages scroll-to-bottom functionality with smart auto-scroll * Only scrolls if user is near the bottom (within threshold) */ interface UseScrollToBottomReturn { /** * Ref to attach to the messages container */ containerRef: React.RefObject; /** * Whether to show the scroll-to-bottom button */ showScrollButton: boolean; /** * Function to scroll to bottom */ scrollToBottom: () => void; } /** * Hook for managing scroll-to-bottom behavior * Automatically scrolls if user is near the bottom * Shows button only when scrolled up significantly */ declare function useScrollToBottom(items: unknown[]): UseScrollToBottomReturn; interface ShortcutConfig { key: string; ctrl?: boolean; shift?: boolean; alt?: boolean; meta?: boolean; callback: () => void; preventDefault?: boolean; description?: string; } /** * Hook for managing global keyboard shortcuts * Automatically handles modifier keys and input field exclusion * * @param shortcuts - Array of keyboard shortcut configurations * * @example * useKeyboardShortcuts([ * { key: 'k', ctrl: true, callback: () => focusSearch(), description: 'Focus search' }, * { key: '?', callback: () => setShowHelp(true), description: 'Show keyboard shortcuts' }, * ]) */ declare function useKeyboardShortcuts(shortcuts: ShortcutConfig[]): void; interface LongPressOptions { delay?: number; onLongPress: (e: React.TouchEvent | React.MouseEvent) => void; onPressStart?: () => void; onPressCancel?: () => void; moveThreshold?: number; hapticFeedback?: boolean; } interface LongPressEventHandlers { onTouchStart: (e: React.TouchEvent) => void; onTouchEnd: (e: React.TouchEvent) => void; onTouchMove: (e: React.TouchEvent) => void; onMouseDown?: (e: React.MouseEvent) => void; onMouseUp?: (e: React.MouseEvent) => void; onMouseLeave?: (e: React.MouseEvent) => void; } interface LongPressResult { handlers: LongPressEventHandlers; isPressed: boolean; } declare function useLongPress(options: LongPressOptions): LongPressResult; type BichatRPC = { "bichat.artifact.delete": { params: ArtifactIDParams; result: OkResult; }; "bichat.artifact.update": { params: ArtifactUpdateParams; result: ArtifactResult; }; "bichat.ping": { params: PingParams; result: PingResult; }; "bichat.question.reject": { params: QuestionCancelParams; result: AsyncRunAcceptedResult; }; "bichat.question.submit": { params: QuestionSubmitParams; result: AsyncRunAcceptedResult; }; "bichat.session.archive": { params: SessionIDParams; result: SessionCreateResult; }; "bichat.session.artifacts": { params: SessionArtifactsParams; result: SessionArtifactsResult; }; "bichat.session.clear": { params: SessionIDParams; result: SessionClearResult; }; "bichat.session.compact": { params: SessionIDParams; result: AsyncRunAcceptedResult; }; "bichat.session.create": { params: SessionCreateParams; result: SessionCreateResult; }; "bichat.session.delete": { params: SessionIDParams; result: OkResult; }; "bichat.session.get": { params: SessionGetParams; result: SessionGetResult; }; "bichat.session.list": { params: SessionListParams; result: SessionListResult; }; "bichat.session.listAll": { params: SessionListAllParams; result: SessionListAllResult; }; "bichat.session.members.add": { params: SessionMembersUpsertParams; result: OkResult; }; "bichat.session.members.list": { params: SessionMembersListParams; result: SessionMembersListResult; }; "bichat.session.members.remove": { params: SessionMembersRemoveParams; result: OkResult; }; "bichat.session.members.updateRole": { params: SessionMembersUpsertParams; result: OkResult; }; "bichat.session.pin": { params: SessionIDParams; result: SessionCreateResult; }; "bichat.session.regenerateTitle": { params: SessionIDParams; result: SessionCreateResult; }; "bichat.session.unarchive": { params: SessionIDParams; result: SessionCreateResult; }; "bichat.session.unpin": { params: SessionIDParams; result: SessionCreateResult; }; "bichat.session.updateTitle": { params: SessionUpdateTitleParams; result: SessionCreateResult; }; "bichat.session.uploadArtifacts": { params: SessionUploadArtifactsParams; result: SessionUploadArtifactsResult; }; "bichat.user.list": { params: UserListParams; result: UserListResult; }; }; interface Artifact { id: string; sessionId: string; messageId?: string; uploadId?: number | null; type: string; name: string; description?: string; mimeType?: string; url?: string; sizeBytes: number; metadata?: Record; createdAt: string; } interface ArtifactIDParams { id: string; } interface ArtifactResult { artifact: Artifact; } interface ArtifactUpdateParams { id: string; name: string; description?: string; } interface AssistantTurn { id: string; role?: string; content: string; explanation?: string; citations: Citation[]; toolCalls?: ToolCall[]; debug?: DebugTrace | null; artifacts: unknown[]; codeOutputs: CodeOutput[]; createdAt: string; } interface AsyncRunAcceptedResult { accepted: boolean; operation: string; sessionId: string; runId: string; startedAt: number; } interface Attachment { id: string; uploadId?: number | null; filename: string; mimeType: string; sizeBytes: number; url?: string; } interface Citation { id: string; type: string; title: string; url: string; startIndex: number; endIndex: number; excerpt?: string; source?: string; } interface CodeOutput { type: string; content: string; filename?: string; mimeType?: string; sizeBytes?: number; } interface ConversationTurn { id: string; sessionId: string; userTurn: UserTurn; assistantTurn?: AssistantTurn | null; createdAt: string; } interface DebugEvent { id?: string; name?: string; type?: string; level?: string; message?: string; reason?: string; spanId?: string; generationId?: string; timestamp?: string; attributes?: Record; } interface DebugGeneration { id?: string; requestId?: string; model?: string; provider?: string; finishReason?: string; promptTokens?: number; completionTokens?: number; totalTokens?: number; cachedTokens?: number; cost?: number; latencyMs?: number; input?: string; output?: string; thinking?: string; observationReason?: string; startedAt?: string; completedAt?: string; toolCalls?: DebugToolCall[]; } interface DebugSpan { id?: string; parentId?: string; generationId?: string; name?: string; type?: string; status?: string; level?: string; callId?: string; toolName?: string; input?: string; output?: string; error?: string; durationMs?: number; startedAt?: string; completedAt?: string; attributes?: Record; } interface DebugToolCall { callId?: string; name?: string; arguments?: string; result?: string; error?: string; durationMs?: number; } interface DebugTrace { schemaVersion?: string; startedAt?: string; completedAt?: string; usage?: DebugUsage | null; generationMs?: number; tools?: DebugToolCall[]; attempts?: DebugGeneration[]; spans?: DebugSpan[]; events?: DebugEvent[]; traceId?: string; traceUrl?: string; sessionId?: string; thinking?: string; observationReason?: string; } interface DebugUsage { promptTokens: number; completionTokens: number; totalTokens: number; cachedTokens: number; cost: number; } interface OkResult { ok: boolean; } interface PendingQuestion { checkpointId: string; agentName?: string; turnId: string; questions: PendingQuestionItem[]; status: string; } interface PendingQuestionItem { id: string; text: string; type: string; options: PendingQuestionOption[]; } interface PendingQuestionOption { id: string; label: string; } type PingParams = Record; interface PingResult { ok: boolean; tenantId: string; } interface QuestionCancelParams { sessionId: string; } interface QuestionSubmitParams { sessionId: string; checkpointId: string; answers: Record; } interface Session { id: string; title: string; status: string; pinned: boolean; createdAt: string; updatedAt: string; owner?: SessionUser | null; isGroup?: boolean; memberCount?: number; access?: SessionAccess | null; } interface SessionAccess { role: string; source: string; canRead: boolean; canWrite: boolean; canManageMembers: boolean; } interface SessionArtifactsParams { sessionId: string; limit: number; offset: number; } interface SessionArtifactsResult { artifacts: Artifact[]; hasMore: boolean; nextOffset: number; } interface SessionClearResult { success: boolean; deletedMessages: number; deletedArtifacts: number; } interface SessionCreateParams { title: string; } interface SessionCreateResult { session: Session; } interface SessionGetParams { id: string; } interface SessionGetResult { session: Session; turns: ConversationTurn[]; pendingQuestion?: PendingQuestion | null; } interface SessionIDParams { id: string; } interface SessionListAllParams { limit: number; offset: number; includeArchived: boolean; userId?: string | null; } interface SessionListAllResult { sessions: Session[]; total?: number; hasMore: boolean; } interface SessionListParams { limit: number; offset: number; includeArchived: boolean; } interface SessionListResult { sessions: Session[]; total?: number; hasMore: boolean; } interface SessionMember { user: SessionUser; role: string; createdAt: string; updatedAt: string; } interface SessionMembersListParams { sessionId: string; } interface SessionMembersListResult { members: SessionMember[]; } interface SessionMembersRemoveParams { sessionId: string; userId: string; } interface SessionMembersUpsertParams { sessionId: string; userId: string; role: string; } interface SessionUpdateTitleParams { id: string; title: string; } interface SessionUploadArtifactsParams { sessionId: string; attachments: Attachment[]; } interface SessionUploadArtifactsResult { artifacts: Artifact[]; } interface SessionUser { id: string; firstName: string; lastName: string; initials: string; } interface ToolCall { id: string; name: string; arguments: string; result?: string; error?: string; durationMs?: number; } type UserListParams = Record; interface UserListResult { users: SessionUser[]; } interface UserTurn { id: string; content: string; attachments: Attachment[]; author?: SessionUser | null; createdAt: string; } /** * Session lifecycle management: create, list, get, delete, archive, pin, rename. * * @internal — Not part of the public API. Consumed by HttpDataSource. */ interface SessionState { session: Session$1; turns: ConversationTurn$1[]; pendingQuestion?: PendingQuestion$1 | null; } /** * Message sending, SSE streaming, and HITL question handling. * * @internal — Not part of the public API. Consumed by HttpDataSource. */ /** * Thrown by {@link subscribeRunEvents} when the underlying EventSource * emits `onerror` before the first event arrives within the * initial-connect grace window. Distinguishes boundary failures * (401 / 404 / 503) from transient mid-run flaps, which the browser's * native auto-reconnect continues to handle silently. */ declare class RunEventsConnectError extends Error { readonly cause?: Event; constructor(message: string, cause?: Event); } interface SubscribeRunEventsOptions { /** When set, start from the last seen event id instead of a full replay. */ lastEventId?: string; /** Fires for every chunk (content / tool / snapshot / done / error / …). */ onChunk: (chunk: StreamChunk) => void; /** Optional hook for raw SSE errors (connection blips, parse failures). */ onError?: (event: Event) => void; /** AbortSignal closes the underlying EventSource. */ signal?: AbortSignal; } interface SubscribeActiveRunsOptions { onEvent: (event: ActiveRunDelivery) => void; onError?: (event: Event) => void; signal?: AbortSignal; } /** * Built-in HTTP data source with SSE streaming and AbortController * Implements ChatDataSource interface with real HTTP/RPC calls * * Uses turn-based architecture - fetches ConversationTurns instead of flat messages. * * This file is a thin facade that delegates to focused internal modules: * - SessionManager.ts — session CRUD (create, list, get, delete, archive, pin) * - MessageTransport.ts — send messages, stream responses, HITL questions * - ArtifactManager.ts — artifact fetch, upload, rename, delete * - AttachmentUploader.ts — file decode, normalize, upload * - mappers.ts — RPC-to-domain type mapping and sanitization */ interface HttpDataSourceConfig { baseUrl: string; rpcEndpoint: string; streamEndpoint?: string; uploadEndpoint?: string; csrfToken?: string | (() => string); headers?: Record; rpcTimeoutMs?: number; streamConnectTimeoutMs?: number; } declare class HttpDataSource implements ChatDataSource { private config; private abortController; private rpc; constructor(config: HttpDataSourceConfig); private getCSRFToken; private createHeaders; private createUploadHeaders; private callRPC; private boundCallRPC; private boundUploadFile; createSession(): Promise; fetchSession(id: string): Promise; listSessions(options?: { limit?: number; offset?: number; includeArchived?: boolean; }): Promise; archiveSession(sessionId: string): Promise; unarchiveSession(sessionId: string): Promise; pinSession(sessionId: string): Promise; unpinSession(sessionId: string): Promise; deleteSession(sessionId: string): Promise; renameSession(sessionId: string, title: string): Promise; regenerateSessionTitle(sessionId: string): Promise; clearSessionHistory(sessionId: string): Promise<{ success: boolean; deletedMessages: number; deletedArtifacts: number; }>; compactSessionHistory(sessionId: string): Promise; listUsers(): Promise; listAllSessions(options?: { limit?: number; offset?: number; includeArchived?: boolean; userId?: string | null; }): Promise<{ sessions: Session$1[]; total: number; hasMore: boolean; }>; listSessionMembers(sessionId: string): Promise; addSessionMember(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise; updateSessionMemberRole(sessionId: string, userId: string, role: 'editor' | 'viewer'): Promise; removeSessionMember(sessionId: string, userId: string): Promise; stopGeneration(sessionId: string): Promise; getStreamStatus(sessionId: string): Promise; resumeStream(sessionId: string, runId: string, onChunk: (chunk: StreamChunk) => void, signal?: AbortSignal): Promise; /** * Open a native EventSource against GET /stream/events for the given * run. Used by components that want browser-native auto-reconnect * with Last-Event-ID (tab close, wifi drop, device switch). Prefer * over resumeStream when tailing an already-running generation that * another tab started. */ subscribeRunEvents(sessionId: string, runId: string, options: SubscribeRunEventsOptions): Promise; /** * Subscribe to the per-tenant active-run fan-out * (GET /stream/active-runs). Never resolves until the caller aborts * via the signal; use from a top-level component (sidebar container) * that mounts for the lifetime of the chat app. */ subscribeActiveRuns(options: SubscribeActiveRunsOptions): Promise; sendMessage(sessionId: string, content: string, attachments?: Attachment$1[], signal?: AbortSignal, options?: SendMessageOptions): AsyncGenerator; cancelStream(): void; submitQuestionAnswers(sessionId: string, questionId: string, answers: QuestionAnswers): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; rejectPendingQuestion(sessionId: string): Promise<{ success: boolean; data?: AsyncRunAccepted; error?: string; }>; fetchSessionArtifacts(sessionId: string, options?: { limit?: number; offset?: number; }): Promise<{ artifacts: SessionArtifact[]; hasMore?: boolean; nextOffset?: number; }>; uploadSessionArtifacts(sessionId: string, files: File[]): Promise<{ artifacts: SessionArtifact[]; }>; renameSessionArtifact(artifactId: string, name: string, description?: string): Promise; deleteSessionArtifact(artifactId: string): Promise; } /** * Factory function to create HttpDataSource */ declare function createHttpDataSource(config: HttpDataSourceConfig): ChatDataSource; /** * Builds HttpDataSourceConfig from window.__APPLET_CONTEXT__. * For use with createHttpDataSource when the app is embedded via the applet framework. * * Expects the host to inject context with: * - config.rpcUIEndpoint, config.streamEndpoint * - session.csrfToken (or window.__CSRF_TOKEN__) */ /** * Returns HttpDataSourceConfig derived from window.__APPLET_CONTEXT__. * Use with createHttpDataSource() for RPC and SSE endpoints. * * @throws Error if window.__APPLET_CONTEXT__ is not available */ declare function useHttpDataSourceConfigFromApplet(options?: { rpcTimeoutMs?: number; streamConnectTimeoutMs?: number; }): HttpDataSourceConfig; /** * Router adapter for BiChat sidebar and archived list. * Consumes a navigate function and location (pathname) and returns * activeSessionId plus callbacks for use with SDK Sidebar and ArchivedChatList. * * Router-agnostic: pass useNavigate()/useLocation() from react-router-dom * or equivalent from your router. */ interface UseBichatRouterParams { /** Navigate to a path (e.g. from useNavigate()) */ navigate: (path: string) => void; /** Current pathname (e.g. location.pathname from useLocation()) */ pathname: string; /** Optional: close mobile sidebar after navigation (e.g. closeMobile from useSidebarState) */ onNavigate?: () => void; } interface UseBichatRouterReturn { /** Session ID extracted from pathname (e.g. /session/:id -> id) */ activeSessionId: string | undefined; /** Navigate to session or home when sessionId is empty */ onSessionSelect: (sessionId: string) => void; /** Navigate to new chat (home) */ onNewChat: () => void; /** Navigate to archived list */ onArchivedView: () => void; /** Navigate back (e.g. to home) */ onBack: () => void; /** Navigate to all-chats view */ onAllChatsView: () => void; /** Current sidebar tab derived from URL */ sidebarTab: 'my-chats' | 'all-chats'; /** Handler to change sidebar tab (navigates to appropriate URL) */ onSidebarTabChange: (tab: 'my-chats' | 'all-chats') => void; } /** * Derives BiChat navigation callbacks and activeSessionId from router state. * Use with SDK Sidebar (onSessionSelect, onNewChat, onArchivedView, activeSessionId) * and ArchivedChatList (onBack, onSessionSelect). */ declare function useBichatRouter({ navigate, pathname, onNavigate, }: UseBichatRouterParams): UseBichatRouterReturn; /** * Framer Motion animation variants for BiChat UI * Subtle, professional animations for enterprise applications * * Reduced-motion handling: Framer Motion's built-in `` * or the `useReducedMotion()` hook handle OS-level accessibility preferences reactively. * Variant objects declare their intended durations; Framer suppresses them automatically. */ /** * Fade in animation */ declare const fadeInVariants: { initial: { opacity: number; }; animate: { opacity: number; transition: { duration: number; }; }; exit: { opacity: number; transition: { duration: number; }; }; }; /** * Fade in with subtle slide up */ declare const fadeInUpVariants: { initial: { opacity: number; y: number; }; animate: { opacity: number; y: number; transition: { duration: number; ease: number[]; }; }; exit: { opacity: number; y: number; transition: { duration: number; }; }; }; /** * Scale fade for modals and popups */ declare const scaleFadeVariants: { initial: { opacity: number; scale: number; }; animate: { opacity: number; scale: number; transition: { duration: number; }; }; exit: { opacity: number; scale: number; transition: { duration: number; }; }; }; /** * Modal backdrop */ declare const backdropVariants: { initial: { opacity: number; }; animate: { opacity: number; transition: { duration: number; }; }; exit: { opacity: number; transition: { duration: number; }; }; }; /** * Button press feedback */ declare const buttonVariants: { tap: { scale: number; }; }; /** * Stagger container for lists */ declare const staggerContainerVariants: { hidden: { opacity: number; }; visible: { opacity: number; transition: { staggerChildren: number; delayChildren: number; }; }; }; /** * List item animation */ declare const listItemVariants: { initial: { opacity: number; x: number; }; animate: { opacity: number; x: number; transition: { duration: number; }; }; exit: { opacity: number; x: number; transition: { duration: number; }; }; }; /** * Message entrance animation */ declare const messageVariants: { initial: { opacity: number; y: number; }; animate: { opacity: number; y: number; transition: { duration: number; ease: number[]; }; }; exit: { opacity: number; transition: { duration: number; }; }; }; /** * Container for staggered messages */ declare const messageContainerVariants: { initial: { opacity: number; }; animate: { opacity: number; transition: { staggerChildren: number; delayChildren: number; }; }; }; /** * Typing indicator dots */ declare const typingDotVariants: { initial: { opacity: number; }; animate: { opacity: number[]; transition: { duration: number; repeat: number; ease: string; }; }; }; /** * Verb transition for typing indicator * Smooth slide-up animation for rotating text */ declare const verbTransitionVariants: { initial: { y: number; opacity: number; }; animate: { y: number; opacity: number; transition: { duration: number; ease: string; }; }; exit: { y: number; opacity: number; transition: { duration: number; }; }; }; /** * Floating button (scroll to bottom, etc.) */ declare const floatingButtonVariants: { initial: { opacity: number; scale: number; }; animate: { opacity: number; scale: number; transition: { duration: number; }; }; exit: { opacity: number; scale: number; transition: { duration: number; }; }; }; /** * Dropdown menu */ declare const dropdownVariants: { initial: { opacity: number; y: number; }; animate: { opacity: number; y: number; transition: { duration: number; }; }; exit: { opacity: number; y: number; transition: { duration: number; }; }; }; /** * Session item with subtle slide-right on hover */ declare const sessionItemVariants: { initial: { opacity: number; x: number; }; animate: { opacity: number; x: number; transition: { duration: number; }; }; hover: { x: number; transition: { duration: number; }; }; exit: { opacity: number; x: number; transition: { duration: number; }; }; }; /** * Error/alert message slide-in */ declare const errorMessageVariants: { initial: { opacity: number; y: number; height: number; }; animate: { opacity: number; y: number; height: string; transition: { duration: number; ease: number[]; }; }; exit: { opacity: number; y: number; height: number; transition: { duration: number; }; }; }; interface ChatSessionProviderProps { dataSource: ChatDataSource; sessionId?: string; /** * External rate limiter instance. Captured once at mount — changing this prop * after initial render has no effect. For most cases, use `rateLimitConfig` * instead and let the provider create the limiter internally. */ rateLimiter?: RateLimiter; /** * Configuration for the built-in rate limiter (ignored when `rateLimiter` is * provided). Captured once at mount — changing after initial render has no effect. */ rateLimitConfig?: RateLimiterConfig; /** * Called when the machine creates a new session (e.g. on first message in a * "new chat"). Use this to navigate your SPA router to the new session URL. */ onSessionCreated?: (sessionId: string) => void; children: ReactNode; } declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, rateLimitConfig, onSessionCreated, children, }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element; declare function useChatSession(): ChatSessionStateValue; declare function useChatMessaging(): ChatMessagingStateValue; /** Returns messaging context or null when outside ChatSessionProvider. */ declare function useOptionalChatMessaging(): ChatMessagingStateValue | null; declare function useChatInput(): ChatInputStateValue; /** * BiChat context types layered on top of canonical applet-core context contracts. */ type UserContext = UserContext$1; type TenantContext = TenantContext$1; type LocaleContext = LocaleContext$1; type AppConfig = AppConfig$1 & { streamEndpoint: string; basePath: string; assetsBasePath: string; rpcUIEndpoint: string; }; interface Extensions { branding?: { appName?: string; logoUrl?: string; theme?: { primary?: string; secondary?: string; accent?: string; }; welcome?: { title?: string; description?: string; examplePrompts?: Array<{ category: string; text: string; icon: string; }>; }; colors?: { primary?: string; secondary?: string; accent?: string; }; logo?: { src?: string; alt?: string; }; }; features?: { vision?: boolean; webSearch?: boolean; codeInterpreter?: boolean; multiAgent?: boolean; }; llm?: { provider?: string; apiKeyConfigured?: boolean; reasoningEffortOptions?: string[]; models?: Array<{ id: string; label: string; default?: boolean; }>; }; debug?: { limits?: { policyMaxTokens: number; modelMaxTokens: number; effectiveMaxTokens: number; completionReserveTokens: number; }; }; } type IotaContext = Omit & { config: AppConfig; extensions?: Extensions; }; declare global { interface Window { __APPLET_CONTEXT__: IotaContext; __CSRF_TOKEN__: string; } } interface IotaContextProviderProps { /** * Explicit context object. When provided, the window global is not read. * Useful for tests, Storybook, or apps that manage their own context. */ context?: IotaContext; children: ReactNode; } declare function IotaContextProvider({ context, children }: IotaContextProviderProps): react_jsx_runtime.JSX.Element; declare function useIotaContext(): IotaContext; /** * Check if user has a specific permission */ declare function hasPermission(permission: string): boolean; /** @deprecated Use `IotaContextProvider` with its `context` prop instead. */ interface BiChatConfig { user: { id: string; email: string; firstName: string; lastName: string; permissions: string[]; }; tenant: { id: string; name: string; }; locale: { language: string; translations: Record; }; endpoints: { rpc: string; stream: string; }; csrfToken?: string; } interface ConfigProviderProps { config?: BiChatConfig; useGlobalConfig?: boolean; children: ReactNode; } /** * @deprecated Use `IotaContextProvider` with its `context` prop instead. * * ConfigProvider component — provides configuration to the BiChat library. * * @param config - Configuration object (preferred method) * @param useGlobalConfig - If true, falls back to window.__APPLET_CONTEXT__ when config is not provided * @param children - React children */ declare function ConfigProvider({ config, useGlobalConfig, children }: ConfigProviderProps): react_jsx_runtime.JSX.Element; /** * Hook to access BiChat configuration * Returns null if no configuration is available */ declare function useConfig(): BiChatConfig | null; /** * Hook to access BiChat configuration (required) * Throws an error if configuration is not available */ declare function useRequiredConfig(): BiChatConfig; /** * Theme system type definitions */ interface Theme { name: string; colors: ThemeColors; spacing: ThemeSpacing; borderRadius: ThemeBorderRadius; } interface ThemeColors { background: string; surface: string; primary: string; secondary: string; text: string; textMuted: string; border: string; error: string; success: string; warning: string; userBubble: string; assistantBubble: string; userText: string; assistantText: string; } interface ThemeSpacing { xs: string; sm: string; md: string; lg: string; xl: string; } interface ThemeBorderRadius { sm: string; md: string; lg: string; full: string; } interface ThemeProviderProps { theme?: Theme | 'light' | 'dark' | 'system'; children: ReactNode; } /** * Theme provider component * Wraps the application and provides theme context */ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element; /** * Hook to access current theme */ declare function useTheme(): Theme; /** * Predefined theme configurations */ declare const lightTheme: Theme; declare const darkTheme: Theme; /** * CSRF token management for API requests */ /** * Get CSRF token from window object * @returns CSRF token string */ declare function getCSRFToken(): string; /** * Add CSRF token to request headers * @param headers - Headers object to modify * @returns Modified headers object */ declare function addCSRFHeader(headers: Headers): Headers; /** * Create headers with CSRF token * @param init - Optional initial headers * @returns Headers object with CSRF token */ declare function createHeadersWithCSRF(init?: HeadersInit): Headers; /** * Internal types for the ChatMachine. * * These are implementation details — consumers use the existing * ChatSessionStateValue / ChatMessagingStateValue / ChatInputStateValue * types via the public hooks. */ interface ChatMachineConfig { dataSource: ChatDataSource; rateLimiter: RateLimiter; onSessionCreated?: (sessionId: string) => void; } /** * Mirrors ChatSessionStateValue. Methods are stable (bound once on * machine construction) so they never trigger re-renders by identity change. */ interface SessionSnapshot { session: Session$1 | null; currentSessionId?: string; fetching: boolean; error: string | null; errorRetryable: boolean; debugMode: boolean; sessionDebugUsage: SessionDebugUsage; debugLimits: DebugLimits | null; reasoningEffort: string | undefined; reasoningEffortOptions: string[] | undefined; model: string | undefined; setError: (error: string | null) => void; retryFetchSession: () => void; setReasoningEffort: (effort: string) => void; setModel: (model: string | undefined) => void; } /** Superset of ChatMessagingStateValue used internally by the state machine; includes internal-only fields such as generationInProgress. */ interface MessagingSnapshot { turns: ConversationTurn$1[]; streamingContent: string; isStreaming: boolean; streamError: string | null; streamErrorRetryable: boolean; loading: boolean; pendingQuestion: PendingQuestion$1 | null; codeOutputs: CodeOutput$1[]; isCompacting: boolean; compactionSummary: string | null; artifactsInvalidationTrigger: number; thinkingContent: string; activeSteps: ActivityStep[]; generationInProgress: boolean; showActivityTrace: boolean; showTypingIndicator: boolean; sendMessage: (content: string, attachments?: Attachment$1[]) => Promise; handleRegenerate?: (turnId: string, model?: string) => Promise; handleEdit?: (turnId: string, newContent: string) => Promise; handleCopy: (text: string) => Promise; handleSubmitQuestionAnswers: (answers: QuestionAnswers) => void; handleRejectPendingQuestion: () => Promise; retryLastMessage: () => Promise; clearStreamError: () => void; cancel: () => void; setCodeOutputs: (outputs: CodeOutput$1[]) => void; } /** Mirrors ChatInputStateValue. */ interface InputSnapshot { message: string; inputError: string | null; messageQueue: QueuedMessage[]; setMessage: (message: string) => void; setInputError: (error: string | null) => void; handleSubmit: (e: { preventDefault: () => void; }, attachments?: Attachment$1[]) => void; handleUnqueue: () => { content: string; attachments: Attachment$1[]; } | null; enqueueMessage: (content: string, attachments: Attachment$1[]) => boolean; removeQueueItem: (index: number) => void; updateQueueItem: (index: number, content: string) => void; } /** * ChatMachine — framework-agnostic state machine for BiChat. * * Owns all async logic that was previously in ChatContext.tsx: * - Session fetch (with race-condition guards) * - Message sending + streaming * - Slash commands (/debug, /clear, /compact) * - HITL question submission / rejection * - Message queue (auto-drain) * - Rate limiting * - Abort / cancel * * Zero React dependency. Designed for `useSyncExternalStore`: * three subscribe/getSnapshot pairs map to the existing 3-context split. */ type Listener = () => void; declare class ChatMachine { private dataSource; private rateLimiter; private onSessionCreated?; private state; private abortController; private lastSendAttempt; /** Prevents fetchSession effect from clobbering state while stream is active. */ private sendingSessionId; /** * Monotonic counter bumped on every real session switch. An async op (send * stream, post-stream sync, queue drain, resume, HITL) captures it at start * and re-checks before writing to the single shared `state.messaging`; a stale * epoch means the user navigated to a different session, so the write is * dropped instead of bleeding into / clobbering the now-visible session. */ private viewEpoch; private fetchCancelled; private disposed; private reasoningEffortOptions; private reasoningEffortOptionSet; /** Memoized sessionDebugUsage — avoids unnecessary session re-renders during streaming. */ private lastSessionDebugUsage; /** Interval handle for passive polling when another tab has an active stream. */ private passivePollingId; private sessionListeners; private messagingListeners; private inputListeners; private cachedSessionSnapshot; private cachedMessagingSnapshot; private cachedInputSnapshot; private sessionSnapshotVersion; private messagingSnapshotVersion; private inputSnapshotVersion; private lastSessionSnapshotVersion; private lastMessagingSnapshotVersion; private lastInputSnapshotVersion; readonly setError: (error: string | null) => void; readonly retryFetchSession: () => void; readonly sendMessage: (content: string, attachments?: Attachment$1[]) => Promise; readonly handleRegenerate: (turnId: string, model?: string) => Promise; readonly handleEdit: (turnId: string, newContent: string) => Promise; readonly handleCopy: (text: string) => Promise; readonly handleSubmitQuestionAnswers: (answers: QuestionAnswers) => void; readonly handleRejectPendingQuestion: () => Promise; readonly retryLastMessage: () => Promise; readonly clearStreamError: () => void; readonly cancel: () => void; readonly setCodeOutputs: (outputs: CodeOutput$1[]) => void; readonly setMessage: (message: string) => void; readonly setInputError: (error: string | null) => void; readonly handleSubmit: (e: { preventDefault: () => void; }, attachments?: Attachment$1[]) => void; readonly handleUnqueue: () => { content: string; attachments: Attachment$1[]; } | null; readonly enqueueMessage: (content: string, attachments: Attachment$1[]) => boolean; readonly removeQueueItem: (index: number) => void; readonly updateQueueItem: (index: number, content: string) => void; readonly setReasoningEffort: (effort: string) => void; readonly setModel: (model: string | undefined) => void; constructor(config: ChatMachineConfig); private buildReasoningEffortOptions; private sanitizeReasoningEffort; /** * Set the active session ID. Triggers fetch when transitioning to a real * session, or resets state for 'new'/undefined. */ setSessionId(id: string | undefined): void; /** * Update mutable config that may change across parent re-renders. * Called from the React provider's useEffect to keep the machine in sync. */ updateConfig(config: Pick): void; dispose(): void; subscribeSession: (listener: Listener) => (() => void); getSessionSnapshot: () => SessionSnapshot; subscribeMessaging: (listener: Listener) => (() => void); getMessagingSnapshot: () => MessagingSnapshot; subscribeInput: (listener: Listener) => (() => void); getInputSnapshot: () => InputSnapshot; private _updateSession; private _notifySession; private _updateMessaging; private _notifyMessaging; private _updateInput; private _notifyInput; private _persistQueue; /** * True while `epoch` is still the active view — i.e. the machine has not been * disposed and no session switch has happened since `epoch` was captured. * Async ops gate their writes to the shared messaging state on this. */ private _isCurrentEpoch; /** A send can't start while generating, mid-resume, or with an open question. */ private _isBlockedForSend; /** * Send the next queued message, but only if we still own the view (`epoch`) * and nothing is blocking (an in-flight generation or an open question). The * item is dequeued optimistically and restored to the front if it turns out we * can't send when the deferred tick fires — so a queued message is never * silently dropped. */ private _drainQueueIfReady; private _setDebugModeForSession; private _hydrateDebugModeForSession; private _setReasoningEffort; private _setModel; private _fetchSessionIfNeeded; /** * Sets turns from fetch, preserving pending user-only turns if server hasn't caught up. * Applies `turns` + optional `pendingQuestion` in a single messaging update to avoid * transient intermediate UI states between separate notifications. */ private _setTurnsFromFetch; /** * After fetch: if backend has an active stream, either resume (same-browser) or poll (passive). */ private _checkStreamStatusAndResumeOrPoll; private _stopPassivePolling; private _startPassivePolling; private _runResumeStream; private _resumeAcceptedRunOrPoll; private _setError; private _retryFetchSession; private _clearStreamError; private _notifySessionsUpdated; private _cancel; private _setCodeOutputs; private _setMessage; private _setInputError; private _executeSlashCommand; private _insertOptimisticTurn; private _resolveSendSession; private _syncSessionFromServer; private _runSendStream; private _ensureSessionSyncAfterStream; private _finalizeSuccessfulSend; private _handleSendError; /** * Public entry point (no options). Calls _sendMessageCore internally. */ private _sendMessage; /** * Internal entry point with options (for regenerate/edit). */ private _sendMessageDirect; /** * Core send-message logic. Handles slash commands, rate limiting, streaming, * session creation, optimistic turns, and auto-queue-drain. */ private _sendMessageCore; private _handleThinkingChunk; private _handleToolStart; private _handleToolEnd; /** Match a step to a tool_end event. Use callId when present; fall back to name + agentName. */ private _matchStep; private _retryLastMessage; private _handleRegenerate; private _handleEdit; private _handleCopy; private _handleSubmitQuestionAnswers; private _handleRejectPendingQuestion; private _handleSubmit; private _handleUnqueue; private _enqueueMessage; private _removeQueueItem; private _updateQueueItem; } /** * SSE stream parser for consuming Server-Sent Events. */ interface SSEEvent { type: string; content?: string; error?: string; sessionId?: string; toolName?: string; toolCallId?: string; durationMs?: number; success?: boolean; [key: string]: unknown; } /** * Parses an SSE stream and yields parsed JSON events. */ declare function parseSSEStream(reader: ReadableStreamDefaultReader): AsyncGenerator; /** * Parses BiChat SSE stream with normalization and terminal event guarantee. * * Guarantees that the generator always yields a terminal event (`done` or * `error`) as its last item — even when the underlying stream closes silently * without one. */ declare function parseBichatStream(reader: ReadableStreamDefaultReader): AsyncGenerator; /** * Type-safe version of `parseBichatStream` that yields `StreamEvent` * discriminated union members instead of the flat `StreamChunk`. * * Use this in new code for proper type narrowing on `event.type`. */ declare function parseBichatStreamEvents(reader: ReadableStreamDefaultReader): AsyncGenerator; /** * Tool label resolution for the Activity Trace. * * Convention: `BiChat.Tools.{toolName}` for SDK-provided tools. * Upstream consumers can extend with their own prefix (e.g., `Ali.Tools.{customTool}`). */ type TranslateFn = (key: string, params?: Record) => string; /** * Resolve a human-readable label for a tool invocation. * * Lookup order: * 1. Consumer prefix (if provided), e.g. `Ali.Tools.custom_tool` * 2. SDK default prefix `BiChat.Tools.{name}` * 3. Fallback: humanise the raw tool name */ declare function getToolLabel(t: TranslateFn, name: string, args?: string, prefix?: string): string; /** * Utility functions for activity step processing. */ /** * Group activity steps by agent — top-level steps (no agentName) and * agent groups (keyed by agentName). */ declare function groupSteps(steps: ActivityStep[]): { topLevel: ActivityStep[]; agentGroups: [string, ActivityStep[]][]; }; /** * File Utilities * Validation, conversion, and formatting for file attachments */ declare const ATTACHMENT_ACCEPT_ATTRIBUTE: string; declare function isImageMimeType(mimeType: string): boolean; /** * Validates a file against size and type constraints * @throws Error if validation fails */ declare function validateAttachmentFile(file: File$1, maxSizeBytes?: number): void; /** * Backward-compatible image validator used by older components/stories. */ declare function validateImageFile(file: File$1, maxSizeBytes?: number): void; /** * Converts a file to base64 string (without data URL prefix). * Prefers FileReader data URLs, then falls back to buffer-based encoding. */ declare function convertToBase64(file: File$1): Promise; /** * Creates a data URL from base64 string and MIME type */ declare function createDataUrl(base64: string, mimeType: string): string; /** * Formats file size in human-readable format */ declare function formatFileSize(bytes: number): string; /** * Validates multiple files don't exceed count limit * @throws Error if count exceeds limit */ declare function validateFileCount(currentCount: number, newCount: number, maxCount?: number): void; interface FileVisual { /** Phosphor icon component */ icon: typeof File$1; /** Tailwind text-color classes for the icon (light + dark) */ iconColor: string; /** Tailwind background classes for the icon container (light + dark) */ bgColor: string; /** Short label (PDF, CSV, XLS, etc.) */ label: string; } /** * Resolves visual metadata (icon, colors, label) for a file based on * its MIME type and/or filename. Single source of truth used by * AttachmentGrid, SessionArtifactList, DownloadCard, etc. */ declare function getFileVisual(mimeType?: string, filename?: string): FileVisual; /** Chart-specific visual (not mime-based, used for artifact type = 'chart') */ declare const CHART_VISUAL: FileVisual; /** * Groups chat sessions by date relative to today * Categories: Today, Yesterday, Last 7 Days, Last 30 Days, Older * Sessions within each group are sorted by updatedAt (most recent first) */ declare function groupSessionsByDate(sessions: Session$1[], t?: (key: string) => string): SessionGroup[]; /** * Error display utilities for structured RPC error handling. * Distinguishes permission-denied errors (amber styling) from generic errors (red styling). */ interface RPCErrorDisplay { title: string; description: string; isPermissionDenied: boolean; } /** * Check whether an error represents a permission-denied / forbidden response. */ declare function isPermissionDeniedError(error: unknown): boolean; /** * Convert an unknown error into a structured display object. */ declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay; /** * Utilities for splitting accumulated assistant content into the distinct * text blocks the server emitted. * * Background: the executor interleaves text with tool calls within one * turn — `text → tool_call → text → tool_call → final_text`. Before the * backend emitted `text_block_end` markers (iota-uz/iota-sdk#732 M1), * all text segments collapsed into one paragraph on the client. Now the * server emits a `text_block_end` event before each tool_start and at * snapshot time carries byte offsets in `partialMetadata.text_block_offsets`. * * `splitIntoTextBlocks` is the client-side inverse: given the * accumulated content string and the ordered list of byte offsets that * mark segment ends, return one entry per segment. The trailing un-closed * segment (if any) is included as the last entry. */ interface AssistantTextBlock { /** Zero-based index matching the seq carried on text_block_end events. */ seq: number; /** Markdown source for this segment. */ content: string; } /** * Split an accumulated assistant content string into blocks using byte * offsets emitted by the server. Offsets are EXCLUSIVE end markers — * i.e. `offsets[0]` is the length of block 0. * * - When `offsets` is empty or undefined, returns a single block with * the full content. * - When offsets are provided but content is shorter than the last * offset (e.g. stale metadata), offsets beyond the content length are * clamped so no crash propagates up. * - Trailing content after the last offset is included as an extra * block (the un-closed segment during streaming / the final segment * after the last tool call). */ declare function splitIntoTextBlocks(content: string, offsets?: ReadonlyArray | null): AssistantTextBlock[]; /** * Normalise partialMetadata.text_block_offsets from a StreamSnapshotPayload * into a number[]. Guards against malformed server data (non-array, * non-numeric entries) so UI code never has to think about shapes. */ declare function readTextBlockOffsets(partialMetadata?: Record | null): number[]; /** * Hand-mirrored copy of the backend's pkg/httpdto.StreamEventType * constant set. Used by subscribeRunEvents / subscribeActiveRuns / * openManagedEventSource to register addEventListener handlers that * match every `event:` label the server emits. * * Drift between this file and the Go definition is caught by * eventNames.test.ts — the test reads the sibling Go source at test * time and diffs the constant set. When the Go file is absent (CI * without the SDK sidecar checkout) the drift guard self-skips. */ declare const STREAM_EVENT_TYPES: readonly ["chunk", "content", "thinking", "tool_start", "tool_end", "text_block_end", "snapshot", "interrupt", "citation", "usage", "ping", "stream_started", "done", "cancelled", "error", "failed"]; type StreamEventType = typeof STREAM_EVENT_TYPES[number]; /** * Subset of {@link STREAM_EVENT_TYPES} that terminates a run from the * client's perspective. Callers should close the EventSource and * settle their promise on any of these. */ declare const TERMINAL_STREAM_EVENT_TYPES: readonly ["done", "cancelled", "error", "failed"]; type TerminalStreamEventType = typeof TERMINAL_STREAM_EVENT_TYPES[number]; /** * Narrow + type-guard helper. Returns true when `name` is one of the * terminal stream event types. The guard narrows precisely to the * terminal subset — callers receiving `true` get {@link TerminalStreamEventType}, * not the full {@link StreamEventType} union. */ declare function isTerminalEvent(name: string): name is TerminalStreamEventType; export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActiveRunDelivery, type ActiveRunSnapshot, type ActiveTab, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTextBlock, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RegenerateModelOption, type RenderTableData, type RenderTableExport, RetryActionArea, RunEventsConnectError, STREAM_EVENT_TYPES, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, type StreamEventType, StreamingCursor, SystemMessage, TERMINAL_STREAM_EVENT_TYPES, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type TerminalStreamEventType, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseActiveRunsOptions, type UseActiveRunsResult, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, isTerminalEvent, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, readTextBlockOffsets, scaleFadeVariants, sessionItemVariants, splitIntoTextBlocks, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useActiveRuns, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };