@erosolaraijs/cure 2.2.0 → 2.3.1

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.
Files changed (35) hide show
  1. package/README.md +314 -26
  2. package/dist/bin/cure.js +173 -23
  3. package/dist/bin/cure.js.map +1 -1
  4. package/dist/capabilities/cureValidationFramework.d.ts +195 -0
  5. package/dist/capabilities/cureValidationFramework.d.ts.map +1 -0
  6. package/dist/capabilities/cureValidationFramework.js +577 -0
  7. package/dist/capabilities/cureValidationFramework.js.map +1 -0
  8. package/dist/capabilities/emergingTherapeutics.d.ts +145 -0
  9. package/dist/capabilities/emergingTherapeutics.d.ts.map +1 -0
  10. package/dist/capabilities/emergingTherapeutics.js +600 -0
  11. package/dist/capabilities/emergingTherapeutics.js.map +1 -0
  12. package/dist/capabilities/globalCancerCoverage.d.ts +143 -0
  13. package/dist/capabilities/globalCancerCoverage.d.ts.map +1 -0
  14. package/dist/capabilities/globalCancerCoverage.js +1066 -0
  15. package/dist/capabilities/globalCancerCoverage.js.map +1 -0
  16. package/dist/capabilities/index.d.ts +21 -0
  17. package/dist/capabilities/index.d.ts.map +1 -1
  18. package/dist/capabilities/index.js +24 -0
  19. package/dist/capabilities/index.js.map +1 -1
  20. package/dist/capabilities/resistanceManagement.d.ts +89 -0
  21. package/dist/capabilities/resistanceManagement.d.ts.map +1 -0
  22. package/dist/capabilities/resistanceManagement.js +713 -0
  23. package/dist/capabilities/resistanceManagement.js.map +1 -0
  24. package/dist/capabilities/universalCancerCureEngine.d.ts +254 -0
  25. package/dist/capabilities/universalCancerCureEngine.d.ts.map +1 -0
  26. package/dist/capabilities/universalCancerCureEngine.js +734 -0
  27. package/dist/capabilities/universalCancerCureEngine.js.map +1 -0
  28. package/package.json +1 -1
  29. package/src/bin/cure.ts +186 -23
  30. package/src/capabilities/cureValidationFramework.ts +757 -0
  31. package/src/capabilities/emergingTherapeutics.ts +760 -0
  32. package/src/capabilities/globalCancerCoverage.ts +1256 -0
  33. package/src/capabilities/index.ts +53 -0
  34. package/src/capabilities/resistanceManagement.ts +835 -0
  35. package/src/capabilities/universalCancerCureEngine.ts +1040 -0
