@runtypelabs/persona 3.10.1 → 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.
package/dist/index.d.cts CHANGED
@@ -1177,6 +1177,13 @@ type AgentWidgetScrollToBottomFeature = {
1177
1177
  label?: string;
1178
1178
  };
1179
1179
  type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1180
+ /**
1181
+ * Animation mode applied to tool call header text while the tool is running.
1182
+ * Character-by-character modes (`shimmer`, `shimmer-color`, `rainbow`) wrap each
1183
+ * character in a span with staggered `animation-delay`. `pulse` applies to the
1184
+ * entire text container. Honors `prefers-reduced-motion`.
1185
+ */
1186
+ type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
1180
1187
  type AgentWidgetToolCallDisplayFeature = {
1181
1188
  /**
1182
1189
  * Controls what collapsed tool call rows show in their header/summary area.
@@ -1190,6 +1197,8 @@ type AgentWidgetToolCallDisplayFeature = {
1190
1197
  activePreview?: boolean;
1191
1198
  /**
1192
1199
  * Optional CSS min-height applied to active collapsed tool call rows.
1200
+ * @default undefined (no min-height)
1201
+ * @example "100px"
1193
1202
  */
1194
1203
  activeMinHeight?: string;
1195
1204
  /**
@@ -1208,6 +1217,16 @@ type AgentWidgetToolCallDisplayFeature = {
1208
1217
  * @default true
1209
1218
  */
1210
1219
  expandable?: boolean;
1220
+ /**
1221
+ * Animation mode applied to the tool call header text while the tool is active.
1222
+ * - "none" — static text, no animation
1223
+ * - "pulse" — opacity pulse on the entire header text
1224
+ * - "shimmer" — monochrome opacity sweep per character
1225
+ * - "shimmer-color" — color gradient sweep per character
1226
+ * - "rainbow" — rainbow color cycle per character
1227
+ * @default "none"
1228
+ */
1229
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1211
1230
  };
1212
1231
  type AgentWidgetReasoningDisplayFeature = {
1213
1232
  /**
@@ -1788,22 +1807,39 @@ type AgentWidgetApprovalConfig = {
1788
1807
  type AgentWidgetToolCallConfig = {
1789
1808
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1790
1809
  shadow?: string;
1810
+ /** Background color of the tool call bubble container. */
1791
1811
  backgroundColor?: string;
1812
+ /** Border color of the tool call bubble container. */
1792
1813
  borderColor?: string;
1814
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1793
1815
  borderWidth?: string;
1816
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1794
1817
  borderRadius?: string;
1818
+ /** Background color of the collapsed header row. */
1795
1819
  headerBackgroundColor?: string;
1820
+ /** Text color of the collapsed header row (tool name / summary). */
1796
1821
  headerTextColor?: string;
1822
+ /** Horizontal padding of the collapsed header row (CSS value). */
1797
1823
  headerPaddingX?: string;
1824
+ /** Vertical padding of the collapsed header row (CSS value). */
1798
1825
  headerPaddingY?: string;
1826
+ /** Background color of the expanded content area. */
1799
1827
  contentBackgroundColor?: string;
1828
+ /** Text color of the expanded content area. */
1800
1829
  contentTextColor?: string;
1830
+ /** Horizontal padding of the expanded content area (CSS value). */
1801
1831
  contentPaddingX?: string;
1832
+ /** Vertical padding of the expanded content area (CSS value). */
1802
1833
  contentPaddingY?: string;
1834
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1803
1835
  codeBlockBackgroundColor?: string;
1836
+ /** Border color of code blocks in the expanded area. */
1804
1837
  codeBlockBorderColor?: string;
1838
+ /** Text color of code blocks in the expanded area. */
1805
1839
  codeBlockTextColor?: string;
1840
+ /** Color of the expand/collapse toggle icon. */
1806
1841
  toggleTextColor?: string;
1842
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1807
1843
  labelTextColor?: string;
1808
1844
  /**
1809
1845
  * Override the collapsed summary row content for a tool call bubble.
@@ -1817,6 +1853,14 @@ type AgentWidgetToolCallConfig = {
1817
1853
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1818
1854
  isActive: boolean;
1819
1855
  config: AgentWidgetConfig;
1856
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1857
+ elapsed: string;
1858
+ /**
1859
+ * Returns a `<span>` whose text content is automatically updated every
1860
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1861
+ * HTMLElement to get a live-ticking duration display.
1862
+ */
1863
+ createElapsedElement: () => HTMLElement;
1820
1864
  }) => HTMLElement | string | null;
