@runtypelabs/persona 3.9.2 → 3.10.1

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 (39) hide show
  1. package/dist/index.cjs +45 -42
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +148 -0
  4. package/dist/index.d.ts +148 -0
  5. package/dist/index.global.js +67 -64
  6. package/dist/index.global.js.map +1 -1
  7. package/dist/index.js +45 -42
  8. package/dist/index.js.map +1 -1
  9. package/dist/theme-editor.cjs +959 -214
  10. package/dist/theme-editor.d.cts +157 -3
  11. package/dist/theme-editor.d.ts +157 -3
  12. package/dist/theme-editor.js +955 -214
  13. package/dist/theme-reference.cjs +1 -1
  14. package/dist/theme-reference.d.cts +8 -0
  15. package/dist/theme-reference.d.ts +8 -0
  16. package/dist/theme-reference.js +1 -1
  17. package/dist/widget.css +154 -0
  18. package/package.json +1 -1
  19. package/src/client.test.ts +312 -1
  20. package/src/client.ts +247 -24
  21. package/src/components/messages.ts +1 -1
  22. package/src/components/reasoning-bubble.ts +117 -28
  23. package/src/components/tool-bubble.ts +161 -27
  24. package/src/defaults.ts +12 -0
  25. package/src/styles/widget.css +154 -0
  26. package/src/theme-editor/index.ts +5 -0
  27. package/src/theme-editor/preview-utils.test.ts +58 -0
  28. package/src/theme-editor/preview-utils.ts +220 -4
  29. package/src/theme-editor/sections.test.ts +20 -0
  30. package/src/theme-editor/sections.ts +10 -0
  31. package/src/theme-reference.ts +8 -3
  32. package/src/tool-call-display-defaults.test.ts +23 -0
  33. package/src/types.ts +155 -0
  34. package/src/ui.attachments-drop.test.ts +188 -0
  35. package/src/ui.scroll.test.ts +150 -0
  36. package/src/ui.tool-display.test.ts +204 -0
  37. package/src/ui.ts +275 -7
  38. package/src/utils/message-fingerprint.test.ts +17 -0
  39. package/src/utils/message-fingerprint.ts +13 -1
@@ -1125,12 +1125,71 @@ type AgentWidgetScrollToBottomFeature = {
1125
1125
  */
1126
1126
  label?: string;
1127
1127
  };
