teodor-new-chat-ui 4.3.596 → 4.3.598

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 (135) hide show
  1. package/dist/components/ui/command.d.ts +7 -7
  2. package/dist/components/ui/resizable.d.ts +1 -1
  3. package/dist/features/{chat/components/ChatInterface → conversation/components}/ChatInterface.d.ts +4 -4
  4. package/dist/features/{chat/components/Message → conversation/components}/MessageComponent.d.ts +2 -1
  5. package/dist/features/{chat/components/Message → conversation/components}/MessageList.d.ts +2 -2
  6. package/dist/features/{chat/components/Message → conversation/components}/MessageRow.d.ts +3 -3
  7. package/dist/features/{chat/components/Message → conversation/components}/ToolContent.d.ts +2 -2
  8. package/dist/features/{chat/components/Message → conversation/components}/hooks/useParsedMessageContent.d.ts +1 -1
  9. package/dist/features/conversation/components/index.d.ts +12 -0
  10. package/dist/features/{chat/components/Message → conversation/components}/renderers/MessageContent.d.ts +3 -4
  11. package/dist/features/{chat/components/Message → conversation/components}/renderers/MessageHeader.d.ts +1 -1
  12. package/dist/features/conversation/components/renderers/artifacts/ArtifactProgress.d.ts +13 -0
  13. package/dist/features/conversation/components/renderers/artifacts/index.d.ts +1 -0
  14. package/dist/features/{chat/components/Message → conversation/components}/renderers/index.d.ts +3 -2
  15. package/dist/features/{chat/components/Message → conversation/components}/renderers/tool/artifacts/ArtifactRenderer.d.ts +1 -1
  16. package/dist/features/conversation/components/renderers/tool/content/ToolProgress.d.ts +11 -0
  17. package/dist/features/{chat/components/Message → conversation/components}/renderers/user/InterruptPartRenderer.d.ts +1 -1
  18. package/dist/features/conversation/components/utils/artifactUtils.d.ts +35 -0
  19. package/dist/features/conversation/components/utils/messageHelpers.d.ts +62 -0
  20. package/dist/features/conversation/contexts/index.d.ts +2 -0
  21. package/dist/features/conversation/contexts/reducers/MessageReducer.d.ts +73 -0
  22. package/dist/features/{chat → conversation}/hooks/useChatController.d.ts +1 -1
  23. package/dist/features/conversation/hooks/useThreadHistoryState.d.ts +43 -0
  24. package/dist/features/conversation/hooks/useThreadsState.d.ts +40 -0
  25. package/dist/features/{chat → conversation}/index.d.ts +1 -1
  26. package/dist/features/persistence/checkpoints/types/models.d.ts +53 -0
  27. package/dist/features/{checkpoint → persistence/checkpoints}/utils/messagePreviews.d.ts +1 -1
  28. package/dist/features/persistence/index.d.ts +1 -0
  29. package/dist/features/streaming/contexts/StreamingProvider.d.ts +2 -2
  30. package/dist/features/streaming/contexts/types.d.ts +54 -7
  31. package/dist/features/streaming/hooks/types.d.ts +1 -1
  32. package/dist/features/streaming/hooks/use-stream.d.ts +1 -1
  33. package/dist/features/streaming/utils/types.d.ts +10 -1
  34. package/dist/features/thread/components/ThreadListItem.d.ts +16 -17
  35. package/dist/features/thread/components/ThreadManager.d.ts +1 -1
  36. package/dist/features/thread/contexts/index.d.ts +1 -2
  37. package/dist/features/thread/contexts/reducers/MessageReducer.d.ts +1 -71
  38. package/dist/features/thread/hooks/useThreadHistoryState.d.ts +1 -43
  39. package/dist/features/thread/hooks/useThreadsState.d.ts +1 -40
  40. package/dist/index.esm.js +4531 -20199
  41. package/dist/index.esm.js.map +1 -1
  42. package/dist/index.umd.js +17 -110
  43. package/dist/index.umd.js.map +1 -1
  44. package/dist/lib/index.d.ts +3 -12
  45. package/dist/shared/core/api/clients/authClient.d.ts +2 -1
  46. package/dist/shared/core/api/clients/chatClient.d.ts +5 -1
  47. package/dist/shared/core/api/utils/http.d.ts +1 -1
  48. package/dist/shared/core/constants/env.d.ts +2 -2
  49. package/dist/shared/core/constants/index.d.ts +1 -0
  50. package/dist/shared/core/constants/storage.d.ts +14 -0
  51. package/dist/shared/core/contexts/providers/ApiProvider.d.ts +1 -1
  52. package/dist/shared/core/contexts/providers/ChatProviders.d.ts +2 -2
  53. package/dist/shared/core/types/index.d.ts +1 -8
  54. package/dist/shared/ui/components/command.d.ts +7 -7
  55. package/dist/types/api/auth.d.ts +15 -0
  56. package/dist/types/api/common.d.ts +9 -0
  57. package/dist/types/api/files.d.ts +7 -0
  58. package/dist/types/api/runs.d.ts +101 -0
  59. package/dist/types/api.d.ts +7 -0
  60. package/dist/types/core/context.d.ts +5 -0
  61. package/dist/types/core/models.d.ts +6 -0
  62. package/dist/types/core.d.ts +100 -0
  63. package/dist/types/domain/artifacts.d.ts +13 -0
  64. package/dist/types/domain/chat.d.ts +130 -0
  65. package/dist/types/domain/persistence.d.ts +52 -0
  66. package/dist/types/domain/streaming.d.ts +188 -0
  67. package/dist/types/index.d.ts +16 -4
  68. package/dist/types/shared/common.d.ts +19 -0
  69. package/package.json +1 -1
  70. package/dist/features/chat/components/ChatInterface/index.d.ts +0 -11
  71. package/dist/features/chat/components/ChatLayout.d.ts +0 -25
  72. package/dist/features/chat/components/Composer.d.ts +0 -4
  73. package/dist/features/chat/components/Message/index.d.ts +0 -12
  74. package/dist/features/chat/components/Message/renderers/tool/content/StreamProgress.d.ts +0 -8
  75. package/dist/features/chat/components/Message/utils/messageHelpers.d.ts +0 -30
  76. package/dist/features/chat/components/index.d.ts +0 -5
  77. package/dist/features/chat/types/index.d.ts +0 -4
  78. package/dist/features/chat/types/models.d.ts +0 -97
  79. package/dist/features/checkpoint/types/models.d.ts +0 -48
  80. package/dist/features/thread/components/index.d.ts +0 -4
  81. package/dist/features/thread/index.d.ts +0 -5
  82. package/dist/features/thread/types/index.d.ts +0 -4
  83. package/dist/features/thread/types/models.d.ts +0 -42
  84. package/dist/shared/core/types/context.d.ts +0 -203
  85. package/dist/shared/core/types/models.d.ts +0 -54
  86. package/dist/shared/core/types/requests.d.ts +0 -22
  87. package/dist/shared/ui/components/input.d.ts +0 -3
  88. package/dist/shared/ui/components/label.d.ts +0 -5
  89. package/dist/shared/ui/components/select.d.ts +0 -13
  90. package/dist/shared/ui/components/separator.d.ts +0 -4
  91. package/dist/shared/ui/components/sheet.d.ts +0 -25
  92. package/dist/shared/ui/components/sonner.d.ts +0 -4
  93. package/dist/shared/ui/components/switch.d.ts +0 -4
  94. package/dist/shared/ui/components/toaster.d.ts +0 -1
  95. package/dist/shared/ui/components/tooltip.d.ts +0 -7
  96. package/dist/shared/ui/index.d.ts +0 -17
  97. package/dist/style.css +0 -1
  98. package/dist/types/events.d.ts +0 -1
  99. package/dist/types/models.d.ts +0 -4
  100. package/dist/types/requests.d.ts +0 -1
  101. /package/dist/features/{chat/components/ChatInterface → conversation/components}/ChatApp.d.ts +0 -0
  102. /package/dist/features/{chat/components/ChatInterface → conversation/components}/ChatInput.d.ts +0 -0
  103. /package/dist/features/{chat/components/ChatInterface → conversation/components}/ChatInputRow.d.ts +0 -0
  104. /package/dist/features/{chat/components/ChatInterface → conversation/components}/ChatWidget.d.ts +0 -0
  105. /package/dist/features/{chat/components/ChatInterface → conversation/components}/NewChatButton.d.ts +0 -0
  106. /package/dist/features/{chat/components/Message → conversation/components}/hooks/index.d.ts +0 -0
  107. /package/dist/features/{chat/components/Message → conversation/components}/hooks/useFilePreview.d.ts +0 -0
  108. /package/dist/features/{chat/components/Message → conversation/components}/hooks/useStreamingMarkdownBuffer.d.ts +0 -0
  109. /package/dist/features/{chat/components/Message → conversation/components}/hooks/useToolPayload.d.ts +0 -0
  110. /package/dist/features/{chat/components/Message → conversation/components}/markdown/MarkdownContent.d.ts +0 -0
  111. /package/dist/features/{chat/components/Message → conversation/components}/markdown/index.d.ts +0 -0
  112. /package/dist/features/{chat/components/Message → conversation/components}/modals/FileViewerModal.d.ts +0 -0
  113. /package/dist/features/{chat/components/Message → conversation/components}/modals/index.d.ts +0 -0
  114. /package/dist/features/{chat/components/Message/renderers/tool → conversation/components/renderers}/content/SimpleJsonView.d.ts +0 -0
  115. /package/dist/features/{chat/components/Message → conversation/components}/renderers/shared/ThinkingIndicator.d.ts +0 -0
  116. /package/dist/features/{chat/components/Message → conversation/components}/renderers/tool/artifacts/ArtifactTypes/PlotArtifact.d.ts +0 -0
  117. /package/dist/features/{chat/components/Message → conversation/components}/renderers/user/UserTextContent.d.ts +0 -0
  118. /package/dist/features/{chat/components/Message → conversation/components}/utils/index.d.ts +0 -0
  119. /package/dist/features/{chat/components/Message → conversation/components}/utils/messageUtils.d.ts +0 -0
  120. /package/dist/features/{chat/components/Message → conversation/components}/utils/toolPayloadUtils.d.ts +0 -0
  121. /package/dist/features/{thread → conversation}/contexts/ThreadStateProvider.d.ts +0 -0
  122. /package/dist/features/{thread → conversation}/contexts/ThreadsProvider.d.ts +0 -0
  123. /package/dist/features/{thread → conversation}/contexts/reducers/utils/reducerUtils.d.ts +0 -0
  124. /package/dist/features/{chat → conversation}/hooks/index.d.ts +0 -0
  125. /package/dist/features/{checkpoint → persistence/checkpoints}/components/TimelineColumn.d.ts +0 -0
  126. /package/dist/features/{checkpoint → persistence/checkpoints}/components/index.d.ts +0 -0
  127. /package/dist/features/{checkpoint → persistence/checkpoints}/hooks/index.d.ts +0 -0
  128. /package/dist/features/{checkpoint → persistence/checkpoints}/hooks/useCheckpointIndex.d.ts +0 -0
  129. /package/dist/features/{checkpoint → persistence/checkpoints}/index.d.ts +0 -0
  130. /package/dist/features/{checkpoint → persistence/checkpoints}/types/index.d.ts +0 -0
  131. /package/dist/features/{checkpoint → persistence/checkpoints}/utils/checkpointIndex.d.ts +0 -0
  132. /package/dist/features/{checkpoint → persistence/checkpoints}/utils/editUtils.d.ts +0 -0
  133. /package/dist/features/{checkpoint → persistence/checkpoints}/utils/historyUtils.d.ts +0 -0
  134. /package/dist/features/{checkpoint → persistence/checkpoints}/utils/index.d.ts +0 -0
  135. /package/dist/features/{checkpoint → persistence/checkpoints}/utils/schemaUtils.d.ts +0 -0
