@miiflow/assistant-ui 0.5.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{WelcomeScreen-D32Tsu6G.d.ts → WelcomeScreen-CVxniqqK.d.ts} +39 -9
  2. package/dist/{avatar-CAmTN1L7.d.ts → avatar-DnLePg72.d.ts} +2 -2
  3. package/dist/branding-NieTEGQf.d.ts +32 -0
  4. package/dist/chunk-ERJKVQQT.js +132 -0
  5. package/dist/chunk-ERJKVQQT.js.map +1 -0
  6. package/dist/chunk-IUCKTDTZ.js +2 -0
  7. package/dist/chunk-IUCKTDTZ.js.map +1 -0
  8. package/dist/chunk-NG4HKXYB.js +2 -0
  9. package/dist/chunk-NG4HKXYB.js.map +1 -0
  10. package/dist/chunk-NKLA5PPB.js +2 -0
  11. package/dist/chunk-NKLA5PPB.js.map +1 -0
  12. package/dist/chunk-QECTWT2H.js +2 -0
  13. package/dist/chunk-QECTWT2H.js.map +1 -0
  14. package/dist/client/index.d.ts +68 -4
  15. package/dist/client/index.js +7 -5
  16. package/dist/client/index.js.map +1 -1
  17. package/dist/composer/index.d.ts +180 -0
  18. package/dist/composer/index.js +2 -0
  19. package/dist/composer/index.js.map +1 -0
  20. package/dist/context/index.d.ts +16 -3
  21. package/dist/context/index.js +1 -1
  22. package/dist/hooks/index.d.ts +2 -2
  23. package/dist/hooks/index.js +1 -1
  24. package/dist/index.d.ts +18 -6
  25. package/dist/index.js +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/{message-D3D59U_Q.d.ts → message-D2ElX5k7.d.ts} +5 -4
  28. package/dist/primitives/index.d.ts +3 -3
  29. package/dist/{streaming-Q8hp5ev4.d.ts → streaming-B_u_jno6.d.ts} +77 -124
  30. package/dist/styled/index.d.ts +246 -73
  31. package/dist/styled/index.js +1 -1
  32. package/dist/styles-no-preflight.css +1 -1
  33. package/dist/styles.css +1 -1
  34. package/dist/types-DeHbndy0.d.ts +48 -0
  35. package/package.json +20 -3
  36. package/dist/branding-SzYU4ncD.d.ts +0 -18
  37. package/dist/chunk-NSTK5EUQ.js +0 -2
  38. package/dist/chunk-NSTK5EUQ.js.map +0 -1
  39. package/dist/chunk-OCKHJ4WO.js +0 -2
  40. package/dist/chunk-OCKHJ4WO.js.map +0 -1
  41. package/dist/chunk-VDFIXLNO.js +0 -20
  42. package/dist/chunk-VDFIXLNO.js.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
- import { A as Attachment, M as MessageData, P as ParticipantRole, e as SuggestedAction, S as SourceReference, a as MemoryFeedbackType } from './message-D3D59U_Q.js';
4
- import { h as AvatarProps$1 } from './avatar-CAmTN1L7.js';
5
- import { S as StreamingChunk, V as VisualizationChunkData, M as MediaChunkData, C as ClarificationData } from './streaming-Q8hp5ev4.js';
3
+ import { A as Attachment, M as MessageData, b as ParticipantRole, d as SuggestedAction, S as SourceReference } from './message-D2ElX5k7.js';
4
+ import { a as AvatarProps$1 } from './avatar-DnLePg72.js';
5
+ import { k as StreamingChunk, u as VisualizationChunkData, M as MediaChunkData, A as ArtifactChunkData, d as ClarificationData, s as ToolApprovalData } from './streaming-B_u_jno6.js';
6
+ import { c as CommandProvider } from './types-DeHbndy0.js';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
 
