@miiflow/assistant-ui 0.5.1 → 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.
@@ -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-BnGtSz1P.js';
5
- import { d as VisualizationActionEvent } from '../streaming-DrnCgnnh.js';
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 */
@@ -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-DrnCgnnh.js';
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, 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-BnGtSz1P.js';
2
- export { a as StreamChunk, b as StreamingOptions, c as StreamingState } from './streaming-DrnCgnnh.js';
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-B6YLvJt3.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-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-88hzx0rD.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-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 [MEDIA:id]).
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{b as AttachmentPreview,c as Avatar,d as ChatContainer,aa as ChatLayout,f as MarkdownContent,U as Message,k as MessageActionBar,V as MessageComposer,X as MessageList,W as ScrollToBottomButton,B as StreamingText,C as SuggestedActions,$ as ToolStatusIndicator,Z as TypingIndicator,ba as WelcomeScreen,a as cn,T as parseContentWithInlineMarkers}from'./chunk-RZNLGXIW.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 getContrastTextColor,b as useBrandingCSSVars}from'./chunk-NSTK5EUQ.js';var i={hour:"numeric",minute:"2-digit",hour12:true},m={month:"short",day:"numeric"},re={...m,year:"numeric",...i};function p(t){let e=typeof t=="string"?new Date(t):t,r=new Date;return e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()?e.toLocaleTimeString("en-US",i):e.getFullYear()===r.getFullYear()?`${e.toLocaleDateString("en-US",m)}, ${e.toLocaleTimeString("en-US",i)}`:e.toLocaleDateString("en-US",re)}function ae(t){let e=typeof t=="string"?new Date(t):t,g=new Date().getTime()-e.getTime(),s=Math.floor(g/1e3),a=Math.floor(s/60),o=Math.floor(a/60),n=Math.floor(o/24);return s<60?"just now":a<60?`${a} minute${a===1?"":"s"} ago`:o<24?`${o} hour${o===1?"":"s"} ago`:n<7?`${n} day${n===1?"":"s"} ago`:p(e)}var oe={spacing:{messageBetween:"1rem",messagePx:"0.875rem",messagePy:"0.625rem",container:"1rem",composerPadding:"1rem"},typography:{message:{fontSize:"1rem",lineHeight:1.5,letterSpacing:"0px"},caption:{fontSize:"0.875rem",lineHeight:1.4},small:{fontSize:"0.8125rem",lineHeight:1.3}},borderRadius:{message:"0.5rem",input:"1rem",panel:"0.5rem",button:"0.5rem",chip:"0.25rem"},colors:{primary:"var(--chat-primary, #106997)",secondary:"var(--chat-secondary, #56C18A)",error:"var(--chat-error, #B1001B)",warning:"var(--chat-warning, #DD9652)",messageBg:"var(--chat-message-bg, rgba(0, 0, 0, 0.03))",userMessageBg:"var(--chat-user-message-bg, var(--chat-primary, #106997))",userMessageText:"var(--chat-user-message-text, #ffffff)",panelBg:"var(--chat-panel-bg, rgba(0, 0, 0, 0.02))",panelBorder:"var(--chat-panel-border, rgba(0, 0, 0, 0.06))",border:"var(--chat-border, rgba(0, 0, 0, 0.06))",borderHover:"var(--chat-border-hover, rgba(0, 0, 0, 0.12))",text:"var(--chat-text, #1D2033)",subtle:"var(--chat-text-subtle, rgba(0, 0, 0, 0.5))",placeholder:"var(--chat-placeholder, rgba(0, 0, 0, 0.4))",status:{pending:{main:"rgba(0, 0, 0, 0.3)",bg:"rgba(0, 0, 0, 0.05)"},running:{main:"rgb(99, 102, 241)",bg:"rgba(99, 102, 241, 0.08)"},completed:{main:"rgb(16, 185, 129)",bg:"rgba(16, 185, 129, 0.08)"},failed:{main:"rgb(239, 68, 68)",bg:"rgba(239, 68, 68, 0.08)"}}},shadows:{subtle:"0 1px 2px rgba(0, 0, 0, 0.04)",input:"0 2px 8px rgba(0, 0, 0, 0.08)",inputFocus:"0 4px 16px rgba(0, 0, 0, 0.12)",button:"0 1px 3px rgba(0, 0, 0, 0.08)",buttonHover:"0 2px 6px rgba(0, 0, 0, 0.12)",primary:"0 2px 6px rgba(16, 105, 151, 0.3)",primaryHover:"0 4px 12px rgba(16, 105, 151, 0.4)"},animations:{messageEntrance:{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3,ease:[.4,0,.2,1]}},fadeIn:{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2}}}};export{oe as chatTokens,p as formatMessageTime,ae as formatRelativeTime};//# sourceMappingURL=index.js.map
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","../src/styles/tokens.ts"],"names":["TIME_FORMAT","DATE_FORMAT","FULL_FORMAT","formatMessageTime","date","d","now","formatRelativeTime","diffMs","diffSeconds","diffMinutes","diffHours","diffDays","chatTokens"],"mappings":"0rCAIA,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,QAAA,CAAW,IAAI,IAAA,CAAKA,CAAI,EAAIA,CAAAA,CAChDE,CAAAA,CAAM,IAAI,IAAA,CAOhB,OAJED,CAAAA,CAAE,OAAA,KAAcC,CAAAA,CAAI,OAAA,IACpBD,CAAAA,CAAE,QAAA,KAAeC,CAAAA,CAAI,QAAA,EAAS,EAC9BD,CAAAA,CAAE,aAAY,GAAMC,CAAAA,CAAI,aAAY,CAG7BD,CAAAA,CAAE,mBAA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CAAS,EAAG,CAAA,CAAG,CAAE,EAC5B,OAAA,CAAS,CAAE,QAAS,CAAA,CAAG,CAAA,CAAG,CAAE,CAAA,CAC5B,UAAA,CAAY,CAAE,QAAA,CAAU,EAAA,CAAK,KAAM,CAAC,EAAA,CAAK,EAAG,EAAA,CAAK,CAAC,CAAE,CACtD,EACA,MAAA,CAAQ,CACN,QAAS,CAAE,OAAA,CAAS,CAAE,CAAA,CACtB,OAAA,CAAS,CAAE,OAAA,CAAS,CAAE,EACtB,UAAA,CAAY,CAAE,SAAU,EAAI,CAC9B,CACF,CACF","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","/**\n * Design tokens for the chat UI.\n * These map to CSS custom properties for easy theming.\n */\n\nexport const chatTokens = {\n spacing: {\n /** Vertical spacing between messages (16px) */\n messageBetween: \"1rem\",\n /** Message bubble horizontal padding (14px) */\n messagePx: \"0.875rem\",\n /** Message bubble vertical padding (10px) */\n messagePy: \"0.625rem\",\n /** Container padding (16px) */\n container: \"1rem\",\n /** Composer padding (16px) */\n composerPadding: \"1rem\",\n },\n\n typography: {\n message: {\n fontSize: \"1rem\",\n lineHeight: 1.5,\n letterSpacing: \"0px\",\n },\n caption: {\n fontSize: \"0.875rem\",\n lineHeight: 1.4,\n },\n small: {\n fontSize: \"0.8125rem\",\n lineHeight: 1.3,\n },\n },\n\n borderRadius: {\n message: \"0.5rem\",\n input: \"1rem\",\n panel: \"0.5rem\",\n button: \"0.5rem\",\n chip: \"0.25rem\",\n },\n\n colors: {\n // CSS custom property references\n primary: \"var(--chat-primary, #106997)\",\n secondary: \"var(--chat-secondary, #56C18A)\",\n error: \"var(--chat-error, #B1001B)\",\n warning: \"var(--chat-warning, #DD9652)\",\n\n // Message backgrounds\n messageBg: \"var(--chat-message-bg, rgba(0, 0, 0, 0.03))\",\n userMessageBg: \"var(--chat-user-message-bg, var(--chat-primary, #106997))\",\n userMessageText: \"var(--chat-user-message-text, #ffffff)\",\n\n // Panel backgrounds\n panelBg: \"var(--chat-panel-bg, rgba(0, 0, 0, 0.02))\",\n panelBorder: \"var(--chat-panel-border, rgba(0, 0, 0, 0.06))\",\n\n // Borders\n border: \"var(--chat-border, rgba(0, 0, 0, 0.06))\",\n borderHover: \"var(--chat-border-hover, rgba(0, 0, 0, 0.12))\",\n\n // Text\n text: \"var(--chat-text, #1D2033)\",\n subtle: \"var(--chat-text-subtle, rgba(0, 0, 0, 0.5))\",\n placeholder: \"var(--chat-placeholder, rgba(0, 0, 0, 0.4))\",\n\n // Status colors\n status: {\n pending: {\n main: \"rgba(0, 0, 0, 0.3)\",\n bg: \"rgba(0, 0, 0, 0.05)\",\n },\n running: {\n main: \"rgb(99, 102, 241)\",\n bg: \"rgba(99, 102, 241, 0.08)\",\n },\n completed: {\n main: \"rgb(16, 185, 129)\",\n bg: \"rgba(16, 185, 129, 0.08)\",\n },\n failed: {\n main: \"rgb(239, 68, 68)\",\n bg: \"rgba(239, 68, 68, 0.08)\",\n },\n },\n },\n\n shadows: {\n subtle: \"0 1px 2px rgba(0, 0, 0, 0.04)\",\n input: \"0 2px 8px rgba(0, 0, 0, 0.08)\",\n inputFocus: \"0 4px 16px rgba(0, 0, 0, 0.12)\",\n button: \"0 1px 3px rgba(0, 0, 0, 0.08)\",\n buttonHover: \"0 2px 6px rgba(0, 0, 0, 0.12)\",\n primary: \"0 2px 6px rgba(16, 105, 151, 0.3)\",\n primaryHover: \"0 4px 12px rgba(16, 105, 151, 0.4)\",\n },\n\n animations: {\n messageEntrance: {\n initial: { opacity: 0, y: 8 },\n animate: { opacity: 1, y: 0 },\n transition: { duration: 0.3, ease: [0.4, 0, 0.2, 1] },\n },\n fadeIn: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n transition: { duration: 0.2 },\n },\n },\n} as const;\n\nexport type ChatTokens = typeof chatTokens;\n"]}
1
+ {"version":3,"sources":["../src/utils/format-date.ts"],"names":["TIME_FORMAT","DATE_FORMAT","FULL_FORMAT","formatM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A,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-DrnCgnnh.js';
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.
@@ -75,8 +75,11 @@ interface ChatMessage extends MessageData {
75
75
  reasoning?: StreamingChunk[];
76
76
  citations?: SourceReference[];
77
77
  pendingClarification?: ClarificationData;
78
+ pendingToolApproval?: ToolApprovalData;
78
79
  /** Inline media (images/videos) to render within message content */
79
80
  medias?: MediaChunkData[];
81
+ /** Downloadable artifacts (PDFs, HTMLs) produced by tool calls in this message */
82
+ artifacts?: ArtifactChunkData[];
80
83
  /** Wall-clock execution time in seconds (persisted after streaming completes) */
81
84
  executionTime?: number;
82
85
  }
@@ -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-B6YLvJt3.js';
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 { d as SuggestedAction } from '../message-BnGtSz1P.js';
5
- import '../streaming-DrnCgnnh.js';
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
  */
@@ -164,6 +164,14 @@ interface ClarificationData {
164
164
  subtaskDescription?: string;
165
165
  subagentName?: string;
166
166
  subagentRole?: string;
167
+ toolCallId?: string;
168
+ }
169
+ interface ToolApprovalData {
170
+ toolName: string;
171
+ toolDescription: string;
172
+ toolInputs: Record<string, unknown>;
173
+ toolSchema?: Record<string, unknown>;
174
+ toolCallId?: string;
167
175
  }
168
176
  type VisualizationType = "chart" | "table" | "card" | "kpi" | "code_preview" | "form";
169
177
  type ChartDataType = "line" | "bar" | "pie" | "area" | "scatter" | "composed";
@@ -190,7 +198,7 @@ interface ChartVisualizationData {
190
198
  xAxis?: ChartAxis;
191
199
  yAxis?: ChartAxis;
192
200
  }
193
- type TableColumnType = "string" | "number" | "currency" | "date" | "badge" | "link" | "boolean" | "progress";
201
+ type TableColumnType = "string" | "number" | "currency" | "date" | "badge" | "link" | "boolean" | "progress" | "media";
194
202
  interface TableColumn {
195
203
  key: string;
196
204
  label: string;
@@ -226,7 +234,7 @@ interface KpiMetric {
226
234
  value: string | number;
227
235
  unit?: string;
228
236
  trend?: "up" | "down" | "neutral";
229
- change?: string;
237
+ change?: string | number;
230
238
  changeLabel?: string;
231
239
  sparkline?: number[];
232
240
  color?: string;
@@ -311,6 +319,37 @@ interface MediaChunkData {
311
319
  toolName?: string;
312
320
  };
313
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
+ }
314
353
  /**
315
354
  * Extended streaming chunk with full agentic support
316
355
  */
@@ -352,8 +391,10 @@ interface StreamingChunk {
352
391
  webOperationData?: WebOperationChunkData;
353
392
  claudeToolData?: ClaudeToolChunkData;
354
393
  clarificationData?: ClarificationData;
394
+ toolApprovalData?: ToolApprovalData;
355
395
  visualizationData?: VisualizationChunkData;
356
396
  mediaData?: MediaChunkData;
397
+ artifactData?: ArtifactChunkData;
357
398
  toolUseId?: string;
358
399
  }
359
400
  /**
@@ -372,8 +413,10 @@ interface StreamingMessage {
372
413
  suggestedActions?: FollowupAction[];
373
414
  activeSubagents?: Map<string, SubagentChunkData>;
374
415
  pendingClarification?: ClarificationData;
416
+ pendingToolApproval?: ToolApprovalData;
375
417
  visualizations?: VisualizationChunkData[];
376
418
  medias?: MediaChunkData[];
419
+ artifacts?: ArtifactChunkData[];
377
420
  }
378
421
  /**
379
422
  * Follow-up action suggested by AI
@@ -435,4 +478,4 @@ type VisualizationActionEvent = {
435
478
  action: string;
436
479
  };
437
480
 
438
- export type { VisualizationType as A, WebOperationChunkData as B, ClarificationData as C, Event as E, FormVisualizationData as F, KpiVisualizationData as K, MediaChunkData as M, ObservationEvent as O, PlanData as P, StreamingChunk as S, TableVisualizationData 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, CardVisualizationData as g, CodePreviewVisualizationData as h, EventStatus as i, ChunkType as j, ClaudeToolChunkData as k, EventType as l, FileOperationChunkData as m, FollowupAction as n, ParallelSubtaskData as o, PlanningEvent as p, ProgressData as q, SearchResultsChunkData as r, StreamingMessage as s, SubTaskData as t, SubagentChunkData as u, SubagentInfo as v, SubtaskEvent as w, TerminalChunkData as x, ThinkingEvent as y, ToolEvent as z };
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 };
@@ -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-88hzx0rD.js';
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 } from '../message-BnGtSz1P.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-BnGtSz1P.js';
6
- import { S as StreamingChunk, P as PlanData, C as ClarificationData, V as VisualizationChunkData, d as VisualizationActionEvent, e as ChartVisualizationData, f as VisualizationConfig, T as TableVisualizationData, g as CardVisualizationData, K as KpiVisualizationData, h as CodePreviewVisualizationData, F as FormVisualizationData, E as Event, i as EventStatus } from '../streaming-DrnCgnnh.js';
7
- export { j as ChunkType, k as ClaudeToolChunkData, l as EventType, m as FileOperationChunkData, n as FollowupAction, M as MediaChunkData, O as ObservationEvent, o as ParallelSubtaskData, p as PlanningEvent, q as ProgressData, r as SearchResultsChunkData, s as StreamingMessage, t as SubTaskData, u as SubagentChunkData, v as SubagentInfo, w as SubtaskEvent, x as TerminalChunkData, y as ThinkingEvent, z as ToolEvent, A as VisualizationType, W as WaveData, B as WebOperationChunkData } from '../streaming-DrnCgnnh.js';
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-B6YLvJt3.js';
11
+ export { u as useComposer, g as useMessage } from '../avatar-C13xc3tA.js';
12
12
 
13
13
  interface LoadingDotsProps {
14
14
  /** Size variant */
@@ -115,6 +115,20 @@ 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;
@@ -123,7 +137,7 @@ interface CitationSourcesProps {
123
137
  * Renders citation sources as a horizontal row of clickable chips.
124
138
  * Clicking a chip opens a modal showing full source content.
125
139
  */
126
- declare function CitationSources({ sources, className }: CitationSourcesProps): react_jsx_runtime.JSX.Element | null;
140
+ declare function CitationSources({ sources, className, }: CitationSourcesProps): react_jsx_runtime.JSX.Element | null;
127
141
  interface SourceDetailModalProps {
128
142
  source: SourceReference | null;
129
143
  onClose: () => void;
@@ -187,99 +201,100 @@ declare const chartVisualizationSchema: z.ZodObject<{
187
201
  name: z.ZodString;
188
202
  value: z.ZodNumber;
189
203
  }, z.core.$strip>]>>;
190
- color: z.ZodOptional<z.ZodString>;
204
+ color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
205
  }, z.core.$strip>>;
192
- xAxis: z.ZodOptional<z.ZodObject<{
193
- label: z.ZodOptional<z.ZodString>;
194
- type: z.ZodOptional<z.ZodEnum<{
206
+ xAxis: z.ZodOptional<z.ZodNullable<z.ZodObject<{
207
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
208
+ type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
195
209
  number: "number";
196
210
  category: "category";
197
211
  time: "time";
198
- }>>;
199
- min: z.ZodOptional<z.ZodNumber>;
200
- max: z.ZodOptional<z.ZodNumber>;
201
- }, z.core.$strip>>;
202
- yAxis: z.ZodOptional<z.ZodObject<{
203
- label: z.ZodOptional<z.ZodString>;
204
- type: z.ZodOptional<z.ZodEnum<{
212
+ }>>>;
213
+ min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
214
+ max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
215
+ }, z.core.$strip>>>;
216
+ yAxis: z.ZodOptional<z.ZodNullable<z.ZodObject<{
217
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
+ type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
205
219
  number: "number";
206
220
  category: "category";
207
221
  time: "time";
208
- }>>;
209
- min: z.ZodOptional<z.ZodNumber>;
210
- max: z.ZodOptional<z.ZodNumber>;
211
- }, z.core.$strip>>;
222
+ }>>>;
223
+ min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
224
+ max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
225
+ }, z.core.$strip>>>;
212
226
  }, z.core.$strip>;
