import * as React from 'react'; import { ReactNode } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { S as SessionMessage } from './message-BHWbxBtT.js'; import { S as SessionPart, a as ToolPart } from './parts-dj7AcUg0.js'; import { AgentBranding } from './types.js'; import { C as CustomToolRenderer } from './tool-display-z4JcDmMQ.js'; import { R as Run, G as GroupedMessage } from './run-PfLmDAox.js'; import { OpenUIAction } from './openui.js'; import { T as ToolCallData } from './tool-call-feed-D9iofJgW.js'; /** * Transcript-only container: message list + auto-scroll. Composers are * composed BELOW this by the app (the canonical one is `AgentComposer` in * `@tangle-network/sandbox-ui`) — this component never renders an input. */ interface ChatContainerProps { messages: SessionMessage[]; partMap: Record; isStreaming: boolean; branding?: AgentBranding; className?: string; /** Custom renderer for tool details. Return ReactNode to override, null to use default. */ renderToolDetail?: CustomToolRenderer; /** Presentation mode for the session view. */ presentation?: "runs" | "timeline"; /** Callback when an OpenUI action button is pressed within inline OpenUI blocks. */ onOpenUIAction?: (action: OpenUIAction) => void; /** Enable rendering OpenUI schemas inline in the chat timeline. Defaults to true. */ enableOpenUI?: boolean; /** Optional actions rendered beside each grouped assistant run. */ renderRunActions?: (run: Run) => ReactNode; /** Optional actions rendered below each user message bubble. */ renderUserMessageActions?: (message: SessionMessage, parts: SessionPart[]) => ReactNode; /** Optional actions rendered beside individual tool items in the run-grouped * (`runs`) presentation. */ renderToolActions?: (part: ToolPart, options: { run: Run; messageId: string; partIndex: number; }) => ReactNode; /** Optional actions rendered beside individual tool items in the `timeline` * presentation, which has no run/message grouping (hence part-only). */ renderTimelineToolActions?: (part: ToolPart) => ReactNode; /** In the `timeline` presentation, collapse to the first N spine rows behind * a "Show N more steps" toggle. Omit to always show every row. */ collapseTimelineAfter?: number; } /** * Chat transcript container: message list + auto-scroll. * Orchestrates useRunGroups, useRunCollapseState, and useAutoScroll. */ declare const ChatContainer: React.MemoExoticComponent<({ messages, partMap, isStreaming, branding, className, renderToolDetail, presentation, onOpenUIAction, enableOpenUI, renderRunActions, renderUserMessageActions, renderToolActions, renderTimelineToolActions, collapseTimelineAfter, }: ChatContainerProps) => react_jsx_runtime.JSX.Element>; interface MessageListProps { groups: GroupedMessage[]; partMap: Record; isCollapsed: (runId: string) => boolean; onToggleCollapse: (runId: string) => void; branding?: AgentBranding; renderToolDetail?: CustomToolRenderer; renderRunActions?: (group: Extract["run"]) => ReactNode; renderUserMessageActions?: (message: SessionMessage, parts: SessionPart[]) => ReactNode; renderToolActions?: (part: ToolPart, options: { run: Extract["run"]; messageId: string; partIndex: number; }) => ReactNode; } /** * Maps GroupedMessage[] to UserMessage and RunGroup components. * This is the main render list for the chat view. */ declare const MessageList: React.MemoExoticComponent<({ groups, partMap, isCollapsed, onToggleCollapse, branding, renderToolDetail, renderRunActions, renderUserMessageActions, renderToolActions, }: MessageListProps) => react_jsx_runtime.JSX.Element>; interface UserMessageProps { /** Session-model input: text is derived from these parts. */ message?: SessionMessage; parts?: SessionPart[]; /** Direct-content input (e.g. AgentTimeline): explicit text + timestamp. */ content?: string; timestamp?: Date; actions?: ReactNode; } /** * The single user message bubble — a quiet, right-aligned bordered bubble on the * muted surface (no loud fill, no uppercase label). Used by both the run/message * list (session-model `parts`) and AgentTimeline (direct `content`/`timestamp`). */ declare const UserMessage: React.MemoExoticComponent<({ message: _message, parts, content, timestamp, actions }: UserMessageProps) => react_jsx_runtime.JSX.Element | null>; type MessageRole = "user" | "assistant" | "system"; interface ChatMessageProps { role: MessageRole; content: string; /** Inline tool call activity rendered between text chunks */ toolCalls?: ReactNode; /** Whether the message is still streaming */ isStreaming?: boolean; /** Timestamp */ timestamp?: Date; className?: string; /** Custom user label. Default: "You" */ userLabel?: string; /** Custom assistant label. Default: "Agent" */ assistantLabel?: string; /** Hide the role label row entirely */ hideRoleLabel?: boolean; } declare function ChatMessage({ role, content, toolCalls, isStreaming, timestamp, className, userLabel, assistantLabel, hideRoleLabel, }: ChatMessageProps): react_jsx_runtime.JSX.Element; interface ThinkingIndicatorProps { className?: string; } declare function ThinkingIndicator({ className }: ThinkingIndicatorProps): react_jsx_runtime.JSX.Element; type AgentTimelineTone = "default" | "info" | "success" | "warning" | "error"; interface AgentTimelineMessageItem { id: string; kind: "message"; role: MessageRole; content: string; toolCalls?: ReactNode; isStreaming?: boolean; timestamp?: Date; after?: ReactNode; } interface AgentTimelineToolItem { id: string; kind: "tool"; call: ToolCallData; /** Source tool part, so a consumer's `renderToolActions` gets the real * input/output (the flat `call` is display-only). */ part?: ToolPart; } interface AgentTimelineToolGroupItem { id: string; kind: "tool_group"; title?: string; calls: ToolCallData[]; /** Source tool parts, parallel to `calls`. */ parts?: ToolPart[]; } interface AgentTimelineStatusItem { id: string; kind: "status"; label: string; detail?: string; tone?: AgentTimelineTone; } interface AgentTimelineArtifactItem { id: string; kind: "artifact"; title: string; description?: string; meta?: ReactNode; icon?: ReactNode; tone?: AgentTimelineTone; action?: ReactNode; onClick?: () => void; } interface AgentTimelineCustomItem { id: string; kind: "custom"; content: ReactNode; } type AgentTimelineItem = AgentTimelineMessageItem | AgentTimelineToolItem | AgentTimelineToolGroupItem | AgentTimelineStatusItem | AgentTimelineArtifactItem | AgentTimelineCustomItem; interface AgentTimelineProps { items: AgentTimelineItem[]; isThinking?: boolean; emptyState?: ReactNode; className?: string; /** Optional actions rendered beside each tool item (e.g. "open in artifacts"). * Receives the source tool part carried on the item. */ renderToolActions?: (part: ToolPart) => ReactNode; /** When set, collapse the timeline to the first N spine rows behind a * "Show N more steps" toggle. Omit to always show every row. */ collapseAfter?: number; } /** * AgentTimeline — unified mixed-content timeline for agent-backed sandbox * sessions. Renders messages, tool steps, status cards, and artifact handoffs in * a single execution narrative. */ declare function AgentTimeline({ items, isThinking, emptyState, className, renderToolActions, collapseAfter, }: AgentTimelineProps): react_jsx_runtime.JSX.Element | null; export { AgentTimeline, type AgentTimelineArtifactItem, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, MessageList, type MessageListProps, type MessageRole, ThinkingIndicator, type ThinkingIndicatorProps, UserMessage, type UserMessageProps };