@runtypelabs/persona 3.11.0 → 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.
package/dist/index.d.cts CHANGED
@@ -1249,6 +1249,17 @@ type AgentWidgetReasoningDisplayFeature = {
1249
1249
  * @default true
1250
1250
  */
1251
1251
  expandable?: boolean;
1252
+ /**
1253
+ * Animation mode applied to the reasoning header text while reasoning is active.
1254
+ * Reuses the same modes as tool call animations.
1255
+ * - "none" — static text, no animation
1256
+ * - "pulse" — opacity pulse on the entire header text
1257
+ * - "shimmer" — monochrome opacity sweep per character
1258
+ * - "shimmer-color" — color gradient sweep per character
1259
+ * - "rainbow" — rainbow color cycle per character
1260
+ * @default "none"
1261
+ */
1262
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1252
1263
  };
1253
1264
  type AgentWidgetFeatureFlags = {
1254
1265
  showReasoning?: boolean;
@@ -1937,6 +1948,14 @@ type AgentWidgetReasoningConfig = {
1937
1948
  previewText: string;
1938
1949
  isActive: boolean;
1939
1950
  config: AgentWidgetConfig;
1951
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1952
+ elapsed: string;
1953
+ /**
1954
+ * Returns a `<span>` whose text content is automatically updated every
1955
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1956
+ * HTMLElement to get a live-ticking duration display.
1957
+ */
1958
+ createElapsedElement: () => HTMLElement;
1940
1959
  }) => HTMLElement | string | null;
1941
1960
  /**
1942
1961
  * Override the lightweight collapsed preview content shown for active reasoning rows.
@@ -1949,6 +1968,45 @@ type AgentWidgetReasoningConfig = {
1949
1968
  isActive: boolean;
1950
1969
  config: AgentWidgetConfig;
1951
1970
  }) => HTMLElement | string | null;
1971
+ /**
1972
+ * Template string for the header text while reasoning is active (streaming).
1973
+ *
1974
+ * **Placeholders:** `{duration}` (live-updating elapsed time).
1975
+ *
1976
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time.
1977
+ *
1978
+ * When not set, falls back to the default "Thinking..." text.
1979
+ * @example "Thinking... ~{duration}~"
1980
+ */
1981
+ activeTextTemplate?: string;
1982
+ /**
1983
+ * Template string for the header text when reasoning is complete.
1984
+ *
1985
+ * **Placeholders:** `{duration}` (final elapsed time).
1986
+ *
1987
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1988
+ *
1989
+ * When not set, falls back to the default "Thought for X seconds" text.
1990
+ * @example "Thought for ~{duration}~"
1991
+ */
1992
+ completeTextTemplate?: string;
1993
+ /**
1994
+ * Primary color for shimmer-color animation mode.
1995
+ * Defaults to the current text color.
1996
+ */
1997
+ loadingAnimationColor?: string;
1998
+ /**
1999
+ * Secondary/end color for shimmer-color animation mode.
2000
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
2001
+ * @default "#3b82f6"
2002
+ */
2003
+ loadingAnimationSecondaryColor?: string;
2004
+ /**
2005
+ * Duration of one full animation cycle in milliseconds.
2006
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
2007
+ * @default 2000
2008
+ */
2009
+ loadingAnimationDuration?: number;
1952
2010
  };
1953
2011
  type AgentWidgetSuggestionChipsConfig = {
1954
2012
  fontFamily?: "sans-serif" | "serif" | "mono";
package/dist/index.d.ts CHANGED
@@ -1249,6 +1249,17 @@ type AgentWidgetReasoningDisplayFeature = {
1249
1249
  * @default true
1250
1250
  */
1251
1251
  expandable?: boolean;
1252
+ /**
1253
+ * Animation mode applied to the reasoning header text while reasoning is active.
1254
+ * Reuses the same modes as tool call animations.
1255
+ * - "none" — static text, no animation
1256
+ * - "pulse" — opacity pulse on the entire header text
1257
+ * - "shimmer" — monochrome opacity sweep per character
1258
+ * - "shimmer-color" — color gradient sweep per character
1259
+ * - "rainbow" — rainbow color cycle per character
1260
+ * @default "none"
1261
+ */
1262
+ loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1252
1263
  };
1253
1264
  type AgentWidgetFeatureFlags = {
1254
1265
  showReasoning?: boolean;
@@ -1937,6 +1948,14 @@ type AgentWidgetReasoningConfig = {
1937
1948
  previewText: string;
1938
1949
  isActive: boolean;
1939
1950
  config: AgentWidgetConfig;
1951
+ /** Static elapsed time snapshot, e.g. "2.6s". */
1952
+ elapsed: string;
1953
+ /**
1954
+ * Returns a `<span>` whose text content is automatically updated every
1955
+ * 100ms by the widget's global timer. Place it anywhere in your returned
1956
+ * HTMLElement to get a live-ticking duration display.
1957
+ */
1958
+ createElapsedElement: () => HTMLElement;
1940
1959
  }) => HTMLElement | string | null;
1941
1960
  /**
1942
1961
  * Override the lightweight collapsed preview content shown for active reasoning rows.
@@ -1949,6 +1968,45 @@ type AgentWidgetReasoningConfig = {
1949
1968
  isActive: boolean;
1950
1969
  config: AgentWidgetConfig;
1951
1970
  }) => HTMLElement | string | null;
1971
+ /**
1972
+ * Template string for the header text while reasoning is active (streaming).
1973
+ *
1974
+ * **Placeholders:** `{duration}` (live-updating elapsed time).
1975
+ *
1976
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — parsed at render time.
1977
+ *
1978
+ * When not set, falls back to the default "Thinking..." text.
1979
+ * @example "Thinking... ~{duration}~"
1980
+ */
1981
+ activeTextTemplate?: string;
1982
+ /**
1983
+ * Template string for the header text when reasoning is complete.
1984
+ *
1985
+ * **Placeholders:** `{duration}` (final elapsed time).
1986
+ *
1987
+ * **Inline formatting:** `~dim~`, `*italic*`, `**bold**` — same syntax as `activeTextTemplate`.
1988
+ *
1989
+ * When not set, falls back to the default "Thought for X seconds" text.
1990
+ * @example "Thought for ~{duration}~"
1991
+ */
1992
+ completeTextTemplate?: string;
1993
+ /**
1994
+ * Primary color for shimmer-color animation mode.
1995
+ * Defaults to the current text color.
1996
+ */
1997
+ loadingAnimationColor?: string;
1998
+ /**
1999
+ * Secondary/end color for shimmer-color animation mode.
2000
+ * Creates a gradient sweep between `loadingAnimationColor` and this color.
2001
+ * @default "#3b82f6"
2002
+ */
2003
+ loadingAnimationSecondaryColor?: string;
2004
+ /**
2005
+ * Duration of one full animation cycle in milliseconds.
2006
+ * Applies to pulse, shimmer, shimmer-color, and rainbow modes.
2007
+ * @default 2000
2008
+ */
2009
+ loadingAnimationDuration?: number;
1952
2010
  };
1953
2011
  type AgentWidgetSuggestionChipsConfig = {
1954
2012
  fontFamily?: "sans-serif" | "serif" | "mono";