8
9
  interface AttachmentPreviewProps {
@@ -88,6 +89,10 @@ interface MessageProps {
88
89
  visualizations?: VisualizationChunkData[];
89
90
  /** Inline media (images/videos) to render within message content */
90
91
  medias?: MediaChunkData[];
92
+ /** Inline downloadable artifacts (PDFs, HTMLs, ...) */
93
+ artifacts?: ArtifactChunkData[];
94
+ /** Callback when a user clicks an artifact inline card */
95
+ onArtifactOpen?: (artifact: ArtifactChunkData) => void;
91
96
  /** Base font size multiplier for markdown rendering */
92
97
  baselineFontSize?: number;
93
98
  /** Total execution time in seconds (persisted from streaming wall-clock) */
@@ -96,10 +101,19 @@ interface MessageProps {
96
101
  pendingClarification?: ClarificationData;
97
102
  /** Callback when user responds to a clarification */
98
103
  onClarificationSubmit?: (response: string) => void;
99
- /** Callback when user gives feedback on a memory citation */
100
- onMemoryFeedback?: (semanticAtomId: string, feedback: MemoryFeedbackType) => void;
101
- /** Current feedback state for memory citations (atomId -> feedback) */
102
- memoryFeedbackState?: Record<string, MemoryFeedbackType>;
104
+ /** Pending tool approval data (tool requires user approval) */
105
+ pendingToolApproval?: ToolApprovalData;
106
+ /** Callback when user approves a tool execution */
107
+ onToolApprove?: (modifiedInputs: Record<string, unknown>) => void;
108
+ /** Callback when user rejects a tool execution */
109
+ onToolReject?: (reason?: string) => void;
110
+ /** Render function for inline suggested action cards (from [SA:id] markers) */
111
+ renderInlineSuggestedAction?: (id: string) => React.ReactNode;
112
+ /** Report this assistant response as incorrect. Receives an optional reason
113
+ * string (category + free-text details) for the learner pipeline. */
114
+ onReportIncorrect?: (reason?: string) => void;
115
+ /** Confirm this assistant response was correct/helpful */
116
+ onConfirmCorrect?: () => void;
103
117
  }
104
118
  /**
105
119
  * Styled Message component with grid layout matching the main app.
@@ -137,6 +151,11 @@ interface MessageComposerProps {
137
151
  isStreaming?: boolean;
138
152
  /** Callback to stop the current streaming response */
139
153
  onStopStreaming?: () => void;
154
+ /** Optional slash-command typeahead provider (e.g. for skill picker). */
155
+ commandProvider?: CommandProvider | null;
156
+ /** Multiple typeahead providers for distinct triggers (e.g. `/` skills +
157
+ * modes plus `@` ad accounts). Takes precedence over `commandProvider`. */
158
+ commandProviders?: CommandProvider[];
140
159
  }
141
160
  /**
142
161
  * MessageComposer with textarea, attachment support,
@@ -216,6 +235,12 @@ interface MessageActionBarProps {
216
235
  onRegenerate?: () => void;
217
236
  /** Optional callback when edit is requested */
218
237
  onEdit?: () => void;
238
+ /** Report this response as incorrect (fires mistake-recording pipeline). Reason
239
+ * combines an optional category chip + free-text details, formatted as
240
+ * "{category}: {details}" | "{category}" | "{details}" | "". */
241
+ onReportIncorrect?: (reason?: string) => void;
242
+ /** Confirm this response was helpful / correct */
243
+ onConfirmCorrect?: () => void;
219
244
  /** Additional CSS classes */
220
245
  className?: string;
221
246
  }
