@unisphere/genie-types 1.28.0 → 1.29.2
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/index.esm.js
CHANGED
|
@@ -1251,6 +1251,12 @@ const schemaVersionSchema = {
|
|
|
1251
1251
|
value: '1',
|
|
1252
1252
|
optional: true
|
|
1253
1253
|
};
|
|
1254
|
+
const dynamicVariablesSchema = {
|
|
1255
|
+
type: 'object',
|
|
1256
|
+
allowUnknownProperties: true,
|
|
1257
|
+
optional: true,
|
|
1258
|
+
properties: {}
|
|
1259
|
+
};
|
|
1254
1260
|
|
|
1255
1261
|
/** Runtime name constant for chat experiences */
|
|
1256
1262
|
const ChatRuntimeName = 'chat';
|
|
@@ -1705,7 +1711,8 @@ const floaterVisualSettingsSchema = {
|
|
|
1705
1711
|
schemaVersion: schemaVersionSchema,
|
|
1706
1712
|
mode: modeSchema,
|
|
1707
1713
|
context: chatContextSchema,
|
|
1708
|
-
customization: chatCustomizationSchema
|
|
1714
|
+
customization: chatCustomizationSchema,
|
|
1715
|
+
dynamicVariables: dynamicVariablesSchema
|
|
1709
1716
|
}
|
|
1710
1717
|
};
|
|
1711
1718
|
const floaterCTAVisualSettingsSchema = {
|
|
@@ -1725,6 +1732,7 @@ const floaterCTAVisualSettingsSchema = {
|
|
|
1725
1732
|
},
|
|
1726
1733
|
context: chatContextSchema,
|
|
1727
1734
|
customization: chatCustomizationSchema,
|
|
1735
|
+
dynamicVariables: dynamicVariablesSchema,
|
|
1728
1736
|
type: {
|
|
1729
1737
|
type: 'literal',
|
|
1730
1738
|
value: 'button',
|
|
@@ -1748,6 +1756,7 @@ const containedVisualSettingsSchema = {
|
|
|
1748
1756
|
schemaVersion: schemaVersionSchema,
|
|
1749
1757
|
mode: modeSchema,
|
|
1750
1758
|
customization: chatCustomizationSchema,
|
|
1759
|
+
dynamicVariables: dynamicVariablesSchema,
|
|
1751
1760
|
onRequestClose: {
|
|
1752
1761
|
type: 'function',
|
|
1753
1762
|
optional: true
|
|
@@ -1822,13 +1831,15 @@ const pageVisualSettingsSchema = {
|
|
|
1822
1831
|
scroll: scrollSchema,
|
|
1823
1832
|
customization: chatCustomizationSchema,
|
|
1824
1833
|
context: pageContextSchema,
|
|
1825
|
-
initialQuestion: initialQuestionSchema
|
|
1834
|
+
initialQuestion: initialQuestionSchema,
|
|
1835
|
+
dynamicVariables: dynamicVariablesSchema
|
|
1826
1836
|
}
|
|
1827
1837
|
};
|
|
1828
1838
|
const bannerVisualSettingsSchema = {
|
|
1829
1839
|
type: 'object',
|
|
1830
1840
|
properties: {
|
|
1831
1841
|
schemaVersion: schemaVersionSchema,
|
|
1842
|
+
dynamicVariables: dynamicVariablesSchema,
|
|
1832
1843
|
title: {
|
|
1833
1844
|
type: 'primitive',
|
|
1834
1845
|
value: 'string',
|
|
@@ -1878,7 +1889,8 @@ const popupVisualSettingsSchema = {
|
|
|
1878
1889
|
schemaVersion: schemaVersionSchema,
|
|
1879
1890
|
scroll: scrollSchema,
|
|
1880
1891
|
customization: chatCustomizationSchema,
|
|
1881
|
-
initialQuestion: initialQuestionSchema
|
|
1892
|
+
initialQuestion: initialQuestionSchema,
|
|
1893
|
+
dynamicVariables: dynamicVariablesSchema
|
|
1882
1894
|
}
|
|
1883
1895
|
};
|
|
1884
1896
|
|
|
@@ -3376,4 +3388,4 @@ const chatThreadRuntimeContainedVisualSettingsSchema = {
|
|
|
3376
3388
|
}
|
|
3377
3389
|
};
|
|
3378
3390
|
|
|
3379
|
-
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, widgetName };
|
|
3391
|
+
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, dynamicVariablesSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, widgetName };
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
40
40
|
registerClientTools<TMap extends Record<string, unknown>>(tools: {
|
|
41
41
|
[K in keyof TMap]: (args: TMap[K]) => undefined | null | Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
42
42
|
}): void;
|
|
43
|
+
unregisterClientTools(...names: string[]): void;
|
|
43
44
|
/** Observable chat panel open state */
|
|
44
45
|
isChatPanelOpen: TinyDataStoreConsumer<boolean>;
|
|
45
46
|
/** Update chat panel open state */
|
|
@@ -4,17 +4,24 @@ import { widgetName } from '../widget-types';
|
|
|
4
4
|
import { ChatContext, GlobalChatSettings } from './shared-settings';
|
|
5
5
|
/** Runtime name constant for chat experiences */
|
|
6
6
|
export declare const ChatRuntimeName: "chat";
|
|
7
|
+
export type ChatRuntimeBaseType = {
|
|
8
|
+
registerClientTools<TMap extends Record<string, unknown>>(tools: {
|
|
9
|
+
[K in keyof TMap]: (args: TMap[K]) => undefined | null | Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
10
|
+
}): void;
|
|
11
|
+
unregisterClientTools(...names: string[]): void;
|
|
12
|
+
updateDynamicVariables(variables: Record<string, unknown>): void;
|
|
13
|
+
};
|
|
7
14
|
/**
|
|
8
15
|
* Chat runtime interface for Genie conversational AI experiences.
|
|
9
16
|
*
|
|
10
17
|
* Provides the core runtime for chat-based interactions with Genie's AI assistant,
|
|
11
18
|
* including conversation management, message handling, and integration features.
|
|
12
19
|
*/
|
|
13
|
-
export
|
|
20
|
+
export type ChatRuntime = UnisphereRuntimeBaseType<ChatRuntimeSettings> & {
|
|
14
21
|
readonly widgetName: typeof widgetName;
|
|
15
22
|
readonly runtimeName: typeof ChatRuntimeName;
|
|
16
23
|
readonly flavor: '';
|
|
17
|
-
}
|
|
24
|
+
} & ChatRuntimeBaseType;
|
|
18
25
|
/** Shared settings fields between ChatRuntimeSettings and ChatRuntimePlayerPluginSettings. */
|
|
19
26
|
export interface BaseChatRuntimeSettings {
|
|
20
27
|
/** Kaltura session token for authentication */
|
|
@@ -106,6 +106,7 @@ export interface KalturaIntegration {
|
|
|
106
106
|
/** Media entry ID for context */
|
|
107
107
|
entryId?: string;
|
|
108
108
|
}
|
|
109
|
+
export type GenieDynamicVariables = Record<string, unknown>;
|
|
109
110
|
/**
|
|
110
111
|
* Global chat configuration settings shared across chat components.
|
|
111
112
|
*
|
|
@@ -140,6 +141,8 @@ export interface GlobalChatSettings {
|
|
|
140
141
|
everywhere?: boolean;
|
|
141
142
|
/** Genie capability overrides — defaults applied per API if absent */
|
|
142
143
|
capabilities?: GenieCapabilities;
|
|
144
|
+
/** Dynamic variables for genie brain */
|
|
145
|
+
dynamicVariables?: GenieDynamicVariables;
|
|
143
146
|
/** Callback function to generate source URLs for an entry or category */
|
|
144
147
|
getSourceUrl?: (params: {
|
|
145
148
|
type: 'category';
|
|
@@ -173,3 +176,4 @@ export declare const integrationsSchema: ValidatorSchema;
|
|
|
173
176
|
export declare const shareUrlSchema: ValidatorSchema;
|
|
174
177
|
export declare const getSourceUrlSchema: ValidatorSchema;
|
|
175
178
|
export declare const schemaVersionSchema: ValidatorSchema;
|
|
179
|
+
export declare const dynamicVariablesSchema: ValidatorSchema;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ValidatorSchema } from '@unisphere/core';
|
|
2
2
|
import { ChatCustomization } from '../chat-customizations-types';
|
|
3
|
-
import { ChatContext } from './shared-settings';
|
|
3
|
+
import { ChatContext, GenieDynamicVariables } from './shared-settings';
|
|
4
4
|
import { AnswerTypeEnum } from '../types';
|
|
5
5
|
interface BaseVisualSettings {
|
|
6
6
|
/** Settings schema version */
|
|
7
7
|
schemaVersion?: '1';
|
|
8
|
+
/** Custom UI styling and behavior options */
|
|
9
|
+
customization?: ChatCustomization;
|
|
10
|
+
/** Dynamic variables for genie brain */
|
|
11
|
+
dynamicVariables?: GenieDynamicVariables;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Visual settings with scroll and customization support.
|
|
@@ -13,8 +17,6 @@ interface BaseVisualSettings {
|
|
|
13
17
|
interface ScrollableVisualSettings extends BaseVisualSettings {
|
|
14
18
|
/** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
|
|
15
19
|
scroll?: 'body' | 'container' | 'modal';
|
|
16
|
-
/** Custom UI styling and behavior options */
|
|
17
|
-
customization?: ChatCustomization;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Visual settings with mode and context support.
|
|
@@ -25,8 +27,6 @@ interface ModeContextVisualSettings extends BaseVisualSettings {
|
|
|
25
27
|
mode?: 'chat' | 'everywhere';
|
|
26
28
|
/** Context for the chat session */
|
|
27
29
|
context?: ChatContext;
|
|
28
|
-
/** Custom UI styling and behavior options */
|
|
29
|
-
customization?: ChatCustomization;
|
|
30
30
|
}
|
|
31
31
|
/** Initial question shape shared between popup and page visual settings. */
|
|
32
32
|
type InitialQuestion = {
|