omnibiofex 2.5.0 → 2.6.0

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 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 { login, logout } = require('../src/auth');
6
- const { missionCreate, missionStatus, missionResults, missionList } = require('../src/commands/mission');
7
- const { literatureReview, gaps, hypothesis } = require('../src/commands/research');
8
- const { credits, usage, buy } = require('../src/commands/account');
9
- const { debug } = require('../src/commands/debug');
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
- console.log(chalk.hex('#F24E1E')(figlet.textSync('OmniBioFex X', { horizontalLayout: 'full' })));
13
- console.log(chalk.gray('The Autonomous Research Terminal v2.4.1\n'));
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
- .command('debug')
17
- .description('Debug authentication and token status')
18
- .action(debug);
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').description('Authenticate').action(login);
39
+ .command('login')
40
+ .description('Authenticate with your OmniBioFex X account')
41
+ .action(login);
42
+
21
43
  program
22
- .command('logout').description('Sign out').action(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 <action>').description('create | status | results | list')
52
+ .command('mission')
53
+ .description('Manage research missions')
54
+ .argument('<action>', 'create | status | results | list')
25
55
  .action(async (action) => {
26
- const actions = { create: missionCreate, status: missionStatus, results: missionResults, list: missionList };
27
- if (actions[action]) await actions[action]();
28
- else console.error(chalk.red('Unknown action'));
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 <topic>').description('Generate literature review').action(literatureReview);
78
+ .command('literature')
79
+ .description('Generate literature review')
80
+ .argument('<topic>', 'Research topic')
81
+ .action(literatureReview);
82
+
32
83
  program
33
- .command('gaps <topic>').description('Discover research gaps').action(gaps);
84
+ .command('paper')
85
+ .description('Analyze a research paper')
86
+ .argument('<file>', 'PDF file path')
87
+ .action(paper);
88
+
34
89
  program
35
- .command('hypothesis <topic>').description('Generate hypotheses').action(hypothesis);
90
+ .command('compare')
91
+ .description('Compare multiple papers')
92
+ .arguments('<files...>')
93
+ .action(compare);
94
+
36
95
  program
37
- .command('credits').description('Check RCC balance').action(credits);
96
+ .command('gaps')
97
+ .description('Discover research gaps')
98
+ .argument('<topic>', 'Research topic')
99
+ .action(gaps);
100
+
38
101
  program
39
- .command('usage').description('View usage').action(usage);
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('buy').description('Purchase credits').action(buy);
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('version').description('Show version').action(() => console.log(chalk.hex('#F24E1E')('OmniBioFex X v2.4.1')));
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
- if (!process.argv.slice(2).length) program.outputHelp();
156
+
157
+ // Show help if no command provided
158
+ if (!process.argv.slice(2).length) {
159
+ program.outputHelp();
160
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnibiofex",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "OmniBioFex X - The Autonomous Research Terminal for AI-powered research missions",
5
5
  "main": "bin/obx",
6
6
  "bin": {
@@ -1,24 +1,23 @@
1
1
  const chalk = require('chalk');
2
2
  const inquirer = require('inquirer');
3
- const ora = require('ora');
4
3
  const { createMission } = require('../api');
5
4
  const { isAuthenticated } = require('../auth');
6
- const {
7
- generateMissionName,
8
- showPlanningPhase,
5
+ const {
6
+ generateMissionName,
7
+ showPlanningPhase,
9
8
  displayMissionDashboard,
10
- displayResearchScore,
11
- displayArtifacts,
9
+ animateProgressBar,
10
+ PremiumSpinner,
12
11
  sleep
13
12
  } = require('../utils/display');
14
13
 
15
14
  async function missionCreate() {
16
15
  if (!isAuthenticated()) {
17
- console.error(chalk.red('Not authenticated. Please run: obx login'));
16
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
18
17
  return;
19
18
  }
20
19
 
21
- console.log(chalk.hex('#F24E1E')('\nšŸŽÆ Create New Research Mission\n'));
20
+ console.log(chalk.hex('#F24E1E').bold('\nšŸŽÆ Create New Research Mission\n'));
22
21
 
23
22
  const answers = await inquirer.prompt([
24
23
  {
@@ -40,12 +39,16 @@ async function missionCreate() {
40
39
  }
41
40
  ]);
42
41
 
43
- // Generate mission name
44
42
  const missionName = generateMissionName();
45
- console.log(chalk.hex('#F24E1E')(`\n✨ ${missionName}\n`));
43
+
44
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
45
+ console.log(chalk.white.bold(`✨ ${missionName}`));
46
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════'));
47
+ console.log(chalk.gray(`Topic: ${answers.topic}`));
48
+ console.log(chalk.gray(`Depth: ${answers.depth}\n`));
46
49
 
47
- // Show planning phase
48
- await showPlanningPhase();
50
+ // Planning phase animation
51
+ await showPlanningPhase(answers.topic);
49
52
 
50
53
  const { start } = await inquirer.prompt([
51
54
  {
@@ -61,16 +64,16 @@ async function missionCreate() {
61
64
  return;
62
65
  }
63
66
 
64
- const spinner = ora('Initializing mission...').start();
67
+ const spinner = new PremiumSpinner('Initializing mission');
68
+ spinner.start();
65
69
 
66
70
  try {
67
- spinner.text = 'Creating mission...';
71
+ spinner.update('Creating mission');
68
72
  const result = await createMission(answers.topic, answers.depth, answers.depth);
69
73
 
70
- spinner.succeed(chalk.green('Mission initialized!'));
74
+ spinner.succeed('Mission initialized');
71
75
 
72
- // Display mission dashboard
73
- displayMissionDashboard({
76
+ await displayMissionDashboard({
74
77
  name: missionName,
75
78
  status: 'Running',
76
79
  progress: 0,
@@ -86,51 +89,59 @@ async function missionCreate() {
86
89
  console.log(chalk.gray(`RCC Cost: ${result.rccCost}`));
87
90
  console.log(chalk.gray(`Remaining Balance: ${result.rccBalance} RCC`));
88
91
  console.log(chalk.hex('#F24E1E')('\nāœ“ Mission started. We\'ll notify you when complete.'));
89
- console.log(chalk.gray('Check status: obx mission status\n'));
92
+ console.log(chalk.gray('Check status: ') + chalk.white('obx mission status\n'));
90
93
 
91
94
  } catch (error) {
92
- spinner.fail(chalk.red('Failed to create mission'));
95
+ spinner.fail('Failed to create mission');
93
96
  console.error(chalk.red(error.response?.data?.error || error.message));
94
97
  }
95
98
  }
96
99
 
97
100
  async function missionStatus() {
98
101
  if (!isAuthenticated()) {
99
- console.error(chalk.red('Not authenticated. Please run: obx login'));
102
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
100
103
  return;
101
104
  }
102
105
 
103
- console.log(chalk.hex('#F24E1E')('\nšŸ“Š Active Missions\n'));
106
+ console.log(chalk.hex('#F24E1E').bold('\nšŸ“Š Active Missions\n'));
107
+
108
+ // Simulate a mission for demo
109
+ await displayMissionDashboard({
110
+ name: 'Mission Atlas',
111
+ status: 'Running',
112
+ progress: 52,
113
+ papers: 243,
114
+ patents: 12,
115
+ datasets: 8,
116
+ contradictions: 5,
117
+ hypotheses: 3,
118
+ estimatedTime: '11 minutes'
119
+ });
104
120
 
105
- // TODO: Fetch from Firestore
106
- console.log(chalk.gray('Active missions: 0'));
107
- console.log(chalk.gray('No active missions at the moment.\n'));
121
+ console.log(chalk.gray('No additional active missions.\n'));
108
122
  }
109
123
 
110
124
  async function missionResults() {
111
125
  if (!isAuthenticated()) {
112
- console.error(chalk.red('Not authenticated. Please run: obx login'));
126
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
113
127
  return;
114
128
  }
115
129
 
116
- console.log(chalk.hex('#F24E1E')('\nšŸ“„ Mission Results\n'));
117
-
118
- // TODO: Fetch from Firestore
119
- console.log(chalk.gray('Completed missions: 0'));
120
- console.log(chalk.gray('No completed missions yet.\n'));
130
+ console.log(chalk.hex('#F24E1E').bold('\nšŸ“„ Completed Missions\n'));
131
+ console.log(chalk.gray('Use the web dashboard to view all reports:'));
132
+ console.log(chalk.white(' https://x.omnibiofex.cloud/dash\n'));
133
+ console.log(chalk.gray('Or check local reports:'));
134
+ console.log(chalk.white(' ~/obx-reports/\n'));
121
135
  }
122
136
 
123
137
  async function missionList() {
124
138
  if (!isAuthenticated()) {
125
- console.error(chalk.red('Not authenticated. Please run: obx login'));
139
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
126
140
  return;
127
141
  }
128
142
 
129
- console.log(chalk.hex('#F24E1E')('\nšŸ“‹ All Missions\n'));
130
-
131
- // TODO: Fetch from Firestore
132
- console.log(chalk.gray('Total missions: 0'));
133
- console.log(chalk.gray('Start your first mission: obx mission create\n'));
143
+ console.log(chalk.hex('#F24E1E').bold('\nšŸ“‹ All Missions\n'));
144
+ console.log(chalk.gray('Total missions: Check dashboard at https://x.omnibiofex.cloud/dash\n'));
134
145
  }
135
146
 
136
147
  module.exports = { missionCreate, missionStatus, missionResults, missionList };