@runtypelabs/persona 3.10.0 → 3.11.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.
@@ -1126,6 +1126,13 @@ type AgentWidgetScrollToBottomFeature = {
1126
1126
  label?: string;
1127
1127
  };
1128
1128
  type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1129
+ /**
1130
+ * Animation mode applied to tool call header text while the tool is running.
1131
+ * Character-by-character modes (`shimmer`, `shimmer-color`, `rainbow`) wrap each
1132
+ * character in a span with staggered `animation-delay`. `pulse` applies to the
1133
+ * entire text container. Honors `prefers-reduced-motion`.
1134
+ */
1135
+ type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
1129
1136
  type AgentWidgetToolCallDisplayFeature = {
1130
1137
  /**
1131
1138
  * Controls what collapsed tool call rows show in their header/summary area.
@@ -1139,6 +1146,8 @@ type AgentWidgetToolCallDisplayFeature = {
1139
1146
  activePreview?: boolean;
1140
1147
  /**
1141
1148
  * Optional CSS min-height applied to active collapsed tool call rows.
1149
+ * @default undefined (no min-height)
1150
+ * @example "100px"
1142
1151
  */
1143
1152
  activeMinHeight?: string;
1144
1153
  /**
@@ -1157,6 +1166,16 @@ type AgentWidgetToolCallDisplayFeature = {
1157
1166
  * @default true
1158
1167
  */
1159
1168
  expandable?: boolean;
1169
+ /**
1170
+ * Animation mode applied to the tool call header text while the tool is active.
1171
+ * - "none" — static text, no animation
1172
+ * - "pulse" — opacity pulse on the entire header text
1173
+ * - "shimmer" — monochrome opacity sweep per character
1174
+ * - "shimmer-color" — color gradient sweep per character
1175
+ * - "rainbow" — rainbow color cycle per character
1176
+ * @default "none"
1177
+ */
1178
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1160
1179
  };
1161
1180
  type AgentWidgetReasoningDisplayFeature = {
1162
1181
  /**
@@ -1672,22 +1691,39 @@ type AgentWidgetApprovalConfig = {
1672
1691
  type AgentWidgetToolCallConfig$1 = {
1673
1692
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1674
1693
  shadow?: string;
1694
+ /** Background color of the tool call bubble container. */
1675
1695
  backgroundColor?: string;
1696
+ /** Border color of the tool call bubble container. */
1676
1697
  borderColor?: string;
1698
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1677
1699
  borderWidth?: string;
1700
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1678
1701
  borderRadius?: string;
1702
+ /** Background color of the collapsed header row. */
1679
1703
  headerBackgroundColor?: string;
1704
+ /** Text color of the collapsed header row (tool name / summary). */
1680
1705
  headerTextColor?: string;
1706
+ /** Horizontal padding of the collapsed header row (CSS value). */
1681
1707
  headerPaddingX?: string;
1708
+ /** Vertical padding of the collapsed header row (CSS value). */
1682
1709
  headerPaddingY?: string;
1710
+ /** Background color of the expanded content area. */
1683
1711
  contentBackgroundColor?: string;
1712
+ /** Text color of the expanded content area. */
1684
1713
  contentTextColor?: string;
1714
+ /** Horizontal padding of the expanded content area (CSS value). */
1685
1715
  contentPaddingX?: string;
1716
+ /** Vertical padding of the expanded content area (CSS value). */
1686
1717
  contentPaddingY?: string;
1718
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1687
1719
  codeBlockBackgroundColor?: string;
1720
+ /** Border color of code blocks in the expanded area. */
1688
1721
  codeBlockBorderColor?: string;
1722
+ /** Text color of code blocks in the expanded area. */
1689
1723
  codeBlockTextColor?: string;
1724
+ /** Color of the expand/collapse toggle icon. */
1690
1725
  toggleTextColor?: string;
1726
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1691
1727
  labelTextColor?: string;
1692
1728
  /**
1693
1729
  * Override the collapsed summary row content for a tool call bubble.
@@ -1701,6 +1737,14 @@ type AgentWidgetToolCallConfig$1 = {
1701
1737
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
1738
  isActive: boolean;
1703
1739
  config: AgentWidgetConfig;
1740
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1741
+ elapsed: string;
1742
+ /**
1743
+ * Returns a `<span>` whose text content is automatically updated every
1744
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1745
+ * HTMLElement to get a live-ticking duration display.
1746
+ */
1747
+ createElapsedElement: () => HTMLElement;
1704
1748
  }) => HTMLElement | string | null;
