@runtypelabs/persona 3.10.1 → 3.12.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
  /**
@@ -1179,6 +1198,17 @@ type AgentWidgetReasoningDisplayFeature = {
1179
1198
  * @default true
1180
1199
  */
1181
1200
  expandable?: boolean;
1201
+ /**
1202
+ * Animation mode applied to the reasoning header text while reasoning is active.
1203
+ * Reuses the same modes as tool call animations.
1204
+ * - "none" — static text, no animation
1205
+ * - "pulse" — opacity pulse on the entire header text
1206
+ * - "shimmer" — monochrome opacity sweep per character
1207
+ * - "shimmer-color" — color gradient sweep per character
1208
+ * - "rainbow" — rainbow color cycle per character
1209
+ * @default "none"
1210
+ */
1211
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1182
1212
  };
1183
1213
  type AgentWidgetFeatureFlags = {
1184
1214
  showReasoning?: boolean;
@@ -1672,22 +1702,39 @@ type AgentWidgetApprovalConfig = {
1672
1702
  type AgentWidgetToolCallConfig$1 = {
1673
1703
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1674
1704
  shadow?: string;
1705
+ /** Background color of the tool call bubble container. */
1675
1706
  backgroundColor?: string;
1707
+ /** Border color of the tool call bubble container. */
1676
1708
  borderColor?: string;
1709
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1677
1710
  borderWidth?: string;
1711
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1678
1712
  borderRadius?: string;
1713
+ /** Background color of the collapsed header row. */
1679
1714
  headerBackgroundColor?: string;
1715
+ /** Text color of the collapsed header row (tool name / summary). */
1680
1716
  headerTextColor?: string;
1717
+ /** Horizontal padding of the collapsed header row (CSS value). */
1681
1718
  headerPaddingX?: string;
1719
+ /** Vertical padding of the collapsed header row (CSS value). */
1682
1720
  headerPaddingY?: string;
1721
+ /** Background color of the expanded content area. */
1683
1722
  contentBackgroundColor?: string;
1723
+ /** Text color of the expanded content area. */
1684
1724
  contentTextColor?: string;
1725
+ /** Horizontal padding of the expanded content area (CSS value). */
1685
1726
  contentPaddingX?: string;
1727
+ /** Vertical padding of the expanded content area (CSS value). */
1686
1728
  contentPaddingY?: string;
1729
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1687
1730
  codeBlockBackgroundColor?: string;
1731
+ /** Border color of code blocks in the expanded area. */
1688
1732
  codeBlockBorderColor?: string;
1733
+ /** Text color of code blocks in the expanded area. */
1689
1734
  codeBlockTextColor?: string;
1735
+ /** Color of the expand/collapse toggle icon. */
1690
1736
  toggleTextColor?: string;
1737
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1691
1738
  labelTextColor?: string;
1692
1739
  /**
1693
1740
  * Override the collapsed summary row content for a tool call bubble.
@@ -1701,6 +1748,14 @@ type AgentWidgetToolCallConfig$1 = {
1701
1748
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
1749
  isActive: boolean;
1703
1750
  config: AgentWidgetConfig;
1751
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1752
+ elapsed: string;
1753
+ /**
1754
+ * Returns a `<span>` whose text content is automatically updated every
1755
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1756
+ * HTMLElement to get a live-ticking duration display.
1757
+ */
1758
+ createElapsedElement: () => HTMLElement;
1704
1759
  }) => HTMLElement | string | null;
1705
1760
  /**
1706
1761
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1723,6 +1778,47 @@ type AgentWidgetToolCallConfig$1 = {
1723
1778
  defaultSummary: string;
1724
1779
  config: AgentWidgetConfig;
1725
1780
  }) => HTMLElement | string | null;
1781
+ /**
1782
+ * Template string for the header text while a tool call is active (running).
1783
+ *
1784
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1785
+ *
1786
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1787
+ * applied as styled `<span>` elements. Works with all animation modes.
1788
+ *
1789
+ * When not set, falls back to the current `collapsedMode` behavior.
1790
+ * @example "Calling {toolName}... ~{duration}~"
1791
+ * @example "**Searching** *{toolName}*..."
1792
+ */
1793
+ activeTextTemplate?: string;
1794
+ /**
1795
+ * Template string for the header text when a tool call is complete.
1796
+ *
1797
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1798
+ *
1799
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1800
+ *
1801
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1802
+ * @example "Finished {toolName} ~{duration}~"
1803
+ */
1804
+ completeTextTemplate?: string;
1805
+ /**
1806
+ * Primary color for shimmer-color animation mode.
1807
+ * Defaults to the current text color.
1808
+ */
1809
+ loadingAnimationColor?: string;
1810
+ /**
1811
+ * Secondary/end color for shimmer-color animation mode.
1812
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1813
+ * @default "#3b82f6"
1814
+ */
1815
+ loadingAnimationSecondaryColor?: string;
1816
+ /**
1817
+ * Duration of one full animation cycle in milliseconds.
1818
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1819
+ * @default 2000
1820
+ */
1821
+ loadingAnimationDuration?: number;
1726
1822
  };
