@unisphere/genie-types 1.16.1 → 1.18.0-avatar-chat.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.16.1",
3
+ "version": "1.18.0-avatar-chat.1",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -10,8 +10,8 @@
10
10
  "types": "./src/index.d.ts",
11
11
  "dependencies": {
12
12
  "@kaltura-sdk/rtc-core": "^1.25.2",
13
- "@unisphere/core": "^1.95.0",
14
- "@unisphere/runtime": "^1.91.0"
13
+ "@unisphere/core": "^1.97.1",
14
+ "@unisphere/runtime": "^1.97.0"
15
15
  },
16
16
  "module": "./index.esm.js",
17
17
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  import { UnisphereService } from '@unisphere/runtime';
2
2
  import { TinyDataStoreConsumer } from '@unisphere/core';
3
3
  import { DeviceEnumerationResult } from '@kaltura-sdk/rtc-core';
4
+ import type { ChatEntry } from './chat-types';
4
5
  /**
5
6
  * Avatar service configuration.
6
7
  */
@@ -196,6 +197,8 @@ export interface AvatarConnectionProxyType {
196
197
  } | null>;
197
198
  /** Observable thread identifier */
198
199
  readonly threadId: TinyDataStoreConsumer<string | null>;
200
+ /** Observable chat log entries */
201
+ readonly chatLog: TinyDataStoreConsumer<ChatEntry[]>;
199
202
  /** Unique connection identifier */
200
203
  readonly id: string;
201
204
  /** Send text message to avatar */
@@ -0,0 +1,7 @@
1
+ export type ChatEntryRole = 'user' | 'avatar';
2
+ export type ChatEntry = {
3
+ id: string;
4
+ role: ChatEntryRole;
5
+ text: string;
6
+ turnId?: string;
7
+ };
@@ -1,5 +1,6 @@
1
1
  export * from './runtime-types';
2
2
  export * from './chat-visual-types';
3
+ export * from './chat-types';
3
4
  export * from './avatar-service-types';
4
5
  export * from './contained-visual-types';
5
6
  export * from './lobby-visual-types';
@@ -37,8 +37,13 @@ export interface AvatarRuntimeLobbyVisualSettings {
37
37
  agentButtonLabel?: string;
38
38
  /** Agent variant only: size (width and height) of the card, e.g. '15rem' */
39
39
  agentSize?: string;
40
- /** Inline styles applied to the root container of any variant */
41
- style?: Record<string, string | number>;
40
+ /** Inline styles applied to lobby elements */
41
+ styles?: {
42
+ /** Styles applied to the inner container (thumbnail/card) */
43
+ container?: Record<string, string | number>;
44
+ /** Styles applied to the outer wrapper (mini variant only) */
45
+ wrapper?: Record<string, string | number>;
46
+ };
42
47
  /** Hide the start conversation button (e.g. when interaction limit is exceeded) */
43
48
  hideStartButton?: boolean;
44
49
  }
@@ -1,6 +1,7 @@
1
1
  import { TinyDataStoreConsumer, ValidatorSchema } from '@unisphere/core';
2
2
  import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
3
3
  import { widgetName } from '../widget-types';
4
+ import { ChatContext, GenieCapabilities } from '../chat-runtime/shared-settings';
4
5
  /** Runtime name constant for avatar experiences */
5
6
  export declare const AvatarRuntimeName: "avatar";
6
7
  /**
@@ -56,7 +57,8 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
56
57
  * kaltura: {
57
58
  * ks: 'your-kaltura-session-token',
58
59
  * partnerId: '12345',
59
- * entryId: 'entry_xyz'
60
+ * context: { type: 'entry', id: 'entry_xyz' },
61
+ * capabilities: { use_knowledge_base: 'on' }
60
62
  * }
61
63
  * };
62
64
  * ```
@@ -92,8 +94,10 @@ export interface AvatarRuntimeSettings {
92
94
  kaltura: {
93
95
  /** Kaltura session token for authentication */
94
96
  ks: string;
95
- /** Media entry ID for context */
96
- entryId?: string;
97
+ /** Context for the avatar session */
98
+ context?: ChatContext;
99
+ /** Genie capability overrides — defaults applied per API if absent */
100
+ capabilities?: GenieCapabilities;
97
101
  /** Kaltura server URI */
98
102
  kalturaServerURI?: string;
99
103
  /** Kaltura partner ID */
@@ -1,5 +1,4 @@
1
- export * from './runtime-flavors/runtime-types';
2
- export * from './runtime-flavors/runtime-player-plugin-types';
1
+ export * from './runtime-types';
2
+ export * from './runtime-player-plugin-types';
3
3
  export * from './visuals-types';