213
227
  declare const tableVisualizationSchema: z.ZodObject<{
214
228
  columns: z.ZodArray<z.ZodObject<{
215
229
  key: z.ZodString;
216
230
  label: z.ZodString;
217
- type: z.ZodOptional<z.ZodEnum<{
231
+ type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
218
232
  string: "string";
219
233
  number: "number";
220
234
  boolean: "boolean";
221
235
  progress: "progress";
236
+ media: "media";
222
237
  currency: "currency";
223
238
  date: "date";
224
239
  badge: "badge";
225
240
  link: "link";
226
- }>>;
227
- align: z.ZodOptional<z.ZodEnum<{
241
+ }>>>;
242
+ align: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
228
243
  left: "left";
229
244
  center: "center";
230
245
  right: "right";
231
- }>>;
232
- width: z.ZodOptional<z.ZodString>;
246
+ }>>>;
247
+ width: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
248
  }, z.core.$strip>>;
234
249
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
235
250
  }, z.core.$strip>;
236
251
  declare const cardVisualizationSchema: z.ZodObject<{
237
- subtitle: z.ZodOptional<z.ZodString>;
238
- imageUrl: z.ZodOptional<z.ZodString>;
252
+ subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
239
254
  sections: z.ZodArray<z.ZodObject<{
240
- title: z.ZodOptional<z.ZodString>;
241
- items: z.ZodOptional<z.ZodArray<z.ZodObject<{
255
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
+ items: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
242
257
  label: z.ZodString;
243
258
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
244
- }, z.core.$strip>>>;
245
- content: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>>>>;
260
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
261
  }, z.core.$strip>>;
247
- actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
262
+ actions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
248
263
  label: z.ZodString;
249
264
  action: z.ZodString;
250
- variant: z.ZodOptional<z.ZodEnum<{
265
+ variant: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
251
266
  primary: "primary";
252
267
  secondary: "secondary";
253
268
  text: "text";
254
- }>>;
255
- }, z.core.$strip>>>;
269
+ }>>>;
270
+ }, z.core.$strip>>>>;
256
271
  }, z.core.$strip>;
