@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.
- package/dist/bin/cure.d.ts +2 -5
- package/dist/bin/cure.d.ts.map +1 -1
- package/dist/bin/cure.js +285 -124
- package/dist/bin/cure.js.map +1 -1
- package/dist/clinician/decisionSupport.d.ts +325 -0
- package/dist/clinician/decisionSupport.d.ts.map +1 -0
- package/dist/clinician/decisionSupport.js +604 -0
- package/dist/clinician/decisionSupport.js.map +1 -0
- package/dist/clinician/index.d.ts +5 -0
- package/dist/clinician/index.d.ts.map +1 -0
- package/dist/clinician/index.js +5 -0
- package/dist/clinician/index.js.map +1 -0
- package/dist/compliance/index.d.ts +5 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +5 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/integrations/clinicalTrials/index.d.ts +5 -0
- package/dist/integrations/clinicalTrials/index.d.ts.map +1 -0
- package/dist/integrations/clinicalTrials/index.js +5 -0
- package/dist/integrations/clinicalTrials/index.js.map +1 -0
- package/dist/integrations/ehr/index.d.ts +5 -0
- package/dist/integrations/ehr/index.d.ts.map +1 -0
- package/dist/integrations/ehr/index.js +5 -0
- package/dist/integrations/ehr/index.js.map +1 -0
- package/dist/integrations/genomics/index.d.ts +5 -0
- package/dist/integrations/genomics/index.d.ts.map +1 -0
- package/dist/integrations/genomics/index.js +5 -0
- package/dist/integrations/genomics/index.js.map +1 -0
- package/dist/integrations/index.d.ts +7 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +10 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/ml/index.d.ts +5 -0
- package/dist/ml/index.d.ts.map +1 -0
- package/dist/ml/index.js +5 -0
- package/dist/ml/index.js.map +1 -0
- package/dist/ml/outcomePredictor.d.ts +297 -0
- package/dist/ml/outcomePredictor.d.ts.map +1 -0
- package/dist/ml/outcomePredictor.js +823 -0
- package/dist/ml/outcomePredictor.js.map +1 -0
- package/dist/patient/index.d.ts +5 -0
- package/dist/patient/index.d.ts.map +1 -0
- package/dist/patient/index.js +5 -0
- package/dist/patient/index.js.map +1 -0
- package/dist/patient/patientPortal.d.ts +337 -0
- package/dist/patient/patientPortal.d.ts.map +1 -0
- package/dist/patient/patientPortal.js +667 -0
- package/dist/patient/patientPortal.js.map +1 -0
- package/dist/safety/drugInteractions.d.ts +230 -0
- package/dist/safety/drugInteractions.d.ts.map +1 -0
- package/dist/safety/drugInteractions.js +697 -0
- package/dist/safety/drugInteractions.js.map +1 -0
- package/dist/safety/index.d.ts +5 -0
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/index.js +5 -0
- package/dist/safety/index.js.map +1 -0
- package/dist/validation/index.d.ts +5 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +5 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/retrospectiveValidator.d.ts +246 -0
- package/dist/validation/retrospectiveValidator.d.ts.map +1 -0
- package/dist/validation/retrospectiveValidator.js +602 -0
- package/dist/validation/retrospectiveValidator.js.map +1 -0
- package/package.json +1 -1
- package/src/bin/cure.ts +331 -140
- package/src/clinician/decisionSupport.ts +949 -0
- 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
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
// Handle commands
|
|
32
|
-
if (args.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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 (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
console.log(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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(
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
--patient=<id>
|
|
161
|
-
--protocol=<id>
|
|
162
|
-
--genomics
|
|
163
|
-
--target=<gene>
|
|
164
|
-
--cancer=<type>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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(
|
|
371
|
+
console.error(`${colors.red}Error:${colors.reset}`, error);
|
|
181
372
|
process.exit(1);
|
|
182
|
-
});
|
|
373
|
+
});
|