@unisphere/genie-types 1.49.0-quiz-skip.0 → 1.50.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/index.esm.js CHANGED
@@ -1132,6 +1132,14 @@ const resolveActiveContextType = context => {
1132
1132
  };
1133
1133
  };
1134
1134
  const CHAT_CONTEXT_TYPE_GLOBAL = 'global';
1135
+ const speechLanguagesSchema = {
1136
+ type: 'array',
1137
+ optional: true,
1138
+ items: {
1139
+ type: 'primitive',
1140
+ value: 'string'
1141
+ }
1142
+ };
1135
1143
  const chatContextSchema = {
1136
1144
  type: 'orByType',
1137
1145
  optional: true,
@@ -1413,6 +1421,8 @@ const chatRuntimeSettingsSchema = {
1413
1421
  deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
1414
1422
  },
1415
1423
  agentMode: agentModeSchema,
1424
+ userSpeechLanguages: speechLanguagesSchema,
1425
+ agentSpeechLanguages: speechLanguagesSchema,
1416
1426
  // @deprecated - no longer supported
1417
1427
  avatarContainerMode: avatarContainerModeSchema,
1418
1428
  initialThread: {
@@ -1477,6 +1487,8 @@ const chatRuntimePlayerPluginSettingsSchema = {
1477
1487
  integrations: integrationsSchema,
1478
1488
  shareUrl: shareUrlSchema,
1479
1489
  agentMode: agentModeSchema,
1490
+ userSpeechLanguages: speechLanguagesSchema,
1491
+ agentSpeechLanguages: speechLanguagesSchema,
1480
1492
  avatarContainerMode: avatarContainerModeSchema
1481
1493
  }
1482
1494
  };
@@ -2695,7 +2707,9 @@ const avatarRuntimeSettingsSchema = {
2695
2707
  getSourceUrl: getSourceUrlSchema,
2696
2708
  kaltura: kalturaSchema,
2697
2709
  features: featuresSchema,
2698
- multipleAvatarBehavior: multipleAvatarBehaviorSchema
2710
+ multipleAvatarBehavior: multipleAvatarBehaviorSchema,
2711
+ userSpeechLanguages: speechLanguagesSchema,
2712
+ agentSpeechLanguages: speechLanguagesSchema
2699
2713
  }
2700
2714
  },
2701
2715
  // serverConfig: 'studio'
@@ -2724,7 +2738,9 @@ const avatarRuntimeSettingsSchema = {
2724
2738
  getSourceUrl: getSourceUrlSchema,
2725
2739
  kaltura: kalturaSchema,
2726
2740
  features: featuresSchema,
2727
- multipleAvatarBehavior: multipleAvatarBehaviorSchema
2741
+ multipleAvatarBehavior: multipleAvatarBehaviorSchema,
2742
+ userSpeechLanguages: speechLanguagesSchema,
2743
+ agentSpeechLanguages: speechLanguagesSchema
2728
2744
  }
2729
2745
  }]
2730
2746
  };
@@ -4156,6 +4172,18 @@ function isFlashcardBlock(b) {
4156
4172
  function isSourcesBlock(b) {
4157
4173
  return b.type === 'unisphere-tool' && b.runtimeName === 'sources-tool' && b.status !== 'error' && typeof b.settings === 'object' && b.settings !== null && Array.isArray(b.settings.sources);
4158
4174
  }
4175
+ function isEventToolBlock(b, runtimeName, itemsKey) {
4176
+ return b.type === 'unisphere-tool' && b.runtimeName === runtimeName && b.status !== 'error' && typeof b.settings === 'object' && b.settings !== null && Array.isArray(b.settings[itemsKey]);
4177
+ }
4178
+ function isEventSessionsBlock(b) {
4179
+ return isEventToolBlock(b, 'event-sessions-tool', 'sessions');
4180
+ }
4181
+ function isEventSpeakersBlock(b) {
4182
+ return isEventToolBlock(b, 'event-speakers-tool', 'speakers');
4183
+ }
4184
+ function isEventChannelsBlock(b) {
4185
+ return isEventToolBlock(b, 'event-channels-tool', 'channels');
4186
+ }
4159
4187
  function isFollowupsBlock(b) {
4160
4188
  return b.type === 'unisphere-tool' && b.runtimeName === 'followups-tool' && b.status !== 'error';
4161
4189
  }
@@ -4164,4 +4192,4 @@ function isTextBlock(b) {
4164
4192
  }
4165
4193
  const hasSources = blocks => blocks.some(b => b.type === 'unisphere-tool' && b.runtimeName === 'sources-tool');
4166
4194
 
4167
- export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, INCLUDE_TIME_CAPABILITY, SUPPORTED_LAYOUT_TYPES, TIMEZONE_VARIABLE_NAME, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeConnectSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeHeadlessVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, buildClientRequestVars, chatContextSchema, chatCustomizationSchema, chatCustomizationSchemaProperties, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, dynamicVariablesSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getBrowserTimezone, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, hasSources, integrationsSchema, isAvatarConnectionProxyInternalType, isFlashcardBlock, isFlashcardElement, isFollowupsBlock, isFollowupsElement, isPDFSourceItem, isSourcesBlock, isSourcesElement, isTextBlock, isTextFlashcard, isVideoGalleryFlashcard, isVideoSourceItem, multipleAvatarBehaviorSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, widgetName };
4195
+ export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, INCLUDE_TIME_CAPABILITY, SUPPORTED_LAYOUT_TYPES, TIMEZONE_VARIABLE_NAME, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeConnectSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeHeadlessVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, buildClientRequestVars, chatContextSchema, chatCustomizationSchema, chatCustomizationSchemaProperties, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, dynamicVariablesSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getBrowserTimezone, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, hasSources, integrationsSchema, isAvatarConnectionProxyInternalType, isEventChannelsBlock, isEventSessionsBlock, isEventSpeakersBlock, isFlashcardBlock, isFlashcardElement, isFollowupsBlock, isFollowupsElement, isPDFSourceItem, isSourcesBlock, isSourcesElement, isTextBlock, isTextFlashcard, isVideoGalleryFlashcard, isVideoSourceItem, multipleAvatarBehaviorSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, speechLanguagesSchema, widgetName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.49.0-quiz-skip.0",
3
+ "version": "1.50.0",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@kaltura-sdk/rtc-core": "^1.27.0",
13
13
  "@unisphere/core": "^1.103.0",
