@epam/ai-dial-shared 0.31.0-rc.8 → 0.31.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 +22 -5
- package/package.json +1 -1
- package/src/constants/overlay.d.ts +15 -4
- package/src/types/chat.d.ts +36 -0
- package/src/types/features.d.ts +0 -1
- package/src/types/import-export.d.ts +49 -0
- package/src/types/index.d.ts +2 -0
- package/src/types/overlay/overlay.d.ts +1 -0
- package/src/types/overlay/request.d.ts +18 -0
- package/src/types/overlay/response.d.ts +19 -0
- package/src/types/prompt.d.ts +6 -0
package/index.esm.js
CHANGED
|
@@ -41,7 +41,6 @@ var Feature;
|
|
|
41
41
|
Feature["CustomLogo"] = "custom-logo";
|
|
42
42
|
// Applications
|
|
43
43
|
Feature["CustomApplications"] = "custom-applications";
|
|
44
|
-
Feature["QuickApps"] = "quick-apps";
|
|
45
44
|
Feature["CodeApps"] = "code-apps";
|
|
46
45
|
// Marketplace
|
|
47
46
|
Feature["Marketplace"] = "marketplace";
|
|
@@ -79,6 +78,13 @@ var SharePermission;
|
|
|
79
78
|
SharePermission["READ"] = "READ";
|
|
80
79
|
SharePermission["WRITE"] = "WRITE";
|
|
81
80
|
})(SharePermission || (SharePermission = {}));
|
|
81
|
+
var FeatureType;
|
|
82
|
+
(function (FeatureType) {
|
|
83
|
+
FeatureType["Chat"] = "chat";
|
|
84
|
+
FeatureType["Prompt"] = "prompt";
|
|
85
|
+
FeatureType["File"] = "file";
|
|
86
|
+
FeatureType["Application"] = "application";
|
|
87
|
+
})(FeatureType || (FeatureType = {}));
|
|
82
88
|
|
|
83
89
|
var FormSchemaPropertyWidget;
|
|
84
90
|
(function (FormSchemaPropertyWidget) {
|
|
@@ -195,12 +201,19 @@ const overlayAppName = '@DIAL_OVERLAY';
|
|
|
195
201
|
var OverlayRequests;
|
|
196
202
|
(function (OverlayRequests) {
|
|
197
203
|
OverlayRequests["getMessages"] = "GET_MESSAGES";
|
|
204
|
+
OverlayRequests["sendMessage"] = "SEND_MESSAGE";
|
|
205
|
+
OverlayRequests["setSystemPrompt"] = "SET_SYSTEM_PROMPT";
|
|
206
|
+
OverlayRequests["setOverlayOptions"] = "SET_OVERLAY_OPTIONS";
|
|
198
207
|
OverlayRequests["getConversations"] = "GET_CONVERSATIONS";
|
|
208
|
+
OverlayRequests["getSelectedConversations"] = "GET_SELECTED_CONVERSATIONS";
|
|
199
209
|
OverlayRequests["selectConversation"] = "SELECT_CONVERSATION";
|
|
200
210
|
OverlayRequests["createConversation"] = "CREATE_CONVERSATION";
|
|
201
|
-
OverlayRequests["
|
|
202
|
-
OverlayRequests["
|
|
203
|
-
OverlayRequests["
|
|
211
|
+
OverlayRequests["createLocalConversation"] = "CREATE_LOCAL_CONVERSATION";
|
|
212
|
+
OverlayRequests["deleteConversation"] = "DELETE_CONVERSATION";
|
|
213
|
+
OverlayRequests["renameConversation"] = "RENAME_CONVERSATION";
|
|
214
|
+
OverlayRequests["createPlaybackConversation"] = "CREATE_PLAYBACK_CONVERSATION";
|
|
215
|
+
OverlayRequests["exportConversation"] = "EXPORT_CONVERSATION";
|
|
216
|
+
OverlayRequests["importConversation"] = "IMPORT_CONVERSATION";
|
|
204
217
|
})(OverlayRequests || (OverlayRequests = {}));
|
|
205
218
|
var OverlayEvents;
|
|
206
219
|
(function (OverlayEvents) {
|
|
@@ -236,6 +249,10 @@ var OverlayEvents;
|
|
|
236
249
|
* Chat dispatch this event when user end receiving message from assistant
|
|
237
250
|
*/
|
|
238
251
|
OverlayEvents["gptEndGenerating"] = "GPT_END_GENERATING";
|
|
252
|
+
/**
|
|
253
|
+
* Chat dispatch this event when any of conversations updated, added or removed
|
|
254
|
+
*/
|
|
255
|
+
OverlayEvents["conversationsUpdated"] = "CONVERSATIONS_UPDATED";
|
|
239
256
|
})(OverlayEvents || (OverlayEvents = {}));
|
|
240
257
|
const overlayLibName = 'ChatOverlay';
|
|
241
258
|
|
|
@@ -253,4 +270,4 @@ var VisualizerConnectorRequests;
|
|
|
253
270
|
VisualizerConnectorRequests["setVisualizerOptions"] = "SET_VISUALIZER_OPTIONS";
|
|
254
271
|
})(VisualizerConnectorRequests || (VisualizerConnectorRequests = {}));
|
|
255
272
|
|
|
256
|
-
export { DeferredRequest, DialSchemaProperties, Feature, FormSchemaPropertyType, FormSchemaPropertyWidget, LikeState, OverlayEvents, OverlayRequests, PublishActions, Role, SharePermission, Task, UploadStatus, VisualizerConnectorEvents, VisualizerConnectorRequests, overlayAppName, overlayLibName, setStyles, validateFeature, visualizerConnectorLibName };
|
|
273
|
+
export { DeferredRequest, DialSchemaProperties, Feature, FeatureType, FormSchemaPropertyType, FormSchemaPropertyWidget, LikeState, OverlayEvents, OverlayRequests, PublishActions, Role, SharePermission, Task, UploadStatus, VisualizerConnectorEvents, VisualizerConnectorRequests, overlayAppName, overlayLibName, setStyles, validateFeature, visualizerConnectorLibName };
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
export declare const overlayAppName = "@DIAL_OVERLAY";
|
|
2
2
|
export declare enum OverlayRequests {
|
|
3
3
|
getMessages = "GET_MESSAGES",
|
|
4
|
+
sendMessage = "SEND_MESSAGE",
|
|
5
|
+
setSystemPrompt = "SET_SYSTEM_PROMPT",
|
|
6
|
+
setOverlayOptions = "SET_OVERLAY_OPTIONS",
|
|
4
7
|
getConversations = "GET_CONVERSATIONS",
|
|
8
|
+
getSelectedConversations = "GET_SELECTED_CONVERSATIONS",
|
|
5
9
|
selectConversation = "SELECT_CONVERSATION",
|
|
6
10
|
createConversation = "CREATE_CONVERSATION",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
createLocalConversation = "CREATE_LOCAL_CONVERSATION",
|
|
12
|
+
deleteConversation = "DELETE_CONVERSATION",
|
|
13
|
+
renameConversation = "RENAME_CONVERSATION",
|
|
14
|
+
createPlaybackConversation = "CREATE_PLAYBACK_CONVERSATION",
|
|
15
|
+
exportConversation = "EXPORT_CONVERSATION",
|
|
16
|
+
importConversation = "IMPORT_CONVERSATION"
|
|
10
17
|
}
|
|
11
18
|
export declare enum OverlayEvents {
|
|
12
19
|
/**
|
|
@@ -40,6 +47,10 @@ export declare enum OverlayEvents {
|
|
|
40
47
|
/**
|
|
41
48
|
* Chat dispatch this event when user end receiving message from assistant
|
|
42
49
|
*/
|
|
43
|
-
gptEndGenerating = "GPT_END_GENERATING"
|
|
50
|
+
gptEndGenerating = "GPT_END_GENERATING",
|
|
51
|
+
/**
|
|
52
|
+
* Chat dispatch this event when any of conversations updated, added or removed
|
|
53
|
+
*/
|
|
54
|
+
conversationsUpdated = "CONVERSATIONS_UPDATED"
|
|
44
55
|
}
|
|
45
56
|
export declare const overlayLibName = "ChatOverlay";
|
package/src/types/chat.d.ts
CHANGED
|
@@ -89,6 +89,12 @@ export declare enum SharePermission {
|
|
|
89
89
|
READ = "READ",
|
|
90
90
|
WRITE = "WRITE"
|
|
91
91
|
}
|
|
92
|
+
export declare enum FeatureType {
|
|
93
|
+
Chat = "chat",
|
|
94
|
+
Prompt = "prompt",
|
|
95
|
+
File = "file",
|
|
96
|
+
Application = "application"
|
|
97
|
+
}
|
|
92
98
|
export interface ShareInterface {
|
|
93
99
|
isShared?: boolean;
|
|
94
100
|
sharedWithMe?: boolean;
|
|
@@ -99,9 +105,39 @@ export interface ShareInterface {
|
|
|
99
105
|
}
|
|
100
106
|
export interface ShareEntity extends Entity, ShareInterface {
|
|
101
107
|
}
|
|
108
|
+
export interface FolderInterface extends ShareEntity {
|
|
109
|
+
type: FeatureType;
|
|
110
|
+
temporary?: boolean;
|
|
111
|
+
serverSynced?: boolean;
|
|
112
|
+
isPublicationFolder?: boolean;
|
|
113
|
+
}
|
|
102
114
|
export interface ConversationInfo extends ShareEntity {
|
|
103
115
|
model: ConversationEntityModel;
|
|
104
116
|
isPlayback?: boolean;
|
|
105
117
|
isReplay?: boolean;
|
|
106
118
|
}
|
|
107
119
|
export type TemplateMapping = [string, string];
|
|
120
|
+
export interface Replay {
|
|
121
|
+
replayAsIs?: boolean;
|
|
122
|
+
isReplay: boolean;
|
|
123
|
+
replayUserMessagesStack?: Message[];
|
|
124
|
+
activeReplayIndex?: number;
|
|
125
|
+
isError?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface Playback {
|
|
128
|
+
isPlayback?: boolean;
|
|
129
|
+
messagesStack: Message[];
|
|
130
|
+
activePlaybackIndex: number;
|
|
131
|
+
}
|
|
132
|
+
export interface Conversation extends ShareEntity, ConversationInfo {
|
|
133
|
+
messages: Message[];
|
|
134
|
+
prompt: string;
|
|
135
|
+
temperature: number;
|
|
136
|
+
reference?: string;
|
|
137
|
+
replay?: Replay;
|
|
138
|
+
playback?: Playback;
|
|
139
|
+
selectedAddons: string[];
|
|
140
|
+
assistantModelId?: string;
|
|
141
|
+
isMessageStreaming?: boolean;
|
|
142
|
+
isNameChanged?: boolean;
|
|
143
|
+
}
|
package/src/types/features.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export declare enum Feature {
|
|
|
30
30
|
HideUserSettings = "hide-user-settings",// Hide user settings
|
|
31
31
|
CustomLogo = "custom-logo",// Enable setting for custom logo feature
|
|
32
32
|
CustomApplications = "custom-applications",// custom applications
|
|
33
|
-
QuickApps = "quick-apps",// Enable Quick apps
|
|
34
33
|
CodeApps = "code-apps",// Enable Code apps
|
|
35
34
|
Marketplace = "marketplace",// Enable Marketplace
|
|
36
35
|
MarketplaceTableView = "marketplace-table-view"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Conversation, FolderInterface, Message } from './chat';
|
|
2
|
+
import { Prompt } from './prompt';
|
|
3
|
+
export type SupportedExportFormats = ExportFormatV1 | ExportFormatV2 | ExportFormatV3 | ExportFormatV4 | ExportConversationsFormatV4 | ExportConversationsFormatV5;
|
|
4
|
+
export type LatestExportFormat = ExportFormatV5;
|
|
5
|
+
export type LatestExportConversationsFormat = ExportConversationsFormatV5;
|
|
6
|
+
interface ConversationV1 {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
messages: Message[];
|
|
10
|
+
}
|
|
11
|
+
export type ExportFormatV1 = ConversationV1[];
|
|
12
|
+
interface ChatFolder {
|
|
13
|
+
id: number;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ExportFormatV2 {
|
|
17
|
+
history: Conversation[] | null;
|
|
18
|
+
folders: ChatFolder[] | null;
|
|
19
|
+
}
|
|
20
|
+
export interface ExportFormatV3 {
|
|
21
|
+
version: 3;
|
|
22
|
+
history: Conversation[];
|
|
23
|
+
folders: FolderInterface[];
|
|
24
|
+
}
|
|
25
|
+
export interface ExportFormatV4 {
|
|
26
|
+
version: 4;
|
|
27
|
+
history: Conversation[];
|
|
28
|
+
folders: FolderInterface[];
|
|
29
|
+
prompts: Prompt[];
|
|
30
|
+
}
|
|
31
|
+
export interface ExportConversationsFormatV4 {
|
|
32
|
+
version: 4;
|
|
33
|
+
history: Conversation[];
|
|
34
|
+
folders: FolderInterface[];
|
|
35
|
+
}
|
|
36
|
+
export interface ExportFormatV5 {
|
|
37
|
+
version: 5;
|
|
38
|
+
history: Conversation[];
|
|
39
|
+
folders: FolderInterface[];
|
|
40
|
+
prompts: Prompt[];
|
|
41
|
+
}
|
|
42
|
+
export type ExportConversationsFormatV5 = Omit<ExportConversationsFormatV4, 'version'> & {
|
|
43
|
+
version: 5;
|
|
44
|
+
};
|
|
45
|
+
export interface ExportPromptsFormat {
|
|
46
|
+
prompts: Prompt[];
|
|
47
|
+
folders: FolderInterface[];
|
|
48
|
+
}
|
|
49
|
+
export {};
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LatestExportConversationsFormat } from '../import-export';
|
|
1
2
|
export interface SendMessageRequest {
|
|
2
3
|
content: string;
|
|
3
4
|
}
|
|
@@ -6,7 +7,24 @@ export interface SetSystemPromptRequest {
|
|
|
6
7
|
}
|
|
7
8
|
export interface CreateConversationRequest {
|
|
8
9
|
parentPath?: string | null;
|
|
10
|
+
local?: boolean | null;
|
|
9
11
|
}
|
|
10
12
|
export interface SelectConversationRequest {
|
|
11
13
|
id: string;
|
|
12
14
|
}
|
|
15
|
+
export interface DeleteConversationRequest {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RenameConversationRequest {
|
|
19
|
+
id: string;
|
|
20
|
+
newName: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CreatePlaybackConversationRequest {
|
|
23
|
+
id: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ExportConversationRequest {
|
|
26
|
+
id: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ImportConversationRequest {
|
|
29
|
+
importConversation: LatestExportConversationsFormat;
|
|
30
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Message } from '../chat';
|
|
2
|
+
import { LatestExportConversationsFormat } from '../import-export';
|
|
2
3
|
import { OverlayConversation } from './conversation';
|
|
3
4
|
export type SendMessageResponse = void;
|
|
4
5
|
export type SetSystemPromptResponse = void;
|
|
@@ -8,9 +9,27 @@ export interface GetMessagesResponse {
|
|
|
8
9
|
export interface GetConversationsResponse {
|
|
9
10
|
conversations: OverlayConversation[];
|
|
10
11
|
}
|
|
12
|
+
export interface GetSelectedConversationsResponse {
|
|
13
|
+
conversations: OverlayConversation[];
|
|
14
|
+
}
|
|
11
15
|
export interface CreateConversationResponse {
|
|
12
16
|
conversation: OverlayConversation;
|
|
13
17
|
}
|
|
18
|
+
export interface CreateLocalConversationResponse {
|
|
19
|
+
conversation: OverlayConversation;
|
|
20
|
+
}
|
|
14
21
|
export interface SelectConversationResponse {
|
|
15
22
|
conversation: OverlayConversation;
|
|
16
23
|
}
|
|
24
|
+
export interface RenameConversationResponse {
|
|
25
|
+
conversation: OverlayConversation;
|
|
26
|
+
}
|
|
27
|
+
export interface CreatePlaybackConversationResponse {
|
|
28
|
+
conversation: OverlayConversation;
|
|
29
|
+
}
|
|
30
|
+
export interface ExportConversationResponse {
|
|
31
|
+
exportConversation: LatestExportConversationsFormat;
|
|
32
|
+
}
|
|
33
|
+
export interface ImportConversationResponse {
|
|
34
|
+
conversation: OverlayConversation;
|
|
35
|
+
}
|