1705
1749
  /**
1706
1750
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1723,6 +1767,47 @@ type AgentWidgetToolCallConfig$1 = {
1723
1767
  defaultSummary: string;
1724
1768
  config: AgentWidgetConfig;
1725
1769
  }) => HTMLElement | string | null;
1770
+ /**
1771
+ * Template string for the header text while a tool call is active (running).
1772
+ *
1773
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1774
+ *
1775
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1776
+ * applied as styled `<span>` elements. Works with all animation modes.
1777
+ *
1778
+ * When not set, falls back to the current `collapsedMode` behavior.
1779
+ * @example "Calling {toolName}... ~{duration}~"
1780
+ * @example "**Searching** *{toolName}*..."
1781
+ */
1782
+ activeTextTemplate?: string;
1783
+ /**
1784
+ * Template string for the header text when a tool call is complete.
1785
+ *
1786
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1787
+ *
1788
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1789
+ *
1790
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1791
+ * @example "Finished {toolName} ~{duration}~"
1792
+ */
1793
+ completeTextTemplate?: string;
1794
+ /**
1795
+ * Primary color for shimmer-color animation mode.
1796
+ * Defaults to the current text color.
1797
+ */
1798
+ loadingAnimationColor?: string;
1799
+ /**
1800
+ * Secondary/end color for shimmer-color animation mode.
1801
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1802
+ * @default "#3b82f6"
1803
+ */
1804
+ loadingAnimationSecondaryColor?: string;
1805
+ /**
1806
+ * Duration of one full animation cycle in milliseconds.
1807
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1808
+ * @default 2000
1809
+ */
1810
+ loadingAnimationDuration?: number;
1726
1811
  };
1727
1812
  type AgentWidgetReasoningConfig = {
1728
1813
  /**
@@ -2412,6 +2497,35 @@ type AgentWidgetAttachmentsConfig = {
2412
2497
  * Callback when a file is rejected (wrong type or too large).
2413
2498
  */
2414
2499
  onFileRejected?: (file: File, reason: 'type' | 'size' | 'count') => void;
2500
+ /**
2501
+ * Customize the drag-and-drop overlay that appears when files are dragged over the widget.
2502
+ */
2503
+ dropOverlay?: {
2504
+ /** Background color/value of the overlay. @default 'rgba(59, 130, 246, 0.08)' */
2505
+ background?: string;
2506
+ /** Backdrop blur applied behind the overlay (CSS value). @default '8px' */
2507
+ backdropBlur?: string;
2508
+ /** Border style shown during drag. @default '2px dashed rgba(59, 130, 246, 0.4)' */
2509
+ border?: string;
2510
+ /** Border radius of the overlay. @default 'inherit' */
2511
+ borderRadius?: string;
2512
+ /** Inset/margin pulling the overlay away from the container edges (CSS value). @default '0' */
2513
+ inset?: string;
2514
+ /** Lucide icon name displayed in the center. @default 'upload' */
2515
+ iconName?: string;
2516
+ /** Icon size (CSS value). @default '48px' */
2517
+ iconSize?: string;
2518
+ /** Icon stroke color. @default 'rgba(59, 130, 246, 0.6)' */
2519
+ iconColor?: string;
2520
+ /** Icon stroke width. @default 0.5 */
2521
+ iconStrokeWidth?: number;
2522
+ /** Optional label text shown below the icon. */
2523
+ label?: string;
2524
+ /** Label font size. @default '0.875rem' */
2525
+ labelSize?: string;
2526
+ /** Label color. @default 'rgba(59, 130, 246, 0.8)' */
2527
+ labelColor?: string;
2528
+ };
2415
2529
  };