257
272
  declare const kpiVisualizationSchema: z.ZodObject<{
258
273
  metrics: z.ZodArray<z.ZodObject<{
259
274
  label: z.ZodString;
260
275
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
261
- unit: z.ZodOptional<z.ZodString>;
262
- trend: z.ZodOptional<z.ZodEnum<{
276
+ unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
+ trend: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
263
278
  up: "up";
264
279
  down: "down";
265
280
  neutral: "neutral";
266
- }>>;
267
- change: z.ZodOptional<z.ZodString>;
268
- changeLabel: z.ZodOptional<z.ZodString>;
269
- sparkline: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
270
- color: z.ZodOptional<z.ZodString>;
281
+ }>>>;
282
+ change: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
283
+ changeLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ sparkline: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
285
+ color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
286
  }, z.core.$strip>>;
272
- layout: z.ZodOptional<z.ZodEnum<{
287
+ layout: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
273
288
  row: "row";
274
289
  grid: "grid";
275
- }>>;
290
+ }>>>;
276
291
  }, z.core.$strip>;
277
292
  declare const codePreviewVisualizationSchema: z.ZodObject<{
278
293
  code: z.ZodString;
279
294
  language: z.ZodString;
280
- lineNumbers: z.ZodOptional<z.ZodBoolean>;
281
- highlightLines: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
282
- startLine: z.ZodOptional<z.ZodNumber>;
295
+ lineNumbers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
296
+ highlightLines: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
297
+ startLine: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
283
298
  }, z.core.$strip>;