4
- export * from './types';
5
4
  export * from './shared-settings';
@@ -1,8 +1,8 @@
1
1
  import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
2
2
  import { ValidatorSchema } from '@unisphere/core';
3
- import { widgetName } from '../../widget-types';
4
- import { ChatRuntimeName } from '../types';
5
- import { GlobalChatSettings } from '../shared-settings';
3
+ import { widgetName } from '../widget-types';
4
+ import { ChatRuntimeName } from './runtime-types';
5
+ import { GlobalChatSettings } from './shared-settings';
6
6
  /**
7
7
  * Chat runtime interface for player plugin integration.
8
8
  *
@@ -20,7 +20,7 @@ export interface ChatRuntimePlayerPlugin extends UnisphereRuntimeBaseType<ChatRu
20
20
  * Basic player plugin setup:
21
21
  * ```typescript
22
22
  * const settings: ChatRuntimePlayerPluginSettings = {
23
- * entryId: 'video_123',
23
+ * context: { type: 'entry', id: 'video_123' },
24
24
  * ks: 'your-kaltura-session-token'
25
25
  * };
26
26
  * ```
@@ -29,7 +29,7 @@ export interface ChatRuntimePlayerPlugin extends UnisphereRuntimeBaseType<ChatRu
29
29
  * With integrations:
30
30
  * ```typescript
31
31
  * const settings: ChatRuntimePlayerPluginSettings = {
32
- * entryId: 'video_123',
32
+ * context: { type: 'entry', id: 'video_123' },
33
33
  * ks: 'your-kaltura-session-token',
34
34
  * partnerId: '12345',
35
35
  * agentMode: true,
@@ -43,8 +43,13 @@ export interface ChatRuntimePlayerPlugin extends UnisphereRuntimeBaseType<ChatRu
43
43
  * ```
44
44
  */
45
45
  export interface ChatRuntimePlayerPluginSettings {
46
- /** Media entry ID for the video being played */
47
- entryId: string;
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
+ };
48
53
  /** Kaltura session token for authentication */
49
54
  ks?: string;
50
55
  /** Kaltura partner ID */
@@ -1,8 +1,9 @@
1
1
  import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
2
2
  import { ValidatorSchema } from '@unisphere/core';
3
- import { widgetName } from '../../widget-types';
4
- import { ChatRuntimeName } from '../types';
5
- import { GlobalChatSettings } from '../shared-settings';
3
+ import { widgetName } from '../widget-types';
4
+ import { GlobalChatSettings } from './shared-settings';
5
+ /** Runtime name constant for chat experiences */
6
+ export declare const ChatRuntimeName: "chat";
6
7
  /**
7
8
  * Chat runtime interface for Genie conversational AI experiences.
8
9
  *
@@ -31,7 +32,7 @@ export interface ChatRuntime extends UnisphereRuntimeBaseType<ChatRuntimeSetting
31
32
  * const settings: ChatRuntimeSettings = {
32
33
  * ks: 'your-kaltura-session-token',
33
34
  * partnerId: '12345',
34
- * entryId: 'entry_xyz',
35
+ * context: { type: 'entry', id: 'entry_xyz' },
35
36
  * initialQuestion: 'Hello! How can I help?',
36
37
  * integrations: {
37
38
  * kaltura: {
@@ -63,8 +64,13 @@ export interface ChatRuntimeSettings {
63
64
  agenticServerUrl?: string;
64
65
  /** Kaltura partner ID */
65
66
  partnerId?: string;
66
- /** Media entry ID for context-aware chat */
67
- entryId?: string;
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
74
  /** Enable agent mode for advanced AI features */
69
75
  agentMode?: boolean;
70
76
  /** Avatar display mode: 'dialog' for modal or 'contained' for embedded */
@@ -1,4 +1,22 @@
1
1
  import { ValidatorSchema } from '@unisphere/core';
2
+ export type CapabilityToggle = 'on' | 'off';
3
+ export interface GenieCapabilities {
4
+ use_knowledge_base?: CapabilityToggle;
5
+ use_content_search?: CapabilityToggle;
6
+ use_get_entry_content?: CapabilityToggle;
7
+ generate_followup_questions?: CapabilityToggle;
8
+ include_sources?: CapabilityToggle;
9
+ use_related_files?: CapabilityToggle;
10
+ avatar?: CapabilityToggle;
11
+ }
12
+ export declare const CHAT_DEFAULT_CAPABILITIES: GenieCapabilities;
13
+ export declare const AVATAR_DEFAULT_CAPABILITIES: GenieCapabilities;
14
+ export declare const getChatDefaultCapabilities: (context?: ChatContext) => GenieCapabilities;
15
+ export declare const getAvatarDefaultCapabilities: (context?: ChatContext) => GenieCapabilities;
16
+ export interface ChatContext {
17
+ type: 'entry' | 'category';
18
+ id: string;
19
+ }
2
20
  /**
3
21
  * Branding configuration for chat UI.
4
22
  */
