@unisphere/genie-types 1.27.0-head.1 → 1.27.0
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 +122 -150
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +1 -9
- package/src/lib/avatar-runtime/index.d.ts +0 -1
- package/src/lib/avatar-runtime/runtime-types.d.ts +42 -52
- package/src/lib/avatar-runtime/shared-types.d.ts +0 -34
- package/src/lib/avatar-runtime/visual-bridge-types.d.ts +6 -1
- package/src/lib/chat-thread-runtime/index.d.ts +2 -0
- package/src/lib/chat-thread-runtime/runtime-types.d.ts +15 -0
- package/src/lib/chat-thread-runtime/runtime-visuals/contained-visual-types.d.ts +5 -0
- package/src/lib/shared/chat-thread-service-types.d.ts +20 -0
- package/src/lib/shared/genie-chat-service-types.d.ts +2 -0
- package/src/lib/shared/index.d.ts +1 -0
- package/src/lib/avatar-runtime/runtime-visuals/floater-visual-types.d.ts +0 -5
- package/src/lib/avatar-runtime/runtime-visuals/head-floater-visual-types.d.ts +0 -5
package/index.esm.js
CHANGED
|
@@ -2038,7 +2038,7 @@ addToUnscopables$1('includes');
|
|
|
2038
2038
|
them forever.
|
|
2039
2039
|
new tools will automatically use their relevant widget names
|
|
2040
2040
|
*/
|
|
2041
|
-
const GENIE_RUNTIMES = ['followups-tool', 'sources-tool', 'flashcards-tool', 'content-gallery-tool', 'user-properties-form-tool'];
|
|
2041
|
+
const GENIE_RUNTIMES = ['followups-tool', 'sources-tool', 'flashcards-tool', 'content-gallery-tool', 'user-properties-form-tool', 'data-visualization-tool'];
|
|
2042
2042
|
const GEN_UI_RUNTIMES = ['gen-ui-composer-tool', 'gen-ui-components-tool'];
|
|
2043
2043
|
/* End of closed list */
|
|
2044
2044
|
const getResolvedWidgetName = params => {
|
|
@@ -2070,178 +2070,133 @@ const getResolvedRuntimeName = runtimeName => {
|
|
|
2070
2070
|
|
|
2071
2071
|
/** Runtime name constant for avatar experiences */
|
|
2072
2072
|
const AvatarRuntimeName = 'avatar';
|
|
2073
|
-
const
|
|
2073
|
+
const avatarRuntimeSettingsSchema = {
|
|
2074
2074
|
type: 'object',
|
|
2075
2075
|
properties: {
|
|
2076
|
-
|
|
2076
|
+
schemaVersion: {
|
|
2077
|
+
type: 'literal',
|
|
2078
|
+
value: '1',
|
|
2079
|
+
optional: true
|
|
2080
|
+
},
|
|
2081
|
+
turnServerUrl: {
|
|
2077
2082
|
type: 'primitive',
|
|
2078
2083
|
value: 'string'
|
|
2079
2084
|
},
|
|
2080
|
-
|
|
2081
|
-
everywhere: {
|
|
2085
|
+
srsBaseUrl: {
|
|
2082
2086
|
type: 'primitive',
|
|
2083
|
-
value: '
|
|
2087
|
+
value: 'string'
|
|
2088
|
+
},
|
|
2089
|
+
serverUrl: {
|
|
2090
|
+
type: 'primitive',
|
|
2091
|
+
value: 'string',
|
|
2084
2092
|
optional: true
|
|
2085
2093
|
},
|
|
2086
|
-
|
|
2087
|
-
type: '
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
properties: {}
|
|
2094
|
+
genieServerUrl: {
|
|
2095
|
+
type: 'primitive',
|
|
2096
|
+
value: 'string',
|
|
2097
|
+
optional: true
|
|
2091
2098
|
},
|
|
2092
|
-
|
|
2093
|
-
entryId: {
|
|
2099
|
+
clientId: {
|
|
2094
2100
|
type: 'primitive',
|
|
2095
2101
|
value: 'string',
|
|
2096
|
-
optional: true
|
|
2097
|
-
deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
|
|
2102
|
+
optional: true
|
|
2098
2103
|
},
|
|
2099
|
-
|
|
2104
|
+
roomId: {
|
|
2100
2105
|
type: 'primitive',
|
|
2101
2106
|
value: 'string',
|
|
2102
2107
|
optional: true
|
|
2103
2108
|
},
|
|
2104
|
-
|
|
2109
|
+
flowId: {
|
|
2105
2110
|
type: 'primitive',
|
|
2106
2111
|
value: 'string',
|
|
2107
2112
|
optional: true
|
|
2108
2113
|
},
|
|
2109
|
-
|
|
2114
|
+
loadingVideoURL: {
|
|
2110
2115
|
type: 'primitive',
|
|
2111
2116
|
value: 'string',
|
|
2112
2117
|
optional: true
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
|
-
};
|
|
2116
|
-
const featuresSchema = {
|
|
2117
|
-
type: 'object',
|
|
2118
|
-
optional: true,
|
|
2119
|
-
properties: {
|
|
2120
|
-
screenShare: {
|
|
2118
|
+
},
|
|
2119
|
+
avatarId: {
|
|
2121
2120
|
type: 'primitive',
|
|
2122
|
-
value: '
|
|
2121
|
+
value: 'string',
|
|
2123
2122
|
optional: true
|
|
2124
2123
|
},
|
|
2125
|
-
|
|
2124
|
+
previewImageUrl: {
|
|
2126
2125
|
type: 'primitive',
|
|
2127
|
-
value: '
|
|
2126
|
+
value: 'string',
|
|
2128
2127
|
optional: true
|
|
2129
2128
|
},
|
|
2130
|
-
|
|
2131
|
-
type: '
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
type: 'primitive',
|
|
2135
|
-
value: 'boolean'
|
|
2136
|
-
}, {
|
|
2137
|
-
type: 'object',
|
|
2138
|
-
allowUnknownProperties: true,
|
|
2139
|
-
properties: {}
|
|
2140
|
-
}]
|
|
2129
|
+
agentMode: {
|
|
2130
|
+
type: 'primitive',
|
|
2131
|
+
value: 'boolean',
|
|
2132
|
+
optional: true
|
|
2141
2133
|
},
|
|
2142
|
-
|
|
2134
|
+
noiseReductionEnabled: {
|
|
2143
2135
|
type: 'primitive',
|
|
2144
|
-
value: '
|
|
2136
|
+
value: 'boolean',
|
|
2145
2137
|
optional: true
|
|
2138
|
+
},
|
|
2139
|
+
kaltura: {
|
|
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: {
|
|
2183
|
+
type: 'object',
|
|
2184
|
+
optional: true,
|
|
2185
|
+
properties: {
|
|
2186
|
+
screenShare: {
|
|
2187
|
+
type: 'primitive',
|
|
2188
|
+
value: 'boolean',
|
|
2189
|
+
optional: true
|
|
2190
|
+
},
|
|
2191
|
+
chat: {
|
|
2192
|
+
type: 'primitive',
|
|
2193
|
+
value: 'boolean',
|
|
2194
|
+
optional: true
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2146
2197
|
}
|
|
2147
2198
|
}
|
|
2148
2199
|
};
|
|
2149
|
-
const avatarRuntimeSettingsSchema = {
|
|
2150
|
-
type: 'or',
|
|
2151
|
-
properties: [
|
|
2152
|
-
// serverConfig: 'manual' (or absent)
|
|
2153
|
-
{
|
|
2154
|
-
type: 'object',
|
|
2155
|
-
properties: {
|
|
2156
|
-
schemaVersion: {
|
|
2157
|
-
type: 'literal',
|
|
2158
|
-
value: '1',
|
|
2159
|
-
optional: true
|
|
2160
|
-
},
|
|
2161
|
-
serverConfig: {
|
|
2162
|
-
type: 'literal',
|
|
2163
|
-
value: 'manual',
|
|
2164
|
-
optional: true
|
|
2165
|
-
},
|
|
2166
|
-
turnServerUrl: {
|
|
2167
|
-
type: 'primitive',
|
|
2168
|
-
value: 'string'
|
|
2169
|
-
},
|
|
2170
|
-
srsBaseUrl: {
|
|
2171
|
-
type: 'primitive',
|
|
2172
|
-
value: 'string'
|
|
2173
|
-
},
|
|
2174
|
-
serverUrl: {
|
|
2175
|
-
type: 'primitive',
|
|
2176
|
-
value: 'string'
|
|
2177
|
-
},
|
|
2178
|
-
genieServerUrl: {
|
|
2179
|
-
type: 'primitive',
|
|
2180
|
-
value: 'string',
|
|
2181
|
-
optional: true
|
|
2182
|
-
},
|
|
2183
|
-
clientId: {
|
|
2184
|
-
type: 'primitive',
|
|
2185
|
-
value: 'string',
|
|
2186
|
-
optional: true
|
|
2187
|
-
},
|
|
2188
|
-
roomId: {
|
|
2189
|
-
type: 'primitive',
|
|
2190
|
-
value: 'string',
|
|
2191
|
-
optional: true
|
|
2192
|
-
},
|
|
2193
|
-
flowId: {
|
|
2194
|
-
type: 'primitive',
|
|
2195
|
-
value: 'string',
|
|
2196
|
-
optional: true
|
|
2197
|
-
},
|
|
2198
|
-
loadingVideoURL: {
|
|
2199
|
-
type: 'primitive',
|
|
2200
|
-
value: 'string',
|
|
2201
|
-
optional: true
|
|
2202
|
-
},
|
|
2203
|
-
avatarId: {
|
|
2204
|
-
type: 'primitive',
|
|
2205
|
-
value: 'string',
|
|
2206
|
-
optional: true
|
|
2207
|
-
},
|
|
2208
|
-
previewImageUrl: {
|
|
2209
|
-
type: 'primitive',
|
|
2210
|
-
value: 'string',
|
|
2211
|
-
optional: true
|
|
2212
|
-
},
|
|
2213
|
-
agentMode: {
|
|
2214
|
-
type: 'primitive',
|
|
2215
|
-
value: 'boolean',
|
|
2216
|
-
optional: true
|
|
2217
|
-
},
|
|
2218
|
-
noiseReductionEnabled: {
|
|
2219
|
-
type: 'primitive',
|
|
2220
|
-
value: 'boolean',
|
|
2221
|
-
optional: true
|
|
2222
|
-
},
|
|
2223
|
-
kaltura: kalturaSchema,
|
|
2224
|
-
features: featuresSchema
|
|
2225
|
-
}
|
|
2226
|
-
},
|
|
2227
|
-
// serverConfig: 'studio'
|
|
2228
|
-
{
|
|
2229
|
-
type: 'object',
|
|
2230
|
-
properties: {
|
|
2231
|
-
schemaVersion: {
|
|
2232
|
-
type: 'literal',
|
|
2233
|
-
value: '1',
|
|
2234
|
-
optional: true
|
|
2235
|
-
},
|
|
2236
|
-
serverConfig: {
|
|
2237
|
-
type: 'literal',
|
|
2238
|
-
value: 'studio'
|
|
2239
|
-
},
|
|
2240
|
-
kaltura: kalturaSchema,
|
|
2241
|
-
features: featuresSchema
|
|
2242
|
-
}
|
|
2243
|
-
}]
|
|
2244
|
-
};
|
|
2245
2200
|
|
|
2246
2201
|
const avatarRuntimeChatVisualSettingsSchema = {
|
|
2247
2202
|
type: 'object',
|
|
@@ -3256,17 +3211,6 @@ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
|
3256
3211
|
|
|
3257
3212
|
const SUPPORTED_LAYOUT_TYPES = new Set(['cinema', 'focusContent', 'balanced', 'floatingCorner', 'fullscreenContent']);
|
|
3258
3213
|
|
|
3259
|
-
const avatarRuntimeHeadFloaterVisualSettingsSchema = {
|
|
3260
|
-
type: 'object',
|
|
3261
|
-
properties: {
|
|
3262
|
-
schemaVersion: {
|
|
3263
|
-
type: 'literal',
|
|
3264
|
-
value: '1',
|
|
3265
|
-
optional: true
|
|
3266
|
-
}
|
|
3267
|
-
}
|
|
3268
|
-
};
|
|
3269
|
-
|
|
3270
3214
|
const blockVisualContextSchema = {
|
|
3271
3215
|
type: 'object',
|
|
3272
3216
|
optional: true,
|
|
@@ -3295,6 +3239,34 @@ const blockVisualContextSchema = {
|
|
|
3295
3239
|
}
|
|
3296
3240
|
};
|
|
3297
3241
|
|
|
3242
|
+
const ChatThreadRuntimeName = 'chat-thread';
|
|
3243
|
+
const chatThreadRuntimeSettingsSchema = {
|
|
3244
|
+
type: 'object',
|
|
3245
|
+
properties: {
|
|
3246
|
+
schemaVersion: {
|
|
3247
|
+
type: 'literal',
|
|
3248
|
+
value: '1',
|
|
3249
|
+
optional: true
|
|
3250
|
+
},
|
|
3251
|
+
threadId: {
|
|
3252
|
+
type: 'primitive',
|
|
3253
|
+
value: 'string'
|
|
3254
|
+
},
|
|
3255
|
+
getSourceUrl: getSourceUrlSchema
|
|
3256
|
+
}
|
|
3257
|
+
};
|
|
3258
|
+
|
|
3259
|
+
const chatThreadRuntimeContainedVisualSettingsSchema = {
|
|
3260
|
+
type: 'object',
|
|
3261
|
+
properties: {
|
|
3262
|
+
schemaVersion: {
|
|
3263
|
+
type: 'literal',
|
|
3264
|
+
value: '1',
|
|
3265
|
+
optional: true
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
};
|
|
3269
|
+
|
|
3298
3270
|
var en = {
|
|
3299
3271
|
|
|
3300
3272
|
};
|
|
@@ -3307,4 +3279,4 @@ const useTranslation = createUseTranslation({
|
|
|
3307
3279
|
supportedLanguages
|
|
3308
3280
|
});
|
|
3309
3281
|
|
|
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,
|
|
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 };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { UnisphereService } from '@unisphere/runtime';
|
|
2
2
|
import { AvatarVisualBridgeType } from './visual-bridge-types';
|
|
3
|
-
import { TinyDataStoreConsumer
|
|
3
|
+
import { TinyDataStoreConsumer } from '@unisphere/core';
|
|
4
4
|
import { AvatarConnectionProxyType } from './shared-types';
|
|
5
|
-
export type AvatarWebsocketEvent = {
|
|
6
|
-
name: string;
|
|
7
|
-
payload: any;
|
|
8
|
-
};
|
|
9
5
|
export interface AvatarServiceType extends UnisphereService {
|
|
10
6
|
id: 'unisphere.widget.genie.avatar';
|
|
11
7
|
readonly visualBridge: AvatarVisualBridgeType;
|
|
@@ -23,8 +19,4 @@ export interface AvatarServiceType extends UnisphereService {
|
|
|
23
19
|
getEntrySourceUrl(entryId: string, startTime?: number): string;
|
|
24
20
|
clearContent(): void;
|
|
25
21
|
askViaText(question: string): void;
|
|
26
|
-
onWebsocketEvents: {
|
|
27
|
-
system: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
28
|
-
app: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
29
|
-
};
|
|
30
22
|
}
|
|
@@ -1,16 +1,9 @@
|
|
|
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';
|
|
5
|
-
import { CaptionConfig, CaptionState } from './shared-types';
|
|
6
5
|
/** Runtime name constant for avatar experiences */
|
|
7
6
|
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
|
-
}
|
|
14
7
|
/**
|
|
15
8
|
* Avatar runtime interface for interactive AI avatar experiences.
|
|
16
9
|
*
|
|
@@ -29,10 +22,6 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
29
22
|
disconnect(): void;
|
|
30
23
|
/** Observable connection status */
|
|
31
24
|
isConnected: TinyDataStoreConsumer<boolean>;
|
|
32
|
-
isPaused: TinyDataStoreConsumer<boolean>;
|
|
33
|
-
captions: Captions;
|
|
34
|
-
setDynamicVariables(data: Record<string, any>): void;
|
|
35
|
-
registerClientTools(tools: Record<string, (variables: Record<string, any>) => Promise<any>>): void;
|
|
36
25
|
/** Observable chat panel open state */
|
|
37
26
|
isChatPanelOpen: TinyDataStoreConsumer<boolean>;
|
|
38
27
|
/** Update chat panel open state */
|
|
@@ -43,32 +32,47 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
43
32
|
setThreadId(id: string | null): void;
|
|
44
33
|
/** Sync preview mode flag from the chat customization settings */
|
|
45
34
|
setIsPreviewMode(value: boolean): void;
|
|
46
|
-
/** Observable mute state */
|
|
47
|
-
isMuted: TinyDataStoreConsumer<boolean>;
|
|
48
|
-
/** Mute the avatar audio */
|
|
49
|
-
mute(): void;
|
|
50
|
-
/** Unmute the avatar audio */
|
|
51
|
-
unmute(): void;
|
|
52
|
-
/** Send a text question to the avatar */
|
|
53
|
-
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
35
|
};
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Configuration settings for the avatar runtime.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* Basic avatar setup (required settings only):
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const settings: AvatarRuntimeSettings = {
|
|
43
|
+
* turnServerUrl: 'https://turn.example.com',
|
|
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;
|
|
72
76
|
/** TURN server URL for WebRTC connectivity */
|
|
73
77
|
turnServerUrl: string;
|
|
74
78
|
/** Avatar service server URL */
|
|
@@ -93,12 +97,6 @@ export type AvatarServerConfig = {
|
|
|
93
97
|
noiseReductionEnabled?: boolean;
|
|
94
98
|
/** Genie service server URL */
|
|
95
99
|
genieServerUrl?: string;
|
|
96
|
-
/** Kaltura sesssion */
|
|
97
|
-
ks: string;
|
|
98
|
-
};
|
|
99
|
-
export type AvatarRuntimeSettings = {
|
|
100
|
-
/** Settings schema version */
|
|
101
|
-
schemaVersion?: string;
|
|
102
100
|
/** Kaltura service integration settings */
|
|
103
101
|
kaltura: {
|
|
104
102
|
/** Kaltura session token for authentication */
|
|
@@ -122,14 +120,6 @@ export type AvatarRuntimeSettings = {
|
|
|
122
120
|
screenShare?: boolean;
|
|
123
121
|
/** Enable chat */
|
|
124
122
|
chat?: boolean;
|
|
125
|
-
/** Enable captions; pass CaptionConfig object for fine-grained control */
|
|
126
|
-
captions?: boolean | CaptionConfig;
|
|
127
|
-
/** Phrase sent automatically when avatar signals a blank kickoff turn */
|
|
128
|
-
kickOffPhrase?: string;
|
|
129
123
|
};
|
|
130
|
-
}
|
|
131
|
-
serverConfig?: 'manual';
|
|
132
|
-
} & AvatarServerConfig) | {
|
|
133
|
-
serverConfig: 'studio';
|
|
134
|
-
});
|
|
124
|
+
}
|
|
135
125
|
export declare const avatarRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -98,32 +98,6 @@ export type AvatarContentData<TSettings = any> = {
|
|
|
98
98
|
/** Content status: error occurred */
|
|
99
99
|
status: 'error';
|
|
100
100
|
});
|
|
101
|
-
/**
|
|
102
|
-
* Current caption display state exposed to consumers.
|
|
103
|
-
*/
|
|
104
|
-
export interface CaptionState {
|
|
105
|
-
/** Current visible text segment; empty string when cleared */
|
|
106
|
-
text: string;
|
|
107
|
-
/** True when captions should be hidden (hold period elapsed) */
|
|
108
|
-
clear: boolean;
|
|
109
|
-
/** Whether the caption engine is actively processing speech */
|
|
110
|
-
active: boolean;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Static caption configuration provided at connection time.
|
|
114
|
-
*/
|
|
115
|
-
export interface CaptionConfig {
|
|
116
|
-
/** Word replacements applied to caption text (longest-first, word-boundary) */
|
|
117
|
-
replacements?: Record<string, string>;
|
|
118
|
-
/** Custom text filter applied after replacements */
|
|
119
|
-
filter?: (text: string) => string;
|
|
120
|
-
/** Milliseconds to hold the last caption segment before clearing (default 2000) */
|
|
121
|
-
holdAfterEndMs?: number;
|
|
122
|
-
/** Maximum characters per display line (default 47) */
|
|
123
|
-
maxCharsPerLine?: number;
|
|
124
|
-
/** Maximum number of lines (default 2) */
|
|
125
|
-
maxLines?: number;
|
|
126
|
-
}
|
|
127
101
|
/**
|
|
128
102
|
* Internal avatar connection proxy interface for advanced operations.
|
|
129
103
|
*
|
|
@@ -201,8 +175,6 @@ export interface AvatarConnectionProxyType {
|
|
|
201
175
|
readonly screenShareInfo: TinyDataStoreConsumer<AgentScreenShareInfo | null>;
|
|
202
176
|
/** Observable form paused state */
|
|
203
177
|
readonly isAvatarPaused: TinyDataStoreConsumer<boolean>;
|
|
204
|
-
/** Observable caption display state — null when feature is disabled */
|
|
205
|
-
readonly captions: TinyDataStoreConsumer<CaptionState | null>;
|
|
206
178
|
/** Unique connection identifier */
|
|
207
179
|
readonly id: string;
|
|
208
180
|
/** Send text message to avatar */
|
|
@@ -223,11 +195,5 @@ export interface AvatarConnectionProxyType {
|
|
|
223
195
|
pauseAvatarAfterSpeaking(): void;
|
|
224
196
|
/** Clear current visual content */
|
|
225
197
|
clearContent(): void;
|
|
226
|
-
/** Toggle caption visibility on/off (no effect when feature is disabled) */
|
|
227
|
-
toggleCaptions(): void;
|
|
228
|
-
/** Update word replacements for the caption filter at runtime */
|
|
229
|
-
setCaptionReplacements(replacements: Record<string, string> | null): void;
|
|
230
|
-
/** Set or clear a custom post-processing filter for captions */
|
|
231
|
-
setCaptionFilter(filter: ((text: string) => string) | null): void;
|
|
232
198
|
}
|
|
233
199
|
export declare const isAvatarConnectionProxyInternalType: (x: any) => x is AvatarConnectionProxInternalType;
|
|
@@ -18,6 +18,9 @@ export interface LayoutConfig {
|
|
|
18
18
|
type: LayoutType;
|
|
19
19
|
background?: string;
|
|
20
20
|
}
|
|
21
|
+
export interface ChatConfig {
|
|
22
|
+
disableInput?: boolean;
|
|
23
|
+
}
|
|
21
24
|
export interface VisualBehavior {
|
|
22
25
|
pauseAfterSpeaking?: boolean;
|
|
23
26
|
pauseImmediately?: boolean;
|
|
@@ -25,10 +28,12 @@ export interface VisualBehavior {
|
|
|
25
28
|
export interface VisualTypeConfig {
|
|
26
29
|
behavior?: VisualBehavior;
|
|
27
30
|
layout?: LayoutConfig;
|
|
31
|
+
chat?: ChatConfig;
|
|
28
32
|
slots?: Partial<Record<SlotType, SlotConfig>>;
|
|
29
33
|
}
|
|
30
34
|
export interface ResolvedCapabilities {
|
|
31
35
|
layout?: LayoutConfig;
|
|
36
|
+
chat?: ChatConfig;
|
|
32
37
|
slots: Partial<Record<SlotType, SlotEntry[]>>;
|
|
33
38
|
}
|
|
34
39
|
export interface ActionContext {
|
|
@@ -38,5 +43,5 @@ export interface ActionContext {
|
|
|
38
43
|
content: AvatarContentData | null;
|
|
39
44
|
}
|
|
40
45
|
export interface AvatarVisualBridgeType extends UnisphereVisualBridgeType<VisualTypeConfig, ResolvedCapabilities> {
|
|
41
|
-
getActionContext(): ActionContext
|
|
46
|
+
getActionContext(): ActionContext;
|
|
42
47
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
|
+
import { widgetName } from '../widget-types';
|
|
4
|
+
import { GlobalChatSettings } from '../chat-runtime/shared-settings';
|
|
5
|
+
export declare const ChatThreadRuntimeName: "chat-thread";
|
|
6
|
+
export type ChatThreadRuntime = UnisphereRuntimeBaseType<ChatThreadRuntimeSettings> & {
|
|
7
|
+
readonly widgetName: typeof widgetName;
|
|
8
|
+
readonly runtimeName: typeof ChatThreadRuntimeName;
|
|
9
|
+
};
|
|
10
|
+
export interface ChatThreadRuntimeSettings {
|
|
11
|
+
schemaVersion?: string;
|
|
12
|
+
threadId: string;
|
|
13
|
+
getSourceUrl?: GlobalChatSettings['getSourceUrl'];
|
|
14
|
+
}
|
|
15
|
+
export declare const chatThreadRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UnisphereService } from '@unisphere/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Genie chat service interface providing chat functionality and media integration.
|
|
4
|
+
*
|
|
5
|
+
* This service enables AI chat interactions, manages conversation state,
|
|
6
|
+
* and integrates with Kaltura media players.
|
|
7
|
+
*/
|
|
8
|
+
export interface ChatThreadServiceType extends UnisphereService {
|
|
9
|
+
/** Service identifier */
|
|
10
|
+
id: 'unisphere.widget.genie.thread';
|
|
11
|
+
/** Generate a URL for a media entry source */
|
|
12
|
+
getSourceUrl?: (params: {
|
|
13
|
+
type: 'category';
|
|
14
|
+
categoryId: string;
|
|
15
|
+
} | {
|
|
16
|
+
type?: 'entry';
|
|
17
|
+
entryId: string;
|
|
18
|
+
startTime?: number;
|
|
19
|
+
}) => string;
|
|
20
|
+
}
|
|
@@ -52,6 +52,8 @@ export interface GenieChatServiceType extends UnisphereService {
|
|
|
52
52
|
/** Block ID for retry operations */
|
|
53
53
|
retryBlockId?: string;
|
|
54
54
|
}>;
|
|
55
|
+
activeThreadId: TinyDataStoreConsumer<string | null>;
|
|
56
|
+
setActiveThreadId: (id: string | null) => void;
|
|
55
57
|
/** Observable for fetching thread messages */
|
|
56
58
|
getThreadMessages: TinyPubSub<{
|
|
57
59
|
/** Optional thread ID to fetch messages from */
|