284
299
  declare const formVisualizationSchema: z.ZodObject<{
285
300
  fields: z.ZodArray<z.ZodObject<{
@@ -297,29 +312,31 @@ declare const formVisualizationSchema: z.ZodObject<{
297
312
  datetime: "datetime";
298
313
  }>;
299
314
  label: z.ZodString;
300
- required: z.ZodOptional<z.ZodBoolean>;
301
- placeholder: z.ZodOptional<z.ZodString>;
302
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
315
+ required: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
316
+ placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
+ options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
303
318
  value: z.ZodString;
304
319
  label: z.ZodString;
320
+ }, z.core.$strip>>>>;
321
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
322
+ validation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
323
+ min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
324
+ max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
325
+ pattern: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
+ message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
327
  }, z.core.$strip>>>;
306
- defaultValue: z.ZodOptional<z.ZodUnknown>;
307
- validation: z.ZodOptional<z.ZodObject<{
308
- min: z.ZodOptional<z.ZodNumber>;
309
- max: z.ZodOptional<z.ZodNumber>;
310
- pattern: z.ZodOptional<z.ZodString>;
311
- message: z.ZodOptional<z.ZodString>;
312
- }, z.core.$strip>>;
313
328
  }, z.core.$strip>>;
314
- submitAction: z.ZodOptional<z.ZodString>;
329
+ submitAction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
330
  }, z.core.$strip>;