14
- "@unisphere/runtime": "^1.98.0",
14
+ "@unisphere/runtime": "^1.103.0",
15
15
  "@unisphere/runtime-js": "^1.98.0"
16
16
  },
17
17
  "module": "./index.esm.js",
@@ -205,6 +205,10 @@ export type AvatarRuntimeSettings = {
205
205
  getSourceUrl?: GlobalChatSettings['getSourceUrl'];
206
206
  /** What happens when several avatars share the page and one is already in a call. Defaults to `{ preventDisconnections: false }`. */
207
207
  multipleAvatarBehavior?: MultipleAvatarBehavior;
208
+ /** Languages the user speaks (ISO 639-1, ordered, e.g. `['ar', 'en']`); sent to the server as speech-recognition hints. Omit to keep the server default. Applies to both `manual` and `studio` modes. */
209
+ userSpeechLanguages?: GlobalChatSettings['userSpeechLanguages'];
210
+ /** Languages the agent can speak (ISO 639-1, ordered); sent to the server for text-to-speech. Omit to keep the server default. Applies to both `manual` and `studio` modes. */
211
+ agentSpeechLanguages?: GlobalChatSettings['agentSpeechLanguages'];
208
212
  } & (({
209
213
  serverConfig?: 'manual';
210
214
  } & Omit<AvatarServerConfig, 'ks'>) | {
@@ -34,6 +34,10 @@ export interface BaseChatRuntimeSettings {
34
34
  context?: ChatContext;
35
35
  /** Enable agent mode for advanced AI features */
36
36
  agentMode?: boolean;
37
+ /** Languages the user speaks (ISO 639-1, ordered, e.g. `['ar', 'en']`); the avatar uses them as speech-recognition hints */
38
+ userSpeechLanguages?: GlobalChatSettings['userSpeechLanguages'];
39
+ /** Languages the agent can speak (ISO 639-1, ordered) */
40
+ agentSpeechLanguages?: GlobalChatSettings['agentSpeechLanguages'];
37
41
  /** @deprecated Use customization.avatar.stage instead */
38
42
  avatarContainerMode?: 'dialog' | 'contained';
39
43
  /** External service integrations (Kaltura player, avatar) */
@@ -148,6 +148,10 @@ export interface GlobalChatSettings {
148
148
  capabilities?: GenieCapabilities;
149
149
  /** Dynamic variables for genie brain */
150
150
  dynamicVariables?: GenieDynamicVariables;
151
+ /** Languages the user speaks (ISO 639-1, ordered, e.g. `['ar', 'en']`); the avatar server uses them as speech-recognition hints. Omit to keep the server default. */
152
+ userSpeechLanguages?: string[];
153
+ /** Languages the agent can speak (ISO 639-1, ordered); the avatar server will use them for text-to-speech. Omit to keep the server default. */
154
+ agentSpeechLanguages?: string[];
151
155
  /** Callback function to generate source URLs for an entry or category */
152
156
  getSourceUrl?: (params: {
153
157
  type: 'category';
@@ -179,6 +183,7 @@ export interface GlobalChatSettings {
179
183
  kaltura?: KalturaIntegration;
180
184
  };
181
185
  }
186
+ export declare const speechLanguagesSchema: ValidatorSchema;
182
187
  export declare const chatContextSchema: ValidatorSchema;
183
188
  export declare const integrationsSchema: ValidatorSchema;
184
189
  export declare const shareUrlSchema: ValidatorSchema;
@@ -19,9 +19,20 @@ export declare function isSourcesBlock(b: UnisphereChatBlock): b is UnisphereCha
19
19
  runtimeName: 'sources-tool';
20
20
  status: 'loading' | 'ready';
21
21
  settings: {
22
- sources: string[];
22
+ sources: {
23
+ entry_id?: string;
24
+ }[];
23
25
  };
24
26
  };
27
+ type EventToolBlock<R extends string, K extends string> = UnisphereChatBlock & {
28
+ type: 'unisphere-tool';
29
+ runtimeName: R;
30
+ status: 'loading' | 'ready';
31
+ settings: Record<K, unknown[]>;
32
+ };
33
+ export declare function isEventSessionsBlock(b: UnisphereChatBlock): b is EventToolBlock<'event-sessions-tool', 'sessions'>;
34
+ export declare function isEventSpeakersBlock(b: UnisphereChatBlock): b is EventToolBlock<'event-speakers-tool', 'speakers'>;
35
+ export declare function isEventChannelsBlock(b: UnisphereChatBlock): b is EventToolBlock<'event-channels-tool', 'channels'>;
25
36
  export type FollowupsBlock = UnisphereChatBlock & {
26
37
  type: 'unisphere-tool';
27
38
  runtimeName: 'followups-tool';
@@ -34,3 +45,4 @@ export declare function isTextBlock(b: UnisphereChatBlock): b is UnisphereChatBl
34
45
  content: string;
35
46
  };
36
47
  export declare const hasSources: (blocks: UnisphereChatBlock[]) => boolean;
48
+ export {};