2416
2530
  /**
2417
2531
  * Configuration for persisting widget state across page navigations.
@@ -1126,6 +1126,13 @@ type AgentWidgetScrollToBottomFeature = {
1126
1126
  label?: string;
1127
1127
  };
1128
1128
  type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1129
+ /**
1130
+ * Animation mode applied to tool call header text while the tool is running.
1131
+ * Character-by-character modes (`shimmer`, `shimmer-color`, `rainbow`) wrap each
1132
+ * character in a span with staggered `animation-delay`. `pulse` applies to the
1133
+ * entire text container. Honors `prefers-reduced-motion`.
1134
+ */
1135
+ type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
1129
1136
  type AgentWidgetToolCallDisplayFeature = {
1130
1137
  /**
1131
1138
  * Controls what collapsed tool call rows show in their header/summary area.
@@ -1139,6 +1146,8 @@ type AgentWidgetToolCallDisplayFeature = {
1139
1146
  activePreview?: boolean;
1140
1147
  /**
1141
1148
  * Optional CSS min-height applied to active collapsed tool call rows.
1149
+ * @default undefined (no min-height)
1150
+ * @example "100px"
1142
1151
  */
1143
1152
  activeMinHeight?: string;
1144
1153
  /**
@@ -1157,6 +1166,16 @@ type AgentWidgetToolCallDisplayFeature = {
1157
1166
  * @default true
1158
1167
  */
1159
1168
  expandable?: boolean;
1169
+ /**
1170
+ * Animation mode applied to the tool call header text while the tool is active.
1171
+ * - "none" — static text, no animation
1172
+ * - "pulse" — opacity pulse on the entire header text
1173
+ * - "shimmer" — monochrome opacity sweep per character
1174
+ * - "shimmer-color" — color gradient sweep per character
1175
+ * - "rainbow" — rainbow color cycle per character
1176
+ * @default "none"
1177
+ */
1178
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1160
1179
  };
1161
1180
  type AgentWidgetReasoningDisplayFeature = {
1162
1181
  /**
@@ -1672,22 +1691,39 @@ type AgentWidgetApprovalConfig = {
1672
1691
  type AgentWidgetToolCallConfig$1 = {
1673
1692
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1674
1693
  shadow?: string;
1694
+ /** Background color of the tool call bubble container. */
1675
1695
  backgroundColor?: string;
1696
+ /** Border color of the tool call bubble container. */
1676
1697
  borderColor?: string;
1698
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1677
1699
  borderWidth?: string;
1700
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1678
1701
  borderRadius?: string;
1702
+ /** Background color of the collapsed header row. */
1679
1703
  headerBackgroundColor?: string;
1704
+ /** Text color of the collapsed header row (tool name / summary). */
1680
1705
  headerTextColor?: string;
1706
+ /** Horizontal padding of the collapsed header row (CSS value). */
1681
1707
  headerPaddingX?: string;
1708
+ /** Vertical padding of the collapsed header row (CSS value). */
1682
1709
  headerPaddingY?: string;
1710
+ /** Background color of the expanded content area. */
1683
1711
  contentBackgroundColor?: string;
1712
+ /** Text color of the expanded content area. */
1684
1713
  contentTextColor?: string;
1714
+ /** Horizontal padding of the expanded content area (CSS value). */
1685
1715
  contentPaddingX?: string;
1716
+ /** Vertical padding of the expanded content area (CSS value). */
1686
1717
  contentPaddingY?: string;
1718
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1687
1719
  codeBlockBackgroundColor?: string;
1720
+ /** Border color of code blocks in the expanded area. */
1688
1721
  codeBlockBorderColor?: string;
1722
+ /** Text color of code blocks in the expanded area. */
1689
1723
  codeBlockTextColor?: string;
1724
+ /** Color of the expand/collapse toggle icon. */
1690
1725
  toggleTextColor?: string;
1726
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1691
1727
  labelTextColor?: string;
1692
1728
  /**
1693
1729
  * Override the collapsed summary row content for a tool call bubble.
@@ -1701,6 +1737,14 @@ type AgentWidgetToolCallConfig$1 = {
1701
1737
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
1738
  isActive: boolean;
1703
1739
  config: AgentWidgetConfig;
1740
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1741
+ elapsed: string;
1742
+ /**
1743
+ * Returns a `<span>` whose text content is automatically updated every
1744
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1745
+ * HTMLElement to get a live-ticking duration display.
1746
+ */
1747
+ createElapsedElement: () => HTMLElement;
1704
1748
  }) => HTMLElement | string | null;