316
331
 
317
332
  interface VisualizationRendererProps {
318
333
  data: VisualizationChunkData;
319
334
  isStreaming?: boolean;
320
335
  onAction?: (event: VisualizationActionEvent) => void;
336
+ /** Message-level media bag used to resolve `media_ref:<id>` cell values. */
337
+ medias?: MediaChunkData[];
321
338
  }
322
- 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;
323
340
 
324
341
  interface ChartVisualizationProps {
325
342
  data: ChartVisualizationData;
@@ -332,8 +349,10 @@ interface TableVisualizationProps {
332
349
  data: TableVisualizationData;
333
350
  config?: VisualizationConfig;
334
351
  isStreaming?: boolean;
352
+ /** Message-level media bag used to resolve `media_ref:<id>` cell values. */
353
+ medias?: MediaChunkData[];
335
354
  }
336
- declare function TableVisualization({ data, config }: TableVisualizationProps): react_jsx_runtime.JSX.Element;
355
+ declare function TableVisualization({ data, config, medias }: TableVisualizationProps): react_jsx_runtime.JSX.Element;
337
356
 
338
357
  interface CardVisualizationProps {
339
358
  data: CardVisualizationData;
@@ -371,6 +390,7 @@ interface VisualizationEntry {
371
390
  config?: VisualizationConfig;
372
391
  isStreaming?: boolean;
373
392
  onAction?: (event: VisualizationActionEvent) => void;
393
+ medias?: MediaChunkData[];
374
394
  }>;
375
395
  schema?: ZodSchema;
376
396
  }
@@ -388,6 +408,62 @@ declare function getVisualization(type: string): VisualizationEntry | undefined;
388
408
  */
389
409
  declare function getRegisteredTypes(): string[];
390
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
+
391
467
  interface EventContentProps {
392
468
  event: Event;
393
469
  className?: string;
@@ -474,4 +550,4 @@ interface TimelineItemProps {
474
550
  */
475
551
  declare function TimelineItem({ status, isLast, badgeSize, children, className, }: TimelineItemProps): react_jsx_runtime.JSX.Element;
476
552
 
477
- 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 };
@@ -1,2 +1,2 @@
1
- export{b as AttachmentPreview,c as Avatar,F as CardVisualization,D as ChartVisualization,d as ChatContainer,_ as ChatHeader,aa as ChatLayout,g as CitationSources,j as ClarificationPanel,u as ClaudeToolPreview,H as CodePreviewVisualization,p as EventContent,s as EventTimeline,w as FileOperationPreview,I as FormVisualization,i as InlineCitation,G as KpiVisualization,e as LoadingDots,f as MarkdownContent,U as Message,k as MessageActionBar,l as MessageAttachments,V as MessageComposer,X as MessageList,t as PlanTimeline,A as ReasoningPanel,W as ScrollToBottomButton,x as SearchResultsView,h as SourceDetailModal,m as StatusBadge,B as StreamingText,z as SubagentPanel,C as SuggestedActions,E as TableVisualization,v as TerminalOutput,Y as TimeMarker,n as Timeline,o as TimelineItem,$ as ToolStatusIndicator,Z as TypingIndicator,S as VisualizationRenderer,y as WebOperationPreview,ba as WelcomeScreen,O as cardVisualizationSchema,M as chartVisualizationSchema,Q as codePreviewVisualizationSchema,q as convertChunkToEvent,r as convertTimelineToEvents,R as formVisualizationSchema,L as getRegisteredTypes,K as getVisualization,P as kpiVisualizationSchema,J as registerVisualization,N as tableVisualizationSchema}from'../chunk-RZNLGXIW.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';//# sourceMappingURL=index.js.map
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