@unisphere/genie-types 1.28.0-head.5 → 1.29.1

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
 
@@ -2227,6 +2239,11 @@ const avatarRuntimeSettingsSchema = {
2227
2239
  value: 'boolean',
2228
2240
  optional: true
2229
2241
  },
2242
+ isTapToTalk: {
2243
+ type: 'primitive',
2244
+ value: 'boolean',
2245
+ optional: true
2246
+ },
2230
2247
  noiseReductionEnabled: {
2231
2248
  type: 'primitive',
2232
2249
  value: 'boolean',
@@ -2289,6 +2306,42 @@ const avatarRuntimeFloaterVisualSettingsSchema = {
2289
2306
  type: 'enum',
2290
2307
  values: ['left', 'right'],
2291
2308
  optional: true
2309
+ },
2310
+ buttonLabel: {
2311
+ type: 'primitive',
2312
+ value: 'string',
2313
+ optional: true
2314
+ },
2315
+ connect: {
2316
+ type: 'object',
2317
+ optional: true,
2318
+ properties: {
2319
+ context: {
2320
+ type: 'object',
2321
+ optional: true,
2322
+ properties: {
2323
+ type: {
2324
+ type: 'literal',
2325
+ value: 'thread'
2326
+ },
2327
+ threadId: {
2328
+ type: 'primitive',
2329
+ value: 'string'
2330
+ },
2331
+ messageId: {
2332
+ type: 'primitive',
2333
+ value: 'string',
2334
+ optional: true
2335
+ }
2336
+ }
2337
+ },
2338
+ dynamicVariables: {
2339
+ type: 'object',
2340
+ optional: true,
2341
+ allowUnknownProperties: true,
2342
+ properties: {}
2343
+ }
2344
+ }
2292
2345
  }
2293
2346
  }
2294
2347
  };
@@ -3335,4 +3388,4 @@ const chatThreadRuntimeContainedVisualSettingsSchema = {
3335
3388
  }
3336
3389
  };
3337
3390
 
3338
- 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.28.0-head.5",
3
+ "version": "1.29.1",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -14,5 +14,16 @@ export interface AvatarRuntimeFloaterVisualSettings {
14
14
  schemaVersion?: string;
15
15
  /** Side of screen where agent panel appears */
16
16
  panelSide?: 'left' | 'right';
17
+ /** Label on the lobby button */
18
+ buttonLabel?: string;
19
+ /** Connection options */
20
+ connect?: {
21
+ context?: {
22
+ type: 'thread';
23
+ threadId: string;
24
+ messageId?: string;
25
+ };
26
+ dynamicVariables?: Record<string, unknown>;
27
+ };
17
28
  }
18
29
  export declare const avatarRuntimeFloaterVisualSettingsSchema: ValidatorSchema;
@@ -33,6 +33,8 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
33
33
  disconnect(): void;
34
34
  /** Observable connection status */
35
35
  isConnected: TinyDataStoreConsumer<boolean>;
36
+ /** Observable active state — true from connect() call until fully disconnected */
37
+ isActive: TinyDataStoreConsumer<boolean>;
36
38
  isPaused: TinyDataStoreConsumer<boolean>;
37
39
  captions: Captions;
38
40
  registerClientTools<TMap extends Record<string, unknown>>(tools: {
@@ -91,6 +93,8 @@ export type AvatarServerConfig = {
91
93
  noiseReductionEnabled?: boolean;
92
94
  /** Kaltura sesssion */
93
95
  ks: string;
96
+ /** Whether tap-to-talk mode is enabled for this widget (from appInit widgetConfig.tapToTalk) */
97
+ isTapToTalk?: boolean;
94
98
  };
95
99
  export type AvatarRuntimeSettings = {
96
100
  /** Settings schema version */
@@ -67,6 +67,19 @@ export type AgentScreenShareInfo = {
67
67
  stream: MediaStream | null;
68
68
  analysisReady: boolean;
69
69
  };
70
+ /**
71
+ * Tap-to-talk mode state
72
+ */
73
+ export type AgentTapToTalkInfo = {
74
+ /** Whether tap-to-talk mode is enabled by server config */
75
+ enabled: boolean;
76
+ /** Whether a tap-to-talk recording is currently in progress */
77
+ active: boolean;
78
+ /** Timestamp (ms) when the current recording started, or null when idle */
79
+ startedAt: number | null;
80
+ /** Whether the idle tap-to-talk button should be shown as enabled */
81
+ buttonEnabled: boolean;
82
+ };
70
83
  /**
71
84
  * Agent kaltura context data
72
85
  */
@@ -210,6 +223,8 @@ export interface AvatarConnectionProxyType {
210
223
  readonly screenShareInfo: TinyDataStoreConsumer<AgentScreenShareInfo | null>;
211
224
  /** Observable form paused state */
212
225
  readonly isAvatarPaused: TinyDataStoreConsumer<boolean>;
226
+ /** Observable tap-to-talk mode state */
227
+ readonly tapToTalkInfo: TinyDataStoreConsumer<AgentTapToTalkInfo | null>;
213
228
  /** Observable caption display state — null when feature is disabled */
214
229
  readonly captions: TinyDataStoreConsumer<CaptionState | null>;
215
230
  /** Unique connection identifier */
@@ -228,6 +243,10 @@ export interface AvatarConnectionProxyType {
228
243
  resumeAvatar(): void;
229
244
  /** Request avatar pause after current speech finishes */
230
245
  pauseAvatarAfterSpeaking(): void;
246
+ /** Start a tap-to-talk recording */
247
+ tapToTalkStart(): void;
248
+ /** End the current tap-to-talk recording */
249
+ tapToTalkEnd(): void;
231
250
  /** Clear current visual content */
232
251
  clearContent(): void;
233
252
  /** Toggle caption visibility on/off (no effect when feature is disabled) */
@@ -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 = {