1128
+ type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1129
+ type AgentWidgetToolCallDisplayFeature = {
1130
+ /**
1131
+ * Controls what collapsed tool call rows show in their header/summary area.
1132
+ * @default "tool-call"
1133
+ */
1134
+ collapsedMode?: AgentWidgetToolCallCollapsedMode;
1135
+ /**
1136
+ * When true, active collapsed tool calls can render a lightweight preview block.
1137
+ * @default false
1138
+ */
1139
+ activePreview?: boolean;
1140
+ /**
1141
+ * Optional CSS min-height applied to active collapsed tool call rows.
1142
+ */
1143
+ activeMinHeight?: string;
1144
+ /**
1145
+ * Maximum preview lines shown for collapsed active tool calls.
1146
+ * @default 3
1147
+ */
1148
+ previewMaxLines?: number;
1149
+ /**
1150
+ * When true, consecutive tool call rows can be visually grouped.
1151
+ * @default false
1152
+ */
1153
+ grouped?: boolean;
1154
+ /**
1155
+ * When false, tool call bubbles show only the collapsed summary with no
1156
+ * expand/collapse toggle. Users see tool awareness without full details.
1157
+ * @default true
1158
+ */
1159
+ expandable?: boolean;
1160
+ };
1161
+ type AgentWidgetReasoningDisplayFeature = {
1162
+ /**
1163
+ * When true, active collapsed reasoning rows can render a lightweight preview block.
1164
+ * @default false
1165
+ */
1166
+ activePreview?: boolean;
1167
+ /**
1168
+ * Optional CSS min-height applied to active collapsed reasoning rows.
1169
+ */
1170
+ activeMinHeight?: string;
1171
+ /**
1172
+ * Maximum preview lines shown for collapsed active reasoning rows.
1173
+ * @default 3
1174
+ */
1175
+ previewMaxLines?: number;
1176
+ /**
1177
+ * When false, reasoning bubbles show only the collapsed summary with no
1178
+ * expand/collapse toggle. Users see reasoning awareness without full details.
1179
+ * @default true
1180
+ */
1181
+ expandable?: boolean;
1182
+ };
1128
1183
  type AgentWidgetFeatureFlags = {
1129
1184
  showReasoning?: boolean;
1130
1185
  showToolCalls?: boolean;
1131
1186
  showEventStreamToggle?: boolean;
1132
1187
  /** Shared transcript + event stream scroll-to-bottom affordance. */
1133
1188
  scrollToBottom?: AgentWidgetScrollToBottomFeature;
1189
+ /** Collapsed transcript behavior for tool call rows. */
1190
+ toolCallDisplay?: AgentWidgetToolCallDisplayFeature;
1191
+ /** Collapsed transcript behavior for reasoning rows. */
1192
+ reasoningDisplay?: AgentWidgetReasoningDisplayFeature;
1134
1193
  /** Configuration for the Event Stream inspector view */
1135
1194
  eventStream?: EventStreamConfig;
1136
1195
  /** Optional artifact sidebar (split pane / mobile drawer) */
@@ -1630,6 +1689,65 @@ type AgentWidgetToolCallConfig$1 = {
1630
1689
  codeBlockTextColor?: string;
1631
1690
  toggleTextColor?: string;
1632
1691
  labelTextColor?: string;
1692
+ /**
1693
+ * Override the collapsed summary row content for a tool call bubble.
1694
+ * Return `null` to fall back to the built-in summary for the active display mode.
1695
+ */
1696
+ renderCollapsedSummary?: (context: {
1697
+ message: AgentWidgetMessage;
1698
+ toolCall: AgentWidgetToolCall;
1699
+ defaultSummary: string;
1700
+ previewText: string;
1701
+ collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
+ isActive: boolean;
1703
+ config: AgentWidgetConfig;
1704
+ }) => HTMLElement | string | null;
1705
+ /**
1706
+ * Override the lightweight collapsed preview content shown for active tool rows.
1707
+ * Return `null` to fall back to the built-in preview text.
1708
+ */
1709
+ renderCollapsedPreview?: (context: {
1710
+ message: AgentWidgetMessage;
1711
+ toolCall: AgentWidgetToolCall;
1712
+ defaultPreview: string;
1713
+ isActive: boolean;
1714
+ config: AgentWidgetConfig;
1715
+ }) => HTMLElement | string | null;
1716
+ /**
1717
+ * Override the summary content for grouped consecutive tool-call containers.
1718
+ * Return `null` to fall back to the built-in `Called [x] tools` summary.
1719
+ */
1720
+ renderGroupedSummary?: (context: {
1721
+ messages: AgentWidgetMessage[];
1722
+ toolCalls: AgentWidgetToolCall[];
1723
+ defaultSummary: string;
1724
+ config: AgentWidgetConfig;
1725
+ }) => HTMLElement | string | null;
1726
+ };
1727
+ type AgentWidgetReasoningConfig = {
1728
+ /**
1729
+ * Override the collapsed summary row content for a reasoning bubble.
1730
+ * Return `null` to fall back to the built-in summary.
1731
+ */
1732
+ renderCollapsedSummary?: (context: {
1733
+ message: AgentWidgetMessage;
1734
+ reasoning: AgentWidgetReasoning;
1735
+ defaultSummary: string;
1736
+ previewText: string;
1737
+ isActive: boolean;
1738
+ config: AgentWidgetConfig;
1739
+ }) => HTMLElement | string | null;
1740
+ /**
1741
+ * Override the lightweight collapsed preview content shown for active reasoning rows.
1742
+ * Return `null` to fall back to the built-in preview text.
1743
+ */
1744
+ renderCollapsedPreview?: (context: {
1745
+ message: AgentWidgetMessage;
1746
+ reasoning: AgentWidgetReasoning;
1747
+ defaultPreview: string;
1748
+ isActive: boolean;
1749
+ config: AgentWidgetConfig;
1750
+ }) => HTMLElement | string | null;
1633
1751
  };
1634
1752
  type AgentWidgetSuggestionChipsConfig = {
1635
1753
  fontFamily?: "sans-serif" | "serif" | "mono";
@@ -2294,6 +2412,35 @@ type AgentWidgetAttachmentsConfig = {
2294
2412
  * Callback when a file is rejected (wrong type or too large).
2295
2413
  */
2296
2414
  onFileRejected?: (file: File, reason: 'type' | 'size' | 'count') => void;
2415
+ /**
2416
+ * Customize the drag-and-drop overlay that appears when files are dragged over the widget.
2417
+ */
2418
+ dropOverlay?: {
2419
+ /** Background color/value of the overlay. @default 'rgba(59, 130, 246, 0.08)' */
2420
+ background?: string;
2421
+ /** Backdrop blur applied behind the overlay (CSS value). @default '8px' */
2422
+ backdropBlur?: string;
2423
+ /** Border style shown during drag. @default '2px dashed rgba(59, 130, 246, 0.4)' */
2424
+ border?: string;
2425
+ /** Border radius of the overlay. @default 'inherit' */
2426
+ borderRadius?: string;
2427
+ /** Inset/margin pulling the overlay away from the container edges (CSS value). @default '0' */
2428
+ inset?: string;
2429
+ /** Lucide icon name displayed in the center. @default 'upload' */
2430
+ iconName?: string;
2431
+ /** Icon size (CSS value). @default '48px' */
2432
+ iconSize?: string;
2433
+ /** Icon stroke color. @default 'rgba(59, 130, 246, 0.6)' */
2434
+ iconColor?: string;
2435
+ /** Icon stroke width. @default 0.5 */
2436
+ iconStrokeWidth?: number;
2437
+ /** Optional label text shown below the icon. */
2438
+ label?: string;
2439
+ /** Label font size. @default '0.875rem' */
2440
+ labelSize?: string;
2441
+ /** Label color. @default 'rgba(59, 130, 246, 0.8)' */
2442
+ labelColor?: string;
2443
+ };
2297
2444
  };
2298
2445
  /**
2299
2446
  * Configuration for persisting widget state across page navigations.
@@ -2685,6 +2832,7 @@ type AgentWidgetConfig = {
2685
2832
  */
2686
2833
  textToSpeech?: TextToSpeechConfig;
2687
2834
  toolCall?: AgentWidgetToolCallConfig$1;
2835
+ reasoning?: AgentWidgetReasoningConfig;
2688
2836
  /**
2689
2837
  * Configuration for tool approval bubbles.
2690
2838
  * Set to `false` to disable built-in approval handling entirely.
@@ -3750,16 +3898,22 @@ declare const MOCK_WORKSPACE_CONTENT = "\n <div class=\"preview-workspace-con
3750
3898
  */
3751
3899
  declare function buildSrcdoc(mountId: string, shellMode: 'light' | 'dark', docked: boolean, widgetCssPath: string): string;
3752
3900
  type PreviewScene = 'home' | 'conversation' | 'minimized' | 'artifact';
3753
- declare function createPreviewMessages(scene: PreviewScene): AgentWidgetMessage[];
3754
- declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene): AgentWidgetConfig;
3901
+ type PreviewTranscriptEntryPreset = 'user-message' | 'assistant-message' | 'reasoning-streaming' | 'reasoning-complete' | 'tool-running' | 'tool-complete';
3902
+ declare function getPreviewTranscriptPresetLabel(preset: PreviewTranscriptEntryPreset): string;
3903
+ declare function createPreviewTranscriptEntry(preset: PreviewTranscriptEntryPreset, index?: number): AgentWidgetMessage;
3904
+ declare function appendPreviewTranscriptEntry(messages: AgentWidgetMessage[], preset: PreviewTranscriptEntryPreset): AgentWidgetMessage[];
3905
+ declare function createPreviewMessages(scene: PreviewScene, config?: Partial<AgentWidgetConfig>, appendedMessages?: AgentWidgetMessage[]): AgentWidgetMessage[];
3906
+ declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene, appendedMessages?: AgentWidgetMessage[]): AgentWidgetConfig;
3755
3907
 
