@unisphere/genie-types 1.27.0 → 1.28.0-head.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 +162 -106
- package/package.json +2 -3
- package/src/index.d.ts +0 -1
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +15 -3
- package/src/lib/avatar-runtime/index.d.ts +1 -0
- package/src/lib/avatar-runtime/runtime-types.d.ts +53 -45
- package/src/lib/avatar-runtime/runtime-visuals/floater-visual-types.d.ts +5 -0
- package/src/lib/avatar-runtime/runtime-visuals/head-floater-visual-types.d.ts +5 -0
- package/src/lib/avatar-runtime/shared-types.d.ts +48 -7
- package/src/lib/avatar-runtime/visual-bridge-types.d.ts +1 -1
- 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',
|
|
@@ -2070,133 +2076,184 @@ const getResolvedRuntimeName = runtimeName => {
|
|
|
2070
2076
|
|
|
2071
2077
|
/** Runtime name constant for avatar experiences */
|
|
2072
2078
|
const AvatarRuntimeName = 'avatar';
|
|
2073
|
-
const
|
|
2079
|
+
const kalturaSchema = {
|
|
2074
2080
|
type: 'object',
|
|
2075
2081
|
properties: {
|
|
2076
|
-
|
|
2077
|
-
type: 'literal',
|
|
2078
|
-
value: '1',
|
|
2079
|
-
optional: true
|
|
2080
|
-
},
|
|
2081
|
-
turnServerUrl: {
|
|
2082
|
-
type: 'primitive',
|
|
2083
|
-
value: 'string'
|
|
2084
|
-
},
|
|
2085
|
-
srsBaseUrl: {
|
|
2082
|
+
ks: {
|
|
2086
2083
|
type: 'primitive',
|
|
2087
2084
|
value: 'string'
|
|
2088
2085
|
},
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
value: 'string',
|
|
2092
|
-
optional: true
|
|
2093
|
-
},
|
|
2094
|
-
genieServerUrl: {
|
|
2086
|
+
context: chatContextSchema,
|
|
2087
|
+
everywhere: {
|
|
2095
2088
|
type: 'primitive',
|
|
2096
|
-
value: '
|
|
2089
|
+
value: 'boolean',
|
|
2097
2090
|
optional: true
|
|
2098
2091
|
},
|
|
2099
|
-
|
|
2100
|
-
type: '
|
|
2101
|
-
|
|
2102
|
-
|
|
2092
|
+
capabilities: {
|
|
2093
|
+
type: 'object',
|
|
2094
|
+
optional: true,
|
|
2095
|
+
allowUnknownProperties: true,
|
|
2096
|
+
properties: {}
|
|
2103
2097
|
},
|
|
2104
|
-
|
|
2098
|
+
// @deprecated - kept for backward compatibility
|
|
2099
|
+
entryId: {
|
|
2105
2100
|
type: 'primitive',
|
|
2106
2101
|
value: 'string',
|
|
2107
|
-
optional: true
|
|
2102
|
+
optional: true,
|
|
2103
|
+
deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
|
|
2108
2104
|
},
|
|
2109
|
-
|
|
2105
|
+
kalturaServerURI: {
|
|
2110
2106
|
type: 'primitive',
|
|
2111
2107
|
value: 'string',
|
|
2112
2108
|
optional: true
|
|
2113
2109
|
},
|
|
2114
|
-
|
|
2110
|
+
partnerId: {
|
|
2115
2111
|
type: 'primitive',
|
|
2116
2112
|
value: 'string',
|
|
2117
2113
|
optional: true
|
|
2118
2114
|
},
|
|
2119
|
-
|
|
2115
|
+
uiConfId: {
|
|
2120
2116
|
type: 'primitive',
|
|
2121
2117
|
value: 'string',
|
|
2122
2118
|
optional: true
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
};
|
|
2122
|
+
const featuresSchema = {
|
|
2123
|
+
type: 'object',
|
|
2124
|
+
optional: true,
|
|
2125
|
+
properties: {
|
|
2126
|
+
screenShare: {
|
|
2125
2127
|
type: 'primitive',
|
|
2126
|
-
value: '
|
|
2128
|
+
value: 'boolean',
|
|
2127
2129
|
optional: true
|
|
2128
2130
|
},
|
|
2129
|
-
|
|
2131
|
+
chat: {
|
|
2130
2132
|
type: 'primitive',
|
|
2131
2133
|
value: 'boolean',
|
|
2132
2134
|
optional: true
|
|
2133
2135
|
},
|
|
2134
|
-
|
|
2136
|
+
captions: {
|
|
2137
|
+
type: 'or',
|
|
2138
|
+
optional: true,
|
|
2139
|
+
properties: [{
|
|
2140
|
+
type: 'primitive',
|
|
2141
|
+
value: 'boolean'
|
|
2142
|
+
}, {
|
|
2143
|
+
type: 'object',
|
|
2144
|
+
allowUnknownProperties: true,
|
|
2145
|
+
properties: {}
|
|
2146
|
+
}]
|
|
2147
|
+
},
|
|
2148
|
+
kickOffPhrase: {
|
|
2135
2149
|
type: 'primitive',
|
|
2136
|
-
value: '
|
|
2150
|
+
value: 'string',
|
|
2137
2151
|
optional: true
|
|
2138
2152
|
},
|
|
2139
|
-
|
|
2140
|
-
type: 'object',
|
|
2141
|
-
properties: {
|
|
2142
|
-
ks: {
|
|
2143
|
-
type: 'primitive',
|
|
2144
|
-
value: 'string'
|
|
2145
|
-
},
|
|
2146
|
-
context: chatContextSchema,
|
|
2147
|
-
everywhere: {
|
|
2148
|
-
type: 'primitive',
|
|
2149
|
-
value: 'boolean',
|
|
2150
|
-
optional: true
|
|
2151
|
-
},
|
|
2152
|
-
capabilities: {
|
|
2153
|
-
type: 'object',
|
|
2154
|
-
optional: true,
|
|
2155
|
-
allowUnknownProperties: true,
|
|
2156
|
-
properties: {}
|
|
2157
|
-
},
|
|
2158
|
-
// @deprecated - kept for backward compatibility
|
|
2159
|
-
entryId: {
|
|
2160
|
-
type: 'primitive',
|
|
2161
|
-
value: 'string',
|
|
2162
|
-
optional: true,
|
|
2163
|
-
deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
|
|
2164
|
-
},
|
|
2165
|
-
kalturaServerURI: {
|
|
2166
|
-
type: 'primitive',
|
|
2167
|
-
value: 'string',
|
|
2168
|
-
optional: true
|
|
2169
|
-
},
|
|
2170
|
-
partnerId: {
|
|
2171
|
-
type: 'primitive',
|
|
2172
|
-
value: 'string',
|
|
2173
|
-
optional: true
|
|
2174
|
-
},
|
|
2175
|
-
uiConfId: {
|
|
2176
|
-
type: 'primitive',
|
|
2177
|
-
value: 'string',
|
|
2178
|
-
optional: true
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
},
|
|
2182
|
-
features: {
|
|
2153
|
+
dynamicVariables: {
|
|
2183
2154
|
type: 'object',
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
type: 'primitive',
|
|
2188
|
-
value: 'boolean',
|
|
2189
|
-
optional: true
|
|
2190
|
-
},
|
|
2191
|
-
chat: {
|
|
2192
|
-
type: 'primitive',
|
|
2193
|
-
value: 'boolean',
|
|
2194
|
-
optional: true
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2155
|
+
properties: {},
|
|
2156
|
+
allowUnknownProperties: true,
|
|
2157
|
+
optional: true
|
|
2197
2158
|
}
|
|
2198
2159
|
}
|
|
2199
2160
|
};
|
|
2161
|
+
const avatarRuntimeSettingsSchema = {
|
|
2162
|
+
type: 'or',
|
|
2163
|
+
properties: [
|
|
2164
|
+
// serverConfig: 'manual' (or absent)
|
|
2165
|
+
{
|
|
2166
|
+
type: 'object',
|
|
2167
|
+
properties: {
|
|
2168
|
+
schemaVersion: {
|
|
2169
|
+
type: 'literal',
|
|
2170
|
+
value: '1',
|
|
2171
|
+
optional: true
|
|
2172
|
+
},
|
|
2173
|
+
serverConfig: {
|
|
2174
|
+
type: 'literal',
|
|
2175
|
+
value: 'manual',
|
|
2176
|
+
optional: true
|
|
2177
|
+
},
|
|
2178
|
+
turnServerUrl: {
|
|
2179
|
+
type: 'primitive',
|
|
2180
|
+
value: 'string'
|
|
2181
|
+
},
|
|
2182
|
+
srsBaseUrl: {
|
|
2183
|
+
type: 'primitive',
|
|
2184
|
+
value: 'string'
|
|
2185
|
+
},
|
|
2186
|
+
serverUrl: {
|
|
2187
|
+
type: 'primitive',
|
|
2188
|
+
value: 'string'
|
|
2189
|
+
},
|
|
2190
|
+
genieServerUrl: {
|
|
2191
|
+
type: 'primitive',
|
|
2192
|
+
value: 'string',
|
|
2193
|
+
optional: true
|
|
2194
|
+
},
|
|
2195
|
+
clientId: {
|
|
2196
|
+
type: 'primitive',
|
|
2197
|
+
value: 'string',
|
|
2198
|
+
optional: true
|
|
2199
|
+
},
|
|
2200
|
+
roomId: {
|
|
2201
|
+
type: 'primitive',
|
|
2202
|
+
value: 'string',
|
|
2203
|
+
optional: true
|
|
2204
|
+
},
|
|
2205
|
+
flowId: {
|
|
2206
|
+
type: 'primitive',
|
|
2207
|
+
value: 'string',
|
|
2208
|
+
optional: true
|
|
2209
|
+
},
|
|
2210
|
+
loadingVideoURL: {
|
|
2211
|
+
type: 'primitive',
|
|
2212
|
+
value: 'string',
|
|
2213
|
+
optional: true
|
|
2214
|
+
},
|
|
2215
|
+
avatarId: {
|
|
2216
|
+
type: 'primitive',
|
|
2217
|
+
value: 'string',
|
|
2218
|
+
optional: true
|
|
2219
|
+
},
|
|
2220
|
+
previewImageUrl: {
|
|
2221
|
+
type: 'primitive',
|
|
2222
|
+
value: 'string',
|
|
2223
|
+
optional: true
|
|
2224
|
+
},
|
|
2225
|
+
agentMode: {
|
|
2226
|
+
type: 'primitive',
|
|
2227
|
+
value: 'boolean',
|
|
2228
|
+
optional: true
|
|
2229
|
+
},
|
|
2230
|
+
noiseReductionEnabled: {
|
|
2231
|
+
type: 'primitive',
|
|
2232
|
+
value: 'boolean',
|
|
2233
|
+
optional: true
|
|
2234
|
+
},
|
|
2235
|
+
kaltura: kalturaSchema,
|
|
2236
|
+
features: featuresSchema
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
// serverConfig: 'studio'
|
|
2240
|
+
{
|
|
2241
|
+
type: 'object',
|
|
2242
|
+
properties: {
|
|
2243
|
+
schemaVersion: {
|
|
2244
|
+
type: 'literal',
|
|
2245
|
+
value: '1',
|
|
2246
|
+
optional: true
|
|
2247
|
+
},
|
|
2248
|
+
serverConfig: {
|
|
2249
|
+
type: 'literal',
|
|
2250
|
+
value: 'studio'
|
|
2251
|
+
},
|
|
2252
|
+
kaltura: kalturaSchema,
|
|
2253
|
+
features: featuresSchema
|
|
2254
|
+
}
|
|
2255
|
+
}]
|
|
2256
|
+
};
|
|
2200
2257
|
|
|
2201
2258
|
const avatarRuntimeChatVisualSettingsSchema = {
|
|
2202
2259
|
type: 'object',
|
|
@@ -2286,7 +2343,7 @@ var DisconnectReasons;
|
|
|
2286
2343
|
})(DisconnectReasons || (DisconnectReasons = {}));
|
|
2287
2344
|
const isAvatarConnectionProxyInternalType = x => {
|
|
2288
2345
|
var _a;
|
|
2289
|
-
return '
|
|
2346
|
+
return '__webSocket' in x && typeof ((_a = x.__webSocket) === null || _a === void 0 ? void 0 : _a.onChanges) === 'function';
|
|
2290
2347
|
};
|
|
2291
2348
|
|
|
2292
2349
|
var iterators = {};
|
|
@@ -3211,6 +3268,17 @@ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
|
3211
3268
|
|
|
3212
3269
|
const SUPPORTED_LAYOUT_TYPES = new Set(['cinema', 'focusContent', 'balanced', 'floatingCorner', 'fullscreenContent']);
|
|
3213
3270
|
|
|
3271
|
+
const avatarRuntimeHeadFloaterVisualSettingsSchema = {
|
|
3272
|
+
type: 'object',
|
|
3273
|
+
properties: {
|
|
3274
|
+
schemaVersion: {
|
|
3275
|
+
type: 'literal',
|
|
3276
|
+
value: '1',
|
|
3277
|
+
optional: true
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
};
|
|
3281
|
+
|
|
3214
3282
|
const blockVisualContextSchema = {
|
|
3215
3283
|
type: 'object',
|
|
3216
3284
|
optional: true,
|
|
@@ -3267,16 +3335,4 @@ const chatThreadRuntimeContainedVisualSettingsSchema = {
|
|
|
3267
3335
|
}
|
|
3268
3336
|
};
|
|
3269
3337
|
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
};
|
|
3273
|
-
|
|
3274
|
-
const supportedLanguages = ['en-US', 'he-IL'];
|
|
3275
|
-
|
|
3276
|
-
const useTranslation = createUseTranslation({
|
|
3277
|
-
packageName: '@unisphere/genie-types',
|
|
3278
|
-
defaultTranslations: en,
|
|
3279
|
-
supportedLanguages
|
|
3280
|
-
});
|
|
3281
|
-
|
|
3282
|
-
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, schemaVersionSchema, shareUrlSchema, useTranslation, widgetName };
|
|
3338
|
+
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, ChatThreadRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeHeadFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, chatThreadRuntimeContainedVisualSettingsSchema, chatThreadRuntimeSettingsSchema, 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.
|
|
3
|
+
"version": "1.28.0-head.5",
|
|
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
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { UnisphereService } from '@unisphere/runtime';
|
|
2
2
|
import { AvatarVisualBridgeType } from './visual-bridge-types';
|
|
3
|
-
import { TinyDataStoreConsumer } from '@unisphere/core';
|
|
3
|
+
import { TinyDataStoreConsumer, TinyPubSub } from '@unisphere/core';
|
|
4
4
|
import { AvatarConnectionProxyType } from './shared-types';
|
|
5
|
+
export type AvatarWebsocketEvent = {
|
|
6
|
+
name: string;
|
|
7
|
+
payload: any;
|
|
8
|
+
};
|
|
5
9
|
export interface AvatarServiceType extends UnisphereService {
|
|
6
10
|
id: 'unisphere.widget.genie.avatar';
|
|
7
11
|
readonly visualBridge: AvatarVisualBridgeType;
|
|
8
12
|
readonly connection: TinyDataStoreConsumer<AvatarConnectionProxyType | null>;
|
|
9
13
|
connect(options?: {
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
context?: {
|
|
15
|
+
type: 'thread';
|
|
16
|
+
threadId: string;
|
|
17
|
+
messageId?: string;
|
|
18
|
+
};
|
|
19
|
+
dynamicVariables?: Record<string, unknown>;
|
|
12
20
|
}): void;
|
|
13
21
|
getKalturaPlayerParams(): {
|
|
14
22
|
kalturaServerURI: string;
|
|
@@ -19,4 +27,8 @@ export interface AvatarServiceType extends UnisphereService {
|
|
|
19
27
|
getEntrySourceUrl(entryId: string, startTime?: number): string;
|
|
20
28
|
clearContent(): void;
|
|
21
29
|
askViaText(question: string): void;
|
|
30
|
+
onWebsocketEvents: {
|
|
31
|
+
system: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
32
|
+
app: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
33
|
+
};
|
|
22
34
|
}
|
|
@@ -2,8 +2,15 @@ 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 { CaptionConfig, CaptionState } from './shared-types';
|
|
5
6
|
/** Runtime name constant for avatar experiences */
|
|
6
7
|
export declare const AvatarRuntimeName: "avatar";
|
|
8
|
+
export interface Captions {
|
|
9
|
+
state: TinyDataStoreConsumer<CaptionState | null>;
|
|
10
|
+
toggle(): void;
|
|
11
|
+
setReplacements(replacements: Record<string, string> | null): void;
|
|
12
|
+
setFilter(filter: ((text: string) => string) | null): void;
|
|
13
|
+
}
|
|
7
14
|
/**
|
|
8
15
|
* Avatar runtime interface for interactive AI avatar experiences.
|
|
9
16
|
*
|
|
@@ -15,13 +22,22 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
15
22
|
readonly runtimeName: typeof AvatarRuntimeName;
|
|
16
23
|
/** Establish connection to the avatar service */
|
|
17
24
|
connect(params?: {
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
context?: {
|
|
26
|
+
type: 'thread';
|
|
27
|
+
threadId: string;
|
|
28
|
+
messageId?: string;
|
|
29
|
+
};
|
|
30
|
+
dynamicVariables?: Record<string, unknown>;
|
|
20
31
|
}): void;
|
|
21
32
|
/** Disconnect from the avatar service */
|
|
22
33
|
disconnect(): void;
|
|
23
34
|
/** Observable connection status */
|
|
24
35
|
isConnected: TinyDataStoreConsumer<boolean>;
|
|
36
|
+
isPaused: TinyDataStoreConsumer<boolean>;
|
|
37
|
+
captions: Captions;
|
|
38
|
+
registerClientTools<TMap extends Record<string, unknown>>(tools: {
|
|
39
|
+
[K in keyof TMap]: (args: TMap[K]) => undefined | null | Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
40
|
+
}): void;
|
|
25
41
|
/** Observable chat panel open state */
|
|
26
42
|
isChatPanelOpen: TinyDataStoreConsumer<boolean>;
|
|
27
43
|
/** Update chat panel open state */
|
|
@@ -32,47 +48,25 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
32
48
|
setThreadId(id: string | null): void;
|
|
33
49
|
/** Sync preview mode flag from the chat customization settings */
|
|
34
50
|
setIsPreviewMode(value: boolean): void;
|
|
51
|
+
/** Observable mute state */
|
|
52
|
+
isMuted: TinyDataStoreConsumer<boolean>;
|
|
53
|
+
/** Mute the avatar audio */
|
|
54
|
+
mute(): void;
|
|
55
|
+
/** Unmute the avatar audio */
|
|
56
|
+
unmute(): void;
|
|
57
|
+
/** Send a text question to the avatar */
|
|
58
|
+
askViaText(question: string): void;
|
|
59
|
+
/** Update dynamic variables */
|
|
60
|
+
updateDynamicVariables(variables: Record<string, unknown>): void;
|
|
35
61
|
};
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* serverUrl: 'https://avatar.example.com',
|
|
45
|
-
* srsBaseUrl: 'https://srs.example.com',
|
|
46
|
-
* kaltura: {
|
|
47
|
-
* ks: 'your-kaltura-session-token'
|
|
48
|
-
* }
|
|
49
|
-
* };
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* Advanced avatar with custom configuration:
|
|
54
|
-
* ```typescript
|
|
55
|
-
* const settings: AvatarRuntimeSettings = {
|
|
56
|
-
* turnServerUrl: 'https://turn.example.com',
|
|
57
|
-
* serverUrl: 'https://avatar.example.com',
|
|
58
|
-
* srsBaseUrl: 'https://srs.example.com',
|
|
59
|
-
* clientId: 'client-123',
|
|
60
|
-
* roomId: 'room-456',
|
|
61
|
-
* avatarId: 'avatar-789',
|
|
62
|
-
* agentMode: true,
|
|
63
|
-
* noiseReductionEnabled: true,
|
|
64
|
-
* kaltura: {
|
|
65
|
-
* ks: 'your-kaltura-session-token',
|
|
66
|
-
* partnerId: '12345',
|
|
67
|
-
* context: { type: 'entry', id: 'entry_xyz' },
|
|
68
|
-
* capabilities: { use_knowledge_base: 'on' }
|
|
69
|
-
* }
|
|
70
|
-
* };
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
export interface AvatarRuntimeSettings {
|
|
74
|
-
/** Settings schema version */
|
|
75
|
-
schemaVersion?: string;
|
|
62
|
+
/** Event emitted when the avatar brain invokes a tool call */
|
|
63
|
+
export interface AvatarToolCallEvent {
|
|
64
|
+
/** Tool name (e.g. 'navigate_to_slide', 'create_slide') */
|
|
65
|
+
name: string;
|
|
66
|
+
/** Tool arguments parsed from the YAML/JSON content */
|
|
67
|
+
args: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
export type AvatarServerConfig = {
|
|
76
70
|
/** TURN server URL for WebRTC connectivity */
|
|
77
71
|
turnServerUrl: string;
|
|
78
72
|
/** Avatar service server URL */
|
|
@@ -95,8 +89,12 @@ export interface AvatarRuntimeSettings {
|
|
|
95
89
|
agentMode?: boolean;
|
|
96
90
|
/** Enable audio noise reduction for clearer audio */
|
|
97
91
|
noiseReductionEnabled?: boolean;
|
|
98
|
-
/**
|
|
99
|
-
|
|
92
|
+
/** Kaltura sesssion */
|
|
93
|
+
ks: string;
|
|
94
|
+
};
|
|
95
|
+
export type AvatarRuntimeSettings = {
|
|
96
|
+
/** Settings schema version */
|
|
97
|
+
schemaVersion?: string;
|
|
100
98
|
/** Kaltura service integration settings */
|
|
101
99
|
kaltura: {
|
|
102
100
|
/** Kaltura session token for authentication */
|
|
@@ -120,6 +118,16 @@ export interface AvatarRuntimeSettings {
|
|
|
120
118
|
screenShare?: boolean;
|
|
121
119
|
/** Enable chat */
|
|
122
120
|
chat?: boolean;
|
|
121
|
+
/** Enable captions; pass CaptionConfig object for fine-grained control */
|
|
122
|
+
captions?: boolean | CaptionConfig;
|
|
123
|
+
/** Phrase sent automatically when avatar signals a blank kickoff turn */
|
|
124
|
+
kickOffPhrase?: string;
|
|
125
|
+
/** Dynamic request variables */
|
|
126
|
+
dynamicVariables?: Record<string, unknown>;
|
|
123
127
|
};
|
|
124
|
-
}
|
|
128
|
+
} & (({
|
|
129
|
+
serverConfig?: 'manual';
|
|
130
|
+
} & AvatarServerConfig) | {
|
|
131
|
+
serverConfig: 'studio';
|
|
132
|
+
});
|
|
125
133
|
export declare const avatarRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -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
|
*
|
|
@@ -98,20 +107,44 @@ export type AvatarContentData<TSettings = any> = {
|
|
|
98
107
|
/** Content status: error occurred */
|
|
99
108
|
status: 'error';
|
|
100
109
|
});
|
|
110
|
+
/**
|
|
111
|
+
* Current caption display state exposed to consumers.
|
|
112
|
+
*/
|
|
113
|
+
export interface CaptionState {
|
|
114
|
+
/** Current visible text segment; empty string when cleared */
|
|
115
|
+
text: string;
|
|
116
|
+
/** True when captions should be hidden (hold period elapsed) */
|
|
117
|
+
clear: boolean;
|
|
118
|
+
/** Whether the caption engine is actively processing speech */
|
|
119
|
+
active: boolean;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Static caption configuration provided at connection time.
|
|
123
|
+
*/
|
|
124
|
+
export interface CaptionConfig {
|
|
125
|
+
/** Word replacements applied to caption text (longest-first, word-boundary) */
|
|
126
|
+
replacements?: Record<string, string>;
|
|
127
|
+
/** Custom text filter applied after replacements */
|
|
128
|
+
filter?: (text: string) => string;
|
|
129
|
+
/** Milliseconds to hold the last caption segment before clearing (default 2000) */
|
|
130
|
+
holdAfterEndMs?: number;
|
|
131
|
+
/** Maximum characters per display line (default 47) */
|
|
132
|
+
maxCharsPerLine?: number;
|
|
133
|
+
/** Maximum number of lines (default 2) */
|
|
134
|
+
maxLines?: number;
|
|
135
|
+
}
|
|
101
136
|
/**
|
|
102
137
|
* Internal avatar connection proxy interface for advanced operations.
|
|
103
138
|
*
|
|
104
139
|
* @internal
|
|
105
140
|
*/
|
|
106
141
|
export interface AvatarConnectionProxInternalType {
|
|
107
|
-
/** Send direct event to server */
|
|
108
|
-
_directEventToServer(message: string, data: any): void;
|
|
109
142
|
/** Set local content state */
|
|
110
|
-
|
|
143
|
+
__setLocalContent(content: any): void;
|
|
111
144
|
/** Handle player errors */
|
|
112
|
-
|
|
145
|
+
__onPlayerError(error: Error): void;
|
|
113
146
|
/** WebSocket connection observable */
|
|
114
|
-
|
|
147
|
+
__webSocket: TinyDataStoreConsumer<SimplifiedSocket | null>;
|
|
115
148
|
}
|
|
116
149
|
export declare enum DisconnectReasons {
|
|
117
150
|
UserRequested = "UserRequested",
|
|
@@ -155,6 +188,8 @@ export interface AvatarConnectionProxyType {
|
|
|
155
188
|
readonly content: TinyDataStoreConsumer<AvatarContentData | null>;
|
|
156
189
|
/** Observable agent state and analytics */
|
|
157
190
|
readonly agentData: TinyDataStoreConsumer<AgentData | null>;
|
|
191
|
+
/** Observable agent kaltura context data */
|
|
192
|
+
readonly kalturaContext: TinyDataStoreConsumer<AgentKalturaContextData | null>;
|
|
158
193
|
/** Observable available audio devices */
|
|
159
194
|
readonly devicesList: TinyDataStoreConsumer<{
|
|
160
195
|
audioInput: MediaDeviceInfo[];
|
|
@@ -175,12 +210,12 @@ export interface AvatarConnectionProxyType {
|
|
|
175
210
|
readonly screenShareInfo: TinyDataStoreConsumer<AgentScreenShareInfo | null>;
|
|
176
211
|
/** Observable form paused state */
|
|
177
212
|
readonly isAvatarPaused: TinyDataStoreConsumer<boolean>;
|
|
213
|
+
/** Observable caption display state — null when feature is disabled */
|
|
214
|
+
readonly captions: TinyDataStoreConsumer<CaptionState | null>;
|
|
178
215
|
/** Unique connection identifier */
|
|
179
216
|
readonly id: string;
|
|
180
217
|
/** Send text message to avatar */
|
|
181
218
|
sendAskViaText(text: string): void;
|
|
182
|
-
/** Send custom event to avatar */
|
|
183
|
-
sendDirectEvent(message: string, data: unknown): void;
|
|
184
219
|
/** Terminate the avatar connection */
|
|
185
220
|
destroy(): void;
|
|
186
221
|
/** Start screen sharing */
|
|
@@ -195,5 +230,11 @@ export interface AvatarConnectionProxyType {
|
|
|
195
230
|
pauseAvatarAfterSpeaking(): void;
|
|
196
231
|
/** Clear current visual content */
|
|
197
232
|
clearContent(): void;
|
|
233
|
+
/** Toggle caption visibility on/off (no effect when feature is disabled) */
|
|
234
|
+
toggleCaptions(): void;
|
|
235
|
+
/** Update word replacements for the caption filter at runtime */
|
|
236
|
+
setCaptionReplacements(replacements: Record<string, string> | null): void;
|
|
237
|
+
/** Set or clear a custom post-processing filter for captions */
|
|
238
|
+
setCaptionFilter(filter: ((text: string) => string) | null): void;
|
|
198
239
|
}
|
|
199
240
|
export declare const isAvatarConnectionProxyInternalType: (x: any) => x is AvatarConnectionProxInternalType;
|
|
@@ -43,5 +43,5 @@ export interface ActionContext {
|
|
|
43
43
|
content: AvatarContentData | null;
|
|
44
44
|
}
|
|
45
45
|
export interface AvatarVisualBridgeType extends UnisphereVisualBridgeType<VisualTypeConfig, ResolvedCapabilities> {
|
|
46
|
-
getActionContext(): ActionContext;
|
|
46
|
+
getActionContext(): ActionContext | null;
|
|
47
47
|
}
|
|
@@ -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[];
|