teodor-new-chat-ui 4.3.627 → 4.3.630

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 (35) hide show
  1. package/dist/components/ui/button.d.ts +1 -1
  2. package/dist/features/conversation/components/ChatInterface.d.ts +1 -2
  3. package/dist/features/conversation/components/MessageComponent.d.ts +1 -1
  4. package/dist/features/conversation/components/MessageList.d.ts +1 -1
  5. package/dist/features/conversation/components/MessageRow.d.ts +1 -2
  6. package/dist/features/conversation/components/hooks/useParsedMessageContent.d.ts +1 -1
  7. package/dist/features/conversation/components/hooks/useToolTimeline.d.ts +3 -17
  8. package/dist/features/conversation/components/index.d.ts +2 -2
  9. package/dist/features/conversation/components/renderers/MessageContent.d.ts +1 -1
  10. package/dist/features/conversation/components/renderers/ToolContent.d.ts +4 -0
  11. package/dist/features/conversation/components/renderers/tool/artifacts/ArtifactRenderer.d.ts +1 -5
  12. package/dist/features/conversation/components/renderers/tool/content/ToolProgress.d.ts +1 -1
  13. package/dist/features/conversation/components/utils/artifactUtils.d.ts +29 -13
  14. package/dist/features/conversation/components/utils/index.d.ts +4 -1
  15. package/dist/features/conversation/components/utils/messageUtils.d.ts +5 -0
  16. package/dist/features/conversation/components/utils/metaUtils.d.ts +26 -0
  17. package/dist/features/conversation/components/utils/toolTimelineUtils.d.ts +6 -0
  18. package/dist/features/conversation/components/utils/visibilityUtils.d.ts +10 -0
  19. package/dist/features/streaming/index.d.ts +1 -1
  20. package/dist/index.esm.js +2036 -2054
  21. package/dist/index.esm.js.map +1 -1
  22. package/dist/index.umd.js +27 -27
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/shared/ui/components/button.d.ts +1 -1
  25. package/dist/types/domain/artifacts.d.ts +89 -4
  26. package/dist/types/domain/chat.d.ts +1 -32
  27. package/dist/types/domain/streaming.d.ts +8 -1
  28. package/dist/types/domain/tools.d.ts +86 -0
  29. package/dist/types/index.d.ts +1 -0
  30. package/package.json +1 -1
  31. package/dist/features/conversation/components/ToolContent.d.ts +0 -41
  32. package/dist/features/conversation/components/utils/messageHelpers.d.ts +0 -58
  33. package/dist/features/streaming/utils/constants.d.ts +0 -1
  34. package/dist/features/streaming/utils/index.d.ts +0 -1
  35. package/dist/features/streaming/utils/types.d.ts +0 -188
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import type { ChatMessage } from "@/types";
7
7
  import type { MessageComponentProps } from "./MessageComponent";
8
- import type { ToolConfig, ToolRendererMap, ToolArtifactRendererMap } from "./ToolContent";
8
+ import type { ToolConfig, ToolRendererMap, ToolArtifactRendererMap } from "@/types";
9
9
  import React from "react";