3756
3908
  interface PreviewConfigOptions {
3757
3909
  config?: Partial<AgentWidgetConfig>;
3758
3910
  theme?: DeepPartial<PersonaTheme>;
3759
3911
  darkTheme?: DeepPartial<PersonaTheme>;
3760
3912
  scene?: PreviewScene;
3913
+ appendedMessages?: AgentWidgetMessage[];
3761
3914
  }
3762
3915
  declare function buildPreviewConfig(options: PreviewConfigOptions, shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
3916
+ declare function buildPreviewConfigWithMessages(options: PreviewConfigOptions, messages: AgentWidgetMessage[], shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
3763
3917
 
3764
3918
  /**
3765
3919
  * Imperative preview renderer for the theme editor.
@@ -3924,4 +4078,4 @@ declare function paletteColorPath(family: string, shade: string): string;
3924
4078
  declare function resolveThemeColorPath(get: (path: string) => unknown, path: string, depth?: number): string;
3925
4079
  declare function tokenRefDisplayName(path: string): string;
3926
4080
 
3927
- export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, applySceneConfig, applyShellTheme, buildPreviewConfig, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
4081
+ export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, type PreviewTranscriptEntryPreset, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, appendPreviewTranscriptEntry, applySceneConfig, applyShellTheme, buildPreviewConfig, buildPreviewConfigWithMessages, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createPreviewTranscriptEntry, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getPreviewTranscriptPresetLabel, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
@@ -1125,12 +1125,71 @@ type AgentWidgetScrollToBottomFeature = {
1125
1125
  */
1126
1126
  label?: string;
1127
1127
  };
1128
+ type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1129
+ type AgentWidgetToolCallDisplayFeature = {
1130
+ /**
1131
+ * Controls what collapsed tool call rows show in their header/summary area.
1132
+ * @default "tool-call"
1133
+ */
1134
+ collapsedMode?: AgentWidgetToolCallCollapsedMode;
1135
+ /**
1136
+ * When true, active collapsed tool calls can render a lightweight preview block.
1137
+ * @default false
1138
+ */
1139
+ activePreview?: boolean;
1140
+ /**
1141
+ * Optional CSS min-height applied to active collapsed tool call rows.
1142
+ */
1143
+ activeMinHeight?: string;
1144
+ /**
1145
+ * Maximum preview lines shown for collapsed active tool calls.
1146
+ * @default 3
1147
+ */
1148
+ previewMaxLines?: number;
1149
+ /**
1150
+ * When true, consecutive tool call rows can be visually grouped.
1151
+ * @default false
1152
+ */
1153
+ grouped?: boolean;
1154
+ /**
1155
+ * When false, tool call bubbles show only the collapsed summary with no
1156
+ * expand/collapse toggle. Users see tool awareness without full details.
1157
+ * @default true
1158
+ */
1159
+ expandable?: boolean;
1160
+ };
1161
+ type AgentWidgetReasoningDisplayFeature = {
1162
+ /**
1163
+ * When true, active collapsed reasoning rows can render a lightweight preview block.
1164
+ * @default false
1165
+ */
1166
+ activePreview?: boolean;
1167
+ /**
1168
+ * Optional CSS min-height applied to active collapsed reasoning rows.
1169
+ */
1170
+ activeMinHeight?: string;
1171
+ /**
1172
+ * Maximum preview lines shown for collapsed active reasoning rows.
1173
+ * @default 3
1174
+ */
1175
+ previewMaxLines?: number;
1176
+ /**
1177
+ * When false, reasoning bubbles show only the collapsed summary with no
1178
+ * expand/collapse toggle. Users see reasoning awareness without full details.
1179
+ * @default true
1180
+ */
1181
+ expandable?: boolean;
1182
+ };
1128
1183
  type AgentWidgetFeatureFlags = {
1129
1184
  showReasoning?: boolean;
1130
1185
  showToolCalls?: boolean;
1131
1186
  showEventStreamToggle?: boolean;
1132
1187
  /** Shared transcript + event stream scroll-to-bottom affordance. */
1133
1188
  scrollToBottom?: AgentWidgetScrollToBottomFeature;
1189
+ /** Collapsed transcript behavior for tool call rows. */
1190
+ toolCallDisplay?: AgentWidgetToolCallDisplayFeature;
1191
+ /** Collapsed transcript behavior for reasoning rows. */
1192
+ reasoningDisplay?: AgentWidgetReasoningDisplayFeature;
1134
1193
  /** Configuration for the Event Stream inspector view */
1135
1194
  eventStream?: EventStreamConfig;
1136
1195
  /** Optional artifact sidebar (split pane / mobile drawer) */
@@ -1630,6 +1689,65 @@ type AgentWidgetToolCallConfig$1 = {
1630
1689
  codeBlockTextColor?: string;
1631
1690
  toggleTextColor?: string;
1632
1691
  labelTextColor?: string;
1692
+ /**
1693
+ * Override the collapsed summary row content for a tool call bubble.
1694
+ * Return `null` to fall back to the built-in summary for the active display mode.
1695
+ */
1696
+ renderCollapsedSummary?: (context: {
1697
+ message: AgentWidgetMessage;
1698
+ toolCall: AgentWidgetToolCall;
1699
+ defaultSummary: string;
1700
+ previewText: string;
1701
+ collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
+ isActive: boolean;
1703
+ config: AgentWidgetConfig;
1704
+ }) => HTMLElement | string | null;
1705
+ /**
1706
+ * Override the lightweight collapsed preview content shown for active tool rows.
1707
+ * Return `null` to fall back to the built-in preview text.
1708
+ */
1709
+ renderCollapsedPreview?: (context: {
1710
+ message: AgentWidgetMessage;
1711
+ toolCall: AgentWidgetToolCall;
1712
+ defaultPreview: string;
1713
+ isActive: boolean;
1714
+ config: AgentWidgetConfig;
1715
+ }) => HTMLElement | string | null;
1716
+ /**
1717
+ * Override the summary content for grouped consecutive tool-call containers.
1718
+ * Return `null` to fall back to the built-in `Called [x] tools` summary.
1719
+ */
1720
+ renderGroupedSummary?: (context: {
1721
+ messages: AgentWidgetMessage[];
1722
+ toolCalls: AgentWidgetToolCall[];
1723
+ defaultSummary: string;
1724
+ config: AgentWidgetConfig;
1725
+ }) => HTMLElement | string | null;
1726
+ };
1727
+ type AgentWidgetReasoningConfig = {
1728
+ /**
1729
+ * Override the collapsed summary row content for a reasoning bubble.
1730
+ * Return `null` to fall back to the built-in summary.
1731
+ */
1732
+ renderCollapsedSummary?: (context: {
1733
+ message: AgentWidgetMessage;
1734
+ reasoning: AgentWidgetReasoning;
1735
+ defaultSummary: string;
1736
+ previewText: string;
1737
+ isActive: boolean;
1738
+ config: AgentWidgetConfig;
1739
+ }) => HTMLElement | string | null;
1740
+ /**
1741
+ * Override the lightweight collapsed preview content shown for active reasoning rows.
1742
+ * Return `null` to fall back to the built-in preview text.
1743
+ */
1744
+ renderCollapsedPreview?: (context: {
1745
+ message: AgentWidgetMessage;
1746
+ reasoning: AgentWidgetReasoning;
1747
+ defaultPreview: string;
1748
+ isActive: boolean;
1749
+ config: AgentWidgetConfig;
1750
+ }) => HTMLElement | string | null;
1633
1751
  };
1634
1752
  type AgentWidgetSuggestionChipsConfig = {
1635
1753
  fontFamily?: "sans-serif" | "serif" | "mono";
@@ -2294,6 +2412,35 @@ type AgentWidgetAttachmentsConfig = {
2294
2412
  * Callback when a file is rejected (wrong type or too large).
2295
2413
  */
2296
2414
  onFileRejected?: (file: File, reason: 'type' | 'size' | 'count') => void;
2415
+ /**
2416
+ * Customize the drag-and-drop overlay that appears when files are dragged over the widget.
2417
+ */
2418
+ dropOverlay?: {
2419
+ /** Background color/value of the overlay. @default 'rgba(59, 130, 246, 0.08)' */
2420
+ background?: string;
2421
+ /** Backdrop blur applied behind the overlay (CSS value). @default '8px' */
2422
+ backdropBlur?: string;
2423
+ /** Border style shown during drag. @default '2px dashed rgba(59, 130, 246, 0.4)' */
2424
+ border?: string;
2425
+ /** Border radius of the overlay. @default 'inherit' */
2426
+ borderRadius?: string;
2427
+ /** Inset/margin pulling the overlay away from the container edges (CSS value). @default '0' */
2428
+ inset?: string;
2429
+ /** Lucide icon name displayed in the center. @default 'upload' */
2430
+ iconName?: string;
2431
+ /** Icon size (CSS value). @default '48px' */
2432
+ iconSize?: string;
2433
+ /** Icon stroke color. @default 'rgba(59, 130, 246, 0.6)' */
2434
+ iconColor?: string;
2435
+ /** Icon stroke width. @default 0.5 */
2436
+ iconStrokeWidth?: number;
2437
+ /** Optional label text shown below the icon. */
2438
+ label?: string;
2439
+ /** Label font size. @default '0.875rem' */
2440
+ labelSize?: string;
2441
+ /** Label color. @default 'rgba(59, 130, 246, 0.8)' */
2442
+ labelColor?: string;
2443
+ };
2297
2444
  };
2298
2445
  /**
2299
2446
  * Configuration for persisting widget state across page navigations.
@@ -2685,6 +2832,7 @@ type AgentWidgetConfig = {
2685
2832
  */
2686
2833
  textToSpeech?: TextToSpeechConfig;
2687
2834
  toolCall?: AgentWidgetToolCallConfig$1;
2835
+ reasoning?: AgentWidgetReasoningConfig;
2688
2836
  /**
2689
2837
  * Configuration for tool approval bubbles.
2690
2838
  * Set to `false` to disable built-in approval handling entirely.
@@ -3750,16 +3898,22 @@ declare const MOCK_WORKSPACE_CONTENT = "\n <div class=\"preview-workspace-con
3750
3898
  */
3751
3899
  declare function buildSrcdoc(mountId: string, shellMode: 'light' | 'dark', docked: boolean, widgetCssPath: string): string;
3752
3900
  type PreviewScene = 'home' | 'conversation' | 'minimized' | 'artifact';
3753
- declare function createPreviewMessages(scene: PreviewScene): AgentWidgetMessage[];
3754
- declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene): AgentWidgetConfig;
3901
+ type PreviewTranscriptEntryPreset = 'user-message' | 'assistant-message' | 'reasoning-streaming' | 'reasoning-complete' | 'tool-running' | 'tool-complete';
3902
+ declare function getPreviewTranscriptPresetLabel(preset: PreviewTranscriptEntryPreset): string;
3903
+ declare function createPreviewTranscriptEntry(preset: PreviewTranscriptEntryPreset, index?: number): AgentWidgetMessage;
3904
+ declare function appendPreviewTranscriptEntry(messages: AgentWidgetMessage[], preset: PreviewTranscriptEntryPreset): AgentWidgetMessage[];
3905
+ declare function createPreviewMessages(scene: PreviewScene, config?: Partial<AgentWidgetConfig>, appendedMessages?: AgentWidgetMessage[]): AgentWidgetMessage[];
3906
+ declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene, appendedMessages?: AgentWidgetMessage[]): AgentWidgetConfig;
3755
3907
 
3756
3908
  interface PreviewConfigOptions {
3757
3909
  config?: Partial<AgentWidgetConfig>;
3758
3910
  theme?: DeepPartial<PersonaTheme>;
3759
3911
  darkTheme?: DeepPartial<PersonaTheme>;
3760
3912
  scene?: PreviewScene;
3913
+ appendedMessages?: AgentWidgetMessage[];
3761
3914
  }
3762
3915
  declare function buildPreviewConfig(options: PreviewConfigOptions, shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
3916
+ declare function buildPreviewConfigWithMessages(options: PreviewConfigOptions, messages: AgentWidgetMessage[], shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
3763
3917
 
3764
3918
  /**
3765
3919
  * Imperative preview renderer for the theme editor.
@@ -3924,4 +4078,4 @@ declare function paletteColorPath(family: string, shade: string): string;
3924
4078
  declare function resolveThemeColorPath(get: (path: string) => unknown, path: string, depth?: number): string;
3925
4079
  declare function tokenRefDisplayName(path: string): string;
3926
4080
 
3927
- export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, applySceneConfig, applyShellTheme, buildPreviewConfig, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
4081
+ export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, type PreviewTranscriptEntryPreset, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, appendPreviewTranscriptEntry, applySceneConfig, applyShellTheme, buildPreviewConfig, buildPreviewConfigWithMessages, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createPreviewTranscriptEntry, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getPreviewTranscriptPresetLabel, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };