@runtypelabs/persona 3.9.2 → 3.10.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.cjs +46 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.global.js +67 -64
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +46 -43
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +826 -210
- package/dist/theme-editor.d.cts +128 -3
- package/dist/theme-editor.d.ts +128 -3
- package/dist/theme-editor.js +822 -210
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +8 -0
- package/dist/theme-reference.d.ts +8 -0
- package/dist/theme-reference.js +1 -1
- package/dist/widget.css +124 -0
- package/package.json +1 -1
- package/src/client.test.ts +312 -1
- package/src/client.ts +247 -24
- package/src/components/messages.ts +1 -1
- package/src/components/reasoning-bubble.ts +117 -28
- package/src/components/tool-bubble.ts +161 -27
- package/src/defaults.ts +12 -0
- package/src/styles/widget.css +124 -0
- package/src/theme-editor/index.ts +5 -0
- package/src/theme-editor/preview-utils.test.ts +58 -0
- package/src/theme-editor/preview-utils.ts +220 -4
- package/src/theme-editor/sections.test.ts +20 -0
- package/src/theme-editor/sections.ts +10 -0
- package/src/theme-reference.ts +8 -3
- package/src/tool-call-display-defaults.test.ts +23 -0
- package/src/types.ts +126 -0
- package/src/ui.scroll.test.ts +104 -0
- package/src/ui.tool-display.test.ts +204 -0
- package/src/ui.ts +103 -3
- package/src/utils/message-fingerprint.test.ts +17 -0
- package/src/utils/message-fingerprint.ts +13 -1
package/dist/theme-editor.d.cts
CHANGED
|
@@ -1125,12 +1125,71 @@ type AgentWidgetScrollToBottomFeature = {
|
|
|
1125
1125
|
*/
|
|
1126
1126
|
label?: string;
|
|
1127
1127
|
};
|
|
1128
|
+
type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
|
|
1129
|
+
type AgentWidgetToolCallDisplayFeature = {
|
|
1130
|
+
/**
|
|
1131
|
+
* Controls what collapsed tool call rows show in their header/summary area.
|
|
1132
|
+
* @default "tool-call"
|
|
1133
|
+
*/
|
|
1134
|
+
collapsedMode?: AgentWidgetToolCallCollapsedMode;
|
|
1135
|
+
/**
|
|
1136
|
+
* When true, active collapsed tool calls can render a lightweight preview block.
|
|
1137
|
+
* @default false
|
|
1138
|
+
*/
|
|
1139
|
+
activePreview?: boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* Optional CSS min-height applied to active collapsed tool call rows.
|
|
1142
|
+
*/
|
|
1143
|
+
activeMinHeight?: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Maximum preview lines shown for collapsed active tool calls.
|
|
1146
|
+
* @default 3
|
|
1147
|
+
*/
|
|
1148
|
+
previewMaxLines?: number;
|
|
1149
|
+
/**
|
|
1150
|
+
* When true, consecutive tool call rows can be visually grouped.
|
|
1151
|
+
* @default false
|
|
1152
|
+
*/
|
|
1153
|
+
grouped?: boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* When false, tool call bubbles show only the collapsed summary with no
|
|
1156
|
+
* expand/collapse toggle. Users see tool awareness without full details.
|
|
1157
|
+
* @default true
|
|
1158
|
+
*/
|
|
1159
|
+
expandable?: boolean;
|
|
1160
|
+
};
|
|
1161
|
+
type AgentWidgetReasoningDisplayFeature = {
|
|
1162
|
+
/**
|
|
1163
|
+
* When true, active collapsed reasoning rows can render a lightweight preview block.
|
|
1164
|
+
* @default false
|
|
1165
|
+
*/
|
|
1166
|
+
activePreview?: boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Optional CSS min-height applied to active collapsed reasoning rows.
|
|
1169
|
+
*/
|
|
1170
|
+
activeMinHeight?: string;
|
|
1171
|
+
/**
|
|
1172
|
+
* Maximum preview lines shown for collapsed active reasoning rows.
|
|
1173
|
+
* @default 3
|
|
1174
|
+
*/
|
|
1175
|
+
previewMaxLines?: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* When false, reasoning bubbles show only the collapsed summary with no
|
|
1178
|
+
* expand/collapse toggle. Users see reasoning awareness without full details.
|
|
1179
|
+
* @default true
|
|
1180
|
+
*/
|
|
1181
|
+
expandable?: boolean;
|
|
1182
|
+
};
|
|
1128
1183
|
type AgentWidgetFeatureFlags = {
|
|
1129
1184
|
showReasoning?: boolean;
|
|
1130
1185
|
showToolCalls?: boolean;
|
|
1131
1186
|
showEventStreamToggle?: boolean;
|
|
1132
1187
|
/** Shared transcript + event stream scroll-to-bottom affordance. */
|
|
1133
1188
|
scrollToBottom?: AgentWidgetScrollToBottomFeature;
|
|
1189
|
+
/** Collapsed transcript behavior for tool call rows. */
|
|
1190
|
+
toolCallDisplay?: AgentWidgetToolCallDisplayFeature;
|
|
1191
|
+
/** Collapsed transcript behavior for reasoning rows. */
|
|
1192
|
+
reasoningDisplay?: AgentWidgetReasoningDisplayFeature;
|
|
1134
1193
|
/** Configuration for the Event Stream inspector view */
|
|
1135
1194
|
eventStream?: EventStreamConfig;
|
|
1136
1195
|
/** Optional artifact sidebar (split pane / mobile drawer) */
|
|
@@ -1630,6 +1689,65 @@ type AgentWidgetToolCallConfig$1 = {
|
|
|
1630
1689
|
codeBlockTextColor?: string;
|
|
1631
1690
|
toggleTextColor?: string;
|
|
1632
1691
|
labelTextColor?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* Override the collapsed summary row content for a tool call bubble.
|
|
1694
|
+
* Return `null` to fall back to the built-in summary for the active display mode.
|
|
1695
|
+
*/
|
|
1696
|
+
renderCollapsedSummary?: (context: {
|
|
1697
|
+
message: AgentWidgetMessage;
|
|
1698
|
+
toolCall: AgentWidgetToolCall;
|
|
1699
|
+
defaultSummary: string;
|
|
1700
|
+
previewText: string;
|
|
1701
|
+
collapsedMode: AgentWidgetToolCallCollapsedMode;
|
|
1702
|
+
isActive: boolean;
|
|
1703
|
+
config: AgentWidgetConfig;
|
|
1704
|
+
}) => HTMLElement | string | null;
|
|
1705
|
+
/**
|
|
1706
|
+
* Override the lightweight collapsed preview content shown for active tool rows.
|
|
1707
|
+
* Return `null` to fall back to the built-in preview text.
|
|
1708
|
+
*/
|
|
1709
|
+
renderCollapsedPreview?: (context: {
|
|
1710
|
+
message: AgentWidgetMessage;
|
|
1711
|
+
toolCall: AgentWidgetToolCall;
|
|
1712
|
+
defaultPreview: string;
|
|
1713
|
+
isActive: boolean;
|
|
1714
|
+
config: AgentWidgetConfig;
|
|
1715
|
+
}) => HTMLElement | string | null;
|
|
1716
|
+
/**
|
|
1717
|
+
* Override the summary content for grouped consecutive tool-call containers.
|
|
1718
|
+
* Return `null` to fall back to the built-in `Called [x] tools` summary.
|
|
1719
|
+
*/
|
|
1720
|
+
renderGroupedSummary?: (context: {
|
|
1721
|
+
messages: AgentWidgetMessage[];
|
|
1722
|
+
toolCalls: AgentWidgetToolCall[];
|
|
1723
|
+
defaultSummary: string;
|
|
1724
|
+
config: AgentWidgetConfig;
|
|
1725
|
+
}) => HTMLElement | string | null;
|
|
1726
|
+
};
|
|
1727
|
+
type AgentWidgetReasoningConfig = {
|
|
1728
|
+
/**
|
|
1729
|
+
* Override the collapsed summary row content for a reasoning bubble.
|
|
1730
|
+
* Return `null` to fall back to the built-in summary.
|
|
1731
|
+
*/
|
|
1732
|
+
renderCollapsedSummary?: (context: {
|
|
1733
|
+
message: AgentWidgetMessage;
|
|
1734
|
+
reasoning: AgentWidgetReasoning;
|
|
1735
|
+
defaultSummary: string;
|
|
1736
|
+
previewText: string;
|
|
1737
|
+
isActive: boolean;
|
|
1738
|
+
config: AgentWidgetConfig;
|
|
1739
|
+
}) => HTMLElement | string | null;
|
|
1740
|
+
/**
|
|
1741
|
+
* Override the lightweight collapsed preview content shown for active reasoning rows.
|
|
1742
|
+
* Return `null` to fall back to the built-in preview text.
|
|
1743
|
+
*/
|
|
1744
|
+
renderCollapsedPreview?: (context: {
|
|
1745
|
+
message: AgentWidgetMessage;
|
|
1746
|
+
reasoning: AgentWidgetReasoning;
|
|
1747
|
+
defaultPreview: string;
|
|
1748
|
+
isActive: boolean;
|
|
1749
|
+
config: AgentWidgetConfig;
|
|
1750
|
+
}) => HTMLElement | string | null;
|
|
1633
1751
|
};
|
|
1634
1752
|
type AgentWidgetSuggestionChipsConfig = {
|
|
1635
1753
|
fontFamily?: "sans-serif" | "serif" | "mono";
|
|
@@ -2685,6 +2803,7 @@ type AgentWidgetConfig = {
|
|
|
2685
2803
|
*/
|
|
2686
2804
|
textToSpeech?: TextToSpeechConfig;
|
|
2687
2805
|
toolCall?: AgentWidgetToolCallConfig$1;
|
|
2806
|
+
reasoning?: AgentWidgetReasoningConfig;
|
|
2688
2807
|
/**
|
|
2689
2808
|
* Configuration for tool approval bubbles.
|
|
2690
2809
|
* Set to `false` to disable built-in approval handling entirely.
|
|
@@ -3750,16 +3869,22 @@ declare const MOCK_WORKSPACE_CONTENT = "\n <div class=\"preview-workspace-con
|
|
|
3750
3869
|
*/
|
|
3751
3870
|
declare function buildSrcdoc(mountId: string, shellMode: 'light' | 'dark', docked: boolean, widgetCssPath: string): string;
|
|
3752
3871
|
type PreviewScene = 'home' | 'conversation' | 'minimized' | 'artifact';
|
|
3753
|
-
|
|
3754
|
-
declare function
|
|
3872
|
+
type PreviewTranscriptEntryPreset = 'user-message' | 'assistant-message' | 'reasoning-streaming' | 'reasoning-complete' | 'tool-running' | 'tool-complete';
|
|
3873
|
+
declare function getPreviewTranscriptPresetLabel(preset: PreviewTranscriptEntryPreset): string;
|
|
3874
|
+
declare function createPreviewTranscriptEntry(preset: PreviewTranscriptEntryPreset, index?: number): AgentWidgetMessage;
|
|
3875
|
+
declare function appendPreviewTranscriptEntry(messages: AgentWidgetMessage[], preset: PreviewTranscriptEntryPreset): AgentWidgetMessage[];
|
|
3876
|
+
declare function createPreviewMessages(scene: PreviewScene, config?: Partial<AgentWidgetConfig>, appendedMessages?: AgentWidgetMessage[]): AgentWidgetMessage[];
|
|
3877
|
+
declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene, appendedMessages?: AgentWidgetMessage[]): AgentWidgetConfig;
|
|
3755
3878
|
|
|
3756
3879
|
interface PreviewConfigOptions {
|
|
3757
3880
|
config?: Partial<AgentWidgetConfig>;
|
|
3758
3881
|
theme?: DeepPartial<PersonaTheme>;
|
|
3759
3882
|
darkTheme?: DeepPartial<PersonaTheme>;
|
|
3760
3883
|
scene?: PreviewScene;
|
|
3884
|
+
appendedMessages?: AgentWidgetMessage[];
|
|
3761
3885
|
}
|
|
3762
3886
|
declare function buildPreviewConfig(options: PreviewConfigOptions, shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
|
|
3887
|
+
declare function buildPreviewConfigWithMessages(options: PreviewConfigOptions, messages: AgentWidgetMessage[], shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
|
|
3763
3888
|
|
|
3764
3889
|
/**
|
|
3765
3890
|
* Imperative preview renderer for the theme editor.
|
|
@@ -3924,4 +4049,4 @@ declare function paletteColorPath(family: string, shade: string): string;
|
|
|
3924
4049
|
declare function resolveThemeColorPath(get: (path: string) => unknown, path: string, depth?: number): string;
|
|
3925
4050
|
declare function tokenRefDisplayName(path: string): string;
|
|
3926
4051
|
|
|
3927
|
-
export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, applySceneConfig, applyShellTheme, buildPreviewConfig, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
|
|
4052
|
+
export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, type PreviewTranscriptEntryPreset, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, appendPreviewTranscriptEntry, applySceneConfig, applyShellTheme, buildPreviewConfig, buildPreviewConfigWithMessages, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createPreviewTranscriptEntry, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getPreviewTranscriptPresetLabel, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
|
package/dist/theme-editor.d.ts
CHANGED
|
@@ -1125,12 +1125,71 @@ type AgentWidgetScrollToBottomFeature = {
|
|
|
1125
1125
|
*/
|
|
1126
1126
|
label?: string;
|
|
1127
1127
|
};
|
|
1128
|
+
type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-preview";
|
|
1129
|
+
type AgentWidgetToolCallDisplayFeature = {
|
|
1130
|
+
/**
|
|
1131
|
+
* Controls what collapsed tool call rows show in their header/summary area.
|
|
1132
|
+
* @default "tool-call"
|
|
1133
|
+
*/
|
|
1134
|
+
collapsedMode?: AgentWidgetToolCallCollapsedMode;
|
|
1135
|
+
/**
|
|
1136
|
+
* When true, active collapsed tool calls can render a lightweight preview block.
|
|
1137
|
+
* @default false
|
|
1138
|
+
*/
|
|
1139
|
+
activePreview?: boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* Optional CSS min-height applied to active collapsed tool call rows.
|
|
1142
|
+
*/
|
|
1143
|
+
activeMinHeight?: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Maximum preview lines shown for collapsed active tool calls.
|
|
1146
|
+
* @default 3
|
|
1147
|
+
*/
|
|
1148
|
+
previewMaxLines?: number;
|
|
1149
|
+
/**
|
|
1150
|
+
* When true, consecutive tool call rows can be visually grouped.
|
|
1151
|
+
* @default false
|
|
1152
|
+
*/
|
|
1153
|
+
grouped?: boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* When false, tool call bubbles show only the collapsed summary with no
|
|
1156
|
+
* expand/collapse toggle. Users see tool awareness without full details.
|
|
1157
|
+
* @default true
|
|
1158
|
+
*/
|
|
1159
|
+
expandable?: boolean;
|
|
1160
|
+
};
|
|
1161
|
+
type AgentWidgetReasoningDisplayFeature = {
|
|
1162
|
+
/**
|
|
1163
|
+
* When true, active collapsed reasoning rows can render a lightweight preview block.
|
|
1164
|
+
* @default false
|
|
1165
|
+
*/
|
|
1166
|
+
activePreview?: boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Optional CSS min-height applied to active collapsed reasoning rows.
|
|
1169
|
+
*/
|
|
1170
|
+
activeMinHeight?: string;
|
|
1171
|
+
/**
|
|
1172
|
+
* Maximum preview lines shown for collapsed active reasoning rows.
|
|
1173
|
+
* @default 3
|
|
1174
|
+
*/
|
|
1175
|
+
previewMaxLines?: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* When false, reasoning bubbles show only the collapsed summary with no
|
|
1178
|
+
* expand/collapse toggle. Users see reasoning awareness without full details.
|
|
1179
|
+
* @default true
|
|
1180
|
+
*/
|
|
1181
|
+
expandable?: boolean;
|
|
1182
|
+
};
|
|
1128
1183
|
type AgentWidgetFeatureFlags = {
|
|
1129
1184
|
showReasoning?: boolean;
|
|
1130
1185
|
showToolCalls?: boolean;
|
|
1131
1186
|
showEventStreamToggle?: boolean;
|
|
1132
1187
|
/** Shared transcript + event stream scroll-to-bottom affordance. */
|
|
1133
1188
|
scrollToBottom?: AgentWidgetScrollToBottomFeature;
|
|
1189
|
+
/** Collapsed transcript behavior for tool call rows. */
|
|
1190
|
+
toolCallDisplay?: AgentWidgetToolCallDisplayFeature;
|
|
1191
|
+
/** Collapsed transcript behavior for reasoning rows. */
|
|
1192
|
+
reasoningDisplay?: AgentWidgetReasoningDisplayFeature;
|
|
1134
1193
|
/** Configuration for the Event Stream inspector view */
|
|
1135
1194
|
eventStream?: EventStreamConfig;
|
|
1136
1195
|
/** Optional artifact sidebar (split pane / mobile drawer) */
|
|
@@ -1630,6 +1689,65 @@ type AgentWidgetToolCallConfig$1 = {
|
|
|
1630
1689
|
codeBlockTextColor?: string;
|
|
1631
1690
|
toggleTextColor?: string;
|
|
1632
1691
|
labelTextColor?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* Override the collapsed summary row content for a tool call bubble.
|
|
1694
|
+
* Return `null` to fall back to the built-in summary for the active display mode.
|
|
1695
|
+
*/
|
|
1696
|
+
renderCollapsedSummary?: (context: {
|
|
1697
|
+
message: AgentWidgetMessage;
|
|
1698
|
+
toolCall: AgentWidgetToolCall;
|
|
1699
|
+
defaultSummary: string;
|
|
1700
|
+
previewText: string;
|
|
1701
|
+
collapsedMode: AgentWidgetToolCallCollapsedMode;
|
|
1702
|
+
isActive: boolean;
|
|
1703
|
+
config: AgentWidgetConfig;
|
|
1704
|
+
}) => HTMLElement | string | null;
|
|
1705
|
+
/**
|
|
1706
|
+
* Override the lightweight collapsed preview content shown for active tool rows.
|
|
1707
|
+
* Return `null` to fall back to the built-in preview text.
|
|
1708
|
+
*/
|
|
1709
|
+
renderCollapsedPreview?: (context: {
|
|
1710
|
+
message: AgentWidgetMessage;
|
|
1711
|
+
toolCall: AgentWidgetToolCall;
|
|
1712
|
+
defaultPreview: string;
|
|
1713
|
+
isActive: boolean;
|
|
1714
|
+
config: AgentWidgetConfig;
|
|
1715
|
+
}) => HTMLElement | string | null;
|
|
1716
|
+
/**
|
|
1717
|
+
* Override the summary content for grouped consecutive tool-call containers.
|
|
1718
|
+
* Return `null` to fall back to the built-in `Called [x] tools` summary.
|
|
1719
|
+
*/
|
|
1720
|
+
renderGroupedSummary?: (context: {
|
|
1721
|
+
messages: AgentWidgetMessage[];
|
|
1722
|
+
toolCalls: AgentWidgetToolCall[];
|
|
1723
|
+
defaultSummary: string;
|
|
1724
|
+
config: AgentWidgetConfig;
|
|
1725
|
+
}) => HTMLElement | string | null;
|
|
1726
|
+
};
|
|
1727
|
+
type AgentWidgetReasoningConfig = {
|
|
1728
|
+
/**
|
|
1729
|
+
* Override the collapsed summary row content for a reasoning bubble.
|
|
1730
|
+
* Return `null` to fall back to the built-in summary.
|
|
1731
|
+
*/
|
|
1732
|
+
renderCollapsedSummary?: (context: {
|
|
1733
|
+
message: AgentWidgetMessage;
|
|
1734
|
+
reasoning: AgentWidgetReasoning;
|
|
1735
|
+
defaultSummary: string;
|
|
1736
|
+
previewText: string;
|
|
1737
|
+
isActive: boolean;
|
|
1738
|
+
config: AgentWidgetConfig;
|
|
1739
|
+
}) => HTMLElement | string | null;
|
|
1740
|
+
/**
|
|
1741
|
+
* Override the lightweight collapsed preview content shown for active reasoning rows.
|
|
1742
|
+
* Return `null` to fall back to the built-in preview text.
|
|
1743
|
+
*/
|
|
1744
|
+
renderCollapsedPreview?: (context: {
|
|
1745
|
+
message: AgentWidgetMessage;
|
|
1746
|
+
reasoning: AgentWidgetReasoning;
|
|
1747
|
+
defaultPreview: string;
|
|
1748
|
+
isActive: boolean;
|
|
1749
|
+
config: AgentWidgetConfig;
|
|
1750
|
+
}) => HTMLElement | string | null;
|
|
1633
1751
|
};
|
|
1634
1752
|
type AgentWidgetSuggestionChipsConfig = {
|
|
1635
1753
|
fontFamily?: "sans-serif" | "serif" | "mono";
|
|
@@ -2685,6 +2803,7 @@ type AgentWidgetConfig = {
|
|
|
2685
2803
|
*/
|
|
2686
2804
|
textToSpeech?: TextToSpeechConfig;
|
|
2687
2805
|
toolCall?: AgentWidgetToolCallConfig$1;
|
|
2806
|
+
reasoning?: AgentWidgetReasoningConfig;
|
|
2688
2807
|
/**
|
|
2689
2808
|
* Configuration for tool approval bubbles.
|
|
2690
2809
|
* Set to `false` to disable built-in approval handling entirely.
|
|
@@ -3750,16 +3869,22 @@ declare const MOCK_WORKSPACE_CONTENT = "\n <div class=\"preview-workspace-con
|
|
|
3750
3869
|
*/
|
|
3751
3870
|
declare function buildSrcdoc(mountId: string, shellMode: 'light' | 'dark', docked: boolean, widgetCssPath: string): string;
|
|
3752
3871
|
type PreviewScene = 'home' | 'conversation' | 'minimized' | 'artifact';
|
|
3753
|
-
|
|
3754
|
-
declare function
|
|
3872
|
+
type PreviewTranscriptEntryPreset = 'user-message' | 'assistant-message' | 'reasoning-streaming' | 'reasoning-complete' | 'tool-running' | 'tool-complete';
|
|
3873
|
+
declare function getPreviewTranscriptPresetLabel(preset: PreviewTranscriptEntryPreset): string;
|
|
3874
|
+
declare function createPreviewTranscriptEntry(preset: PreviewTranscriptEntryPreset, index?: number): AgentWidgetMessage;
|
|
3875
|
+
declare function appendPreviewTranscriptEntry(messages: AgentWidgetMessage[], preset: PreviewTranscriptEntryPreset): AgentWidgetMessage[];
|
|
3876
|
+
declare function createPreviewMessages(scene: PreviewScene, config?: Partial<AgentWidgetConfig>, appendedMessages?: AgentWidgetMessage[]): AgentWidgetMessage[];
|
|
3877
|
+
declare function applySceneConfig(base: AgentWidgetConfig, scene: PreviewScene, appendedMessages?: AgentWidgetMessage[]): AgentWidgetConfig;
|
|
3755
3878
|
|
|
3756
3879
|
interface PreviewConfigOptions {
|
|
3757
3880
|
config?: Partial<AgentWidgetConfig>;
|
|
3758
3881
|
theme?: DeepPartial<PersonaTheme>;
|
|
3759
3882
|
darkTheme?: DeepPartial<PersonaTheme>;
|
|
3760
3883
|
scene?: PreviewScene;
|
|
3884
|
+
appendedMessages?: AgentWidgetMessage[];
|
|
3761
3885
|
}
|
|
3762
3886
|
declare function buildPreviewConfig(options: PreviewConfigOptions, shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
|
|
3887
|
+
declare function buildPreviewConfigWithMessages(options: PreviewConfigOptions, messages: AgentWidgetMessage[], shellModeOverride?: 'light' | 'dark'): AgentWidgetConfig;
|
|
3763
3888
|
|
|
3764
3889
|
/**
|
|
3765
3890
|
* Imperative preview renderer for the theme editor.
|
|
@@ -3924,4 +4049,4 @@ declare function paletteColorPath(family: string, shade: string): string;
|
|
|
3924
4049
|
declare function resolveThemeColorPath(get: (path: string) => unknown, path: string, depth?: number): string;
|
|
3925
4050
|
declare function tokenRefDisplayName(path: string): string;
|
|
3926
4051
|
|
|
3927
|
-
export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, applySceneConfig, applyShellTheme, buildPreviewConfig, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
|
|
4052
|
+
export { ADVANCED_TOKENS_SECTION, ALL_ROLES, ALL_TABS, BRAND_PALETTE_SECTION, BUILT_IN_PRESETS, COLORS_SECTIONS, COLOR_FAMILIES, COMPONENTS_SECTIONS, COMPONENT_COLOR_SECTIONS, COMPONENT_SHAPE_SECTIONS, CONFIGURE_SECTIONS, CONFIGURE_SUB_GROUPS, type ColorScaleOptions, type CompareMode, type ConfigChangeListener, type ConfiguratorSnapshot, DEVICE_DIMENSIONS, type DetectedRoleAssignment, type FieldDef, type FieldType, HOME_SUGGESTION_CHIPS, INTERFACE_ROLES_SECTION, MOCK_BROWSER_CONTENT, MOCK_WORKSPACE_CONTENT, type OnChangeCallback, PALETTE_SECTION, PREVIEW_STORAGE_ADAPTER, type PreviewConfigOptions, type PreviewDevice, type PreviewLifecycleContext, type PreviewScene, type PreviewShellMode, type PreviewShellPalette, type PreviewTranscriptEntryPreset, ROLE_ASSISTANT_MESSAGES, ROLE_BORDERS, ROLE_FAMILIES, ROLE_FAMILY_LABELS, ROLE_HEADER, ROLE_INPUT, ROLE_INTENSITIES, ROLE_LINKS_FOCUS, ROLE_PRIMARY_ACTIONS, ROLE_SCROLL_TO_BOTTOM, ROLE_SURFACES, ROLE_USER_MESSAGES, type RoleAssignmentOptions, type RoleFamily, type RoleIntensity, type RoleTarget, type RoleTargetKind, SEMANTIC_COLORS_SECTION, SHADE_KEYS, SHELL_STYLE_ID, STATUS_COLORS_SECTION, STATUS_PALETTE_SECTION, STYLE_SECTIONS, STYLE_SECTIONS_V2, type SectionDef, type SectionPreset, type SelectOption, type SliderOptions, type SubGroupDef, THEME_EDITOR_PRESETS, THEME_SECTION, type TabDef, type ThemeEditorPreset, ThemeEditorState, type ThemePreviewHandle, type ThemePreviewOptions, type TokenRefOptions, ZOOM_MAX, ZOOM_MIN, appendPreviewTranscriptEntry, applySceneConfig, applyShellTheme, buildPreviewConfig, buildPreviewConfigWithMessages, buildShellCss, buildSrcdoc, convertFromPx, convertToPx, createPreviewMessages, createPreviewTranscriptEntry, createThemePreview, detectRoleAssignment, escapeHtml, findSection, formatCssValue, generateColorScale, getPreviewTranscriptPresetLabel, getShellPalette, getThemeEditorPreset, hexToHsl, hslToHex, isValidHex, normalizeColorValue, paletteColorPath, parseCssValue, resolveRoleAssignment, resolveThemeColorPath, scopeSection, tokenRefDisplayName, wcagContrastRatio };
|