1727
1823
  type AgentWidgetReasoningConfig = {
1728
1824
  /**
@@ -1736,6 +1832,14 @@ type AgentWidgetReasoningConfig = {
1736
1832
  previewText: string;
1737
1833
  isActive: boolean;
1738
1834
  config: AgentWidgetConfig;
1835
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1836
+ elapsed: string;
1837
+ /**
1838
+ * Returns a `<span>` whose text content is automatically updated every
1839
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1840
+ * HTMLElement to get a live-ticking duration display.
1841
+ */
1842
+ createElapsedElement: () => HTMLElement;
1739
1843
  }) => HTMLElement | string | null;
1740
1844
  /**
1741
1845
  * Override the lightweight collapsed preview content shown for active reasoning rows.
@@ -1748,6 +1852,45 @@ type AgentWidgetReasoningConfig = {
1748
1852
  isActive: boolean;
1749
1853
  config: AgentWidgetConfig;
1750
1854
  }) => HTMLElement | string | null;
1855
+ /**
1856
+ * Template string for the header text while reasoning is active (streaming).
1857
+ *
1858
+ * **Placeholders:** `{duration}` (live-updating elapsed time).
1859
+ *
1860
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time.
1861
+ *
1862
+ * When not set, falls back to the default "Thinking..." text.
1863
+ * @example "Thinking... ~{duration}~"
1864
+ */
1865
+ activeTextTemplate?: string;
1866
+ /**
1867
+ * Template string for the header text when reasoning is complete.
1868
+ *
1869
+ * **Placeholders:** `{duration}` (final elapsed time).
1870
+ *
1871
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1872
+ *
1873
+ * When not set, falls back to the default "Thought for X seconds" text.
1874
+ * @example "Thought for ~{duration}~"
1875
+ */
1876
+ completeTextTemplate?: string;
1877
+ /**
1878
+ * Primary color for shimmer-color animation mode.
1879
+ * Defaults to the current text color.
1880
+ */
1881
+ loadingAnimationColor?: string;
1882
+ /**
1883
+ * Secondary/end color for shimmer-color animation mode.
1884
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1885
+ * @default "#3b82f6"
1886
+ */
1887
+ loadingAnimationSecondaryColor?: string;
1888
+ /**
1889
+ * Duration of one full animation cycle in milliseconds.
1890
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1891
+ * @default 2000
1892
+ */
1893
+ loadingAnimationDuration?: number;
1751
1894
  };
1752
1895
  type AgentWidgetSuggestionChipsConfig = {
1753
1896
  fontFamily?: "sans-serif" | "serif" | "mono";
@@ -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
  /**
@@ -1179,6 +1198,17 @@ type AgentWidgetReasoningDisplayFeature = {
1179
1198
  * @default true
1180
1199
  */
1181
1200
  expandable?: boolean;
1201
+ /**
1202
+ * Animation mode applied to the reasoning header text while reasoning is active.
1203
+ * Reuses the same modes as tool call animations.
1204
+ * - "none" — static text, no animation
1205
+ * - "pulse" — opacity pulse on the entire header text
1206
+ * - "shimmer" — monochrome opacity sweep per character
1207
+ * - "shimmer-color" — color gradient sweep per character
1208
+ * - "rainbow" — rainbow color cycle per character
1209
+ * @default "none"
1210
+ */
1211
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1182
1212
  };