@@ -223,7 +248,7 @@ interface MessageActionBarProps {
223
248
  * Action bar that appears on hover below assistant message bubbles.
224
249
  * Currently implements Copy; onRegenerate and onEdit are reserved for future use.
225
250
  */
226
- declare function MessageActionBar({ textContent, onRegenerate, onEdit, className, }: MessageActionBarProps): react_jsx_runtime.JSX.Element;
251
+ declare function MessageActionBar({ textContent, onRegenerate, onEdit, onReportIncorrect, onConfirmCorrect, className, }: MessageActionBarProps): react_jsx_runtime.JSX.Element;
227
252
 
228
253
  interface ScrollToBottomButtonProps {
229
254
  /** Whether the viewport is at the bottom (hides button when true) */
@@ -298,6 +323,11 @@ interface WelcomeScreenProps {
298
323
  supportsAttachments?: boolean;
299
324
  /** Override the default plain-text input with a custom composer (e.g. chat-ui MessageComposer) */
300
325
  composerSlot?: ReactNode;
326
+ /** Optional slash-command typeahead provider (e.g. for skill picker). */
327
+ commandProvider?: CommandProvider | null;
328
+ /** Multiple typeahead providers for distinct triggers (e.g. `/` skills +
329
+ * modes plus `@` ad accounts). Takes precedence over `commandProvider`. */
330
+ commandProviders?: CommandProvider[];
301
331
  /** Additional CSS classes for the outer wrapper */
302
332
  className?: string;
303
333
  /** Assistant avatar image URL — when provided, welcome text renders in message format */
@@ -314,4 +344,4 @@ interface WelcomeScreenProps {
314
344
  */
315
345
  declare const WelcomeScreen: react.ForwardRefExoticComponent<WelcomeScreenProps & react.RefAttributes<HTMLDivElement>>;
316
346
 
317
- export { AttachmentPreview as A, ChatContainer as C, MarkdownContent as M, ScrollToBottomButton as S, ToolStatusIndicator as T, WelcomeScreen as W, Avatar as a, ChatLayout as b, Message as c, MessageActionBar as d, MessageComposer as e, MessageList as f, StreamingText as g, SuggestedActions as h, TypingIndicator as i, type AttachmentPreviewProps as j, type AvatarProps as k, type ChatContainerProps as l, type ChatLayoutProps as m, type MarkdownContentProps as n, type MessageActionBarProps as o, type MessageComposerProps as p, type MessageListProps as q, type MessageProps as r, type ScrollToBottomButtonProps as s, type StreamingTextProps as t, type SuggestedActionsProps as u, type ToolStatus as v, type ToolStatusIndicatorProps as w, type TypingIndicatorProps as x, type WelcomeScreenProps as y };
347
+ export { AttachmentPreview as A, ChatContainer as C, MarkdownContent as M, ScrollToBottomButton as S, type ToolStatus as T, WelcomeScreen as W, type AttachmentPreviewProps as a, Avatar as b, type AvatarProps as c, type ChatContainerProps as d, ChatLayout as e, type ChatLayoutProps as f, type MarkdownContentProps as g, Message as h, MessageActionBar as i, type MessageActionBarProps as j, MessageComposer as k, type MessageComposerProps as l, MessageList as m, type MessageListProps as n, type MessageProps as o, type ScrollToBottomButtonProps as p, StreamingText as q, type StreamingTextProps as r, SuggestedActions as s, type SuggestedActionsProps as t, ToolStatusIndicator as u, type ToolStatusIndicatorProps as v, TypingIndicator as w, type TypingIndicatorProps as x, type WelcomeScreenProps as y };
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, TextareaHTMLAttributes, ButtonHTMLAttributes } from 'react';
3
- import { M as MessageData, P as ParticipantRole } from './message-D3D59U_Q.js';
3
+ import { M as MessageData, b as ParticipantRole } from './message-D2ElX5k7.js';
4
4
 
5
5
  interface MessageContextValue {
6
6
  message: MessageData;
@@ -106,4 +106,4 @@ interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
106
106
  */
107
107
  declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
108
108
 
109
- export { Avatar as A, ComposerContext as C, MessageComposer as M, ComposerInput as a, ComposerSubmit as b, MessageContent as c, MessageContext as d, Message as e, MessageTimestamp as f, useMessage as g, type AvatarProps as h, type ComposerInputProps as i, type ComposerSubmitProps as j, type MessageComposerProps as k, type MessageContentProps as l, type MessageProps as m, type MessageTimestampProps as n, useComposer as u };
109
+ export { Avatar as A, ComposerContext as C, Message as M, type AvatarProps as a, ComposerInput as b, type ComposerInputProps as c, ComposerSubmit as d, type ComposerSubmitProps as e, MessageComposer as f, type MessageComposerProps as g, MessageContent as h, type MessageContentProps as i, MessageContext as j, type MessageProps as k, MessageTimestamp as l, type MessageTimestampProps as m, useMessage as n, useComposer as u };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Branding types for theming chat UI components.
3
+ */
4
+ interface BrandingData {
5
+ customName?: string;
6
+ messageFontSize?: number;
7
+ fontFamily?: string;
8
+ welcomeMessage?: string;
9
+ chatboxPlaceholder?: string;
10
+ backgroundBubbleColor?: string;
11
+ headerBackgroundColor?: string;
12
+ showHeader?: boolean;
13
+ rotatingPlaceholders?: string[];
14
+ presetQuestions?: string[];
15
+ chatbotLogo?: string;
16
+ assistantAvatar?: string;
17
+ approvalAccentColor?: string;
18
+ approveButtonColor?: string;
19
+ approveButtonHoverColor?: string;
20
+ rejectButtonHoverColor?: string;
21
+ clarificationAccentColor?: string;
22
+ /**
23
+ * Accent color used for in-progress / live indicators in the reasoning
24
+ * panel: the running-state halo, animated caret, header wave, rail-flow
25
+ * gradient, and active-row wash. Defaults to `backgroundBubbleColor`
26
+ * (i.e. `--chat-primary`); set this independently when the brand
27
+ * primary is neutral, so activity stays distinguishable.
28
+ */
29
+ activityAccentColor?: string;
30
+ }
31
+
32
+ export type { BrandingData as B };