@ctchealth/plato-sdk 0.0.8 → 0.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/README.md ADDED
@@ -0,0 +1,404 @@
1
+ # Plato SDK
2
+
3
+ A TypeScript SDK for interacting with the Plato API to create and manage AI-powered medical training simulations.
4
+
5
+ ## Overview
6
+
7
+ The Plato SDK provides a simple and type-safe way to integrate with the Plato platform, allowing you to create medical training simulations with AI personas and manage voice-based interactions.
8
+
9
+ ## Features
10
+
11
+ - Create AI personas with customizable professional profiles and personalities
12
+ - Real-time voice interactions with AI assistants
13
+ - Comprehensive event system for call management
14
+ - Type-safe API with full TypeScript support
15
+ - Medical training simulation configuration
16
+ - Simulation persistence and recovery across page reloads
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install plato-sdk
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```typescript
27
+ import { PlatoApiClient } from 'plato-sdk';
28
+
29
+ // Initialize the client
30
+ const client = new PlatoApiClient({
31
+ baseUrl: 'https://your-plato-api.com',
32
+ token: 'your-api-token',
33
+ user: 'test@test.test',
34
+ });
35
+
36
+ // Create a simulation
37
+ const simulation = await client.createSimulation({
38
+ persona: {
39
+ professionalProfile: {
40
+ location: 'City Hospital, New York',
41
+ practiceSettings: 'Outpatient Clinic',
42
+ yearOfExperience: 12,
43
+ specialityAndDepartment: 'Cardiology',
44
+ },
45
+ segment: SegmentType.CostConsciousPrescriber,
46
+ assistantGender: AssistantVoiceGender.Male,
47
+ name: 'Dr Vegapunk',
48
+ personalityAndBehaviour: {
49
+ riskTolerance: 40,
50
+ researchOrientation: 70,
51
+ recognitionNeed: 60,
52
+ brandLoyalty: 55,
53
+ patientEmpathy: 80,
54
+ },
55
+ context: {
56
+ subSpecialityOrTherapyFocus: 'Hypertension management',
57
+ typicalPatientMix: 'Elderly with comorbidities',
58
+ keyClinicalDrivers: 'Reducing cardiovascular risk',
59
+ },
60
+ },
61
+ product: {
62
+ name: 'Ibuprofen 1000mg',
63
+ description:
64
+ 'A nonsteroidal anti-inflammatory drug used to reduce pain, inflammation, and fever',
65
+ },
66
+ presentation: 'Oral tablets, 10 tablets per pack',
67
+ scenario: 'Discussing treatment options for an elderly patient with chronic arthritis',
68
+ objectives:
69
+ 'Demonstrate efficacy of Ibuprofen in pain management Highlight safety profile and contraindications Encourage patient adherence',
70
+ anticipatedObjections:
71
+ 'Concerns about gastrointestinal side effects Preference for lower-cost generic alternatives Potential interactions with other medications',
72
+ });
73
+
74
+ // Check the simulation status - If simulation creation phase is equals to FINISHED, the simulation is ready to use
75
+ // If the simulation creation phase is ERROR the simulation creation failed and you need to retry creating a new one
76
+ // tip: you can also check the simulation status periodically using a polling mechanism
77
+ const status = await client.getSimulationStatus(simulation.simulationId);
78
+
79
+ // Start a voice call
80
+ const call = await client.startCall(simulation.simulationId);
81
+
82
+ // Listen to call events
83
+ call.on('call-start', () => {
84
+ console.log('Call started');
85
+ });
86
+
87
+ call.on('message', message => {
88
+ console.log('Message received:', message.transcript);
89
+ });
90
+
91
+ call.on('call-end', () => {
92
+ console.log('Call ended');
93
+ });
94
+
95
+ // Stop the call when done
96
+ call.stopCall();
97
+ ```
98
+
99
+ ## API Reference
100
+
101
+ ### PlatoApiClient
102
+
103
+ The main class for interacting with the Plato API.
104
+
105
+ #### Constructor
106
+
107
+ ```typescript
108
+ new PlatoApiClient(config: ApiClientConfig)
109
+ ```
110
+
111
+ **Parameters:**
112
+
113
+ - `config.baseUrl` (string): The base URL of the Plato API
114
+ - `config.token` (string): Your API authentication token
115
+ - `config.user` (string): Your user identifier
116
+
117
+ #### Methods
118
+
119
+ ##### createSimulation(params: CreateSimulationDto)
120
+
121
+ Creates a new medical training simulation. It may take a few minutes for the simulation to be ready for use.
122
+
123
+ **Returns:** `Promise<{ simulationId: string, phase: CreationPhase }>`
124
+
125
+ ##### startCall(simulationId: string)
126
+
127
+ Starts a voice call with the AI persona for the specified simulation.
128
+
129
+ **Returns:** Object with:
130
+
131
+ - `stopCall()`: Function to end the call
132
+ - `callId`: Unique identifier for the call
133
+ - `on<K>(event: K, listener: CallEventListener<K>)`: Subscribe to call events
134
+ - `off<K>(event: K, listener: CallEventListener<K>)`: Unsubscribe from call events
135
+
136
+ ##### getCallDetails(callId: string)
137
+
138
+ Retrieves detailed information about a completed call, including transcript, summary, recording URL, ratings, and evaluation metrics.
139
+
140
+ **Parameters:**
141
+
142
+ - `callId` (string): The MongoDB `_id` of the call
143
+
144
+ **Returns:** `Promise<CallDTO>` — An object containing:
145
+
146
+ - `_id`: MongoDB ID of the call
147
+ - `summary`: Summary of the conversation
148
+ - `transcript`: Full transcript of the call
149
+ - `recordingUrl`: URL to access the call recording
150
+ - `rating`: User-provided rating (0-5)
151
+ - `successEvaluation`: Boolean indicating if the call was successful
152
+ - `score`: Overall score for the call
153
+ - `strengths`: Array of identified strengths
154
+ - `weaknesses`: Array of identified weaknesses
155
+ - `metric1`, `metric2`, `metric3`: Evaluation metric names
156
+ - `metric1Value`, `metric2Value`, `metric3Value`: Values for each metric
157
+ - `createdAt`: Timestamp when the call was created
158
+ - `endedAt`: Timestamp when the call ended
159
+ - `callDurationMs`: Duration of the call in milliseconds
160
+ - And other call-related fields
161
+
162
+ **Example:**
163
+
164
+ ```typescript
165
+ // After a call has ended, retrieve its details
166
+ const callDetails = await client.getCallDetails(call._id);
167
+ console.log('Call Summary:', callDetails.summary);
168
+ ```
169
+
170
+ ##### getCallRecordings(queryParams: SimulationRecordingsQueryDto)
171
+
172
+ Retrieves a paginated list of call recordings for the authenticated user.
173
+
174
+ **Parameters:**
175
+
176
+ - `queryParams` (SimulationRecordingsQueryDto): Query parameters for filtering and pagination
177
+ - `limit` (optional): Number of recordings per page (`5`, `10`, or `25`)
178
+ - `page` (optional): Page number for pagination
179
+ - `sort` (optional): Sort order (`'asc'` or `'desc'`)
180
+
181
+ **Returns:** `Promise<SimulationRecordingsDto[]>` — An array of recording objects, each containing:
182
+
183
+ - `_id`: MongoDB ID of the call
184
+ - `createdAt`: Timestamp when the call was created
185
+ - `recordingStatus`: Status of the recording (`'STARTED'`, `'PROCESSING'`, `'FINISHED'`, or `'FAILED'`)
186
+
187
+ **Example:**
188
+
189
+ ```typescript
190
+ // Get the 10 most recent call recordings
191
+ const recordings = await client.getCallRecordings({
192
+ limit: 10,
193
+ page: 1,
194
+ sort: 'desc',
195
+ });
196
+
197
+ recordings.forEach(recording => {
198
+ console.log(`Call ${recording._id} - Status: ${recording.recordingStatus}`);
199
+ });
200
+ ```
201
+
202
+ ##### getCallRecording(callId: string)
203
+
204
+ Retrieves the recording URL for a specific call.
205
+
206
+ **Parameters:**
207
+
208
+ - `callId` (string): The MongoDB `_id` of the call
209
+
210
+ **Returns:** `Promise<string>` — The URL to access the call recording
211
+
212
+ **Example:**
213
+
214
+ ```typescript
215
+ // Get the recording URL for a specific call
216
+ const recordingUrl = await client.getCallRecording(call._id);
217
+ console.log('Recording URL:', recordingUrl);
218
+ ```
219
+
220
+ ## Checking Simulation Status
221
+
222
+ You can check the current phase/status of a simulation using the `checkSimulationStatus` method. This is useful for polling the simulation creation process until it is ready or has failed.
223
+
224
+ ```typescript
225
+ const status = await client.checkSimulationStatus(simulation.simulationId);
226
+ console.log('Current phase:', status.phase); // e.g., 'FINISHED', 'ERROR', etc.
227
+ ```
228
+
229
+ - **Returns:** `{ phase: CreationPhase }` — The current phase of the simulation creation process.
230
+ - **Typical usage:** Poll this method until the phase is `FINISHED` or `ERROR` before starting a call.
231
+
232
+ ## Simulation Persistence
233
+
234
+ Simulations are persisted server-side and can be recovered after page reloads. Store the simulation ID client-side (e.g., localStorage) for quick recovery.
235
+
236
+ ### getSimulationDetails(simulationId: string)
237
+
238
+ Retrieves detailed information about a simulation, including its original configuration.
239
+
240
+ **Returns:** `Promise<SimulationDetailsDto>` containing:
241
+
242
+ - `simulationId`: MongoDB ID
243
+ - `phase`: Current creation phase
244
+ - `assistantId`: The assistant ID (available after creation)
245
+ - `configuration`: Original `CreateSimulationDto`
246
+ - `createdAt`, `updatedAt`: Timestamps
247
+
248
+ **Example:**
249
+
250
+ ```typescript
251
+ // Store simulation ID after creation
252
+ const simulation = await client.createSimulation(config);
253
+ localStorage.setItem('plato_simulation_id', simulation.simulationId);
254
+
255
+ // Recover simulation on page reload
256
+ const simulationId = localStorage.getItem('plato_simulation_id');
257
+ if (simulationId) {
258
+ const details = await client.getSimulationDetails(simulationId);
259
+
260
+ if (details.phase !== CreationPhase.ERROR) {
261
+ // Resume polling if still in progress
262
+ if (details.phase !== CreationPhase.FINISHED) {
263
+ startPolling(details.simulationId);
264
+ }
265
+ } else {
266
+ localStorage.removeItem('plato_simulation_id');
267
+ }
268
+ }
269
+ ```
270
+
271
+ ### getUserSimulations()
272
+
273
+ Retrieves all simulations for the authenticated user. Useful when the simulation ID is not stored locally.
274
+
275
+ **Returns:** `Promise<Array<{ simulationId: string; phase: CreationPhase }>>`
276
+
277
+ **Example:**
278
+
279
+ ```typescript
280
+ const simulations = await client.getUserSimulations();
281
+ const inProgress = simulations.find(
282
+ sim => sim.phase !== CreationPhase.FINISHED && sim.phase !== CreationPhase.ERROR
283
+ );
284
+ ```
285
+
286
+ ## Event System
287
+
288
+ The SDK provides a comprehensive event system for managing voice calls:
289
+
290
+ ### Available Events
291
+
292
+ - `call-start`: Triggered when a call begins
293
+ - `call-end`: Triggered when a call ends
294
+ - `speech-start`: Triggered when speech detection starts
295
+ - `speech-end`: Triggered when speech detection ends
296
+ - `message`: Triggered when a message is received (contains transcript and metadata)
297
+ - `volume-level`: Triggered with volume level updates (number)
298
+ - `error`: Triggered when an error occurs
299
+
300
+ ### Event Usage
301
+
302
+ ```typescript
303
+ // Subscribe to events
304
+ call.on('message', message => {
305
+ console.log('Transcript:', message.transcript);
306
+ console.log('Type:', message.transcriptType); // 'final' or 'partial'
307
+ });
308
+
309
+ call.on('volume-level', level => {
310
+ console.log('Volume level:', level);
311
+ });
312
+
313
+ call.on('error', error => {
314
+ console.error('Call error:', error);
315
+ });
316
+ ```
317
+
318
+ ## Data Types
319
+
320
+ ### CreateSimulationDto
321
+
322
+ Configuration for creating a simulation:
323
+
324
+ ```typescript
325
+ interface CreateSimulationDto {
326
+ persona: CharacterCreateDto;
327
+ product: ProductConfig;
328
+ presentation?: string;
329
+ scenario: string;
330
+ objectives?: string;
331
+ anticipatedObjections?: string;
332
+ trainingConfiguration: TrainingConfigurationDto;
333
+ }
334
+ ```
335
+
336
+ ### CharacterCreateDto
337
+
338
+ AI persona configuration:
339
+
340
+ ```typescript
341
+ interface CharacterCreateDto {
342
+ name: string;
343
+ professionalProfile: ProfessionalProfileDto;
344
+ segment: SegmentType;
345
+ personalityAndBehaviour: PersonalityAndBehaviourDto;
346
+ context: ContextDto;
347
+ assistantGender?: AssistantVoiceGender;
348
+ }
349
+ ```
350
+
351
+ ### SimulationDetailsDto
352
+
353
+ Detailed simulation information returned by `getSimulationDetails()`:
354
+
355
+ ```typescript
356
+ interface SimulationDetailsDto {
357
+ simulationId: string;
358
+ phase: CreationPhase;
359
+ assistantId: string;
360
+ configuration?: CreateSimulationDto;
361
+ createdAt: Date;
362
+ updatedAt: Date;
363
+ }
364
+ ```
365
+
366
+ ### CreationPhase
367
+
368
+ Enum representing the simulation creation phases:
369
+
370
+ ```typescript
371
+ enum CreationPhase {
372
+ STARTING = 'STARTING',
373
+ CORE = 'CORE',
374
+ BOUNDARIES = 'BOUNDARIES',
375
+ SPEECH_AND_THOUGHT = 'SPEECH_AND_THOUGHT',
376
+ CONVERSATION_EVOLUTION = 'CONVERSATION_EVOLUTION',
377
+ MEMORY = 'MEMORY',
378
+ FINISHED = 'FINISHED',
379
+ ERROR = 'ERROR',
380
+ }
381
+ ```
382
+
383
+ ## Error Handling
384
+
385
+ The SDK throws errors for invalid configurations and API failures:
386
+
387
+ ```typescript
388
+ try {
389
+ const client = new PlatoApiClient({
390
+ baseUrl: 'https://api.plato.com',
391
+ token: 'your-token',
392
+ user: 'your-user',
393
+ });
394
+
395
+ const simulation = await client.createSimulation(simulationConfig);
396
+ const call = await client.startCall(simulation.simulationId);
397
+ } catch (error) {
398
+ console.error('Error:', error.message);
399
+ }
400
+ ```
401
+
402
+ ## Support
403
+
404
+ For support and questions, please contact the development team.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctchealth/plato-sdk",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
6
  "@vapi-ai/web": "2.1.8",