@@ -97,8 +115,10 @@ export interface KalturaIntegration {
97
115
  export interface GlobalChatSettings {
98
116
  /** Kaltura session token for authentication */
99
117
  ks: string;
100
- /** Entry ID for context-aware features */
101
- entryId?: string;
118
+ /** Context for the chat session */
119
+ context?: ChatContext;
120
+ /** Genie capability overrides — defaults applied per API if absent */
121
+ capabilities?: GenieCapabilities;
102
122
  /** Callback function to generate source URLs with entry ID and optional start time */
103
123
  getSourceUrl?: (params: {
104
124
  entryId: string;
@@ -7,8 +7,8 @@ import { AnswerTypeEnum } from '../types';
7
7
  * @example
8
8
  * ```typescript
9
9
  * const settings: PageVisualSettings = {
10
+ * scroll: 'container',
10
11
  * customization: {
11
- * scroll: 'container',
12
12
  * theme: { translucent: true }
13
13
  * }
14
14
  * };
@@ -17,6 +17,8 @@ import { AnswerTypeEnum } from '../types';
17
17
  export interface PageVisualSettings {
18
18
  /** Settings schema version */
19
19
  schemaVersion?: '1';
20
+ /** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
21
+ scroll?: 'body' | 'container' | 'modal';
20
22
  /** Custom UI styling and behavior options */
21
23
  customization?: ChatCustomization;
22
24
  }
@@ -69,9 +71,7 @@ export interface BannerVisualSettings {
69
71
  * @example
70
72
  * ```typescript
71
73
  * const settings: PopupVisualSettings = {
72
- * customization: {
73
- * scroll: 'modal'
74
- * },
74
+ * scroll: 'modal',
75
75
  * initialQuestion: {
76
76
  * question: 'Tell me about this topic',
77
77
  * answerType: AnswerTypeEnum.GENERAL
@@ -82,6 +82,8 @@ export interface BannerVisualSettings {
82
82
  export interface PopupVisualSettings {
83
83
  /** Settings schema version */
84
84
  schemaVersion?: '1';
85
+ /** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
86
+ scroll?: 'body' | 'container' | 'modal';
85
87
  /** Custom UI styling and behavior options */
86
88
  customization?: ChatCustomization;
87
89
  /** Optional question to ask automatically when popup opens */
@@ -92,6 +94,28 @@ export interface PopupVisualSettings {
92
94
  answerType?: AnswerTypeEnum;
93
95
  };
94
96
  }
97
+ export interface EverywhereVisualSettings {
98
+ /** Settings schema version */
99
+ schemaVersion?: '1';
100
+ /** Custom UI styling and behavior options */
101
+ customization?: ChatCustomization;
102
+ /** Callback invoked when the widget requests to be closed */
103
+ onRequestClose?: () => void;
104
+ /** Callback invoked when the user clicks the expand button */
105
+ onExpand?: () => void;
106
+ /** Whether the host has expanded the widget; drives the expand/collapse icon in the header */
107
+ isExpanded?: boolean;
108
+ /** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
109
+ scroll?: 'body' | 'container' | 'modal';
110
+ /** Context for the chat session */
111
+ context?: {
112
+ /** Context type - 'entry' for media entries, 'category' for content categories */
113
+ type: 'entry' | 'category' | 'ancestor-category';
114
+ /** Media entry ID or category ID for context-aware conversations */
115
+ id: string;
116
+ };
117
+ }
118
+ export declare const everywhereVisualSettingsSchema: ValidatorSchema;
95
119
  export declare const pageVisualSettingsSchema: ValidatorSchema;
96
120
  export declare const bannerVisualSettingsSchema: ValidatorSchema;
97
121
  export declare const popupVisualSettingsSchema: ValidatorSchema;
@@ -1,27 +1,5 @@
1
1
  import { ValidatorSchema } from '@unisphere/core';
2
- export interface VideoClip {
3
- start_index: number;
4
- last_index: number;
5
- entry_id: string | null;
6
- start_time: number;
7
- end_time: number;
8
- type: string | null;
9
- thumbnail: string | null;
10
- video_link: string | null;
11
- }
12
- export interface VideoSlide {
13
- slide_type: 'video';
14
- text: string | null;
15
- citation: {
16
- clips: VideoClip[];
17
- };
18
- }
19
- export interface TextSlide {
20
- slide_type: 'text';
21
- text: string;
22
- citation: null;
23
- }
24
- export type Slide = VideoSlide | TextSlide;
2
+ import { Slide } from './shared-visual-types';
25
3
  export interface ContentGalleryToolRuntimeAvatarVisualSettings {
26
4
  schemaVersion?: string;
27
5
  slides: Slide[];
@@ -0,0 +1,12 @@
1
+ import { ValidatorSchema } from '@unisphere/core';
2
+ import { BlockVisualContext } from '../shared/general-visual-types';
3
+ import { Slide } from './shared-visual-types';
4
+ export interface ContentGalleryToolRuntimeGenieAnswerVisualSettings {
5
+ schemaVersion?: string;
6
+ slides: Slide[];
7
+ autoplay?: boolean;
8
+ slideDuration?: number;
9
+ loop?: boolean;
10
+ blockContext?: BlockVisualContext;
11
+ }
12
+ export declare const contentGalleryToolRuntimeGenieAnswerVisualSettingsSchema: ValidatorSchema;
@@ -1,2 +1,4 @@
1
1
  export * from './runtime-types';
2
2
  export * from './avatar-visual-types';
3
+ export * from './genie-answer-visual-types';
4
+ export * from './shared-visual-types';
@@ -0,0 +1,32 @@
1
+ import { ValidatorSchema } from '@unisphere/core';
2
+ export interface VideoClip {
3
+ start_index: number;
4
+ last_index: number;
5
+ entry_id: string | null;
6
+ start_time: number;
7
+ end_time: number;
8
+ type: string | null;
9
+ thumbnail: string | null;
10
+ video_link: string | null;
11
+ }
12
+ export interface VideoSlide {
13
+ slide_type: 'video';
14
+ text: string | null;
15
+ citation: {
16
+ clips: VideoClip[];
17
+ };
18
+ }
19
+ export interface TextSlide {
20
+ slide_type: 'text';
21
+ text: string;
22
+ citation: null;
23
+ }
24
+ export type Slide = VideoSlide | TextSlide;
25
+ export type ContentGalleryToolVisualsBaseSettings = {
26
+ schemaVersion?: string;
27
+ slides: Slide[];
28
+ autoplay?: boolean;
29
+ slideDuration?: number;
30
+ loop?: boolean;
31
+ };
32
+ export declare const slideSchema: ValidatorSchema;
@@ -11,8 +11,7 @@ import { AnswerTypeEnum } from '../types';
11
11
  * const customization: ChatCustomization = {
12
12
  * theme: {
13
13
  * translucent: true
14
- * },
15
- * scroll: 'container'
14
+ * }
16
15
  * };
17
16
  * ```
18
17
  *
@@ -20,10 +19,6 @@ import { AnswerTypeEnum } from '../types';
20
19
  * Advanced customization with initial page:
21
20
  * ```typescript
22
21
  * const customization: ChatCustomization = {
23
- * context: {
24
- * type: 'entry',
25
- * entryId: 'video_123'
26
- * },
27
22
  * initialPage: {
28
23
  * type: 'banner',
29
24
  * title: 'Welcome to AI Chat',
@@ -40,13 +35,6 @@ import { AnswerTypeEnum } from '../types';
40
35
  * ```
41
36
  */
42
37
  export interface ChatCustomization {
43
- /** Context for the chat session (e.g., specific media entry) */
44
- context?: {
45
- /** Context type - currently only 'entry' is supported */
46
- type: 'entry';
47
- /** Media entry ID for context-aware conversations */
48
- entryId: string;
49
- };
50
38
  /** Visual theme customization */
51
39
  theme?: {
52
40
  /** Enable translucent/semi-transparent UI elements */
@@ -68,8 +56,6 @@ export interface ChatCustomization {
68
56
  initialPreferredTool?: string;
69
57
  /** Branding options (logo display, etc.) */
70
58
  branding?: ChatBranding;
71
- /** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
72
- scroll?: 'body' | 'container' | 'modal';
73
59
  /** Initial landing page configuration */
74
60
  initialPage?: {
75
61
  /** Page layout type: 'default' for standard, 'banner' for hero-style */
@@ -1,2 +0,0 @@
1
- /** Runtime name constant for chat experiences */
2
- export declare const ChatRuntimeName: "chat";