@ctchealth/plato-sdk 0.0.16 → 0.0.17

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