@unisphere/genie-types 1.38.3 → 1.38.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/genie-types",
3
- "version": "1.38.3",
3
+ "version": "1.38.5",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
package/src/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './lib/avatar-runtime';
6
6
  export * from './lib/chat-customizations-types';
7
7
  export * from './lib/general-visual-types';
8
8
  export * from './lib/chat-thread-runtime';
9
+ export * from './lib/data-models';
@@ -2,7 +2,7 @@ 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 { AgentScreenShareInfo, AgentTapToTalkInfo, AvatarConnectionStatus, CaptionConfig, CaptionState } from './shared-types';
5
+ import { AgentData, AgentScreenShareInfo, AgentTapToTalkInfo, AvatarConnectionStatus, CaptionConfig, CaptionState } from './shared-types';
6
6
  import { ChatEntry } from './chat-types';
7
7
  /** Runtime name constant for avatar experiences */
8
8
  export declare const AvatarRuntimeName: "avatar";
@@ -81,7 +81,9 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
81
81
  setIsPreviewMode(value: boolean): void;
82
82
  /** Sync context selector visibility from the chat customization settings */
83
83
  setContextSelectorVisible(value: boolean): void;
84
- /** Observable mute state */
84
+ /** Observable mute state
85
+ * @deprecated Use `audioState` instead, which provides both mute and speaking state
86
+ */
85
87
  isMuted: TinyDataStoreConsumer<boolean>;
86
88
  /** Mute the avatar audio */
87
89
  mute(): void;
@@ -93,6 +95,13 @@ export type AvatarRuntime = UnisphereRuntimeBaseType<AvatarRuntimeSettings> & {
93
95
  updateDynamicVariables(variables: Record<string, unknown>): void;
94
96
  /** Observable chat log entries */
95
97
  chatLog: TinyDataStoreConsumer<ChatEntry[]>;
98
+ /** Observable audio state (muted, speaking) */
99
+ audioState: TinyDataStoreConsumer<{
100
+ muted: boolean;
101
+ isSpeaking: boolean;
102
+ }>;
103
+ /** Observable agent data */
104
+ agentData: TinyDataStoreConsumer<AgentData>;
96
105
  };
97
106
  /** Event emitted when the avatar brain invokes a tool call */
