import type { ToolCallMessagePartProps } from "@assistant-ui/react"; import React from "react"; import type { ActionChatUIConfig } from "../../action-ui.js"; import type { AgentMcpAppPayload } from "../../mcp-client/app-result.js"; import type { ContentPart } from "../sse-event-processor.js"; import { FilesChangedSummary } from "../tool-cells/index.js"; export declare const ChatRunningContext: React.Context; export declare const ChatRunDurationContext: React.Context; export declare const ASSISTANT_VISIBLE_TOOL_CALL_LIMIT = 3; /** * Human-in-the-loop approval bridge. `AssistantChatInner` provides a value that * re-issues the turn approving a specific paused tool call (opt-in * `needsApproval` actions). When null, the Approve button is not rendered. * Deny defaults to local-only (the action stays un-run) unless `onDeny` is * provided, and "Always allow" only renders when `onAlwaysAllow` is provided * — both are additive so existing action-approval consumers are unaffected. */ export type ApprovalContextValue = { /** Re-issue the turn so the server runs the approved call. */ onApprove: (approvalKey: string) => void; /** * Optional host hook invoked in addition to the local "denied" state, e.g. * so a Code session can also resolve its own pending approval as denied. */ onDeny?: (approvalKey: string) => void; /** * Optional host hook that persists this exact call so future occurrences * skip the approval gate. When absent, no "Always allow" button renders. */ onAlwaysAllow?: (approvalKey: string) => void; }; export declare const ApprovalContext: React.Context; export declare const TOOL_LONG_RUNNING_HINT_DELAY_MS = 45000; export declare function ToolActivityPresentation({ toolName, isRunning, isActiveTail, suppressLongRunningHint, children, }: { toolName: string; isRunning: boolean; isActiveTail: boolean; suppressLongRunningHint?: boolean; children: React.ReactNode; }): React.JSX.Element; type ToolDetailSection = "input" | "result"; export type ToolDetailPayload = { section: ToolDetailSection; title: string; text: string; copyText: string; lang: string; }; export declare function toolInputPayload(toolName: string, args: Record): ToolDetailPayload | null; export declare function toolResultPayload(result: string | undefined): ToolDetailPayload | null; export declare function AnimatedCollapse({ open, children, }: { open: boolean; children: React.ReactNode; }): React.JSX.Element | null; export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, structuredMeta, approval, repeatCount, isLatestRunning, isActiveTail, }: { toolName: string; argsText?: string; args: Record; result?: string; mcpApp?: AgentMcpAppPayload; chatUI?: ActionChatUIConfig; isRunning: boolean; structuredMeta?: Record; approval?: { approvalKey: string; dismissed?: boolean; }; repeatCount?: number; /** The latest tool shown while the overall chat turn is still active. */ isActiveTail?: boolean; /** @deprecated Use isActiveTail. */ isLatestRunning?: boolean; }): React.JSX.Element; export declare function ToolCallFallback({ toolName, args, argsText, result, ...rest }: ToolCallMessagePartProps & { mcpApp?: AgentMcpAppPayload; chatUI?: ActionChatUIConfig; structuredMeta?: Record; activity?: boolean; approval?: { approvalKey: string; dismissed?: boolean; }; repeatCount?: number; isLatestRunning?: boolean; isActiveTail?: boolean; }): React.JSX.Element; export declare function ReconnectStreamMessage({ content, }: { content: ContentPart[]; }): React.JSX.Element; export declare function ReasoningCell({ text, isStreaming, resetKey, defaultOpen, autoCollapse, collapseWhenReplaced, durationMs, }: { text: string; isStreaming?: boolean; /** Stable identity used to restart the reveal when a new reasoning part mounts. */ resetKey?: string; defaultOpen?: boolean; /** Animate closed when a live reasoning segment finishes during a run. */ autoCollapse?: boolean; /** Animate closed when a newer reasoning segment replaces this one. */ collapseWhenReplaced?: boolean; /** * Elapsed thinking time in ms, once known. Only meaningful once streaming * has finished — callers that track live timing (see ReasoningMessagePart) * pass this so the label can read "Thought for Xs" instead of "Thought". * Historical messages with no live timing simply omit it. */ durationMs?: number | null; }): React.JSX.Element | null; export declare function formatWorkedDuration(ms: number): string; export declare function WorkedForSummary({ durationMs, defaultOpen, autoCollapse, children, }: { durationMs?: number | null; /** Keep completed work visible when the turn contains interactive UI. */ defaultOpen?: boolean; /** When true, close the summary after a run has completed. */ autoCollapse?: boolean; children: React.ReactNode; }): React.JSX.Element; export declare function RanToolsSummary({ toolCount, children, }: { toolCount: number; children: React.ReactNode; }): React.JSX.Element; export { FilesChangedSummary }; //# sourceMappingURL=tool-call-display.d.ts.map