@ctchealth/plato-sdk 0.0.15 → 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.
- package/README.md +1420 -0
- package/eslint.config.cjs +121 -0
- package/jest.config.ts +10 -0
- package/package.json +3 -4
- package/project.json +24 -0
- package/src/lib/{constants.d.ts → constants.ts} +3 -3
- package/src/lib/plato-intefaces.ts +431 -0
- package/src/lib/plato-sdk.ts +789 -0
- package/src/lib/utils.ts +72 -0
- package/tsconfig.json +22 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +10 -0
- package/src/index.js +0 -18
- package/src/index.js.map +0 -1
- package/src/lib/constants.js +0 -20
- package/src/lib/constants.js.map +0 -1
- package/src/lib/plato-intefaces.d.ts +0 -361
- package/src/lib/plato-intefaces.js +0 -172
- package/src/lib/plato-intefaces.js.map +0 -1
- package/src/lib/plato-sdk.d.ts +0 -193
- package/src/lib/plato-sdk.js +0 -643
- package/src/lib/plato-sdk.js.map +0 -1
- package/src/lib/utils.d.ts +0 -24
- package/src/lib/utils.js +0 -70
- package/src/lib/utils.js.map +0 -1
- /package/src/{index.d.ts → index.ts} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const { defineConfig, globalIgnores } = require('eslint/config');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin');
|
|
5
|
+
const globals = require('globals');
|
|
6
|
+
const tsParser = require('@typescript-eslint/parser');
|
|
7
|
+
const jest = require('eslint-plugin-jest');
|
|
8
|
+
const js = require('@eslint/js');
|
|
9
|
+
const headers = require('eslint-plugin-headers');
|
|
10
|
+
const { FlatCompat } = require('@eslint/eslintrc');
|
|
11
|
+
const baseRules = require('../../eslint-config-base.cjs');
|
|
12
|
+
|
|
13
|
+
const compat = new FlatCompat({
|
|
14
|
+
baseDirectory: __dirname,
|
|
15
|
+
recommendedConfig: js.configs.recommended,
|
|
16
|
+
allConfig: js.configs.all,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
module.exports = defineConfig([
|
|
20
|
+
globalIgnores([
|
|
21
|
+
'**/.eslintrc.js',
|
|
22
|
+
'src/index.d.ts',
|
|
23
|
+
'scripts/db-migrations/archived/**/*',
|
|
24
|
+
'**/*.spec.ts',
|
|
25
|
+
'**/*.config.js',
|
|
26
|
+
'**/*.config.cjs',
|
|
27
|
+
'**/jest.config.ts',
|
|
28
|
+
]),
|
|
29
|
+
{
|
|
30
|
+
files: ['**/*.ts'],
|
|
31
|
+
plugins: {
|
|
32
|
+
headers,
|
|
33
|
+
},
|
|
34
|
+
rules: {
|
|
35
|
+
'headers/header-format': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
source: 'string',
|
|
39
|
+
content: `Copyright (c) 2025 ctcHealth. All rights reserved.
|
|
40
|
+
|
|
41
|
+
This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
|
|
42
|
+
|
|
43
|
+
This source code and all related materials are confidential and proprietary to ctcHealth.
|
|
44
|
+
Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
|
|
45
|
+
and may result in disciplinary action and civil and/or criminal penalties.
|
|
46
|
+
|
|
47
|
+
This software is intended solely for authorized use within ctcHealth and its designated partners.
|
|
48
|
+
|
|
49
|
+
For internal use only.`,
|
|
50
|
+
style: 'jsdoc',
|
|
51
|
+
trailingNewlines: 1,
|
|
52
|
+
preservePragmas: false,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
extends: compat.extends(
|
|
59
|
+
'plugin:@typescript-eslint/recommended',
|
|
60
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
61
|
+
'plugin:@typescript-eslint/strict'
|
|
62
|
+
),
|
|
63
|
+
|
|
64
|
+
files: ['**/*.ts'],
|
|
65
|
+
ignores: ['**/*.json', '**/*.spec.ts'],
|
|
66
|
+
|
|
67
|
+
plugins: {
|
|
68
|
+
'@typescript-eslint': typescriptEslintEslintPlugin,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
languageOptions: {
|
|
72
|
+
globals: {
|
|
73
|
+
...globals.node,
|
|
74
|
+
...globals.jest,
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
parser: tsParser,
|
|
78
|
+
ecmaVersion: 10,
|
|
79
|
+
sourceType: 'module',
|
|
80
|
+
|
|
81
|
+
parserOptions: {
|
|
82
|
+
project: path.join(__dirname, 'tsconfig.lib.json'),
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
rules: {
|
|
87
|
+
...baseRules.rules, // shared rules
|
|
88
|
+
// project-specific rules
|
|
89
|
+
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
90
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
91
|
+
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
92
|
+
'@typescript-eslint/promise-function-async': ['error'],
|
|
93
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
94
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
95
|
+
semi: ['error', 'always'],
|
|
96
|
+
'@typescript-eslint/unbound-method': 'error',
|
|
97
|
+
'keyword-spacing': ['error'],
|
|
98
|
+
'@typescript-eslint/restrict-template-expressions': 'error',
|
|
99
|
+
'@typescript-eslint/prefer-regexp-exec': 'warn',
|
|
100
|
+
'@typescript-eslint/require-await': 'warn',
|
|
101
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
102
|
+
'@typescript-eslint/no-unnecessary-condition': 'warn',
|
|
103
|
+
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
104
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
105
|
+
'space-infix-ops': 'off',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
files: ['**/*.spec.ts'],
|
|
110
|
+
extends: compat.extends('plugin:jest/recommended'),
|
|
111
|
+
|
|
112
|
+
plugins: {
|
|
113
|
+
jest,
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
rules: {
|
|
117
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
118
|
+
'jest/unbound-method': 'error',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
]);
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
displayName: 'plato-sdk',
|
|
3
|
+
preset: '../../jest.preset.js',
|
|
4
|
+
testEnvironment: 'node',
|
|
5
|
+
transform: {
|
|
6
|
+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
7
|
+
},
|
|
8
|
+
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
+
coverageDirectory: '../../coverage/libs/plato-sdk',
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctchealth/plato-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"@vapi-ai/web": "2.1.8",
|
|
@@ -12,6 +12,5 @@
|
|
|
12
12
|
"typings": "./src/index.d.ts",
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "plato-sdk",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "libs/plato-sdk/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@nx/js:tsc",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"outputPath": "dist/libs/plato-sdk",
|
|
13
|
+
"main": "libs/plato-sdk/src/index.ts",
|
|
14
|
+
"tsConfig": "libs/plato-sdk/tsconfig.lib.json",
|
|
15
|
+
"assets": ["libs/plato-sdk/*.md"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"nx-release-publish": {
|
|
19
|
+
"options": {
|
|
20
|
+
"packageRoot": "dist/{projectRoot}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
*
|
|
12
12
|
* For internal use only.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export const MAX_PDF_FILE_SIZE = 20 * 1024 * 1024; // 20MB
|
|
15
|
+
export const ALLOWED_PDF_MIME_TYPES = ['application/pdf'];
|
|
16
|
+
export const MAX_PDF_PAGES = 100;
|
|
@@ -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
|
+
}
|