@yourgpt/copilot-sdk 2.1.4 → 2.1.5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/MessageTree-CoIt_4nB.d.cts +161 -0
  2. package/dist/MessageTree-CzaN9Eul.d.ts +161 -0
  3. package/dist/{ThreadManager-Dkp_eLty.d.ts → ThreadManager-BEAECB7Y.d.ts} +1 -1
  4. package/dist/{ThreadManager-LfFRhr4e.d.cts → ThreadManager-Cw5fwyCN.d.cts} +1 -1
  5. package/dist/{chunk-POZNNKNJ.cjs → chunk-246B6X5D.cjs} +8 -2
  6. package/dist/chunk-246B6X5D.cjs.map +1 -0
  7. package/dist/{chunk-QLH6TSCC.js → chunk-4QXY2PBG.js} +8 -2
  8. package/dist/chunk-4QXY2PBG.js.map +1 -0
  9. package/dist/{chunk-7PKGRYHY.js → chunk-6BMQZIS3.js} +3094 -355
  10. package/dist/chunk-6BMQZIS3.js.map +1 -0
  11. package/dist/{chunk-N6VZ7FOW.cjs → chunk-76RE7AJE.cjs} +3277 -520
  12. package/dist/chunk-76RE7AJE.cjs.map +1 -0
  13. package/dist/chunk-BJYA5NDL.cjs +96 -0
  14. package/dist/chunk-BJYA5NDL.cjs.map +1 -0
  15. package/dist/{chunk-LZMBBGWH.js → chunk-ENFWM3EY.js} +4 -4
  16. package/dist/{chunk-LZMBBGWH.js.map → chunk-ENFWM3EY.js.map} +1 -1
  17. package/dist/{chunk-OQPRIB73.cjs → chunk-I3SQUNTT.cjs} +71 -25
  18. package/dist/chunk-I3SQUNTT.cjs.map +1 -0
  19. package/dist/{chunk-WAPGTQDR.cjs → chunk-JKGFQUHJ.cjs} +10 -10
  20. package/dist/{chunk-WAPGTQDR.cjs.map → chunk-JKGFQUHJ.cjs.map} +1 -1
  21. package/dist/{chunk-XGITAEXU.js → chunk-LLM7AHMO.js} +2 -2
  22. package/dist/{chunk-XGITAEXU.js.map → chunk-LLM7AHMO.js.map} +1 -1
  23. package/dist/{chunk-ASV6JLYG.cjs → chunk-NUXLAZOE.cjs} +2 -2
  24. package/dist/{chunk-ASV6JLYG.cjs.map → chunk-NUXLAZOE.cjs.map} +1 -1
  25. package/dist/{chunk-37KEHUCE.js → chunk-UXJ6LIZB.js} +51 -7
  26. package/dist/chunk-UXJ6LIZB.js.map +1 -0
  27. package/dist/chunk-VNLLW3ZI.js +94 -0
  28. package/dist/chunk-VNLLW3ZI.js.map +1 -0
  29. package/dist/core/index.cjs +99 -91
  30. package/dist/core/index.d.cts +7 -7
  31. package/dist/core/index.d.ts +7 -7
  32. package/dist/core/index.js +5 -5
  33. package/dist/{index-BHkRA0mM.d.cts → index-CiExk87c.d.cts} +1 -1
  34. package/dist/{index-tB0qI8my.d.ts → index-Dwrcf-CP.d.ts} +1 -1
  35. package/dist/mcp/index.d.cts +3 -3
  36. package/dist/mcp/index.d.ts +3 -3
  37. package/dist/react/index.cjs +113 -52
  38. package/dist/react/index.d.cts +673 -77
  39. package/dist/react/index.d.ts +673 -77
  40. package/dist/react/index.js +7 -6
  41. package/dist/server/index.cjs +339 -0
  42. package/dist/server/index.cjs.map +1 -0
  43. package/dist/server/index.d.cts +171 -0
  44. package/dist/server/index.d.ts +171 -0
  45. package/dist/server/index.js +332 -0
  46. package/dist/server/index.js.map +1 -0
  47. package/dist/tools/anthropic/index.cjs +3 -3
  48. package/dist/tools/anthropic/index.d.cts +1 -1
  49. package/dist/tools/anthropic/index.d.ts +1 -1
  50. package/dist/tools/anthropic/index.js +3 -3
  51. package/dist/tools/brave/index.cjs +6 -6
  52. package/dist/tools/brave/index.d.cts +1 -1
  53. package/dist/tools/brave/index.d.ts +1 -1
  54. package/dist/tools/brave/index.js +3 -3
  55. package/dist/tools/exa/index.cjs +6 -6
  56. package/dist/tools/exa/index.d.cts +1 -1
  57. package/dist/tools/exa/index.d.ts +1 -1
  58. package/dist/tools/exa/index.js +3 -3
  59. package/dist/tools/google/index.cjs +6 -6
  60. package/dist/tools/google/index.d.cts +1 -1
  61. package/dist/tools/google/index.d.ts +1 -1
  62. package/dist/tools/google/index.js +3 -3
  63. package/dist/tools/openai/index.cjs +6 -6
  64. package/dist/tools/openai/index.d.cts +1 -1
  65. package/dist/tools/openai/index.d.ts +1 -1
  66. package/dist/tools/openai/index.js +3 -3
  67. package/dist/tools/searxng/index.cjs +6 -6
  68. package/dist/tools/searxng/index.d.cts +1 -1
  69. package/dist/tools/searxng/index.d.ts +1 -1
  70. package/dist/tools/searxng/index.js +3 -3
  71. package/dist/tools/serper/index.cjs +6 -6
  72. package/dist/tools/serper/index.d.cts +1 -1
  73. package/dist/tools/serper/index.d.ts +1 -1
  74. package/dist/tools/serper/index.js +3 -3
  75. package/dist/tools/tavily/index.cjs +6 -6
  76. package/dist/tools/tavily/index.d.cts +1 -1
  77. package/dist/tools/tavily/index.d.ts +1 -1
  78. package/dist/tools/tavily/index.js +3 -3
  79. package/dist/tools/web-search/index.cjs +7 -7
  80. package/dist/tools/web-search/index.d.cts +2 -2
  81. package/dist/tools/web-search/index.d.ts +2 -2
  82. package/dist/tools/web-search/index.js +4 -4
  83. package/dist/{tools-coIcskZ4.d.ts → tools-DHZhF5km.d.cts} +161 -1
  84. package/dist/{tools-coIcskZ4.d.cts → tools-DHZhF5km.d.ts} +161 -1
  85. package/dist/{types-rjaSVmEF.d.ts → types-BTyJu0WD.d.ts} +1 -1
  86. package/dist/types-BckL3hiw.d.cts +93 -0
  87. package/dist/types-BckL3hiw.d.ts +93 -0
  88. package/dist/{types-C8t4Ut8f.d.cts → types-BdX7uPj0.d.cts} +1 -1
  89. package/dist/{types-DG2ya08y.d.ts → types-BeFBBZ5i.d.cts} +64 -1
  90. package/dist/{types-DG2ya08y.d.cts → types-BeFBBZ5i.d.ts} +64 -1
  91. package/dist/ui/index.cjs +468 -163
  92. package/dist/ui/index.cjs.map +1 -1
  93. package/dist/ui/index.d.cts +81 -4
  94. package/dist/ui/index.d.ts +81 -4
  95. package/dist/ui/index.js +416 -112
  96. package/dist/ui/index.js.map +1 -1
  97. package/package.json +6 -1
  98. package/dist/chunk-37KEHUCE.js.map +0 -1
  99. package/dist/chunk-7PKGRYHY.js.map +0 -1
  100. package/dist/chunk-N6VZ7FOW.cjs.map +0 -1
  101. package/dist/chunk-OQPRIB73.cjs.map +0 -1
  102. package/dist/chunk-POZNNKNJ.cjs.map +0 -1
  103. package/dist/chunk-QLH6TSCC.js.map +0 -1