1705
1749
  /**
1706
1750
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1723,6 +1767,47 @@ type AgentWidgetToolCallConfig$1 = {
1723
1767
  defaultSummary: string;
1724
1768
  config: AgentWidgetConfig;
1725
1769
  }) => HTMLElement | string | null;
1770
+ /**
1771
+ * Template string for the header text while a tool call is active (running).
1772
+ *
1773
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1774
+ *
1775
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1776
+ * applied as styled `<span>` elements. Works with all animation modes.
1777
+ *
1778
+ * When not set, falls back to the current `collapsedMode` behavior.
1779
+ * @example "Calling {toolName}... ~{duration}~"
1780
+ * @example "**Searching** *{toolName}*..."
1781
+ */
1782
+ activeTextTemplate?: string;
1783
+ /**
1784
+ * Template string for the header text when a tool call is complete.
1785
+ *
1786
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1787
+ *
1788
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1789
+ *
1790
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1791
+ * @example "Finished {toolName} ~{duration}~"
1792
+ */
1793
+ completeTextTemplate?: string;
1794
+ /**
1795
+ * Primary color for shimmer-color animation mode.
1796
+ * Defaults to the current text color.
1797
+ */
1798
+ loadingAnimationColor?: string;
1799
+ /**
1800
+ * Secondary/end color for shimmer-color animation mode.
1801
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1802
+ * @default "#3b82f6"
1803
+ */
1804
+ loadingAnimationSecondaryColor?: string;
1805
+ /**
1806
+ * Duration of one full animation cycle in milliseconds.
1807
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1808
+ * @default 2000
1809
+ */
1810
+ loadingAnimationDuration?: number;
1726
1811
  };
1727
1812
  type AgentWidgetReasoningConfig = {
1728
1813
  /**
@@ -2412,6 +2497,35 @@ type AgentWidgetAttachmentsConfig = {
2412
2497
  * Callback when a file is rejected (wrong type or too large).
2413
2498
  */
2414
2499
  onFileRejected?: (file: File, reason: 'type' | 'size' | 'count') => void;
2500
+ /**
2501
+ * Customize the drag-and-drop overlay that appears when files are dragged over the widget.
2502
+ */
2503
+ dropOverlay?: {
2504
+ /** Background color/value of the overlay. @default 'rgba(59, 130, 246, 0.08)' */
2505
+ background?: string;
2506
+ /** Backdrop blur applied behind the overlay (CSS value). @default '8px' */
2507
+ backdropBlur?: string;
2508
+ /** Border style shown during drag. @default '2px dashed rgba(59, 130, 246, 0.4)' */
2509
+ border?: string;
2510
+ /** Border radius of the overlay. @default 'inherit' */
2511
+ borderRadius?: string;
2512
+ /** Inset/margin pulling the overlay away from the container edges (CSS value). @default '0' */
2513
+ inset?: string;
2514
+ /** Lucide icon name displayed in the center. @default 'upload' */
2515
+ iconName?: string;
2516
+ /** Icon size (CSS value). @default '48px' */
2517
+ iconSize?: string;
2518
+ /** Icon stroke color. @default 'rgba(59, 130, 246, 0.6)' */
2519
+ iconColor?: string;
2520
+ /** Icon stroke width. @default 0.5 */
2521
+ iconStrokeWidth?: number;
2522
+ /** Optional label text shown below the icon. */
2523
+ label?: string;
2524
+ /** Label font size. @default '0.875rem' */
2525
+ labelSize?: string;
2526
+ /** Label color. @default 'rgba(59, 130, 246, 0.8)' */
2527
+ labelColor?: string;
2528
+ };
2415
2529
  };
2416
2530
  /**
2417
2531
  * Configuration for persisting widget state across page navigations.