@@ -6,7 +6,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
6
6
  ref?: React.Ref<HTMLDivElement>;
7
7
  } & {
8
8
  asChild?: boolean;
9
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
9
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
10
10
  label?: string;
11
11
  shouldFilter?: boolean;
12
12
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -22,7 +22,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
22
22
  ref?: React.Ref<HTMLInputElement>;
23
23
  } & {
24
24
  asChild?: boolean;
25
- }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
25
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
26
26
  value?: string;
27
27
  onValueChange?: (search: string) => void;
28
28
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -32,7 +32,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
32
32
  ref?: React.Ref<HTMLDivElement>;
33
33
  } & {
34
34
  asChild?: boolean;
35
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
35
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
36
36
  label?: string;
37
37
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
38
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
@@ -41,14 +41,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
41
41
  ref?: React.Ref<HTMLDivElement>;
42
42
  } & {
43
43
  asChild?: boolean;
44
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
45
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
46
46
  children?: React.ReactNode;
47
47
  } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
48
48
  ref?: React.Ref<HTMLDivElement>;
49
49
  } & {
50
50
  asChild?: boolean;
51
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
51
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
52
52
  heading?: React.ReactNode;
53
53
  value?: string;
54
54
  forceMount?: boolean;
@@ -57,7 +57,7 @@ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<R
57
57
  ref?: React.Ref<HTMLDivElement>;
58
58
  } & {
59
59
  asChild?: boolean;
60
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
60
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
61
61
  alwaysRender?: boolean;
62
62
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
63
63
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
@@ -66,7 +66,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
66
66
  ref?: React.Ref<HTMLDivElement>;
67
67
  } & {
68
68
  asChild?: boolean;
69
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
69
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "onSelect" | "disabled"> & {
70
70
  disabled?: boolean;
71
71
  onSelect?: (value: string) => void;
72
72
  value?: string;
@@ -1,6 +1,6 @@
1
1
  import * as ResizablePrimitive from "react-resizable-panels";
2
2
  declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
3
- declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLAnchorElement | HTMLElement | HTMLDivElement | HTMLButtonElement | HTMLSpanElement | HTMLParagraphElement | HTMLObjectElement | HTMLDataElement | HTMLSourceElement | HTMLLinkElement | HTMLHeadElement | HTMLBodyElement | HTMLMapElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
3
+ declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLAnchorElement | HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLSourceElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
4
4
  className?: string | undefined;
5
5
  collapsedSize?: number | undefined;
6
6
  collapsible?: boolean | undefined;
@@ -4,11 +4,11 @@
4
4
  * Relies on the split context hooks (useThreads/useMessages/useStream/useApi).
5
5
  */
6
6
  import type { ChatMessage } from "@/types";
7
- import { type MessageComponentProps, type ToolConfig, type ToolRendererMap, type ToolArtifactRendererMap } from "../Message";
7
+ import type { MessageComponentProps } from "./MessageComponent";
8
+ import type { ToolConfig, ToolRendererMap, ToolArtifactRendererMap } from "./ToolContent";
8
9
  export interface ChatInterfaceProps {
9
10
  className?: string;
10
11
  placeholder?: string;
11
- autoFocus?: boolean;
12
12
  maxHeight?: string;
13
13
  /** Debounce (ms) used for buffering mid-stream markdown updates */
14
14
  streamingDebounceMs?: number;
@@ -40,5 +40,5 @@ export interface ChatInterfaceProps {
40
40
  }) => void;
41
41
  onError?: (error: string) => void;
42
42
  }
43
- export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
44
- export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "../Message/ToolContent";
43
+ export declare function ChatInterface({ className, placeholder, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
44
+ export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./ToolContent";
@@ -2,11 +2,12 @@
2
2
  * Message Component - With truncatable tool messages and responsive design
3
3
  */
4
4
  import type { ChatMessage, RespondToInterruptOptions } from "@/types";
5
- import type { CheckpointMeta, EditMeta } from "@/features/checkpoint/types";
5
+ import type { CheckpointMeta, EditMeta } from "@/features/persistence";
6
6
  import type { ToolConfig } from "./ToolContent";
7
7
  export interface MessageComponentProps {
8
8
  message: ChatMessage;
9
9
  messageIndex: number;
10
+ allMessages?: ChatMessage[];
10
11
  isStreamingMessage?: boolean;
11
12
  /** ms to wait for quiet before rendering streaming markdown updates */
12
13
  streamingDebounceMs?: number;
@@ -1,6 +1,6 @@
1
1
  import type { ChatMessage, RespondToInterruptOptions, PendingInterrupt } from "@/types";
2
- import type { EditMeta, TimelineCheckpoint } from "@/features/checkpoint/types";
3
- import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
2
+ import type { EditMeta, TimelineCheckpoint } from "@/features/persistence/checkpoints/types";
3
+ import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
4
4
  import React from "react";
5
5
  import type { MessageComponentProps } from "./MessageComponent";
6
6
  import type { ToolConfig } from "./ToolContent";
@@ -1,6 +1,6 @@
1
1
  import type { ChatMessage, RespondToInterruptOptions } from "@/types";
2
- import type { EditMeta } from "@/features/checkpoint/types";
3
- import { type CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
2
+ import type { EditMeta } from "@/features/persistence/checkpoints/types";
3
+ import { type CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
4
4
  import type { MessageComponentProps } from "./MessageComponent";
5
5
  import React from "react";
6
6
  import type { ToolConfig } from "./ToolContent";
@@ -8,7 +8,7 @@ export declare const getMessageDomKey: (message: ChatMessage | undefined, index:
8
8
  export interface MessageRowProps {
9
9
  message: ChatMessage;
10
10
  index: number;
11
- isStreaming: boolean;
11
+ allMessages?: ChatMessage[];
12
12
  streamingAssistantId: string | null;
13
13
  streamingDebounceMs?: number;
14
14
  layoutSize: "phone" | "tablet" | "desktop" | "half-screen";
@@ -1,7 +1,7 @@
1
1
  import type { ChatMessage, MessageArtifact } from "@/types";
2
2
  import type { ReactNode } from "react";
3
- import { type ToolPayloadResult } from "@/features/chat/components/Message/hooks";
4
- import type { ToolMeta } from "@/features/chat/components/Message/utils/messageHelpers";
3
+ import { type ToolPayloadResult } from "./hooks/useToolPayload";
4
+ import type { ToolMeta } from "./utils/messageHelpers";
5
5
  export interface ToolRendererContext {
6
6
  message: ChatMessage;
7
7
  toolMeta: ToolMeta;
@@ -1,5 +1,5 @@
1
1
  import type { ChatMessage, MessagePart } from "@/types";
2
- import { ToolMeta } from "@/features/chat/components/Message/utils";
2
+ import { ToolMeta } from "../utils/messageHelpers";
3
3
  export interface ParsedMessageContent {
4
4
  contentParts: MessagePart[];
5
5
  textContent: string;
@@ -0,0 +1,12 @@
1
+ export { ChatApp } from "./ChatApp";
2
+ export { ChatInterface } from "./ChatInterface";
3
+ export { ChatInput } from "./ChatInput";
4
+ export { ChatWidget } from "./ChatWidget";
5
+ export { NewChatButton } from "./NewChatButton";
6
+ export { ChatInputRow } from "./ChatInputRow";
7
+ export { MessageList } from "./MessageList";
8
+ export { default as MessageComponent } from "./MessageComponent";
9
+ export { MessageRow, getMessageDomKey } from "./MessageRow";
10
+ export { ToolContent } from "./ToolContent";
11
+ export { MessageContent } from "./renderers/MessageContent";
12
+ export * from "./renderers";
@@ -1,9 +1,9 @@
1
1
  import { MouseEvent as ReactMouseEvent } from "react";
2
- import type { ChatMessage, MessagePart } from "@/types";
3
- import type { InterruptPart, InterruptAlternative } from "@/features/chat/types/models";
2
+ import type { ChatMessage, MessagePart, InterruptPart, InterruptAlternative } from "@/types";
4
3
  import type { ToolConfig } from "../ToolContent";
5
4
  export interface MessageContentProps {
6
5
  message: ChatMessage;
6
+ allMessages?: ChatMessage[];
7
7
  isToolMessage: boolean;
8
8
  showToolMessages: boolean;
9
9
  toolViewMode: "preview" | "expanded";
@@ -32,7 +32,6 @@ export interface MessageContentProps {
32
32
  handleInterruptReject?: () => void;
33
33
  handleInterruptAlternative?: (part: unknown, alternative?: InterruptAlternative) => void;
34
34
  disableInterruptActions?: boolean;
35
- isInterruptMessage: boolean;
36
35
  }
37
- export declare function MessageContent({ message, isToolMessage, showToolMessages, toolViewMode, toolExpandable, isToolStreaming, contentParts, textContent, imageParts, fileParts, interruptPart, isStreamingMessage, streamingDebounceMs, enableStreamingMarkdownBuffer, renderStreamingMarkdown, handleFileClick, uploadingFiles, messageRole, truncateUserMessages, userMessagePreviewLength, isUserExpanded, setIsUserExpanded, isCompactLayout, iconForeground, toolConfig, handleInterruptApprove, handleInterruptReject, handleInterruptAlternative, disableInterruptActions, isInterruptMessage, }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
36
+ export declare function MessageContent({ message, allMessages, isToolMessage, showToolMessages, toolViewMode, toolExpandable, isToolStreaming, contentParts, textContent, imageParts, fileParts, interruptPart, isStreamingMessage, streamingDebounceMs, enableStreamingMarkdownBuffer, renderStreamingMarkdown, handleFileClick, uploadingFiles, messageRole, truncateUserMessages, userMessagePreviewLength, isUserExpanded, setIsUserExpanded, isCompactLayout, iconForeground, toolConfig, handleInterruptApprove, handleInterruptReject, handleInterruptAlternative, disableInterruptActions, }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
38
37
  export default MessageContent;
@@ -1,4 +1,4 @@
1
- import type { ToolMeta } from "@/features/chat/components/Message/utils/messageHelpers";
1
+ import type { ToolMeta } from "../utils/messageHelpers";
2
2
  export interface MessageHeaderProps {
3
3
  showTimestamp: boolean;
4
4
  showAgentName: boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Artifact Progress Component
3
+ *
4
+ * Shows real-time progress for streaming artifacts.
5
+ * Displays status, progress bar, and partial data.
6
+ */
7
+ import type { MessageArtifact } from "@/types";
8
+ interface ArtifactProgressProps {
9
+ artifact: MessageArtifact | null | undefined;
10
+ showPartialData?: boolean;
11
+ }
12
+ export declare function ArtifactProgress({ artifact, showPartialData }: ArtifactProgressProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
@@ -0,0 +1 @@
1
+ export { ArtifactProgress } from "./ArtifactProgress";
@@ -1,6 +1,7 @@
1
1
  export { ArtifactRenderer } from "./tool/artifacts/ArtifactRenderer";
2
- export { SimpleJsonView } from "./tool/content/SimpleJsonView";
3
- export { StreamProgress } from "./tool/content/StreamProgress";
2
+ export { ArtifactProgress } from "./artifacts/ArtifactProgress";
3
+ export { SimpleJsonView } from "./content/SimpleJsonView";
4
+ export { ToolProgress } from "./tool/content/ToolProgress";
4
5
  export { InterruptPartRenderer } from "./user/InterruptPartRenderer";
5
6
  export { ThinkingIndicator } from "./shared/ThinkingIndicator";
6
7
  export { UserTextContent } from "./user/UserTextContent";
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { MessageArtifact } from "@/types";
8
8
  export interface ArtifactRendererProps {
9
- artifact: MessageArtifact | any;
9
+ artifact: MessageArtifact | null | undefined;
10
10
  idx?: number;
11
11
  }
12
12
  /**
@@ -0,0 +1,11 @@
1
+ import type { ChatMessage } from "@/types";
2
+ import type { ToolConfig } from "../../../ToolContent";
3
+ interface ToolProgressProps {
4
+ message: ChatMessage;
5
+ allMessages?: ChatMessage[];
6
+ isStreaming?: boolean;
7
+ viewMode?: "preview" | "expanded";
8
+ toolConfig?: ToolConfig;
9
+ }
10
+ export declare function ToolProgress({ message, allMessages, isStreaming, toolConfig, }: ToolProgressProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -7,7 +7,7 @@ export declare function InterruptPartRenderer({ interruptPart, onApprove, onReje
7
7
  interruptPart: {
8
8
  type: "interrupt";
9
9
  title?: string;
10
- id?: string;
10
+ id?: string | null;
11
11
  };
12
12
  onApprove: (interruptPart: any) => void;
13
13
  onReject: (interruptPart: any) => void;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Artifact Utilities
3
+ *
4
+ * Helper functions for working with artifacts, including metadata handling
5
+ * and streaming updates.
6
+ */
7
+ import type { MessageArtifact, ChatMessage } from "@/types";
8
+ export interface ArtifactMetadata {
9
+ id: string;
10
+ type: string;
11
+ created_at: string;
12
+ updated_at?: string;
13
+ status?: "pending" | "in_progress" | "completed" | "failed";
14
+ progress?: number;
15
+ error?: string;
16
+ }
17
+ export interface ArtifactWithMetadata extends MessageArtifact {
18
+ metadata: ArtifactMetadata;
19
+ }
20
+ /**
21
+ * Extract artifact metadata from a message
22
+ */
23
+ export declare function getArtifactMetadata(message: ChatMessage): ArtifactMetadata | null;
24
+ /**
25
+ * Check if an artifact is streaming (has progress < 100)
26
+ */
27
+ export declare function isArtifactStreaming(artifact: MessageArtifact | undefined): boolean;
28
+ /**
29
+ * Update artifact metadata during streaming
30
+ */
31
+ export declare function updateArtifactMetadata(message: ChatMessage, updates: Partial<ArtifactMetadata>): ChatMessage;
32
+ /**
33
+ * Find a message by artifact ID
34
+ */
35
+ export declare function findMessageByArtifactId(messages: ChatMessage[], artifactId: string): ChatMessage | null;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Shared helper utilities for chat message rendering and metadata parsing.
3
+ */
4
+ import type { PlotData, ArtifactPreview, ChatMessage, MessagePart } from "@/types";
5
+ export type ToolMeta = {
6
+ name?: string;
7
+ toolCallId?: string;
8
+ };
9
+ export declare function collectText(parts: MessagePart[]): string;
10
+ export declare function extractToolMeta(message: ChatMessage): ToolMeta;
11
+ export declare function normalizeInterruptId(id: unknown): string | null;
12
+ export declare function stringifyTool(parts: MessagePart[]): string;
13
+ export declare function getAgentNameFromMessage(m: ChatMessage): string | null;
14
+ export declare function messageSignature(message: ChatMessage): string;
15
+ export declare function normalizeMimeType(formatHint?: string): string;
16
+ export declare function buildLabelParts(extras?: {
17
+ plotId?: string;
18
+ artifactId?: string;
19
+ }): string[];
20
+ export declare function createArtifactPreviewFromSource({ base64, url, formatHint, extras, }: {
21
+ base64?: string;
22
+ url?: string;
23
+ formatHint?: string;
24
+ extras?: {
25
+ plotId?: string;
26
+ artifactId?: string;
27
+ };
28
+ }): ArtifactPreview | null;
29
+ export declare function createArtifactPreviewFromPlot(plot: PlotData): ArtifactPreview | null;
30
+ export declare function getToolProgress(message: ChatMessage): unknown[];
31
+ /**
32
+ * Check if an assistant message contains ONLY tool_call parts (no text content).
33
+ * These messages should be hidden from the main list and their tool execution
34
+ * should be shown nested within the next assistant message with text.
35
+ */
36
+ export declare function isAssistantMessageWithOnlyToolCalls(message: ChatMessage): boolean;
37
+ /**
38
+ * Check if a message should be hidden from the main message list.
39
+ * This includes:
40
+ * - Tool messages (role: "tool")
41
+ * - Assistant messages with only tool_call parts (no text)
42
+ */
43
+ export declare function shouldHideMessageFromList(message: ChatMessage): boolean;
44
+ export type ToolExecutionEntry = {
45
+ type: "tool.start" | "tool.end";
46
+ toolName: string;
47
+ toolCallId: string;
48
+ content?: string;
49
+ timestamp?: string;
50
+ output?: unknown;
51
+ artifact?: unknown;
52
+ };
53
+ /**
54
+ * Build a tool execution timeline from message history.
55
+ * This matches assistant messages with tool_call parts to their corresponding
56
+ * tool response messages, creating a timeline similar to streaming events.
57
+ *
58
+ * @param messages - Full message list including tool messages
59
+ * @param currentMessageId - ID of the current assistant message to build timeline for
60
+ * @returns Array of tool execution entries (start/end pairs)
61
+ */
62
+ export declare function buildToolExecutionTimeline(messages: ChatMessage[], currentMessageId: string): ToolExecutionEntry[];
@@ -0,0 +1,2 @@
1
+ export { ThreadsProvider, useThreads } from './ThreadsProvider';
2
+ export { ThreadStateProvider, useThreadState, useThreadStateUpdater } from './ThreadStateProvider';
@@ -0,0 +1,73 @@
1
+ import type { ChatMessage } from "@/types";
2
+ import type { PendingInterrupt } from "@/types";
3
+ import type { StreamEvent } from "@/types/domain/streaming";
4
+ export interface MessagesState {
5
+ messages: ChatMessage[];
6
+ assemblingId: string | null;
7
+ lastCheckpointId: string | null;
8
+ lastCheckpointNs: string | null;
9
+ pendingInterrupt: PendingInterrupt;
10
+ messagesStreamMeta?: Record<string, {
11
+ lastSeq?: number | null;
12
+ lastText?: string;
13
+ }>;
14
+ values: Record<string, unknown>;
15
+ }
16
+ export type MessagesAction = {
17
+ type: "reset";
18
+ payload?: {
19
+ messages?: ChatMessage[];
20
+ };
21
+ } | {
22
+ type: "seed";
23
+ payload: {
24
+ messages: ChatMessage[];
25
+ checkpointId?: string | null;
26
+ checkpointNs?: string | null;
27
+ pendingInterrupt?: PendingInterrupt;
28
+ };
29
+ } | {
30
+ type: "prepend";
31
+ payload: {
32
+ messages: ChatMessage[];
33
+ };
34
+ } | {
35
+ type: "user_message";
36
+ payload: {
37
+ message: ChatMessage;
38
+ editingMessageId?: string | null;
39
+ };
40
+ } | {
41
+ type: "event";
42
+ payload: {
43
+ ev: StreamEvent;
44
+ };
45
+ } | {
46
+ type: "batch";
47
+ payload: {
48
+ events: StreamEvent[];
49
+ };
50
+ } | {
51
+ type: "interrupt_response";
52
+ payload: {
53
+ interruptId: string;
54
+ };
55
+ };
56
+ export declare const initialMessagesState: MessagesState;
57
+ export declare function messagesReducer(state: MessagesState, action: MessagesAction): MessagesState;
58
+ export declare function useMessagesReducer(initial?: ChatMessage[]): {
59
+ readonly reset: (messages?: ChatMessage[]) => void;
60
+ readonly seed: (messages: ChatMessage[], opts?: {
61
+ checkpointId?: string | null;
62
+ checkpointNs?: string | null;
63
+ pendingInterrupt?: {
64
+ id: string;
65
+ value: any;
66
+ } | null;
67
+ }) => void;
68
+ readonly prepend: (messages: ChatMessage[]) => void;
69
+ readonly pushUser: (message: ChatMessage, editingMessageId?: string | null) => void;
70
+ readonly onEvent: (ev: StreamEvent) => void;
71
+ readonly state: MessagesState;
72
+ readonly dispatch: import("react").Dispatch<MessagesAction>;
73
+ };
@@ -48,5 +48,5 @@ export declare function useChatController({ submit, chatRequest, lastCheckpointI
48
48
  startEditing: (messageId: string, content: string, meta?: EditContextMeta) => void;
49
49
  cancelEditing: () => void;
50
50
  handleRegenerateCb: (messageIndex: number) => void;
51
- displayMessages: ChatMessage[];
51
+ displayMessages: ChatMessage[] | undefined;
52
52
  };
@@ -0,0 +1,43 @@
1
+ import type { ChatApi } from "@/shared/core";
2
+ import type { StateHistoryEvent } from "@/features/streaming";
3
+ import type { ChatMessage, HydratedCheckpointSnapshot } from "@/types";
4
+ import type { TimelineCheckpoint } from "@/features/persistence/checkpoints/types";
5
+ import type { PendingInterrupt } from "@/types";
6
+ import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
7
+ interface UseThreadHistoryStateOptions {
8
+ api: ChatApi;
9
+ seed: (messages: ChatMessage[], opts?: {
10
+ checkpointId?: string | null;
11
+ checkpointNs?: string | null;
12
+ pendingInterrupt?: PendingInterrupt;
13
+ }) => void;
14
+ onError?: (msg: string) => void;
15
+ currentThreadId: string | null;
16
+ initialThreadId?: string | null;
17
+ initialCheckpointId?: string | null;
18
+ initialCheckpointNs?: string | null;
19
+ autoLoadInitial?: boolean;
20
+ isStreaming: boolean;
21
+ getMessages: () => ChatMessage[];
22
+ }
23
+ interface ThreadHistoryResult {
24
+ threadCheckpoints: HydratedCheckpointSnapshot[];
25
+ threadTimeline: TimelineCheckpoint[];
26
+ checkpointIndex: CheckpointIndex;
27
+ isLoadingThread: boolean;
28
+ isLoadingCheckpoint: boolean;
29
+ threadStateError: string | null;
30
+ loadThread: (threadId: string, checkpointId?: string | null, options?: {
31
+ clearProgress?: boolean;
32
+ }) => Promise<void>;
33
+ navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
34
+ setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
35
+ returnToLatest: () => Promise<void>;
36
+ handleStateHistoryEvent: (event: StateHistoryEvent) => void;
37
+ markSkipNextLoad: (threadId: string | null) => void;
38
+ markStreamPendingThread: (threadId: string | null) => void;
39
+ resetHistoryState: () => void;
40
+ clearState: () => void;
41
+ }
42
+ export declare function useThreadHistoryState({ api, seed, onError, currentThreadId, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, isStreaming, getMessages, }: UseThreadHistoryStateOptions): ThreadHistoryResult;
43
+ export {};
@@ -0,0 +1,40 @@
1
+ import { type MutableRefObject } from 'react';
2
+ import type { ChatApi } from "@/shared/core";
3
+ import type { ThreadInfoEvent } from '@/features/streaming';
4
+ import type { ProjectInfo, SharedThreadSummary, ThreadSummary } from '@/types';
5
+ interface ThreadActions {
6
+ createThread: (title?: string, project?: {
7
+ id: string;
8
+ name?: string;
9
+ } | ProjectInfo | null) => Promise<string | null>;
10
+ deleteThread: (threadId: string) => Promise<void>;
11
+ renameThread: (threadId: string, title: string) => Promise<void>;
12
+ refreshThreads: () => Promise<void>;
13
+ refreshSharedThreads: () => Promise<void>;
14
+ shareThread: (threadId: string, sharedWithUserId: string) => Promise<void>;
15
+ unshareThread: (threadId: string, shareId: string) => Promise<void>;
16
+ }
17
+ interface UseThreadsStateOptions {
18
+ api: ChatApi;
19
+ initialThreadId?: string | null;
20
+ onError?: (error: string) => void;
21
+ onThreadChange?: (threadId: string | null) => void;
22
+ onCurrentThreadDeleted?: () => void;
23
+ }
24
+ export interface UseThreadsStateResult {
25
+ threads: ThreadSummary[];
26
+ currentThreadId: string | null;
27
+ currentThreadIdRef: MutableRefObject<string | null>;
28
+ setCurrentThreadId: (id: string | null) => void;
29
+ isLoadingThreads: boolean;
30
+ threadsError: string | null;
31
+ sharedThreads: SharedThreadSummary[];
32
+ isLoadingSharedThreads: boolean;
33
+ actions: ThreadActions;
34
+ addThreadFromEvent: (threadInfo: ThreadInfoEvent) => void;
35
+ shareInFlight: boolean;
36
+ shareStatus: string | null;
37
+ clearShareStatus: () => void;
38
+ }
39
+ export declare function useThreadsState({ api, initialThreadId, onError, onThreadChange, onCurrentThreadDeleted, }: UseThreadsStateOptions): UseThreadsStateResult;
40
+ export {};
@@ -1,3 +1,3 @@
1
1
  export * from "./components";
2
- export * from "./types";
3
2
  export * from "./hooks";
3
+ export * from "./contexts";
@@ -0,0 +1,53 @@
1
+ import type { ChatMessage } from "@/types";
2
+ import type { PendingInterrupt, PregelTask } from "@/types/core/models";
3
+ /**
4
+ * Checkpoint domain models representing LangGraph snapshots and history payloads.
5
+ */
6
+ export interface CheckpointSnapshot {
7
+ id?: string;
8
+ threadId?: string;
9
+ checkpointId?: string | null;
10
+ checkpointNs?: string | null;
11
+ values?: Record<string, unknown>;
12
+ next?: string[] | string | null;
13
+ config?: Record<string, unknown>;
14
+ metadata?: {
15
+ source?: string;
16
+ step?: number;
17
+ writes?: Record<string, unknown>;
18
+ execution_time?: number;
19
+ [key: string]: unknown;
20
+ };
21
+ tasks?: PregelTask[];
22
+ interrupts?: unknown[];
23
+ interrupt?: PendingInterrupt;
24
+ created_at?: string;
25
+ createdAt?: string;
26
+ parentConfig?: Record<string, unknown>;
27
+ parent_config?: Record<string, unknown>;
28
+ }
29
+ export interface HydratedCheckpointSnapshot {
30
+ checkpointId: string | null;
31
+ checkpointNs?: string | null;
32
+ parentId?: string | null;
33
+ createdAt: string;
34
+ messages?: ChatMessage[];
35
+ nextCursor?: string | null;
36
+ nextCursorNs?: string | null;
37
+ interrupt?: PendingInterrupt;
38
+ metadata?: {
39
+ step?: number | null;
40
+ source?: string | null;
41
+ [key: string]: unknown;
42
+ } | null;
43
+ config?: Record<string, unknown> | null;
44
+ parentConfig?: Record<string, unknown> | null;
45
+ next?: string[] | string | null;
46
+ tasks?: PregelTask[] | null;
47
+ values?: Record<string, unknown>;
48
+ }
49
+ export interface HistoryPayload {
50
+ version: string;
51
+ threadId: string;
52
+ checkpoints: CheckpointSnapshot[];
53
+ }
@@ -1,4 +1,4 @@
1
- import type { HydratedCheckpointSnapshot } from '@/features/checkpoint/types';
1
+ import type { HydratedCheckpointSnapshot } from '@/features/persistence/checkpoints/types';
2
2
  import type { ChatMessage } from '@/types';
3
3
  export declare function getPreviewForMessage(message: ChatMessage): string;
4
4
  /**
@@ -0,0 +1 @@
1
+ export * from "./checkpoints";
@@ -1,5 +1,5 @@
1
- import type { StreamContextValue } from '@/shared/core/types';
2
- import type { ToolEndEvent } from '@/features/streaming';
1
+ import type { StreamContextValue } from '@/types/core';
2
+ import type { ToolEndEvent } from "@/types/domain/streaming";
3
3
  import { type ReactNode } from 'react';
4
4
  interface StreamingProviderProps {
5
5
  children: ReactNode;