@@ -12,5 +12,5 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "types": "./../libs/plato-sdk/src/index.d.ts"
15
+ "types": "./src/index.d.ts"
16
16
  }
package/src/index.d.ts CHANGED
@@ -1 +1,14 @@
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
+ */
1
14
  export * from './lib/plato-sdk';
package/src/index.js CHANGED
@@ -1,5 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ /**
5
+ * Copyright (c) 2025 ctcHealth. All rights reserved.
6
+ *
7
+ * This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
8
+ *
9
+ * This source code and all related materials are confidential and proprietary to ctcHealth.
10
+ * Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
11
+ * and may result in disciplinary action and civil and/or criminal penalties.
12
+ *
13
+ * This software is intended solely for authorized use within ctcHealth and its designated partners.
14
+ *
15
+ * For internal use only.
16
+ */
4
17
  tslib_1.__exportStar(require("./lib/plato-sdk"), exports);
5
18
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plato-sdk/src/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plato-sdk/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,0DAAgC"}
@@ -70,8 +70,8 @@ export declare class CreateSimulationDto {
70
70
  product: ProductConfig;
71
71
  presentation?: string;
72
72
  scenario: string;
73
- objectives?: string[];
74
- anticipatedObjections?: string[];
73
+ objectives?: string;
74
+ anticipatedObjections?: string;
75
75
  }