@@ -7,8 +7,9 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import * as use_stick_to_bottom from 'use-stick-to-bottom';
9
9
  import { d as WebSearchResult, f as WebSearchResponse } from '../types-ZguuKEs_.cjs';
10
- import { T as Thread, b as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-DG2ya08y.cjs';
11
- import { T as ToolDefinition } from '../tools-coIcskZ4.cjs';
10
+ import { a as Thread, c as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-BeFBBZ5i.cjs';
11
+ import { T as ToolDefinition } from '../tools-DHZhF5km.cjs';
12
+ import { B as BranchInfo } from '../MessageTree-CoIt_4nB.cjs';
12
13
  import { d as MCPUIIntent, n as MCPUIFrameProps, M as MCPUIResource } from '../types-B20VCJXL.cjs';
13
14
  import { ClassValue } from 'clsx';
14
15
 
@@ -844,6 +845,42 @@ declare function parseFollowUps(content: string): {
844
845
  */
845
846
  declare function FollowUpQuestions({ questions, onSelect, className, buttonClassName, }: FollowUpProps): react_jsx_runtime.JSX.Element | null;
846
847
 
848
+ interface BranchNavigatorProps {
849
+ /** 0-based index of the current sibling */
850
+ siblingIndex: number;
851
+ /** Total number of sibling variants at this fork */
852
+ totalSiblings: number;
853
+ /** Whether there is a previous sibling to navigate to */
854
+ hasPrevious: boolean;
855
+ /** Whether there is a next sibling to navigate to */
856
+ hasNext: boolean;
857
+ /** Navigate to the previous sibling */
858
+ onPrevious: () => void;
859
+ /** Navigate to the next sibling */
860
+ onNext: () => void;
861
+ /** Additional class names */
862
+ className?: string;
863
+ }
864
+ /**
865
+ * BranchNavigator — ← N/M → variant navigator shown below user messages
866
+ * when a conversation has been branched (via edit or regenerate).
867
+ *
868
+ * Purely presentational — no SDK dependency.
869
+ *
870
+ * @example
871
+ * ```tsx
872
+ * <BranchNavigator
873
+ * siblingIndex={1}
874
+ * totalSiblings={3}
875
+ * hasPrevious={true}
876
+ * hasNext={true}
877
+ * onPrevious={() => switchBranch(siblings[0])}
878
+ * onNext={() => switchBranch(siblings[2])}
879
+ * />
880
+ * ```
881
+ */
882
+ declare function BranchNavigator({ siblingIndex, totalSiblings, hasPrevious, hasNext, onPrevious, onNext, className, }: BranchNavigatorProps): react_jsx_runtime.JSX.Element;
883
+
847
884
  /**
848
885
  * SDK State for DevLogger
849
886
  */
@@ -1333,6 +1370,14 @@ type ChatMessage = {
1333
1370
  }>;
1334
1371
  /** Additional metadata (citations, etc.) */
1335
1372
  metadata?: Record<string, unknown>;
1373
+ /**
1374
+ * Parent message ID for branching support.
1375
+ * - null = root message (no parent)
1376
+ * - undefined = legacy linear message (no branch awareness)
1377
+ */
1378
+ parent_id?: string | null;
1379
+ /** Direct children IDs for O(1) sibling lookup */
1380
+ children_ids?: string[];
1336
1381
  };
1337
1382
 
1338
1383
  /**
@@ -1593,6 +1638,18 @@ type ChatProps = {
1593
1638
  * ```
1594
1639
  */
1595
1640
  mcpToolRenderer?: React__default.ComponentType<ToolRendererProps>;
1641
+ /**
1642
+ * Catch-all renderer for ALL tools not matched by `toolRenderers`.
1643
+ * Applied regardless of tool source (native, custom, or MCP).
1644
+ *
1645
+ * Priority: toolRenderers[name] > mcpToolRenderer (mcp only) > fallbackToolRenderer > tool.render > default
1646
+ *
1647
+ * @example
1648
+ * ```tsx
1649
+ * <Chat fallbackToolRenderer={DefaultToolCard} />
1650
+ * ```
1651
+ */
1652
+ fallbackToolRenderer?: React__default.ComponentType<ToolRendererProps>;
1596
1653
  /**
1597
1654
  * Called when user approves a tool execution.
1598
1655
  * @param executionId - The tool execution ID
@@ -1608,6 +1665,9 @@ type ChatProps = {
1608
1665
  renderInput?: () => React__default.ReactNode;
1609
1666
  /** Custom header renderer (replaces entire header) */
1610
1667
  renderHeader?: () => React__default.ReactNode;
1668
+ /** Group consecutive messages from same role — hides avatar on non-first messages in a run.
1669
+ * Resets on role change or if messages are > 5 minutes apart. */
1670
+ groupConsecutiveMessages?: boolean;
1611
1671
  /** Class name for root container (use for sizing) */
1612
1672
  className?: string;
1613
1673
  /** Granular class names for sub-components */
@@ -1638,6 +1698,23 @@ type ChatProps = {
1638
1698
  onSwitchThread?: (threadId: string) => void;
1639
1699
  /** Whether a thread operation is in progress (disables controls) */
1640
1700
  isThreadBusy?: boolean;
1701
+ /**
1702
+ * Returns branch navigation info for a message ID.
1703
+ * Provide this to enable the ← N/M → navigator below edited user messages.
1704
+ * Wire from `useChat().getBranchInfo` or `useCopilot().actions.getBranchInfo`.
1705
+ */
1706
+ getBranchInfo?: (messageId: string) => BranchInfo | null;
1707
+ /**
1708
+ * Called when the user clicks ← or → in the branch navigator.
1709
+ * Wire from `useChat().switchBranch` or `useCopilot().actions.switchBranch`.
1710
+ */
1711
+ onSwitchBranch?: (messageId: string) => void;
1712
+ /**
1713
+ * Called when the user submits an edit to a user message.
1714
+ * Creates a new branch from the same parent as the original message.
1715
+ * Wire from `useChat().editMessage` or `useCopilot().actions.editMessage`.
1716
+ */
1717
+ onEditMessage?: (messageId: string, newContent: string) => void;
1641
1718
  };
1642
1719
 
1643
1720
  interface CopilotChatInternalContext {
@@ -1748,7 +1825,7 @@ declare function BackButton({ className, children, disabled, "aria-label": ariaL
1748
1825
  */
1749
1826
  type ThreadPickerCompoundProps = Omit<ThreadPickerProps, "value" | "threads" | "onSelect" | "onNewThread" | "onDeleteThread" | "disabled">;
1750
1827
  declare function ThreadPickerCompound(props: ThreadPickerCompoundProps): react_jsx_runtime.JSX.Element | null;
1751
- declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, }: ChatProps): react_jsx_runtime.JSX.Element;
1828
+ declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
1752
1829
  /**
1753
1830
  * Chat component with compound component pattern.
1754
1831
  *
@@ -2157,4 +2234,4 @@ declare function MCPUIFrameList({ resources, onIntent, onError, className, frame
2157
2234
 
2158
2235
  declare function cn(...inputs: ClassValue[]): string;
2159
2236
 
2160
- export { AlertTriangleIcon, type BackButtonProps, BotIcon, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, type Citation, CitationBadge, type CitationBadgeProps, type CitationConfig, CitationSuperscript, type CitationSuperscriptProps, type CitationsConfig, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, MCPUIFrame, MCPUIFrameList, type MCPUIFrameListProps, MCPUIFrameProps, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, MessageWithCitations, type MessageWithCitationsProps, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SearchAnswer, type SearchAnswerProps, SearchResults, type SearchResultsProps, SearchResultsWithAnswer, type SearchResultsWithAnswerProps, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, SimpleSource, type SimpleSourceProps, Source, SourceContent, type SourceContentProps, SourceGroup, type SourceGroupProps, type SourceItem, SourcePill, type SourcePillProps, type SourceProps, SourceTrigger, type SourceTriggerProps, SourcesBar, type SourcesBarProps, SourcesCollapsible, type SourcesCollapsibleProps, SourcesList, type SourcesListProps, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, annotationsToCitations, cn, parseFollowUps, resultsToCitations, useChatContainer, useCopilotChatContext, useCopilotUI };
2237
+ export { AlertTriangleIcon, type BackButtonProps, BotIcon, BranchNavigator, type BranchNavigatorProps, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, type Citation, CitationBadge, type CitationBadgeProps, type CitationConfig, CitationSuperscript, type CitationSuperscriptProps, type CitationsConfig, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, MCPUIFrame, MCPUIFrameList, type MCPUIFrameListProps, MCPUIFrameProps, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, MessageWithCitations, type MessageWithCitationsProps, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SearchAnswer, type SearchAnswerProps, SearchResults, type SearchResultsProps, SearchResultsWithAnswer, type SearchResultsWithAnswerProps, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, SimpleSource, type SimpleSourceProps, Source, SourceContent, type SourceContentProps, SourceGroup, type SourceGroupProps, type SourceItem, SourcePill, type SourcePillProps, type SourceProps, SourceTrigger, type SourceTriggerProps, SourcesBar, type SourcesBarProps, SourcesCollapsible, type SourcesCollapsibleProps, SourcesList, type SourcesListProps, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, annotationsToCitations, cn, parseFollowUps, resultsToCitations, useChatContainer, useCopilotChatContext, useCopilotUI };
@@ -7,8 +7,9 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import * as use_stick_to_bottom from 'use-stick-to-bottom';
9
9
  import { d as WebSearchResult, f as WebSearchResponse } from '../types-ZguuKEs_.js';
10
- import { T as Thread, b as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-DG2ya08y.js';
11
- import { T as ToolDefinition } from '../tools-coIcskZ4.js';
10
+ import { a as Thread, c as ThreadStorageAdapter, A as AsyncThreadStorageAdapter } from '../types-BeFBBZ5i.js';
11
+ import { T as ToolDefinition } from '../tools-DHZhF5km.js';
12
+ import { B as BranchInfo } from '../MessageTree-CzaN9Eul.js';
12
13
  import { d as MCPUIIntent, n as MCPUIFrameProps, M as MCPUIResource } from '../types-B20VCJXL.js';
13
14
  import { ClassValue } from 'clsx';
14
15
 
@@ -844,6 +845,42 @@ declare function parseFollowUps(content: string): {
844
845
  */
845
846
  declare function FollowUpQuestions({ questions, onSelect, className, buttonClassName, }: FollowUpProps): react_jsx_runtime.JSX.Element | null;
846
847
 
848
+ interface BranchNavigatorProps {
849
+ /** 0-based index of the current sibling */
850
+ siblingIndex: number;
851
+ /** Total number of sibling variants at this fork */
852
+ totalSiblings: number;
853
+ /** Whether there is a previous sibling to navigate to */
854
+ hasPrevious: boolean;
855
+ /** Whether there is a next sibling to navigate to */
856
+ hasNext: boolean;
857
+ /** Navigate to the previous sibling */
858
+ onPrevious: () => void;
859
+ /** Navigate to the next sibling */
860
+ onNext: () => void;
861
+ /** Additional class names */
862
+ className?: string;
863
+ }
864
+ /**
865
+ * BranchNavigator — ← N/M → variant navigator shown below user messages
866
+ * when a conversation has been branched (via edit or regenerate).
867
+ *
868
+ * Purely presentational — no SDK dependency.
869
+ *
870
+ * @example
871
+ * ```tsx
872
+ * <BranchNavigator
873
+ * siblingIndex={1}
874
+ * totalSiblings={3}
875
+ * hasPrevious={true}
876
+ * hasNext={true}
877
+ * onPrevious={() => switchBranch(siblings[0])}
878
+ * onNext={() => switchBranch(siblings[2])}
879
+ * />
880
+ * ```
881
+ */
882
+ declare function BranchNavigator({ siblingIndex, totalSiblings, hasPrevious, hasNext, onPrevious, onNext, className, }: BranchNavigatorProps): react_jsx_runtime.JSX.Element;
883
+
847
884
  /**
848
885
  * SDK State for DevLogger
849
886
  */
@@ -1333,6 +1370,14 @@ type ChatMessage = {
1333
1370
  }>;
1334
1371
  /** Additional metadata (citations, etc.) */
1335
1372
  metadata?: Record<string, unknown>;
1373
+ /**
1374
+ * Parent message ID for branching support.
1375
+ * - null = root message (no parent)
1376
+ * - undefined = legacy linear message (no branch awareness)
1377
+ */
1378
+ parent_id?: string | null;
1379
+ /** Direct children IDs for O(1) sibling lookup */
1380
+ children_ids?: string[];
1336
1381
  };
1337
1382
 
1338
1383
  /**
@@ -1593,6 +1638,18 @@ type ChatProps = {
1593
1638
  * ```
1594
1639
  */
1595
1640
  mcpToolRenderer?: React__default.ComponentType<ToolRendererProps>;
1641
+ /**
1642
+ * Catch-all renderer for ALL tools not matched by `toolRenderers`.
1643
+ * Applied regardless of tool source (native, custom, or MCP).
1644
+ *
1645
+ * Priority: toolRenderers[name] > mcpToolRenderer (mcp only) > fallbackToolRenderer > tool.render > default
1646
+ *
1647
+ * @example
1648
+ * ```tsx
1649
+ * <Chat fallbackToolRenderer={DefaultToolCard} />
1650
+ * ```
1651
+ */
1652
+ fallbackToolRenderer?: React__default.ComponentType<ToolRendererProps>;
1596
1653
  /**
1597
1654
  * Called when user approves a tool execution.
1598
1655
  * @param executionId - The tool execution ID
@@ -1608,6 +1665,9 @@ type ChatProps = {
1608
1665
  renderInput?: () => React__default.ReactNode;
1609
1666
  /** Custom header renderer (replaces entire header) */
1610
1667
  renderHeader?: () => React__default.ReactNode;
1668
+ /** Group consecutive messages from same role — hides avatar on non-first messages in a run.
1669
+ * Resets on role change or if messages are > 5 minutes apart. */
1670
+ groupConsecutiveMessages?: boolean;
1611
1671
  /** Class name for root container (use for sizing) */
1612
1672
  className?: string;
1613
1673
  /** Granular class names for sub-components */
@@ -1638,6 +1698,23 @@ type ChatProps = {
1638
1698
  onSwitchThread?: (threadId: string) => void;
1639
1699
  /** Whether a thread operation is in progress (disables controls) */
1640
1700
  isThreadBusy?: boolean;
1701
+ /**
1702
+ * Returns branch navigation info for a message ID.
1703
+ * Provide this to enable the ← N/M → navigator below edited user messages.
1704
+ * Wire from `useChat().getBranchInfo` or `useCopilot().actions.getBranchInfo`.
1705
+ */
1706
+ getBranchInfo?: (messageId: string) => BranchInfo | null;
1707
+ /**
1708
+ * Called when the user clicks ← or → in the branch navigator.
1709
+ * Wire from `useChat().switchBranch` or `useCopilot().actions.switchBranch`.
1710
+ */
1711
+ onSwitchBranch?: (messageId: string) => void;
1712
+ /**
1713
+ * Called when the user submits an edit to a user message.
1714
+ * Creates a new branch from the same parent as the original message.
1715
+ * Wire from `useChat().editMessage` or `useCopilot().actions.editMessage`.
1716
+ */
1717
+ onEditMessage?: (messageId: string, newContent: string) => void;
1641
1718
  };
1642
1719
 
1643
1720
  interface CopilotChatInternalContext {
@@ -1748,7 +1825,7 @@ declare function BackButton({ className, children, disabled, "aria-label": ariaL
1748
1825
  */
1749
1826
  type ThreadPickerCompoundProps = Omit<ThreadPickerProps, "value" | "threads" | "onSelect" | "onNewThread" | "onDeleteThread" | "disabled">;
1750
1827
  declare function ThreadPickerCompound(props: ThreadPickerCompoundProps): react_jsx_runtime.JSX.Element | null;
1751
- declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, }: ChatProps): react_jsx_runtime.JSX.Element;
1828
+ declare function ChatComponent({ messages, onSendMessage, onStop, isLoading, children, placeholder, welcomeMessage, title, showHeader, header, threadPicker, logo, name, onClose, showPoweredBy, showUserAvatar, userAvatar: userAvatarProp, assistantAvatar: assistantAvatarProp, loaderVariant, fontSize, maxFileSize, allowedFileTypes, attachmentsEnabled, attachmentsDisabledTooltip, processAttachment: processAttachmentProp, suggestions, onSuggestionClick, welcome, recentThreads, onSelectThread, onDeleteThread, onViewMoreThreads, isProcessing, registeredTools, toolRenderers, mcpToolRenderer, fallbackToolRenderer, onApproveToolExecution, onRejectToolExecution, showFollowUps, followUpClassName, followUpButtonClassName, citations, renderMessage, renderInput, renderHeader, groupConsecutiveMessages, className, classNames, onNewChat, threads, currentThreadId, onSwitchThread, isThreadBusy, getBranchInfo, onSwitchBranch, onEditMessage, }: ChatProps): react_jsx_runtime.JSX.Element;
1752
1829
  /**
1753
1830
  * Chat component with compound component pattern.
1754
1831
  *
@@ -2157,4 +2234,4 @@ declare function MCPUIFrameList({ resources, onIntent, onError, className, frame
2157
2234
 
2158
2235
  declare function cn(...inputs: ClassValue[]): string;
2159
2236
 
2160
- export { AlertTriangleIcon, type BackButtonProps, BotIcon, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, type Citation, CitationBadge, type CitationBadgeProps, type CitationConfig, CitationSuperscript, type CitationSuperscriptProps, type CitationsConfig, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, MCPUIFrame, MCPUIFrameList, type MCPUIFrameListProps, MCPUIFrameProps, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, MessageWithCitations, type MessageWithCitationsProps, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SearchAnswer, type SearchAnswerProps, SearchResults, type SearchResultsProps, SearchResultsWithAnswer, type SearchResultsWithAnswerProps, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, SimpleSource, type SimpleSourceProps, Source, SourceContent, type SourceContentProps, SourceGroup, type SourceGroupProps, type SourceItem, SourcePill, type SourcePillProps, type SourceProps, SourceTrigger, type SourceTriggerProps, SourcesBar, type SourcesBarProps, SourcesCollapsible, type SourcesCollapsibleProps, SourcesList, type SourcesListProps, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, annotationsToCitations, cn, parseFollowUps, resultsToCitations, useChatContainer, useCopilotChatContext, useCopilotUI };
2237
+ export { AlertTriangleIcon, type BackButtonProps, BotIcon, BranchNavigator, type BranchNavigatorProps, Button, CapabilityBadge, type CapabilityBadgeProps, CapabilityList, type CapabilityListProps, type CapabilityType, Chat, ChatContainerContent, ChatContainerRoot, ChatContainerScrollAnchor, type ChatMessage, type ChatProps, type ChatViewProps, ChatWelcome, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronUpIcon, type Citation, CitationBadge, type CitationBadgeProps, type CitationConfig, CitationSuperscript, type CitationSuperscriptProps, type CitationsConfig, CloseIcon, type CloudPersistenceConfig, CodeBlock, CompactPermissionConfirmation, type CompactPermissionConfirmationProps, Confirmation, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApproved, type ConfirmationApprovedProps, ConfirmationMessage, type ConfirmationMessageProps, ConfirmationPending, type ConfirmationPendingProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, type ConfirmationState$1 as ConfirmationState, ConnectedChat, type ConnectedChatProps, CopilotChat, type CopilotChatClassNames, type CopilotChatPersistenceConfig, type CopilotChatProps, type CopilotUIConfig, type CopilotUIContextValue, CopilotUIProvider, type CopilotUIProviderProps, CopyIcon, DEFAULT_PERMISSION_OPTIONS, DevLogger, type DevLoggerProps, type DevLoggerState, FeedbackBar, type FollowUpProps, FollowUpQuestions, type FooterProps, type HeaderProps, type HomeViewProps as HomeProps, type HomeViewProps, InlineToolSteps, type InlineToolStepsProps, Loader, type LocalPersistenceConfig, MCPUIFrame, MCPUIFrameList, type MCPUIFrameListProps, MCPUIFrameProps, Markdown, MessageAvatar, MessageContent, Message as MessagePrimitive, MessageWithCitations, type MessageWithCitationsProps, type ModelOption, ModelSelector, type ModelSelectorProps, PermissionConfirmation, type PermissionConfirmationProps, type PermissionLevel, type PermissionOption, PoweredBy, type PoweredByProps, PromptInput, PromptInputAction, PromptInputActions, PromptInputTextarea, type ProviderGroup, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, RefreshIcon, ScrollButton, SearchAnswer, type SearchAnswerProps, SearchResults, type SearchResultsProps, SearchResultsWithAnswer, type SearchResultsWithAnswerProps, SendIcon, type ServerPersistenceConfig, SimpleConfirmation, type SimpleConfirmationProps, SimpleModelSelector, type SimpleModelSelectorProps, SimpleReasoning, type SimpleReasoningProps, SimpleSource, type SimpleSourceProps, Source, SourceContent, type SourceContentProps, SourceGroup, type SourceGroupProps, type SourceItem, SourcePill, type SourcePillProps, type SourceProps, SourceTrigger, type SourceTriggerProps, SourcesBar, type SourcesBarProps, SourcesCollapsible, type SourcesCollapsibleProps, SourcesList, type SourcesListProps, StopIcon, ThreadCard, type ThreadCardProps, ThreadList, type ThreadListProps, ThreadPicker, type ThreadPickerCompoundProps, type ThreadPickerProps, ThumbsDownIcon, ThumbsUpIcon, ToolExecutionMessage, type ToolRendererProps, type ToolRenderers, ToolStep, type ToolStepData, type ToolStepProps, type ToolStepStatus, ToolSteps, type ToolStepsProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, UserIcon, type WelcomeConfig, XIcon, annotationsToCitations, cn, parseFollowUps, resultsToCitations, useChatContainer, useCopilotChatContext, useCopilotUI };