@erosolaraijs/cure 1.0.1 → 1.0.2

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 (68) hide show
  1. package/dist/bin/cure.d.ts +2 -5
  2. package/dist/bin/cure.d.ts.map +1 -1
  3. package/dist/bin/cure.js +285 -124
  4. package/dist/bin/cure.js.map +1 -1
  5. package/dist/clinician/decisionSupport.d.ts +325 -0
  6. package/dist/clinician/decisionSupport.d.ts.map +1 -0
  7. package/dist/clinician/decisionSupport.js +604 -0
  8. package/dist/clinician/decisionSupport.js.map +1 -0
  9. package/dist/clinician/index.d.ts +5 -0
  10. package/dist/clinician/index.d.ts.map +1 -0
  11. package/dist/clinician/index.js +5 -0
  12. package/dist/clinician/index.js.map +1 -0
  13. package/dist/compliance/index.d.ts +5 -0
  14. package/dist/compliance/index.d.ts.map +1 -0
  15. package/dist/compliance/index.js +5 -0
  16. package/dist/compliance/index.js.map +1 -0
  17. package/dist/integrations/clinicalTrials/index.d.ts +5 -0
  18. package/dist/integrations/clinicalTrials/index.d.ts.map +1 -0
  19. package/dist/integrations/clinicalTrials/index.js +5 -0
  20. package/dist/integrations/clinicalTrials/index.js.map +1 -0
  21. package/dist/integrations/ehr/index.d.ts +5 -0
  22. package/dist/integrations/ehr/index.d.ts.map +1 -0
  23. package/dist/integrations/ehr/index.js +5 -0
  24. package/dist/integrations/ehr/index.js.map +1 -0
  25. package/dist/integrations/genomics/index.d.ts +5 -0
  26. package/dist/integrations/genomics/index.d.ts.map +1 -0
  27. package/dist/integrations/genomics/index.js +5 -0
  28. package/dist/integrations/genomics/index.js.map +1 -0
  29. package/dist/integrations/index.d.ts +7 -0
  30. package/dist/integrations/index.d.ts.map +1 -0
  31. package/dist/integrations/index.js +10 -0
  32. package/dist/integrations/index.js.map +1 -0
  33. package/dist/ml/index.d.ts +5 -0
  34. package/dist/ml/index.d.ts.map +1 -0
  35. package/dist/ml/index.js +5 -0
  36. package/dist/ml/index.js.map +1 -0
  37. package/dist/ml/outcomePredictor.d.ts +297 -0
  38. package/dist/ml/outcomePredictor.d.ts.map +1 -0
  39. package/dist/ml/outcomePredictor.js +823 -0
  40. package/dist/ml/outcomePredictor.js.map +1 -0
  41. package/dist/patient/index.d.ts +5 -0
  42. package/dist/patient/index.d.ts.map +1 -0
  43. package/dist/patient/index.js +5 -0
  44. package/dist/patient/index.js.map +1 -0
  45. package/dist/patient/patientPortal.d.ts +337 -0
  46. package/dist/patient/patientPortal.d.ts.map +1 -0
  47. package/dist/patient/patientPortal.js +667 -0
  48. package/dist/patient/patientPortal.js.map +1 -0
  49. package/dist/safety/drugInteractions.d.ts +230 -0
  50. package/dist/safety/drugInteractions.d.ts.map +1 -0
  51. package/dist/safety/drugInteractions.js +697 -0
  52. package/dist/safety/drugInteractions.js.map +1 -0
  53. package/dist/safety/index.d.ts +5 -0
  54. package/dist/safety/index.d.ts.map +1 -0
  55. package/dist/safety/index.js +5 -0
  56. package/dist/safety/index.js.map +1 -0
  57. package/dist/validation/index.d.ts +5 -0
  58. package/dist/validation/index.d.ts.map +1 -0
  59. package/dist/validation/index.js +5 -0
  60. package/dist/validation/index.js.map +1 -0
  61. package/dist/validation/retrospectiveValidator.d.ts +246 -0
  62. package/dist/validation/retrospectiveValidator.d.ts.map +1 -0
  63. package/dist/validation/retrospectiveValidator.js +602 -0
  64. package/dist/validation/retrospectiveValidator.js.map +1 -0
  65. package/package.json +1 -1
  66. package/src/bin/cure.ts +331 -140
  67. package/src/clinician/decisionSupport.ts +949 -0
  68. package/src/patient/patientPortal.ts +1039 -0