76
76
  export type RecordingsLimit = 5 | 10 | 25;
77
77
  export declare class SimulationRecordingsQueryDto {
@@ -197,11 +197,10 @@ export interface CallDTO {
197
197
  * Defines if the calls will be consider for the memory feature
198
198
  */
199
199
  inMemory: boolean;
200
- }
201
- export declare enum CreationStatus {
202
- CREATING = "CREATING",
203
- READY = "READY",
204
- ERROR = "ERROR"
200
+ /**
201
+ * Duration of the call in milliseconds
202
+ */
203
+ callDurationMs?: number;
205
204
  }
206
205
  export declare enum CreationPhase {
207
206
  STARTING = "STARTING",
@@ -213,3 +212,32 @@ export declare enum CreationPhase {
213
212
  FINISHED = "FINISHED",
214
213
  ERROR = "ERROR"
215
214
  }
215
+ /**
216
+ * Response DTO for PDF file upload.
217
+ */
218
+ export interface UploadPdfSlidesResponseDto {
219
+ /**
220
+ * The S3 object key where the PDF was saved
221
+ */
222
+ objectKey: string;
223
+ /**
224
+ * The original filename
225
+ */
226
+ filename: string;
227
+ /**
228
+ * The file size in bytes
229
+ */
230
+ size: number;
231
+ /**
232
+ * The content type of the file
233
+ */
234
+ contentType: string;
235
+ }
236
+ export interface SimulationDetailsDto {
237
+ simulationId: string;
238
+ phase: CreationPhase;
239
+ assistantId: string;
240
+ configuration?: CreateSimulationDto;
241
+ createdAt: Date;
242
+ updatedAt: Date;
243
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreationPhase = exports.CreationStatus = exports.SimulationRecordingsDto = exports.RecordingStatus = exports.SortOrder = exports.SimulationRecordingsQueryDto = exports.CreateSimulationDto = exports.ProductConfig = exports.CharacterCreateDto = exports.ContextDto = exports.ProfessionalProfileDto = exports.PersonalityAndBehaviourDto = exports.AssistantVoiceGender = exports.SegmentType = exports.PracticeType = exports.YearOfExperience = void 0;
3
+ exports.CreationPhase = exports.SimulationRecordingsDto = exports.RecordingStatus = exports.SortOrder = exports.SimulationRecordingsQueryDto = exports.CreateSimulationDto = exports.ProductConfig = exports.CharacterCreateDto = exports.ContextDto = exports.ProfessionalProfileDto = exports.PersonalityAndBehaviourDto = exports.AssistantVoiceGender = exports.SegmentType = exports.PracticeType = exports.YearOfExperience = void 0;
4
4
  /**
5
5
  * Copyright (c) 2025 ctcHealth. All rights reserved.
6
6
  *
@@ -110,12 +110,6 @@ class SimulationRecordingsDto {
110
110
  recordingStatus;
111
111
  }
112
112
  exports.SimulationRecordingsDto = SimulationRecordingsDto;
113
- var CreationStatus;
114
- (function (CreationStatus) {
115
- CreationStatus["CREATING"] = "CREATING";
116
- CreationStatus["READY"] = "READY";
117
- CreationStatus["ERROR"] = "ERROR";
118
- })(CreationStatus || (exports.CreationStatus = CreationStatus = {}));
119
113
  var CreationPhase;
120
114
  (function (CreationPhase) {
121
115
  CreationPhase["STARTING"] = "STARTING";
@@ -1 +1 @@
1
- {"version":3,"file":"plato-intefaces.js","sourceRoot":"","sources":["../../../../../libs/plato-sdk/src/lib/plato-intefaces.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;AACrB,CAAC,EALW,g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B,CAAY;CAClC;AAPD,kDAOC;AAID,MAAa,4BAA4B;IACvC,KAAK,CAAmB;IACxB,IAAI,CAAU;IACd,IAAI,CAAa;CAClB;AAJD,oEAIC;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;AACnB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAED,MAAa,uBAAuB;IAClC,GAAG,CAAU;IACb,SAAS,CAAQ;IACjB,eAAe,CAAmB;CACnC;AAJD,0DAIC;AA6GD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AACD,IAAY,aASX;AATD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,0DAAyC,CAAA;IACzC,kEAAiD,CAAA;IACjD,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACjB,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB"}
1
+ {"version":3,"file":"plato-intefaces.js","sourceRoot":"","sources":["../../../../../libs/plato-sdk/src/lib/plato-intefaces.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;AACrB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,qCAAqB,CAA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B;AAJD,oEAIC;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;AACnB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAED,MAAa,uBAAuB;IAClC,GAAG,CAAU;IACb,SAAS,CAAQ;IACjB,eAAe,CAAmB;CACnC;AAJD,0DAIC;AAiHD,IAAY,aASX;AATD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,0DAAyC,CAAA;IACzC,kEAAiD,CAAA;IACjD,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;AACjB,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB"}
@@ -1,26 +1,38 @@
1
- import { CallDTO, CreateSimulationDto, CreationPhase, SimulationRecordingsDto, SimulationRecordingsQueryDto } from './plato-intefaces';
1
+ import { CallDTO, CreateSimulationDto, CreationPhase, SimulationRecordingsDto, SimulationRecordingsQueryDto, UploadPdfSlidesResponseDto, SimulationDetailsDto } from './plato-intefaces';
2
2
  export interface ApiClientConfig {
3
3
  baseUrl: string;
4
4
  token?: string;
5
5
  user?: string;
6
6
  }
7
+ export interface ToolCall {
8
+ function: {
9
+ name: string;
10
+ arguments: {
11
+ slideNumber?: number;
12
+ progressObjectiveNumber?: number;
13
+ [key: string]: unknown;
14
+ };
15
+ };
16
+ id: string;
17
+ }
7
18
  /**
8
19
  * Event map for call events, providing strict typing for each event's payload.
20
+ * There are no inputs for the events and all of them return void.
9
21
  */
10
22
  export interface CallEventMap {
11
- 'call-start': void;
12
- 'call-end': void;
13
- 'speech-start': void;
14
- 'speech-end': void;
23
+ 'call-start': undefined;
24
+ 'call-end': undefined;
25
+ 'speech-start': undefined;
26
+ 'speech-end': undefined;
15
27
  error: Error;
16
28
  message: {
17
29
  type: string;
18
30
  role: string;
19
31
  transcript?: string;
20
32
  transcriptType: 'final' | 'partial';
21
- toolCallList?: any[];
22
- toolCalls?: any[];
23
- [key: string]: any;
33
+ toolCallList?: ToolCall[];
34
+ toolCalls?: ToolCall[];
35
+ [key: string]: unknown;
24
36
  };
25
37
  'volume-level': number;
26
38
  }
@@ -57,6 +69,11 @@ export declare class PlatoApiClient {
57
69
  checkSimulationStatus(simulationId: string): Promise<{
58
70
  phase: CreationPhase;
59
71
  }>;
72
+ getUserSimulations(): Promise<Array<{
73
+ simulationId: string;
74
+ phase: CreationPhase;
75
+ }>>;
76
+ getSimulationDetails(simulationId: string): Promise<SimulationDetailsDto>;
60
77
  getCallDetails(callId: string): Promise<CallDTO>;
61
78
  getCallRecordings(queryParams: SimulationRecordingsQueryDto): Promise<SimulationRecordingsDto[]>;
62
79
  getCallRecording(callId: string): Promise<string>;
@@ -81,4 +98,5 @@ export declare class PlatoApiClient {
81
98
  off: <K extends CallEventNames>(event: K, listener: CallEventListener<K>) => void;
82
99
  }>;
83
100
  private createCall;
101
+ uploadPdfSlides(file: File | Blob): Promise<UploadPdfSlidesResponseDto>;
84
102
  }
@@ -2,6 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlatoApiClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ /**
6
+ * Copyright (c) 2025 ctcHealth. All rights reserved.
7
+ *
8
+ * This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
9
+ *
10
+ * This source code and all related materials are confidential and proprietary to ctcHealth.
11
+ * Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
12
+ * and may result in disciplinary action and civil and/or criminal penalties.
13
+ *
14
+ * This software is intended solely for authorized use within ctcHealth and its designated partners.
15
+ *
16
+ * For internal use only.
17
+ */
5
18
  const axios_1 = tslib_1.__importDefault(require("axios"));
6
19
  const web_1 = tslib_1.__importDefault(require("@vapi-ai/web"));
7
20
  class PlatoApiClient {
@@ -51,7 +64,10 @@ class PlatoApiClient {
51
64
  if (!this.eventListeners[event]) {
52
65
  this.eventListeners[event] = [];
53
66
  }
54
- this.eventListeners[event].push(listener);
67
+ const listeners = this.eventListeners[event];
68
+ if (listeners) {
69
+ listeners.push(listener);
70
+ }
55
71
  if (this.callControllerInstance && !this.eventsAttached) {
56
72
  this.attachEvents();
57
73
  }
@@ -62,9 +78,10 @@ class PlatoApiClient {
62
78
  * @param listener Listener function
63
79
  */
64
80
  off(event, listener) {
65
- if (!this.eventListeners[event])
81
+ const listeners = this.eventListeners[event];
82
+ if (!listeners)
66
83
  return;
67
- this.eventListeners[event] = this.eventListeners[event].filter(l => l !== listener);
84
+ this.eventListeners[event] = listeners.filter(l => l !== listener);
68
85
  }
69
86
  /**
70
87
  * Internal: Attach event listeners and propagate to registered listeners.
@@ -101,6 +118,30 @@ class PlatoApiClient {
101
118
  const res = await this.http.get(`/api/v1/simulation/status/${simulationId}`);
102
119
  return res.data;
103
120
  }
121
+ async getUserSimulations() {
122
+ try {
123
+ const res = await this.http.get('/api/v1/simulation/user/simulations');
124
+ return res.data;
125
+ }
126
+ catch (e) {
127
+ if (axios_1.default.isAxiosError(e)) {
128
+ console.error('Error getting user simulations:', e.response?.data.message);
129
+ }
130
+ throw e;
131
+ }
132
+ }
133
+ async getSimulationDetails(simulationId) {
134
+ try {
135
+ const res = await this.http.get(`/api/v1/simulation/details/${simulationId}`);
136
+ return res.data;
137
+ }
138
+ catch (e) {
139
+ if (axios_1.default.isAxiosError(e)) {
140
+ console.error('Error getting simulation details:', e.response?.data.message);
141
+ }
142
+ throw e;
143
+ }
144
+ }
104
145
  async getCallDetails(callId) {
105
146
  try {
106
147
  const res = await this.http.get(`/api/v1/simulation/call/${callId}`);
@@ -205,6 +246,12 @@ class PlatoApiClient {
205
246
  });
206
247
  return response.data;
207
248
  }
249
+ async uploadPdfSlides(file) {
250
+ const formData = new FormData();
251
+ formData.append('file', file);
252
+ const response = await this.http.post('/api/v1/pdfSlides/upload', formData);
253
+ return response.data;
254
+ }
208
255
  }
209
256
  exports.PlatoApiClient = PlatoApiClient;
210
257
  //# sourceMappingURL=plato-sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plato-sdk.js","sourceRoot":"","sources":["../../../../../libs/plato-sdk/src/lib/plato-sdk.ts"],"names":[],"mappings":";;;;AAAA,0DAA6C;AAS7C,+DAAgC;AAkChC,MAAa,cAAc;IAgBL;IAfZ,IAAI,CAAgB;IAC5B,sEAAsE;IAC9D,cAAc,GAAgD,EAAE,CAAC;IACjE,sBAAsB,CAAQ;IAC9B,cAAc,GAAG,KAAK,CAAC;IAC/B,UAAU,GAAqB;QAC7B,YAAY;QACZ,UAAU;QACV,cAAc;QACd,YAAY;QACZ,OAAO;QACP,SAAS;QACT,cAAc;KACf,CAAC;IAEF,YAAoB,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;QACzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,eAAK,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC,O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