@ctchealth/plato-sdk 0.0.18 → 0.0.19

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.
@@ -0,0 +1,433 @@
1
+ /**
2
+ * Copyright (c) 2025 ctcHealth. All rights reserved.
3
+ *
4
+ * This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
5
+ *
6
+ * This source code and all related materials are confidential and proprietary to ctcHealth.
7
+ * Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
8
+ * and may result in disciplinary action and civil and/or criminal penalties.
9
+ *
10
+ * This software is intended solely for authorized use within ctcHealth and its designated partners.
11
+ *
12
+ * For internal use only.
13
+ */
14
+ export enum YearOfExperience {
15
+ '1-5' = '1-5 years',
16
+ '6-10' = '6-10 years',
17
+ '11-20' = '16-20 years',
18
+ '20+' = '20+ years',
19
+ }
20
+
21
+ export enum PracticeType {
22
+ Private = 'Private Practice',
23
+ Hospital = 'Hospital',
24
+ AcademicMedicalCenter = 'Academic Medical Center',
25
+ Clinic = 'Clinic',
26
+ }
27
+ export enum SegmentType {
28
+ Traditionalist = 'The Traditionalist',
29
+ Innovator = 'The Innovator',
30
+ PatientOrientedPhysician = 'The Patient-Oriented Physician',
31
+ FinanciallyDrivenPrescriber = 'The Financially-Driven Prescriber',
32
+ EvidencePurist = 'The Evidence-Purist',
33
+ CostConsciousPrescriber = 'The Cost-Conscious Prescriber',
34
+ }
35
+
36
+ export enum AssistantVoiceGender {
37
+ Male = 'Male',
38
+ Female = 'Female',
39
+ }
40
+
41
+ export enum AvatarLanguage {
42
+ English = 'en',
43
+ German = 'de',
44
+ Spanish = 'es',
45
+ Italian = 'it',
46
+ French = 'fr',
47
+ Arabic = 'ar',
48
+ Russian = 'ru',
49
+ }
50
+
51
+ export class PersonalityAndBehaviourDto {
52
+ riskTolerance!: number;
53
+ researchOrientation!: number;
54
+ recognitionNeed!: number;
55
+ brandLoyalty!: number;
56
+ patientEmpathy!: number;
57
+ }
58
+
59
+ export class ProfessionalProfileDto {
60
+ practiceSettings!: string;
61
+ yearOfExperience!: number;
62
+ specialityAndDepartment!: string;
63
+ location!: string;
64
+ }
65
+
66
+ export class ContextDto {
67
+ subSpecialityOrTherapyFocus!: string;
68
+ typicalPatientMix!: string;
69
+ keyClinicalDrivers!: string;
70
+ }
71
+
72
+ export class CharacterCreateDto {
73
+ name!: string;
74
+ professionalProfile!: ProfessionalProfileDto;
75
+ segment!: SegmentType;
76
+ personalityAndBehaviour!: PersonalityAndBehaviourDto;
77
+ context!: ContextDto;
78
+ assistantGender?: AssistantVoiceGender;
79
+ }
80
+
81
+ export class ProductConfig {
82
+ name!: string;
83
+ description!: string;
84
+ }
85
+
86
+ export class CreateSimulationDto {
87
+ persona!: CharacterCreateDto;
88
+ product!: ProductConfig;
89
+ scenario!: string;
90
+ objectives?: string;
91
+ anticipatedObjections?: string;
92
+ imageId!: string;
93
+ avatarLanguage!: AvatarLanguage;
94
+ pdfSlideId?: string;
95
+ }
96
+
97
+ export type RecordingsLimit = 5 | 10 | 25;
98
+
99
+ export class SimulationRecordingsQueryDto {
100
+ limit?: RecordingsLimit;
101
+ page?: number;
102
+ sort?: SortOrder;
103
+ }
104
+
105
+ export enum SortOrder {
106
+ ASC = 'asc',
107
+ DESC = 'desc',
108
+ }
109
+
110
+ export enum RecordingStatus {
111
+ STARTED = 'STARTED',
112
+ PROCESSING = 'PROCESSING',
113
+ FINISHED = 'FINISHED',
114
+ FAILED = 'FAILED',
115
+ }
116
+
117
+ export class SimulationRecordingsDto {
118
+ _id!: string;
119
+ createdAt!: Date;
120
+ recordingStatus?: RecordingStatus;
121
+ }
122
+
123
+ //
124
+ export interface CallCreateDto {
125
+ /**
126
+ * Call ID obtained
127
+ */
128
+ callId: string;
129
+ /**
130
+ * Call Assistant ID
131
+ */
132
+ assistantId: string;
133
+ }
134
+
135
+ export interface CallDTO {
136
+ /**
137
+ * call ID
138
+ */
139
+ _id: string;
140
+ /**
141
+ * call ID obtained
142
+ */
143
+ callId: string;
144
+ /**
145
+ * call User ID
146
+ */
147
+ platoUserId: string;
148
+ /**
149
+ * call Assistant ID
150
+ */
151
+ assistantId: string;
152
+ /**
153
+ * call summary of the conversation
154
+ */
155
+ summary: string;
156
+ /**
157
+ * call transcript of the conversation
158
+ */
159
+ transcript: string;
160
+ /**
161
+ * call feedback provided by the user
162
+ */
163
+ feedback: string;
164
+ /**
165
+ * Success Evaluation returned by model
166
+ */
167
+ successEvaluation: boolean;
168
+ /**
169
+ * call Recording URL
170
+ */
171
+ recordingUrl: string;
172
+ /**
173
+ * Status of recording processing (e.g., 'STARTED', 'PROCESSING', 'FINISHED', 'FAILED')
174
+ */
175
+ recordingStatus?: RecordingStatus;
176
+ /**
177
+ * Date and Time of the creation of the message
178
+ */
179
+ createdAt: Date;
180
+ /**
181
+ * Date and Time of the creation of the message
182
+ */
183
+ endedAt: Date;
184
+ /**
185
+ * Rating of the call given by the user
186
+ */
187
+ rating: number;
188
+ /**
189
+ * Main strenghts of the user conversation based on the analysis of the AI
190
+ */
191
+ strengths: Array<string>;
192
+ /**
193
+ * Main weak points of the user conversation based on the analysis of the AI
194
+ */
195
+ weaknesses: Array<string>;
196
+ /**
197
+ * Name of Metric for the AI feedback report
198
+ */
199
+ metric1: string;
200
+ /**
201
+ * Name of Metric for the AI feedback report
202
+ */
203
+ metric2: string;
204
+ /**
205
+ * Name of Metric for the AI feedback report
206
+ */
207
+ metric3: string;
208
+ /**
209
+ * AI feedback value for Metric 1
210
+ */
211
+ metric1Value: number;
212
+ /**
213
+ * AI feedback value for Metric 2
214
+ */
215
+ metric2Value: number;
216
+ /**
217
+ * AI feedback value for Metric 3
218
+ */
219
+ metric3Value: number;
220
+ /**
221
+ * AI feedback value for the call score
222
+ */
223
+ score?: number;
224
+ /**
225
+ * Defines if the calls will be consider for the memory feature
226
+ */
227
+ inMemory: boolean;
228
+ /**
229
+ * Duration of the call in milliseconds
230
+ */
231
+ callDurationMs?: number;
232
+ }
233
+
234
+ export enum CreationPhase {
235
+ QUEUED = 'QUEUED',
236
+ STARTING = 'STARTING',
237
+ BUILD_HEADER = 'BUILD_HEADER',
238
+ SEGMENT_SELECTED = 'SEGMENT_SELECTED',
239
+ BUILD_CONTEXT = 'BUILD_CONTEXT',
240
+ BUILD_PSYCHOGRAPHICS = 'BUILD_PSYCHOGRAPHICS',
241
+ BUILD_OBJECTIVES = 'BUILD_OBJECTIVES',
242
+ PERSONA_ASSEMBLED = 'PERSONA_ASSEMBLED',
243
+ CORE = 'CORE',
244
+ BOUNDARIES = 'BOUNDARIES',
245
+ SPEECH_AND_THOUGHT = 'SPEECH_AND_THOUGHT',
246
+ CONVERSATION_EVOLUTION = 'CONVERSATION_EVOLUTION',
247
+ MEMORY = 'MEMORY',
248
+ OBJECTION_HANDLING = 'OBJECTION_HANDLING',
249
+ PERFORMANCE_EVALUATION = 'PERFORMANCE_EVALUATION',
250
+ BEHAVIORAL_FRAMEWORKS = 'BEHAVIORAL_FRAMEWORKS',
251
+ FINISHED = 'FINISHED',
252
+ ERROR = 'ERROR',
253
+ }
254
+
255
+ /**
256
+ * Presigned POST data for S3 upload.
257
+ */
258
+ export interface PresignedPost {
259
+ url: string;
260
+ fields: Record<string, string>;
261
+ }
262
+
263
+ /**
264
+ * Response for requesting a PDF upload.
265
+ */
266
+ export interface RequestPdfUploadResponse {
267
+ presignedPost: PresignedPost;
268
+ objectKey: string;
269
+ pdfId: string;
270
+ }
271
+
272
+ /**
273
+ * Persona description within simulation briefing
274
+ */
275
+ export interface PersonaDescriptionDto {
276
+ summary: string;
277
+ details: string[];
278
+ }
279
+
280
+ /**
281
+ * Scenario context within simulation briefing
282
+ */
283
+ export interface ScenarioContextDto {
284
+ summary: string;
285
+ steps: string[];
286
+ }
287
+
288
+ /**
289
+ * Training objectives within simulation briefing
290
+ */
291
+ export interface TrainingObjectiveDto {
292
+ summary: string;
293
+ keyObjectives: string[];
294
+ }
295
+
296
+ /**
297
+ * Complete simulation briefing structure generated by multi-agent system
298
+ */
299
+ export interface SimulationBriefingDto {
300
+ objectiveTag: string;
301
+ personaDescription: PersonaDescriptionDto;
302
+ scenarioContext: ScenarioContextDto;
303
+ trainingObjective: TrainingObjectiveDto;
304
+ }
305
+
306
+ export interface SimulationDetailsDto {
307
+ simulationId: string;
308
+ phase: CreationPhase;
309
+ assistantId: string;
310
+ configuration?: CreateSimulationDto;
311
+ simulationBriefing?: SimulationBriefingDto;
312
+ createdAt: Date;
313
+ updatedAt: Date;
314
+ }
315
+
316
+ export enum RecommendationPriority {
317
+ HIGH = 'high',
318
+ MEDIUM = 'medium',
319
+ LOW = 'low',
320
+ }
321
+
322
+ export interface RecommendationItemDto {
323
+ title: string;
324
+ description: string;
325
+ priority: RecommendationPriority;
326
+ }
327
+
328
+ export interface PerformancePatternDto {
329
+ strength: string;
330
+ frequency: number;
331
+ }
332
+
333
+ export interface ImprovementAreaDto {
334
+ area: string;
335
+ frequency: number;
336
+ }
337
+
338
+ export interface RecommendationsResponseDto {
339
+ recommendations: RecommendationItemDto[];
340
+ strengths: PerformancePatternDto[];
341
+ improvementAreas: ImprovementAreaDto[];
342
+ summary: string;
343
+ callsAnalyzed: number;
344
+ generatedAt: Date;
345
+ }
346
+
347
+ export enum PdfSlidesStatus {
348
+ PENDING = 'pending',
349
+ STARTED = 'started',
350
+ PROCESSING = 'processing',
351
+ OVERVIEW = 'overview',
352
+ COMPLETED = 'completed',
353
+ FAILED = 'failed',
354
+ }
355
+
356
+ export interface CheckPdfStatusResponse {
357
+ status: PdfSlidesStatus;
358
+ processedBatches: number[];
359
+ totalBatches?: number;
360
+ }
361
+
362
+ export enum PdfSlidesSortField {
363
+ CREATED_AT = 'createdAt',
364
+ FILENAME = 'originalFilename',
365
+ TOTAL_SLIDES = 'totalSlides',
366
+ }
367
+
368
+ export class PdfSlidesAnalysisQueryDto {
369
+ limit?: RecordingsLimit;
370
+ page?: number;
371
+ sort?: SortOrder;
372
+ sortBy?: PdfSlidesSortField;
373
+ }
374
+
375
+ export interface SlideAnalysis {
376
+ slideNumber: number;
377
+ title?: string;
378
+ textExtraction?: string;
379
+ visualDescription?: string;
380
+ }
381
+
382
+ export interface PdfSlidesDto {
383
+ _id: string;
384
+ status: PdfSlidesStatus;
385
+ originalFilename: string;
386
+ totalSlides?: number;
387
+ lessonOverview?: string;
388
+ createdAt: Date;
389
+ updatedAt: Date;
390
+ }
391
+
392
+ export interface PdfSlideDto {
393
+ _id: string;
394
+ status: PdfSlidesStatus;
395
+ originalFilename: string;
396
+ totalSlides?: number;
397
+ lessonOverview?: string;
398
+ slideAnalysis?: SlideAnalysis[];
399
+ createdAt: Date;
400
+ updatedAt: Date;
401
+ }
402
+
403
+ export interface AssistantImageDto {
404
+ _id: string;
405
+ imageUrl: string;
406
+ }
407
+
408
+ /**
409
+ * Represents the state of an active call stored in localStorage for recovery purposes.
410
+ * Used to detect and recover abandoned calls after page refresh.
411
+ */
412
+ export interface ActiveCallState {
413
+ /**
414
+ * MongoDB ID of the call record
415
+ */
416
+ callId: string;
417
+ /**
418
+ * External call provider ID
419
+ */
420
+ externalCallId: string;
421
+ /**
422
+ * ID of the simulation this call belongs to
423
+ */
424
+ simulationId: string;
425
+ /**
426
+ * ISO 8601 timestamp when the call was started
427
+ */
428
+ startedAt: string;
429
+ /**
430
+ * Schema version for future compatibility
431
+ */
432
+ version: number;
433
+ }