98
107
  export interface AvatarToolCallEvent {
@@ -298,7 +298,7 @@ export interface AvatarConnectionProxyType {
298
298
  }
299
299
  export declare const isAvatarConnectionProxyInternalType: (x: any) => x is AvatarConnectionProxInternalType;
300
300
  /**
301
- * Public surface of `AvatarClientManager` (from `@local/genie-avatar-client-react`).
301
+ * Public surface of `AvatarClientManager` (from `@kaltura-sdk/avatar-client`).
302
302
  * Import this instead of the concrete class when a consumer only needs to
303
303
  * read state or call the public API — e.g. UI components, other packages.
304
304
  * Supersedes the deprecated `AvatarConnectionProxyType`/
@@ -0,0 +1,136 @@
1
+ export interface ClassGenieFlashCardElementBase {
2
+ title: string;
3
+ subTitle: string;
4
+ description?: string;
5
+ }
6
+ export type ClassGenieVideoGalleryVideoItem = {
7
+ type: 'video' | 'video-thumbnail';
8
+ title: string;
9
+ entryId: string;
10
+ duration?: number;
11
+ startTime: number;
12
+ endTime: number;
13
+ link: string | null;
14
+ similarityScore: number;
15
+ };
16
+ export type ClassGenieVideoGalleryFlashcard = {
17
+ type: 'videoGallery';
18
+ version: 1;
19
+ videos: ClassGenieVideoGalleryVideoItem[];
20
+ } & ClassGenieFlashCardElementBase;
21
+ export type ClassGenieTextFlashcard = {
22
+ version: 1;
23
+ type: 'text';
24
+ } & ClassGenieFlashCardElementBase;
25
+ export type ClassGenieFlashCard = ClassGenieVideoGalleryFlashcard | ClassGenieTextFlashcard;
26
+ export type ClassGenieFlashCardElement = {
27
+ version: 1;
28
+ type: 'flashcards';
29
+ totalCards: number;
30
+ cards: ClassGenieFlashCard[];
31
+ };
32
+ export type ClassGenieFollowupsElement = {
33
+ version: 1;
34
+ type: 'followups';
35
+ followups: string[];
36
+ };
37
+ export type ClassGenieSourceVideoItem = {
38
+ type: 'video';
39
+ title: string;
40
+ entryId: string;
41
+ duration: number;
42
+ };
43
+ export type ClassGenieSourceDocumentItem = {
44
+ type: 'document';
45
+ title: string;
46
+ entryId: string;
47
+ };
48
+ export type ClassGenieSourceItem = ClassGenieSourceVideoItem | ClassGenieSourceDocumentItem;
49
+ export type ClassGenieSourcesElement = {
50
+ version: 1;
51
+ type: 'sources';
52
+ sources: ClassGenieSourceItem[];
53
+ };
54
+ export type ClassGenieElement = ClassGenieFlashCardElement | ClassGenieFollowupsElement | ClassGenieSourcesElement | string;
55
+ export type ClassGenieQuestionData = {
56
+ version: 1;
57
+ threadId: string;
58
+ question: string;
59
+ messageId?: string;
60
+ elements: ClassGenieElement[];
61
+ isFinal?: boolean;
62
+ };
63
+ export interface QuestionTitleBlock {
64
+ type: 'question-title';
65
+ title: string;
66
+ contextId?: string;
67
+ contextType?: 'entry' | 'category';
68
+ contextTitle?: string;
69
+ contextImageUrl?: string;
70
+ isContextActive?: boolean;
71
+ }
72
+ export interface MarkdownBlock {
73
+ type: 'markdown';
74
+ status: 'ready';
75
+ content: string;
76
+ }
77
+ export interface AvatarBlock {
78
+ type: 'avatar';
79
+ status: 'ready';
80
+ content: string;
81
+ }
82
+ export type UnisphereToolBlock = {
83
+ type: 'unisphere-tool';
84
+ widgetName: string;
85
+ runtimeName: string;
86
+ } & ({
87
+ status: 'loading' | 'ready';
88
+ settings: any;
89
+ threadId?: string;
90
+ } | {
91
+ status: 'error';
92
+ });
93
+ export type UnisphereErrorBlock = {
94
+ type: 'error';
95
+ content?: string;
96
+ shouldDisplayDefaultMessage?: boolean;
97
+ shouldDisplayRetryButton?: boolean;
98
+ retryThreadId?: string;
99
+ };
100
+ export type UnisphereSocialActionsBlock = {
101
+ type: 'social-actions';
102
+ data: {
103
+ question: string;
104
+ isFinal: boolean;
105
+ translucent?: boolean;
106
+ isShareable?: boolean;
107
+ };
108
+ };
109
+ export type OAuthRequiredBlock = {
110
+ type: 'oauth-required';
111
+ toolDisplayName: string;
112
+ authUrl: string;
113
+ };
114
+ export type AvatarSummaryBlock = {
115
+ type: 'avatar-summary';
116
+ socketId: string;
117
+ summary?: string;
118
+ summaryContentType?: 'text' | 'html' | 'html_with_js';
119
+ sessionDuration?: number;
120
+ avatarSessionGroups?: UnisphereChatBlock[][];
121
+ };
122
+ type UnisphereChatBlockBase = {
123
+ id: string;
124
+ threadId?: string;
125
+ messageId?: string;
126
+ speechId?: string;
127
+ newTitle?: string;
128
+ isShareable?: boolean;
129
+ };
130
+ export type UnisphereChatBlock = UnisphereChatBlockBase & (QuestionTitleBlock | MarkdownBlock | AvatarBlock | UnisphereToolBlock | UnisphereErrorBlock | UnisphereSocialActionsBlock | OAuthRequiredBlock | AvatarSummaryBlock);
131
+ export type ChatRateAnswerData = {
132
+ isPositive: boolean;
133
+ comment?: string;
134
+ messageId: string;
135
+ };
136
+ export {};