10
10
  export interface ChatInterfaceProps {
11
11
  className?: string;
@@ -46,4 +46,3 @@ export interface ChatInterfaceProps {
46
46
  emptyMessage?: React.ReactNode;
47
47
  }
48
48
  export declare function ChatInterface({ className, placeholder, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, renderArtifactsInline, emptyMessage, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
49
- export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./ToolContent";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { ChatMessage, RespondToInterruptOptions } from "@/types";
5
5
  import type { CheckpointMeta, EditMeta } from "@/features/persistence";
6
- import type { ToolConfig } from "./ToolContent";
6
+ import type { ToolConfig } from "@/types";
7
7
  export interface MessageComponentProps {
8
8
  message: ChatMessage;
9
9
  messageIndex: number;
@@ -3,7 +3,7 @@ import type { EditMeta, TimelineCheckpoint } from "@/features/persistence/checkp
3
3
  import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
4
4
  import React from "react";
5
5
  import type { MessageComponentProps } from "./MessageComponent";
6
- import type { ToolConfig } from "./ToolContent";
6
+ import type { ToolConfig } from "./renderers/ToolContent";
7
7
  export interface MessageListProps {
8
8
  messages: ChatMessage[];
9
9
  isStreaming: boolean;
@@ -1,9 +1,8 @@
1
- import type { ChatMessage, RespondToInterruptOptions } from "@/types";
1
+ import type { ChatMessage, RespondToInterruptOptions, ToolConfig } from "@/types";
2
2
  import type { EditMeta } from "@/features/persistence/checkpoints/types";
3
3
  import { type CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
4
4
  import type { MessageComponentProps } from "./MessageComponent";
5
5
  import React from "react";
6
- import type { ToolConfig } from "./ToolContent";
7
6
  export declare const getMessageDomKey: (message: ChatMessage | undefined, index: number) => string;
8
7
  export interface MessageRowProps {
9
8
  message: ChatMessage;
@@ -1,5 +1,5 @@
1
1
  import type { ChatMessage, MessagePart } from "@/types";
2
- import { ToolMeta } from "../utils/messageHelpers";
2
+ import { type ToolMeta } from "../utils";
3
3
  export interface ParsedMessageContent {
4
4
  contentParts: MessagePart[];
5
5
  textContent: string;
@@ -1,20 +1,6 @@
1
- import type { ChatMessage } from "@/types";
2
- export interface ToolStep {
3
- toolCallId: string;
4
- toolName: string;
5
- status: "running" | "completed" | "failed";
6
- content?: string;
7
- output?: unknown;
8
- artifact?: unknown;
9
- timestamp?: string;
10
- }
11
- export interface ToolTimelineResult {
12
- steps: ToolStep[];
13
- artifacts: any[];
14
- hasToolExecution: boolean;
15
- }
1
+ import type { ChatMessage, ToolTimelineResult } from "@/types";
16
2
  /**
17
- * Hook to share data between ToolProgress (steps) and MessageContent (aggregated artifacts).
18
- * It scans the message history to reconstruct what happened in hidden tool messages.
3
+ * Hook to build tool execution timeline from message history.
4
+ * Works for both streaming and historical messages - no dual-path logic needed.
19
5
  */
20
6
  export declare function useToolTimeline(message: ChatMessage, allMessages?: ChatMessage[]): ToolTimelineResult;
@@ -8,7 +8,7 @@ export { MessageList } from "./MessageList";
8
8
  export type { MessageListHandle } from "./MessageList";
9
9
  export { default as MessageComponent } from "./MessageComponent";
10
10
  export { MessageRow, getMessageDomKey } from "./MessageRow";
11
- export { ToolContent } from "./ToolContent";
12
- export type { ToolRendererMap, ToolArtifactRendererMap, ToolRenderer, ToolArtifactRenderer, ToolRendererContext, ToolConfig } from "./ToolContent";
11
+ export { ToolContent } from "./renderers/ToolContent";
12
+ export type { ToolRendererMap, ToolArtifactRendererMap, ToolRenderer, ToolArtifactRenderer, ToolRendererContext, ToolConfig } from "./renderers/ToolContent";
13
13
  export { MessageContent } from "./renderers/MessageContent";
14
14
  export * from "./renderers";
@@ -1,6 +1,6 @@
1
1
  import { MouseEvent as ReactMouseEvent } from "react";
2
2
  import type { ChatMessage, MessagePart, InterruptPart, InterruptAlternative } from "@/types";
3
- import type { ToolConfig } from "../ToolContent";
3
+ import type { ToolConfig } from "@/types";
4
4
  export interface MessageContentProps {
5
5
  message: ChatMessage;
6
6
  allMessages?: ChatMessage[];
@@ -0,0 +1,4 @@
1
+ import type { ToolArtifactRenderer, ToolArtifactRendererMap, ToolRendererContext, ToolRenderer, ToolRendererMap, ToolConfig, ToolContentProps } from "@/types";
2
+ export type { ToolRendererContext, ToolRenderer, ToolRendererMap, ToolConfig, ToolContentProps, ToolArtifactRenderer, ToolArtifactRendererMap };
3
+ export declare function ToolContent({ message, viewMode, isStreaming, toolConfig, expandable, }: ToolContentProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function createExpandableToolRenderer(renderer: ToolRenderer): ToolRenderer;
@@ -4,11 +4,7 @@
4
4
  * Dispatches to specific artifact renderers based on type.
5
5
  * Supports: plots. Other types can be handled via toolArtifactRenderers in the host app.
6
6
  */
7
- import type { MessageArtifact } from "@/types";
8
- export interface ArtifactRendererProps {
9
- artifact: MessageArtifact | null | undefined;
10
- idx?: number;
11
- }
7
+ import type { ArtifactRendererProps } from "@/types";
12
8
  /**
13
9
  * Determines artifact type and renders appropriate component
14
10
  */
@@ -1,5 +1,5 @@
1
1
  import type { ChatMessage } from "@/types";
2
- import type { ToolConfig } from "../../../ToolContent";
2
+ import { ToolConfig } from "@/types";
3
3
  interface ToolProgressProps {
4
4
  message: ChatMessage;
5
5
  allMessages?: ChatMessage[];
@@ -4,19 +4,7 @@
4
4
  * Helper functions for working with artifacts, including metadata handling
5
5
  * and streaming updates.
6
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
- }
7
+ import type { MessageArtifact, ChatMessage, ArtifactMetadata } from "@/types";
20
8
  /**
21
9
  * Extract artifact metadata from a message
22
10
  */
@@ -33,3 +21,31 @@ export declare function updateArtifactMetadata(message: ChatMessage, updates: Pa
33
21
  * Find a message by artifact ID
34
22
  */
35
23
  export declare function findMessageByArtifactId(messages: ChatMessage[], artifactId: string): ChatMessage | null;
24
+ import type { PlotData, ArtifactPreview } from "@/types";
25
+ /**
26
+ * Normalize MIME type from format hints
27
+ */
28
+ export declare function normalizeMimeType(formatHint?: string): string;
29
+ /**
30
+ * Build label parts for artifact display
31
+ */
32
+ export declare function buildLabelParts(extras?: {
33
+ plotId?: string;
34
+ artifactId?: string;
35
+ }): string[];
36
+ /**
37
+ * Create artifact preview object from source data
38
+ */
39
+ export declare function createArtifactPreviewFromSource({ base64, url, formatHint, extras, }: {
40
+ base64?: string;
41
+ url?: string;
42
+ formatHint?: string;
43
+ extras?: {
44
+ plotId?: string;
45
+ artifactId?: string;
46
+ };
47
+ }): ArtifactPreview | null;
48
+ /**
49
+ * Create artifact preview object from Plot data
50
+ */
51
+ export declare function createArtifactPreviewFromPlot(plot: PlotData): ArtifactPreview | null;
@@ -1,3 +1,6 @@
1
- export * from "./messageHelpers";
1
+ export * from "./metaUtils";
2
+ export * from "./visibilityUtils";
3
+ export * from "./toolTimelineUtils";
2
4
  export * from "./messageUtils";
5
+ export * from "./artifactUtils";
3
6
  export * from "./toolPayloadUtils";
@@ -22,3 +22,8 @@ export declare function formatToolOutput(x: any): {
22
22
  };
23
23
  export { parseJsonSafe, looksLikeMarkdown } from "@/shared/utils/jsonUtils";
24
24
  export { extractToolContent } from "@/features/persistence/checkpoints/utils/historyUtils";
25
+ import type { MessagePart } from "@/types";
26
+ /**
27
+ * Stringify tool call parts for display/debugging
28
+ */
29
+ export declare function stringifyTool(parts: MessagePart[]): string;
@@ -0,0 +1,26 @@
1
+ import type { ChatMessage, MessagePart } from "@/types";
2
+ export type ToolMeta = {
3
+ name?: string;
4
+ toolCallId?: string;
5
+ };
6
+ /**
7
+ * Collect all text parts into a single string
8
+ */
9
+ export declare function collectText(parts: MessagePart[]): string;
10
+ /**
11
+ * Normalize interrupt ID strings
12
+ */
13
+ export declare function normalizeInterruptId(id: unknown): string | null;
14
+ /**
15
+ * Extract tool metadata (ID and name) from a message.
16
+ * Standardized to camelCase.
17
+ */
18
+ export declare function extractToolMeta(message: ChatMessage): ToolMeta;
19
+ /**
20
+ * Extract agent name from message metadata
21
+ */
22
+ export declare function getAgentNameFromMessage(m: ChatMessage): string | null;
23
+ /**
24
+ * Create a unique signature for a message for stable rendering
25
+ */
26
+ export declare function messageSignature(message: ChatMessage): string;
@@ -0,0 +1,6 @@
1
+ import type { ChatMessage, ToolExecutionEntry } from "@/types";
2
+ /**
3
+ * Build a tool execution timeline from message history.
4
+ * Matches assistant messages with tool calls to their corresponding responses.
5
+ */
6
+ export declare function buildToolExecutionTimeline(messages: ChatMessage[], currentMessageId: string): ToolExecutionEntry[];
@@ -0,0 +1,10 @@
1
+ import type { ChatMessage } from "@/types";
2
+ /**
3
+ * Check if an assistant message contains ONLY tool calls (no meaningful text/media).
4
+ * Usually hidden to hoist logic into the actual response.
5
+ */
6
+ export declare function isAssistantMessageWithOnlyToolCalls(message: ChatMessage): boolean;
7
+ /**
8
+ * Check if a message should be hidden from the main message list.
9
+ */
10
+ export declare function shouldHideMessageFromList(message: ChatMessage): boolean;
@@ -1,4 +1,4 @@
1
1
  export * from "./contexts";
2
2
  export { useStream as useStreamingHook } from "./hooks/use-stream";
3
3
  export type { UseStreamApi, UseChatStreamOptions, ActiveRunContext, } from "./hooks/types";
4
- export * from "./utils";
4
+ export type { ToolEndEvent, ThreadInfoEvent, StateHistoryEvent } from "@/types/domain/streaming";