@unisphere/genie-types 1.20.0 → 1.21.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
@@ -1098,6 +1098,71 @@ const getAvatarDefaultCapabilities = context => {
1098
1098
  }
1099
1099
  return AVATAR_DEFAULT_CAPABILITIES;
1100
1100
  };
1101
+ const chatContextSchema = {
1102
+ type: 'orByType',
1103
+ optional: true,
1104
+ schemas: {
1105
+ entry: {
1106
+ type: 'object',
1107
+ properties: {
1108
+ type: {
1109
+ type: 'literal',
1110
+ value: 'entry'
1111
+ },
1112
+ id: {
1113
+ type: 'primitive',
1114
+ value: 'string'
1115
+ },
1116
+ imageUrl: {
1117
+ type: 'primitive',
1118
+ value: 'string',
1119
+ optional: true
1120
+ },
1121
+ title: {
1122
+ type: 'primitive',
1123
+ value: 'string',
1124
+ optional: true
1125
+ }
1126
+ }
1127
+ },
1128
+ category: {
1129
+ type: 'object',
1130
+ properties: {
1131
+ type: {
1132
+ type: 'literal',
1133
+ value: 'category'
1134
+ },
1135
+ id: {
1136
+ type: 'primitive',
1137
+ value: 'string'
1138
+ },
1139
+ title: {
1140
+ type: 'primitive',
1141
+ value: 'string',
1142
+ optional: true
1143
+ }
1144
+ }
1145
+ },
1146
+ 'ancestor-category': {
1147
+ type: 'object',
1148
+ properties: {
1149
+ type: {
1150
+ type: 'literal',
1151
+ value: 'ancestor-category'
1152
+ },
1153
+ id: {
1154
+ type: 'primitive',
1155
+ value: 'string'
1156
+ },
1157
+ title: {
1158
+ type: 'primitive',
1159
+ value: 'string',
1160
+ optional: true
1161
+ }
1162
+ }
1163
+ }
1164
+ }
1165
+ };
1101
1166
  const integrationsSchema = {
1102
1167
  type: 'object',
1103
1168
  properties: {
@@ -1264,20 +1329,7 @@ const chatRuntimeSettingsSchema = {
1264
1329
  },
1265
1330
  optional: true
1266
1331
  },
1267
- context: {
1268
- type: 'object',
1269
- optional: true,
1270
- properties: {
1271
- type: {
1272
- type: 'enum',
1273
- values: ['entry', 'category']
1274
- },
1275
- id: {
1276
- type: 'primitive',
1277
- value: 'string'
1278
- }
1279
- }
1280
- },
1332
+ context: chatContextSchema,
1281
1333
  // @deprecated - kept for backward compatibility
1282
1334
  entryId: {
1283
1335
  type: 'primitive',
@@ -1322,20 +1374,7 @@ const chatRuntimePlayerPluginSettingsSchema = {
1322
1374
  value: 'string',
1323
1375
  optional: true
1324
1376
  },
1325
- context: {
1326
- type: 'object',
1327
- optional: true,
1328
- properties: {
1329
- type: {
1330
- type: 'enum',
1331
- values: ['entry', 'category']
1332
- },
1333
- id: {
1334
- type: 'primitive',
1335
- value: 'string'
1336
- }
1337
- }
1338
- },
1377
+ context: chatContextSchema,
1339
1378
  // @deprecated - kept for backward compatibility
1340
1379
  entryId: {
1341
1380
  type: 'primitive',
@@ -1529,7 +1568,8 @@ const floaterVisualSettingsSchema = {
1529
1568
  type: 'enum',
1530
1569
  values: ['chat', 'everywhere'],
1531
1570
  optional: true
1532
- }
1571
+ },
1572
+ context: chatContextSchema
1533
1573
  }
1534
1574
  };
