@runtypelabs/persona 3.11.0 → 3.13.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/README.md +79 -0
- package/dist/index.cjs +43 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.global.js +61 -61
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +43 -43
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/theme-editor.cjs +133 -14
- package/dist/theme-editor.d.cts +58 -0
- package/dist/theme-editor.d.ts +58 -0
- package/dist/theme-editor.js +133 -14
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.js +1 -1
- package/package.json +1 -1
- package/src/components/reasoning-bubble.ts +139 -5
- package/src/defaults.ts +1 -0
- package/src/install.ts +14 -3
- package/src/runtime/init.test.ts +132 -0
- package/src/theme-reference.ts +6 -3
- package/src/tool-call-display-defaults.test.ts +1 -0
- package/src/types.ts +58 -0
- package/src/utils/code-generators.test.ts +57 -0
- package/src/utils/code-generators.ts +21 -6
- package/src/utils/formatting.test.ts +25 -1
- package/src/utils/formatting.ts +15 -0
- package/src/utils/message-fingerprint.test.ts +12 -0
- package/src/utils/message-fingerprint.ts +1 -0
- package/src/utils/morph.test.ts +86 -0
- package/src/utils/morph.ts +8 -0
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";
|
|
@@ -4956,6 +5014,12 @@ type CodeGeneratorOptions = {
|
|
|
4956
5014
|
* @default true
|
|
4957
5015
|
*/
|
|
4958
5016
|
includeHookComments?: boolean;
|
|
5017
|
+
/**
|
|
5018
|
+
* If provided, emits `windowKey` in the generated `initAgentWidget()` call
|
|
5019
|
+
* so the widget handle is stored on `window[windowKey]`.
|
|
5020
|
+
* Only affects script formats (script-installer, script-manual, script-advanced).
|
|
5021
|
+
*/
|
|
5022
|
+
windowKey?: string;
|
|
4959
5023
|
};
|
|
4960
5024
|
declare function generateCodeSnippet(config: any, format?: CodeFormat, options?: CodeGeneratorOptions): string;
|
|
4961
5025
|
|
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";
|
|
@@ -4956,6 +5014,12 @@ type CodeGeneratorOptions = {
|
|
|
4956
5014
|
* @default true
|
|
4957
5015
|
*/
|
|
4958
5016
|
includeHookComments?: boolean;
|
|
5017
|
+
/**
|
|
5018
|
+
* If provided, emits `windowKey` in the generated `initAgentWidget()` call
|
|
5019
|
+
* so the widget handle is stored on `window[windowKey]`.
|
|
5020
|
+
* Only affects script formats (script-installer, script-manual, script-advanced).
|
|
5021
|
+
*/
|
|
5022
|
+
windowKey?: string;
|
|
4959
5023
|
};
|
|
4960
5024
|
declare function generateCodeSnippet(config: any, format?: CodeFormat, options?: CodeGeneratorOptions): string;
|
|
4961
5025
|
|