@runtypelabs/persona 3.23.0 → 3.25.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 +35 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +206 -190
- package/dist/index.d.ts +206 -190
- package/dist/index.global.js +78 -398
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +35 -35
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +17 -17
- package/dist/theme-editor.js +21 -21
- package/package.json +1 -1
- package/src/client.test.ts +261 -0
- package/src/client.ts +103 -25
- package/src/index-core.ts +406 -0
- package/src/index-global.ts +4 -2
- package/src/index.ts +24 -400
- package/src/session.ts +4 -0
- package/src/types.ts +17 -0
- package/src/webmcp-bridge.test.ts +80 -0
- package/src/webmcp-bridge.ts +68 -0
package/dist/index.d.ts
CHANGED
|
@@ -2778,6 +2778,14 @@ type ClientChatRequest = {
|
|
|
2778
2778
|
context?: Record<string, unknown>;
|
|
2779
2779
|
/** WebMCP page-discovered tools — same shape as `dispatch.clientTools[]`. */
|
|
2780
2780
|
clientTools?: ClientToolDefinition[];
|
|
2781
|
+
/**
|
|
2782
|
+
* Diff-only / send-once: order-independent fingerprint of the client tool set.
|
|
2783
|
+
* When the set is unchanged from the previous turn the widget sends this
|
|
2784
|
+
* WITHOUT `clientTools` and the server reuses its stored set. On a cache miss
|
|
2785
|
+
* the server replies `409 { error: 'client_tools_resend_required' }` and the
|
|
2786
|
+
* widget retries once with the full `clientTools[]`.
|
|
2787
|
+
*/
|
|
2788
|
+
clientToolsFingerprint?: string;
|
|
2781
2789
|
};
|
|
2782
2790
|
/**
|
|
2783
2791
|
* Feedback types supported by the API
|
|
@@ -4628,6 +4636,8 @@ declare class AgentWidgetClient {
|
|
|
4628
4636
|
private onSSEEvent?;
|
|
4629
4637
|
private clientSession;
|
|
4630
4638
|
private sessionInitPromise;
|
|
4639
|
+
private lastSentClientToolsFingerprint;
|
|
4640
|
+
private clientToolsFingerprintSessionId;
|
|
4631
4641
|
private readonly webMcpBridge;
|
|
4632
4642
|
constructor(config?: AgentWidgetConfig);
|
|
4633
4643
|
/**
|
|
@@ -4688,6 +4698,12 @@ declare class AgentWidgetClient {
|
|
|
4688
4698
|
* Clear the current client session
|
|
4689
4699
|
*/
|
|
4690
4700
|
clearClientSession(): void;
|
|
4701
|
+
/**
|
|
4702
|
+
* Forget the diff-only WebMCP tool fingerprint so the next client-token turn
|
|
4703
|
+
* resends the full `clientTools[]`. Called when the session is cleared and
|
|
4704
|
+
* when the conversation is reset (`WidgetSession.clearMessages`).
|
|
4705
|
+
*/
|
|
4706
|
+
resetClientToolsFingerprint(): void;
|
|
4691
4707
|
/**
|
|
4692
4708
|
* Get the feedback API URL
|
|
4693
4709
|
*/
|
|
@@ -6085,148 +6101,6 @@ declare const isDockedMountMode: (config?: AgentWidgetConfig) => boolean;
|
|
|
6085
6101
|
*/
|
|
6086
6102
|
declare const resolveDockConfig: (config?: AgentWidgetConfig) => Required<AgentWidgetDockConfig>;
|
|
6087
6103
|
|
|
6088
|
-
type CodeFormat = "esm" | "script-installer" | "script-manual" | "script-advanced" | "react-component" | "react-advanced";
|
|
6089
|
-
/**
|
|
6090
|
-
* Hook code templates for code generation.
|
|
6091
|
-
* Each hook can be provided as a string (code template) OR as an actual function.
|
|
6092
|
-
* Functions are automatically serialized via `.toString()`.
|
|
6093
|
-
*
|
|
6094
|
-
* IMPORTANT: When providing functions:
|
|
6095
|
-
* - Functions must be self-contained (no external variables/closures)
|
|
6096
|
-
* - External variables will be undefined when the generated code runs
|
|
6097
|
-
* - Use arrow functions or regular function expressions
|
|
6098
|
-
*
|
|
6099
|
-
* @example
|
|
6100
|
-
* ```typescript
|
|
6101
|
-
* // Both of these work:
|
|
6102
|
-
*
|
|
6103
|
-
* // As string:
|
|
6104
|
-
* { getHeaders: "async () => ({ 'Authorization': 'Bearer token' })" }
|
|
6105
|
-
*
|
|
6106
|
-
* // As function (recommended - better IDE support):
|
|
6107
|
-
* { getHeaders: async () => ({ 'Authorization': 'Bearer token' }) }
|
|
6108
|
-
* ```
|
|
6109
|
-
*/
|
|
6110
|
-
type CodeGeneratorHooks = {
|
|
6111
|
-
/**
|
|
6112
|
-
* Custom getHeaders function.
|
|
6113
|
-
* Should return an object with header key-value pairs.
|
|
6114
|
-
*
|
|
6115
|
-
* @example
|
|
6116
|
-
* ```typescript
|
|
6117
|
-
* async () => ({ 'Authorization': `Bearer ${await getAuthToken()}` })
|
|
6118
|
-
* ```
|
|
6119
|
-
*/
|
|
6120
|
-
getHeaders?: string | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
6121
|
-
/**
|
|
6122
|
-
* Custom onFeedback callback for message actions.
|
|
6123
|
-
* Receives a feedback object with type, messageId, and message.
|
|
6124
|
-
*
|
|
6125
|
-
* @example
|
|
6126
|
-
* ```typescript
|
|
6127
|
-
* (feedback) => { console.log('Feedback:', feedback.type); }
|
|
6128
|
-
* ```
|
|
6129
|
-
*/
|
|
6130
|
-
onFeedback?: string | ((feedback: {
|
|
6131
|
-
type: string;
|
|
6132
|
-
messageId: string;
|
|
6133
|
-
message: unknown;
|
|
6134
|
-
}) => void);
|
|
6135
|
-
/**
|
|
6136
|
-
* Custom onCopy callback for message actions.
|
|
6137
|
-
* Receives the message that was copied.
|
|
6138
|
-
*
|
|
6139
|
-
* @example
|
|
6140
|
-
* ```typescript
|
|
6141
|
-
* (message) => { analytics.track('message_copied', { id: message.id }); }
|
|
6142
|
-
* ```
|
|
6143
|
-
*/
|
|
6144
|
-
onCopy?: string | ((message: unknown) => void);
|
|
6145
|
-
/**
|
|
6146
|
-
* Custom requestMiddleware function.
|
|
6147
|
-
* Receives { payload, config } context.
|
|
6148
|
-
*
|
|
6149
|
-
* @example
|
|
6150
|
-
* ```typescript
|
|
6151
|
-
* ({ payload }) => ({ ...payload, metadata: { pageUrl: window.location.href } })
|
|
6152
|
-
* ```
|
|
6153
|
-
*/
|
|
6154
|
-
requestMiddleware?: string | ((context: {
|
|
6155
|
-
payload: unknown;
|
|
6156
|
-
config: unknown;
|
|
6157
|
-
}) => unknown);
|
|
6158
|
-
/**
|
|
6159
|
-
* Custom action handlers array.
|
|
6160
|
-
* Array of handler functions.
|
|
6161
|
-
*
|
|
6162
|
-
* @example
|
|
6163
|
-
* ```typescript
|
|
6164
|
-
* [
|
|
6165
|
-
* (action, context) => {
|
|
6166
|
-
* if (action.type === 'custom') {
|
|
6167
|
-
* return { handled: true };
|
|
6168
|
-
* }
|
|
6169
|
-
* }
|
|
6170
|
-
* ]
|
|
6171
|
-
* ```
|
|
6172
|
-
*/
|
|
6173
|
-
actionHandlers?: string | Array<(action: unknown, context: unknown) => unknown>;
|
|
6174
|
-
/**
|
|
6175
|
-
* Custom action parsers array.
|
|
6176
|
-
* Array of parser functions.
|
|
6177
|
-
*/
|
|
6178
|
-
actionParsers?: string | Array<(context: unknown) => unknown>;
|
|
6179
|
-
/**
|
|
6180
|
-
* Custom postprocessMessage function.
|
|
6181
|
-
* Receives { text, message, streaming, raw } context.
|
|
6182
|
-
* Will override the default markdownPostprocessor.
|
|
6183
|
-
*
|
|
6184
|
-
* @example
|
|
6185
|
-
* ```typescript
|
|
6186
|
-
* ({ text }) => customMarkdownProcessor(text)
|
|
6187
|
-
* ```
|
|
6188
|
-
*/
|
|
6189
|
-
postprocessMessage?: string | ((context: {
|
|
6190
|
-
text: string;
|
|
6191
|
-
message?: unknown;
|
|
6192
|
-
streaming?: boolean;
|
|
6193
|
-
raw?: string;
|
|
6194
|
-
}) => string);
|
|
6195
|
-
/**
|
|
6196
|
-
* Custom context providers array.
|
|
6197
|
-
* Array of provider functions.
|
|
6198
|
-
*/
|
|
6199
|
-
contextProviders?: string | Array<() => unknown>;
|
|
6200
|
-
/**
|
|
6201
|
-
* Custom stream parser factory.
|
|
6202
|
-
* Should be a function that returns a StreamParser.
|
|
6203
|
-
*/
|
|
6204
|
-
streamParser?: string | (() => unknown);
|
|
6205
|
-
};
|
|
6206
|
-
/**
|
|
6207
|
-
* Options for code generation beyond format selection.
|
|
6208
|
-
*/
|
|
6209
|
-
type CodeGeneratorOptions = {
|
|
6210
|
-
/**
|
|
6211
|
-
* Custom hook code to inject into the generated snippet.
|
|
6212
|
-
* Hooks are JavaScript/TypeScript code strings that will be
|
|
6213
|
-
* inserted at appropriate locations in the output.
|
|
6214
|
-
*/
|
|
6215
|
-
hooks?: CodeGeneratorHooks;
|
|
6216
|
-
/**
|
|
6217
|
-
* Whether to include comments explaining each hook.
|
|
6218
|
-
* @default true
|
|
6219
|
-
*/
|
|
6220
|
-
includeHookComments?: boolean;
|
|
6221
|
-
/**
|
|
6222
|
-
* If provided, emits `windowKey` in the generated `initAgentWidget()` call
|
|
6223
|
-
* so the widget handle is stored on `window[windowKey]`.
|
|
6224
|
-
* Only affects script formats (script-installer, script-manual, script-advanced).
|
|
6225
|
-
*/
|
|
6226
|
-
windowKey?: string;
|
|
6227
|
-
};
|
|
6228
|
-
declare function generateCodeSnippet(config: any, format?: CodeFormat, options?: CodeGeneratorOptions): string;
|
|
6229
|
-
|
|
6230
6104
|
/**
|
|
6231
6105
|
* The current version of the @runtypelabs/persona package.
|
|
6232
6106
|
* This is automatically derived from package.json.
|
|
@@ -6633,54 +6507,6 @@ interface ComboButtonHandle {
|
|
|
6633
6507
|
*/
|
|
6634
6508
|
declare function createComboButton(options: CreateComboButtonOptions): ComboButtonHandle;
|
|
6635
6509
|
|
|
6636
|
-
interface DemoCarouselItem {
|
|
6637
|
-
/** URL to load in the iframe (relative or absolute). */
|
|
6638
|
-
url: string;
|
|
6639
|
-
/** Display title shown in the toolbar. */
|
|
6640
|
-
title: string;
|
|
6641
|
-
/** Optional subtitle/description. */
|
|
6642
|
-
description?: string;
|
|
6643
|
-
}
|
|
6644
|
-
interface DemoCarouselOptions {
|
|
6645
|
-
/** Demo pages to cycle through. */
|
|
6646
|
-
items: DemoCarouselItem[];
|
|
6647
|
-
/** Initial item index. Default: 0. */
|
|
6648
|
-
initialIndex?: number;
|
|
6649
|
-
/** Initial device viewport. Default: 'desktop'. */
|
|
6650
|
-
initialDevice?: "desktop" | "mobile";
|
|
6651
|
-
/** Initial color scheme for the iframe wrapper. Default: 'light'. */
|
|
6652
|
-
initialColorScheme?: "light" | "dark";
|
|
6653
|
-
/** Show zoom +/- controls. Default: true. */
|
|
6654
|
-
showZoomControls?: boolean;
|
|
6655
|
-
/** Show desktop/mobile toggle. Default: true. */
|
|
6656
|
-
showDeviceToggle?: boolean;
|
|
6657
|
-
/** Show light/dark scheme toggle. Default: true. */
|
|
6658
|
-
showColorSchemeToggle?: boolean;
|
|
6659
|
-
/** Called when the active demo changes. */
|
|
6660
|
-
onChange?: (index: number, item: DemoCarouselItem) => void;
|
|
6661
|
-
}
|
|
6662
|
-
interface DemoCarouselHandle {
|
|
6663
|
-
/** Root element (already appended to the container). */
|
|
6664
|
-
element: HTMLElement;
|
|
6665
|
-
/** Navigate to a demo by index. */
|
|
6666
|
-
goTo(index: number): void;
|
|
6667
|
-
/** Go to the next demo. */
|
|
6668
|
-
next(): void;
|
|
6669
|
-
/** Go to the previous demo. */
|
|
6670
|
-
prev(): void;
|
|
6671
|
-
/** Current demo index. */
|
|
6672
|
-
getIndex(): number;
|
|
6673
|
-
/** Change the device viewport. */
|
|
6674
|
-
setDevice(device: "desktop" | "mobile"): void;
|
|
6675
|
-
/** Change the wrapper color scheme. */
|
|
6676
|
-
setColorScheme(scheme: "light" | "dark"): void;
|
|
6677
|
-
/** Override zoom level (null = auto-fit). */
|
|
6678
|
-
setZoom(zoom: number | null): void;
|
|
6679
|
-
/** Tear down listeners, observer, and DOM. */
|
|
6680
|
-
destroy(): void;
|
|
6681
|
-
}
|
|
6682
|
-
declare function createDemoCarousel(container: HTMLElement, options: DemoCarouselOptions): DemoCarouselHandle;
|
|
6683
|
-
|
|
6684
6510
|
declare const DEFAULT_PALETTE: {
|
|
6685
6511
|
colors: {
|
|
6686
6512
|
primary: {
|
|
@@ -7247,4 +7073,194 @@ declare function createVoiceProvider(config: VoiceConfig): VoiceProvider;
|
|
|
7247
7073
|
declare function createBestAvailableVoiceProvider(config?: Partial<VoiceConfig>): VoiceProvider;
|
|
7248
7074
|
declare function isVoiceSupported(config?: Partial<VoiceConfig>): boolean;
|
|
7249
7075
|
|
|
7076
|
+
type CodeFormat = "esm" | "script-installer" | "script-manual" | "script-advanced" | "react-component" | "react-advanced";
|
|
7077
|
+
/**
|
|
7078
|
+
* Hook code templates for code generation.
|
|
7079
|
+
* Each hook can be provided as a string (code template) OR as an actual function.
|
|
7080
|
+
* Functions are automatically serialized via `.toString()`.
|
|
7081
|
+
*
|
|
7082
|
+
* IMPORTANT: When providing functions:
|
|
7083
|
+
* - Functions must be self-contained (no external variables/closures)
|
|
7084
|
+
* - External variables will be undefined when the generated code runs
|
|
7085
|
+
* - Use arrow functions or regular function expressions
|
|
7086
|
+
*
|
|
7087
|
+
* @example
|
|
7088
|
+
* ```typescript
|
|
7089
|
+
* // Both of these work:
|
|
7090
|
+
*
|
|
7091
|
+
* // As string:
|
|
7092
|
+
* { getHeaders: "async () => ({ 'Authorization': 'Bearer token' })" }
|
|
7093
|
+
*
|
|
7094
|
+
* // As function (recommended - better IDE support):
|
|
7095
|
+
* { getHeaders: async () => ({ 'Authorization': 'Bearer token' }) }
|
|
7096
|
+
* ```
|
|
7097
|
+
*/
|
|
7098
|
+
type CodeGeneratorHooks = {
|
|
7099
|
+
/**
|
|
7100
|
+
* Custom getHeaders function.
|
|
7101
|
+
* Should return an object with header key-value pairs.
|
|
7102
|
+
*
|
|
7103
|
+
* @example
|
|
7104
|
+
* ```typescript
|
|
7105
|
+
* async () => ({ 'Authorization': `Bearer ${await getAuthToken()}` })
|
|
7106
|
+
* ```
|
|
7107
|
+
*/
|
|
7108
|
+
getHeaders?: string | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
7109
|
+
/**
|
|
7110
|
+
* Custom onFeedback callback for message actions.
|
|
7111
|
+
* Receives a feedback object with type, messageId, and message.
|
|
7112
|
+
*
|
|
7113
|
+
* @example
|
|
7114
|
+
* ```typescript
|
|
7115
|
+
* (feedback) => { console.log('Feedback:', feedback.type); }
|
|
7116
|
+
* ```
|
|
7117
|
+
*/
|
|
7118
|
+
onFeedback?: string | ((feedback: {
|
|
7119
|
+
type: string;
|
|
7120
|
+
messageId: string;
|
|
7121
|
+
message: unknown;
|
|
7122
|
+
}) => void);
|
|
7123
|
+
/**
|
|
7124
|
+
* Custom onCopy callback for message actions.
|
|
7125
|
+
* Receives the message that was copied.
|
|
7126
|
+
*
|
|
7127
|
+
* @example
|
|
7128
|
+
* ```typescript
|
|
7129
|
+
* (message) => { analytics.track('message_copied', { id: message.id }); }
|
|
7130
|
+
* ```
|
|
7131
|
+
*/
|
|
7132
|
+
onCopy?: string | ((message: unknown) => void);
|
|
7133
|
+
/**
|
|
7134
|
+
* Custom requestMiddleware function.
|
|
7135
|
+
* Receives { payload, config } context.
|
|
7136
|
+
*
|
|
7137
|
+
* @example
|
|
7138
|
+
* ```typescript
|
|
7139
|
+
* ({ payload }) => ({ ...payload, metadata: { pageUrl: window.location.href } })
|
|
7140
|
+
* ```
|
|
7141
|
+
*/
|
|
7142
|
+
requestMiddleware?: string | ((context: {
|
|
7143
|
+
payload: unknown;
|
|
7144
|
+
config: unknown;
|
|
7145
|
+
}) => unknown);
|
|
7146
|
+
/**
|
|
7147
|
+
* Custom action handlers array.
|
|
7148
|
+
* Array of handler functions.
|
|
7149
|
+
*
|
|
7150
|
+
* @example
|
|
7151
|
+
* ```typescript
|
|
7152
|
+
* [
|
|
7153
|
+
* (action, context) => {
|
|
7154
|
+
* if (action.type === 'custom') {
|
|
7155
|
+
* return { handled: true };
|
|
7156
|
+
* }
|
|
7157
|
+
* }
|
|
7158
|
+
* ]
|
|
7159
|
+
* ```
|
|
7160
|
+
*/
|
|
7161
|
+
actionHandlers?: string | Array<(action: unknown, context: unknown) => unknown>;
|
|
7162
|
+
/**
|
|
7163
|
+
* Custom action parsers array.
|
|
7164
|
+
* Array of parser functions.
|
|
7165
|
+
*/
|
|
7166
|
+
actionParsers?: string | Array<(context: unknown) => unknown>;
|
|
7167
|
+
/**
|
|
7168
|
+
* Custom postprocessMessage function.
|
|
7169
|
+
* Receives { text, message, streaming, raw } context.
|
|
7170
|
+
* Will override the default markdownPostprocessor.
|
|
7171
|
+
*
|
|
7172
|
+
* @example
|
|
7173
|
+
* ```typescript
|
|
7174
|
+
* ({ text }) => customMarkdownProcessor(text)
|
|
7175
|
+
* ```
|
|
7176
|
+
*/
|
|
7177
|
+
postprocessMessage?: string | ((context: {
|
|
7178
|
+
text: string;
|
|
7179
|
+
message?: unknown;
|
|
7180
|
+
streaming?: boolean;
|
|
7181
|
+
raw?: string;
|
|
7182
|
+
}) => string);
|
|
7183
|
+
/**
|
|
7184
|
+
* Custom context providers array.
|
|
7185
|
+
* Array of provider functions.
|
|
7186
|
+
*/
|
|
7187
|
+
contextProviders?: string | Array<() => unknown>;
|
|
7188
|
+
/**
|
|
7189
|
+
* Custom stream parser factory.
|
|
7190
|
+
* Should be a function that returns a StreamParser.
|
|
7191
|
+
*/
|
|
7192
|
+
streamParser?: string | (() => unknown);
|
|
7193
|
+
};
|
|
7194
|
+
/**
|
|
7195
|
+
* Options for code generation beyond format selection.
|
|
7196
|
+
*/
|
|
7197
|
+
type CodeGeneratorOptions = {
|
|
7198
|
+
/**
|
|
7199
|
+
* Custom hook code to inject into the generated snippet.
|
|
7200
|
+
* Hooks are JavaScript/TypeScript code strings that will be
|
|
7201
|
+
* inserted at appropriate locations in the output.
|
|
7202
|
+
*/
|
|
7203
|
+
hooks?: CodeGeneratorHooks;
|
|
7204
|
+
/**
|
|
7205
|
+
* Whether to include comments explaining each hook.
|
|
7206
|
+
* @default true
|
|
7207
|
+
*/
|
|
7208
|
+
includeHookComments?: boolean;
|
|
7209
|
+
/**
|
|
7210
|
+
* If provided, emits `windowKey` in the generated `initAgentWidget()` call
|
|
7211
|
+
* so the widget handle is stored on `window[windowKey]`.
|
|
7212
|
+
* Only affects script formats (script-installer, script-manual, script-advanced).
|
|
7213
|
+
*/
|
|
7214
|
+
windowKey?: string;
|
|
7215
|
+
};
|
|
7216
|
+
declare function generateCodeSnippet(config: any, format?: CodeFormat, options?: CodeGeneratorOptions): string;
|
|
7217
|
+
|
|
7218
|
+
interface DemoCarouselItem {
|
|
7219
|
+
/** URL to load in the iframe (relative or absolute). */
|
|
7220
|
+
url: string;
|
|
7221
|
+
/** Display title shown in the toolbar. */
|
|
7222
|
+
title: string;
|
|
7223
|
+
/** Optional subtitle/description. */
|
|
7224
|
+
description?: string;
|
|
7225
|
+
}
|
|
7226
|
+
interface DemoCarouselOptions {
|
|
7227
|
+
/** Demo pages to cycle through. */
|
|
7228
|
+
items: DemoCarouselItem[];
|
|
7229
|
+
/** Initial item index. Default: 0. */
|
|
7230
|
+
initialIndex?: number;
|
|
7231
|
+
/** Initial device viewport. Default: 'desktop'. */
|
|
7232
|
+
initialDevice?: "desktop" | "mobile";
|
|
7233
|
+
/** Initial color scheme for the iframe wrapper. Default: 'light'. */
|
|
7234
|
+
initialColorScheme?: "light" | "dark";
|
|
7235
|
+
/** Show zoom +/- controls. Default: true. */
|
|
7236
|
+
showZoomControls?: boolean;
|
|
7237
|
+
/** Show desktop/mobile toggle. Default: true. */
|
|
7238
|
+
showDeviceToggle?: boolean;
|
|
7239
|
+
/** Show light/dark scheme toggle. Default: true. */
|
|
7240
|
+
showColorSchemeToggle?: boolean;
|
|
7241
|
+
/** Called when the active demo changes. */
|
|
7242
|
+
onChange?: (index: number, item: DemoCarouselItem) => void;
|
|
7243
|
+
}
|
|
7244
|
+
interface DemoCarouselHandle {
|
|
7245
|
+
/** Root element (already appended to the container). */
|
|
7246
|
+
element: HTMLElement;
|
|
7247
|
+
/** Navigate to a demo by index. */
|
|
7248
|
+
goTo(index: number): void;
|
|
7249
|
+
/** Go to the next demo. */
|
|
7250
|
+
next(): void;
|
|
7251
|
+
/** Go to the previous demo. */
|
|
7252
|
+
prev(): void;
|
|
7253
|
+
/** Current demo index. */
|
|
7254
|
+
getIndex(): number;
|
|
7255
|
+
/** Change the device viewport. */
|
|
7256
|
+
setDevice(device: "desktop" | "mobile"): void;
|
|
7257
|
+
/** Change the wrapper color scheme. */
|
|
7258
|
+
setColorScheme(scheme: "light" | "dark"): void;
|
|
7259
|
+
/** Override zoom level (null = auto-fit). */
|
|
7260
|
+
setZoom(zoom: number | null): void;
|
|
7261
|
+
/** Tear down listeners, observer, and DOM. */
|
|
7262
|
+
destroy(): void;
|
|
7263
|
+
}
|
|
7264
|
+
declare function createDemoCarousel(container: HTMLElement, options: DemoCarouselOptions): DemoCarouselHandle;
|
|
7265
|
+
|
|
7250
7266
|
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 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 };
|