1821
1865
  /**
1822
1866
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1839,6 +1883,47 @@ type AgentWidgetToolCallConfig = {
1839
1883
  defaultSummary: string;
1840
1884
  config: AgentWidgetConfig;
1841
1885
  }) => HTMLElement | string | null;
1886
+ /**
1887
+ * Template string for the header text while a tool call is active (running).
1888
+ *
1889
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1890
+ *
1891
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1892
+ * applied as styled `<span>` elements. Works with all animation modes.
1893
+ *
1894
+ * When not set, falls back to the current `collapsedMode` behavior.
1895
+ * @example "Calling {toolName}... ~{duration}~"
1896
+ * @example "**Searching** *{toolName}*..."
1897
+ */
1898
+ activeTextTemplate?: string;
1899
+ /**
1900
+ * Template string for the header text when a tool call is complete.
1901
+ *
1902
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1903
+ *
1904
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1905
+ *
1906
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1907
+ * @example "Finished {toolName} ~{duration}~"
1908
+ */
1909
+ completeTextTemplate?: string;
1910
+ /**
1911
+ * Primary color for shimmer-color animation mode.
1912
+ * Defaults to the current text color.
1913
+ */
1914
+ loadingAnimationColor?: string;
1915
+ /**
1916
+ * Secondary/end color for shimmer-color animation mode.
1917
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1918
+ * @default "#3b82f6"
1919
+ */
1920
+ loadingAnimationSecondaryColor?: string;
1921
+ /**
1922
+ * Duration of one full animation cycle in milliseconds.
1923
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1924
+ * @default 2000
1925
+ */
1926
+ loadingAnimationDuration?: number;
1842
1927
  };
1843
1928
  type AgentWidgetReasoningConfig = {
1844
1929
  /**
package/dist/index.d.ts CHANGED
@@ -1177,6 +1177,13 @@ type AgentWidgetScrollToBottomFeature = {
1177
1177
  label?: string;
1178
1178
  };
1179
1179
  type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
1180
+ /**
1181
+ * Animation mode applied to tool call header text while the tool is running.
1182
+ * Character-by-character modes (`shimmer`, `shimmer-color`, `rainbow`) wrap each
1183
+ * character in a span with staggered `animation-delay`. `pulse` applies to the
1184
+ * entire text container. Honors `prefers-reduced-motion`.
1185
+ */
1186
+ type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
1180
1187
  type AgentWidgetToolCallDisplayFeature = {
1181
1188
  /**
1182
1189
  * Controls what collapsed tool call rows show in their header/summary area.
@@ -1190,6 +1197,8 @@ type AgentWidgetToolCallDisplayFeature = {
1190
1197
  activePreview?: boolean;
1191
1198
  /**
1192
1199
  * Optional CSS min-height applied to active collapsed tool call rows.
1200
+ * @default undefined (no min-height)
1201
+ * @example "100px"
1193
1202
  */
1194
1203
  activeMinHeight?: string;
1195
1204
  /**
@@ -1208,6 +1217,16 @@ type AgentWidgetToolCallDisplayFeature = {
1208
1217
  * @default true
1209
1218
  */
1210
1219
  expandable?: boolean;
1220
+ /**
1221
+ * Animation mode applied to the tool call header text while the tool is active.
1222
+ * - "none" — static text, no animation
1223
+ * - "pulse" — opacity pulse on the entire header text
1224
+ * - "shimmer" — monochrome opacity sweep per character
1225
+ * - "shimmer-color" — color gradient sweep per character
1226
+ * - "rainbow" — rainbow color cycle per character
1227
+ * @default "none"
1228
+ */
1229
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1211
1230
  };
1212
1231
  type AgentWidgetReasoningDisplayFeature = {
1213
1232
  /**
@@ -1788,22 +1807,39 @@ type AgentWidgetApprovalConfig = {
1788
1807
  type AgentWidgetToolCallConfig = {
1789
1808
  /** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
1790
1809
  shadow?: string;
1810
+ /** Background color of the tool call bubble container. */
1791
1811
  backgroundColor?: string;
1812
+ /** Border color of the tool call bubble container. */
1792
1813
  borderColor?: string;
1814
+ /** Border width of the tool call bubble container (CSS value, e.g. `"1px"`). */
1793
1815
  borderWidth?: string;
1816
+ /** Border radius of the tool call bubble container (CSS value, e.g. `"12px"`). */
1794
1817
  borderRadius?: string;
1818
+ /** Background color of the collapsed header row. */
1795
1819
  headerBackgroundColor?: string;
1820
+ /** Text color of the collapsed header row (tool name / summary). */
1796
1821
  headerTextColor?: string;
1822
+ /** Horizontal padding of the collapsed header row (CSS value). */
1797
1823
  headerPaddingX?: string;
1824
+ /** Vertical padding of the collapsed header row (CSS value). */
1798
1825
  headerPaddingY?: string;
1826
+ /** Background color of the expanded content area. */
1799
1827
  contentBackgroundColor?: string;
1828
+ /** Text color of the expanded content area. */
1800
1829
  contentTextColor?: string;
1830
+ /** Horizontal padding of the expanded content area (CSS value). */
1801
1831
  contentPaddingX?: string;
1832
+ /** Vertical padding of the expanded content area (CSS value). */
1802
1833
  contentPaddingY?: string;
1834
+ /** Background color of code blocks (arguments / result) in the expanded area. */
1803
1835
  codeBlockBackgroundColor?: string;
1836
+ /** Border color of code blocks in the expanded area. */
1804
1837
  codeBlockBorderColor?: string;
1838
+ /** Text color of code blocks in the expanded area. */
1805
1839
  codeBlockTextColor?: string;
1840
+ /** Color of the expand/collapse toggle icon. */
1806
1841
  toggleTextColor?: string;
1842
+ /** Color of section labels ("Arguments", "Result", "Activity") in the expanded area. */
1807
1843
  labelTextColor?: string;
1808
1844
  /**
1809
1845
  * Override the collapsed summary row content for a tool call bubble.
@@ -1817,6 +1853,14 @@ type AgentWidgetToolCallConfig = {
1817
1853
  collapsedMode: AgentWidgetToolCallCollapsedMode;
1818
1854
  isActive: boolean;
1819
1855
  config: AgentWidgetConfig;
1856
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1857
+ elapsed: string;
1858
+ /**
1859
+ * Returns a `<span>` whose text content is automatically updated every
1860
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1861
+ * HTMLElement to get a live-ticking duration display.
1862
+ */
1863
+ createElapsedElement: () => HTMLElement;
1820
1864
  }) => HTMLElement | string | null;