1535
1575
  const floaterCTAVisualSettingsSchema = {
@@ -1555,6 +1595,7 @@ const floaterCTAVisualSettingsSchema = {
1555
1595
  value: 'boolean',
1556
1596
  optional: true
1557
1597
  },
1598
+ context: chatContextSchema,
1558
1599
  type: {
1559
1600
  type: 'literal',
1560
1601
  value: 'button',
@@ -1604,13 +1645,24 @@ const containedVisualSettingsSchema = {
1604
1645
  values: ['body', 'container', 'modal'],
1605
1646
  optional: true
1606
1647
  },
1607
- context: {
1648
+ context: chatContextSchema,
1649
+ closeButtonType: {
1650
+ type: 'enum',
1651
+ values: ['none', 'drawer', 'close'],
1652
+ optional: true
1653
+ }
1654
+ }
1655
+ };
1656
+ const pageContextSchema = {
1657
+ type: 'orByType',
1658
+ optional: true,
1659
+ schemas: {
1660
+ entry: {
1608
1661
  type: 'object',
1609
- optional: true,
1610
1662
  properties: {
1611
1663
  type: {
1612
- type: 'enum',
1613
- values: ['entry', 'category', 'ancestor-category']
1664
+ type: 'literal',
1665
+ value: 'entry'
1614
1666
  },
1615
1667
  id: {
1616
1668
  type: 'primitive',
@@ -1618,10 +1670,31 @@ const containedVisualSettingsSchema = {
1618
1670
  }
1619
1671
  }
1620
1672
  },
1621
- closeButtonType: {
1622
- type: 'enum',
1623
- values: ['none', 'drawer', 'close'],
1624
- optional: true
1673
+ category: {
1674
+ type: 'object',
1675
+ properties: {
1676
+ type: {
1677
+ type: 'literal',
1678
+ value: 'category'
1679
+ },
1680
+ id: {
1681
+ type: 'primitive',
1682
+ value: 'string'
1683
+ }
1684
+ }
1685
+ },
1686
+ 'ancestor-category': {
1687
+ type: 'object',
1688
+ properties: {
1689
+ type: {
1690
+ type: 'literal',
1691
+ value: 'ancestor-category'
1692
+ },
1693
+ id: {
1694
+ type: 'primitive',
1695
+ value: 'string'
1696
+ }
1697
+ }
1625
1698
  }
1626
1699
  }
1627
1700
  };
@@ -1639,6 +1712,7 @@ const pageVisualSettingsSchema = {
1639
1712
  optional: true
1640
1713
  },
1641
1714
  customization: chatCustomizationSchema,
1715
+ context: pageContextSchema,
1642
1716
  initialQuestion: {
1643
1717
  type: 'object',
1644
1718
  optional: true,
@@ -2111,20 +2185,7 @@ const avatarRuntimeSettingsSchema = {
2111
2185
  type: 'primitive',
2112
2186
  value: 'string'
2113
2187
  },
2114
- context: {
2115
- type: 'object',
2116
- optional: true,
2117
- properties: {
2118
- type: {
2119
- type: 'enum',
2120
- values: ['entry', 'category']
2121
- },
2122
- id: {
2123
- type: 'primitive',
2124
- value: 'string'
2125
- }
2126
- }
2127
- },
2188
+ context: chatContextSchema,
2128
2189
  capabilities: {
2129
2190
  type: 'object',
2130
2191
  optional: true,
@@ -2285,12 +2346,7 @@ const avatarRuntimeLobbyVisualSettingsSchema = {
2285
2346
  },
2286
2347
  variant: {
2287
2348
  type: 'enum',
2288
- values: ['default', 'mini', 'buttonOnly', 'agent'],
2289
- optional: true
2290
- },
2291
- isTranslucent: {
2292
- type: 'primitive',
2293
- value: 'boolean',
2349
+ values: ['agent'],
2294
2350
  optional: true
2295
2351
  },
2296
2352
  threadId: {
@@ -2331,11 +2387,6 @@ const avatarRuntimeLobbyVisualSettingsSchema = {
2331
2387
  },
2332
2388
  optional: true
2333
2389
  },
2334
- hideStartButton: {
2335
- type: 'primitive',
2336
- value: 'boolean',
2337
- optional: true
2338
- },
2339
2390
  onOpen: {
2340
2391
  type: 'function',
2341
2392
  optional: true
@@ -3235,4 +3286,4 @@ const contentGalleryToolRuntimeGenieAnswerVisualSettingsSchema = {
3235
3286
  }
3236
3287
  };
3237
3288
 
3238
- export { AVATAR_DEFAULT_CAPABILITIES, AdminDemoRuntimeName, AdminRuntimeName, AgentUnavailabilityReasons, AnswerModelEnum, AnswerTypeEnum, ApplicationRuntimeName, AvatarConnectionStatus, AvatarRuntimeName, AvatarStatus, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ContentGalleryToolRuntimeName, DeviceType, DisconnectReasons, FlashcardsToolRuntimeName, FollowupsToolRuntimeName, GenUiComponentsToolRuntimeName, GenUiComposerToolRuntimeName, GtcAgendaListToolRuntimeName, GtcAgendaToolRuntimeName, KalturaVideoPlayerToolRuntimeName, Nvidia2026EventToolRuntimeName, SourcesToolRuntimeName, SummaryToolRuntimeName, adminDemoRuntimeSettingsSchema, adminRuntimeSettingsSchema, applicationRuntimeSettingsSchema, avatarRuntimeAgentVisualSettingsSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeLobbyVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, contentGalleryToolRuntimeAvatarVisualSettingsSchema, contentGalleryToolRuntimeGenieAnswerVisualSettingsSchema, contentGalleryToolRuntimeSettingsSchema, flashcardsToolRuntimeSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, followupsToolRuntimeAvatarVisualSettingsSchema, followupsToolRuntimeGenieAnswerVisualSettingsSchema, followupsToolRuntimeSettingsSchema, genUiComponentsToolRuntimeCardVisualSettingsSchema, genUiComponentsToolRuntimeLoginVisualSettingsSchema, genUiComponentsToolRuntimeMarkdownVisualSettingsSchema, genUiComponentsToolRuntimePlayerVisualSettingsSchema, genUiComponentsToolRuntimeQuestionsPresetsVisualSettingsSchema, genUiComponentsToolRuntimeSettingsSchema, genUiComposerToolRuntimeAvatarVisualSettingsSchema, genUiComposerToolRuntimeSettingsSchema, genieAnswerVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getSourceUrlSchema, gtcAgendaListToolRuntimeAvatarVisualSettingsSchema, gtcAgendaListToolRuntimeSettingsSchema, gtcAgendaToolRuntimeAvatarVisualSettingsSchema, gtcAgendaToolRuntimeSettingsSchema, integrationsSchema, isAvatarConnectionProxyInternalType, kalturaVideoPlayerToolRuntimeAvatarVisualSettingsSchema, kalturaVideoPlayerToolRuntimeSettingsSchema, nvidia2026EventToolRuntimeSettingsSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, shareUrlSchema, slideSchema, sourcesToolRuntimeGenieAnswerVisualSettingsSchema, sourcesToolRuntimeSettingsSchema, summaryToolRuntimeGenieAnswerVisualSettingsSchema, summaryToolRuntimeSettingsSchema, widgetName };
3289
+ export { AVATAR_DEFAULT_CAPABILITIES, AdminDemoRuntimeName, AdminRuntimeName, AgentUnavailabilityReasons, AnswerModelEnum, AnswerTypeEnum, ApplicationRuntimeName, AvatarConnectionStatus, AvatarRuntimeName, AvatarStatus, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ContentGalleryToolRuntimeName, DeviceType, DisconnectReasons, FlashcardsToolRuntimeName, FollowupsToolRuntimeName, GenUiComponentsToolRuntimeName, GenUiComposerToolRuntimeName, GtcAgendaListToolRuntimeName, GtcAgendaToolRuntimeName, KalturaVideoPlayerToolRuntimeName, Nvidia2026EventToolRuntimeName, SourcesToolRuntimeName, SummaryToolRuntimeName, adminDemoRuntimeSettingsSchema, adminRuntimeSettingsSchema, applicationRuntimeSettingsSchema, avatarRuntimeAgentVisualSettingsSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeLobbyVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, contentGalleryToolRuntimeAvatarVisualSettingsSchema, contentGalleryToolRuntimeGenieAnswerVisualSettingsSchema, contentGalleryToolRuntimeSettingsSchema, flashcardsToolRuntimeSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, followupsToolRuntimeAvatarVisualSettingsSchema, followupsToolRuntimeGenieAnswerVisualSettingsSchema, followupsToolRuntimeSettingsSchema, genUiComponentsToolRuntimeCardVisualSettingsSchema, genUiComponentsToolRuntimeLoginVisualSettingsSchema, genUiComponentsToolRuntimeMarkdownVisualSettingsSchema, genUiComponentsToolRuntimePlayerVisualSettingsSchema, genUiComponentsToolRuntimeQuestionsPresetsVisualSettingsSchema, genUiComponentsToolRuntimeSettingsSchema, genUiComposerToolRuntimeAvatarVisualSettingsSchema, genUiComposerToolRuntimeSettingsSchema, genieAnswerVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getSourceUrlSchema, gtcAgendaListToolRuntimeAvatarVisualSettingsSchema, gtcAgendaListToolRuntimeSettingsSchema, gtcAgendaToolRuntimeAvatarVisualSettingsSchema, gtcAgendaToolRuntimeSettingsSchema, integrationsSchema, isAvatarConnectionProxyInternalType, kalturaVideoPlayerToolRuntimeAvatarVisualSettingsSchema, kalturaVideoPlayerToolRuntimeSettingsSchema, nvidia2026EventToolRuntimeSettingsSchema, pageVisualSettingsSchema, popupVisualSettingsSchema, shareUrlSchema, slideSchema, sourcesToolRuntimeGenieAnswerVisualSettingsSchema, sourcesToolRuntimeSettingsSchema, summaryToolRuntimeGenieAnswerVisualSettingsSchema, summaryToolRuntimeSettingsSchema, widgetName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "types": "./src/index.d.ts",
11
11
  "dependencies": {
12
12
  "@kaltura-sdk/rtc-core": "^1.25.12",
13
- "@unisphere/core": "^1.98.0",
13
+ "@unisphere/core": "^1.99.0",
14
14
  "@unisphere/runtime": "^1.97.0"
15
15
  },
16
16
  "module": "./index.esm.js",
@@ -37,8 +37,12 @@ export interface ApplicationRuntimeSettings {
37
37
  ks: string;
38
38
  /** Kaltura server URI */
39
39
  kalturaServerURI: string;
40
- /** Callback function to generate source URLs with entry ID and optional start time */
41
- getSourceUrl?: ({ entryId, startTime, }: {
40
+ /** Callback function to generate source URLs for an entry or category */
41
+ getSourceUrl?: (params: {
42
+ type: 'category';
43
+ categoryId: string;
44
+ } | {
45
+ type?: 'entry';
42
46
  entryId: string;
43
47
  startTime?: number;
44
48
  }) => string;
@@ -25,10 +25,8 @@ import { ValidatorSchema } from '@unisphere/core';
25
25
  export interface AvatarRuntimeLobbyVisualSettings {
26
26
  /** Settings schema version */
27
27
  schemaVersion?: string;
28
- /** Display variant: 'default' for full lobby, 'mini' for compact, 'buttonOnly' for minimal, 'agent' for agent-specific UI */
29
- variant?: 'default' | 'mini' | 'buttonOnly' | 'agent';
30
- /** Enable translucent/semi-transparent UI elements */
31
- isTranslucent?: boolean;
28
+ /** Display variant: 'agent' for agent-specific UI */
29
+ variant?: 'agent';
32
30
  /** Thread identifier for resuming conversations */
33
31
  threadId?: string;
34
32
  /** Message identifier for context */
@@ -44,8 +42,6 @@ export interface AvatarRuntimeLobbyVisualSettings {
44
42
  /** Styles applied to the outer wrapper (mini variant only) */
45
43
  wrapper?: Record<string, string | number>;
46
44
  };
47
- /** Hide the start conversation button (e.g. when interaction limit is exceeded) */
48
- hideStartButton?: boolean;
49
45
  /** When provided, overrides the default avatar launch behavior on click */
50
46
  onOpen?: () => void;
51
47
  }
@@ -14,7 +14,10 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
14
14
  readonly widgetName: typeof widgetName;
15
15
  readonly runtimeName: typeof AvatarRuntimeName;
16
16
  /** Establish connection to the avatar service */
17
- connect(): void;
17
+ connect(params?: {
18
+ threadId?: string;
19
+ messageId?: string;
20
+ }): void;
18
21
  /** Disconnect from the avatar service */
19
22
  disconnect(): void;
20
23
  /** Observable connection status */
@@ -44,12 +44,7 @@ export interface ChatRuntimePlayerPlugin extends UnisphereRuntimeBaseType<ChatRu
44
44
  */
45
45
  export interface ChatRuntimePlayerPluginSettings {
46
46
  /** Context for the chat session */
47
- context?: {
48
- /** Context type - 'entry' for media entries, 'category' for content categories */
49
- type: 'entry' | 'category';
50
- /** Media entry ID or category ID for context-aware conversations */
51
- id: string;
52
- };
47
+ context?: GlobalChatSettings['context'];
53
48
  /** Kaltura session token for authentication */
54
49
  ks?: string;
55
50
  /** Kaltura partner ID */
@@ -1,7 +1,7 @@
1
1
  import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
2
2
  import { ValidatorSchema } from '@unisphere/core';
3
3
  import { widgetName } from '../widget-types';
4
- import { GlobalChatSettings } from './shared-settings';
4
+ import { ChatContext, GlobalChatSettings } from './shared-settings';
5
5
  /** Runtime name constant for chat experiences */
6
6
  export declare const ChatRuntimeName: "chat";
7
7
  /**
@@ -65,12 +65,7 @@ export interface ChatRuntimeSettings {
65
65
  /** Kaltura partner ID */
66
66
  partnerId?: string;
67
67
  /** Context for the chat session */
68
- context?: {
69
- /** Context type - 'entry' for media entries, 'category' for content categories */
70
- type: 'entry' | 'category';
71
- /** Media entry ID or category ID for context-aware conversations */
72
- id: string;
73
- };
68
+ context?: ChatContext;
74
69
  /** Enable agent mode for advanced AI features */
75
70
  agentMode?: boolean;
76
71
  /** Avatar display mode: 'dialog' for modal or 'contained' for embedded */
@@ -13,10 +13,16 @@ export declare const CHAT_DEFAULT_CAPABILITIES: GenieCapabilities;
13
13
  export declare const AVATAR_DEFAULT_CAPABILITIES: GenieCapabilities;
14
14
  export declare const getChatDefaultCapabilities: (context?: ChatContext) => GenieCapabilities;
15
15
  export declare const getAvatarDefaultCapabilities: (context?: ChatContext) => GenieCapabilities;
16
- export interface ChatContext {
17
- type: 'entry' | 'category';
16
+ export type ChatContext = {
17
+ type: 'entry';
18
18
  id: string;
19
- }
19
+ imageUrl?: string;
20
+ title?: string;
21
+ } | {
22
+ type: 'category' | 'ancestor-category';
23
+ id: string;
24
+ title?: string;
25
+ };
20
26
  /**
21
27
  * Branding configuration for chat UI.
22
28
  */
@@ -72,6 +78,8 @@ export type AvatarIntegration = {
72
78
  } | {
73
79
  /** Configuration type: 'byKS' for automatic setup using Kaltura session */
74
80
  type: 'byKS';
81
+ /** Loading video URL displayed during initialization */
82
+ loadingVideoURL?: string;
75
83
  /** Preview image URL displayed before avatar loads */
76
84
  previewImageUrl?: string;
77
85
  };
@@ -119,8 +127,12 @@ export interface GlobalChatSettings {
119
127
  context?: ChatContext;
120
128
  /** Genie capability overrides — defaults applied per API if absent */
121
129
  capabilities?: GenieCapabilities;
122
- /** Callback function to generate source URLs with entry ID and optional start time */
130
+ /** Callback function to generate source URLs for an entry or category */
123
131
  getSourceUrl?: (params: {
132
+ type: 'category';
133
+ categoryId: string;
134
+ } | {
135
+ type?: 'entry';
124
136
  entryId: string;
125
137
  startTime?: number;
126
138
  }) => string;
@@ -143,6 +155,7 @@ export interface GlobalChatSettings {
143
155
  kaltura?: KalturaIntegration;
144
156
  };
145
157
  }
158
+ export declare const chatContextSchema: ValidatorSchema;
146
159
  export declare const integrationsSchema: ValidatorSchema;
147
160
  export declare const shareUrlSchema: ValidatorSchema;
148
161
  export declare const getSourceUrlSchema: ValidatorSchema;
@@ -1,5 +1,6 @@
1
1
  import { ValidatorSchema } from '@unisphere/core';
2
2
  import { ChatCustomization } from '../shared/chat-customizations-types';
3
+ import { ChatContext } from './shared-settings';
3
4
  import { AnswerTypeEnum } from '../types';
4
5
  /**
5
6
  * Visual settings for page-embedded chat experiences.
@@ -21,6 +22,8 @@ export interface PageVisualSettings {
21
22
  scroll?: 'body' | 'container' | 'modal';
22
23
  /** Custom UI styling and behavior options */
23
24
  customization?: ChatCustomization;
25
+ /** Context for the chat session — host-provided, not user-controllable */
26
+ context?: Pick<ChatContext, 'type' | 'id'>;
24
27
  }
25
28
  /**
26
29
  * Visual settings for banner/hero-style chat landing pages.
@@ -110,12 +113,7 @@ export interface ContainedVisualSettings {
110
113
  /** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
111
114
  scroll?: 'body' | 'container' | 'modal';
112
115
  /** Context for the chat session */
113
- context?: {
114
- /** Context type - 'entry' for media entries, 'category' for content categories */
115
- type: 'entry' | 'category' | 'ancestor-category';
116
- /** Media entry ID or category ID for context-aware conversations */
117
- id: string;
118
- };
116
+ context?: ChatContext;
119
117
  /** Type of close button to display in the header */
120
118
  closeButtonType?: 'none' | 'drawer' | 'close';
121
119
  }
@@ -124,6 +122,7 @@ export type FloaterCTAVisualSettings = {
124
122
  position?: 'bottom-right' | 'bottom-center' | 'bottom-left';
125
123
  mode?: 'chat' | 'everywhere';
126
124
  openByDefault?: boolean;
125
+ context?: ChatContext;
127
126
  } & {
128
127
  type?: 'button';
129
128
  text?: string;
@@ -132,6 +131,7 @@ export type FloaterCTAVisualSettings = {
132
131
  export interface FloaterVisualSettings {
133
132
  schemaVersion?: '1';
134
133
  mode?: 'chat' | 'everywhere';
134
+ context?: ChatContext;
135
135
  }
136
136
  export declare const floaterVisualSettingsSchema: ValidatorSchema;
137
137
  export declare const floaterCTAVisualSettingsSchema: ValidatorSchema;