@runtypelabs/persona 3.29.1 → 3.30.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 +55 -0
- package/dist/codegen.cjs +6 -6
- package/dist/codegen.js +4 -4
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -7
- package/dist/index.d.ts +112 -7
- package/dist/index.global.js +59 -59
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/launcher.global.js +2 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/plugin-kit.cjs +1 -0
- package/dist/plugin-kit.d.cts +98 -0
- package/dist/plugin-kit.d.ts +98 -0
- package/dist/plugin-kit.js +1 -0
- package/dist/smart-dom-reader.d.cts +107 -4
- package/dist/smart-dom-reader.d.ts +107 -4
- package/dist/theme-editor.cjs +38 -38
- package/dist/theme-editor.d.cts +111 -6
- package/dist/theme-editor.d.ts +111 -6
- package/dist/theme-editor.js +38 -38
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +2 -0
- package/dist/theme-reference.d.ts +2 -0
- package/dist/theme-reference.js +1 -1
- package/package.json +8 -2
- package/src/components/approval-bubble.test.ts +268 -0
- package/src/components/approval-bubble.ts +170 -20
- package/src/components/launcher.ts +6 -3
- package/src/components/tool-bubble.test.ts +39 -0
- package/src/components/tool-bubble.ts +4 -0
- package/src/index-core.ts +1 -0
- package/src/plugin-kit.test.ts +230 -0
- package/src/plugin-kit.ts +294 -0
- package/src/plugins/types.ts +49 -2
- package/src/session.test.ts +99 -0
- package/src/session.ts +14 -3
- package/src/theme-editor/preview-utils.test.ts +10 -0
- package/src/theme-editor/preview-utils.ts +29 -1
- package/src/theme-editor/sections.test.ts +17 -0
- package/src/theme-editor/sections.ts +31 -0
- package/src/theme-reference.ts +1 -1
- package/src/types/theme.ts +2 -0
- package/src/types.ts +59 -2
- package/src/ui.approval-plugin.test.ts +204 -0
- package/src/ui.ts +149 -16
- package/src/utils/theme.test.ts +6 -2
- package/src/utils/theme.ts +0 -8
- package/src/utils/tokens.ts +6 -1
- package/src/webmcp-bridge.test.ts +66 -0
- package/src/webmcp-bridge.ts +49 -0
package/dist/index.d.cts
CHANGED
|
@@ -149,13 +149,59 @@ interface AgentWidgetPlugin {
|
|
|
149
149
|
config: AgentWidgetConfig;
|
|
150
150
|
}) => HTMLElement | null;
|
|
151
151
|
/**
|
|
152
|
-
* Custom renderer for approval bubbles
|
|
153
|
-
*
|
|
152
|
+
* Custom renderer for approval bubbles.
|
|
153
|
+
*
|
|
154
|
+
* Return an `HTMLElement` to fully own the approval UI, `defaultRenderer()`
|
|
155
|
+
* to render (or wrap) the built-in bubble, or `null` to fall through to the
|
|
156
|
+
* default. Unlike the built-in bubble — whose Approve/Deny buttons are wired
|
|
157
|
+
* via delegation — a fully custom element resolves the approval by calling
|
|
158
|
+
* the `approve`/`deny` callbacks. Both route through the same path the
|
|
159
|
+
* built-in buttons use (optimistic update, `onDecision`, in-place anchoring).
|
|
160
|
+
*
|
|
161
|
+
* An approval is a single binary gate, so there are exactly two outcomes.
|
|
162
|
+
* Pass `{ remember: true }` to flag a "remember this" affordance (e.g. an
|
|
163
|
+
* "Always allow" button); the current approval resolves identically, but the
|
|
164
|
+
* flag is forwarded to `config.approval.onDecision` so you can persist a
|
|
165
|
+
* don't-ask-again policy for future approvals.
|
|
166
|
+
*
|
|
167
|
+
* `renderApproval` is called again whenever the approval's status changes, so
|
|
168
|
+
* branch on `message.approval?.status` to render the resolved state (and tear
|
|
169
|
+
* down any global listeners you added while pending).
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // An alternative prompt: "Always allow" / "Allow once" / "Deny".
|
|
174
|
+
* renderApproval: ({ message, approve, deny }) => {
|
|
175
|
+
* const approval = message.approval;
|
|
176
|
+
* if (!approval || approval.status !== "pending") return null; // default renders resolved state
|
|
177
|
+
* const root = document.createElement("div");
|
|
178
|
+
* root.textContent = `${approval.toolName} requires approval`;
|
|
179
|
+
*
|
|
180
|
+
* const always = document.createElement("button");
|
|
181
|
+
* always.textContent = "Always allow";
|
|
182
|
+
* always.addEventListener("click", () => approve({ remember: true }));
|
|
183
|
+
*
|
|
184
|
+
* const once = document.createElement("button");
|
|
185
|
+
* once.textContent = "Allow once";
|
|
186
|
+
* once.addEventListener("click", () => approve());
|
|
187
|
+
*
|
|
188
|
+
* const no = document.createElement("button");
|
|
189
|
+
* no.textContent = "Deny";
|
|
190
|
+
* no.addEventListener("click", () => deny());
|
|
191
|
+
*
|
|
192
|
+
* root.append(always, once, no);
|
|
193
|
+
* return root;
|
|
194
|
+
* }
|
|
195
|
+
* ```
|
|
154
196
|
*/
|
|
155
197
|
renderApproval?: (context: {
|
|
156
198
|
message: AgentWidgetMessage;
|
|
157
199
|
defaultRenderer: () => HTMLElement;
|
|
158
200
|
config: AgentWidgetConfig;
|
|
201
|
+
/** Resolve this approval as approved. Pass `{ remember: true }` for an "Always allow" affordance. */
|
|
202
|
+
approve: (options?: AgentWidgetApprovalDecisionOptions) => void;
|
|
203
|
+
/** Resolve this approval as denied. Pass `{ remember: true }` for an "Always deny" affordance. */
|
|
204
|
+
deny: (options?: AgentWidgetApprovalDecisionOptions) => void;
|
|
159
205
|
}) => HTMLElement | null;
|
|
160
206
|
/**
|
|
161
207
|
* Custom renderer for loading indicator
|
|
@@ -530,6 +576,8 @@ interface ApprovalTokens {
|
|
|
530
576
|
background: TokenReference<'color'>;
|
|
531
577
|
border: TokenReference<'color'>;
|
|
532
578
|
text: TokenReference<'color'>;
|
|
579
|
+
/** Box-shadow for the approval bubble (token ref or raw CSS, e.g. `none`). */
|
|
580
|
+
shadow: string;
|
|
533
581
|
};
|
|
534
582
|
approve: ComponentTokenSet;
|
|
535
583
|
deny: ComponentTokenSet;
|
|
@@ -2166,6 +2214,12 @@ type WebMcpConfirmInfo = {
|
|
|
2166
2214
|
toolName: string;
|
|
2167
2215
|
args: unknown;
|
|
2168
2216
|
description?: string;
|
|
2217
|
+
/**
|
|
2218
|
+
* Display title the tool declared via the WebMCP spec's
|
|
2219
|
+
* `ToolDescriptor.title` (e.g. `"Add to Cart"`). Absent when the tool
|
|
2220
|
+
* didn't declare one.
|
|
2221
|
+
*/
|
|
2222
|
+
title?: string;
|
|
2169
2223
|
annotations?: {
|
|
2170
2224
|
readOnlyHint?: boolean;
|
|
2171
2225
|
untrustedContentHint?: boolean;
|
|
@@ -3625,6 +3679,22 @@ interface VoiceProvider {
|
|
|
3625
3679
|
/** Stop playback / cancel in-flight request without starting recording */
|
|
3626
3680
|
stopPlayback?(): void;
|
|
3627
3681
|
}
|
|
3682
|
+
/**
|
|
3683
|
+
* Extra context for an approval decision, surfaced to `onDecision` and to the
|
|
3684
|
+
* `approve`/`deny` callbacks passed to the `renderApproval` plugin hook.
|
|
3685
|
+
*/
|
|
3686
|
+
type AgentWidgetApprovalDecisionOptions = {
|
|
3687
|
+
/**
|
|
3688
|
+
* The user chose a "remember this" affordance (e.g. an "Always allow"
|
|
3689
|
+
* button) rather than a one-time decision. The widget resolves the *current*
|
|
3690
|
+
* approval identically whether or not this is set — an approval bubble is a
|
|
3691
|
+
* single binary gate (`approved`/`denied`). Persisting a don't-ask-again
|
|
3692
|
+
* policy for *future* approvals (auto-resolving them, or not surfacing them)
|
|
3693
|
+
* is the integrator's responsibility, typically inside `onDecision`.
|
|
3694
|
+
* Defaults to absent/`false`.
|
|
3695
|
+
*/
|
|
3696
|
+
remember?: boolean;
|
|
3697
|
+
};
|
|
3628
3698
|
/**
|
|
3629
3699
|
* Configuration for tool approval bubbles.
|
|
3630
3700
|
* Controls styling, labels, and behavior of the approval UI.
|
|
@@ -3634,6 +3704,8 @@ type AgentWidgetApprovalConfig = {
|
|
|
3634
3704
|
backgroundColor?: string;
|
|
3635
3705
|
/** Border color of the approval bubble */
|
|
3636
3706
|
borderColor?: string;
|
|
3707
|
+
/** Box-shadow for the approval bubble; pass `"none"` to remove it. Overrides the default `persona-shadow-sm`. */
|
|
3708
|
+
shadow?: string;
|
|
3637
3709
|
/** Color for the title text */
|
|
3638
3710
|
titleColor?: string;
|
|
3639
3711
|
/** Color for the description text */
|
|
@@ -3656,20 +3728,51 @@ type AgentWidgetApprovalConfig = {
|
|
|
3656
3728
|
approveLabel?: string;
|
|
3657
3729
|
/** Label for the deny button */
|
|
3658
3730
|
denyLabel?: string;
|
|
3731
|
+
/**
|
|
3732
|
+
* How the technical details (the tool's agent-facing description and the
|
|
3733
|
+
* raw parameters JSON) are presented:
|
|
3734
|
+
* - `"collapsed"` (default) — hidden behind a "Show details" toggle
|
|
3735
|
+
* - `"expanded"` — visible, with the toggle available to hide them
|
|
3736
|
+
* - `"hidden"` — never rendered
|
|
3737
|
+
*/
|
|
3738
|
+
detailsDisplay?: "collapsed" | "expanded" | "hidden";
|
|
3739
|
+
/** Label for the toggle that reveals the technical details */
|
|
3740
|
+
showDetailsLabel?: string;
|
|
3741
|
+
/** Label for the toggle that hides the technical details */
|
|
3742
|
+
hideDetailsLabel?: string;
|
|
3743
|
+
/**
|
|
3744
|
+
* Build the user-facing summary line for an approval request. Overrides the
|
|
3745
|
+
* default "The assistant wants to use “Tool name”." copy. Return a falsy
|
|
3746
|
+
* value to fall back to the default for that approval. `displayTitle` is
|
|
3747
|
+
* the display name the tool declared via the WebMCP spec's
|
|
3748
|
+
* `ToolDescriptor.title`, when one exists.
|
|
3749
|
+
*/
|
|
3750
|
+
formatDescription?: (approval: {
|
|
3751
|
+
toolName: string;
|
|
3752
|
+
toolType?: string;
|
|
3753
|
+
description: string;
|
|
3754
|
+
parameters?: unknown;
|
|
3755
|
+
displayTitle?: string;
|
|
3756
|
+
}) => string | undefined;
|
|
3659
3757
|
/**
|
|
3660
3758
|
* Custom handler for approval decisions.
|
|
3661
3759
|
* Return void to let the SDK auto-resolve via the API,
|
|
3662
3760
|
* or return a Response/ReadableStream for custom handling.
|
|
3761
|
+
*
|
|
3762
|
+
* `options.remember` is `true` when the decision came from a "remember this"
|
|
3763
|
+
* affordance (e.g. an "Always allow" button in a custom `renderApproval`
|
|
3764
|
+
* plugin). Use it to persist a don't-ask-again policy for future approvals;
|
|
3765
|
+
* the current approval resolves the same way regardless.
|
|
3663
3766
|
*/
|
|
3664
3767
|
onDecision?: (data: {
|
|
3665
3768
|
approvalId: string;
|
|
3666
3769
|
executionId: string;
|
|
3667
3770
|
agentId: string;
|
|
3668
3771
|
toolName: string;
|
|
3669
|
-
}, decision: 'approved' | 'denied') => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
3772
|
+
}, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions) => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
3670
3773
|
};
|
|
3671
3774
|
type AgentWidgetToolCallConfig = {
|
|
3672
|
-
/** Box-shadow for tool-call bubbles;
|
|
3775
|
+
/** Box-shadow for tool-call bubbles; pass `"none"` to remove it. Overrides the `components.toolBubble.shadow` token / `--persona-tool-bubble-shadow`. */
|
|
3673
3776
|
shadow?: string;
|
|
3674
3777
|
/** Background color of the tool call bubble container. */
|
|
3675
3778
|
backgroundColor?: string;
|
|
@@ -6371,7 +6474,7 @@ declare class AgentWidgetSession {
|
|
|
6371
6474
|
* Updates the approval message status, calls the API (or custom onDecision),
|
|
6372
6475
|
* and pipes the response stream through connectStream().
|
|
6373
6476
|
*/
|
|
6374
|
-
resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied'): Promise<void>;
|
|
6477
|
+
resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions): Promise<void>;
|
|
6375
6478
|
/**
|
|
6376
6479
|
* Resolve a paused `ask_user_question` LOCAL tool call.
|
|
6377
6480
|
*
|
|
@@ -6690,8 +6793,10 @@ type Controller = {
|
|
|
6690
6793
|
* Programmatically resolve a pending approval.
|
|
6691
6794
|
* @param approvalId - The approval ID to resolve
|
|
6692
6795
|
* @param decision - "approved" or "denied"
|
|
6796
|
+
* @param options - Optional decision context (e.g. `{ remember: true }`),
|
|
6797
|
+
* forwarded to `config.approval.onDecision`.
|
|
6693
6798
|
*/
|
|
6694
|
-
resolveApproval: (approvalId: string, decision: 'approved' | 'denied') => Promise<void>;
|
|
6799
|
+
resolveApproval: (approvalId: string, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions) => Promise<void>;
|
|
6695
6800
|
};
|
|
6696
6801
|
declare const createAgentExperience: (mount: HTMLElement, initialConfig?: AgentWidgetConfig, runtimeOptions?: {
|
|
6697
6802
|
debugTools?: boolean;
|
|
@@ -8514,4 +8619,4 @@ interface DemoCarouselHandle {
|
|
|
8514
8619
|
}
|
|
8515
8620
|
declare function createDemoCarousel(container: HTMLElement, options: DemoCarouselOptions): DemoCarouselHandle;
|
|
8516
8621
|
|
|
8517
|
-
export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type RuntypeAgentSSEEvent, type RuntypeAgentTurnCompleteEvent, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeDispatchSSEEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, isWebMcpToolName, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
|
|
8622
|
+
export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetApprovalDecisionOptions, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type RuntypeAgentSSEEvent, type RuntypeAgentTurnCompleteEvent, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeDispatchSSEEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, isWebMcpToolName, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -149,13 +149,59 @@ interface AgentWidgetPlugin {
|
|
|
149
149
|
config: AgentWidgetConfig;
|
|
150
150
|
}) => HTMLElement | null;
|
|
151
151
|
/**
|
|
152
|
-
* Custom renderer for approval bubbles
|
|
153
|
-
*
|
|
152
|
+
* Custom renderer for approval bubbles.
|
|
153
|
+
*
|
|
154
|
+
* Return an `HTMLElement` to fully own the approval UI, `defaultRenderer()`
|
|
155
|
+
* to render (or wrap) the built-in bubble, or `null` to fall through to the
|
|
156
|
+
* default. Unlike the built-in bubble — whose Approve/Deny buttons are wired
|
|
157
|
+
* via delegation — a fully custom element resolves the approval by calling
|
|
158
|
+
* the `approve`/`deny` callbacks. Both route through the same path the
|
|
159
|
+
* built-in buttons use (optimistic update, `onDecision`, in-place anchoring).
|
|
160
|
+
*
|
|
161
|
+
* An approval is a single binary gate, so there are exactly two outcomes.
|
|
162
|
+
* Pass `{ remember: true }` to flag a "remember this" affordance (e.g. an
|
|
163
|
+
* "Always allow" button); the current approval resolves identically, but the
|
|
164
|
+
* flag is forwarded to `config.approval.onDecision` so you can persist a
|
|
165
|
+
* don't-ask-again policy for future approvals.
|
|
166
|
+
*
|
|
167
|
+
* `renderApproval` is called again whenever the approval's status changes, so
|
|
168
|
+
* branch on `message.approval?.status` to render the resolved state (and tear
|
|
169
|
+
* down any global listeners you added while pending).
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // An alternative prompt: "Always allow" / "Allow once" / "Deny".
|
|
174
|
+
* renderApproval: ({ message, approve, deny }) => {
|
|
175
|
+
* const approval = message.approval;
|
|
176
|
+
* if (!approval || approval.status !== "pending") return null; // default renders resolved state
|
|
177
|
+
* const root = document.createElement("div");
|
|
178
|
+
* root.textContent = `${approval.toolName} requires approval`;
|
|
179
|
+
*
|
|
180
|
+
* const always = document.createElement("button");
|
|
181
|
+
* always.textContent = "Always allow";
|
|
182
|
+
* always.addEventListener("click", () => approve({ remember: true }));
|
|
183
|
+
*
|
|
184
|
+
* const once = document.createElement("button");
|
|
185
|
+
* once.textContent = "Allow once";
|
|
186
|
+
* once.addEventListener("click", () => approve());
|
|
187
|
+
*
|
|
188
|
+
* const no = document.createElement("button");
|
|
189
|
+
* no.textContent = "Deny";
|
|
190
|
+
* no.addEventListener("click", () => deny());
|
|
191
|
+
*
|
|
192
|
+
* root.append(always, once, no);
|
|
193
|
+
* return root;
|
|
194
|
+
* }
|
|
195
|
+
* ```
|
|
154
196
|
*/
|
|
155
197
|
renderApproval?: (context: {
|
|
156
198
|
message: AgentWidgetMessage;
|
|
157
199
|
defaultRenderer: () => HTMLElement;
|
|
158
200
|
config: AgentWidgetConfig;
|
|
201
|
+
/** Resolve this approval as approved. Pass `{ remember: true }` for an "Always allow" affordance. */
|
|
202
|
+
approve: (options?: AgentWidgetApprovalDecisionOptions) => void;
|
|
203
|
+
/** Resolve this approval as denied. Pass `{ remember: true }` for an "Always deny" affordance. */
|
|
204
|
+
deny: (options?: AgentWidgetApprovalDecisionOptions) => void;
|
|
159
205
|
}) => HTMLElement | null;
|
|
160
206
|
/**
|
|
161
207
|
* Custom renderer for loading indicator
|
|
@@ -530,6 +576,8 @@ interface ApprovalTokens {
|
|
|
530
576
|
background: TokenReference<'color'>;
|
|
531
577
|
border: TokenReference<'color'>;
|
|
532
578
|
text: TokenReference<'color'>;
|
|
579
|
+
/** Box-shadow for the approval bubble (token ref or raw CSS, e.g. `none`). */
|
|
580
|
+
shadow: string;
|
|
533
581
|
};
|
|
534
582
|
approve: ComponentTokenSet;
|
|
535
583
|
deny: ComponentTokenSet;
|
|
@@ -2166,6 +2214,12 @@ type WebMcpConfirmInfo = {
|
|
|
2166
2214
|
toolName: string;
|
|
2167
2215
|
args: unknown;
|
|
2168
2216
|
description?: string;
|
|
2217
|
+
/**
|
|
2218
|
+
* Display title the tool declared via the WebMCP spec's
|
|
2219
|
+
* `ToolDescriptor.title` (e.g. `"Add to Cart"`). Absent when the tool
|
|
2220
|
+
* didn't declare one.
|
|
2221
|
+
*/
|
|
2222
|
+
title?: string;
|
|
2169
2223
|
annotations?: {
|
|
2170
2224
|
readOnlyHint?: boolean;
|
|
2171
2225
|
untrustedContentHint?: boolean;
|
|
@@ -3625,6 +3679,22 @@ interface VoiceProvider {
|
|
|
3625
3679
|
/** Stop playback / cancel in-flight request without starting recording */
|
|
3626
3680
|
stopPlayback?(): void;
|
|
3627
3681
|
}
|
|
3682
|
+
/**
|
|
3683
|
+
* Extra context for an approval decision, surfaced to `onDecision` and to the
|
|
3684
|
+
* `approve`/`deny` callbacks passed to the `renderApproval` plugin hook.
|
|
3685
|
+
*/
|
|
3686
|
+
type AgentWidgetApprovalDecisionOptions = {
|
|
3687
|
+
/**
|
|
3688
|
+
* The user chose a "remember this" affordance (e.g. an "Always allow"
|
|
3689
|
+
* button) rather than a one-time decision. The widget resolves the *current*
|
|
3690
|
+
* approval identically whether or not this is set — an approval bubble is a
|
|
3691
|
+
* single binary gate (`approved`/`denied`). Persisting a don't-ask-again
|
|
3692
|
+
* policy for *future* approvals (auto-resolving them, or not surfacing them)
|
|
3693
|
+
* is the integrator's responsibility, typically inside `onDecision`.
|
|
3694
|
+
* Defaults to absent/`false`.
|
|
3695
|
+
*/
|
|
3696
|
+
remember?: boolean;
|
|
3697
|
+
};
|
|
3628
3698
|
/**
|
|
3629
3699
|
* Configuration for tool approval bubbles.
|
|
3630
3700
|
* Controls styling, labels, and behavior of the approval UI.
|
|
@@ -3634,6 +3704,8 @@ type AgentWidgetApprovalConfig = {
|
|
|
3634
3704
|
backgroundColor?: string;
|
|
3635
3705
|
/** Border color of the approval bubble */
|
|
3636
3706
|
borderColor?: string;
|
|
3707
|
+
/** Box-shadow for the approval bubble; pass `"none"` to remove it. Overrides the default `persona-shadow-sm`. */
|
|
3708
|
+
shadow?: string;
|
|
3637
3709
|
/** Color for the title text */
|
|
3638
3710
|
titleColor?: string;
|
|
3639
3711
|
/** Color for the description text */
|
|
@@ -3656,20 +3728,51 @@ type AgentWidgetApprovalConfig = {
|
|
|
3656
3728
|
approveLabel?: string;
|
|
3657
3729
|
/** Label for the deny button */
|
|
3658
3730
|
denyLabel?: string;
|
|
3731
|
+
/**
|
|
3732
|
+
* How the technical details (the tool's agent-facing description and the
|
|
3733
|
+
* raw parameters JSON) are presented:
|
|
3734
|
+
* - `"collapsed"` (default) — hidden behind a "Show details" toggle
|
|
3735
|
+
* - `"expanded"` — visible, with the toggle available to hide them
|
|
3736
|
+
* - `"hidden"` — never rendered
|
|
3737
|
+
*/
|
|
3738
|
+
detailsDisplay?: "collapsed" | "expanded" | "hidden";
|
|
3739
|
+
/** Label for the toggle that reveals the technical details */
|
|
3740
|
+
showDetailsLabel?: string;
|
|
3741
|
+
/** Label for the toggle that hides the technical details */
|
|
3742
|
+
hideDetailsLabel?: string;
|
|
3743
|
+
/**
|
|
3744
|
+
* Build the user-facing summary line for an approval request. Overrides the
|
|
3745
|
+
* default "The assistant wants to use “Tool name”." copy. Return a falsy
|
|
3746
|
+
* value to fall back to the default for that approval. `displayTitle` is
|
|
3747
|
+
* the display name the tool declared via the WebMCP spec's
|
|
3748
|
+
* `ToolDescriptor.title`, when one exists.
|
|
3749
|
+
*/
|
|
3750
|
+
formatDescription?: (approval: {
|
|
3751
|
+
toolName: string;
|
|
3752
|
+
toolType?: string;
|
|
3753
|
+
description: string;
|
|
3754
|
+
parameters?: unknown;
|
|
3755
|
+
displayTitle?: string;
|
|
3756
|
+
}) => string | undefined;
|
|
3659
3757
|
/**
|
|
3660
3758
|
* Custom handler for approval decisions.
|
|
3661
3759
|
* Return void to let the SDK auto-resolve via the API,
|
|
3662
3760
|
* or return a Response/ReadableStream for custom handling.
|
|
3761
|
+
*
|
|
3762
|
+
* `options.remember` is `true` when the decision came from a "remember this"
|
|
3763
|
+
* affordance (e.g. an "Always allow" button in a custom `renderApproval`
|
|
3764
|
+
* plugin). Use it to persist a don't-ask-again policy for future approvals;
|
|
3765
|
+
* the current approval resolves the same way regardless.
|
|
3663
3766
|
*/
|
|
3664
3767
|
onDecision?: (data: {
|
|
3665
3768
|
approvalId: string;
|
|
3666
3769
|
executionId: string;
|
|
3667
3770
|
agentId: string;
|
|
3668
3771
|
toolName: string;
|
|
3669
|
-
}, decision: 'approved' | 'denied') => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
3772
|
+
}, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions) => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
3670
3773
|
};
|
|
3671
3774
|
type AgentWidgetToolCallConfig = {
|
|
3672
|
-
/** Box-shadow for tool-call bubbles;
|
|
3775
|
+
/** Box-shadow for tool-call bubbles; pass `"none"` to remove it. Overrides the `components.toolBubble.shadow` token / `--persona-tool-bubble-shadow`. */
|
|
3673
3776
|
shadow?: string;
|
|
3674
3777
|
/** Background color of the tool call bubble container. */
|
|
3675
3778
|
backgroundColor?: string;
|
|
@@ -6371,7 +6474,7 @@ declare class AgentWidgetSession {
|
|
|
6371
6474
|
* Updates the approval message status, calls the API (or custom onDecision),
|
|
6372
6475
|
* and pipes the response stream through connectStream().
|
|
6373
6476
|
*/
|
|
6374
|
-
resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied'): Promise<void>;
|
|
6477
|
+
resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions): Promise<void>;
|
|
6375
6478
|
/**
|
|
6376
6479
|
* Resolve a paused `ask_user_question` LOCAL tool call.
|
|
6377
6480
|
*
|
|
@@ -6690,8 +6793,10 @@ type Controller = {
|
|
|
6690
6793
|
* Programmatically resolve a pending approval.
|
|
6691
6794
|
* @param approvalId - The approval ID to resolve
|
|
6692
6795
|
* @param decision - "approved" or "denied"
|
|
6796
|
+
* @param options - Optional decision context (e.g. `{ remember: true }`),
|
|
6797
|
+
* forwarded to `config.approval.onDecision`.
|
|
6693
6798
|
*/
|
|
6694
|
-
resolveApproval: (approvalId: string, decision: 'approved' | 'denied') => Promise<void>;
|
|
6799
|
+
resolveApproval: (approvalId: string, decision: 'approved' | 'denied', options?: AgentWidgetApprovalDecisionOptions) => Promise<void>;
|
|
6695
6800
|
};
|
|
6696
6801
|
declare const createAgentExperience: (mount: HTMLElement, initialConfig?: AgentWidgetConfig, runtimeOptions?: {
|
|
6697
6802
|
debugTools?: boolean;
|
|
@@ -8514,4 +8619,4 @@ interface DemoCarouselHandle {
|
|
|
8514
8619
|
}
|
|
8515
8620
|
declare function createDemoCarousel(container: HTMLElement, options: DemoCarouselOptions): DemoCarouselHandle;
|
|
8516
8621
|
|
|
8517
|
-
export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type RuntypeAgentSSEEvent, type RuntypeAgentTurnCompleteEvent, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeDispatchSSEEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, isWebMcpToolName, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
|
|
8622
|
+
export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetApprovalDecisionOptions, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type RuntypeAgentSSEEvent, type RuntypeAgentTurnCompleteEvent, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeDispatchSSEEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, isWebMcpToolName, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
|