1821
1865
  /**
1822
1866
  * Override the lightweight collapsed preview content shown for active tool rows.
@@ -1839,6 +1883,47 @@ type AgentWidgetToolCallConfig = {
1839
1883
  defaultSummary: string;
1840
1884
  config: AgentWidgetConfig;
1841
1885
  }) => HTMLElement | string | null;
1886
+ /**
1887
+ * Template string for the header text while a tool call is active (running).
1888
+ *
1889
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (live-updating elapsed time).
1890
+ *
1891
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time and
1892
+ * applied as styled `<span>` elements. Works with all animation modes.
1893
+ *
1894
+ * When not set, falls back to the current `collapsedMode` behavior.
1895
+ * @example "Calling {toolName}... ~{duration}~"
1896
+ * @example "**Searching** *{toolName}*..."
1897
+ */
1898
+ activeTextTemplate?: string;
1899
+ /**
1900
+ * Template string for the header text when a tool call is complete.
1901
+ *
1902
+ * **Placeholders:** `{toolName}` (tool name), `{duration}` (final elapsed time).
1903
+ *
1904
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1905
+ *
1906
+ * When not set, falls back to the existing "Used tool for X seconds" text.
1907
+ * @example "Finished {toolName} ~{duration}~"
1908
+ */
1909
+ completeTextTemplate?: string;
1910
+ /**
1911
+ * Primary color for shimmer-color animation mode.
1912
+ * Defaults to the current text color.
1913
+ */
1914
+ loadingAnimationColor?: string;
1915
+ /**
1916
+ * Secondary/end color for shimmer-color animation mode.
1917
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
1918
+ * @default "#3b82f6"
1919
+ */
1920
+ loadingAnimationSecondaryColor?: string;
1921
+ /**
1922
+ * Duration of one full animation cycle in milliseconds.
1923
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
1924
+ * @default 2000
1925
+ */
1926
+ loadingAnimationDuration?: number;
1842
1927
  };
1843
1928
  type AgentWidgetReasoningConfig = {
1844
1929
  /**