@miiflow/assistant-ui 0.5.2 → 0.7.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.
- package/dist/{WelcomeScreen-D32Tsu6G.d.ts → WelcomeScreen-XVZqMpVW.d.ts} +27 -8
- package/dist/{avatar-CAmTN1L7.d.ts → avatar-C13xc3tA.d.ts} +1 -1
- package/dist/chunk-EI3GOLHT.js +128 -0
- package/dist/chunk-EI3GOLHT.js.map +1 -0
- package/dist/chunk-O2ILSWHS.js +2 -0
- package/dist/chunk-O2ILSWHS.js.map +1 -0
- package/dist/client/index.d.ts +67 -3
- package/dist/client/index.js +5 -5
- package/dist/client/index.js.map +1 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{message-D3D59U_Q.d.ts → message-BrHFdwb2.d.ts} +5 -4
- package/dist/primitives/index.d.ts +3 -3
- package/dist/{streaming-Q8hp5ev4.d.ts → streaming-DURrv9_E.d.ts} +46 -4
- package/dist/styled/index.d.ts +89 -19
- package/dist/styled/index.js +1 -1
- package/dist/styles-no-preflight.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -2
- package/dist/chunk-VDFIXLNO.js +0 -20
- package/dist/chunk-VDFIXLNO.js.map +0 -1
package/dist/context/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { C as ChatMessage, P as ParticipantRole } from '../message-
|
|
5
|
-
import { d as VisualizationActionEvent } from '../streaming-
|
|
4
|
+
import { C as ChatMessage, P as ParticipantRole } from '../message-BrHFdwb2.js';
|
|
5
|
+
import { d as VisualizationActionEvent } from '../streaming-DURrv9_E.js';
|
|
6
6
|
|
|
7
7
|
interface ChatContextValue {
|
|
8
8
|
/** List of messages in the conversation */
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { RefObject, KeyboardEvent } from 'react';
|
|
3
|
-
import { b as StreamingOptions, a as StreamChunk } from '../streaming-
|
|
3
|
+
import { b as StreamingOptions, a as StreamChunk } from '../streaming-DURrv9_E.js';
|
|
4
4
|
import { B as BrandingData } from '../branding-SzYU4ncD.js';
|
|
5
5
|
|
|
6
6
|
interface UseAutoScrollOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { A as Attachment, C as ChatMessage,
|
|
2
|
-
export { a as StreamChunk, b as StreamingOptions, c as StreamingState } from './streaming-
|
|
1
|
+
export { A as Attachment, C as ChatMessage, M as MessageData, a as MessageError, b as Participant, P as ParticipantRole, R as ReasoningChunk, S as SourceReference, c as SourceTypeConfig, d as SuggestedAction, e as SuggestedActionType } from './message-BrHFdwb2.js';
|
|
2
|
+
export { a as StreamChunk, b as StreamingOptions, c as StreamingState } from './streaming-DURrv9_E.js';
|
|
3
3
|
export { B as BrandingData } from './branding-SzYU4ncD.js';
|
|
4
4
|
export { ChatContext, ChatContextValue, ChatProvider, ChatProviderProps, useChatContext } from './context/index.js';
|
|
5
5
|
export { useAttachments, useAutoScroll, useBrandingCSSVars, useMessageComposer, useScrollLock, useStreaming } from './hooks/index.js';
|
|
6
|
-
export { A as AvatarPrimitive, C as ComposerContext, a as ComposerInput, b as ComposerSubmit, M as MessageComposerPrimitive, c as MessageContentPrimitive, d as MessageContext, e as MessagePrimitive, f as MessageTimestampPrimitive, u as useComposer, g as useMessage } from './avatar-
|
|
6
|
+
export { A as AvatarPrimitive, C as ComposerContext, a as ComposerInput, b as ComposerSubmit, M as MessageComposerPrimitive, c as MessageContentPrimitive, d as MessageContext, e as MessagePrimitive, f as MessageTimestampPrimitive, u as useComposer, g as useMessage } from './avatar-C13xc3tA.js';
|
|
7
7
|
export { ActionButton, MessageList as MessageListPrimitive, StreamingText as StreamingTextPrimitive, SuggestedActionsContext, SuggestedActions as SuggestedActionsPrimitive, TypingIndicator as TypingIndicatorPrimitive, useSuggestedActions } from './primitives/index.js';
|
|
8
|
-
export { A as AttachmentPreview, a as Avatar, C as ChatContainer, b as ChatLayout, M as MarkdownContent, c as Message, d as MessageActionBar, e as MessageComposer, f as MessageList, S as ScrollToBottomButton, g as StreamingText, h as SuggestedActions, T as ToolStatusIndicator, i as TypingIndicator, W as WelcomeScreen } from './WelcomeScreen-
|
|
8
|
+
export { A as AttachmentPreview, a as Avatar, C as ChatContainer, b as ChatLayout, M as MarkdownContent, c as Message, d as MessageActionBar, e as MessageComposer, f as MessageList, S as ScrollToBottomButton, g as StreamingText, h as SuggestedActions, T as ToolStatusIndicator, i as TypingIndicator, W as WelcomeScreen } from './WelcomeScreen-XVZqMpVW.js';
|
|
9
9
|
import { ClassValue } from 'clsx';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import 'react';
|
|
@@ -51,9 +51,12 @@ type ContentPart = {
|
|
|
51
51
|
} | {
|
|
52
52
|
type: "media";
|
|
53
53
|
id: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: "sa";
|
|
56
|
+
id: string;
|
|
54
57
|
};
|
|
55
58
|
/**
|
|
56
|
-
* Parse content and split it by inline markers ([VIZ:id] and [
|
|
59
|
+
* Parse content and split it by inline markers ([VIZ:id], [MEDIA:id], and [SA:id]).
|
|
57
60
|
*/
|
|
58
61
|
declare function parseContentWithInlineMarkers(content: string): ContentPart[];
|
|
59
62
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{b as AttachmentPreview,c as Avatar,d as ChatContainer,ga as ChatLayout,f as MarkdownContent,_ as Message,l as MessageActionBar,$ as MessageComposer,ba as MessageList,aa as ScrollToBottomButton,C as StreamingText,D as SuggestedActions,fa as ToolStatusIndicator,da as TypingIndicator,ha as WelcomeScreen,a as cn,Z as parseContentWithInlineMarkers}from'./chunk-EI3GOLHT.js';export{q as ActionButton,l as AvatarPrimitive,g as ComposerContext,j as ComposerInput,k as ComposerSubmit,i as MessageComposerPrimitive,d as MessageContentPrimitive,a as MessageContext,f as MessageListPrimitive,c as MessagePrimitive,e as MessageTimestampPrimitive,m as StreamingTextPrimitive,n as SuggestedActionsContext,p as SuggestedActionsPrimitive,r as TypingIndicatorPrimitive,h as useComposer,b as useMessage,o as useSuggestedActions}from'./chunk-6RN7SUWT.js';export{b as useAttachments,a as useStreaming}from'./chunk-WG77GQR3.js';export{a as useScrollLock}from'./chunk-D2PFIJNZ.js';export{a as useAutoScroll,b as useMessageComposer}from'./chunk-4WWJTYYA.js';export{a as ChatContext,b as ChatProvider,c as useChatContext}from'./chunk-OCKHJ4WO.js';export{a as chatTokens}from'./chunk-O2ILSWHS.js';export{a as getContrastTextColor,b as useBrandingCSSVars}from'./chunk-NSTK5EUQ.js';var i={hour:"numeric",minute:"2-digit",hour12:true},m={month:"short",day:"numeric"},se={...m,year:"numeric",...i};function u(t){let e=typeof t=="string"?new Date(t):t,o=new Date;return e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()?e.toLocaleTimeString("en-US",i):e.getFullYear()===o.getFullYear()?`${e.toLocaleDateString("en-US",m)}, ${e.toLocaleTimeString("en-US",i)}`:e.toLocaleDateString("en-US",se)}function re(t){let e=typeof t=="string"?new Date(t):t,g=new Date().getTime()-e.getTime(),n=Math.floor(g/1e3),s=Math.floor(n/60),r=Math.floor(s/60),a=Math.floor(r/24);return n<60?"just now":s<60?`${s} minute${s===1?"":"s"} ago`:r<24?`${r} hour${r===1?"":"s"} ago`:a<7?`${a} day${a===1?"":"s"} ago`:u(e)}export{u as formatMessageTime,re as formatRelativeTime};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/format-date.ts"
|
|
1
|
+
{"version":3,"sources":["../src/utils/format-date.ts"],"names":["TIME_FORMAT","DATE_FORMAT","FULL_FORMAT","formatMessageTime","date","d","now","formatRelativeTime","diffMs","diffSeconds","diffMinutes","diffHours","diffDays"],"mappings":"+uCAIA,IAAMA,EAA0C,CAC9C,IAAA,CAAM,UACN,MAAA,CAAQ,SAAA,CACR,OAAQ,IACV,CAAA,CAEMC,CAAAA,CAA0C,CAC9C,MAAO,OAAA,CACP,GAAA,CAAK,SACP,CAAA,CAEMC,EAAAA,CAA0C,CAC9C,GAAGD,CAAAA,CACH,IAAA,CAAM,SAAA,CACN,GAAGD,CACL,CAAA,CAQO,SAASG,CAAAA,CAAkBC,CAAAA,CAA6B,CAC7D,IAAMC,CAAAA,CAAI,OAAOD,CAAAA,EAAS,SAAW,IAAI,IAAA,CAAKA,CAAI,CAAA,CAAIA,CAAAA,CAChDE,EAAM,IAAI,IAAA,CAOhB,OAJED,CAAAA,CAAE,SAAQ,GAAMC,CAAAA,CAAI,SAAQ,EAC5BD,CAAAA,CAAE,UAAS,GAAMC,CAAAA,CAAI,QAAA,EAAS,EAC9BD,EAAE,WAAA,EAAY,GAAMC,EAAI,WAAA,EAAY,CAG7BD,EAAE,kBAAA,CAAmB,OAAA,CAASL,CAAW,CAAA,CAG/BK,EAAE,WAAA,EAAY,GAAMC,EAAI,WAAA,EAAY,CAG9C,GAAGD,CAAAA,CAAE,kBAAA,CAAmB,QAASJ,CAAW,CAAC,KAAKI,CAAAA,CAAE,kBAAA,CAAmB,QAASL,CAAW,CAAC,GAG9FK,CAAAA,CAAE,kBAAA,CAAmB,OAAA,CAASH,EAAW,CAClD,CAKO,SAASK,GAAmBH,CAAAA,CAA6B,CAC9D,IAAMC,CAAAA,CAAI,OAAOD,CAAAA,EAAS,QAAA,CAAW,IAAI,IAAA,CAAKA,CAAI,EAAIA,CAAAA,CAEhDI,CAAAA,CADM,IAAI,IAAA,EAAK,CACF,OAAA,EAAQ,CAAIH,EAAE,OAAA,EAAQ,CACnCI,EAAc,IAAA,CAAK,KAAA,CAAMD,EAAS,GAAI,CAAA,CACtCE,CAAAA,CAAc,IAAA,CAAK,MAAMD,CAAAA,CAAc,EAAE,EACzCE,CAAAA,CAAY,IAAA,CAAK,MAAMD,CAAAA,CAAc,EAAE,CAAA,CACvCE,CAAAA,CAAW,KAAK,KAAA,CAAMD,CAAAA,CAAY,EAAE,CAAA,CAE1C,OAAIF,EAAc,EAAA,CACT,UAAA,CAGLC,CAAAA,CAAc,EAAA,CACT,GAAGA,CAAW,CAAA,OAAA,EAAUA,IAAgB,CAAA,CAAI,EAAA,CAAK,GAAG,CAAA,IAAA,CAAA,CAGzDC,CAAAA,CAAY,EAAA,CACP,CAAA,EAAGA,CAAS,CAAA,KAAA,EAAQA,CAAAA,GAAc,EAAI,EAAA,CAAK,GAAG,OAGnDC,CAAAA,CAAW,CAAA,CACN,GAAGA,CAAQ,CAAA,IAAA,EAAOA,IAAa,CAAA,CAAI,EAAA,CAAK,GAAG,CAAA,IAAA,CAAA,CAG7CT,CAAAA,CAAkBE,CAAC,CAC5B","file":"index.js","sourcesContent":["/**\n * Format a date for display in chat messages.\n */\n\nconst TIME_FORMAT: Intl.DateTimeFormatOptions = {\n hour: \"numeric\",\n minute: \"2-digit\",\n hour12: true,\n};\n\nconst DATE_FORMAT: Intl.DateTimeFormatOptions = {\n month: \"short\",\n day: \"numeric\",\n};\n\nconst FULL_FORMAT: Intl.DateTimeFormatOptions = {\n ...DATE_FORMAT,\n year: \"numeric\",\n ...TIME_FORMAT,\n};\n\n/**\n * Format a timestamp for display.\n * - Today: \"2:30 PM\"\n * - This year: \"Dec 15, 2:30 PM\"\n * - Other years: \"Dec 15, 2024, 2:30 PM\"\n */\nexport function formatMessageTime(date: Date | string): string {\n const d = typeof date === \"string\" ? new Date(date) : date;\n const now = new Date();\n\n const isToday =\n d.getDate() === now.getDate() &&\n d.getMonth() === now.getMonth() &&\n d.getFullYear() === now.getFullYear();\n\n if (isToday) {\n return d.toLocaleTimeString(\"en-US\", TIME_FORMAT);\n }\n\n const isThisYear = d.getFullYear() === now.getFullYear();\n\n if (isThisYear) {\n return `${d.toLocaleDateString(\"en-US\", DATE_FORMAT)}, ${d.toLocaleTimeString(\"en-US\", TIME_FORMAT)}`;\n }\n\n return d.toLocaleDateString(\"en-US\", FULL_FORMAT);\n}\n\n/**\n * Format a relative time (e.g., \"2 minutes ago\").\n */\nexport function formatRelativeTime(date: Date | string): string {\n const d = typeof date === \"string\" ? new Date(date) : date;\n const now = new Date();\n const diffMs = now.getTime() - d.getTime();\n const diffSeconds = Math.floor(diffMs / 1000);\n const diffMinutes = Math.floor(diffSeconds / 60);\n const diffHours = Math.floor(diffMinutes / 60);\n const diffDays = Math.floor(diffHours / 24);\n\n if (diffSeconds < 60) {\n return \"just now\";\n }\n\n if (diffMinutes < 60) {\n return `${diffMinutes} minute${diffMinutes === 1 ? \"\" : \"s\"} ago`;\n }\n\n if (diffHours < 24) {\n return `${diffHours} hour${diffHours === 1 ? \"\" : \"s\"} ago`;\n }\n\n if (diffDays < 7) {\n return `${diffDays} day${diffDays === 1 ? \"\" : \"s\"} ago`;\n }\n\n return formatMessageTime(d);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StreamingChunk, C as ClarificationData, M as MediaChunkData } from './streaming-
|
|
1
|
+
import { S as StreamingChunk, C as ClarificationData, T as ToolApprovalData, M as MediaChunkData, A as ArtifactChunkData } from './streaming-DURrv9_E.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Citation source types for AI-generated content.
|
|
@@ -22,8 +22,6 @@ interface SourceTypeConfig {
|
|
|
22
22
|
label: string;
|
|
23
23
|
color: string;
|
|
24
24
|
}
|
|
25
|
-
type MemoryFeedbackType = "relevant" | "not_relevant";
|
|
26
|
-
declare function isMemoryCitation(source: SourceReference): boolean;
|
|
27
25
|
|
|
28
26
|
type ParticipantRole = "user" | "assistant" | "system";
|
|
29
27
|
interface Participant {
|
|
@@ -77,8 +75,11 @@ interface ChatMessage extends MessageData {
|
|
|
77
75
|
reasoning?: StreamingChunk[];
|
|
78
76
|
citations?: SourceReference[];
|
|
79
77
|
pendingClarification?: ClarificationData;
|
|
78
|
+
pendingToolApproval?: ToolApprovalData;
|
|
80
79
|
/** Inline media (images/videos) to render within message content */
|
|
81
80
|
medias?: MediaChunkData[];
|
|
81
|
+
/** Downloadable artifacts (PDFs, HTMLs) produced by tool calls in this message */
|
|
82
|
+
artifacts?: ArtifactChunkData[];
|
|
82
83
|
/** Wall-clock execution time in seconds (persisted after streaming completes) */
|
|
83
84
|
executionTime?: number;
|
|
84
85
|
}
|
|
@@ -89,4 +90,4 @@ interface ReasoningChunk {
|
|
|
89
90
|
timestamp: string | Date;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
export {
|
|
93
|
+
export type { Attachment as A, ChatMessage as C, MessageData as M, ParticipantRole as P, ReasoningChunk as R, SourceReference as S, MessageError as a, Participant as b, SourceTypeConfig as c, SuggestedAction as d, SuggestedActionType as e };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as Avatar, h as AvatarProps, C as ComposerContext, a as ComposerInput, i as ComposerInputProps, b as ComposerSubmit, j as ComposerSubmitProps, e as Message, M as MessageComposer, k as MessageComposerProps, c as MessageContent, l as MessageContentProps, d as MessageContext, m as MessageProps, f as MessageTimestamp, n as MessageTimestampProps, u as useComposer, g as useMessage } from '../avatar-
|
|
1
|
+
export { A as Avatar, h as AvatarProps, C as ComposerContext, a as ComposerInput, i as ComposerInputProps, b as ComposerSubmit, j as ComposerSubmitProps, e as Message, M as MessageComposer, k as MessageComposerProps, c as MessageContent, l as MessageContentProps, d as MessageContext, m as MessageProps, f as MessageTimestamp, n as MessageTimestampProps, u as useComposer, g as useMessage } from '../avatar-C13xc3tA.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import '../streaming-
|
|
4
|
+
import { d as SuggestedAction } from '../message-BrHFdwb2.js';
|
|
5
|
+
import '../streaming-DURrv9_E.js';
|
|
6
6
|
|
|
7
7
|
interface MessageListProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
/** Messages to render */
|
|
@@ -20,7 +20,7 @@ interface StreamingOptions {
|
|
|
20
20
|
/**
|
|
21
21
|
* Extended chunk types for agentic streaming
|
|
22
22
|
*/
|
|
23
|
-
type ChunkType = "content" | "thinking" | "tool" | "observation" | "answer" | "planning" | "subtask" | "progress" | "wave_start" | "wave_complete" | "parallel_subtask_start" | "parallel_subtask_complete" | "multi_agent_planning" | "multi_agent_planning_complete" | "subagent_start" | "subagent_complete" | "subagent_failed" | "synthesis" | "clarification_needed" | "visualization" | "media" | "subagent" | "file_operation" | "terminal" | "search_results" | "web_operation" | "claude_text" | "claude_thinking";
|
|
23
|
+
type ChunkType = "content" | "thinking" | "tool" | "observation" | "answer" | "planning" | "subtask" | "progress" | "wave_start" | "wave_complete" | "parallel_subtask_start" | "parallel_subtask_complete" | "multi_agent_planning" | "multi_agent_planning_complete" | "subagent_start" | "subagent_complete" | "subagent_failed" | "synthesis" | "clarification_needed" | "tool_approval_needed" | "visualization" | "media" | "artifact" | "subagent" | "file_operation" | "terminal" | "search_results" | "web_operation" | "claude_text" | "claude_thinking" | "suggested_action_created";
|
|
24
24
|
/**
|
|
25
25
|
* Subtask data structure for Plan & Execute mode
|
|
26
26
|
*/
|
|
@@ -166,6 +166,13 @@ interface ClarificationData {
|
|
|
166
166
|
subagentRole?: string;
|
|
167
167
|
toolCallId?: string;
|
|
168
168
|
}
|
|
169
|
+
interface ToolApprovalData {
|
|
170
|
+
toolName: string;
|
|
171
|
+
toolDescription: string;
|
|
172
|
+
toolInputs: Record<string, unknown>;
|
|
173
|
+
toolSchema?: Record<string, unknown>;
|
|
174
|
+
toolCallId?: string;
|
|
175
|
+
}
|
|
169
176
|
type VisualizationType = "chart" | "table" | "card" | "kpi" | "code_preview" | "form";
|
|
170
177
|
type ChartDataType = "line" | "bar" | "pie" | "area" | "scatter" | "composed";
|
|
171
178
|
interface ChartSeries {
|
|
@@ -191,7 +198,7 @@ interface ChartVisualizationData {
|
|
|
191
198
|
xAxis?: ChartAxis;
|
|
192
199
|
yAxis?: ChartAxis;
|
|
193
200
|
}
|
|
194
|
-
type TableColumnType = "string" | "number" | "currency" | "date" | "badge" | "link" | "boolean" | "progress";
|
|
201
|
+
type TableColumnType = "string" | "number" | "currency" | "date" | "badge" | "link" | "boolean" | "progress" | "media";
|
|
195
202
|
interface TableColumn {
|
|
196
203
|
key: string;
|
|
197
204
|
label: string;
|
|
@@ -227,7 +234,7 @@ interface KpiMetric {
|
|
|
227
234
|
value: string | number;
|
|
228
235
|
unit?: string;
|
|
229
236
|
trend?: "up" | "down" | "neutral";
|
|
230
|
-
change?: string;
|
|
237
|
+
change?: string | number;
|
|
231
238
|
changeLabel?: string;
|
|
232
239
|
sparkline?: number[];
|
|
233
240
|
color?: string;
|
|
@@ -312,6 +319,37 @@ interface MediaChunkData {
|
|
|
312
319
|
toolName?: string;
|
|
313
320
|
};
|
|
314
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Artifact chunk — a tool-produced file (PDF, HTML, ...) persisted server-side.
|
|
324
|
+
*
|
|
325
|
+
* The backend emits the chunk twice per artifact: first with
|
|
326
|
+
* `status: "pending"` (before rendering) so the frontend can show a skeleton
|
|
327
|
+
* card, then again with `status: "ready"` (URL + size populated) or
|
|
328
|
+
* `status: "failed"` (errorMessage populated). Consumers should key by `id`
|
|
329
|
+
* and replace state on the second chunk.
|
|
330
|
+
*
|
|
331
|
+
* `url` is a stable proxy URL (`/assistant/artifacts/<id>/download/`) — the
|
|
332
|
+
* backend re-signs on every request, so it does not expire mid-session. It is
|
|
333
|
+
* `null` while status is pending/failed.
|
|
334
|
+
*/
|
|
335
|
+
type ArtifactStatus = "pending" | "ready" | "failed";
|
|
336
|
+
interface ArtifactChunkData {
|
|
337
|
+
id: string;
|
|
338
|
+
kind: "pdf" | "html" | string;
|
|
339
|
+
title: string;
|
|
340
|
+
description?: string;
|
|
341
|
+
status?: ArtifactStatus;
|
|
342
|
+
url: string | null;
|
|
343
|
+
mimetype?: string;
|
|
344
|
+
sizeBytes?: number;
|
|
345
|
+
pageCount?: number;
|
|
346
|
+
createdAt?: string;
|
|
347
|
+
errorMessage?: string;
|
|
348
|
+
context?: {
|
|
349
|
+
orchestratorType?: string;
|
|
350
|
+
toolName?: string;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
315
353
|
/**
|
|
316
354
|
* Extended streaming chunk with full agentic support
|
|
317
355
|
*/
|
|
@@ -353,8 +391,10 @@ interface StreamingChunk {
|
|
|
353
391
|
webOperationData?: WebOperationChunkData;
|
|
354
392
|
claudeToolData?: ClaudeToolChunkData;
|
|
355
393
|
clarificationData?: ClarificationData;
|
|
394
|
+
toolApprovalData?: ToolApprovalData;
|
|
356
395
|
visualizationData?: VisualizationChunkData;
|
|
357
396
|
mediaData?: MediaChunkData;
|
|
397
|
+
artifactData?: ArtifactChunkData;
|
|
358
398
|
toolUseId?: string;
|
|
359
399
|
}
|
|
360
400
|
/**
|
|
@@ -373,8 +413,10 @@ interface StreamingMessage {
|
|
|
373
413
|
suggestedActions?: FollowupAction[];
|
|
374
414
|
activeSubagents?: Map<string, SubagentChunkData>;
|
|
375
415
|
pendingClarification?: ClarificationData;
|
|
416
|
+
pendingToolApproval?: ToolApprovalData;
|
|
376
417
|
visualizations?: VisualizationChunkData[];
|
|
377
418
|
medias?: MediaChunkData[];
|
|
419
|
+
artifacts?: ArtifactChunkData[];
|
|
378
420
|
}
|
|
379
421
|
/**
|
|
380
422
|
* Follow-up action suggested by AI
|
|
@@ -436,4 +478,4 @@ type VisualizationActionEvent = {
|
|
|
436
478
|
action: string;
|
|
437
479
|
};
|
|
438
480
|
|
|
439
|
-
export type {
|
|
481
|
+
export type { ArtifactChunkData as A, ThinkingEvent as B, ClarificationData as C, ToolEvent as D, Event as E, FormVisualizationData as F, VisualizationType as G, WebOperationChunkData as H, KpiVisualizationData as K, MediaChunkData as M, ObservationEvent as O, PlanData as P, StreamingChunk as S, ToolApprovalData as T, VisualizationChunkData as V, WaveData as W, StreamChunk as a, StreamingOptions as b, StreamingState as c, VisualizationActionEvent as d, ChartVisualizationData as e, VisualizationConfig as f, TableVisualizationData as g, CardVisualizationData as h, CodePreviewVisualizationData as i, EventStatus as j, ArtifactStatus as k, ChunkType as l, ClaudeToolChunkData as m, EventType as n, FileOperationChunkData as o, FollowupAction as p, ParallelSubtaskData as q, PlanningEvent as r, ProgressData as s, SearchResultsChunkData as t, StreamingMessage as u, SubTaskData as v, SubagentChunkData as w, SubagentInfo as x, SubtaskEvent as y, TerminalChunkData as z };
|
package/dist/styled/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { A as AttachmentPreview, j as AttachmentPreviewProps, a as Avatar, k as AvatarProps, C as ChatContainer, l as ChatContainerProps, b as ChatLayout, m as ChatLayoutProps, M as MarkdownContent, n as MarkdownContentProps, c as Message, d as MessageActionBar, o as MessageActionBarProps, e as MessageComposer, p as MessageComposerProps, f as MessageList, q as MessageListProps, r as MessageProps, S as ScrollToBottomButton, s as ScrollToBottomButtonProps, g as StreamingText, t as StreamingTextProps, h as SuggestedActions, u as SuggestedActionsProps, v as ToolStatus, T as ToolStatusIndicator, w as ToolStatusIndicatorProps, i as TypingIndicator, x as TypingIndicatorProps, W as WelcomeScreen, y as WelcomeScreenProps } from '../WelcomeScreen-
|
|
1
|
+
export { A as AttachmentPreview, j as AttachmentPreviewProps, a as Avatar, k as AvatarProps, C as ChatContainer, l as ChatContainerProps, b as ChatLayout, m as ChatLayoutProps, M as MarkdownContent, n as MarkdownContentProps, c as Message, d as MessageActionBar, o as MessageActionBarProps, e as MessageComposer, p as MessageComposerProps, f as MessageList, q as MessageListProps, r as MessageProps, S as ScrollToBottomButton, s as ScrollToBottomButtonProps, g as StreamingText, t as StreamingTextProps, h as SuggestedActions, u as SuggestedActionsProps, v as ToolStatus, T as ToolStatusIndicator, w as ToolStatusIndicatorProps, i as TypingIndicator, x as TypingIndicatorProps, W as WelcomeScreen, y as WelcomeScreenProps } from '../WelcomeScreen-XVZqMpVW.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import react__default, { ReactNode } from 'react';
|
|
4
|
-
import { A as Attachment, S as SourceReference
|
|
5
|
-
export { C as ChatMessage, M as MessageData,
|
|
6
|
-
import { S as StreamingChunk, P as PlanData, C as ClarificationData, V as VisualizationChunkData, d as VisualizationActionEvent, e as ChartVisualizationData, f as VisualizationConfig,
|
|
7
|
-
export {
|
|
3
|
+
import react__default, { ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { A as Attachment, S as SourceReference } from '../message-BrHFdwb2.js';
|
|
5
|
+
export { C as ChatMessage, M as MessageData, a as MessageError, b as Participant, P as ParticipantRole, c as SourceTypeConfig, d as SuggestedAction, e as SuggestedActionType } from '../message-BrHFdwb2.js';
|
|
6
|
+
import { S as StreamingChunk, P as PlanData, C as ClarificationData, T as ToolApprovalData, V as VisualizationChunkData, d as VisualizationActionEvent, M as MediaChunkData, e as ChartVisualizationData, f as VisualizationConfig, g as TableVisualizationData, h as CardVisualizationData, K as KpiVisualizationData, i as CodePreviewVisualizationData, F as FormVisualizationData, A as ArtifactChunkData, E as Event, j as EventStatus } from '../streaming-DURrv9_E.js';
|
|
7
|
+
export { k as ArtifactStatus, l as ChunkType, m as ClaudeToolChunkData, n as EventType, o as FileOperationChunkData, p as FollowupAction, O as ObservationEvent, q as ParallelSubtaskData, r as PlanningEvent, s as ProgressData, t as SearchResultsChunkData, u as StreamingMessage, v as SubTaskData, w as SubagentChunkData, x as SubagentInfo, y as SubtaskEvent, z as TerminalChunkData, B as ThinkingEvent, D as ToolEvent, G as VisualizationType, W as WaveData, H as WebOperationChunkData } from '../streaming-DURrv9_E.js';
|
|
8
8
|
import { z, ZodSchema } from 'zod';
|
|
9
9
|
export { ChatContextValue, ChatProvider, ChatProviderProps, useChatContext } from '../context/index.js';
|
|
10
10
|
export { B as BrandingData } from '../branding-SzYU4ncD.js';
|
|
11
|
-
export { u as useComposer, g as useMessage } from '../avatar-
|
|
11
|
+
export { u as useComposer, g as useMessage } from '../avatar-C13xc3tA.js';
|
|
12
12
|
|
|
13
13
|
interface LoadingDotsProps {
|
|
14
14
|
/** Size variant */
|
|
@@ -115,26 +115,34 @@ interface ClarificationPanelProps {
|
|
|
115
115
|
*/
|
|
116
116
|
declare function ClarificationPanel({ clarification, onSubmit, onOptionSelect, disabled, loading, className, }: ClarificationPanelProps): react_jsx_runtime.JSX.Element;
|
|
117
117
|
|
|
118
|
+
interface ToolApprovalPanelProps {
|
|
119
|
+
approval: ToolApprovalData;
|
|
120
|
+
onApprove: (modifiedInputs: Record<string, unknown>) => void;
|
|
121
|
+
onReject: (reason?: string) => void;
|
|
122
|
+
disabled?: boolean;
|
|
123
|
+
className?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Tool approval panel - displays when the AI agent needs user approval before
|
|
127
|
+
* executing a tool. Shows tool summary, editable parameters, and approve/reject actions.
|
|
128
|
+
* Amber left-border panel (distinguished from orange clarification panel).
|
|
129
|
+
*/
|
|
130
|
+
declare function ToolApprovalPanel({ approval, onApprove, onReject, disabled, className, }: ToolApprovalPanelProps): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
118
132
|
interface CitationSourcesProps {
|
|
119
133
|
sources: SourceReference[];
|
|
120
134
|
className?: string;
|
|
121
|
-
onMemoryFeedback?: (semanticAtomId: string, feedback: MemoryFeedbackType) => void;
|
|
122
|
-
memoryFeedbackState?: Record<string, MemoryFeedbackType>;
|
|
123
135
|
}
|
|
124
136
|
/**
|
|
125
137
|
* Renders citation sources as a horizontal row of clickable chips.
|
|
126
138
|
* Clicking a chip opens a modal showing full source content.
|
|
127
|
-
* Memory citations include feedback buttons (thumbs up/down).
|
|
128
139
|
*/
|
|
129
|
-
declare function CitationSources({ sources, className,
|
|
140
|
+
declare function CitationSources({ sources, className, }: CitationSourcesProps): react_jsx_runtime.JSX.Element | null;
|
|
130
141
|
interface SourceDetailModalProps {
|
|
131
142
|
source: SourceReference | null;
|
|
132
143
|
onClose: () => void;
|
|
133
|
-
onMemoryFeedback?: (semanticAtomId: string, feedback: MemoryFeedbackType) => void;
|
|
134
|
-
feedbackState?: Record<string, MemoryFeedbackType>;
|
|
135
|
-
onFeedbackChange?: (source: SourceReference, feedback: MemoryFeedbackType) => void;
|
|
136
144
|
}
|
|
137
|
-
declare function SourceDetailModal({ source, onClose,
|
|
145
|
+
declare function SourceDetailModal({ source, onClose, }: SourceDetailModalProps): react_jsx_runtime.JSX.Element | null;
|
|
138
146
|
/**
|
|
139
147
|
* Inline citation badge - renders a small numbered badge like [1]
|
|
140
148
|
* with optional tooltip on hover and click-to-open URL.
|
|
@@ -225,6 +233,7 @@ declare const tableVisualizationSchema: z.ZodObject<{
|
|
|
225
233
|
number: "number";
|
|
226
234
|
boolean: "boolean";
|
|
227
235
|
progress: "progress";
|
|
236
|
+
media: "media";
|
|
228
237
|
currency: "currency";
|
|
229
238
|
date: "date";
|
|
230
239
|
badge: "badge";
|
|
@@ -270,7 +279,7 @@ declare const kpiVisualizationSchema: z.ZodObject<{
|
|
|
270
279
|
down: "down";
|
|
271
280
|
neutral: "neutral";
|
|
272
281
|
}>>>;
|
|
273
|
-
change: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
282
|
+
change: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
274
283
|
changeLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
275
284
|
sparkline: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
276
285
|
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -324,8 +333,10 @@ interface VisualizationRendererProps {
|
|
|
324
333
|
data: VisualizationChunkData;
|
|
325
334
|
isStreaming?: boolean;
|
|
326
335
|
onAction?: (event: VisualizationActionEvent) => void;
|
|
336
|
+
/** Message-level media bag used to resolve `media_ref:<id>` cell values. */
|
|
337
|
+
medias?: MediaChunkData[];
|
|
327
338
|
}
|
|
328
|
-
declare function VisualizationRenderer({ data, isStreaming, onAction, }: VisualizationRendererProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
declare function VisualizationRenderer({ data, isStreaming, onAction, medias, }: VisualizationRendererProps): react_jsx_runtime.JSX.Element;
|
|
329
340
|
|
|
330
341
|
interface ChartVisualizationProps {
|
|
331
342
|
data: ChartVisualizationData;
|
|
@@ -338,8 +349,10 @@ interface TableVisualizationProps {
|
|
|
338
349
|
data: TableVisualizationData;
|
|
339
350
|
config?: VisualizationConfig;
|
|
340
351
|
isStreaming?: boolean;
|
|
352
|
+
/** Message-level media bag used to resolve `media_ref:<id>` cell values. */
|
|
353
|
+
medias?: MediaChunkData[];
|
|
341
354
|
}
|
|
342
|
-
declare function TableVisualization({ data, config }: TableVisualizationProps): react_jsx_runtime.JSX.Element;
|
|
355
|
+
declare function TableVisualization({ data, config, medias }: TableVisualizationProps): react_jsx_runtime.JSX.Element;
|
|
343
356
|
|
|
344
357
|
interface CardVisualizationProps {
|
|
345
358
|
data: CardVisualizationData;
|
|
@@ -377,6 +390,7 @@ interface VisualizationEntry {
|
|
|
377
390
|
config?: VisualizationConfig;
|
|
378
391
|
isStreaming?: boolean;
|
|
379
392
|
onAction?: (event: VisualizationActionEvent) => void;
|
|
393
|
+
medias?: MediaChunkData[];
|
|
380
394
|
}>;
|
|
381
395
|
schema?: ZodSchema;
|
|
382
396
|
}
|
|
@@ -394,6 +408,62 @@ declare function getVisualization(type: string): VisualizationEntry | undefined;
|
|
|
394
408
|
*/
|
|
395
409
|
declare function getRegisteredTypes(): string[];
|
|
396
410
|
|
|
411
|
+
interface ArtifactInlineCardProps {
|
|
412
|
+
artifact: ArtifactChunkData;
|
|
413
|
+
isStreaming?: boolean;
|
|
414
|
+
onOpen?: (artifact: ArtifactChunkData) => void;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Unstyled primitive inline card. The app layer (`web/`) registers a
|
|
418
|
+
* MUI-skinned version via `registerArtifact`; this primitive is the fallback
|
|
419
|
+
* shipped with the chat-ui package so headless / embedded consumers still
|
|
420
|
+
* render something when a tool emits an artifact.
|
|
421
|
+
*/
|
|
422
|
+
declare function ArtifactInlineCard({ artifact, isStreaming, onOpen, }: ArtifactInlineCardProps): react_jsx_runtime.JSX.Element;
|
|
423
|
+
|
|
424
|
+
interface ArtifactListProps {
|
|
425
|
+
artifacts: ArtifactChunkData[];
|
|
426
|
+
isStreaming?: boolean;
|
|
427
|
+
onOpen?: (artifact: ArtifactChunkData) => void;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Renders one inline card per artifact using the registered renderer when
|
|
431
|
+
* available; falls back to the unstyled `ArtifactInlineCard` otherwise.
|
|
432
|
+
*/
|
|
433
|
+
declare function ArtifactList({ artifacts, isStreaming, onOpen, }: ArtifactListProps): react_jsx_runtime.JSX.Element | null;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Shape of a registered artifact type.
|
|
437
|
+
*
|
|
438
|
+
* Artifacts have a dual UI:
|
|
439
|
+
* - `InlineCard` is rendered inside the message body (compact, clickable).
|
|
440
|
+
* - `Viewer` is rendered inside the side-panel drawer (full preview).
|
|
441
|
+
*
|
|
442
|
+
* The app layer (`web/`) supplies MUI-skinned implementations; the unstyled
|
|
443
|
+
* primitive `ArtifactInlineCard` is used as a fallback for headless consumers
|
|
444
|
+
* (e.g. the embedded widget) that do not register MUI artifacts.
|
|
445
|
+
*/
|
|
446
|
+
interface ArtifactEntry {
|
|
447
|
+
type: string;
|
|
448
|
+
label: string;
|
|
449
|
+
icon?: ComponentType<{
|
|
450
|
+
className?: string;
|
|
451
|
+
}>;
|
|
452
|
+
InlineCard: ComponentType<{
|
|
453
|
+
artifact: ArtifactChunkData;
|
|
454
|
+
isStreaming?: boolean;
|
|
455
|
+
onOpen?: (artifact: ArtifactChunkData) => void;
|
|
456
|
+
}>;
|
|
457
|
+
Viewer?: ComponentType<{
|
|
458
|
+
artifact: ArtifactChunkData;
|
|
459
|
+
}>;
|
|
460
|
+
/** Optional description shown when no entry is registered for this type. */
|
|
461
|
+
fallback?: ReactNode;
|
|
462
|
+
}
|
|
463
|
+
declare function registerArtifact(type: string, entry: ArtifactEntry): void;
|
|
464
|
+
declare function getArtifact(type: string): ArtifactEntry | undefined;
|
|
465
|
+
declare function getRegisteredArtifactTypes(): string[];
|
|
466
|
+
|
|
397
467
|
interface EventContentProps {
|
|
398
468
|
event: Event;
|
|
399
469
|
className?: string;
|
|
@@ -480,4 +550,4 @@ interface TimelineItemProps {
|
|
|
480
550
|
*/
|
|
481
551
|
declare function TimelineItem({ status, isLast, badgeSize, children, className, }: TimelineItemProps): react_jsx_runtime.JSX.Element;
|
|
482
552
|
|
|
483
|
-
export { Attachment, CardVisualization, type CardVisualizationProps, ChartVisualization, type ChartVisualizationProps, ChatHeader, type ChatHeaderAction, type ChatHeaderProps, CitationSources, type CitationSourcesProps, ClarificationData, ClarificationPanel, type ClarificationPanelProps, ClaudeToolPreview, type ClaudeToolPreviewProps, CodePreviewVisualization, type CodePreviewVisualizationProps, Event, EventContent, EventStatus, EventTimeline, type EventTimelineProps, FileOperationPreview, type FileOperationPreviewProps, FormVisualization, type FormVisualizationProps, InlineCitation, type InlineCitationProps, KpiVisualization, type KpiVisualizationProps, LoadingDots, type LoadingDotsProps, MessageAttachments, type MessageAttachmentsProps, PlanData, PlanTimeline, type PlanTimelineProps, ReasoningPanel, type ReasoningPanelProps, SearchResultsView, type SearchResultsViewProps, SourceDetailModal, type SourceDetailModalProps, SourceReference, StatusBadge, StreamingChunk, SubagentPanel, type SubagentPanelProps, TableVisualization, type TableVisualizationProps, TerminalOutput, type TerminalOutputProps, TimeMarker, type TimeMarkerProps, Timeline, TimelineItem, type TimelineItemData, type TimelineItemProps, type TimelineProps, VisualizationActionEvent, VisualizationChunkData, VisualizationConfig, type VisualizationEntry, VisualizationRenderer, type VisualizationRendererProps, WebOperationPreview, type WebOperationPreviewProps, cardVisualizationSchema, chartVisualizationSchema, codePreviewVisualizationSchema, convertChunkToEvent, convertTimelineToEvents, formVisualizationSchema, getRegisteredTypes, getVisualization, kpiVisualizationSchema, registerVisualization, tableVisualizationSchema };
|
|
553
|
+
export { ArtifactChunkData, type ArtifactEntry, ArtifactInlineCard, type ArtifactInlineCardProps, ArtifactList, type ArtifactListProps, Attachment, CardVisualization, type CardVisualizationProps, ChartVisualization, type ChartVisualizationProps, ChatHeader, type ChatHeaderAction, type ChatHeaderProps, CitationSources, type CitationSourcesProps, ClarificationData, ClarificationPanel, type ClarificationPanelProps, ClaudeToolPreview, type ClaudeToolPreviewProps, CodePreviewVisualization, type CodePreviewVisualizationProps, Event, EventContent, EventStatus, EventTimeline, type EventTimelineProps, FileOperationPreview, type FileOperationPreviewProps, FormVisualization, type FormVisualizationProps, InlineCitation, type InlineCitationProps, KpiVisualization, type KpiVisualizationProps, LoadingDots, type LoadingDotsProps, MediaChunkData, MessageAttachments, type MessageAttachmentsProps, PlanData, PlanTimeline, type PlanTimelineProps, ReasoningPanel, type ReasoningPanelProps, SearchResultsView, type SearchResultsViewProps, SourceDetailModal, type SourceDetailModalProps, SourceReference, StatusBadge, StreamingChunk, SubagentPanel, type SubagentPanelProps, TableVisualization, type TableVisualizationProps, TerminalOutput, type TerminalOutputProps, TimeMarker, type TimeMarkerProps, Timeline, TimelineItem, type TimelineItemData, type TimelineItemProps, type TimelineProps, ToolApprovalPanel, type ToolApprovalPanelProps, VisualizationActionEvent, VisualizationChunkData, VisualizationConfig, type VisualizationEntry, VisualizationRenderer, type VisualizationRendererProps, WebOperationPreview, type WebOperationPreviewProps, cardVisualizationSchema, chartVisualizationSchema, codePreviewVisualizationSchema, convertChunkToEvent, convertTimelineToEvents, formVisualizationSchema, getArtifact, getRegisteredArtifactTypes, getRegisteredTypes, getVisualization, kpiVisualizationSchema, registerArtifact, registerVisualization, tableVisualizationSchema };
|
package/dist/styled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{U as ArtifactInlineCard,Y as ArtifactList,b as AttachmentPreview,c as Avatar,G as CardVisualization,E as ChartVisualization,d as ChatContainer,ea as ChatHeader,ga as ChatLayout,g as CitationSources,j as ClarificationPanel,v as ClaudeToolPreview,I as CodePreviewVisualization,q as EventContent,t as EventTimeline,x as FileOperationPreview,J as FormVisualization,i as InlineCitation,H as KpiVisualization,e as LoadingDots,f as MarkdownContent,_ as Message,l as MessageActionBar,m as MessageAttachments,$ as MessageComposer,ba as MessageList,u as PlanTimeline,B as ReasoningPanel,aa as ScrollToBottomButton,y as SearchResultsView,h as SourceDetailModal,n as StatusBadge,C as StreamingText,A as SubagentPanel,D as SuggestedActions,F as TableVisualization,w as TerminalOutput,ca as TimeMarker,o as Timeline,p as TimelineItem,k as ToolApprovalPanel,fa as ToolStatusIndicator,da as TypingIndicator,T as VisualizationRenderer,z as WebOperationPreview,ha as WelcomeScreen,P as cardVisualizationSchema,N as chartVisualizationSchema,R as codePreviewVisualizationSchema,r as convertChunkToEvent,s as convertTimelineToEvents,S as formVisualizationSchema,W as getArtifact,X as getRegisteredArtifactTypes,M as getRegisteredTypes,L as getVisualization,Q as kpiVisualizationSchema,V as registerArtifact,K as registerVisualization,O as tableVisualizationSchema}from'../chunk-EI3GOLHT.js';export{h as useComposer,b as useMessage}from'../chunk-6RN7SUWT.js';import'../chunk-D2PFIJNZ.js';import'../chunk-4WWJTYYA.js';export{b as ChatProvider,c as useChatContext}from'../chunk-OCKHJ4WO.js';import'../chunk-O2ILSWHS.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|