1183
1213
  type AgentWidgetFeatureFlags = {
1184
1214
  showReasoning?: boolean;
@@ -1672,22 +1702,39 @@ type AgentWidgetApprovalConfig = {
1672
1702
  type AgentWidgetToolCallConfig$1 = {
1673
1703
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1674
1704
  shadow?: string;
1705
+ /** Background color of the tool call bubble container. */
1675
1706
  backgroundColor?: string;
1707
+ /** Border color of the tool call bubble container. */
1676
1708
  borderColor?: string;
1709
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1677
1710
  borderWidth?: string;
1711
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1678
1712
  borderRadius?: string;
1713
+ /** Background color of the collapsed header row. */
1679
1714
  headerBackgroundColor?: string;
1715
+ /** Text color of the collapsed header row (tool name / summary). */
1680
1716
  headerTextColor?: string;
1717
+ /** Horizontal padding of the collapsed header row (CSS value). */
1681
1718
  headerPaddingX?: string;
1719
+ /** Vertical padding of the collapsed header row (CSS value). */
1682
1720
  headerPaddingY?: string;
1721
+ /** Background color of the expanded content area. */
1683
1722
  contentBackgroundColor?: string;
1723
+ /** Text color of the expanded content area. */
1684
1724
  contentTextColor?: string;
1725
+ /** Horizontal padding of the expanded content area (CSS value). */
1685
1726
  contentPaddingX?: string;
1727
+ /** Vertical padding of the expanded content area (CSS value). */
1686
1728
  contentPaddingY?: string;
1729
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1687
1730
  codeBlockBackgroundColor?: string;
1731
+ /** Border color of code blocks in the expanded area. */
1688
1732
  codeBlockBorderColor?: string;
1733
+ /** Text color of code blocks in the expanded area. */
1689
1734
  codeBlockTextColor?: string;
1735
+ /** Color of the expand/collapse toggle icon. */
1690
1736
  toggleTextColor?: string;
1737
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1691
1738
  labelTextColor?: string;
1692
1739
  /**
1693
1740
  * Override the collapsed summary row content for a tool call bubble.
@@ -1701,6 +1748,14 @@ type AgentWidgetToolCallConfig$1 = {
1701
1748
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1702
1749
  isActive: boolean;
1703
1750
  config: AgentWidgetConfig;
1751
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1752
+ elapsed: string;
1753
+ /**
1754
+ * Returns a `<span>` whose text content is automatically updated every
1755
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1756
+ * HTMLElement to get a live-ticking duration display.
1757
+ */
1758
+ createElapsedElement: () => HTMLElement;
1704
1759
  }) => HTMLElement | string | null;
1705
1760
  /**
1706
1761
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1723,6 +1778,47 @@ type AgentWidgetToolCallConfig$1 = {
1723
1778
  defaultSummary: string;
1724
1779
  config: AgentWidgetConfig;
1725
1780
  }) => HTMLElement | string | null;
1781
+ /**
1782
+ * Template string for the header text while a tool call is active (running).
1783
+ *
1784
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1785
+ *
1786
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1787
+ * applied as styled `<span>` elements. Works with all animation modes.
1788
+ *
1789
+ * When not set, falls back to the current `collapsedMode` behavior.
1790
+ * @example "Calling {toolName}... ~{duration}~"
1791
+ * @example "**Searching** *{toolName}*..."
1792
+ */
1793
+ activeTextTemplate?: string;
1794
+ /**
1795
+ * Template string for the header text when a tool call is complete.
1796
+ *
1797
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1798
+ *
1799
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1800
+ *
1801
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1802
+ * @example "Finished {toolName} ~{duration}~"
1803
+ */
1804
+ completeTextTemplate?: string;
1805
+ /**
1806
+ * Primary color for shimmer-color animation mode.
1807
+ * Defaults to the current text color.
1808
+ */
1809
+ loadingAnimationColor?: string;
1810
+ /**
1811
+ * Secondary/end color for shimmer-color animation mode.
1812
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1813
+ * @default "#3b82f6"
1814
+ */
1815
+ loadingAnimationSecondaryColor?: string;
1816
+ /**
1817
+ * Duration of one full animation cycle in milliseconds.
1818
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1819
+ * @default 2000
1820
+ */
1821
+ loadingAnimationDuration?: number;
1726
1822
  };
1727
1823
  type AgentWidgetReasoningConfig = {
1728
1824
  /**
@@ -1736,6 +1832,14 @@ type AgentWidgetReasoningConfig = {
1736
1832
  previewText: string;
1737
1833
  isActive: boolean;
1738
1834
  config: AgentWidgetConfig;
1835
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1836
+ elapsed: string;
1837
+ /**
1838
+ * Returns a `<span>` whose text content is automatically updated every
1839
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1840
+ * HTMLElement to get a live-ticking duration display.
1841
+ */
1842
+ createElapsedElement: () => HTMLElement;
1739
1843
  }) => HTMLElement | string | null;
1740
1844
  /**
1741
1845
  * Override the lightweight collapsed preview content shown for active reasoning rows.
@@ -1748,6 +1852,45 @@ type AgentWidgetReasoningConfig = {
1748
1852
  isActive: boolean;
1749
1853
  config: AgentWidgetConfig;
1750
1854
  }) => HTMLElement | string | null;
1855
+ /**
1856
+ * Template string for the header text while reasoning is active (streaming).
1857
+ *
1858
+ * **Placeholders:** `{duration}` (live-updating elapsed time).
1859
+ *
1860
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time.
1861
+ *
1862
+ * When not set, falls back to the default "Thinking..." text.
1863
+ * @example "Thinking... ~{duration}~"
1864
+ */
1865
+ activeTextTemplate?: string;
1866
+ /**
1867
+ * Template string for the header text when reasoning is complete.
1868
+ *
1869
+ * **Placeholders:** `{duration}` (final elapsed time).
1870
+ *
1871
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1872
+ *
1873
+ * When not set, falls back to the default "Thought for X seconds" text.
1874
+ * @example "Thought for ~{duration}~"
1875
+ */
1876
+ completeTextTemplate?: string;
1877
+ /**
1878
+ * Primary color for shimmer-color animation mode.
1879
+ * Defaults to the current text color.
1880
+ */
1881
+ loadingAnimationColor?: string;
1882
+ /**
1883
+ * Secondary/end color for shimmer-color animation mode.
1884
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1885
+ * @default "#3b82f6"
1886
+ */
1887
+ loadingAnimationSecondaryColor?: string;
1888
+ /**
1889
+ * Duration of one full animation cycle in milliseconds.
1890
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1891
+ * @default 2000
1892
+ */
1893
+ loadingAnimationDuration?: number;
1751
1894
  };
1752
1895
  type AgentWidgetSuggestionChipsConfig = {
1753
1896
  fontFamily?: "sans-serif" | "serif" | "mono";