@unisphere/genie-types 1.17.0 → 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/index.esm.js +1215 -7
- package/package.json +3 -3
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +3 -0
- package/src/lib/avatar-runtime/chat-types.d.ts +7 -0
- package/src/lib/avatar-runtime/index.d.ts +1 -0
- package/src/lib/avatar-runtime/runtime-types.d.ts +7 -3
- package/src/lib/chat-runtime/index.d.ts +2 -3
- package/src/lib/chat-runtime/{runtime-flavors/runtime-player-plugin-types.d.ts → runtime-player-plugin-types.d.ts} +12 -7
- package/src/lib/chat-runtime/{runtime-flavors/runtime-types.d.ts → runtime-types.d.ts} +12 -6
- package/src/lib/chat-runtime/shared-settings.d.ts +22 -2
- package/src/lib/chat-runtime/visuals-types.d.ts +28 -4
- package/src/lib/shared/chat-customizations-types.d.ts +1 -15
- package/src/lib/chat-runtime/types.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisphere/genie-types",
|
|
3
|
-
"version": "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.
|
|
14
|
-
"@unisphere/runtime": "^1.
|
|
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 */
|
|
@@ -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
|
-
*
|
|
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
|
-
/**
|
|
96
|
-
|
|
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-
|
|
2
|
-
export * from './runtime-
|
|
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 '
|
|
4
|
-
import { ChatRuntimeName } from '
|
|
5
|
-
import { GlobalChatSettings } from '
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
47
|
-
|
|
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 '
|
|
4
|
-
import {
|
|
5
|
-
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
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
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
|
-
/**
|
|
101
|
-
|
|
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
|
-
*
|
|
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;
|
|
@@ -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 */
|