omnibiofex 2.5.0 ā 2.5.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.
- package/bin/obx +138 -24
- package/package.json +1 -1
package/bin/obx
CHANGED
|
@@ -1,46 +1,160 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
const { program } = require('commander');
|
|
3
4
|
const chalk = require('chalk');
|
|
4
5
|
const figlet = require('figlet');
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
// š„ FIX: Read version dynamically from package.json
|
|
10
|
+
const packageJson = JSON.parse(
|
|
11
|
+
fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8')
|
|
12
|
+
);
|
|
13
|
+
const VERSION = packageJson.version;
|
|
10
14
|
|
|
15
|
+
// Display banner
|
|
16
|
+
console.log(
|
|
17
|
+
chalk.hex('#F24E1E')(
|
|
18
|
+
figlet.textSync('OmniBioFex X', { horizontalLayout: 'full' })
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
console.log(chalk.gray(`The Autonomous Research Terminal v${VERSION}\n`));
|
|
11
22
|
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
// Global error handler
|
|
24
|
+
process.on('unhandledRejection', (error) => {
|
|
25
|
+
console.error(chalk.red('\nā Error:'), error.message);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
14
28
|
|
|
29
|
+
// š„ FIX: Register --version flag properly
|
|
15
30
|
program
|
|
16
|
-
.
|
|
17
|
-
.
|
|
18
|
-
.
|
|
31
|
+
.name('obx')
|
|
32
|
+
.version(VERSION, '-v, --version', 'Show CLI version')
|
|
33
|
+
.description('OmniBioFex X - The Autonomous Research Terminal');
|
|
34
|
+
|
|
35
|
+
// ==================== AUTHENTICATION ====================
|
|
36
|
+
const { login, logout } = require('../src/auth');
|
|
37
|
+
|
|
19
38
|
program
|
|
20
|
-
.command('login')
|
|
39
|
+
.command('login')
|
|
40
|
+
.description('Authenticate with your OmniBioFex X account')
|
|
41
|
+
.action(login);
|
|
42
|
+
|
|
21
43
|
program
|
|
22
|
-
.command('logout')
|
|
44
|
+
.command('logout')
|
|
45
|
+
.description('Sign out of your account')
|
|
46
|
+
.action(logout);
|
|
47
|
+
|
|
48
|
+
// ==================== MISSION COMMANDS ====================
|
|
49
|
+
const { missionCreate, missionStatus, missionResults, missionList } = require('../src/commands/mission');
|
|
50
|
+
|
|
23
51
|
program
|
|
24
|
-
.command('mission
|
|
52
|
+
.command('mission')
|
|
53
|
+
.description('Manage research missions')
|
|
54
|
+
.argument('<action>', 'create | status | results | list')
|
|
25
55
|
.action(async (action) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
56
|
+
switch (action) {
|
|
57
|
+
case 'create':
|
|
58
|
+
await missionCreate();
|
|
59
|
+
break;
|
|
60
|
+
case 'status':
|
|
61
|
+
await missionStatus();
|
|
62
|
+
break;
|
|
63
|
+
case 'results':
|
|
64
|
+
await missionResults();
|
|
65
|
+
break;
|
|
66
|
+
case 'list':
|
|
67
|
+
await missionList();
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
console.error(chalk.red('Unknown action. Use: create, status, results, or list'));
|
|
71
|
+
}
|
|
29
72
|
});
|
|
73
|
+
|
|
74
|
+
// ==================== RESEARCH COMMANDS ====================
|
|
75
|
+
const { literatureReview, paper, compare, gaps, hypothesis } = require('../src/commands/research');
|
|
76
|
+
|
|
30
77
|
program
|
|
31
|
-
.command('literature
|
|
78
|
+
.command('literature')
|
|
79
|
+
.description('Generate literature review')
|
|
80
|
+
.argument('<topic>', 'Research topic')
|
|
81
|
+
.action(literatureReview);
|
|
82
|
+
|
|
32
83
|
program
|
|
33
|
-
.command('
|
|
84
|
+
.command('paper')
|
|
85
|
+
.description('Analyze a research paper')
|
|
86
|
+
.argument('<file>', 'PDF file path')
|
|
87
|
+
.action(paper);
|
|
88
|
+
|
|
34
89
|
program
|
|
35
|
-
.command('
|
|
90
|
+
.command('compare')
|
|
91
|
+
.description('Compare multiple papers')
|
|
92
|
+
.arguments('<files...>')
|
|
93
|
+
.action(compare);
|
|
94
|
+
|
|
36
95
|
program
|
|
37
|
-
.command('
|
|
96
|
+
.command('gaps')
|
|
97
|
+
.description('Discover research gaps')
|
|
98
|
+
.argument('<topic>', 'Research topic')
|
|
99
|
+
.action(gaps);
|
|
100
|
+
|
|
38
101
|
program
|
|
39
|
-
.command('
|
|
102
|
+
.command('hypothesis')
|
|
103
|
+
.description('Generate research hypotheses')
|
|
104
|
+
.argument('<topic>', 'Research topic')
|
|
105
|
+
.action(hypothesis);
|
|
106
|
+
|
|
107
|
+
// ==================== DATA COMMANDS ====================
|
|
108
|
+
const { dataset, code, medical } = require('../src/commands/data');
|
|
109
|
+
|
|
110
|
+
program
|
|
111
|
+
.command('dataset')
|
|
112
|
+
.description('Analyze dataset')
|
|
113
|
+
.argument('<file>', 'CSV/Excel file path')
|
|
114
|
+
.action(dataset);
|
|
115
|
+
|
|
116
|
+
program
|
|
117
|
+
.command('code')
|
|
118
|
+
.description('Review code repository')
|
|
119
|
+
.argument('[directory]', 'Directory path', '.')
|
|
120
|
+
.action(code);
|
|
121
|
+
|
|
40
122
|
program
|
|
41
|
-
.command('
|
|
123
|
+
.command('medical')
|
|
124
|
+
.description('Analyze medical imaging')
|
|
125
|
+
.argument('<file>', 'DICOM/image file path')
|
|
126
|
+
.action(medical);
|
|
127
|
+
|
|
128
|
+
// ==================== ACCOUNT COMMANDS ====================
|
|
129
|
+
const { credits, usage, buy } = require('../src/commands/account');
|
|
130
|
+
|
|
131
|
+
program
|
|
132
|
+
.command('credits')
|
|
133
|
+
.description('Check your RCC balance')
|
|
134
|
+
.action(credits);
|
|
135
|
+
|
|
42
136
|
program
|
|
43
|
-
.command('
|
|
137
|
+
.command('usage')
|
|
138
|
+
.description('View usage statistics')
|
|
139
|
+
.action(usage);
|
|
44
140
|
|
|
141
|
+
program
|
|
142
|
+
.command('buy')
|
|
143
|
+
.description('Open browser to purchase credits')
|
|
144
|
+
.action(buy);
|
|
145
|
+
|
|
146
|
+
// ==================== DEBUG COMMAND ====================
|
|
147
|
+
const { debug } = require('../src/commands/debug');
|
|
148
|
+
|
|
149
|
+
program
|
|
150
|
+
.command('debug')
|
|
151
|
+
.description('Debug authentication and token status')
|
|
152
|
+
.action(debug);
|
|
153
|
+
|
|
154
|
+
// Parse arguments
|
|
45
155
|
program.parse(process.argv);
|
|
46
|
-
|
|
156
|
+
|
|
157
|
+
// Show help if no command provided
|
|
158
|
+
if (!process.argv.slice(2).length) {
|
|
159
|
+
program.outputHelp();
|
|
160
|
+
}
|