@eka-care/medassist-core 1.0.8 → 1.0.10
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/dist/Synapse.d.ts +1 -0
- package/dist/Synapse.d.ts.map +1 -1
- package/dist/Synapse.js +3 -2
- package/dist/constants/index.js +2 -2
- package/dist/events/types.d.ts +7 -3
- package/dist/events/types.d.ts.map +1 -1
- package/dist/media/file/File.d.ts +6 -23
- package/dist/media/file/File.d.ts.map +1 -1
- package/dist/media/file/File.js +67 -84
- package/dist/messages/MessageManager.d.ts +1 -1
- package/dist/messages/MessageManager.d.ts.map +1 -1
- package/dist/messages/MessageManager.js +16 -9
- package/dist/messages/types.d.ts +34 -9
- package/dist/messages/types.d.ts.map +1 -1
- package/dist/messages/types.js +55 -0
- package/dist/resources/session/types.d.ts +1 -1
- package/dist/resources/session/types.d.ts.map +1 -1
- package/dist/resources/toolCall/types.d.ts +11 -40
- package/dist/resources/toolCall/types.d.ts.map +1 -1
- package/dist/resources/toolCall/types.js +7 -10
- package/package.json +1 -1
package/dist/Synapse.d.ts
CHANGED
package/dist/Synapse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Synapse.d.ts","sourceRoot":"","sources":["../src/Synapse.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEL,cAAc,EACf,MAAM,gCAAgC,CAAC;AAKxC,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,aAAa,CAAC;AAI1D,OAAO,EACL,uBAAuB,EAEvB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAML,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAShC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MA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/B;;OAEG;YACW,mBAAmB;IAsCjC,OAAO,CAAC,iBAAiB;CAW1B"}
|
package/dist/Synapse.js
CHANGED
|
@@ -32,7 +32,7 @@ class SynapseSDK {
|
|
|
32
32
|
const API_ORIGIN = (0, constants_1.getConfig)(this.config?.environment).BASE_API_URL;
|
|
33
33
|
this.resourceManager = new resources_1.ResourceManager({
|
|
34
34
|
agentId: this.config.agentId,
|
|
35
|
-
serverUrl: API_ORIGIN, //based on environment
|
|
35
|
+
serverUrl: this.config.serverUrl || API_ORIGIN, //based on environment
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -268,11 +268,12 @@ class SynapseSDK {
|
|
|
268
268
|
}
|
|
269
269
|
this.sessionConfig = sessionResponse;
|
|
270
270
|
const serverUrl = (0, constants_1.getConfig)(this.config?.environment).WEBSOCKET_URL;
|
|
271
|
+
const customSocketUrl = this.config.serverUrl ? `ws://${this.config.serverUrl.split("://")[1]}` : null;
|
|
271
272
|
const connectionType = this.config.connectionType === "socket"
|
|
272
273
|
? ConnectionFactory_1.ConnectionType.SOCKET
|
|
273
274
|
: ConnectionFactory_1.ConnectionType.SOCKET;
|
|
274
275
|
this.connection = await ConnectionFactory_1.ConnectionFactory.createConnection(connectionType, {
|
|
275
|
-
serverUrl,
|
|
276
|
+
serverUrl: customSocketUrl || serverUrl,
|
|
276
277
|
auth: {
|
|
277
278
|
sessionId: sessionResponse.session_id,
|
|
278
279
|
sessionToken: sessionResponse.session_token,
|
package/dist/constants/index.js
CHANGED
|
@@ -6,8 +6,8 @@ const PRODUCTION_CONFIG = {
|
|
|
6
6
|
BASE_API_URL: "https://matrix.eka.care/reloaded",
|
|
7
7
|
};
|
|
8
8
|
// const PRODUCTION_CONFIG = {
|
|
9
|
-
// WEBSOCKET_URL: "ws://
|
|
10
|
-
// BASE_API_URL: "https://
|
|
9
|
+
// WEBSOCKET_URL: "ws://87677104b49f.ngrok-free.app/reloaded",
|
|
10
|
+
// BASE_API_URL: "https://87677104b49f.ngrok-free.app/reloaded",
|
|
11
11
|
// }
|
|
12
12
|
const DEVELOPMENT_CONFIG = {
|
|
13
13
|
// can be used for local development
|
package/dist/events/types.d.ts
CHANGED
|
@@ -33,11 +33,11 @@ export interface ChatSynapseToMatrixMessage extends BaseMessage {
|
|
|
33
33
|
ev: (typeof SOCKET_EVENTS)["CHAT"];
|
|
34
34
|
ct: (typeof SOCKET_CONTENT_TYPES)["TEXT"] | (typeof SOCKET_CONTENT_TYPES)["FILE"] | (typeof SOCKET_CONTENT_TYPES)["TOOL_CALL"] | (typeof SOCKET_CONTENT_TYPES)["AUDIO"];
|
|
35
35
|
data?: {
|
|
36
|
-
|
|
36
|
+
urls?: string[];
|
|
37
37
|
text?: string;
|
|
38
38
|
tool_id?: string;
|
|
39
39
|
hidden?: boolean;
|
|
40
|
-
|
|
40
|
+
extensions?: string[];
|
|
41
41
|
tool_use_params?: any;
|
|
42
42
|
audio?: string;
|
|
43
43
|
format?: string;
|
|
@@ -66,11 +66,15 @@ export type ToolCallData = {
|
|
|
66
66
|
details?: ToolDetails;
|
|
67
67
|
_meta?: Record<string, unknown>;
|
|
68
68
|
};
|
|
69
|
+
export interface presignedUrls {
|
|
70
|
+
id: string;
|
|
71
|
+
url: string;
|
|
72
|
+
}
|
|
69
73
|
export interface ChatMatrixToSynapseMessage extends BaseMessage {
|
|
70
74
|
ev: (typeof SOCKET_EVENTS)["CHAT"];
|
|
71
75
|
ct: Exclude<SOCKET_CONTENT_TYPES, (typeof SOCKET_CONTENT_TYPES)["AUDIO"]>;
|
|
72
76
|
data: {
|
|
73
|
-
urls?:
|
|
77
|
+
urls?: presignedUrls[];
|
|
74
78
|
exp?: number;
|
|
75
79
|
text?: string;
|
|
76
80
|
tips?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/events/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,kBAAkB,EAC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AC5C,EAAE,EAAE,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;CAC3C"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type presignedUrls } from "../../events/types";
|
|
2
|
+
export declare const MAX_FILE_SIZE: number;
|
|
1
3
|
export declare class Filemanager {
|
|
2
4
|
private pendingFiles;
|
|
3
5
|
private pendingMessage?;
|
|
4
|
-
private
|
|
6
|
+
private pendingFormats;
|
|
5
7
|
/**
|
|
6
8
|
* Set the files for upload
|
|
7
9
|
*/
|
|
@@ -12,19 +14,12 @@ export declare class Filemanager {
|
|
|
12
14
|
getPendingFileState(): {
|
|
13
15
|
files: File[];
|
|
14
16
|
message: string;
|
|
15
|
-
|
|
17
|
+
formats: string[];
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* Upload files to presigned URLs
|
|
19
21
|
*/
|
|
20
|
-
uploadFilesToPresignedUrl(presignedUrls:
|
|
21
|
-
/**
|
|
22
|
-
* Zips multiple files into a single zip file
|
|
23
|
-
* @param files Array of files to zip
|
|
24
|
-
* @param zipFileName Name for the zip file (without extension)
|
|
25
|
-
* @returns Promise<Blob> - The zipped file as a blob
|
|
26
|
-
*/
|
|
27
|
-
zipFiles(): Promise<Blob>;
|
|
22
|
+
uploadFilesToPresignedUrl(presignedUrls: presignedUrls[]): Promise<string[]>;
|
|
28
23
|
/**
|
|
29
24
|
* Creates a File object from a blob with a specific name
|
|
30
25
|
* @param blob The blob to convert
|
|
@@ -32,24 +27,12 @@ export declare class Filemanager {
|
|
|
32
27
|
* @returns File object
|
|
33
28
|
*/
|
|
34
29
|
blobToFile(blob: Blob, fileName: string): File;
|
|
35
|
-
/**
|
|
36
|
-
* Checks if multiple files should be zipped
|
|
37
|
-
* @param files Array of files
|
|
38
|
-
* @returns boolean - true if files should be zipped
|
|
39
|
-
*/
|
|
40
|
-
shouldZipFiles(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Gets the appropriate file name for upload (either zip or single file)
|
|
43
|
-
* @param files Array of files
|
|
44
|
-
* @returns string - the file name to use for upload
|
|
45
|
-
*/
|
|
46
|
-
getUploadFileName(): string;
|
|
47
30
|
/**
|
|
48
31
|
* Validate file types
|
|
49
32
|
* @param file The file to validate
|
|
50
33
|
* @returns boolean - true if file type is supported
|
|
51
34
|
*/
|
|
52
|
-
|
|
35
|
+
validateFile(file: File): boolean;
|
|
53
36
|
/**
|
|
54
37
|
* Clears the pending files
|
|
55
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../src/media/file/File.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../src/media/file/File.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,eAAO,MAAM,aAAa,QAAkB,CAAC;AAC7C,qBAAa,WAAW;IACtB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,cAAc,CAAgB;IAEtC;;OAEG;IACI,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAkB/D;;OAEG;IAEI,mBAAmB,IAAI;QAC5B,KAAK,EAAE,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB;IAQD;;OAEG;IACU,yBAAyB,CACpC,aAAa,EAAE,aAAa,EAAE,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC;IAgFpB;;;;;OAKG;IACI,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAyBrD;;;;OAIG;IACI,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAgBxC;;OAEG;IACI,sBAAsB,IAAI,IAAI;CAKtC"}
|
package/dist/media/file/File.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Filemanager = void 0;
|
|
3
|
+
exports.Filemanager = exports.MAX_FILE_SIZE = void 0;
|
|
7
4
|
/**
|
|
8
5
|
* Class to store file states
|
|
9
6
|
* Helpers: Zipping, uploading to presigned url, etc.
|
|
10
7
|
*/
|
|
11
|
-
const jszip_1 = __importDefault(require("jszip"));
|
|
12
8
|
const Error_1 = require("../../internal/Error/Error");
|
|
9
|
+
exports.MAX_FILE_SIZE = 3 * 1024 * 1024; // 3MB
|
|
13
10
|
class Filemanager {
|
|
14
11
|
pendingFiles = [];
|
|
15
12
|
pendingMessage = "";
|
|
16
|
-
|
|
13
|
+
pendingFormats = [];
|
|
17
14
|
/**
|
|
18
15
|
* Set the files for upload
|
|
19
16
|
*/
|
|
@@ -21,9 +18,9 @@ class Filemanager {
|
|
|
21
18
|
if (this.pendingFiles.length > 0) {
|
|
22
19
|
this.clearPendingFilesState();
|
|
23
20
|
}
|
|
24
|
-
const validFiles = files.filter((file) => this.
|
|
21
|
+
const validFiles = files.filter((file) => this.validateFile(file));
|
|
25
22
|
if (validFiles.length === 0) {
|
|
26
|
-
throw new Error_1.FileError("
|
|
23
|
+
throw new Error_1.FileError("File not supported", {
|
|
27
24
|
context: { stage: "setFilesForUpload" },
|
|
28
25
|
});
|
|
29
26
|
}
|
|
@@ -31,8 +28,8 @@ class Filemanager {
|
|
|
31
28
|
if (message && message.trim()) {
|
|
32
29
|
this.pendingMessage = message;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
console.log("validFiles", validFiles);
|
|
32
|
+
this.pendingFormats = validFiles.map(file => file.type);
|
|
36
33
|
}
|
|
37
34
|
/**
|
|
38
35
|
* Get the pending file state
|
|
@@ -41,86 +38,72 @@ class Filemanager {
|
|
|
41
38
|
return {
|
|
42
39
|
files: this.pendingFiles,
|
|
43
40
|
message: this.pendingMessage || "",
|
|
44
|
-
|
|
41
|
+
formats: this.pendingFormats || [],
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
44
|
/**
|
|
48
45
|
* Upload files to presigned URLs
|
|
49
46
|
*/
|
|
50
47
|
async uploadFilesToPresignedUrl(presignedUrls) {
|
|
51
|
-
let
|
|
48
|
+
let successIds = [];
|
|
52
49
|
// Filter out invalid URLs
|
|
53
|
-
const validUrls = presignedUrls.filter((url) => url && url.trim());
|
|
50
|
+
const validUrls = presignedUrls.filter((url) => url.url && url.url.trim());
|
|
54
51
|
try {
|
|
55
52
|
if (validUrls.length === 0) {
|
|
56
53
|
throw new Error_1.FileError("No valid presigned URLs provided", {
|
|
57
54
|
context: { stage: "uploadFilesToPresignedUrl" },
|
|
58
55
|
});
|
|
59
56
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const zipBlob = await this.zipFiles();
|
|
65
|
-
const zipFileName = this.getUploadFileName();
|
|
66
|
-
fileToUpload = this.blobToFile(zipBlob, zipFileName);
|
|
67
|
-
contentType = "application/zip";
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// Single file, upload as is
|
|
71
|
-
fileToUpload = this.pendingFiles?.[0];
|
|
72
|
-
contentType = fileToUpload.type;
|
|
57
|
+
if (!this.pendingFiles.length) {
|
|
58
|
+
throw new Error_1.FileError("No files to upload", {
|
|
59
|
+
context: { stage: "uploadFilesToPresignedUrl" },
|
|
60
|
+
});
|
|
73
61
|
}
|
|
74
|
-
// Upload to all presigned URLs
|
|
75
62
|
for (let i = 0; i < validUrls.length; i++) {
|
|
76
|
-
const url = validUrls[i];
|
|
63
|
+
const url = validUrls[i].url;
|
|
77
64
|
const response = await fetch(url, {
|
|
78
65
|
method: "PUT",
|
|
79
|
-
body:
|
|
66
|
+
body: this.pendingFiles[i],
|
|
80
67
|
headers: {
|
|
81
|
-
"Content-Type":
|
|
68
|
+
"Content-Type": this.pendingFiles[i].type,
|
|
82
69
|
"x-ms-blob-type": "BlockBlob",
|
|
83
70
|
},
|
|
84
71
|
});
|
|
85
72
|
if (!response.ok) {
|
|
86
|
-
throw new Error_1.FileError(`Failed to upload ${
|
|
87
|
-
context: {
|
|
88
|
-
stage: "uploadFilesToPresignedUrl",
|
|
89
|
-
status: response.status,
|
|
90
|
-
url,
|
|
91
|
-
},
|
|
73
|
+
throw new Error_1.FileError(`Failed to upload ${this.pendingFiles[i].name} to URL ${i + 1}: ${response.status} ${response.statusText}`, {
|
|
74
|
+
context: { stage: "uploadFilesToPresignedUrl" },
|
|
92
75
|
});
|
|
93
76
|
}
|
|
94
|
-
|
|
77
|
+
successIds.push(validUrls[i].id);
|
|
95
78
|
}
|
|
96
79
|
// Call sendFileUploadComplete only once with the first presigned URL
|
|
97
80
|
// this.sendFileUploadComplete(validUrls[0]);
|
|
98
|
-
return
|
|
81
|
+
return successIds;
|
|
99
82
|
}
|
|
100
83
|
catch (error) {
|
|
101
|
-
if (
|
|
84
|
+
if (successIds.length > 0) {
|
|
102
85
|
// this.sendFileUploadComplete(validUrls[0]);
|
|
103
|
-
return
|
|
86
|
+
return successIds;
|
|
104
87
|
}
|
|
105
88
|
throw (0, Error_1.normalizeError)(error, Error_1.FileError, "Failed to upload files to presigned URL", { context: { stage: "uploadFilesToPresignedUrl" } });
|
|
106
89
|
}
|
|
107
90
|
}
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
async zipFiles() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
91
|
+
// /**
|
|
92
|
+
// * Zips multiple files into a single zip file
|
|
93
|
+
// * @param files Array of files to zip
|
|
94
|
+
// * @param zipFileName Name for the zip file (without extension)
|
|
95
|
+
// * @returns Promise<Blob> - The zipped file as a blob
|
|
96
|
+
// */
|
|
97
|
+
// public async zipFiles(): Promise<Blob> {
|
|
98
|
+
// const zip = new JSZip();
|
|
99
|
+
// // Add each file to the zip
|
|
100
|
+
// this.pendingFiles.forEach((file) => {
|
|
101
|
+
// zip.file(file.name, file);
|
|
102
|
+
// });
|
|
103
|
+
// // Generate the zip file as a blob
|
|
104
|
+
// const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
105
|
+
// return zipBlob;
|
|
106
|
+
// }
|
|
124
107
|
/**
|
|
125
108
|
* Creates a File object from a blob with a specific name
|
|
126
109
|
* @param blob The blob to convert
|
|
@@ -130,44 +113,44 @@ class Filemanager {
|
|
|
130
113
|
blobToFile(blob, fileName) {
|
|
131
114
|
return new File([blob], fileName, { type: blob.type });
|
|
132
115
|
}
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
shouldZipFiles() {
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
getUploadFileName() {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
116
|
+
// /**
|
|
117
|
+
// * Checks if multiple files should be zipped
|
|
118
|
+
// * @param files Array of files
|
|
119
|
+
// * @returns boolean - true if files should be zipped
|
|
120
|
+
// */
|
|
121
|
+
// public shouldZipFiles(): boolean {
|
|
122
|
+
// return this.pendingFiles.length > 1;
|
|
123
|
+
// }
|
|
124
|
+
// /**
|
|
125
|
+
// * Gets the appropriate file name for upload (either zip or single file)
|
|
126
|
+
// * @param files Array of files
|
|
127
|
+
// * @returns string - the file name to use for upload
|
|
128
|
+
// */
|
|
129
|
+
// public getUploadFileName(): string {
|
|
130
|
+
// if (this.shouldZipFiles()) {
|
|
131
|
+
// return `uploaded_files_${Date.now()}.zip`;
|
|
132
|
+
// }
|
|
133
|
+
// return this.pendingFiles[0]?.name || "file";
|
|
134
|
+
// }
|
|
152
135
|
/**
|
|
153
136
|
* Validate file types
|
|
154
137
|
* @param file The file to validate
|
|
155
138
|
* @returns boolean - true if file type is supported
|
|
156
139
|
*/
|
|
157
|
-
|
|
140
|
+
validateFile(file) {
|
|
158
141
|
const validFormats = [
|
|
159
142
|
"application/pdf",
|
|
160
143
|
"image/jpeg",
|
|
161
144
|
"image/png",
|
|
162
145
|
"image/jpg",
|
|
163
|
-
"image/tiff",
|
|
164
|
-
"text/plain",
|
|
165
|
-
"text/markdown",
|
|
166
|
-
"image/heif",
|
|
167
|
-
"image/heic",
|
|
168
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
146
|
+
// "image/tiff",
|
|
147
|
+
// "text/plain",
|
|
148
|
+
// "text/markdown",
|
|
149
|
+
// "image/heif",
|
|
150
|
+
// "image/heic",
|
|
151
|
+
// "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
169
152
|
];
|
|
170
|
-
return validFormats.includes(file.type);
|
|
153
|
+
return validFormats.includes(file.type) && file.size < exports.MAX_FILE_SIZE;
|
|
171
154
|
}
|
|
172
155
|
/**
|
|
173
156
|
* Clears the pending files
|
|
@@ -175,7 +158,7 @@ class Filemanager {
|
|
|
175
158
|
clearPendingFilesState() {
|
|
176
159
|
this.pendingFiles = [];
|
|
177
160
|
this.pendingMessage = "";
|
|
178
|
-
this.
|
|
161
|
+
this.pendingFormats = [];
|
|
179
162
|
}
|
|
180
163
|
}
|
|
181
164
|
exports.Filemanager = Filemanager;
|
|
@@ -21,7 +21,7 @@ export declare class MessageManager {
|
|
|
21
21
|
/**
|
|
22
22
|
* send chat message through socket
|
|
23
23
|
*/
|
|
24
|
-
sendSocketMessage({ message, files, audio,
|
|
24
|
+
sendSocketMessage({ message, files, audio, urls, tool_declined, tool_id, initial_prompts }: SocketChatRequestData): void;
|
|
25
25
|
/**
|
|
26
26
|
* Handle incoming chat message
|
|
27
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageManager.d.ts","sourceRoot":"","sources":["../../src/messages/MessageManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACtC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAEL,KAAK,qBAAqB,EAI3B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageManager.d.ts","sourceRoot":"","sources":["../../src/messages/MessageManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACtC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAEL,KAAK,qBAAqB,EAI3B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,SAAS,CAAoC;IACrD,OAAO,CAAC,WA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 class MessageManager {
|
|
|
18
18
|
/**
|
|
19
19
|
* Handle file upload process
|
|
20
20
|
*/
|
|
21
|
-
handleFileUploadProcess({ files, message,
|
|
21
|
+
handleFileUploadProcess({ files, message, urls, }) {
|
|
22
22
|
if (!this.fileManager) {
|
|
23
23
|
this.fileManager = new File_1.Filemanager();
|
|
24
24
|
}
|
|
@@ -33,11 +33,11 @@ class MessageManager {
|
|
|
33
33
|
_id: Date.now().toString(),
|
|
34
34
|
ts: Date.now(),
|
|
35
35
|
data: {
|
|
36
|
-
|
|
36
|
+
extensions: this.fileManager.getPendingFileState().formats,
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
else if (
|
|
40
|
+
else if (urls && urls.length > 0) {
|
|
41
41
|
//--stage 3. of file upload process
|
|
42
42
|
//--only requirement is url
|
|
43
43
|
//--send file upload acknowledgement to client
|
|
@@ -48,7 +48,7 @@ class MessageManager {
|
|
|
48
48
|
_id: Date.now().toString(),
|
|
49
49
|
ts: Date.now(),
|
|
50
50
|
data: {
|
|
51
|
-
|
|
51
|
+
urls: urls,
|
|
52
52
|
...(text && { text }),
|
|
53
53
|
},
|
|
54
54
|
};
|
|
@@ -59,14 +59,21 @@ class MessageManager {
|
|
|
59
59
|
/**
|
|
60
60
|
* send chat message through socket
|
|
61
61
|
*/
|
|
62
|
-
sendSocketMessage({ message, files, audio,
|
|
62
|
+
sendSocketMessage({ message, files, audio, urls, tool_declined, tool_id, initial_prompts }) {
|
|
63
63
|
const connection = this.assertConnection("sendSocketChatMessage");
|
|
64
64
|
let outMessage;
|
|
65
|
-
if ((files && files.length > 0) || (
|
|
65
|
+
if ((files && files.length > 0) || (urls && urls.length > 0)) {
|
|
66
|
+
if (files && files.length > 3) {
|
|
67
|
+
const error = new Error_1.MessageError("Maximum 3 files are allowed to be sent at a time", {
|
|
68
|
+
context: { stage: "sendSocketChatMessage" },
|
|
69
|
+
});
|
|
70
|
+
this.emitError(error);
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
66
73
|
outMessage = this.handleFileUploadProcess({
|
|
67
74
|
files,
|
|
68
75
|
message,
|
|
69
|
-
|
|
76
|
+
urls,
|
|
70
77
|
});
|
|
71
78
|
}
|
|
72
79
|
else if (message) {
|
|
@@ -116,9 +123,9 @@ class MessageManager {
|
|
|
116
123
|
//stage 2. of file upload process
|
|
117
124
|
this.fileManager
|
|
118
125
|
?.uploadFilesToPresignedUrl(message.data.urls)
|
|
119
|
-
.then(() => {
|
|
126
|
+
.then((validUrls) => {
|
|
120
127
|
this.sendSocketMessage({
|
|
121
|
-
|
|
128
|
+
urls: validUrls,
|
|
122
129
|
});
|
|
123
130
|
})
|
|
124
131
|
.catch((error) => {
|
package/dist/messages/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface SocketChatRequestData {
|
|
|
22
22
|
messageId?: string;
|
|
23
23
|
files?: File[];
|
|
24
24
|
audio?: AudioMetaData;
|
|
25
|
-
|
|
25
|
+
urls?: string[];
|
|
26
26
|
tool_id?: string;
|
|
27
27
|
tool_declined?: boolean;
|
|
28
28
|
tool_use_params?: Record<string, unknown>;
|
|
@@ -73,21 +73,46 @@ export type SynapseRealTimeEventData = {
|
|
|
73
73
|
messageId?: string;
|
|
74
74
|
timestamp?: number;
|
|
75
75
|
};
|
|
76
|
-
export type
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
export type TDoctorAvailability = {
|
|
77
|
+
hospital_id?: string;
|
|
78
|
+
doctor_id?: string;
|
|
79
|
+
selected_date?: string;
|
|
80
|
+
availability?: TAvailability[];
|
|
81
|
+
date_preference?: string;
|
|
82
|
+
slot_preference?: string;
|
|
81
83
|
};
|
|
82
|
-
export type
|
|
84
|
+
export type TAvailability = {
|
|
83
85
|
date: string;
|
|
84
86
|
day?: string;
|
|
85
87
|
slots: string[];
|
|
86
88
|
selected_slot?: string;
|
|
87
89
|
};
|
|
90
|
+
export type THospital = {
|
|
91
|
+
hospital_id: string;
|
|
92
|
+
name?: string;
|
|
93
|
+
city?: string;
|
|
94
|
+
state?: string;
|
|
95
|
+
region_id?: string;
|
|
96
|
+
};
|
|
88
97
|
export type TDoctorDetails = {
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
name: string;
|
|
99
|
+
specialty: string;
|
|
100
|
+
hospitals: THospital[];
|
|
101
|
+
timings?: string;
|
|
102
|
+
experience?: string;
|
|
103
|
+
profile_link?: string;
|
|
104
|
+
profile_pic?: string;
|
|
105
|
+
languages?: string;
|
|
106
|
+
};
|
|
107
|
+
export type TCallbacks = {
|
|
108
|
+
tool_name: string;
|
|
109
|
+
input_schema: {
|
|
110
|
+
doctor_id?: string;
|
|
111
|
+
hospital_id?: string;
|
|
112
|
+
region_id?: string;
|
|
113
|
+
date?: string;
|
|
114
|
+
slot?: string;
|
|
115
|
+
} & Record<string, unknown>;
|
|
91
116
|
};
|
|
92
117
|
export type SynapseContentTypes = SOCKET_CONTENT_TYPES;
|
|
93
118
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/messages/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB;;;;;;;;;CAAuB,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE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CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AACD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,EAAE,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAKD,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtI,CAAA;AACD,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC"}
|
package/dist/messages/types.js
CHANGED
|
@@ -45,3 +45,58 @@ exports.SYNAPSE_REALTIME_RESERVED_EVENTS = {
|
|
|
45
45
|
// [key: string]: unknown;
|
|
46
46
|
// };
|
|
47
47
|
//TODO: tips will never come in tool escalation
|
|
48
|
+
// {component: "doctor_card",
|
|
49
|
+
// input: {
|
|
50
|
+
// doctors: [{
|
|
51
|
+
// hospital_id?:
|
|
52
|
+
// doctor_id:
|
|
53
|
+
// selected_date?: "20-02-2024" or today,
|
|
54
|
+
// // Either below availability is present or we have a callback available to fetch availabilities
|
|
55
|
+
// availability?: [{
|
|
56
|
+
// date: "20-02-2024",
|
|
57
|
+
// slots: ["13:00", "14:00"],
|
|
58
|
+
// selected_slot?: "13:00"
|
|
59
|
+
// },
|
|
60
|
+
// {
|
|
61
|
+
// date: "21-02-2024",
|
|
62
|
+
// slots: ["09:00", "14:00"],
|
|
63
|
+
// selected_slot?: "09:00"
|
|
64
|
+
// }]
|
|
65
|
+
// date_preference
|
|
66
|
+
// slot_preference
|
|
67
|
+
// }],
|
|
68
|
+
// // Let's say we have doctor details in our cache, we provide it directly here instead of waiting for callbacks
|
|
69
|
+
// doctor_details?: {
|
|
70
|
+
// [doctor_id]: {
|
|
71
|
+
// name: string;
|
|
72
|
+
// specialty: string;
|
|
73
|
+
// hospitals: {
|
|
74
|
+
// name, city, state, hospital_id, region_id
|
|
75
|
+
// }
|
|
76
|
+
// timings?: string;
|
|
77
|
+
// experience?: string; // optional
|
|
78
|
+
// profile_link?: string; // optional
|
|
79
|
+
// profile_pic?: string; //optional
|
|
80
|
+
// languages?: string; //optional
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
// },
|
|
84
|
+
// callbacks: [
|
|
85
|
+
// {
|
|
86
|
+
// tool_name: "doctor_details",
|
|
87
|
+
// input_schema: {
|
|
88
|
+
// doctor_id: "string",
|
|
89
|
+
// }
|
|
90
|
+
// },
|
|
91
|
+
// {
|
|
92
|
+
// // Doctor availability where we call multiple APIs for each doctor and date is handled by Matrix and UI only has 1 tool to call
|
|
93
|
+
// // The entire logic for getting the slots and translating it to above mentioned availability response is handled by matrix using business specific logics defined.
|
|
94
|
+
// tool_name: "doctor_availability",
|
|
95
|
+
// input_schema: {
|
|
96
|
+
// doctor_id: "string",
|
|
97
|
+
// hospital_id: "string"
|
|
98
|
+
// date?
|
|
99
|
+
// slot?
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// ]}
|
|
@@ -7,7 +7,7 @@ export declare const USER_FEEDBACK: {
|
|
|
7
7
|
export type USER_FEEDBACK = (typeof USER_FEEDBACK)[keyof typeof USER_FEEDBACK];
|
|
8
8
|
export type TInitialMessage = {
|
|
9
9
|
text?: string;
|
|
10
|
-
suggestions
|
|
10
|
+
suggestions?: {
|
|
11
11
|
label?: string;
|
|
12
12
|
value?: string;
|
|
13
13
|
response?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACvE,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC"}
|
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
import { MULTI_SELECT_ADDITIONAL_OPTION } from "../../events/Events";
|
|
2
|
-
import {
|
|
2
|
+
import type { TAvailability, TCallbacks, TDoctorAvailability, TDoctorDetails } from "../../messages/types";
|
|
3
3
|
import type { ResourceResponse } from "../types";
|
|
4
|
-
export type TDoctorToolResponse = ResourceResponse &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
hospitals: THospital[];
|
|
8
|
-
timings?: string;
|
|
9
|
-
experience?: string;
|
|
10
|
-
profile_link?: string;
|
|
11
|
-
profile_pic?: string;
|
|
12
|
-
languages?: string;
|
|
13
|
-
doctor_id: string;
|
|
14
|
-
};
|
|
15
|
-
export type THospital = {
|
|
16
|
-
name: string;
|
|
17
|
-
city?: string;
|
|
18
|
-
state?: string;
|
|
19
|
-
hospital_id: string;
|
|
20
|
-
region_id?: string;
|
|
21
|
-
};
|
|
22
|
-
export type TAvailableSlotsToolResponse = ResourceResponse & {
|
|
23
|
-
slots: string[];
|
|
24
|
-
};
|
|
25
|
-
export type TAvailabilityDatesToolResponse = ResourceResponse & {
|
|
26
|
-
available_dates: string[];
|
|
4
|
+
export type TDoctorToolResponse = ResourceResponse & TDoctorDetails;
|
|
5
|
+
export type TAvailableToolResponse = ResourceResponse & {
|
|
6
|
+
availability: TAvailability[];
|
|
27
7
|
};
|
|
28
8
|
export declare enum SYNAPSE_TOOL_NAME {
|
|
29
9
|
MOBILE_VERIFICATION = "mobile_verification",
|
|
30
|
-
|
|
31
|
-
AVAILABILITY_SLOTS = "availability_slots",
|
|
10
|
+
DOCTOR_AVAILABILITY = "doctor_availability",
|
|
32
11
|
DOCTOR_DETAILS = "doctor_details",
|
|
33
12
|
GET_LOCATION = "get_location"
|
|
34
13
|
}
|
|
@@ -50,31 +29,23 @@ export type ToolDetails = {
|
|
|
50
29
|
value: string;
|
|
51
30
|
}[];
|
|
52
31
|
mobile_number?: string;
|
|
53
|
-
|
|
32
|
+
doctors?: TDoctorAvailability[];
|
|
33
|
+
doctor_details?: TDoctorDetailsMap;
|
|
54
34
|
additional_option?: typeof MULTI_SELECT_ADDITIONAL_OPTION;
|
|
55
35
|
text: string;
|
|
56
36
|
};
|
|
57
37
|
component: SYNAPSE_COMPONENT_TYPES;
|
|
58
38
|
_meta: Record<string, unknown> & {
|
|
59
|
-
callbacks?:
|
|
39
|
+
callbacks?: TCallbacks[];
|
|
60
40
|
};
|
|
61
41
|
};
|
|
62
|
-
export type
|
|
63
|
-
[
|
|
64
|
-
tool_name: SYNAPSE_TOOL_NAME;
|
|
65
|
-
input_schema: Record<string, unknown>;
|
|
66
|
-
};
|
|
42
|
+
export type TDoctorDetailsMap = {
|
|
43
|
+
[doctor_id: string]: TDoctorDetails;
|
|
67
44
|
};
|
|
68
|
-
export declare enum SYNAPSE_TOOL_CALLBACK_NAME {
|
|
69
|
-
AVAILABILITY_DATES = "tool_callback_availability_dates",
|
|
70
|
-
AVAILABILITY_SLOTS = "tool_callback_availability_slots",
|
|
71
|
-
MOBILE_VERIFICATION = "tool_callback_mobile_verification",
|
|
72
|
-
DOCTOR_DETAILS = "tool_callback_doctor_details"
|
|
73
|
-
}
|
|
74
45
|
export type TGetLocationToolResponse = ResourceResponse & {
|
|
75
46
|
latitude: number;
|
|
76
47
|
longitude: number;
|
|
77
48
|
accuracy?: number;
|
|
78
49
|
};
|
|
79
|
-
export type ToolCallResponse = TDoctorToolResponse |
|
|
50
|
+
export type ToolCallResponse = TDoctorToolResponse | TAvailableToolResponse | TGetLocationToolResponse;
|
|
80
51
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/toolCall/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE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ACnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAC/B,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;KAG1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAC;AAgBxE,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,sBAAsB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SYNAPSE_COMPONENTS = exports.SYNAPSE_TOOL_NAME = void 0;
|
|
4
|
+
// export type TAvailabilityDatesToolResponse = ResourceResponse & {
|
|
5
|
+
// available_dates: string[];
|
|
6
|
+
// };
|
|
4
7
|
var SYNAPSE_TOOL_NAME;
|
|
5
8
|
(function (SYNAPSE_TOOL_NAME) {
|
|
6
9
|
SYNAPSE_TOOL_NAME["MOBILE_VERIFICATION"] = "mobile_verification";
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
// AVAILABILITY_DATES = "availability_dates",
|
|
11
|
+
// AVAILABILITY_SLOTS = "availability_slots",
|
|
12
|
+
SYNAPSE_TOOL_NAME["DOCTOR_AVAILABILITY"] = "doctor_availability";
|
|
9
13
|
SYNAPSE_TOOL_NAME["DOCTOR_DETAILS"] = "doctor_details";
|
|
10
14
|
SYNAPSE_TOOL_NAME["GET_LOCATION"] = "get_location";
|
|
11
15
|
})(SYNAPSE_TOOL_NAME || (exports.SYNAPSE_TOOL_NAME = SYNAPSE_TOOL_NAME = {}));
|
|
@@ -15,10 +19,3 @@ exports.SYNAPSE_COMPONENTS = {
|
|
|
15
19
|
MULTI: "multi",
|
|
16
20
|
DOCTOR_CARD: "doctor_card",
|
|
17
21
|
};
|
|
18
|
-
var SYNAPSE_TOOL_CALLBACK_NAME;
|
|
19
|
-
(function (SYNAPSE_TOOL_CALLBACK_NAME) {
|
|
20
|
-
SYNAPSE_TOOL_CALLBACK_NAME["AVAILABILITY_DATES"] = "tool_callback_availability_dates";
|
|
21
|
-
SYNAPSE_TOOL_CALLBACK_NAME["AVAILABILITY_SLOTS"] = "tool_callback_availability_slots";
|
|
22
|
-
SYNAPSE_TOOL_CALLBACK_NAME["MOBILE_VERIFICATION"] = "tool_callback_mobile_verification";
|
|
23
|
-
SYNAPSE_TOOL_CALLBACK_NAME["DOCTOR_DETAILS"] = "tool_callback_doctor_details";
|
|
24
|
-
})(SYNAPSE_TOOL_CALLBACK_NAME || (exports.SYNAPSE_TOOL_CALLBACK_NAME = SYNAPSE_TOOL_CALLBACK_NAME = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eka-care/medassist-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "TypeScript SDK for real-time medical chatbot experiences with session management, WebSocket connectivity, and media handling",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|