@unisphere/genie-types 1.13.1 → 1.14.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/README.md +1 -175
- package/index.esm.js +644 -5
- package/package.json +4 -4
- package/src/index.d.ts +3 -0
- package/src/lib/admin-demo-runtime/runtime-types.d.ts +9 -0
- package/src/lib/admin-runtime/runtime-types.d.ts +25 -0
- package/src/lib/application-runtime/runtime-types.d.ts +36 -0
- package/src/lib/avatar-runtime/agent-visual-types.d.ts +18 -0
- package/src/lib/avatar-runtime/avatar-service-types.d.ts +100 -3
- package/src/lib/avatar-runtime/chat-visual-types.d.ts +9 -0
- package/src/lib/avatar-runtime/contained-visual-types.d.ts +9 -0
- package/src/lib/avatar-runtime/index.d.ts +1 -0
- package/src/lib/avatar-runtime/lobby-visual-types.d.ts +35 -1
- package/src/lib/avatar-runtime/runtime-types.d.ts +71 -3
- package/src/lib/chat-runtime/runtime-flavors/runtime-player-plugin-types.d.ts +42 -0
- package/src/lib/chat-runtime/runtime-flavors/runtime-types.d.ts +60 -0
- package/src/lib/chat-runtime/shared-settings.d.ts +88 -0
- package/src/lib/chat-runtime/types.d.ts +1 -0
- package/src/lib/chat-runtime/visuals-types.d.ts +66 -0
- package/src/lib/content-gallery-tool-runtime/avatar-visual-types.d.ts +32 -0
- package/src/lib/content-gallery-tool-runtime/index.d.ts +2 -0
- package/src/lib/content-gallery-tool-runtime/runtime-types.d.ts +20 -0
- package/src/lib/flashcards-tool-runtime/runtime-types.d.ts +27 -0
- package/src/lib/flashcards-tool-runtime/visuals-types.d.ts +36 -0
- package/src/lib/followups-tool-runtime/avatar-visual-types.d.ts +18 -0
- package/src/lib/followups-tool-runtime/runtime-types.d.ts +31 -0
- package/src/lib/gen-ui-components-tool-runtime/card-visual-types.d.ts +39 -0
- package/src/lib/gen-ui-components-tool-runtime/index.d.ts +4 -0
- package/src/lib/gen-ui-components-tool-runtime/markdown-visual-types.d.ts +7 -0
- package/src/lib/gen-ui-components-tool-runtime/player-visual-types.d.ts +25 -0
- package/src/lib/gen-ui-components-tool-runtime/runtime-types.d.ts +13 -0
- package/src/lib/gen-ui-composer-tool-runtime/avatar-visual-types.d.ts +49 -0
- package/src/lib/gen-ui-composer-tool-runtime/index.d.ts +2 -0
- package/src/lib/gen-ui-composer-tool-runtime/runtime-types.d.ts +13 -0
- package/src/lib/gtc-agenda-list-tool-runtime/genie-answer-visual-types.d.ts +17 -2
- package/src/lib/gtc-agenda-list-tool-runtime/runtime-types.d.ts +15 -0
- package/src/lib/gtc-agenda-tool-runtime/genie-answer-visual-types.d.ts +13 -2
- package/src/lib/gtc-agenda-tool-runtime/runtime-types.d.ts +15 -0
- package/src/lib/kaltura-video-player-tool-runtime/genie-answer-visual-types.d.ts +13 -2
- package/src/lib/kaltura-video-player-tool-runtime/runtime-types.d.ts +23 -0
- package/src/lib/nvidia-2026-event-tool-runtime/runtime-types.d.ts +45 -0
- package/src/lib/shared/chat-customizations-types.d.ts +83 -0
- package/src/lib/shared/chat-tools-service-types.d.ts +52 -0
- package/src/lib/shared/general-visual-types.d.ts +19 -0
- package/src/lib/sources-tool-runtime/runtime-types.d.ts +38 -0
- package/src/lib/summary-tool-runtime/runtime-types.d.ts +55 -0
- package/src/lib/types.d.ts +66 -1
- package/src/lib/widget-types.d.ts +1 -0
|
@@ -3,30 +3,90 @@ import { ValidatorSchema } from '@unisphere/core';
|
|
|
3
3
|
import { widgetName } from '../../widget-types';
|
|
4
4
|
import { ChatRuntimeName } from '../types';
|
|
5
5
|
import { GlobalChatSettings } from '../shared-settings';
|
|
6
|
+
/**
|
|
7
|
+
* Chat runtime interface for Genie conversational AI experiences.
|
|
8
|
+
*
|
|
9
|
+
* Provides the core runtime for chat-based interactions with Genie's AI assistant,
|
|
10
|
+
* including conversation management, message handling, and integration features.
|
|
11
|
+
*/
|
|
6
12
|
export interface ChatRuntime extends UnisphereRuntimeBaseType<ChatRuntimeSettings> {
|
|
7
13
|
readonly widgetName: typeof widgetName;
|
|
8
14
|
readonly runtimeName: typeof ChatRuntimeName;
|
|
9
15
|
readonly flavor: '';
|
|
10
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Configuration settings for the chat runtime.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* Basic chat setup (required settings only):
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const settings: ChatRuntimeSettings = {
|
|
24
|
+
* ks: 'your-kaltura-session-token'
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* Advanced chat with custom features:
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const settings: ChatRuntimeSettings = {
|
|
32
|
+
* ks: 'your-kaltura-session-token',
|
|
33
|
+
* partnerId: '12345',
|
|
34
|
+
* entryId: 'entry_xyz',
|
|
35
|
+
* initialQuestion: 'Hello! How can I help?',
|
|
36
|
+
* integrations: {
|
|
37
|
+
* kaltura: {
|
|
38
|
+
* serverUrl: 'https://www.kaltura.com',
|
|
39
|
+
* uiConfId: '54321'
|
|
40
|
+
* }
|
|
41
|
+
* },
|
|
42
|
+
* customization: {
|
|
43
|
+
* breadcrumb: {
|
|
44
|
+
* root: {
|
|
45
|
+
* url: 'https://example.com',
|
|
46
|
+
* label: 'Home'
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* };
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
11
53
|
export interface ChatRuntimeSettings {
|
|
54
|
+
/** Kaltura session token for authentication */
|
|
12
55
|
ks: string;
|
|
56
|
+
/** Optional initial question to display when chat starts */
|
|
13
57
|
initialQuestion?: string;
|
|
58
|
+
/** Settings schema version, defaults to '1' */
|
|
14
59
|
schemaVersion?: '1';
|
|
60
|
+
/** Genie server URL for API requests */
|
|
15
61
|
genieServerUrl?: string;
|
|
62
|
+
/** Kaltura partner ID */
|
|
16
63
|
partnerId?: string;
|
|
64
|
+
/** Media entry ID for context-aware chat */
|
|
17
65
|
entryId?: string;
|
|
66
|
+
/** Enable agent mode for advanced AI features */
|
|
18
67
|
agentMode?: boolean;
|
|
68
|
+
/** Avatar display mode: 'dialog' for modal or 'contained' for embedded */
|
|
19
69
|
avatarContainerMode?: 'dialog' | 'contained';
|
|
70
|
+
/** Callback function to generate source URLs with entry ID and optional start time */
|
|
20
71
|
getSourceUrl?: GlobalChatSettings['getSourceUrl'];
|
|
72
|
+
/** Configuration for conversation sharing functionality */
|
|
21
73
|
shareUrl?: GlobalChatSettings['shareUrl'];
|
|
74
|
+
/** @deprecated Use visual settings or customization settings instead */
|
|
22
75
|
branding?: {
|
|
76
|
+
/** Display Kaltura logo in the chat interface */
|
|
23
77
|
kalturaLogo?: boolean;
|
|
24
78
|
};
|
|
79
|
+
/** External service integrations (Kaltura player, avatar) */
|
|
25
80
|
integrations?: GlobalChatSettings['integrations'];
|
|
81
|
+
/** UI customization options */
|
|
26
82
|
customization?: {
|
|
83
|
+
/** Breadcrumb navigation configuration */
|
|
27
84
|
breadcrumb?: {
|
|
85
|
+
/** Root breadcrumb item */
|
|
28
86
|
root?: {
|
|
87
|
+
/** URL for the root breadcrumb link */
|
|
29
88
|
url: string;
|
|
89
|
+
/** Display label for the root breadcrumb */
|
|
30
90
|
label: string;
|
|
31
91
|
};
|
|
32
92
|
};
|
|
@@ -1,37 +1,125 @@
|
|
|
1
1
|
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
/**
|
|
3
|
+
* Branding configuration for chat UI.
|
|
4
|
+
*/
|
|
2
5
|
export interface ChatBranding {
|
|
6
|
+
/** Display Kaltura logo in the chat interface */
|
|
3
7
|
kalturaLogo?: boolean;
|
|
4
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Avatar service integration configuration.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* Manual configuration:
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const integration: AvatarIntegration = {
|
|
16
|
+
* type: 'config',
|
|
17
|
+
* turnServerUrl: 'https://turn.example.com',
|
|
18
|
+
* serverUrl: 'https://avatar.example.com',
|
|
19
|
+
* srsBaseUrl: 'https://srs.example.com',
|
|
20
|
+
* clientId: 'client-123',
|
|
21
|
+
* roomId: 'room-456',
|
|
22
|
+
* flowId: 'flow-789'
|
|
23
|
+
* };
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* Automatic configuration via KS:
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const integration: AvatarIntegration = {
|
|
30
|
+
* type: 'byKS',
|
|
31
|
+
* previewImageUrl: 'https://example.com/avatar-preview.jpg'
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
5
35
|
export type AvatarIntegration = {
|
|
36
|
+
/** Configuration type: 'config' for manual setup */
|
|
6
37
|
type: 'config';
|
|
38
|
+
/** TURN server URL for WebRTC */
|
|
7
39
|
turnServerUrl: string;
|
|
40
|
+
/** Avatar service server URL */
|
|
8
41
|
serverUrl: string;
|
|
42
|
+
/** SRS (Simple Realtime Server) base URL */
|
|
9
43
|
srsBaseUrl: string;
|
|
44
|
+
/** Client identifier */
|
|
10
45
|
clientId: string;
|
|
46
|
+
/** Room identifier */
|
|
11
47
|
roomId: string;
|
|
48
|
+
/** Flow identifier */
|
|
12
49
|
flowId: string;
|
|
50
|
+
/** Loading video URL displayed during initialization */
|
|
13
51
|
loadingVideoURL?: string;
|
|
52
|
+
/** Preview image URL displayed before avatar loads */
|
|
53
|
+
previewImageUrl?: string;
|
|
14
54
|
} | {
|
|
55
|
+
/** Configuration type: 'byKS' for automatic setup using Kaltura session */
|
|
15
56
|
type: 'byKS';
|
|
57
|
+
/** Preview image URL displayed before avatar loads */
|
|
58
|
+
previewImageUrl?: string;
|
|
16
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Kaltura service integration configuration.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const integration: KalturaIntegration = {
|
|
66
|
+
* entryId: 'video_123'
|
|
67
|
+
* };
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
17
70
|
export interface KalturaIntegration {
|
|
71
|
+
/** Media entry ID for context */
|
|
18
72
|
entryId?: string;
|
|
19
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Global chat configuration settings shared across chat components.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const settings: GlobalChatSettings = {
|
|
80
|
+
* ks: 'your-kaltura-session-token',
|
|
81
|
+
* avatarContainerMode: 'dialog',
|
|
82
|
+
* getSourceUrl: ({ entryId, startTime }) =>
|
|
83
|
+
* `https://example.com/media/${entryId}${startTime ? `?t=${startTime}` : ''}`,
|
|
84
|
+
* shareUrl: {
|
|
85
|
+
* queryParam: 'msg',
|
|
86
|
+
* createUrl: ({ messageId }) =>
|
|
87
|
+
* `${window.location.href}?msg=${messageId}`
|
|
88
|
+
* },
|
|
89
|
+
* integrations: {
|
|
90
|
+
* kaltura: {
|
|
91
|
+
* entryId: 'video_123'
|
|
92
|
+
* }
|
|
93
|
+
* }
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
20
97
|
export interface GlobalChatSettings {
|
|
98
|
+
/** Kaltura session token for authentication */
|
|
21
99
|
ks: string;
|
|
100
|
+
/** Entry ID for context-aware features */
|
|
101
|
+
entryId?: string;
|
|
102
|
+
/** Callback function to generate source URLs with entry ID and optional start time */
|
|
22
103
|
getSourceUrl?: (params: {
|
|
23
104
|
entryId: string;
|
|
24
105
|
startTime?: number;
|
|
25
106
|
}) => string;
|
|
107
|
+
/** Configuration for conversation sharing */
|
|
26
108
|
shareUrl?: {
|
|
109
|
+
/** Query parameter name for message ID in shared URLs */
|
|
27
110
|
queryParam: string;
|
|
111
|
+
/** Callback to generate shareable URL for a message */
|
|
28
112
|
createUrl: (params: {
|
|
29
113
|
messageId: string;
|
|
30
114
|
}) => string;
|
|
31
115
|
};
|
|
116
|
+
/** Avatar display mode: 'dialog' for modal, 'contained' for embedded, or null */
|
|
32
117
|
avatarContainerMode: 'dialog' | 'contained' | null;
|
|
118
|
+
/** External service integrations */
|
|
33
119
|
integrations?: {
|
|
120
|
+
/** Avatar service integration */
|
|
34
121
|
avatar?: AvatarIntegration;
|
|
122
|
+
/** Kaltura service integration */
|
|
35
123
|
kaltura?: KalturaIntegration;
|
|
36
124
|
};
|
|
37
125
|
}
|
|
@@ -1,28 +1,94 @@
|
|
|
1
1
|
import { ValidatorSchema } from '@unisphere/core';
|
|
2
2
|
import { ChatCustomization } from '../shared/chat-customizations-types';
|
|
3
3
|
import { AnswerTypeEnum } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Visual settings for page-embedded chat experiences.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const settings: PageVisualSettings = {
|
|
10
|
+
* customization: {
|
|
11
|
+
* scroll: 'container',
|
|
12
|
+
* theme: { translucent: true }
|
|
13
|
+
* }
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
4
17
|
export interface PageVisualSettings {
|
|
18
|
+
/** Settings schema version */
|
|
5
19
|
schemaVersion?: '1';
|
|
20
|
+
/** Custom UI styling and behavior options */
|
|
6
21
|
customization?: ChatCustomization;
|
|
7
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Visual settings for banner/hero-style chat landing pages.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const settings: BannerVisualSettings = {
|
|
29
|
+
* title: 'Ask anything about this video',
|
|
30
|
+
* background: {
|
|
31
|
+
* type: 'url',
|
|
32
|
+
* url: 'https://example.com/banner.jpg'
|
|
33
|
+
* },
|
|
34
|
+
* predefinedQuestions: [
|
|
35
|
+
* {
|
|
36
|
+
* text: 'What are the key topics?',
|
|
37
|
+
* label: 'Key Topics',
|
|
38
|
+
* answerType: AnswerTypeEnum.GENERAL
|
|
39
|
+
* }
|
|
40
|
+
* ]
|
|
41
|
+
* };
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
8
44
|
export interface BannerVisualSettings {
|
|
45
|
+
/** Settings schema version */
|
|
9
46
|
schemaVersion?: '1';
|
|
47
|
+
/** Banner title text */
|
|
10
48
|
title?: string;
|
|
49
|
+
/** Background image configuration */
|
|
11
50
|
background?: {
|
|
51
|
+
/** Background type - currently only 'url' is supported */
|
|
12
52
|
type: 'url';
|
|
53
|
+
/** Image URL */
|
|
13
54
|
url: string;
|
|
14
55
|
};
|
|
56
|
+
/** Suggested questions to display on banner */
|
|
15
57
|
predefinedQuestions?: {
|
|
58
|
+
/** Question text sent to AI */
|
|
16
59
|
text: string;
|
|
60
|
+
/** Display label for the button */
|
|
17
61
|
label: string;
|
|
62
|
+
/** Preferred answer type */
|
|
18
63
|
answerType?: AnswerTypeEnum;
|
|
19
64
|
}[];
|
|
20
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Visual settings for popup/modal chat dialogs.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const settings: PopupVisualSettings = {
|
|
72
|
+
* customization: {
|
|
73
|
+
* scroll: 'modal'
|
|
74
|
+
* },
|
|
75
|
+
* initialQuestion: {
|
|
76
|
+
* question: 'Tell me about this topic',
|
|
77
|
+
* answerType: AnswerTypeEnum.GENERAL
|
|
78
|
+
* }
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
21
82
|
export interface PopupVisualSettings {
|
|
83
|
+
/** Settings schema version */
|
|
22
84
|
schemaVersion?: '1';
|
|
85
|
+
/** Custom UI styling and behavior options */
|
|
23
86
|
customization?: ChatCustomization;
|
|
87
|
+
/** Optional question to ask automatically when popup opens */
|
|
24
88
|
initialQuestion?: {
|
|
89
|
+
/** Question text */
|
|
25
90
|
question: string;
|
|
91
|
+
/** Preferred answer type */
|
|
26
92
|
answerType?: AnswerTypeEnum;
|
|
27
93
|
};
|
|
28
94
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
export interface VideoClip {
|
|
3
|
+
start_index: number;
|
|
4
|
+
last_index: number;
|
|
5
|
+
entry_id: string;
|
|
6
|
+
start_time: number;
|
|
7
|
+
end_time: number;
|
|
8
|
+
type: string;
|
|
9
|
+
thumbnail: string | null;
|
|
10
|
+
video_link: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface VideoSlide {
|
|
13
|
+
slide_type: 'video';
|
|
14
|
+
text: string | null;
|
|
15
|
+
citation: {
|
|
16
|
+
clips: VideoClip[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface TextSlide {
|
|
20
|
+
slide_type: 'text';
|
|
21
|
+
text: string;
|
|
22
|
+
citation: null;
|
|
23
|
+
}
|
|
24
|
+
export type Slide = VideoSlide | TextSlide;
|
|
25
|
+
export interface ContentGalleryToolRuntimeAvatarVisualSettings {
|
|
26
|
+
schemaVersion?: string;
|
|
27
|
+
slides: Slide[];
|
|
28
|
+
autoplay?: boolean;
|
|
29
|
+
slideDuration?: number;
|
|
30
|
+
loop?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const contentGalleryToolRuntimeAvatarVisualSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
|
+
import { widgetName } from '../widget-types';
|
|
4
|
+
export declare const ContentGalleryToolRuntimeName: "content-gallery-tool";
|
|
5
|
+
export type ContentGalleryToolRuntime = UnisphereRuntimeBaseType<ContentGalleryToolRuntimeSettings> & {
|
|
6
|
+
readonly widgetName: typeof widgetName;
|
|
7
|
+
readonly runtimeName: typeof ContentGalleryToolRuntimeName;
|
|
8
|
+
};
|
|
9
|
+
export interface ContentGalleryToolRuntimeSettings {
|
|
10
|
+
schemaVersion?: string;
|
|
11
|
+
/** Kaltura server URI */
|
|
12
|
+
kalturaServerURI: string;
|
|
13
|
+
/** Kaltura partner ID */
|
|
14
|
+
partnerId: string;
|
|
15
|
+
/** UI configuration ID */
|
|
16
|
+
uiConfId: string;
|
|
17
|
+
/** Kaltura session token for authentication */
|
|
18
|
+
ks: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const contentGalleryToolRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -2,13 +2,40 @@ import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
|
2
2
|
import { ValidatorSchema } from '@unisphere/core';
|
|
3
3
|
import { widgetName } from '../widget-types';
|
|
4
4
|
import { ChatCustomization } from '../shared/chat-customizations-types';
|
|
5
|
+
/** Runtime name constant for flashcards tool */
|
|
5
6
|
export declare const FlashcardsToolRuntimeName: "flashcards-tool";
|
|
7
|
+
/**
|
|
8
|
+
* Flashcards tool runtime interface for educational study aids.
|
|
9
|
+
*
|
|
10
|
+
* Provides interactive flashcard experiences for learning and knowledge reinforcement.
|
|
11
|
+
*/
|
|
6
12
|
export interface FlashcardsToolRuntime extends UnisphereRuntimeBaseType<FlashcardsToolRuntimeSettings> {
|
|
7
13
|
readonly widgetName: typeof widgetName;
|
|
8
14
|
readonly runtimeName: typeof FlashcardsToolRuntimeName;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuration settings for the flashcards tool runtime.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* Basic flashcards setup:
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const settings: FlashcardsToolRuntimeSettings = {};
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* With custom UI styling:
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const settings: FlashcardsToolRuntimeSettings = {
|
|
29
|
+
* customization: {
|
|
30
|
+
* // Custom chat UI settings
|
|
31
|
+
* }
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
10
35
|
export interface FlashcardsToolRuntimeSettings {
|
|
36
|
+
/** Settings schema version, defaults to '1' */
|
|
11
37
|
schemaVersion?: '1';
|
|
38
|
+
/** Custom UI styling and behavior options */
|
|
12
39
|
customization?: ChatCustomization;
|
|
13
40
|
}
|
|
14
41
|
export declare const flashcardsToolRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
import { ValidatorSchema } from '@unisphere/core';
|
|
2
2
|
import { CardsVideoDataType } from '../types';
|
|
3
3
|
import { BlockVisualContext } from '../shared/general-visual-types';
|
|
4
|
+
/**
|
|
5
|
+
* Visual settings for flashcard Genie answer display.
|
|
6
|
+
*
|
|
7
|
+
* Configures how flashcard answers are rendered, including title, summary,
|
|
8
|
+
* and key points with video citations.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const visualSettings: GenieAnswerVisualSettings = {
|
|
13
|
+
* title: 'Key Concepts',
|
|
14
|
+
* summary: 'Main ideas from the lesson',
|
|
15
|
+
* keypoints: [
|
|
16
|
+
* {
|
|
17
|
+
* title: 'Introduction',
|
|
18
|
+
* summary: 'Overview of the topic',
|
|
19
|
+
* citation: {
|
|
20
|
+
* clips: [{
|
|
21
|
+
* entry_id: 'video_123',
|
|
22
|
+
* start_time: 10,
|
|
23
|
+
* end_time: 30,
|
|
24
|
+
* thumbnail: 'https://example.com/thumb.jpg'
|
|
25
|
+
* }]
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ]
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
4
32
|
export interface GenieAnswerVisualSettings {
|
|
33
|
+
/** Visual block context for rendering */
|
|
5
34
|
blockContext?: BlockVisualContext;
|
|
35
|
+
/** Title for the answer display */
|
|
6
36
|
title?: string;
|
|
37
|
+
/** Summary text for the answer */
|
|
7
38
|
summary?: string;
|
|
39
|
+
/** Array of key points with optional video citations */
|
|
8
40
|
keypoints?: {
|
|
41
|
+
/** Title of the key point */
|
|
9
42
|
title?: string;
|
|
43
|
+
/** Summary text for the key point */
|
|
10
44
|
summary?: string;
|
|
45
|
+
/** Video citations supporting this key point */
|
|
11
46
|
citation?: {
|
|
47
|
+
/** Array of video clip references */
|
|
12
48
|
clips?: CardsVideoDataType[];
|
|
13
49
|
};
|
|
14
50
|
}[];
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import { ValidatorSchema } from '@unisphere/core';
|
|
2
2
|
import { BlockVisualContext } from '../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Visual settings for follow-up questions in avatar mode.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const visualSettings: FollowupsToolRuntimeAvatarVisualSettings = {
|
|
9
|
+
* questions: [
|
|
10
|
+
* 'Can you explain more?',
|
|
11
|
+
* 'What are the next steps?'
|
|
12
|
+
* ],
|
|
13
|
+
* onAction: (data) => console.log('Action triggered:', data)
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
3
17
|
export interface FollowupsToolRuntimeAvatarVisualSettings {
|
|
18
|
+
/** Settings schema version */
|
|
4
19
|
schemaVersion?: string;
|
|
20
|
+
/** Visual block context for rendering */
|
|
5
21
|
blockContext?: BlockVisualContext;
|
|
22
|
+
/** Array of suggested follow-up questions */
|
|
6
23
|
questions?: string[];
|
|
24
|
+
/** Callback function triggered when user selects a question */
|
|
7
25
|
onAction: (data: any) => void;
|
|
8
26
|
}
|
|
9
27
|
export declare const followupsToolRuntimeAvatarVisualSettingsSchema: ValidatorSchema;
|
|
@@ -2,17 +2,48 @@ import { ValidatorSchema } from '@unisphere/core';
|
|
|
2
2
|
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
3
|
import { widgetName } from '../widget-types';
|
|
4
4
|
import { BlockVisualContext } from '../shared/general-visual-types';
|
|
5
|
+
/** Runtime name constant for followups tool */
|
|
5
6
|
export declare const FollowupsToolRuntimeName: "followups-tool";
|
|
7
|
+
/**
|
|
8
|
+
* Followups tool runtime interface for suggested conversation continuations.
|
|
9
|
+
*
|
|
10
|
+
* Provides AI-generated follow-up questions to guide users deeper into topics.
|
|
11
|
+
*/
|
|
6
12
|
export type FollowupsToolRuntime = UnisphereRuntimeBaseType<FollowupsToolRuntimeSettings> & {
|
|
7
13
|
readonly widgetName: typeof widgetName;
|
|
8
14
|
readonly runtimeName: typeof FollowupsToolRuntimeName;
|
|
9
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Configuration settings for the followups tool runtime.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const settings: FollowupsToolRuntimeSettings = {};
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
10
24
|
export interface FollowupsToolRuntimeSettings {
|
|
25
|
+
/** Settings schema version */
|
|
11
26
|
schemaVersion?: string;
|
|
12
27
|
}
|
|
13
28
|
export declare const followupsToolRuntimeSettingsSchema: ValidatorSchema;
|
|
29
|
+
/**
|
|
30
|
+
* Visual settings for followup questions displayed in Genie answers.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const visualSettings: FollowupsToolRuntimeGenieAnswerVisualSettings = {
|
|
35
|
+
* questions: [
|
|
36
|
+
* 'Tell me more about this topic',
|
|
37
|
+
* 'What are some related concepts?',
|
|
38
|
+
* 'Can you provide an example?'
|
|
39
|
+
* ]
|
|
40
|
+
* };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
14
43
|
export interface FollowupsToolRuntimeGenieAnswerVisualSettings {
|
|
44
|
+
/** Visual block context for rendering */
|
|
15
45
|
blockContext?: BlockVisualContext;
|
|
46
|
+
/** Array of suggested follow-up questions */
|
|
16
47
|
questions?: string[];
|
|
17
48
|
}
|
|
18
49
|
export declare const followupsToolRuntimeGenieAnswerVisualSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
3
|
+
export interface CardAction {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
7
|
+
}
|
|
8
|
+
export type CardMedia = {
|
|
9
|
+
type: 'image';
|
|
10
|
+
src: string;
|
|
11
|
+
alt: string;
|
|
12
|
+
placement?: 'left' | 'right';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'video';
|
|
15
|
+
src: string;
|
|
16
|
+
placement?: 'left' | 'right';
|
|
17
|
+
startTime?: number;
|
|
18
|
+
endTime?: number;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'kaltura';
|
|
21
|
+
entryId: string;
|
|
22
|
+
kalturaServerURI?: string;
|
|
23
|
+
partnerId?: string;
|
|
24
|
+
uiConfId?: string;
|
|
25
|
+
ks?: string;
|
|
26
|
+
placement?: 'left' | 'right';
|
|
27
|
+
startTime?: number;
|
|
28
|
+
endTime?: number;
|
|
29
|
+
};
|
|
30
|
+
export interface GenUiComponentsToolRuntimeCardVisualSettings {
|
|
31
|
+
schemaVersion?: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
body?: string;
|
|
34
|
+
action?: CardAction;
|
|
35
|
+
media?: CardMedia;
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
isTranslucent?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const genUiComponentsToolRuntimeCardVisualSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
export interface GenUiComponentsToolRuntimeMarkdownVisualSettings {
|
|
3
|
+
schemaVersion?: string;
|
|
4
|
+
content: string;
|
|
5
|
+
isTranslucent?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const genUiComponentsToolRuntimeMarkdownVisualSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
export type PlayerSource = {
|
|
3
|
+
type: 'native';
|
|
4
|
+
src: string;
|
|
5
|
+
poster?: string;
|
|
6
|
+
startTime?: number;
|
|
7
|
+
endTime?: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'kaltura';
|
|
10
|
+
entryId: string;
|
|
11
|
+
kalturaServerURI?: string;
|
|
12
|
+
partnerId?: string;
|
|
13
|
+
uiConfId?: string;
|
|
14
|
+
ks?: string;
|
|
15
|
+
startTime?: number;
|
|
16
|
+
endTime?: number;
|
|
17
|
+
};
|
|
18
|
+
export interface GenUiComponentsToolRuntimePlayerVisualSettings {
|
|
19
|
+
schemaVersion?: string;
|
|
20
|
+
source: PlayerSource;
|
|
21
|
+
title?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
isTranslucent?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const genUiComponentsToolRuntimePlayerVisualSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
3
|
+
import { widgetName } from '../widget-types';
|
|
4
|
+
export declare const GenUiComponentsToolRuntimeName: "gen-ui-components-tool";
|
|
5
|
+
export type GenUiComponentsToolRuntime = UnisphereRuntimeBaseType<GenUiComponentsToolRuntimeSettings> & {
|
|
6
|
+
readonly widgetName: typeof widgetName;
|
|
7
|
+
readonly runtimeName: typeof GenUiComponentsToolRuntimeName;
|
|
8
|
+
};
|
|
9
|
+
export interface GenUiComponentsToolRuntimeSettings {
|
|
10
|
+
schemaVersion?: string;
|
|
11
|
+
baseVisualSettings?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export declare const genUiComponentsToolRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ValidatorSchema } from '@unisphere/core';
|
|
2
|
+
export interface RowHeight {
|
|
3
|
+
type: 'auto' | 'fixed' | 'fill' | 'percentage';
|
|
4
|
+
value?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CellWidth {
|
|
7
|
+
type: 'fill' | 'fit' | 'fixed' | 'percentage' | 'custom';
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GridRow {
|
|
11
|
+
id: string;
|
|
12
|
+
height: RowHeight;
|
|
13
|
+
columns: string;
|
|
14
|
+
cells: GridCell[];
|
|
15
|
+
}
|
|
16
|
+
export interface GridLayout {
|
|
17
|
+
type: 'cssGrid';
|
|
18
|
+
gridTemplateAreas?: string;
|
|
19
|
+
gridTemplateRows?: string;
|
|
20
|
+
gridTemplateColumns?: string;
|
|
21
|
+
gap?: string;
|
|
22
|
+
cells?: GridCell[];
|
|
23
|
+
rows?: GridRow[];
|
|
24
|
+
}
|
|
25
|
+
export interface GridCell {
|
|
26
|
+
id: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
width?: CellWidth;
|
|
29
|
+
rowSpan?: number;
|
|
30
|
+
visual?: UnisphereVisualConfig;
|
|
31
|
+
runtime?: UnisphereRuntimeConfig;
|
|
32
|
+
style?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface UnisphereVisualConfig {
|
|
35
|
+
widgetName: string;
|
|
36
|
+
runtimeName: string;
|
|
37
|
+
visualType: string;
|
|
38
|
+
visualSettings?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface UnisphereRuntimeConfig {
|
|
41
|
+
widgetName: string;
|
|
42
|
+
runtimeName: string;
|
|
43
|
+
runtimeSettings: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
export interface GenUiComposerToolRuntimeAvatarVisualSettings {
|
|
46
|
+
schemaVersion?: string;
|
|
47
|
+
layout?: GridLayout;
|
|
48
|
+
}
|
|
49
|
+
export declare const genUiComposerToolRuntimeAvatarVisualSettingsSchema: ValidatorSchema;
|