@unisphere/genie-types 1.26.3 → 1.27.0-head.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 +150 -94
- package/package.json +1 -1
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +9 -1
- package/src/lib/avatar-runtime/index.d.ts +1 -0
- package/src/lib/avatar-runtime/runtime-types.d.ts +42 -42
- 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 +34 -0
- package/src/lib/avatar-runtime/visual-bridge-types.d.ts +1 -6
- package/src/lib/shared/genie-chat-service-types.d.ts +0 -2
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'];
|
|
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,133 +2070,178 @@ const getResolvedRuntimeName = runtimeName => {
|
|
|
2070
2070
|
|
|
2071
2071
|
/** Runtime name constant for avatar experiences */
|
|
2072
2072
|
const AvatarRuntimeName = 'avatar';
|
|
2073
|
-
const
|
|
2073
|
+
const kalturaSchema = {
|
|
2074
2074
|
type: 'object',
|
|
2075
2075
|
properties: {
|
|
2076
|
-
|
|
2077
|
-
type: 'literal',
|
|
2078
|
-
value: '1',
|
|
2079
|
-
optional: true
|
|
2080
|
-
},
|
|
2081
|
-
turnServerUrl: {
|
|
2082
|
-
type: 'primitive',
|
|
2083
|
-
value: 'string'
|
|
2084
|
-
},
|
|
2085
|
-
srsBaseUrl: {
|
|
2076
|
+
ks: {
|
|
2086
2077
|
type: 'primitive',
|
|
2087
2078
|
value: 'string'
|
|
2088
2079
|
},
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
value: 'string',
|
|
2092
|
-
optional: true
|
|
2093
|
-
},
|
|
2094
|
-
genieServerUrl: {
|
|
2095
|
-
type: 'primitive',
|
|
2096
|
-
value: 'string',
|
|
2097
|
-
optional: true
|
|
2098
|
-
},
|
|
2099
|
-
clientId: {
|
|
2080
|
+
context: chatContextSchema,
|
|
2081
|
+
everywhere: {
|
|
2100
2082
|
type: 'primitive',
|
|
2101
|
-
value: '
|
|
2083
|
+
value: 'boolean',
|
|
2102
2084
|
optional: true
|
|
2103
2085
|
},
|
|
2104
|
-
|
|
2105
|
-
type: '
|
|
2106
|
-
|
|
2107
|
-
|
|
2086
|
+
capabilities: {
|
|
2087
|
+
type: 'object',
|
|
2088
|
+
optional: true,
|
|
2089
|
+
allowUnknownProperties: true,
|
|
2090
|
+
properties: {}
|
|
2108
2091
|
},
|
|
2109
|
-
|
|
2092
|
+
// @deprecated - kept for backward compatibility
|
|
2093
|
+
entryId: {
|
|
2110
2094
|
type: 'primitive',
|
|
2111
2095
|
value: 'string',
|
|
2112
|
-
optional: true
|
|
2096
|
+
optional: true,
|
|
2097
|
+
deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
|
|
2113
2098
|
},
|
|
2114
|
-
|
|
2099
|
+
kalturaServerURI: {
|
|
2115
2100
|
type: 'primitive',
|
|
2116
2101
|
value: 'string',
|
|
2117
2102
|
optional: true
|
|
2118
2103
|
},
|
|
2119
|
-
|
|
2104
|
+
partnerId: {
|
|
2120
2105
|
type: 'primitive',
|
|
2121
2106
|
value: 'string',
|
|
2122
2107
|
optional: true
|
|
2123
2108
|
},
|
|
2124
|
-
|
|
2109
|
+
uiConfId: {
|
|
2125
2110
|
type: 'primitive',
|
|
2126
2111
|
value: 'string',
|
|
2127
2112
|
optional: true
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
};
|
|
2116
|
+
const featuresSchema = {
|
|
2117
|
+
type: 'object',
|
|
2118
|
+
optional: true,
|
|
2119
|
+
properties: {
|
|
2120
|
+
screenShare: {
|
|
2130
2121
|
type: 'primitive',
|
|
2131
2122
|
value: 'boolean',
|
|
2132
2123
|
optional: true
|
|
2133
2124
|
},
|
|
2134
|
-
|
|
2125
|
+
chat: {
|
|
2135
2126
|
type: 'primitive',
|
|
2136
2127
|
value: 'boolean',
|
|
2137
2128
|
optional: true
|
|
2138
2129
|
},
|
|
2139
|
-
|
|
2140
|
-
type: '
|
|
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',
|
|
2130
|
+
captions: {
|
|
2131
|
+
type: 'or',
|
|
2184
2132
|
optional: true,
|
|
2185
|
-
properties: {
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2133
|
+
properties: [{
|
|
2134
|
+
type: 'primitive',
|
|
2135
|
+
value: 'boolean'
|
|
2136
|
+
}, {
|
|
2137
|
+
type: 'object',
|
|
2138
|
+
allowUnknownProperties: true,
|
|
2139
|
+
properties: {}
|
|
2140
|
+
}]
|
|
2141
|
+
},
|
|
2142
|
+
kickOffPhrase: {
|
|
2143
|
+
type: 'primitive',
|
|
2144
|
+
value: 'string',
|
|
2145
|
+
optional: true
|
|
2197
2146
|
}
|
|
2198
2147
|
}
|
|
2199
2148
|
};
|
|
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
|
+
};
|
|
2200
2245
|
|
|
2201
2246
|
const avatarRuntimeChatVisualSettingsSchema = {
|
|
2202
2247
|
type: 'object',
|
|
@@ -3211,6 +3256,17 @@ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
|
3211
3256
|
|
|
3212
3257
|
const SUPPORTED_LAYOUT_TYPES = new Set(['cinema', 'focusContent', 'balanced', 'floatingCorner', 'fullscreenContent']);
|
|
3213
3258
|
|
|
3259
|
+
const avatarRuntimeHeadFloaterVisualSettingsSchema = {
|
|
3260
|
+
type: 'object',
|
|
3261
|
+
properties: {
|
|
3262
|
+
schemaVersion: {
|
|
3263
|
+
type: 'literal',
|
|
3264
|
+
value: '1',
|
|
3265
|
+
optional: true
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
};
|
|
3269
|
+
|
|
3214
3270
|
const blockVisualContextSchema = {
|
|
3215
3271
|
type: 'object',
|
|
3216
3272
|
optional: true,
|
|
@@ -3251,4 +3307,4 @@ const useTranslation = createUseTranslation({
|
|
|
3251
3307
|
supportedLanguages
|
|
3252
3308
|
});
|
|
3253
3309
|
|
|
3254
|
-
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, 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, schemaVersionSchema, shareUrlSchema, useTranslation, widgetName };
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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;
|
|
@@ -19,4 +23,8 @@ export interface AvatarServiceType extends UnisphereService {
|
|
|
19
23
|
getEntrySourceUrl(entryId: string, startTime?: number): string;
|
|
20
24
|
clearContent(): void;
|
|
21
25
|
askViaText(question: string): void;
|
|
26
|
+
onWebsocketEvents: {
|
|
27
|
+
system: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
28
|
+
app: TinyPubSub<AvatarWebsocketEvent>['consumer'];
|
|
29
|
+
};
|
|
22
30
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TinyDataStoreConsumer, ValidatorSchema } from '@unisphere/core';
|
|
1
|
+
import { TinyDataStoreConsumer, TinyPubSub, 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 } from './shared-types';
|
|
5
6
|
/** Runtime name constant for avatar experiences */
|
|
6
7
|
export declare const AvatarRuntimeName: "avatar";
|
|
7
8
|
/**
|
|
@@ -32,47 +33,32 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
|
|
|
32
33
|
setThreadId(id: string | null): void;
|
|
33
34
|
/** Sync preview mode flag from the chat customization settings */
|
|
34
35
|
setIsPreviewMode(value: boolean): void;
|
|
36
|
+
/** Observable mute state */
|
|
37
|
+
isMuted: TinyDataStoreConsumer<boolean>;
|
|
38
|
+
/** Mute the avatar audio */
|
|
39
|
+
mute(): void;
|
|
40
|
+
/** Unmute the avatar audio */
|
|
41
|
+
unmute(): void;
|
|
42
|
+
/** Send a text question to the avatar */
|
|
43
|
+
askViaText(question: string): void;
|
|
44
|
+
/** Send setDynamicPrompt event to the CM */
|
|
45
|
+
setDynamicPrompt(data: unknown): void;
|
|
46
|
+
/**
|
|
47
|
+
* Subscribe to tool-call events from the avatar's WebSocket.
|
|
48
|
+
* Emits for every tool call (e.g. navigate_to_slide) without interfering
|
|
49
|
+
* with internal GenUI rendering. The host app can register handlers to
|
|
50
|
+
* react to specific tool names.
|
|
51
|
+
*/
|
|
52
|
+
readonly onToolCall: TinyPubSub<AvatarToolCallEvent>['consumer'];
|
|
35
53
|
};
|
|
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;
|
|
54
|
+
/** Event emitted when the avatar brain invokes a tool call */
|
|
55
|
+
export interface AvatarToolCallEvent {
|
|
56
|
+
/** Tool name (e.g. 'navigate_to_slide', 'create_slide') */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Tool arguments parsed from the YAML/JSON content */
|
|
59
|
+
args: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
export type AvatarServerConfig = {
|
|
76
62
|
/** TURN server URL for WebRTC connectivity */
|
|
77
63
|
turnServerUrl: string;
|
|
78
64
|
/** Avatar service server URL */
|
|
@@ -97,6 +83,12 @@ export interface AvatarRuntimeSettings {
|
|
|
97
83
|
noiseReductionEnabled?: boolean;
|
|
98
84
|
/** Genie service server URL */
|
|
99
85
|
genieServerUrl?: string;
|
|
86
|
+
/** Kaltura sesssion */
|
|
87
|
+
ks: string;
|
|
88
|
+
};
|
|
89
|
+
export type AvatarRuntimeSettings = {
|
|
90
|
+
/** Settings schema version */
|
|
91
|
+
schemaVersion?: string;
|
|
100
92
|
/** Kaltura service integration settings */
|
|
101
93
|
kaltura: {
|
|
102
94
|
/** Kaltura session token for authentication */
|
|
@@ -120,6 +112,14 @@ export interface AvatarRuntimeSettings {
|
|
|
120
112
|
screenShare?: boolean;
|
|
121
113
|
/** Enable chat */
|
|
122
114
|
chat?: boolean;
|
|
115
|
+
/** Enable captions; pass CaptionConfig object for fine-grained control */
|
|
116
|
+
captions?: boolean | CaptionConfig;
|
|
117
|
+
/** Phrase sent automatically when avatar signals a blank kickoff turn */
|
|
118
|
+
kickOffPhrase?: string;
|
|
123
119
|
};
|
|
124
|
-
}
|
|
120
|
+
} & (({
|
|
121
|
+
serverConfig?: 'manual';
|
|
122
|
+
} & AvatarServerConfig) | {
|
|
123
|
+
serverConfig: 'studio';
|
|
124
|
+
});
|
|
125
125
|
export declare const avatarRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -98,6 +98,32 @@ 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
|
+
}
|
|
101
127
|
/**
|
|
102
128
|
* Internal avatar connection proxy interface for advanced operations.
|
|
103
129
|
*
|
|
@@ -175,6 +201,8 @@ export interface AvatarConnectionProxyType {
|
|
|
175
201
|
readonly screenShareInfo: TinyDataStoreConsumer<AgentScreenShareInfo | null>;
|
|
176
202
|
/** Observable form paused state */
|
|
177
203
|
readonly isAvatarPaused: TinyDataStoreConsumer<boolean>;
|
|
204
|
+
/** Observable caption display state — null when feature is disabled */
|
|
205
|
+
readonly captions: TinyDataStoreConsumer<CaptionState | null>;
|
|
178
206
|
/** Unique connection identifier */
|
|
179
207
|
readonly id: string;
|
|
180
208
|
/** Send text message to avatar */
|
|
@@ -195,5 +223,11 @@ export interface AvatarConnectionProxyType {
|
|
|
195
223
|
pauseAvatarAfterSpeaking(): void;
|
|
196
224
|
/** Clear current visual content */
|
|
197
225
|
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;
|
|
198
232
|
}
|
|
199
233
|
export declare const isAvatarConnectionProxyInternalType: (x: any) => x is AvatarConnectionProxInternalType;
|
|
@@ -18,9 +18,6 @@ export interface LayoutConfig {
|
|
|
18
18
|
type: LayoutType;
|
|
19
19
|
background?: string;
|
|
20
20
|
}
|
|
21
|
-
export interface ChatConfig {
|
|
22
|
-
disableInput?: boolean;
|
|
23
|
-
}
|
|
24
21
|
export interface VisualBehavior {
|
|
25
22
|
pauseAfterSpeaking?: boolean;
|
|
26
23
|
pauseImmediately?: boolean;
|
|
@@ -28,12 +25,10 @@ export interface VisualBehavior {
|
|
|
28
25
|
export interface VisualTypeConfig {
|
|
29
26
|
behavior?: VisualBehavior;
|
|
30
27
|
layout?: LayoutConfig;
|
|
31
|
-
chat?: ChatConfig;
|
|
32
28
|
slots?: Partial<Record<SlotType, SlotConfig>>;
|
|
33
29
|
}
|
|
34
30
|
export interface ResolvedCapabilities {
|
|
35
31
|
layout?: LayoutConfig;
|
|
36
|
-
chat?: ChatConfig;
|
|
37
32
|
slots: Partial<Record<SlotType, SlotEntry[]>>;
|
|
38
33
|
}
|
|
39
34
|
export interface ActionContext {
|
|
@@ -43,5 +38,5 @@ export interface ActionContext {
|
|
|
43
38
|
content: AvatarContentData | null;
|
|
44
39
|
}
|
|
45
40
|
export interface AvatarVisualBridgeType extends UnisphereVisualBridgeType<VisualTypeConfig, ResolvedCapabilities> {
|
|
46
|
-
getActionContext(): ActionContext;
|
|
41
|
+
getActionContext(): ActionContext | null;
|
|
47
42
|
}
|
|
@@ -52,8 +52,6 @@ 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;
|
|
57
55
|
/** Observable for fetching thread messages */
|
|
58
56
|
getThreadMessages: TinyPubSub<{
|
|
59
57
|
/** Optional thread ID to fetch messages from */
|