@@ -0,0 +1,835 @@
1
+ /**
2
+ * Comprehensive Cancer Treatment Resistance Management
3
+ *
4
+ * ╔═══════════════════════════════════════════════════════════════════════════════╗
5
+ * ║ RESISTANCE MANAGEMENT - ENSURING CURE DESPITE TREATMENT RESISTANCE ║
6
+ * ╠═══════════════════════════════════════════════════════════════════════════════╣
7
+ * ║ This module handles: ║
8
+ * ║ - All known resistance mechanisms for every approved targeted therapy ║
9
+ * ║ - Real-time resistance detection via ctDNA and repeat biopsy ║
10
+ * ║ - Sequential therapy strategies to overcome resistance ║
11
+ * ║ - Combination approaches to prevent resistance ║
12
+ * ║ - Novel investigational strategies for resistant disease ║
13
+ * ╚═══════════════════════════════════════════════════════════════════════════════╝
14
+ */
15
+
16
+ // ═══════════════════════════════════════════════════════════════════════════════
17
+ // COMPREHENSIVE RESISTANCE MECHANISM DATABASE
18
+ // ═══════════════════════════════════════════════════════════════════════════════
19
+
20
+ export interface ResistanceMechanism {
21
+ id: string;
22
+ originalTarget: string;
23
+ originalDrugs: string[];
24
+ resistanceMutation: string;
25
+ frequency: string; // e.g., "30-40% of cases"
26
+ detectionMethod: string[];
27
+ overcomingStrategies: OvercomingStrategy[];
28
+ preventionStrategies: string[];
29
+ prognosis: string;
30
+ }
31
+
32
+ export interface OvercomingStrategy {
33
+ approach: string;
34
+ drugs: string[];
35
+ evidenceLevel: 'FDA-Approved' | 'Phase III' | 'Phase II' | 'Phase I' | 'Preclinical';
36
+ expectedResponse: string;
37
+ clinicalTrials?: string[];
38
+ }
39
+
40
+ export const RESISTANCE_MECHANISM_DATABASE: ResistanceMechanism[] = [
41
+ // ═══════════════════════════════════════════════════════════════════════════
42
+ // EGFR RESISTANCE MECHANISMS
43
+ // ═══════════════════════════════════════════════════════════════════════════
44
+ {
45
+ id: 'egfr-t790m',
46
+ originalTarget: 'EGFR sensitizing mutations (exon 19 del, L858R)',
47
+ originalDrugs: ['Erlotinib', 'Gefitinib', 'Afatinib'],
48
+ resistanceMutation: 'EGFR T790M gatekeeper mutation',
49
+ frequency: '50-60% of acquired resistance',
50
+ detectionMethod: ['ctDNA (plasma)', 'Repeat tissue biopsy', 'Cobas EGFR test'],
51
+ overcomingStrategies: [
52
+ {
53
+ approach: 'Third-generation EGFR TKI',
54
+ drugs: ['Osimertinib'],
55
+ evidenceLevel: 'FDA-Approved',
56
+ expectedResponse: 'ORR 70%, median PFS 10 months'
57
+ }
58
+ ],
59
+ preventionStrategies: ['Frontline osimertinib (FLAURA trial)'],
60
+ prognosis: 'Good - effective third-generation options available'
61
+ },
62
+ {
63
+ id: 'egfr-c797s',
64
+ originalTarget: 'EGFR T790M',
65
+ originalDrugs: ['Osimertinib'],
66
+ resistanceMutation: 'EGFR C797S mutation',
67
+ frequency: '10-25% of osimertinib resistance',
68
+ detectionMethod: ['ctDNA (plasma)', 'Repeat tissue biopsy'],
69
+ overcomingStrategies: [
70
+ {
71
+ approach: 'EGFR-MET bispecific antibody',
72
+ drugs: ['Amivantamab'],
73
+ evidenceLevel: 'FDA-Approved',
74
+ expectedResponse: 'ORR 30-40%'
75
+ },
76
+ {
77
+ approach: 'Fourth-generation EGFR TKI',
78
+ drugs: ['BLU-945', 'BLU-701'],
79
+ evidenceLevel: 'Phase I',
80
+ expectedResponse: 'Under investigation',
81
+ clinicalTrials: ['NCT04862780']
82
+ },
83
+ {
84
+ approach: 'First-gen + third-gen TKI combination (if in trans)',
85
+ drugs: ['Erlotinib + Osimertinib'],
86
+ evidenceLevel: 'Phase II',
87
+ expectedResponse: 'May overcome if mutations in trans'
88
+ }
89
+ ],
90
+ preventionStrategies: ['Combination therapy upfront', 'Early resistance detection'],
91
+ prognosis: 'Challenging - emerging options in development'
92
+ },
93
+ {
94
+ id: 'egfr-met-amp',
95
+ originalTarget: 'EGFR',
96
+ originalDrugs: ['All EGFR TKIs'],
97
+ resistanceMutation: 'MET amplification (bypass pathway)',
98
+ frequency: '5-20% of EGFR TKI resistance',
99
+ detectionMethod: ['NGS', 'FISH', 'ctDNA'],
100
+ overcomingStrategies: [
101
+ {
102
+ approach: 'EGFR + MET inhibitor combination',
103
+ drugs: ['Osimertinib + Savolitinib', 'Amivantamab + Lazertinib'],
104
+ evidenceLevel: 'FDA-Approved',
105
+ expectedResponse: 'ORR 30-50%'
106
+ },
107
+ {
108
+ approach: 'MET-targeted therapy',
109
+ drugs: ['Capmatinib', 'Tepotinib', 'Crizotinib'],
110
+ evidenceLevel: 'FDA-Approved',
111
+ expectedResponse: 'Response in combination'
112
+ }
113
+ ],
114
+ preventionStrategies: ['MET monitoring during treatment'],
115
+ prognosis: 'Addressable with combination therapy'
116
+ },
117
+ {
118
+ id: 'egfr-transformation',
119
+ originalTarget: 'EGFR',
120
+ originalDrugs: ['All EGFR TKIs'],
121
+ resistanceMutation: 'Histologic transformation to SCLC',
122
+ frequency: '3-14% of EGFR TKI resistance',
123
+ detectionMethod: ['Repeat biopsy (mandatory)', 'Neuroendocrine markers'],
124
+ overcomingStrategies: [
125
+ {
126
+ approach: 'SCLC-directed chemotherapy',
127
+ drugs: ['Platinum + Etoposide'],
128
+ evidenceLevel: 'FDA-Approved',
129
+ expectedResponse: 'Response in most cases, often transient'
130
+ },
131
+ {
132
+ approach: 'SCLC regimen + continue EGFR TKI',
133
+ drugs: ['Platinum/Etoposide + Osimertinib'],
134
+ evidenceLevel: 'Phase II',
135
+ expectedResponse: 'May improve outcomes'
136
+ }
137
+ ],
138
+ preventionStrategies: ['Early detection with repeat biopsy at progression'],
139
+ prognosis: 'Poor - aggressive histology'
140
+ },
141
+
142
+ // ═══════════════════════════════════════════════════════════════════════════
143
+ // ALK RESISTANCE MECHANISMS
144
+ // ═══════════════════════════════════════════════════════════════════════════
145
+ {
146
+ id: 'alk-secondary',
147
+ originalTarget: 'ALK fusion',
148
+ originalDrugs: ['Crizotinib', 'Alectinib'],
149
+ resistanceMutation: 'ALK secondary mutations (G1202R, L1196M, etc.)',
150
+ frequency: '30-50% of ALK TKI resistance',
151
+ detectionMethod: ['ctDNA', 'Repeat biopsy with ALK resistance panel'],
152
+ overcomingStrategies: [
153
+ {
154
+ approach: 'Next-generation ALK TKI based on mutation',
155
+ drugs: ['Lorlatinib (covers most)', 'Brigatinib', 'Ensartinib'],
156
+ evidenceLevel: 'FDA-Approved',
157
+ expectedResponse: 'Mutation-dependent response'
158
+ },
159
+ {
160
+ approach: 'Compound mutation strategies',
161
+ drugs: ['Lorlatinib', 'Chemotherapy'],
162
+ evidenceLevel: 'Phase II',
163
+ expectedResponse: 'Variable'
164
+ }
165
+ ],
166
+ preventionStrategies: ['Sequential TKI selection based on resistance profile'],
167
+ prognosis: 'Moderate - sequential TKIs can provide disease control'
168
+ },
169
+ {
170
+ id: 'alk-g1202r',
171
+ originalTarget: 'ALK fusion',
172
+ originalDrugs: ['Crizotinib', 'Alectinib', 'Ceritinib', 'Brigatinib'],
173
+ resistanceMutation: 'ALK G1202R solvent front mutation',
174
+ frequency: 'Most common resistance mutation to second-gen ALK TKIs',
175
+ detectionMethod: ['ctDNA', 'Repeat biopsy'],
176
+ overcomingStrategies: [
177
+ {
178
+ approach: 'Third-generation ALK TKI',
179
+ drugs: ['Lorlatinib'],
180
+ evidenceLevel: 'FDA-Approved',
181
+ expectedResponse: 'ORR 40-50% in G1202R+'
182
+ }
183
+ ],
184
+ preventionStrategies: ['Consider lorlatinib earlier in treatment sequence'],
185
+ prognosis: 'Addressable with lorlatinib'
186
+ },
187
+
188
+ // ═══════════════════════════════════════════════════════════════════════════
189
+ // BRAF RESISTANCE MECHANISMS
190
+ // ═══════════════════════════════════════════════════════════════════════════
191
+ {
192
+ id: 'braf-reactivation',
193
+ originalTarget: 'BRAF V600E',
194
+ originalDrugs: ['Vemurafenib', 'Dabrafenib', 'Encorafenib'],
195
+ resistanceMutation: 'MAPK pathway reactivation (NRAS, MEK, BRAF splice variants)',
196
+ frequency: 'Nearly universal within 12-18 months',
197
+ detectionMethod: ['ctDNA', 'Repeat biopsy'],
198
+ overcomingStrategies: [
199
+ {
200
+ approach: 'BRAF + MEK inhibitor combination (if not already on)',
201
+ drugs: ['Dabrafenib + Trametinib', 'Encorafenib + Binimetinib'],
202
+ evidenceLevel: 'FDA-Approved',
203
+ expectedResponse: 'Standard of care upfront'
204
+ },
205
+ {
206
+ approach: 'ERK inhibitor',
207
+ drugs: ['Ulixertinib'],
208
+ evidenceLevel: 'Phase I',
209
+ expectedResponse: 'Under investigation',
210
+ clinicalTrials: ['NCT01781429']
211
+ },
212
+ {
213
+ approach: 'Immunotherapy switch',
214
+ drugs: ['Nivolumab + Ipilimumab'],
215
+ evidenceLevel: 'FDA-Approved',
216
+ expectedResponse: 'ORR 50-60% in melanoma'
217
+ }
218
+ ],
219
+ preventionStrategies: ['Upfront BRAF/MEK combination', 'Immunotherapy sequencing'],
220
+ prognosis: 'Moderate - immunotherapy provides durable responses'
221
+ },
222
+
223
+ // ═══════════════════════════════════════════════════════════════════════════
224
+ // HER2 RESISTANCE MECHANISMS
225
+ // ═══════════════════════════════════════════════════════════════════════════
226
+ {
227
+ id: 'her2-resistance',
228
+ originalTarget: 'HER2 amplification',
229
+ originalDrugs: ['Trastuzumab', 'Pertuzumab'],
230
+ resistanceMutation: 'PI3K pathway activation, HER2 mutations, truncated HER2',
231
+ frequency: 'Variable, 40-50% eventually progress',
232
+ detectionMethod: ['ctDNA', 'Repeat biopsy', 'PIK3CA testing'],
233
+ overcomingStrategies: [
234
+ {
235
+ approach: 'Antibody-drug conjugate',
236
+ drugs: ['T-DXd (Trastuzumab Deruxtecan)', 'T-DM1'],
237
+ evidenceLevel: 'FDA-Approved',
238
+ expectedResponse: 'T-DXd ORR 60%, median PFS 25 months'
239
+ },
240
+ {
241
+ approach: 'Tyrosine kinase inhibitor combination',
242
+ drugs: ['Tucatinib + Trastuzumab + Capecitabine', 'Neratinib', 'Lapatinib'],
243
+ evidenceLevel: 'FDA-Approved',
244
+ expectedResponse: 'ORR 40-50%'
245
+ },
246
+ {
247
+ approach: 'PI3K inhibitor addition (if PIK3CA+)',
248
+ drugs: ['Alpelisib'],
249
+ evidenceLevel: 'FDA-Approved',
250
+ expectedResponse: 'Improved PFS in PIK3CA-mutant'
251
+ }
252
+ ],
253
+ preventionStrategies: ['ADC-based therapy earlier', 'Combination approaches'],
254
+ prognosis: 'Good - multiple effective later-line options'
255
+ },
256
+
257
+ // ═══════════════════════════════════════════════════════════════════════════
258
+ // HORMONE RECEPTOR RESISTANCE
259
+ // ═══════════════════════════════════════════════════════════════════════════
260
+ {
261
+ id: 'esr1-mutations',
262
+ originalTarget: 'Estrogen receptor',
263
+ originalDrugs: ['Aromatase inhibitors', 'Tamoxifen'],
264
+ resistanceMutation: 'ESR1 mutations (Y537S, D538G, etc.)',
265
+ frequency: '30-40% of metastatic ER+ breast cancer',
266
+ detectionMethod: ['ctDNA (sensitive)', 'Repeat biopsy'],
267
+ overcomingStrategies: [
268
+ {
269
+ approach: 'Oral SERD',
270
+ drugs: ['Elacestrant'],
271
+ evidenceLevel: 'FDA-Approved',
272
+ expectedResponse: 'PFS benefit in ESR1-mutant'
273
+ },
274
+ {
275
+ approach: 'Pure antiestrogen',
276
+ drugs: ['Fulvestrant'],
277
+ evidenceLevel: 'FDA-Approved',
278
+ expectedResponse: 'Response in some ESR1-mutant cases'
279
+ },
280
+ {
281
+ approach: 'CDK4/6 inhibitor continuation',
282
+ drugs: ['Palbociclib', 'Ribociclib', 'Abemaciclib'],
283
+ evidenceLevel: 'FDA-Approved',
284
+ expectedResponse: 'Continue if tolerated'
285
+ }
286
+ ],
287
+ preventionStrategies: ['Monitoring for ESR1 mutations', 'Consider SERDs earlier'],
288
+ prognosis: 'Moderate - multiple options available'
289
+ },
290
+ {
291
+ id: 'ar-resistance',
292
+ originalTarget: 'Androgen receptor',
293
+ originalDrugs: ['Enzalutamide', 'Abiraterone', 'Apalutamide'],
294
+ resistanceMutation: 'AR amplification, AR-V7 splice variant, glucocorticoid receptor activation',
295
+ frequency: '30-50% of mCRPC',
296
+ detectionMethod: ['CTC-based AR-V7', 'ctDNA', 'Repeat biopsy'],
297
+ overcomingStrategies: [
298
+ {
299
+ approach: 'Taxane chemotherapy',
300
+ drugs: ['Docetaxel', 'Cabazitaxel'],
301
+ evidenceLevel: 'FDA-Approved',
302
+ expectedResponse: 'Effective regardless of AR-V7'
303
+ },
304
+ {
305
+ approach: 'Radioligand therapy',
306
+ drugs: ['Lu-PSMA-617'],
307
+ evidenceLevel: 'FDA-Approved',
308
+ expectedResponse: 'ORR 30%, OS benefit'
309
+ },
310
+ {
311
+ approach: 'PARP inhibitor (if HRR+)',
312
+ drugs: ['Olaparib', 'Rucaparib'],
313
+ evidenceLevel: 'FDA-Approved',
314
+ expectedResponse: 'Effective in HRR-deficient'
315
+ }
316
+ ],
317
+ preventionStrategies: ['Early taxane consideration', 'HRR testing upfront'],
318
+ prognosis: 'Moderate - taxanes and PSMA effective'
319
+ },
320
+
321
+ // ═══════════════════════════════════════════════════════════════════════════
322
+ // BTK INHIBITOR RESISTANCE
323
+ // ═══════════════════════════════════════════════════════════════════════════
324
+ {
325
+ id: 'btk-c481s',
326
+ originalTarget: 'BTK',
327
+ originalDrugs: ['Ibrutinib', 'Acalabrutinib', 'Zanubrutinib'],
328
+ resistanceMutation: 'BTK C481S mutation',
329
+ frequency: '80% of CLL resistance to covalent BTK inhibitors',
330
+ detectionMethod: ['ctDNA', 'Repeat bone marrow'],
331
+ overcomingStrategies: [
332
+ {
333
+ approach: 'Non-covalent BTK inhibitor',
334
+ drugs: ['Pirtobrutinib'],
335
+ evidenceLevel: 'FDA-Approved',
336
+ expectedResponse: 'ORR 70% in BTK C481S+'
337
+ },
338
+ {
339
+ approach: 'BCL2 inhibitor',
340
+ drugs: ['Venetoclax'],
341
+ evidenceLevel: 'FDA-Approved',
342
+ expectedResponse: 'Effective alternative pathway'
343
+ },
344
+ {
345
+ approach: 'CAR-T therapy',
346
+ drugs: ['Lisocabtagene maraleucel'],
347
+ evidenceLevel: 'FDA-Approved',
348
+ expectedResponse: 'Deep responses in R/R CLL'
349
+ }
350
+ ],
351
+ preventionStrategies: ['Time-limited venetoclax-based regimens', 'Resistance monitoring'],
352
+ prognosis: 'Good - multiple effective options'
353
+ },
354
+
355
+ // ═══════════════════════════════════════════════════════════════════════════
356
+ // BCR-ABL RESISTANCE
357
+ // ═══════════════════════════════════════════════════════════════════════════
358
+ {
359
+ id: 'bcr-abl-t315i',
360
+ originalTarget: 'BCR-ABL',
361
+ originalDrugs: ['Imatinib', 'Dasatinib', 'Nilotinib', 'Bosutinib'],
362
+ resistanceMutation: 'BCR-ABL T315I gatekeeper mutation',
363
+ frequency: '15-20% of TKI-resistant CML',
364
+ detectionMethod: ['BCR-ABL mutation analysis', 'Sanger sequencing', 'NGS'],
365
+ overcomingStrategies: [
366
+ {
367
+ approach: 'Third-generation TKI',
368
+ drugs: ['Ponatinib'],
369
+ evidenceLevel: 'FDA-Approved',
370
+ expectedResponse: 'High response rates'
371
+ },
372
+ {
373
+ approach: 'Allosteric inhibitor',
374
+ drugs: ['Asciminib'],
375
+ evidenceLevel: 'FDA-Approved',
376
+ expectedResponse: 'Effective in T315I'
377
+ },
378
+ {
379
+ approach: 'Allogeneic stem cell transplant',
380
+ drugs: ['Allo-HSCT'],
381
+ evidenceLevel: 'FDA-Approved',
382
+ expectedResponse: 'Curative option'
383
+ }
384
+ ],
385
+ preventionStrategies: ['Adherence monitoring', 'Early mutation detection'],
386
+ prognosis: 'Good - ponatinib and asciminib effective'
387
+ },
388
+
389
+ // ═══════════════════════════════════════════════════════════════════════════
390
+ // IMMUNOTHERAPY RESISTANCE
391
+ // ═══════════════════════════════════════════════════════════════════════════
392
+ {
393
+ id: 'checkpoint-primary',
394
+ originalTarget: 'PD-1/PD-L1',
395
+ originalDrugs: ['Pembrolizumab', 'Nivolumab', 'Atezolizumab'],
396
+ resistanceMutation: 'Primary resistance (JAK1/2 loss, B2M loss, WNT activation)',
397
+ frequency: '40-60% never respond',
398
+ detectionMethod: ['Repeat biopsy with immune profiling', 'Gene expression analysis'],
399
+ overcomingStrategies: [
400
+ {
401
+ approach: 'Dual checkpoint blockade',
402
+ drugs: ['Ipilimumab + Nivolumab', 'Relatlimab + Nivolumab'],
403
+ evidenceLevel: 'FDA-Approved',
404
+ expectedResponse: 'May convert some non-responders'
405
+ },
406
+ {
407
+ approach: 'Combination with chemotherapy',
408
+ drugs: ['Pembrolizumab + Chemotherapy'],
409
+ evidenceLevel: 'FDA-Approved',
410
+ expectedResponse: 'Synergistic effect'
411
+ },
412
+ {
413
+ approach: 'Novel immune targets',
414
+ drugs: ['TIGIT inhibitors', 'LAG-3 inhibitors', 'TIM-3 inhibitors'],
415
+ evidenceLevel: 'Phase II',
416
+ expectedResponse: 'Under investigation',
417
+ clinicalTrials: ['Multiple ongoing']
418
+ }
419
+ ],
420
+ preventionStrategies: ['Biomarker selection (PD-L1, TMB, MSI-H)', 'Combination upfront'],
421
+ prognosis: 'Variable - depends on mechanism'
422
+ },
423
+ {
424
+ id: 'checkpoint-acquired',
425
+ originalTarget: 'PD-1/PD-L1',
426
+ originalDrugs: ['All checkpoint inhibitors'],
427
+ resistanceMutation: 'Acquired resistance (antigen loss, neoantigen editing, T-cell exhaustion)',
428
+ frequency: '30-50% of initial responders',
429
+ detectionMethod: ['Repeat biopsy', 'T-cell profiling', 'Neoantigen analysis'],
430
+ overcomingStrategies: [
431
+ {
432
+ approach: 'Rechallenge after break',
433
+ drugs: ['Same or different checkpoint inhibitor'],
434
+ evidenceLevel: 'Phase II',
435
+ expectedResponse: 'Variable, some responses'
436
+ },
437
+ {
438
+ approach: 'Cellular therapy',
439
+ drugs: ['TIL therapy (Lifileucel)', 'TCR-T cells'],
440
+ evidenceLevel: 'FDA-Approved',
441
+ expectedResponse: 'ORR 30-40% in melanoma'
442
+ },
443
+ {
444
+ approach: 'Oncolytic virus combination',
445
+ drugs: ['T-VEC + Pembrolizumab'],
446
+ evidenceLevel: 'Phase II',
447
+ expectedResponse: 'May enhance immune response'
448
+ }
449
+ ],
450
+ preventionStrategies: ['Optimize duration of therapy', 'Early detection of resistance'],
451
+ prognosis: 'Challenging - cellular therapies show promise'
452
+ },
453
+
454
+ // ═══════════════════════════════════════════════════════════════════════════
455
+ // KRAS INHIBITOR RESISTANCE
456
+ // ═══════════════════════════════════════════════════════════════════════════
457
+ {
458
+ id: 'kras-g12c-resistance',
459
+ originalTarget: 'KRAS G12C',
460
+ originalDrugs: ['Sotorasib', 'Adagrasib'],
461
+ resistanceMutation: 'Secondary KRAS mutations, RTK amplification, SHP2 activation',
462
+ frequency: 'Common within 6-12 months',
463
+ detectionMethod: ['ctDNA', 'Repeat biopsy'],
464
+ overcomingStrategies: [
465
+ {
466
+ approach: 'KRAS G12C + SHP2 inhibitor',
467
+ drugs: ['Sotorasib + RMC-4630'],
468
+ evidenceLevel: 'Phase I',
469
+ expectedResponse: 'Under investigation',
470
+ clinicalTrials: ['NCT04330664']
471
+ },
472
+ {
473
+ approach: 'KRAS G12C + SOS1 inhibitor',
474
+ drugs: ['Adagrasib + BI 1701963'],
475
+ evidenceLevel: 'Phase I',
476
+ expectedResponse: 'Under investigation'
477
+ },
478
+ {
479
+ approach: 'Immunotherapy combination',
480
+ drugs: ['Sotorasib + Pembrolizumab', 'Adagrasib + Pembrolizumab'],
481
+ evidenceLevel: 'Phase II',
482
+ expectedResponse: 'May extend benefit'
483
+ }
484
+ ],
485
+ preventionStrategies: ['Combination approaches upfront', 'Resistance monitoring'],
486
+ prognosis: 'Active area of research - combinations promising'
487
+ },
488
+
489
+ // ═══════════════════════════════════════════════════════════════════════════
490
+ // CAR-T RESISTANCE
491
+ // ═══════════════════════════════════════════════════════════════════════════
492
+ {
493
+ id: 'cart-antigen-loss',
494
+ originalTarget: 'CD19, BCMA',
495
+ originalDrugs: ['CD19 CAR-T', 'BCMA CAR-T'],
496
+ resistanceMutation: 'Antigen loss/downregulation, T-cell exhaustion',
497
+ frequency: '30-50% of CAR-T relapses',
498
+ detectionMethod: ['Flow cytometry for antigen', 'Repeat biopsy'],
499
+ overcomingStrategies: [
500
+ {
501
+ approach: 'Alternative target CAR-T',
502
+ drugs: ['CD22 CAR-T (for CD19 loss)', 'GPRC5D CAR-T (for BCMA loss)'],
503
+ evidenceLevel: 'Phase I',
504
+ expectedResponse: 'Responses seen'
505
+ },
506
+ {
507
+ approach: 'Bispecific antibodies',
508
+ drugs: ['Blinatumomab', 'Teclistamab', 'Talquetamab'],
509
+ evidenceLevel: 'FDA-Approved',
510
+ expectedResponse: 'Alternative target engagement'
511
+ },
512
+ {
513
+ approach: 'Dual-targeting CAR-T',
514
+ drugs: ['CD19/CD22 CAR-T', 'BCMA/CD38 CAR-T'],
515
+ evidenceLevel: 'Phase I',
516
+ expectedResponse: 'May prevent escape',
517
+ clinicalTrials: ['Multiple ongoing']
518
+ }
519
+ ],
520
+ preventionStrategies: ['Dual-targeting from start', 'Early CAR-T consideration'],
521
+ prognosis: 'Challenging - alternative targets help'
522
+ }
523
+ ];
524
+
525
+ // ═══════════════════════════════════════════════════════════════════════════════
526
+ // RESISTANCE DETECTION AND MONITORING
527
+ // ═══════════════════════════════════════════════════════════════════════════════
528
+
529
+ export interface ResistanceMonitoringPlan {
530
+ baseline: string[];
531
+ onTreatment: string[];
532
+ atProgression: string[];
533
+ frequency: string;
534
+ }
535
+
536
+ export const RESISTANCE_MONITORING_PROTOCOLS: Record<string, ResistanceMonitoringPlan> = {
537
+ egfr: {
538
+ baseline: ['Comprehensive genomic profiling', 'ctDNA baseline'],
539
+ onTreatment: ['ctDNA every 8 weeks', 'T790M monitoring'],
540
+ atProgression: ['Repeat biopsy if accessible', 'ctDNA comprehensive', 'MET FISH'],
541
+ frequency: 'Every 8-12 weeks'
542
+ },
543
+ alk: {
544
+ baseline: ['ALK FISH/IHC', 'NGS for resistance mutations'],
545
+ onTreatment: ['ctDNA for ALK resistance mutations'],
546
+ atProgression: ['Repeat biopsy', 'Full ALK resistance panel'],
547
+ frequency: 'Every 12 weeks'
548
+ },
549
+ her2: {
550
+ baseline: ['HER2 IHC/FISH', 'PIK3CA mutation status', 'ctDNA'],
551
+ onTreatment: ['ctDNA monitoring'],
552
+ atProgression: ['Repeat HER2 testing', 'PIK3CA status', 'Genomic profiling'],
553
+ frequency: 'Every 12 weeks'
554
+ },
555
+ hormone: {
556
+ baseline: ['ER/PR status', 'ESR1 ctDNA', 'PIK3CA status'],
557
+ onTreatment: ['ESR1 ctDNA every 12 weeks', 'Tumor markers'],
558
+ atProgression: ['Repeat biopsy for ER status', 'ESR1 full panel', 'Genomic profiling'],
559
+ frequency: 'Every 12 weeks'
560
+ },
561
+ immunotherapy: {
562
+ baseline: ['PD-L1', 'TMB', 'MSI status', 'Gene expression profiling'],
563
+ onTreatment: ['ctDNA for response', 'irRC imaging'],
564
+ atProgression: ['Repeat biopsy with immune profiling', 'JAK/B2M status', 'WNT pathway'],
565
+ frequency: 'Every 8-12 weeks'
566
+ }
567
+ };
568
+
569
+ // ═══════════════════════════════════════════════════════════════════════════════
570
+ // RESISTANCE MANAGEMENT ENGINE
571
+ // ═══════════════════════════════════════════════════════════════════════════════
572
+
573
+ export class ResistanceManagementEngine {
574
+
575
+ /**
576
+ * Analyze resistance and provide next-step recommendations
577
+ */
578
+ analyzeResistance(
579
+ currentTherapy: string,
580
+ target: string,
581
+ detectedMechanism: string,
582
+ patientProfile: { age: number; ps: number; priorLines: number }
583
+ ): {
584
+ mechanism: ResistanceMechanism | undefined;
585
+ recommendedStrategies: OvercomingStrategy[];
586
+ clinicalTrials: string[];
587
+ prognosis: string;
588
+ urgency: 'immediate' | 'soon' | 'planned';
589
+ } {
590
+
591
+ // Find matching resistance mechanism
592
+ const mechanism = RESISTANCE_MECHANISM_DATABASE.find(m =>
593
+ m.originalTarget.toLowerCase().includes(target.toLowerCase()) ||
594
+ m.resistanceMutation.toLowerCase().includes(detectedMechanism.toLowerCase())
595
+ );
596
+
597
+ if (!mechanism) {
598
+ return {
599
+ mechanism: undefined,
600
+ recommendedStrategies: [{
601
+ approach: 'Comprehensive genomic profiling',
602
+ drugs: ['Clinical trial enrollment recommended'],
603
+ evidenceLevel: 'Phase II',
604
+ expectedResponse: 'Personalized approach needed'
605
+ }],
606
+ clinicalTrials: ['Search clinicaltrials.gov for target + resistance'],
607
+ prognosis: 'Unknown mechanism - further workup needed',
608
+ urgency: 'soon'
609
+ };
610
+ }
611
+
612
+ // Filter strategies by patient fitness
613
+ let strategies = [...mechanism.overcomingStrategies];
614
+ if (patientProfile.ps >= 2 || patientProfile.age >= 75) {
615
+ strategies = strategies.filter(s =>
616
+ s.evidenceLevel === 'FDA-Approved' ||
617
+ s.expectedResponse.toLowerCase().includes('tolerable')
618
+ );
619
+ }
620
+
621
+ // Collect clinical trials
622
+ const trials = strategies
623
+ .filter(s => s.clinicalTrials)
624
+ .flatMap(s => s.clinicalTrials!);
625
+
626
+ // Determine urgency
627
+ const urgency = detectedMechanism.toLowerCase().includes('transform') ? 'immediate' :
628
+ patientProfile.priorLines >= 3 ? 'immediate' : 'soon';
629
+
630
+ return {
631
+ mechanism,
632
+ recommendedStrategies: strategies,
633
+ clinicalTrials: trials,
634
+ prognosis: mechanism.prognosis,
635
+ urgency
636
+ };
637
+ }
638
+
639
+ /**
640
+ * Generate resistance prevention strategy
641
+ */
642
+ generatePreventionPlan(
643
+ cancerType: string,
644
+ targetedTherapy: string,
645
+ biomarkers: string[]
646
+ ): {
647
+ strategies: string[];
648
+ monitoring: ResistanceMonitoringPlan;
649
+ combinationOptions: string[];
650
+ } {
651
+
652
+ const strategies: string[] = [];
653
+ const combinationOptions: string[] = [];
654
+
655
+ // General prevention strategies
656
+ strategies.push('Regular ctDNA monitoring for early detection');
657
+ strategies.push('Consider combination therapy to delay resistance');
658
+ strategies.push('Optimize drug exposure with TDM if available');
659
+
660
+ // Target-specific strategies
661
+ if (targetedTherapy.toLowerCase().includes('egfr')) {
662
+ strategies.push('Start with osimertinib to prevent T790M');
663
+ combinationOptions.push('EGFR + MET inhibitor');
664
+ combinationOptions.push('EGFR + antiangiogenic');
665
+ }
666
+
667
+ if (targetedTherapy.toLowerCase().includes('braf')) {
668
+ strategies.push('Always use BRAF + MEK combination');
669
+ strategies.push('Consider immunotherapy sequencing');
670
+ combinationOptions.push('BRAF/MEK + immunotherapy');
671
+ }
672
+
673
+ if (targetedTherapy.toLowerCase().includes('cdk4')) {
674
+ strategies.push('Monitor ESR1 mutations');
675
+ strategies.push('Consider triplet therapy in high-risk');
676
+ combinationOptions.push('CDK4/6i + endocrine + PI3K inhibitor');
677
+ }
678
+
679
+ const monitoringKey = targetedTherapy.toLowerCase().includes('egfr') ? 'egfr' :
680
+ targetedTherapy.toLowerCase().includes('alk') ? 'alk' :
681
+ targetedTherapy.toLowerCase().includes('her2') ? 'her2' :
682
+ 'immunotherapy';
683
+
684
+ return {
685
+ strategies,
686
+ monitoring: RESISTANCE_MONITORING_PROTOCOLS[monitoringKey] || RESISTANCE_MONITORING_PROTOCOLS.immunotherapy,
687
+ combinationOptions
688
+ };
689
+ }
690
+
691
+ /**
692
+ * Get all resistance mechanisms for a target
693
+ */
694
+ getResistanceMechanismsForTarget(target: string): ResistanceMechanism[] {
695
+ return RESISTANCE_MECHANISM_DATABASE.filter(m =>
696
+ m.originalTarget.toLowerCase().includes(target.toLowerCase()) ||
697
+ m.originalDrugs.some(d => d.toLowerCase().includes(target.toLowerCase()))
698
+ );
699
+ }
700
+ }
701
+
702
+ // ═══════════════════════════════════════════════════════════════════════════════
703
+ // CURE VERIFICATION SYSTEM
704
+ // ═══════════════════════════════════════════════════════════════════════════════
705
+
706
+ export interface CureVerificationResult {
707
+ status: 'CURED' | 'REMISSION' | 'MRD_NEGATIVE' | 'RESPONDING' | 'STABLE' | 'PROGRESSING';
708
+ confidence: number;
709
+ evidence: string[];
710
+ surveillancePlan: string[];
711
+ nextAssessment: string;
712
+ longTermRisks: string[];
713
+ }
714
+
715
+ export class CureVerificationEngine {
716
+
717
+ /**
718
+ * Verify cure status based on multiple criteria
719
+ */
720
+ verifyCureStatus(
721
+ cancerType: string,
722
+ treatmentDuration: number,
723
+ imagingResult: 'CR' | 'PR' | 'SD' | 'PD' | 'NED',
724
+ mrdStatus: 'negative' | 'positive' | 'not_tested',
725
+ ctdnaStatus: 'undetectable' | 'detectable' | 'not_tested',
726
+ timeOffTherapy: number, // months
727
+ lastProgression: number | null // months since
728
+ ): CureVerificationResult {
729
+
730
+ const evidence: string[] = [];
731
+ let status: CureVerificationResult['status'] = 'STABLE';
732
+ let confidence = 0.5;
733
+
734
+ // Imaging evidence
735
+ if (imagingResult === 'CR' || imagingResult === 'NED') {
736
+ evidence.push('Complete radiographic response / No evidence of disease');
737
+ confidence += 0.2;
738
+ } else if (imagingResult === 'PR') {
739
+ evidence.push('Partial radiographic response');
740
+ }
741
+
742
+ // MRD evidence
743
+ if (mrdStatus === 'negative') {
744
+ evidence.push('MRD negative by validated assay');
745
+ confidence += 0.2;
746
+ }
747
+
748
+ // ctDNA evidence
749
+ if (ctdnaStatus === 'undetectable') {
750
+ evidence.push('ctDNA undetectable');
751
+ confidence += 0.1;
752
+ }
753
+
754
+ // Time-based criteria
755
+ if (timeOffTherapy >= 24 && imagingResult === 'NED') {
756
+ evidence.push('Disease-free for 2+ years off therapy');
757
+ confidence += 0.2;
758
+ }
759
+
760
+ // Determine status
761
+ if (confidence >= 0.9 && imagingResult === 'NED' && (mrdStatus === 'negative' || ctdnaStatus === 'undetectable') && timeOffTherapy >= 24) {
762
+ status = 'CURED';
763
+ } else if (confidence >= 0.7 && (mrdStatus === 'negative' || ctdnaStatus === 'undetectable')) {
764
+ status = 'MRD_NEGATIVE';
765
+ } else if (imagingResult === 'CR' || imagingResult === 'NED') {
766
+ status = 'REMISSION';
767
+ } else if (imagingResult === 'PR') {
768
+ status = 'RESPONDING';
769
+ } else if (imagingResult === 'PD') {
770
+ status = 'PROGRESSING';
771
+ }
772
+
773
+ // Generate surveillance plan
774
+ const surveillancePlan = this.generateSurveillancePlan(cancerType, status);
775
+
776
+ // Long-term risks
777
+ const longTermRisks = this.assessLongTermRisks(cancerType, treatmentDuration);
778
+
779
+ return {
780
+ status,
781
+ confidence: Math.min(confidence, 0.98),
782
+ evidence,
783
+ surveillancePlan,
784
+ nextAssessment: this.getNextAssessmentTime(status),
785
+ longTermRisks
786
+ };
787
+ }
788
+
789
+ private generateSurveillancePlan(cancerType: string, status: string): string[] {
790
+ const basePlan = [
791
+ 'History and physical exam every 3-6 months for 2 years',
792
+ 'Annual imaging per cancer-specific guidelines',
793
+ 'Tumor markers if applicable'
794
+ ];
795
+
796
+ if (status === 'CURED' || status === 'MRD_NEGATIVE') {
797
+ basePlan.push('Transition to annual survivorship visits after 5 years');
798
+ basePlan.push('Long-term effects monitoring');
799
+ basePlan.push('Secondary malignancy screening');
800
+ }
801
+
802
+ return basePlan;
803
+ }
804
+
805
+ private assessLongTermRisks(cancerType: string, treatmentDuration: number): string[] {
806
+ const risks: string[] = [];
807
+
808
+ risks.push('Late recurrence (monitor per guidelines)');
809
+ risks.push('Second primary malignancy');
810
+ risks.push('Treatment-related late effects');
811
+
812
+ if (treatmentDuration > 12) {
813
+ risks.push('Cardiovascular monitoring recommended');
814
+ risks.push('Bone health assessment');
815
+ }
816
+
817
+ return risks;
818
+ }
819
+
820
+ private getNextAssessmentTime(status: string): string {
821
+ switch (status) {
822
+ case 'CURED': return '12 months (annual surveillance)';
823
+ case 'MRD_NEGATIVE': return '3-6 months (confirm durability)';
824
+ case 'REMISSION': return '3 months (confirm stability)';
825
+ case 'RESPONDING': return '2-3 months (assess depth of response)';
826
+ case 'STABLE': return '2-3 months (monitor for progression)';
827
+ case 'PROGRESSING': return 'Immediate (treatment change needed)';
828
+ default: return '3 months';
829
+ }
830
+ }
831
+ }
832
+
833
+ // Export singleton instances
834
+ export const resistanceManagementEngine = new ResistanceManagementEngine();
835
+ export const cureVerificationEngine = new CureVerificationEngine();