package/src/bin/cure.ts CHANGED
@@ -1,21 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * 癌症治疗统一人工智能框架 - 核心医疗控制台
4
- * Unified Cancer Treatment Framework - Core Medical Console
5
- *
6
- * 全球首个人工通用智能驱动的癌症治疗统一指挥控制平台
7
- * 提供完整的癌症研究、药物发现、治疗规划、患者管理和医疗系统集成能力
3
+ * Cure - AI Cancer Treatment Framework
4
+ * Interactive CLI for precision oncology research and clinical decision support
8
5
  */
9
6
 
7
+ import * as readline from 'readline';
10
8
  import { CancerTreatmentCapabilityModule } from '../capabilities/cancerTreatmentCapability.js';
11
9
 
10
+ const VERSION = '1.0.2';
11
+
12
+ // ANSI color codes
13
+ const colors = {
14
+ reset: '\x1b[0m',
15
+ bold: '\x1b[1m',
16
+ dim: '\x1b[2m',
17
+ cyan: '\x1b[36m',
18
+ green: '\x1b[32m',
19
+ yellow: '\x1b[33m',
20
+ blue: '\x1b[34m',
21
+ magenta: '\x1b[35m',
22
+ red: '\x1b[31m',
23
+ white: '\x1b[37m',
24
+ };
25
+
26
+ let cancerTreatment: CancerTreatmentCapabilityModule;
27
+
12
28
  async function main(): Promise<void> {
13
29
  const args = process.argv.slice(2);
14
30
 
15
31
  // Check for version flag
16
32
  if (args.includes('--version') || args.includes('-v')) {
17
- const pkg = JSON.parse(await import('fs').then(fs => fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf-8')));
18
- console.log(`agi-core-cancer-treatment v${pkg.version}`);
33
+ console.log(`cure v${VERSION}`);
19
34
  process.exit(0);
20
35
  }
21
36
 
@@ -26,157 +41,333 @@ async function main(): Promise<void> {
26
41
  }
27
42
 
28
43
  // Initialize module
29
- const cancerTreatment = new CancerTreatmentCapabilityModule();
30
-
31
- // Handle commands
32
- if (args.includes('--cancer-treatment') || args.includes('--medical')) {
33
- console.log('\n🏥 癌症治疗人工智能框架激活\n');
34
- console.log('💊 最大能力癌症治疗框架 - 全面医疗与AI能力\n');
35
- console.log('📊 框架提供以下核心能力:');
36
- console.log(' • 个性化癌症治疗协议分析与规划');
37
- console.log(' • AI驱动的药物靶点发现与设计');
38
- console.log(' • 精准医疗与基因组分析管道');
39
- console.log(' • 临床试验管理与优化');
40
- console.log(' • 患者多维度评估与监测');
41
- console.log(' • 医疗系统集成与数据协调');
42
- console.log(' • 统一医疗指挥与协调系统');
43
- console.log(' • 人工智能治疗决策支持\n');
44
-
45
- console.log('✅ 癌症治疗能力框架初始化完成');
46
- console.log('🚀 使用 --help 查看可用命令');
47
- }
48
- else if (args.includes('--analyze-patient')) {
49
- const patientId = args.find(arg => arg.startsWith('--patient='))?.split('=')[1] || 'P001';
50
- const includeGenomics = args.includes('--genomics');
51
-
52
- console.log(`\n🔍 分析患者: ${patientId}`);
53
- console.log('───────────────────────────');
54
-
55
- try {
56
- const result = await cancerTreatment.analyzePatient(patientId, includeGenomics);
57
- console.log('📊 分析结果:');
58
- console.log(` • 癌症类型: ${result.analysis.cancerType}`);
59
- console.log(` • 分期: ${result.analysis.stage}`);
60
- console.log(` • 生物标志物: ${result.analysis.biomarkers.join(', ')}`);
61
- console.log(` • 生存概率: ${(result.analysis.riskAssessment.survivalProbability * 100).toFixed(1)}%`);
62
- console.log('✅ 分析完成');
63
- } catch (error) {
64
- console.error('❌ 分析失败:', error);
44
+ cancerTreatment = new CancerTreatmentCapabilityModule();
45
+
46
+ // Handle direct commands or launch interactive mode
47
+ if (args.length > 0) {
48
+ await handleCommand(args);
49
+ } else {
50
+ await launchInteractiveMode();
51
+ }
52
+ }
53
+
54
+ async function launchInteractiveMode(): Promise<void> {
55
+ console.clear();
56
+ printBanner();
57
+
58
+ const rl = readline.createInterface({
59
+ input: process.stdin,
60
+ output: process.stdout,
61
+ });
62
+
63
+ const prompt = () => {
64
+ process.stdout.write(`\n${colors.cyan}cure${colors.reset} ${colors.dim}>${colors.reset} `);
65
+ };
66
+
67
+ console.log(`${colors.dim}Type a command or describe what you need. Type /help for commands.${colors.reset}\n`);
68
+ prompt();
69
+
70
+ rl.on('line', async (input) => {
71
+ const trimmed = input.trim();
72
+
73
+ if (!trimmed) {
74
+ prompt();
75
+ return;
76
+ }
77
+
78
+ if (trimmed === '/exit' || trimmed === '/quit' || trimmed === 'exit' || trimmed === 'quit') {
79
+ console.log(`\n${colors.dim}Goodbye.${colors.reset}\n`);
80
+ rl.close();
81
+ process.exit(0);
65
82
  }
83
+
84
+ if (trimmed === '/help' || trimmed === 'help') {
85
+ printInteractiveHelp();
86
+ prompt();
87
+ return;
88
+ }
89
+
90
+ if (trimmed === '/clear') {
91
+ console.clear();
92
+ printBanner();
93
+ prompt();
94
+ return;
95
+ }
96
+
97
+ await processInput(trimmed);
98
+ prompt();
99
+ });
100
+
101
+ rl.on('close', () => {
102
+ process.exit(0);
103
+ });
104
+ }
105
+
106
+ async function processInput(input: string): Promise<void> {
107
+ const lower = input.toLowerCase();
108
+
109
+ // Slash commands
110
+ if (input.startsWith('/')) {
111
+ const parts = input.slice(1).split(' ');
112
+ const cmd = parts[0];
113
+ const args = parts.slice(1);
114
+
115
+ switch (cmd) {
116
+ case 'analyze':
117
+ await analyzePatient(args[0] || 'P001', args.includes('--genomics'));
118
+ break;
119
+ case 'plan':
120
+ await designTreatmentPlan(args[0] || 'P001', args[1]);
121
+ break;
122
+ case 'discover':
123
+ await discoverTargets(args[0] || 'EGFR', args[1] || 'Lung');
124
+ break;
125
+ case 'demo':
126
+ await runDemo();
127
+ break;
128
+ case 'version':
129
+ console.log(`\n${colors.cyan}cure${colors.reset} v${VERSION}`);
130
+ break;
131
+ default:
132
+ console.log(`\n${colors.red}Unknown command: /${cmd}${colors.reset}`);
133
+ console.log(`${colors.dim}Type /help for available commands.${colors.reset}`);
134
+ }
135
+ return;
66
136
  }
67
- else if (args.includes('--treatment-plan')) {
68
- const patientId = args.find(arg => arg.startsWith('--patient='))?.split('=')[1] || 'P001';
69
- const protocolId = args.find(arg => arg.startsWith('--protocol='))?.split('=')[1];
70
-
71
- console.log(`\n💊 设计治疗计划: ${patientId}`);
72
- console.log('─────────────────────────────');
73
-
74
- try {
75
- const result = await cancerTreatment.designTreatmentPlan(patientId, protocolId);
76
- console.log('📋 治疗计划:');
77
- console.log(` • 协议: ${result.plan.protocol.name}`);
78
- console.log(` • 治疗方式: ${result.plan.protocol.treatmentModalities.join(', ')}`);
79
- console.log(` • 预计疗效: ${(result.estimatedEfficacy * 100).toFixed(1)}%`);
80
- console.log(` • 时间线: ${result.plan.treatmentTimeline.length} 周`);
81
- console.log(' 治疗计划设计完成');
82
- } catch (error) {
83
- console.error('❌ 治疗计划设计失败:', error);
137
+
138
+ // Natural language processing
139
+ if (lower.includes('analyze') && lower.includes('patient')) {
140
+ const match = input.match(/patient\s+(\w+)/i) || input.match(/P\d+/i);
141
+ const patientId = match ? match[0].replace(/patient\s+/i, '') : 'P001';
142
+ await analyzePatient(patientId, lower.includes('genom'));
143
+ }
144
+ else if (lower.includes('treatment') || lower.includes('plan')) {
145
+ const match = input.match(/patient\s+(\w+)/i) || input.match(/P\d+/i);
146
+ const patientId = match ? match[0].replace(/patient\s+/i, '') : 'P001';
147
+ await designTreatmentPlan(patientId);
148
+ }
149
+ else if (lower.includes('drug') || lower.includes('target') || lower.includes('discover')) {
150
+ const genes = ['EGFR', 'KRAS', 'BRAF', 'HER2', 'ALK', 'ROS1', 'PIK3CA', 'TP53'];
151
+ const cancers = ['lung', 'breast', 'colon', 'melanoma', 'pancreatic'];
152
+
153
+ let gene = 'EGFR';
154
+ let cancer = 'Lung';
155
+
156
+ for (const g of genes) {
157
+ if (lower.includes(g.toLowerCase())) {
158
+ gene = g;
159
+ break;
160
+ }
161
+ }
162
+ for (const c of cancers) {
163
+ if (lower.includes(c)) {
164
+ cancer = c.charAt(0).toUpperCase() + c.slice(1);
165
+ break;
166
+ }
84
167
  }
168
+
169
+ await discoverTargets(gene, cancer);
85
170
  }
86
- else if (args.includes('--drug-discovery')) {
87
- const targetGene = args.find(arg => arg.startsWith('--target='))?.split('=')[1] || 'EGFR';
88
- const cancerType = args.find(arg => arg.startsWith('--cancer='))?.split('=')[1] || 'Lung';
89
-
90
- console.log(`\n🧬 药物靶点发现: ${targetGene} (${cancerType} 癌症)`);
91
- console.log('──────────────────────────────');
92
-
93
- try {
94
- const result = await cancerTreatment.discoverDrugTargets(cancerType, targetGene);
95
- console.log('🔬 发现结果:');
96
- console.log(` • 癌症类型: ${result.cancerType}`);
97
- console.log(` • 目标基因: ${result.targetGene || '所有'}`);
98
- console.log(` • 发现靶点: ${result.discoveredTargets.length} 个`);
99
-
100
- result.discoveredTargets.slice(0, 3).forEach((target: any, index: number) => {
101
- console.log(` ${index + 1}. ${target.gene} - ${target.evidenceLevel} 证据等级`);
102
- console.log(` 相关癌症: ${target.cancerTypes.join(', ')}`);
103
- });
104
-
105
- console.log('✅ 药物靶点发现完成');
106
- } catch (error) {
107
- console.error('❌ 药物发现失败:', error);
171
+ else if (lower.includes('demo')) {
172
+ await runDemo();
173
+ }
174
+ else {
175
+ // Default response
176
+ console.log(`\n${colors.cyan}I can help you with:${colors.reset}`);
177
+ console.log(` ${colors.dim}•${colors.reset} Analyzing patient data`);
178
+ console.log(` ${colors.dim}•${colors.reset} Designing treatment plans`);
179
+ console.log(` ${colors.dim}•${colors.reset} Discovering drug targets`);
180
+ console.log(` ${colors.dim}•${colors.reset} Running clinical demos`);
181
+ console.log(`\n${colors.dim}Try: "analyze patient P001" or type /help${colors.reset}`);
182
+ }
183
+ }
184
+
185
+ async function analyzePatient(patientId: string, includeGenomics: boolean = false): Promise<void> {
186
+ console.log(`\n${colors.cyan}Analyzing patient ${patientId}...${colors.reset}\n`);
187
+
188
+ try {
189
+ const result = await cancerTreatment.analyzePatient(patientId, includeGenomics);
190
+
191
+ console.log(`${colors.bold}Patient Analysis${colors.reset}`);
192
+ console.log(`${colors.dim}─────────────────────────────${colors.reset}`);
193
+ console.log(` Cancer Type: ${colors.yellow}${result.analysis.cancerType}${colors.reset}`);
194
+ console.log(` Stage: ${colors.yellow}${result.analysis.stage}${colors.reset}`);
195
+ console.log(` Biomarkers: ${result.analysis.biomarkers.join(', ')}`);
196
+ console.log(` Survival Prob: ${colors.green}${(result.analysis.riskAssessment.survivalProbability * 100).toFixed(1)}%${colors.reset}`);
197
+ console.log(` Recurrence: ${colors.yellow}${(result.analysis.riskAssessment.recurrenceRisk * 100).toFixed(1)}%${colors.reset}`);
198
+
199
+ if (result.analysis.genomicProfile) {
200
+ console.log(`\n${colors.bold}Genomic Profile${colors.reset}`);
201
+ console.log(` Mutations: ${result.analysis.genomicProfile.mutations?.length || 0} detected`);
108
202
  }
203
+
204
+ console.log(`\n${colors.green}✓ Analysis complete${colors.reset}`);
205
+ } catch (error) {
206
+ console.error(`${colors.red}✗ Analysis failed:${colors.reset}`, error);
109
207
  }
110
- else if (args.includes('--demo')) {
111
- console.log('\n🏥 癌症治疗框架演示');
112
- console.log('────────────────────');
113
-
114
- try {
115
- const { demonstrateCancerTreatmentFramework } = await import('../examples/cancerTreatmentDemo.js');
116
- await demonstrateCancerTreatmentFramework();
117
- } catch (error) {
118
- console.error('❌ 演示失败:', error);
208
+ }
209
+
210
+ async function designTreatmentPlan(patientId: string, protocolId?: string): Promise<void> {
211
+ console.log(`\n${colors.cyan}Designing treatment plan for ${patientId}...${colors.reset}\n`);
212
+
213
+ try {
214
+ const result = await cancerTreatment.designTreatmentPlan(patientId, protocolId);
215
+
216
+ console.log(`${colors.bold}Treatment Plan${colors.reset}`);
217
+ console.log(`${colors.dim}─────────────────────────────${colors.reset}`);
218
+ console.log(` Protocol: ${colors.yellow}${result.plan.protocol.name}${colors.reset}`);
219
+ console.log(` Modalities: ${result.plan.protocol.treatmentModalities.join(', ')}`);
220
+ console.log(` Est. Efficacy: ${colors.green}${(result.estimatedEfficacy * 100).toFixed(1)}%${colors.reset}`);
221
+ console.log(` Duration: ${result.plan.treatmentTimeline.length} weeks`);
222
+
223
+ console.log(`\n${colors.bold}Timeline${colors.reset}`);
224
+ result.plan.treatmentTimeline.slice(0, 4).forEach((week: any, i: number) => {
225
+ console.log(` Week ${i + 1}: ${week.phase} - ${week.activities.join(', ')}`);
226
+ });
227
+ if (result.plan.treatmentTimeline.length > 4) {
228
+ console.log(` ${colors.dim}... and ${result.plan.treatmentTimeline.length - 4} more weeks${colors.reset}`);
119
229
  }
230
+
231
+ console.log(`\n${colors.green}✓ Plan generated${colors.reset}`);
232
+ } catch (error) {
233
+ console.error(`${colors.red}✗ Plan generation failed:${colors.reset}`, error);
234
+ }
235
+ }
236
+
237
+ async function discoverTargets(gene: string, cancerType: string): Promise<void> {
238
+ console.log(`\n${colors.cyan}Discovering drug targets for ${gene} in ${cancerType} cancer...${colors.reset}\n`);
239
+
240
+ try {
241
+ const result = await cancerTreatment.discoverDrugTargets(cancerType, gene);
242
+
243
+ console.log(`${colors.bold}Drug Target Discovery${colors.reset}`);
244
+ console.log(`${colors.dim}─────────────────────────────${colors.reset}`);
245
+ console.log(` Cancer Type: ${colors.yellow}${result.cancerType}${colors.reset}`);
246
+ console.log(` Target Gene: ${colors.yellow}${result.targetGene || 'All'}${colors.reset}`);
247
+ console.log(` Targets Found: ${result.discoveredTargets.length}`);
248
+
249
+ console.log(`\n${colors.bold}Top Targets${colors.reset}`);
250
+ result.discoveredTargets.slice(0, 5).forEach((target: any, i: number) => {
251
+ console.log(` ${i + 1}. ${colors.cyan}${target.gene}${colors.reset} - ${target.evidenceLevel} evidence`);
252
+ console.log(` ${colors.dim}Cancers: ${target.cancerTypes.slice(0, 3).join(', ')}${colors.reset}`);
253
+ });
254
+
255
+ console.log(`\n${colors.green}✓ Discovery complete${colors.reset}`);
256
+ } catch (error) {
257
+ console.error(`${colors.red}✗ Discovery failed:${colors.reset}`, error);
258
+ }
259
+ }
260
+
261
+ async function runDemo(): Promise<void> {
262
+ console.log(`\n${colors.cyan}Running framework demo...${colors.reset}\n`);
263
+
264
+ try {
265
+ const { demonstrateCancerTreatmentFramework } = await import('../examples/cancerTreatmentDemo.js');
266
+ await demonstrateCancerTreatmentFramework();
267
+ } catch (error) {
268
+ console.error(`${colors.red}✗ Demo failed:${colors.reset}`, error);
269
+ }
270
+ }
271
+
272
+ async function handleCommand(args: string[]): Promise<void> {
273
+ if (args.includes('--analyze-patient')) {
274
+ const patientId = args.find(a => a.startsWith('--patient='))?.split('=')[1] || 'P001';
275
+ await analyzePatient(patientId, args.includes('--genomics'));
276
+ }
277
+ else if (args.includes('--treatment-plan')) {
278
+ const patientId = args.find(a => a.startsWith('--patient='))?.split('=')[1] || 'P001';
279
+ const protocolId = args.find(a => a.startsWith('--protocol='))?.split('=')[1];
280
+ await designTreatmentPlan(patientId, protocolId);
120
281
  }
121
- else if (args.length === 0) {
122
- // Interactive mode
123
- console.log('\n🏥 AGI 癌症治疗框架');
124
- console.log('══════════════════════════════════════');
125
- console.log('\n🔧 可用命令:');
126
- console.log(' agi --cancer-treatment 激活癌症治疗框架');
127
- console.log(' agi --analyze-patient --patient=P001 分析患者数据');
128
- console.log(' agi --treatment-plan --patient=P001 设计治疗计划');
129
- console.log(' agi --drug-discovery --target=EGFR 药物靶点发现');
130
- console.log(' agi --clinical-trial 临床试验演示');
131
- console.log(' agi --demo 完整框架演示');
132
- console.log(' agi --help 显示帮助信息');
133
- console.log(' agi --version 显示版本信息');
134
- console.log('\n📚 了解更多:');
135
- console.log(' 查看 README.md 获取完整文档和使用指南');
282
+ else if (args.includes('--drug-discovery')) {
283
+ const gene = args.find(a => a.startsWith('--target='))?.split('=')[1] || 'EGFR';
284
+ const cancer = args.find(a => a.startsWith('--cancer='))?.split('=')[1] || 'Lung';
285
+ await discoverTargets(gene, cancer);
286
+ }
287
+ else if (args.includes('--demo')) {
288
+ await runDemo();
136
289
  }
137
290
  else {
138
- console.log('❌ 未知命令。使用 agi --help 查看可用命令。');
291
+ console.log(`${colors.red}Unknown command.${colors.reset} Use cure --help for usage.`);
139
292
  process.exit(1);
140
293
  }
141
294
  }
142
295
 
296
+ function printBanner(): void {
297
+ console.log(`
298
+ ${colors.cyan}${colors.bold} ╔═══════════════════════════════════════════════════════════╗
299
+ ║ ║
300
+ ║ ██████╗██╗ ██╗██████╗ ███████╗ ║
301
+ ║ ██╔════╝██║ ██║██╔══██╗██╔════╝ ║
302
+ ║ ██║ ██║ ██║██████╔╝█████╗ ║
303
+ ║ ██║ ██║ ██║██╔══██╗██╔══╝ ║
304
+ ║ ╚██████╗╚██████╔╝██║ ██║███████╗ ║
305
+ ║ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ║
306
+ ║ ║
307
+ ║ AI Cancer Treatment Framework ║
308
+ ║ Precision Oncology Research & Clinical Decision Support ║
309
+ ║ ║
310
+ ╚═══════════════════════════════════════════════════════════╝${colors.reset}
311
+
312
+ ${colors.dim}v${VERSION}${colors.reset}
313
+ `);
314
+ }
315
+
316
+ function printInteractiveHelp(): void {
317
+ console.log(`
318
+ ${colors.bold}Commands${colors.reset}
319
+ ${colors.dim}─────────────────────────────${colors.reset}
320
+ ${colors.cyan}/analyze${colors.reset} [patient] Analyze patient data
321
+ ${colors.cyan}/plan${colors.reset} [patient] Design treatment plan
322
+ ${colors.cyan}/discover${colors.reset} [gene] Drug target discovery
323
+ ${colors.cyan}/demo${colors.reset} Run framework demo
324
+ ${colors.cyan}/clear${colors.reset} Clear screen
325
+ ${colors.cyan}/help${colors.reset} Show this help
326
+ ${colors.cyan}/exit${colors.reset} Exit
327
+
328
+ ${colors.bold}Natural Language${colors.reset}
329
+ ${colors.dim}─────────────────────────────${colors.reset}
330
+ "analyze patient P001"
331
+ "create treatment plan for P002"
332
+ "find EGFR targets in lung cancer"
333
+ "run demo"
334
+ `);
335
+ }
336
+
143
337
  function printHelp(): void {
144
338
  console.log(`
145
- 🏥 AGI 癌症治疗框架 - 命令行工具
146
-
147
- 使用方法:
148
- agi [命令] [选项]
149
-
150
- 命令:
151
- --cancer-treatment, --medical 激活癌症治疗框架
152
- --analyze-patient 分析患者数据
153
- --treatment-plan 设计个性化治疗计划
154
- --drug-discovery AI驱动的药物靶点发现
155
- --demo 完整框架演示
156
- --help, -h 显示此帮助信息
157
- --version, -v 显示版本信息
158
-
159
- 选项:
160
- --patient=<id> 患者ID (默认: P001)
161
- --protocol=<id> 治疗协议ID
162
- --genomics 包含基因组数据分析
163
- --target=<gene> 目标基因 (默认: EGFR)
164
- --cancer=<type> 癌症类型 (默认: Lung)
165
-
166
- 示例:
167
- agi --cancer-treatment
168
- agi --analyze-patient --patient=P001 --genomics
169
- agi --treatment-plan --patient=P001 --protocol=nccn-breast-early
170
- agi --drug-discovery --target=EGFR --cancer=Lung
171
- agi --demo
172
-
173
- 📞 技术支持: medical-support@agi-cancer-treatment.org
174
- 📚 文档: 查看项目目录中的 README.md
339
+ ${colors.bold}Cure - AI Cancer Treatment Framework${colors.reset}
340
+
341
+ ${colors.bold}Usage:${colors.reset}
342
+ cure Launch interactive mode
343
+ cure [command] Run a specific command
344
+
345
+ ${colors.bold}Commands:${colors.reset}
346
+ --analyze-patient Analyze patient data
347
+ --treatment-plan Design treatment plan
348
+ --drug-discovery Drug target discovery
349
+ --demo Run framework demo
350
+ --help, -h Show this help
351
+ --version, -v Show version
352
+
353
+ ${colors.bold}Options:${colors.reset}
354
+ --patient=<id> Patient ID (default: P001)
355
+ --protocol=<id> Treatment protocol
356
+ --genomics Include genomic analysis
357
+ --target=<gene> Target gene (default: EGFR)
358
+ --cancer=<type> Cancer type (default: Lung)
359
+
360
+ ${colors.bold}Examples:${colors.reset}
361
+ cure
362
+ cure --analyze-patient --patient=P001 --genomics
363
+ cure --treatment-plan --patient=P001
364
+ cure --drug-discovery --target=BRAF --cancer=Melanoma
365
+
366
+ ${colors.dim}https://npmjs.com/package/@erosolaraijs/cure${colors.reset}
175
367
  `);
176
368
  }
177
369
 
178
- // Run main function
179
370
  main().catch((error) => {
180
- console.error('应用程序错误:', error);
371
+ console.error(`${colors.red}Error:${colors.reset}`, error);
181
372
  process.exit(1);
182
- });
373
+ });