@unisphere/genie-types 1.47.3 → 1.47.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 +5 -1
- package/package.json +3 -3
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +5 -1
- package/src/lib/avatar-runtime/runtime-types.d.ts +9 -3
- package/src/lib/avatar-runtime/shared-types.d.ts +7 -5
- package/src/lib/chat-runtime/shared-settings.d.ts +6 -3
- package/src/lib/shared/genie-chat-service-types.d.ts +2 -2
- package/src/lib/shared/genie-thread-service-types.d.ts +25 -0
- package/src/lib/shared/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -2628,9 +2628,11 @@ const avatarRuntimeSettingsSchema = {
|
|
|
2628
2628
|
value: 'manual',
|
|
2629
2629
|
optional: true
|
|
2630
2630
|
},
|
|
2631
|
+
// Legacy fallback host, used only when conversation-manager sends no TURN credentials (SECF-30947).
|
|
2631
2632
|
turnServerUrl: {
|
|
2632
2633
|
type: 'primitive',
|
|
2633
|
-
value: 'string'
|
|
2634
|
+
value: 'string',
|
|
2635
|
+
optional: true
|
|
2634
2636
|
},
|
|
2635
2637
|
srsBaseUrl: {
|
|
2636
2638
|
type: 'primitive',
|
|
@@ -2690,6 +2692,7 @@ const avatarRuntimeSettingsSchema = {
|
|
|
2690
2692
|
value: 'string',
|
|
2691
2693
|
optional: true
|
|
2692
2694
|
},
|
|
2695
|
+
getSourceUrl: getSourceUrlSchema,
|
|
2693
2696
|
kaltura: kalturaSchema,
|
|
2694
2697
|
features: featuresSchema,
|
|
2695
2698
|
multipleAvatarBehavior: multipleAvatarBehaviorSchema
|
|
@@ -2718,6 +2721,7 @@ const avatarRuntimeSettingsSchema = {
|
|
|
2718
2721
|
value: 'string',
|
|
2719
2722
|
optional: true
|
|
2720
2723
|
},
|
|
2724
|
+
getSourceUrl: getSourceUrlSchema,
|
|
2721
2725
|
kaltura: kalturaSchema,
|
|
2722
2726
|
features: featuresSchema,
|
|
2723
2727
|
multipleAvatarBehavior: multipleAvatarBehaviorSchema
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisphere/genie-types",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.5",
|
|
4
4
|
"author": "kaltura",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"types": "./src/index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@kaltura-sdk/rtc-core": "^1.
|
|
13
|
-
"@unisphere/core": "^1.
|
|
12
|
+
"@kaltura-sdk/rtc-core": "^1.27.0",
|
|
13
|
+
"@unisphere/core": "^1.103.0",
|
|
14
14
|
"@unisphere/runtime": "^1.98.0",
|
|
15
15
|
"@unisphere/runtime-js": "^1.98.0"
|
|
16
16
|
},
|
|
@@ -36,7 +36,11 @@ export interface AvatarServiceType extends UnisphereService {
|
|
|
36
36
|
uiConfId: string;
|
|
37
37
|
ks: string;
|
|
38
38
|
} | null;
|
|
39
|
-
|
|
39
|
+
/** Present only when the host provided a source URL resolver */
|
|
40
|
+
getEntrySourceUrl?: (entryId: string, startTime?: number) => string | {
|
|
41
|
+
url: string;
|
|
42
|
+
target: string;
|
|
43
|
+
};
|
|
40
44
|
clearContent(): void;
|
|
41
45
|
askViaText(question: string): void;
|
|
42
46
|
/** Start a tap-to-talk recording. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TinyDataStoreConsumer, ValidatorSchema } from '@unisphere/core';
|
|
2
2
|
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
3
|
import { widgetName } from '../widget-types';
|
|
4
|
-
import { ChatContext, GenieCapabilities } from '../chat-runtime/shared-settings';
|
|
4
|
+
import { ChatContext, GenieCapabilities, GlobalChatSettings } from '../chat-runtime/shared-settings';
|
|
5
5
|
import { AgentData, AgentScreenShareInfo, AgentTapToTalkInfo, AvatarConnectionStatus, CaptionConfig, CaptionState, DisconnectReasons, MultipleAvatarBehavior } from './shared-types';
|
|
6
6
|
import { ChatEntry } from './chat-types';
|
|
7
7
|
/** Runtime name constant for avatar experiences */
|
|
@@ -120,8 +120,12 @@ export interface AvatarToolCallEvent {
|
|
|
120
120
|
args: Record<string, unknown>;
|
|
121
121
|
}
|
|
122
122
|
export type AvatarServerConfig = {
|
|
123
|
-
/**
|
|
124
|
-
|
|
123
|
+
/**
|
|
124
|
+
* TURN host (no scheme or port) for the legacy static-credentials fallback. Used only when
|
|
125
|
+
* conversation-manager sends no TURN credentials; otherwise its credentials replace it.
|
|
126
|
+
* @deprecated Temporary (SECF-30947); remove once every conversation-manager sends TURN credentials.
|
|
127
|
+
*/
|
|
128
|
+
turnServerUrl?: string;
|
|
125
129
|
/** Avatar service server URL */
|
|
126
130
|
serverUrl: string;
|
|
127
131
|
/** SRS (Simple Realtime Server) base URL for media streaming */
|
|
@@ -197,6 +201,8 @@ export type AvatarRuntimeSettings = {
|
|
|
197
201
|
};
|
|
198
202
|
/** Full URL to POST client-tool-call responses to (e.g. `https://genie.example.com/assistant/tool_response`). Required for client tool calls to receive a response. Applies to both `manual` and `studio` modes. */
|
|
199
203
|
clientToolResponseUrl?: string;
|
|
204
|
+
/** Callback to generate source URLs for an entry. When absent, source links are not shown. */
|
|
205
|
+
getSourceUrl?: GlobalChatSettings['getSourceUrl'];
|
|
200
206
|
/** What happens when several avatars share the page and one is already in a call. Defaults to `{ preventDisconnections: false }`. */
|
|
201
207
|
multipleAvatarBehavior?: MultipleAvatarBehavior;
|
|
202
208
|
} & (({
|
|
@@ -263,8 +263,6 @@ export interface AvatarConnectionProxyType {
|
|
|
263
263
|
readonly sessionId: TinyDataStoreConsumer<string | null>;
|
|
264
264
|
/** Observable cast mode from server */
|
|
265
265
|
readonly castMode: TinyDataStoreConsumer<string | null>;
|
|
266
|
-
/** Observable TURN server URL */
|
|
267
|
-
readonly turnServerURL: TinyDataStoreConsumer<string | null>;
|
|
268
266
|
/** Observable content data */
|
|
269
267
|
readonly content: TinyDataStoreConsumer<AvatarContentData | null>;
|
|
270
268
|
/** Observable agent state and analytics */
|
|
@@ -366,8 +364,6 @@ export interface AvatarClientManagerType {
|
|
|
366
364
|
readonly sessionId: TinyDataStoreConsumer<string | null>;
|
|
367
365
|
/** Observable cast mode from server */
|
|
368
366
|
readonly castMode: TinyDataStoreConsumer<string | null>;
|
|
369
|
-
/** Observable TURN server URL */
|
|
370
|
-
readonly turnServerURL: TinyDataStoreConsumer<string | null>;
|
|
371
367
|
/** Observable disconnect information */
|
|
372
368
|
readonly disconnectData: TinyDataStoreConsumer<{
|
|
373
369
|
reason: DisconnectReasons;
|
|
@@ -453,7 +449,7 @@ export interface AvatarClientManagerType {
|
|
|
453
449
|
readonly clientToolCallLog: TinyDataStoreConsumer<ClientToolCallLogEntry[]>;
|
|
454
450
|
/** Observable persistent thread identifier */
|
|
455
451
|
readonly threadId: TinyDataStoreConsumer<string | null>;
|
|
456
|
-
/**
|
|
452
|
+
/** @deprecated only writes the `threadId` store; it does not affect `connect()`. Pass `connect({ context })` instead. */
|
|
457
453
|
setExternalThreadId(id: string | null): void;
|
|
458
454
|
/** Observable preview mode flag */
|
|
459
455
|
readonly isPreviewMode: TinyDataStoreConsumer<boolean>;
|
|
@@ -498,6 +494,12 @@ export interface AvatarClientManagerType {
|
|
|
498
494
|
readonly devicesList: TinyDataStoreConsumer<UserDevicesList | null>;
|
|
499
495
|
joinSTV(videoContainerId: string, sessionId: string, stvUrl: string, onConnected: () => void): Promise<void>;
|
|
500
496
|
leaveSTV(): void;
|
|
497
|
+
/** Latest server-issued TURN credentials; read at connection time, never cache or log them. */
|
|
498
|
+
getTurnCredentials(): {
|
|
499
|
+
url: string;
|
|
500
|
+
username: string;
|
|
501
|
+
credential: string;
|
|
502
|
+
} | null;
|
|
501
503
|
changeDevice(deviceType: DeviceType, deviceId: string): Promise<boolean>;
|
|
502
504
|
toggleMuteAudio(muted: boolean): Promise<void>;
|
|
503
505
|
onPlayerReady(): void;
|
|
@@ -49,7 +49,6 @@ export interface ChatBranding {
|
|
|
49
49
|
* ```typescript
|
|
50
50
|
* const integration: AvatarIntegration = {
|
|
51
51
|
* type: 'config',
|
|
52
|
-
* turnServerUrl: 'https://turn.example.com',
|
|
53
52
|
* serverUrl: 'https://avatar.example.com',
|
|
54
53
|
* srsBaseUrl: 'https://srs.example.com',
|
|
55
54
|
* clientId: 'client-123',
|
|
@@ -70,8 +69,12 @@ export interface ChatBranding {
|
|
|
70
69
|
export type AvatarIntegration = {
|
|
71
70
|
/** Configuration type: 'config' for manual setup */
|
|
72
71
|
type: 'config';
|
|
73
|
-
/**
|
|
74
|
-
|
|
72
|
+
/**
|
|
73
|
+
* TURN host for the legacy static-credentials fallback, used only when conversation-manager
|
|
74
|
+
* sends no TURN credentials.
|
|
75
|
+
* @deprecated Temporary (SECF-30947); remove once every conversation-manager sends TURN credentials.
|
|
76
|
+
*/
|
|
77
|
+
turnServerUrl?: string;
|
|
75
78
|
/** Avatar service server URL */
|
|
76
79
|
serverUrl: string;
|
|
77
80
|
/** SRS (Simple Realtime Server) base URL */
|
|
@@ -37,8 +37,8 @@ export interface GenieChatServiceType extends UnisphereService {
|
|
|
37
37
|
getClipPlayerUrl?: (source: ClassGenieGetClipPlayerUrlData) => string | null;
|
|
38
38
|
/** Generate poster/thumbnail URL for video clip */
|
|
39
39
|
getClipPlayerPosterUrl: (source: ClassGenieGetClipPlayerPosterUrlData) => string;
|
|
40
|
-
/** Generate source URL for media entry with optional start time */
|
|
41
|
-
getEntrySourceUrl
|
|
40
|
+
/** Generate source URL for media entry with optional start time. Present only when the host provided a source URL resolver */
|
|
41
|
+
getEntrySourceUrl?: (entryId: string, startTime?: number) => string | {
|
|
42
42
|
url: string;
|
|
43
43
|
target: string;
|
|
44
44
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UnisphereService } from '@unisphere/runtime';
|
|
2
|
+
import { TinyDataStoreConsumer, TinyPubSub } from '@unisphere/core';
|
|
3
|
+
/** Who wrote the thread id. Subscribers use it (with `source`) to skip their own writes. */
|
|
4
|
+
export type ThreadOrigin = 'chat' | 'avatar' | 'host';
|
|
5
|
+
export type ThreadIdChange = {
|
|
6
|
+
threadId: string | null;
|
|
7
|
+
previous: string | null;
|
|
8
|
+
origin: ThreadOrigin;
|
|
9
|
+
/** Identifies the individual writer within an origin (e.g. one chat machine of several in a workspace) */
|
|
10
|
+
source?: unknown;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Single source of truth for the active thread id, shared by the chat and
|
|
14
|
+
* avatar runtimes (either one may be absent). Whichever runtime is created
|
|
15
|
+
* first registers it on the workspace.
|
|
16
|
+
*/
|
|
17
|
+
export interface GenieThreadServiceType extends UnisphereService {
|
|
18
|
+
id: 'unisphere.widget.genie.thread-id';
|
|
19
|
+
/** `null` = no thread yet / new thread */
|
|
20
|
+
threadId: TinyDataStoreConsumer<string | null>;
|
|
21
|
+
/** Emits only on a real change */
|
|
22
|
+
changes: TinyPubSub<ThreadIdChange>;
|
|
23
|
+
/** No-op when the value is unchanged, so echo loops cannot form */
|
|
24
|
+
set(threadId: string | null, origin: ThreadOrigin, source?: unknown): void;
|
|
25
|
+
}
|