@unisphere/genie-types 1.27.0-head.1 → 1.27.0-head.2
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 +16 -16
- package/package.json +2 -3
- package/src/index.d.ts +0 -1
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +6 -2
- package/src/lib/avatar-runtime/runtime-types.d.ts +10 -16
- package/src/lib/avatar-runtime/shared-types.d.ts +14 -7
- package/src/lib/chat-runtime/shared-settings.d.ts +7 -0
- package/languages/.gitkeep +0 -0
- package/languages/he-IL.json +0 -1
- package/src/languages/supported-languages.d.ts +0 -1
- package/src/lib/use-translation.d.ts +0 -5
package/index.esm.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createUseTranslation } from '@unisphere/ui-i18n-react';
|
|
2
|
-
|
|
3
1
|
/** Widget name constant for all Genie experiences */
|
|
4
2
|
const widgetName = 'unisphere.widget.genie';
|
|
5
3
|
|
|
@@ -1125,6 +1123,14 @@ const CHAT_CONTEXT_TYPE = {
|
|
|
1125
1123
|
category: 'category',
|
|
1126
1124
|
'ancestor-category': 'ancestor_category'
|
|
1127
1125
|
};
|
|
1126
|
+
const resolveActiveContextType = context => {
|
|
1127
|
+
return context ? {
|
|
1128
|
+
contextId: context.id,
|
|
1129
|
+
contextType: CHAT_CONTEXT_TYPE[context.type]
|
|
1130
|
+
} : {
|
|
1131
|
+
contextType: CHAT_CONTEXT_TYPE_GLOBAL
|
|
1132
|
+
};
|
|
1133
|
+
};
|
|
1128
1134
|
const CHAT_CONTEXT_TYPE_GLOBAL = 'global';
|
|
1129
1135
|
const chatContextSchema = {
|
|
1130
1136
|
type: 'orByType',
|
|
@@ -2143,6 +2149,12 @@ const featuresSchema = {
|
|
|
2143
2149
|
type: 'primitive',
|
|
2144
2150
|
value: 'string',
|
|
2145
2151
|
optional: true
|
|
2152
|
+
},
|
|
2153
|
+
dynamicVariables: {
|
|
2154
|
+
type: 'object',
|
|
2155
|
+
properties: {},
|
|
2156
|
+
allowUnknownProperties: true,
|
|
2157
|
+
optional: true
|
|
2146
2158
|
}
|
|
2147
2159
|
}
|
|
2148
2160
|
};
|
|
@@ -2331,7 +2343,7 @@ var DisconnectReasons;
|
|
|
2331
2343
|
})(DisconnectReasons || (DisconnectReasons = {}));
|
|
2332
2344
|
const isAvatarConnectionProxyInternalType = x => {
|
|
2333
2345
|
var _a;
|
|
2334
|
-
return '
|
|
2346
|
+
return '__webSocket' in x && typeof ((_a = x.__webSocket) === null || _a === void 0 ? void 0 : _a.onChanges) === 'function';
|
|
2335
2347
|
};
|
|
2336
2348
|
|
|
2337
2349
|
var iterators = {};
|
|
@@ -3295,16 +3307,4 @@ const blockVisualContextSchema = {
|
|
|
3295
3307
|
}
|
|
3296
3308
|
};
|
|
3297
3309
|
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
};
|
|
3301
|
-
|
|
3302
|
-
const supportedLanguages = ['en-US', 'he-IL'];
|
|
3303
|
-
|
|
3304
|
-
const useTranslation = createUseTranslation({
|
|
3305
|
-
packageName: '@unisphere/genie-types',
|
|
3306
|
-
defaultTranslations: en,
|
|
3307
|
-
supportedLanguages
|
|
3308
|
-
});
|
|
3309
|
-
|
|
3310
|
-
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, schemaVersionSchema, shareUrlSchema, useTranslation, widgetName };
|
|
3310
|
+
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, resolveActiveContextType, schemaVersionSchema, shareUrlSchema, widgetName };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisphere/genie-types",
|
|
3
|
-
"version": "1.27.0-head.
|
|
3
|
+
"version": "1.27.0-head.2",
|
|
4
4
|
"author": "kaltura",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"@kaltura-sdk/rtc-core": "^1.25.13",
|
|
13
13
|
"@unisphere/core": "^1.99.0",
|
|
14
14
|
"@unisphere/runtime": "^1.98.0",
|
|
15
|
-
"@unisphere/runtime-js": "^1.96.0"
|
|
16
|
-
"@unisphere/ui-i18n-react": "^1.70.1"
|
|
15
|
+
"@unisphere/runtime-js": "^1.96.0"
|
|
17
16
|
},
|
|
18
17
|
"module": "./index.esm.js",
|
|
19
18
|
"type": "module",
|
package/src/index.d.ts
CHANGED
|
@@ -11,8 +11,12 @@ export interface AvatarServiceType extends UnisphereService {
|
|
|
11
11
|
readonly visualBridge: AvatarVisualBridgeType;
|
|
12
12
|
readonly connection: TinyDataStoreConsumer<AvatarConnectionProxyType | null>;
|
|
13
13
|
connect(options?: {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
context?: {
|
|
15
|
+
type: 'thread';
|
|
16
|
+
threadId: string;
|
|
17
|
+
messageId?: string;
|
|
18
|
+
};
|
|
19
|
+
dynamicVariables?: Record<string, unknown>;
|
|
16
20
|
}): void;
|
|
17
21
|
getKalturaPlayerParams(): {
|
|
18
22
|
kalturaServerURI: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TinyDataStoreConsumer,
|
|
1
|
+
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';
|
|
@@ -22,8 +22,12 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
22
22
|
readonly runtimeName: typeof AvatarRuntimeName;
|
|
23
23
|
/** Establish connection to the avatar service */
|
|
24
24
|
connect(params?: {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
context?: {
|
|
26
|
+
type: 'thread';
|
|
27
|
+
threadId: string;
|
|
28
|
+
messageId?: string;
|
|
29
|
+
};
|
|
30
|
+
dynamicVariables?: Record<string, unknown>;
|
|
27
31
|
}): void;
|
|
28
32
|
/** Disconnect from the avatar service */
|
|
29
33
|
disconnect(): void;
|
|
@@ -31,8 +35,7 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
31
35
|
isConnected: TinyDataStoreConsumer<boolean>;
|
|
32
36
|
isPaused: TinyDataStoreConsumer<boolean>;
|
|
33
37
|
captions: Captions;
|
|
34
|
-
|
|
35
|
-
registerClientTools(tools: Record<string, (variables: Record<string, any>) => Promise<any>>): void;
|
|
38
|
+
registerClientTools(tools: Record<string, (variables: unknown) => undefined | null | Record<string, unknown> | Promise<Record<string, unknown>>>): void;
|
|
36
39
|
/** Observable chat panel open state */
|
|
37
40
|
isChatPanelOpen: TinyDataStoreConsumer<boolean>;
|
|
38
41
|
/** Update chat panel open state */
|
|
@@ -51,15 +54,6 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
51
54
|
unmute(): void;
|
|
52
55
|
/** Send a text question to the avatar */
|
|
53
56
|
askViaText(question: string): void;
|
|
54
|
-
/** Send setDynamicPrompt event to the CM */
|
|
55
|
-
setDynamicPrompt(data: unknown): void;
|
|
56
|
-
/**
|
|
57
|
-
* Subscribe to tool-call events from the avatar's WebSocket.
|
|
58
|
-
* Emits for every tool call (e.g. navigate_to_slide) without interfering
|
|
59
|
-
* with internal GenUI rendering. The host app can register handlers to
|
|
60
|
-
* react to specific tool names.
|
|
61
|
-
*/
|
|
62
|
-
readonly onToolCall: TinyPubSub<AvatarToolCallEvent>['consumer'];
|
|
63
57
|
};
|
|
64
58
|
/** Event emitted when the avatar brain invokes a tool call */
|
|
65
59
|
export interface AvatarToolCallEvent {
|
|
@@ -91,8 +85,6 @@ export type AvatarServerConfig = {
|
|
|
91
85
|
agentMode?: boolean;
|
|
92
86
|
/** Enable audio noise reduction for clearer audio */
|
|
93
87
|
noiseReductionEnabled?: boolean;
|
|
94
|
-
/** Genie service server URL */
|
|
95
|
-
genieServerUrl?: string;
|
|
96
88
|
/** Kaltura sesssion */
|
|
97
89
|
ks: string;
|
|
98
90
|
};
|
|
@@ -126,6 +118,8 @@ export type AvatarRuntimeSettings = {
|
|
|
126
118
|
captions?: boolean | CaptionConfig;
|
|
127
119
|
/** Phrase sent automatically when avatar signals a blank kickoff turn */
|
|
128
120
|
kickOffPhrase?: string;
|
|
121
|
+
/** Dynamic request variables */
|
|
122
|
+
dynamicVariables?: Record<string, unknown>;
|
|
129
123
|
};
|
|
130
124
|
} & (({
|
|
131
125
|
serverConfig?: 'manual';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TinyDataStoreConsumer } from '@unisphere/core';
|
|
2
2
|
import { DeviceEnumerationResult } from '@kaltura-sdk/rtc-core';
|
|
3
3
|
import type { ChatEntry } from './chat-types';
|
|
4
|
+
import { ChatContext } from '../chat-runtime';
|
|
4
5
|
/**
|
|
5
6
|
* Audio device types for avatar connections.
|
|
6
7
|
*/
|
|
@@ -66,6 +67,14 @@ export type AgentScreenShareInfo = {
|
|
|
66
67
|
stream: MediaStream | null;
|
|
67
68
|
analysisReady: boolean;
|
|
68
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Agent kaltura context data
|
|
72
|
+
*/
|
|
73
|
+
export type AgentKalturaContextData = {
|
|
74
|
+
active: boolean;
|
|
75
|
+
everywhere: boolean;
|
|
76
|
+
data: ChatContext | null;
|
|
77
|
+
};
|
|
69
78
|
/**
|
|
70
79
|
* Content data for avatar tool integrations.
|
|
71
80
|
*
|
|
@@ -130,14 +139,12 @@ export interface CaptionConfig {
|
|
|
130
139
|
* @internal
|
|
131
140
|
*/
|
|
132
141
|
export interface AvatarConnectionProxInternalType {
|
|
133
|
-
/** Send direct event to server */
|
|
134
|
-
_directEventToServer(message: string, data: any): void;
|
|
135
142
|
/** Set local content state */
|
|
136
|
-
|
|
143
|
+
__setLocalContent(content: any): void;
|
|
137
144
|
/** Handle player errors */
|
|
138
|
-
|
|
145
|
+
__onPlayerError(error: Error): void;
|
|
139
146
|
/** WebSocket connection observable */
|
|
140
|
-
|
|
147
|
+
__webSocket: TinyDataStoreConsumer<SimplifiedSocket | null>;
|
|
141
148
|
}
|
|
142
149
|
export declare enum DisconnectReasons {
|
|
143
150
|
UserRequested = "UserRequested",
|
|
@@ -181,6 +188,8 @@ export interface AvatarConnectionProxyType {
|
|
|
181
188
|
readonly content: TinyDataStoreConsumer<AvatarContentData | null>;
|
|
182
189
|
/** Observable agent state and analytics */
|
|
183
190
|
readonly agentData: TinyDataStoreConsumer<AgentData | null>;
|
|
191
|
+
/** Observable agent kaltura context data */
|
|
192
|
+
readonly kalturaContext: TinyDataStoreConsumer<AgentKalturaContextData | null>;
|
|
184
193
|
/** Observable available audio devices */
|
|
185
194
|
readonly devicesList: TinyDataStoreConsumer<{
|
|
186
195
|
audioInput: MediaDeviceInfo[];
|
|
@@ -207,8 +216,6 @@ export interface AvatarConnectionProxyType {
|
|
|
207
216
|
readonly id: string;
|
|
208
217
|
/** Send text message to avatar */
|
|
209
218
|
sendAskViaText(text: string): void;
|
|
210
|
-
/** Send custom event to avatar */
|
|
211
|
-
sendDirectEvent(message: string, data: unknown): void;
|
|
212
219
|
/** Terminate the avatar connection */
|
|
213
220
|
destroy(): void;
|
|
214
221
|
/** Start screen sharing */
|
|
@@ -14,6 +14,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
16
|
export declare const CHAT_CONTEXT_TYPE: Record<ChatContext['type'], string>;
|
|
17
|
+
export declare const resolveActiveContextType: (context: ChatContext | undefined) => {
|
|
18
|
+
contextId: string;
|
|
19
|
+
contextType: string;
|
|
20
|
+
} | {
|
|
21
|
+
contextType: string;
|
|
22
|
+
contextId?: undefined;
|
|
23
|
+
};
|
|
17
24
|
export declare const CHAT_CONTEXT_TYPE_GLOBAL = "global";
|
|
18
25
|
export type ChatContext = {
|
|
19
26
|
type: 'entry';
|
package/languages/.gitkeep
DELETED
|
File without changes
|
package/languages/he-IL.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const supportedLanguages: string[];
|