@unisphere/genie-types 1.37.1 → 1.38.5
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 +32 -0
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/avatar-runtime/runtime-types.d.ts +16 -2
- package/src/lib/avatar-runtime/shared-types.d.ts +4 -1
- package/src/lib/chat-customizations-types.d.ts +13 -0
- package/src/lib/chat-runtime/shared-settings.d.ts +4 -1
- package/src/lib/data-models.d.ts +136 -0
- package/src/lib/shared/chat-thread-service-types.d.ts +4 -1
- package/src/lib/shared/genie-chat-service-types.d.ts +4 -1
package/index.esm.js
CHANGED
|
@@ -1515,6 +1515,11 @@ const chatCustomizationSchema = {
|
|
|
1515
1515
|
type: 'primitive',
|
|
1516
1516
|
value: 'boolean',
|
|
1517
1517
|
optional: true
|
|
1518
|
+
},
|
|
1519
|
+
linkTarget: {
|
|
1520
|
+
type: 'primitive',
|
|
1521
|
+
value: 'string',
|
|
1522
|
+
optional: true
|
|
1518
1523
|
}
|
|
1519
1524
|
}
|
|
1520
1525
|
},
|
|
@@ -1637,6 +1642,33 @@ const chatCustomizationSchema = {
|
|
|
1637
1642
|
}
|
|
1638
1643
|
}
|
|
1639
1644
|
},
|
|
1645
|
+
uiControls: {
|
|
1646
|
+
type: 'object',
|
|
1647
|
+
optional: true,
|
|
1648
|
+
allowUnknownProperties: true,
|
|
1649
|
+
properties: {
|
|
1650
|
+
modalSelector: {
|
|
1651
|
+
type: 'object',
|
|
1652
|
+
optional: true,
|
|
1653
|
+
properties: {
|
|
1654
|
+
visible: {
|
|
1655
|
+
type: 'primitive',
|
|
1656
|
+
value: 'boolean'
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1660
|
+
contextSelector: {
|
|
1661
|
+
type: 'object',
|
|
1662
|
+
optional: true,
|
|
1663
|
+
properties: {
|
|
1664
|
+
visible: {
|
|
1665
|
+
type: 'primitive',
|
|
1666
|
+
value: 'boolean'
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
},
|
|
1640
1672
|
thread: {
|
|
1641
1673
|
type: 'object',
|
|
1642
1674
|
optional: true,
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { TinyDataStoreConsumer, ValidatorSchema } from '@unisphere/core';
|
|
|
2
2
|
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
3
|
import { widgetName } from '../widget-types';
|
|
4
4
|
import { ChatContext, GenieCapabilities } from '../chat-runtime/shared-settings';
|
|
5
|
-
import { AgentScreenShareInfo, AgentTapToTalkInfo, AvatarConnectionStatus, CaptionConfig, CaptionState } from './shared-types';
|
|
5
|
+
import { AgentData, AgentScreenShareInfo, AgentTapToTalkInfo, AvatarConnectionStatus, CaptionConfig, CaptionState } from './shared-types';
|
|
6
|
+
import { ChatEntry } from './chat-types';
|
|
6
7
|
/** Runtime name constant for avatar experiences */
|
|
7
8
|
export declare const AvatarRuntimeName: "avatar";
|
|
8
9
|
export interface Captions {
|
|
@@ -78,7 +79,11 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
78
79
|
setThreadId(id: string | null): void;
|
|
79
80
|
/** Sync preview mode flag from the chat customization settings */
|
|
80
81
|
setIsPreviewMode(value: boolean): void;
|
|
81
|
-
/**
|
|
82
|
+
/** Sync context selector visibility from the chat customization settings */
|
|
83
|
+
setContextSelectorVisible(value: boolean): void;
|
|
84
|
+
/** Observable mute state
|
|
85
|
+
* @deprecated Use `audioState` instead, which provides both mute and speaking state
|
|
86
|
+
*/
|
|
82
87
|
isMuted: TinyDataStoreConsumer<boolean>;
|
|
83
88
|
/** Mute the avatar audio */
|
|
84
89
|
mute(): void;
|
|
@@ -88,6 +93,15 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
88
93
|
askViaText(question: string): void;
|
|
89
94
|
/** Update dynamic variables */
|
|
90
95
|
updateDynamicVariables(variables: Record<string, unknown>): void;
|
|
96
|
+
/** Observable chat log entries */
|
|
97
|
+
chatLog: TinyDataStoreConsumer<ChatEntry[]>;
|
|
98
|
+
/** Observable audio state (muted, speaking) */
|
|
99
|
+
audioState: TinyDataStoreConsumer<{
|
|
100
|
+
muted: boolean;
|
|
101
|
+
isSpeaking: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
/** Observable agent data */
|
|
104
|
+
agentData: TinyDataStoreConsumer<AgentData>;
|
|
91
105
|
};
|
|
92
106
|
/** Event emitted when the avatar brain invokes a tool call */
|
|
93
107
|
export interface AvatarToolCallEvent {
|
|
@@ -298,7 +298,7 @@ export interface AvatarConnectionProxyType {
|
|
|
298
298
|
}
|
|
299
299
|
export declare const isAvatarConnectionProxyInternalType: (x: any) => x is AvatarConnectionProxInternalType;
|
|
300
300
|
/**
|
|
301
|
-
* Public surface of `AvatarClientManager` (from `@
|
|
301
|
+
* Public surface of `AvatarClientManager` (from `@kaltura-sdk/avatar-client`).
|
|
302
302
|
* Import this instead of the concrete class when a consumer only needs to
|
|
303
303
|
* read state or call the public API — e.g. UI components, other packages.
|
|
304
304
|
* Supersedes the deprecated `AvatarConnectionProxyType`/
|
|
@@ -410,6 +410,9 @@ export interface AvatarClientManagerType {
|
|
|
410
410
|
/** Observable preview mode flag */
|
|
411
411
|
readonly isPreviewMode: TinyDataStoreConsumer<boolean>;
|
|
412
412
|
setIsPreviewMode(value: boolean): void;
|
|
413
|
+
/** Observable context selector visibility */
|
|
414
|
+
readonly contextSelectorVisible: TinyDataStoreConsumer<boolean>;
|
|
415
|
+
setContextSelectorVisible(value: boolean): void;
|
|
413
416
|
/** Observable feature flags from runtime settings */
|
|
414
417
|
readonly features: TinyDataStoreConsumer<{
|
|
415
418
|
screenShare?: boolean;
|
|
@@ -46,6 +46,8 @@ export interface ChatCustomization {
|
|
|
46
46
|
useExternalPlayer?: boolean;
|
|
47
47
|
/** Indicates genie is embedded inside Kaltura Studio (preview mode) */
|
|
48
48
|
isPreviewMode?: boolean;
|
|
49
|
+
/** Target attribute for links rendered in markdown content (defaults to '_blank') */
|
|
50
|
+
linkTarget?: string;
|
|
49
51
|
};
|
|
50
52
|
/** New conversation thread settings
|
|
51
53
|
* @deprecated
|
|
@@ -83,6 +85,17 @@ export interface ChatCustomization {
|
|
|
83
85
|
} | {
|
|
84
86
|
stage: 'fullscreen';
|
|
85
87
|
};
|
|
88
|
+
/** UI controls visibility */
|
|
89
|
+
uiControls?: {
|
|
90
|
+
/** Show/hide the AI model selector (Fast/Smart). Default: true */
|
|
91
|
+
modalSelector?: {
|
|
92
|
+
visible: boolean;
|
|
93
|
+
};
|
|
94
|
+
/** Show/hide the context selector chip and add-context button. Default: true */
|
|
95
|
+
contextSelector?: {
|
|
96
|
+
visible: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
86
99
|
/** thread configuration */
|
|
87
100
|
thread?: {
|
|
88
101
|
/** enabled by default */
|
|
@@ -151,7 +151,10 @@ export interface GlobalChatSettings {
|
|
|
151
151
|
type?: 'entry';
|
|
152
152
|
entryId: string;
|
|
153
153
|
startTime?: number;
|
|
154
|
-
}) => string
|
|
154
|
+
}) => string | {
|
|
155
|
+
url: string;
|
|
156
|
+
target: string;
|
|
157
|
+
};
|
|
155
158
|
/** Configuration for conversation sharing */
|
|
156
159
|
shareUrl?: {
|
|
157
160
|
/** Query parameter name for message ID in shared URLs */
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export interface ClassGenieFlashCardElementBase {
|
|
2
|
+
title: string;
|
|
3
|
+
subTitle: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export type ClassGenieVideoGalleryVideoItem = {
|
|
7
|
+
type: 'video' | 'video-thumbnail';
|
|
8
|
+
title: string;
|
|
9
|
+
entryId: string;
|
|
10
|
+
duration?: number;
|
|
11
|
+
startTime: number;
|
|
12
|
+
endTime: number;
|
|
13
|
+
link: string | null;
|
|
14
|
+
similarityScore: number;
|
|
15
|
+
};
|
|
16
|
+
export type ClassGenieVideoGalleryFlashcard = {
|
|
17
|
+
type: 'videoGallery';
|
|
18
|
+
version: 1;
|
|
19
|
+
videos: ClassGenieVideoGalleryVideoItem[];
|
|
20
|
+
} & ClassGenieFlashCardElementBase;
|
|
21
|
+
export type ClassGenieTextFlashcard = {
|
|
22
|
+
version: 1;
|
|
23
|
+
type: 'text';
|
|
24
|
+
} & ClassGenieFlashCardElementBase;
|
|
25
|
+
export type ClassGenieFlashCard = ClassGenieVideoGalleryFlashcard | ClassGenieTextFlashcard;
|
|
26
|
+
export type ClassGenieFlashCardElement = {
|
|
27
|
+
version: 1;
|
|
28
|
+
type: 'flashcards';
|
|
29
|
+
totalCards: number;
|
|
30
|
+
cards: ClassGenieFlashCard[];
|
|
31
|
+
};
|
|
32
|
+
export type ClassGenieFollowupsElement = {
|
|
33
|
+
version: 1;
|
|
34
|
+
type: 'followups';
|
|
35
|
+
followups: string[];
|
|
36
|
+
};
|
|
37
|
+
export type ClassGenieSourceVideoItem = {
|
|
38
|
+
type: 'video';
|
|
39
|
+
title: string;
|
|
40
|
+
entryId: string;
|
|
41
|
+
duration: number;
|
|
42
|
+
};
|
|
43
|
+
export type ClassGenieSourceDocumentItem = {
|
|
44
|
+
type: 'document';
|
|
45
|
+
title: string;
|
|
46
|
+
entryId: string;
|
|
47
|
+
};
|
|
48
|
+
export type ClassGenieSourceItem = ClassGenieSourceVideoItem | ClassGenieSourceDocumentItem;
|
|
49
|
+
export type ClassGenieSourcesElement = {
|
|
50
|
+
version: 1;
|
|
51
|
+
type: 'sources';
|
|
52
|
+
sources: ClassGenieSourceItem[];
|
|
53
|
+
};
|
|
54
|
+
export type ClassGenieElement = ClassGenieFlashCardElement | ClassGenieFollowupsElement | ClassGenieSourcesElement | string;
|
|
55
|
+
export type ClassGenieQuestionData = {
|
|
56
|
+
version: 1;
|
|
57
|
+
threadId: string;
|
|
58
|
+
question: string;
|
|
59
|
+
messageId?: string;
|
|
60
|
+
elements: ClassGenieElement[];
|
|
61
|
+
isFinal?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export interface QuestionTitleBlock {
|
|
64
|
+
type: 'question-title';
|
|
65
|
+
title: string;
|
|
66
|
+
contextId?: string;
|
|
67
|
+
contextType?: 'entry' | 'category';
|
|
68
|
+
contextTitle?: string;
|
|
69
|
+
contextImageUrl?: string;
|
|
70
|
+
isContextActive?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface MarkdownBlock {
|
|
73
|
+
type: 'markdown';
|
|
74
|
+
status: 'ready';
|
|
75
|
+
content: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AvatarBlock {
|
|
78
|
+
type: 'avatar';
|
|
79
|
+
status: 'ready';
|
|
80
|
+
content: string;
|
|
81
|
+
}
|
|
82
|
+
export type UnisphereToolBlock = {
|
|
83
|
+
type: 'unisphere-tool';
|
|
84
|
+
widgetName: string;
|
|
85
|
+
runtimeName: string;
|
|
86
|
+
} & ({
|
|
87
|
+
status: 'loading' | 'ready';
|
|
88
|
+
settings: any;
|
|
89
|
+
threadId?: string;
|
|
90
|
+
} | {
|
|
91
|
+
status: 'error';
|
|
92
|
+
});
|
|
93
|
+
export type UnisphereErrorBlock = {
|
|
94
|
+
type: 'error';
|
|
95
|
+
content?: string;
|
|
96
|
+
shouldDisplayDefaultMessage?: boolean;
|
|
97
|
+
shouldDisplayRetryButton?: boolean;
|
|
98
|
+
retryThreadId?: string;
|
|
99
|
+
};
|
|
100
|
+
export type UnisphereSocialActionsBlock = {
|
|
101
|
+
type: 'social-actions';
|
|
102
|
+
data: {
|
|
103
|
+
question: string;
|
|
104
|
+
isFinal: boolean;
|
|
105
|
+
translucent?: boolean;
|
|
106
|
+
isShareable?: boolean;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export type OAuthRequiredBlock = {
|
|
110
|
+
type: 'oauth-required';
|
|
111
|
+
toolDisplayName: string;
|
|
112
|
+
authUrl: string;
|
|
113
|
+
};
|
|
114
|
+
export type AvatarSummaryBlock = {
|
|
115
|
+
type: 'avatar-summary';
|
|
116
|
+
socketId: string;
|
|
117
|
+
summary?: string;
|
|
118
|
+
summaryContentType?: 'text' | 'html' | 'html_with_js';
|
|
119
|
+
sessionDuration?: number;
|
|
120
|
+
avatarSessionGroups?: UnisphereChatBlock[][];
|
|
121
|
+
};
|
|
122
|
+
type UnisphereChatBlockBase = {
|
|
123
|
+
id: string;
|
|
124
|
+
threadId?: string;
|
|
125
|
+
messageId?: string;
|
|
126
|
+
speechId?: string;
|
|
127
|
+
newTitle?: string;
|
|
128
|
+
isShareable?: boolean;
|
|
129
|
+
};
|
|
130
|
+
export type UnisphereChatBlock = UnisphereChatBlockBase & (QuestionTitleBlock | MarkdownBlock | AvatarBlock | UnisphereToolBlock | UnisphereErrorBlock | UnisphereSocialActionsBlock | OAuthRequiredBlock | AvatarSummaryBlock);
|
|
131
|
+
export type ChatRateAnswerData = {
|
|
132
|
+
isPositive: boolean;
|
|
133
|
+
comment?: string;
|
|
134
|
+
messageId: string;
|
|
135
|
+
};
|
|
136
|
+
export {};
|
|
@@ -38,7 +38,10 @@ export interface GenieChatServiceType extends UnisphereService {
|
|
|
38
38
|
/** Generate poster/thumbnail URL for video clip */
|
|
39
39
|
getClipPlayerPosterUrl: (source: ClassGenieGetClipPlayerPosterUrlData) => string;
|
|
40
40
|
/** Generate source URL for media entry with optional start time */
|
|
41
|
-
getEntrySourceUrl: (entryId: string, startTime?: number) => string
|
|
41
|
+
getEntrySourceUrl: (entryId: string, startTime?: number) => string | {
|
|
42
|
+
url: string;
|
|
43
|
+
target: string;
|
|
44
|
+
};
|
|
42
45
|
/** Observable for submitting questions and getting AI answers */
|
|
43
46
|
getAnswer: TinyPubSub<{
|
|
44
47
|
/** Question text to ask */
|