@unisphere/genie-types 1.47.3 → 1.47.4
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 +2 -0
- package/package.json +1 -1
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +5 -1
- package/src/lib/avatar-runtime/runtime-types.d.ts +3 -1
- package/src/lib/avatar-runtime/shared-types.d.ts +1 -1
- 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
|
@@ -2690,6 +2690,7 @@ const avatarRuntimeSettingsSchema = {
|
|
|
2690
2690
|
value: 'string',
|
|
2691
2691
|
optional: true
|
|
2692
2692
|
},
|
|
2693
|
+
getSourceUrl: getSourceUrlSchema,
|
|
2693
2694
|
kaltura: kalturaSchema,
|
|
2694
2695
|
features: featuresSchema,
|
|
2695
2696
|
multipleAvatarBehavior: multipleAvatarBehaviorSchema
|
|
@@ -2718,6 +2719,7 @@ const avatarRuntimeSettingsSchema = {
|
|
|
2718
2719
|
value: 'string',
|
|
2719
2720
|
optional: true
|
|
2720
2721
|
},
|
|
2722
|
+
getSourceUrl: getSourceUrlSchema,
|
|
2721
2723
|
kaltura: kalturaSchema,
|
|
2722
2724
|
features: featuresSchema,
|
|
2723
2725
|
multipleAvatarBehavior: multipleAvatarBehaviorSchema
|
package/package.json
CHANGED
|
@@ -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 */
|
|
@@ -197,6 +197,8 @@ export type AvatarRuntimeSettings = {
|
|
|
197
197
|
};
|
|
198
198
|
/** 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
199
|
clientToolResponseUrl?: string;
|
|
200
|
+
/** Callback to generate source URLs for an entry. When absent, source links are not shown. */
|
|
201
|
+
getSourceUrl?: GlobalChatSettings['getSourceUrl'];
|
|
200
202
|
/** What happens when several avatars share the page and one is already in a call. Defaults to `{ preventDisconnections: false }`. */
|
|
201
203
|
multipleAvatarBehavior?: MultipleAvatarBehavior;
|
|
202
204
|
} & (({
|
|
@@ -453,7 +453,7 @@ export interface AvatarClientManagerType {
|
|
|
453
453
|
readonly clientToolCallLog: TinyDataStoreConsumer<ClientToolCallLogEntry[]>;
|
|
454
454
|
/** Observable persistent thread identifier */
|
|
455
455
|
readonly threadId: TinyDataStoreConsumer<string | null>;
|
|
456
|
-
/**
|
|
456
|
+
/** @deprecated only writes the `threadId` store; it does not affect `connect()`. Pass `connect({ context })` instead. */
|
|
457
457
|
setExternalThreadId(id: string | null): void;
|
|
458
458
|
/** Observable preview mode flag */
|
|
459
459
|
readonly isPreviewMode: TinyDataStoreConsumer<boolean>;
|
|
@@ -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
|
+
}
|