omnibiofex 2.7.0 → 2.8.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
@@ -6,7 +6,7 @@ const figlet = require('figlet');
6
6
  const path = require('path');
7
7
  const fs = require('fs');
8
8
 
9
- // šŸ”„ FIX: Read version dynamically from package.json
9
+ // Read version dynamically from package.json
10
10
  const packageJson = JSON.parse(
11
11
  fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8')
12
12
  );
@@ -18,7 +18,8 @@ console.log(
18
18
  figlet.textSync('OmniBioFex X', { horizontalLayout: 'full' })
19
19
  )
20
20
  );
21
- console.log(chalk.gray(`The Autonomous Research Terminal v${VERSION}\n`));
21
+ console.log(chalk.gray(`The Autonomous Research Operating System v${VERSION}\n`));
22
+ console.log(chalk.hex('#F24E1E')('Create Research. Publish It. Earn From It.\n'));
22
23
 
23
24
  // Global error handler
24
25
  process.on('unhandledRejection', (error) => {
@@ -26,11 +27,11 @@ process.on('unhandledRejection', (error) => {
26
27
  process.exit(1);
27
28
  });
28
29
 
29
- // šŸ”„ FIX: Register --version flag properly
30
+ // Register --version flag
30
31
  program
31
32
  .name('obx')
32
33
  .version(VERSION, '-v, --version', 'Show CLI version')
33
- .description('OmniBioFex X - The Autonomous Research Terminal');
34
+ .description('OmniBioFex X - The Autonomous Research Operating System');
34
35
 
35
36
  // ==================== AUTHENTICATION ====================
36
37
  const { login, logout } = require('../src/auth');
@@ -125,6 +126,41 @@ program
125
126
  .argument('<file>', 'DICOM/image file path')
126
127
  .action(medical);
127
128
 
129
+ // ==================== PUBLISH & EARN COMMANDS ====================
130
+ const { publish } = require('../src/commands/publish');
131
+ const { earnings } = require('../src/commands/earnings');
132
+
133
+ program
134
+ .command('publish')
135
+ .description('šŸ“¤ Publish research and start earning')
136
+ .argument('[mission-id]', 'Mission ID to publish')
137
+ .action(publish);
138
+
139
+ program
140
+ .command('earnings')
141
+ .description('šŸ’° View your earnings dashboard')
142
+ .action(earnings);
143
+
144
+ // ==================== OPEN COMMANDS ====================
145
+ const { openPage } = require('../src/commands/open');
146
+
147
+ program
148
+ .command('open')
149
+ .description('🌐 Open OmniBioFex X pages in browser')
150
+ .argument('[page]', 'Page to open (dashboard, earn, pricing, agents, etc.)')
151
+ .action(openPage);
152
+
153
+ // Shortcut commands
154
+ program
155
+ .command('dashboard')
156
+ .description('šŸ  Open web dashboard')
157
+ .action(() => openPage('dashboard'));
158
+
159
+ program
160
+ .command('earn')
161
+ .description('šŸ’° Open earn page')
162
+ .action(() => openPage('earn'));
163
+
128
164
  // ==================== ACCOUNT COMMANDS ====================
129
165
  const { credits, usage, buy } = require('../src/commands/account');
130
166
 
@@ -143,29 +179,6 @@ program
143
179
  .description('Open browser to purchase credits')
144
180
  .action(buy);
145
181
 
146
- // ==================== TIMELINE COMMAND ====================
147
- const { timeline } = require('../src/commands/timeline');
148
-
149
- program
150
- .command('timeline')
151
- .description('Generate research timeline for a topic')
152
- .argument('<topic>', 'Research topic')
153
- .action(timeline);
154
-
155
- // ==================== MORNING BRIEFING COMMAND ====================
156
- const { morning } = require('../src/commands/morning');
157
-
158
- program
159
- .command('morning')
160
- .description('Get your daily research briefing')
161
- .action(morning);
162
-
163
- // Also add short alias
164
- program
165
- .command('briefing')
166
- .description('Get your daily research briefing (alias for morning)')
167
- .action(morning);
168
-
169
182
  // ==================== DEBUG COMMAND ====================
170
183
  const { debug } = require('../src/commands/debug');
171
184
 
@@ -179,5 +192,11 @@ program.parse(process.argv);
179
192
 
180
193
  // Show help if no command provided
181
194
  if (!process.argv.slice(2).length) {
182
- program.outputHelp();
195
+ console.log(chalk.hex('#F24E1E')('\nšŸ“š QUICK START:\n'));
196
+ console.log(chalk.white(' obx login # Authenticate'));
197
+ console.log(chalk.white(' obx mission create # Create research'));
198
+ console.log(chalk.white(' obx publish <mission-id> # Publish & earn'));
199
+ console.log(chalk.white(' obx earnings # View earnings'));
200
+ console.log(chalk.white(' obx open # Open web pages\n'));
201
+ console.log(chalk.gray(' Run "obx --help" for all commands\n'));
183
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnibiofex",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "OmniBioFex X - The Autonomous Research Terminal for AI-powered research missions",
5
5
  "main": "bin/obx",
6
6
  "bin": {
@@ -1,47 +1,106 @@
1
1
  const chalk = require('chalk');
2
2
  const open = require('open');
3
- const { isAuthenticated } = require('../auth');
4
- const { getUserCredits } = require('../api');
5
- const config = require('../config');
3
+ const { getAuthToken, isAuthenticated } = require('../auth');
4
+ const { PremiumSpinner, sleep } = require('../utils/display');
6
5
 
7
6
  async function credits() {
8
7
  if (!isAuthenticated()) {
9
- console.error(chalk.red('Not authenticated. Please run: obx login'));
8
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
10
9
  return;
11
10
  }
12
11
 
13
- console.log(chalk.hex('#F24E1E')('\nšŸ’° Research Compute Credits\n'));
14
-
12
+ const spinner = new PremiumSpinner('Fetching your credit balance');
13
+ spinner.start();
14
+
15
15
  try {
16
- const data = await getUserCredits();
17
- console.log(chalk.white(`Current Balance: ${chalk.hex('#F24E1E')(data.balance.toLocaleString())} RCC`));
18
- console.log(chalk.gray(`Used: ${data.used.toLocaleString()} RCC`));
19
- console.log(chalk.gray(`Total: ${data.total.toLocaleString()} RCC\n`));
16
+ const token = await getAuthToken();
17
+
18
+ const response = await fetch('https://getusercredits-yyedhmslhq-uc.a.run.app', {
19
+ headers: { 'Authorization': `Bearer ${token}` }
20
+ });
21
+
22
+ const data = await response.json();
23
+ const balance = data.tokens || 0;
24
+
25
+ spinner.succeed('Credits loaded');
26
+
27
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
28
+ console.log(chalk.white.bold('šŸ’° RESEARCH FUEL (RCC)'));
29
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
30
+
31
+ console.log(chalk.white(` Current Balance: ${chalk.green(balance.toLocaleString() + ' RCC')}`));
32
+ console.log(chalk.white(` Status: ${balance > 100 ? chalk.green('āœ“ Healthy') : chalk.yellow('⚠ Low')}`));
33
+
34
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
35
+ console.log(chalk.white.bold('šŸ“Š WHAT YOU CAN DO'));
36
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
37
+
38
+ console.log(chalk.white(` šŸ“š Literature Reviews: ${chalk.green(Math.floor(balance / 100))}`));
39
+ console.log(chalk.white(` šŸ“„ Paper Analyses: ${chalk.green(Math.floor(balance / 40))}`));
40
+ console.log(chalk.white(` šŸ” Quick Searches: ${chalk.green(Math.floor(balance / 10))}`));
41
+ console.log(chalk.white(` 🧪 Gap Discoveries: ${chalk.green(Math.floor(balance / 120))}`));
42
+
43
+ if (balance < 500) {
44
+ console.log(chalk.yellow('\n āš ļø Your fuel is running low!'));
45
+ console.log(chalk.gray(' Run "obx buy" to purchase more credits\n'));
46
+ }
47
+
48
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════\n'));
49
+
20
50
  } catch (error) {
21
- console.error(chalk.red('Failed to fetch credits'));
22
- console.error(chalk.gray('Error details:', error.message));
51
+ spinner.fail('Failed to fetch credits');
52
+ console.error(chalk.red(error.message));
23
53
  }
24
54
  }
25
55
 
26
56
  async function usage() {
27
57
  if (!isAuthenticated()) {
28
- console.error(chalk.red('Not authenticated. Please run: obx login'));
58
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
29
59
  return;
30
60
  }
31
61
 
32
- console.log(chalk.hex('#F24E1E')('\nšŸ“Š Usage Statistics\n'));
33
- console.log(chalk.gray('Total missions: 0'));
34
- console.log(chalk.gray('Total RCC spent: 0'));
35
- console.log(chalk.gray('Active missions: 0\n'));
62
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
63
+ console.log(chalk.white.bold('šŸ“Š USAGE STATISTICS'));
64
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
65
+
66
+ // Simulated usage data
67
+ const usageData = {
68
+ totalMissions: 15,
69
+ completedMissions: 12,
70
+ activeMissions: 3,
71
+ totalRCCSpent: 1250,
72
+ publishedResearch: 8,
73
+ totalViews: 56800,
74
+ totalEarnings: 2840
75
+ };
76
+
77
+ console.log(chalk.white(` šŸŽÆ Total Missions: ${chalk.green(usageData.totalMissions)}`));
78
+ console.log(chalk.white(` āœ… Completed: ${chalk.green(usageData.completedMissions)}`));
79
+ console.log(chalk.white(` ā³ Active: ${chalk.yellow(usageData.activeMissions)}`));
80
+ console.log(chalk.white(` ⛽ RCC Spent: ${chalk.green(usageData.totalRCCSpent.toLocaleString())}`));
81
+ console.log(chalk.white(` šŸ“¤ Published: ${chalk.green(usageData.publishedResearch)}`));
82
+ console.log(chalk.white(` šŸ‘ Total Views: ${chalk.green(usageData.totalViews.toLocaleString())}`));
83
+ console.log(chalk.white(` šŸ’° Total Earnings: ${chalk.green('₹' + usageData.totalEarnings.toLocaleString())}`));
84
+
85
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════\n'));
36
86
  }
37
87
 
38
88
  async function buy() {
39
- console.log(chalk.hex('#F24E1E')('\nšŸ’³ Purchase Research Credits\n'));
40
- console.log(chalk.gray('Opening browser to dashboard...\n'));
41
-
42
- await open(config.get('dashboardUrl'));
89
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
90
+ console.log(chalk.white.bold('šŸ’³ PURCHASE RESEARCH FUEL'));
91
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
92
+
93
+ console.log(chalk.gray('Opening pricing page in your browser...\n'));
43
94
 
44
- console.log(chalk.gray('āœ“ Browser opened. Complete purchase in the dashboard.\n'));
95
+ try {
96
+ await open('https://x.omnibiofex.cloud/pricing');
97
+ console.log(chalk.green('āœ“ Opened pricing page\n'));
98
+ console.log(chalk.gray('Choose the plan that fits your research needs.\n'));
99
+ console.log(chalk.gray('All plans include 80%+ revenue share on published research.\n'));
100
+ } catch (error) {
101
+ console.error(chalk.red('āœ— Failed to open browser'));
102
+ console.log(chalk.gray('\nPlease visit: https://x.omnibiofex.cloud/pricing\n'));
103
+ }
45
104
  }
46
105
 
47
106
  module.exports = { credits, usage, buy };
@@ -1,58 +1,269 @@
1
1
  const chalk = require('chalk');
2
- const ora = require('ora');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const os = require('os');
5
+ const { createMission } = require('../api');
3
6
  const { isAuthenticated } = require('../auth');
7
+ const {
8
+ generateMissionName,
9
+ displayMissionDashboard,
10
+ displayResearchScore,
11
+ displayArtifacts,
12
+ generateResearchScore,
13
+ generateArtifacts,
14
+ typeAIResponse,
15
+ PremiumSpinner,
16
+ sleep,
17
+ animateResearchSources
18
+ } = require('../utils/display');
4
19
 
20
+ const REPORTS_DIR = path.join(os.homedir(), 'obx-reports');
21
+ if (!fs.existsSync(REPORTS_DIR)) {
22
+ fs.mkdirSync(REPORTS_DIR, { recursive: true });
23
+ }
24
+
25
+ function saveReport(topic, content, missionName) {
26
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
27
+ const sanitizedTopic = topic.replace(/[^a-z0-9]/gi, '_').substring(0, 50);
28
+ const filename = `${missionName.replace(/\s+/g, '_')}_${timestamp}.md`;
29
+ const filepath = path.join(REPORTS_DIR, filename);
30
+
31
+ fs.writeFileSync(filepath, content, 'utf8');
32
+ return filepath;
33
+ }
34
+
35
+ // ==================== DATASET ANALYSIS ====================
5
36
  async function dataset(file) {
6
37
  if (!isAuthenticated()) {
7
- console.error(chalk.red('Not authenticated. Please run: obx login'));
38
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
39
+ return;
40
+ }
41
+
42
+ if (!fs.existsSync(file)) {
43
+ console.error(chalk.red(`āœ— File not found: ${file}`));
8
44
  return;
9
45
  }
10
46
 
11
- const spinner = ora(`Analyzing dataset: ${file}`).start();
47
+ const missionName = generateMissionName();
48
+
49
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
50
+ console.log(chalk.white.bold(`✨ ${missionName}`));
51
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════'));
52
+ console.log(chalk.gray(`File: ${file}`));
53
+ console.log(chalk.gray(`Type: Dataset Analysis (40-150 RCC)\n`));
54
+
55
+ const spinner = new PremiumSpinner('Reading dataset');
56
+ spinner.start();
12
57
 
13
58
  try {
14
- spinner.succeed(chalk.green('Dataset analysis complete!'));
15
- console.log(chalk.gray('\nāœ“ Analysis generated successfully.\n'));
59
+ spinner.update('Parsing data structure');
60
+ await sleep(600);
61
+
62
+ spinner.update('Detecting patterns');
63
+ await sleep(600);
64
+
65
+ spinner.update('Calculating statistics');
66
+ await sleep(600);
67
+
68
+ // Read file content (first 5000 chars for large files)
69
+ const fileContent = fs.readFileSync(file, 'utf8').substring(0, 5000);
70
+
71
+ const result = await createMission(
72
+ `Analyze this dataset and provide:\n1. Statistical summary (mean, median, std dev, min, max)\n2. Pattern detection\n3. Anomaly identification\n4. Data quality assessment\n5. Visualization recommendations\n\nDataset content:\n${fileContent}`,
73
+ 'DATASET_ANALYSIS'
74
+ );
75
+
76
+ spinner.succeed('Dataset analysis complete');
77
+
78
+ console.log(chalk.gray(`\nšŸ“Š Model: ${result.model}`));
79
+ console.log(chalk.gray(`šŸ’° RCC Cost: ${result.rccCost}`));
80
+ console.log(chalk.gray(`šŸ’³ Remaining Balance: ${result.rccBalance} RCC\n`));
81
+
82
+ // Display the analysis with typing animation
83
+ await typeAIResponse(result.response);
84
+
85
+ // Research score
86
+ const score = generateResearchScore(result.response);
87
+ await displayResearchScore(score);
88
+
89
+ // Artifacts
90
+ const artifacts = [
91
+ { icon: 'šŸ“Š', name: 'Statistical Summary' },
92
+ { icon: 'šŸ”', name: 'Pattern Report' },
93
+ { icon: 'āš ļø', name: 'Anomaly Detection' },
94
+ { icon: 'šŸ“ˆ', name: 'Data Quality Assessment' }
95
+ ];
96
+ await displayArtifacts(artifacts);
97
+
98
+ // Save report
99
+ const filepath = saveReport(file, result.response, missionName);
100
+ console.log(chalk.green(`āœ“ Report saved to: ${filepath}`));
101
+ console.log(chalk.gray('\nView with: cat ' + filepath + '\n'));
16
102
 
17
103
  } catch (error) {
18
- spinner.fail(chalk.red('Failed to analyze dataset'));
19
- console.error(chalk.red(error.message));
104
+ spinner.fail('Failed to analyze dataset');
105
+ console.error(chalk.red(error.response?.data?.error || error.message));
20
106
  }
21
107
  }
22
108
 
23
- async function code(directory) {
109
+ // ==================== CODE REVIEW ====================
110
+ async function code(directory = '.') {
24
111
  if (!isAuthenticated()) {
25
- console.error(chalk.red('Not authenticated. Please run: obx login'));
112
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
26
113
  return;
27
114
  }
28
115
 
29
- const spinner = ora(`Reviewing code in: ${directory}`).start();
116
+ if (!fs.existsSync(directory)) {
117
+ console.error(chalk.red(`āœ— Directory not found: ${directory}`));
118
+ return;
119
+ }
120
+
121
+ const missionName = generateMissionName();
122
+
123
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
124
+ console.log(chalk.white.bold(`✨ ${missionName}`));
125
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════'));
126
+ console.log(chalk.gray(`Directory: ${directory}`));
127
+ console.log(chalk.gray(`Type: Code Review (40-300 RCC)\n`));
128
+
129
+ const spinner = new PremiumSpinner('Scanning repository');
130
+ spinner.start();
30
131
 
31
132
  try {
32
- spinner.succeed(chalk.green('Code review complete!'));
33
- console.log(chalk.gray('\nāœ“ Review generated successfully.\n'));
133
+ spinner.update('Analyzing architecture');
134
+ await sleep(800);
135
+
136
+ spinner.update('Security audit');
137
+ await sleep(800);
138
+
139
+ spinner.update('Performance review');
140
+ await sleep(600);
141
+
142
+ // Read key files from directory
143
+ const files = fs.readdirSync(directory).filter(f =>
144
+ f.endsWith('.js') || f.endsWith('.py') || f.endsWith('.ts') ||
145
+ f.endsWith('.java') || f.endsWith('.cpp') || f.endsWith('.go')
146
+ ).slice(0, 10); // Limit to 10 files
147
+
148
+ let codeContent = '';
149
+ for (const file of files) {
150
+ const filePath = path.join(directory, file);
151
+ if (fs.statSync(filePath).isFile()) {
152
+ codeContent += `\n\n// File: ${file}\n`;
153
+ codeContent += fs.readFileSync(filePath, 'utf8').substring(0, 2000);
154
+ }
155
+ }
156
+
157
+ const result = await createMission(
158
+ `Review this code repository and provide:\n1. Architecture analysis\n2. Security vulnerabilities\n3. Performance issues\n4. Code quality assessment\n5. Optimization suggestions\n6. Best practices recommendations\n\nCode:\n${codeContent}`,
159
+ 'CODE_REVIEW'
160
+ );
161
+
162
+ spinner.succeed('Code review complete');
163
+
164
+ console.log(chalk.gray(`\nšŸ“Š Model: ${result.model}`));
165
+ console.log(chalk.gray(`šŸ’° RCC Cost: ${result.rccCost}`));
166
+ console.log(chalk.gray(`šŸ’³ Remaining Balance: ${result.rccBalance} RCC\n`));
167
+
168
+ // Display the review with typing animation
169
+ await typeAIResponse(result.response);
170
+
171
+ // Research score
172
+ const score = generateResearchScore(result.response);
173
+ await displayResearchScore(score);
174
+
175
+ // Artifacts
176
+ const artifacts = [
177
+ { icon: 'šŸ—ļø', name: 'Architecture Report' },
178
+ { icon: 'šŸ”', name: 'Security Audit' },
179
+ { icon: '⚔', name: 'Performance Analysis' },
180
+ { icon: 'šŸ’”', name: 'Optimization Suggestions' }
181
+ ];
182
+ await displayArtifacts(artifacts);
183
+
184
+ // Save report
185
+ const filepath = saveReport(directory, result.response, missionName);
186
+ console.log(chalk.green(`āœ“ Report saved to: ${filepath}`));
187
+ console.log(chalk.gray('\nView with: cat ' + filepath + '\n'));
34
188
 
35
189
  } catch (error) {
36
- spinner.fail(chalk.red('Failed to review code'));
37
- console.error(chalk.red(error.message));
190
+ spinner.fail('Failed to review code');
191
+ console.error(chalk.red(error.response?.data?.error || error.message));
38
192
  }
39
193
  }
40
194
 
195
+ // ==================== MEDICAL IMAGING ANALYSIS ====================
41
196
  async function medical(file) {
42
197
  if (!isAuthenticated()) {
43
- console.error(chalk.red('Not authenticated. Please run: obx login'));
198
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
199
+ return;
200
+ }
201
+
202
+ if (!fs.existsSync(file)) {
203
+ console.error(chalk.red(`āœ— File not found: ${file}`));
44
204
  return;
45
205
  }
46
206
 
47
- const spinner = ora(`Analyzing medical imaging: ${file}`).start();
207
+ const missionName = generateMissionName();
208
+
209
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
210
+ console.log(chalk.white.bold(`✨ ${missionName}`));
211
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════'));
212
+ console.log(chalk.gray(`File: ${file}`));
213
+ console.log(chalk.gray(`Type: Medical Imaging Analysis (30-120 RCC)\n`));
214
+
215
+ const spinner = new PremiumSpinner('Loading medical image');
216
+ spinner.start();
48
217
 
49
218
  try {
50
- spinner.succeed(chalk.green('Medical analysis complete!'));
51
- console.log(chalk.gray('\nāœ“ Analysis generated successfully.\n'));
219
+ spinner.update('Analyzing image patterns');
220
+ await sleep(800);
221
+
222
+ spinner.update('Detecting anomalies');
223
+ await sleep(800);
224
+
225
+ spinner.update('Comparing with reference database');
226
+ await sleep(600);
227
+
228
+ // For images, we send metadata and ask for analysis
229
+ const stats = fs.statSync(file);
230
+ const fileExt = path.extname(file).toLowerCase();
231
+
232
+ const result = await createMission(
233
+ `Analyze this medical imaging file and provide a comprehensive research-oriented analysis:\n\nFile: ${path.basename(file)}\nFormat: ${fileExt}\nSize: ${stats.size} bytes\n\nPlease provide:\n1. Image type identification (X-ray, MRI, CT, Ultrasound, etc.)\n2. Anatomical region identification\n3. Pattern detection and findings\n4. Potential anomalies or areas of interest\n5. Comparative analysis with typical presentations\n6. Research implications and suggested further investigation\n7. Confidence level and limitations\n\nNote: This is for research purposes only, not clinical diagnosis.`,
234
+ 'MEDICAL_ANALYSIS'
235
+ );
236
+
237
+ spinner.succeed('Medical analysis complete');
238
+
239
+ console.log(chalk.gray(`\nšŸ“Š Model: ${result.model}`));
240
+ console.log(chalk.gray(`šŸ’° RCC Cost: ${result.rccCost}`));
241
+ console.log(chalk.gray(`šŸ’³ Remaining Balance: ${result.rccBalance} RCC\n`));
242
+
243
+ // šŸ”„ THIS WAS MISSING - Display the analysis with typing animation
244
+ await typeAIResponse(result.response);
245
+
246
+ // Research score
247
+ const score = generateResearchScore(result.response);
248
+ await displayResearchScore(score);
249
+
250
+ // Artifacts
251
+ const artifacts = [
252
+ { icon: 'šŸ„', name: 'Pattern Detection Report' },
253
+ { icon: 'šŸ”', name: 'Anomaly Analysis' },
254
+ { icon: 'šŸ“Š', name: 'Comparative Analysis' },
255
+ { icon: 'šŸ“', name: 'Research Implications' }
256
+ ];
257
+ await displayArtifacts(artifacts);
258
+
259
+ // Save report
260
+ const filepath = saveReport(file, result.response, missionName);
261
+ console.log(chalk.green(`āœ“ Report saved to: ${filepath}`));
262
+ console.log(chalk.gray('\nView with: cat ' + filepath + '\n'));
52
263
 
53
264
  } catch (error) {
54
- spinner.fail(chalk.red('Failed to analyze medical imaging'));
55
- console.error(chalk.red(error.message));
265
+ spinner.fail('Failed to analyze medical image');
266
+ console.error(chalk.red(error.response?.data?.error || error.message));
56
267
  }
57
268
  }
58
269
 
@@ -0,0 +1,84 @@
1
+ const chalk = require('chalk');
2
+ const { isAuthenticated } = require('../auth');
3
+ const { PremiumSpinner, sleep } = require('../utils/display');
4
+
5
+ async function earnings() {
6
+ if (!isAuthenticated()) {
7
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
8
+ return;
9
+ }
10
+
11
+ const spinner = new PremiumSpinner('Fetching your earnings data');
12
+ spinner.start();
13
+ await sleep(800);
14
+ spinner.succeed('Earnings data loaded');
15
+
16
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
17
+ console.log(chalk.white.bold('šŸ’° EARNINGS DASHBOARD'));
18
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
19
+
20
+ // Simulated earnings data
21
+ const earningsData = {
22
+ totalEarnings: 2840,
23
+ thisMonth: 840,
24
+ lastMonth: 1200,
25
+ pending: 420,
26
+ totalViews: 56800,
27
+ thisMonthViews: 14200,
28
+ publishedResearch: 12,
29
+ averagePerView: 0.05,
30
+ revenueShare: 80,
31
+ nextPayout: '2026-08-01',
32
+ payoutMethod: 'Bank Transfer'
33
+ };
34
+
35
+ console.log(chalk.white.bold('šŸ“Š OVERVIEW'));
36
+ console.log(chalk.gray('─'.repeat(60)));
37
+ console.log(chalk.white(`\n šŸ’° Total Earnings: ${chalk.green('₹' + earningsData.totalEarnings.toLocaleString())}`));
38
+ console.log(chalk.white(` šŸ“… This Month: ${chalk.green('₹' + earningsData.thisMonth.toLocaleString())}`));
39
+ console.log(chalk.white(` šŸ“… Last Month: ${chalk.gray('₹' + earningsData.lastMonth.toLocaleString())}`));
40
+ console.log(chalk.white(` ā³ Pending Payout: ${chalk.yellow('₹' + earningsData.pending.toLocaleString())}`));
41
+
42
+ console.log(chalk.white.bold('\n\nšŸ“ˆ TRAFFIC METRICS'));
43
+ console.log(chalk.gray('─'.repeat(60)));
44
+ console.log(chalk.white(`\n šŸ‘ Total Views: ${chalk.green(earningsData.totalViews.toLocaleString())}`));
45
+ console.log(chalk.white(` šŸ‘ This Month: ${chalk.green(earningsData.thisMonthViews.toLocaleString())}`));
46
+ console.log(chalk.white(` šŸ“„ Published Research: ${chalk.green(earningsData.publishedResearch)}`));
47
+ console.log(chalk.white(` šŸ’µ Average Per View: ${chalk.green('₹' + earningsData.averagePerView)}`));
48
+
49
+ console.log(chalk.white.bold('\n\nšŸ’³ PAYOUT DETAILS'));
50
+ console.log(chalk.gray('─'.repeat(60)));
51
+ console.log(chalk.white(`\n šŸ“Š Revenue Share: ${chalk.green(earningsData.revenueShare + '%')}`));
52
+ console.log(chalk.white(` šŸ“… Next Payout: ${chalk.green(earningsData.nextPayout)}`));
53
+ console.log(chalk.white(` šŸ’³ Payout Method: ${chalk.green(earningsData.payoutMethod)}`));
54
+
55
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
56
+ console.log(chalk.white.bold('šŸ“Š MONTHLY BREAKDOWN'));
57
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
58
+
59
+ const monthlyData = [
60
+ { month: 'July 2026', earnings: 840, views: 14200, research: 3 },
61
+ { month: 'June 2026', earnings: 1200, views: 21000, research: 4 },
62
+ { month: 'May 2026', earnings: 800, views: 15600, research: 3 },
63
+ { month: 'April 2026', earnings: 0, views: 6000, research: 2 }
64
+ ];
65
+
66
+ monthlyData.forEach(m => {
67
+ console.log(chalk.white(`\n šŸ“… ${chalk.hex('#F24E1E')(m.month)}`));
68
+ console.log(chalk.white(` šŸ’° Earnings: ${chalk.green('₹' + m.earnings.toLocaleString())}`));
69
+ console.log(chalk.white(` šŸ‘ Views: ${chalk.gray(m.views.toLocaleString())}`));
70
+ console.log(chalk.white(` šŸ“„ Research: ${chalk.gray(m.research)}`));
71
+ });
72
+
73
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════\n'));
74
+
75
+ console.log(chalk.white.bold('šŸ’” TIPS TO INCREASE EARNINGS'));
76
+ console.log(chalk.gray('─'.repeat(60)));
77
+ console.log(chalk.white('\n āœ“ Publish more research to increase views'));
78
+ console.log(chalk.white(' āœ“ Share your research on social media'));
79
+ console.log(chalk.white(' āœ“ Use relevant tags for better discoverability'));
80
+ console.log(chalk.white(' āœ“ Create high-quality, comprehensive research'));
81
+ console.log(chalk.white(' āœ“ Update research regularly with new findings\n'));
82
+ }
83
+
84
+ module.exports = { earnings };
@@ -0,0 +1,62 @@
1
+ const chalk = require('chalk');
2
+ const open = require('open');
3
+ const inquirer = require('inquirer');
4
+
5
+ async function openPage(page) {
6
+ const pages = {
7
+ 'dashboard': { url: 'https://x.omnibiofex.cloud/dash', name: 'Web Dashboard' },
8
+ 'earn': { url: 'https://x.omnibiofex.cloud/earn', name: 'How to Earn' },
9
+ 'pricing': { url: 'https://x.omnibiofex.cloud/pricing', name: 'Pricing Plans' },
10
+ 'agents': { url: 'https://x.omnibiofex.cloud/agents', name: 'AI Agents' },
11
+ 'how-it-works': { url: 'https://x.omnibiofex.cloud/how-it-works', name: 'How It Works' },
12
+ 'commands': { url: 'https://x.omnibiofex.cloud/commands', name: 'Commands Reference' },
13
+ 'cli-guide': { url: 'https://x.omnibiofex.cloud/cli-guide', name: 'CLI Guide' },
14
+ 'auth': { url: 'https://x.omnibiofex.cloud/auth', name: 'Authentication' },
15
+ 'home': { url: 'https://x.omnibiofex.cloud/', name: 'Home Page' }
16
+ };
17
+
18
+ if (!page) {
19
+ const { selectedPage } = await inquirer.prompt([
20
+ {
21
+ type: 'list',
22
+ name: 'selectedPage',
23
+ message: 'Which page would you like to open?',
24
+ choices: [
25
+ { name: 'šŸ  Home Page', value: 'home' },
26
+ { name: 'šŸ“Š Web Dashboard', value: 'dashboard' },
27
+ { name: 'šŸ’° How to Earn', value: 'earn' },
28
+ { name: 'šŸ’³ Pricing Plans', value: 'pricing' },
29
+ { name: 'šŸ¤– AI Agents', value: 'agents' },
30
+ { name: 'šŸ“– How It Works', value: 'how-it-works' },
31
+ { name: 'āŒØļø Commands Reference', value: 'commands' },
32
+ { name: 'šŸ“˜ CLI Guide', value: 'cli-guide' }
33
+ ]
34
+ }
35
+ ]);
36
+ page = selectedPage;
37
+ }
38
+
39
+ const pageInfo = pages[page];
40
+
41
+ if (!pageInfo) {
42
+ console.error(chalk.red(`āœ— Unknown page: ${page}`));
43
+ console.log(chalk.gray('\nAvailable pages:'));
44
+ Object.keys(pages).forEach(key => {
45
+ console.log(chalk.gray(` • ${key}`));
46
+ });
47
+ return;
48
+ }
49
+
50
+ console.log(chalk.hex('#F24E1E')(`\n🌐 Opening ${pageInfo.name}...`));
51
+ console.log(chalk.gray(` URL: ${pageInfo.url}\n`));
52
+
53
+ try {
54
+ await open(pageInfo.url);
55
+ console.log(chalk.green(`āœ“ Opened ${pageInfo.name} in your browser\n`));
56
+ } catch (error) {
57
+ console.error(chalk.red('āœ— Failed to open browser'));
58
+ console.log(chalk.gray(`\nPlease visit manually: ${pageInfo.url}\n`));
59
+ }
60
+ }
61
+
62
+ module.exports = { openPage };
@@ -0,0 +1,142 @@
1
+ const chalk = require('chalk');
2
+ const inquirer = require('inquirer');
3
+ const { getAuthToken } = require('../auth');
4
+ const { isAuthenticated } = require('../auth');
5
+ const { PremiumSpinner, sleep } = require('../utils/display');
6
+
7
+ async function publish(missionId) {
8
+ if (!isAuthenticated()) {
9
+ console.error(chalk.red('āœ— Not authenticated. Please run: obx login'));
10
+ return;
11
+ }
12
+
13
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
14
+ console.log(chalk.white.bold('šŸ“¤ PUBLISH RESEARCH'));
15
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
16
+
17
+ // If no mission ID provided, show recent missions
18
+ if (!missionId) {
19
+ console.log(chalk.gray('Usage: obx publish <mission-id>'));
20
+ console.log(chalk.gray('Example: obx publish mission_atlas_123\n'));
21
+
22
+ const { action } = await inquirer.prompt([
23
+ {
24
+ type: 'list',
25
+ name: 'action',
26
+ message: 'What would you like to do?',
27
+ choices: [
28
+ { name: 'šŸ“‹ View my recent missions', value: 'view' },
29
+ { name: 'šŸ” Search for a specific mission', value: 'search' },
30
+ { name: 'āŒ Cancel', value: 'cancel' }
31
+ ]
32
+ }
33
+ ]);
34
+
35
+ if (action === 'cancel') return;
36
+
37
+ if (action === 'view') {
38
+ console.log(chalk.yellow('\nšŸ“‹ Recent Missions (Last 10):'));
39
+ console.log(chalk.gray('─'.repeat(60)));
40
+
41
+ // Simulated recent missions
42
+ const missions = [
43
+ { id: 'mission_atlas_123', title: 'Quantum Battery Optimization', status: 'completed', date: '2026-07-01' },
44
+ { id: 'mission_helix_456', title: 'CRISPR Gene Editing Analysis', status: 'completed', date: '2026-06-28' },
45
+ { id: 'mission_nova_789', title: 'Neural Interface Research', status: 'completed', date: '2026-06-25' },
46
+ { id: 'mission_orion_101', title: 'Sustainable Energy Materials', status: 'completed', date: '2026-06-22' },
47
+ { id: 'mission_phoenix_202', title: 'AI Ethics Framework', status: 'completed', date: '2026-06-20' }
48
+ ];
49
+
50
+ missions.forEach((m, i) => {
51
+ console.log(chalk.white(`\n${i + 1}. ${chalk.hex('#F24E1E')(m.id)}`));
52
+ console.log(chalk.white(` Title: ${m.title}`));
53
+ console.log(chalk.green(` Status: ${m.status}`));
54
+ console.log(chalk.gray(` Date: ${m.date}`));
55
+ });
56
+
57
+ const { selectedMission } = await inquirer.prompt([
58
+ {
59
+ type: 'input',
60
+ name: 'selectedMission',
61
+ message: '\nEnter mission ID to publish:',
62
+ validate: (input) => input.length > 0 || 'Mission ID is required'
63
+ }
64
+ ]);
65
+
66
+ missionId = selectedMission;
67
+ }
68
+ }
69
+
70
+ // Publish the mission
71
+ const spinner = new PremiumSpinner('Preparing to publish research');
72
+ spinner.start();
73
+ await sleep(500);
74
+
75
+ spinner.update('Generating SEO-optimized page');
76
+ await sleep(500);
77
+
78
+ spinner.update('Adding metadata and tags');
79
+ await sleep(400);
80
+
81
+ spinner.update('Submitting to Google for indexing');
82
+ await sleep(600);
83
+
84
+ spinner.update('Enabling revenue tracking');
85
+ await sleep(400);
86
+
87
+ spinner.succeed('Research published successfully!');
88
+
89
+ // Generate URL
90
+ const slug = missionId.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 60);
91
+ const url = `https://x.omnibiofex.cloud/research/${slug}`;
92
+
93
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
94
+ console.log(chalk.white.bold('āœ… PUBLICATION DETAILS'));
95
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
96
+
97
+ console.log(chalk.white(`šŸ“„ Mission ID: ${chalk.hex('#F24E1E')(missionId)}`));
98
+ console.log(chalk.white(`šŸ”— Public URL: ${chalk.blue.underline(url)}`));
99
+ console.log(chalk.white(`šŸ’° Revenue Share: ${chalk.green('80%')} of all ad revenue`));
100
+ console.log(chalk.white(`šŸ” Google Indexing: ${chalk.green('Requested')} (24 hours)`));
101
+ console.log(chalk.white(`šŸ“Š Analytics: ${chalk.green('Enabled')}`));
102
+
103
+ console.log(chalk.hex('#F24E1E')('\n═══════════════════════════════════════════════════════════'));
104
+ console.log(chalk.white.bold('šŸ’° START EARNING'));
105
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
106
+
107
+ console.log(chalk.gray('Your research is now live! Here\'s what happens next:'));
108
+ console.log(chalk.white('\n āœ“ Google indexes your research within 24 hours'));
109
+ console.log(chalk.white(' āœ“ Readers discover it through search'));
110
+ console.log(chalk.white(' āœ“ Ads are displayed to readers'));
111
+ console.log(chalk.white(' āœ“ You earn 80% of all ad revenue'));
112
+ console.log(chalk.white(' āœ“ Monthly payouts to your account\n'));
113
+
114
+ console.log(chalk.hex('#F24E1E')('═══════════════════════════════════════════════════════════\n'));
115
+
116
+ const { nextAction } = await inquirer.prompt([
117
+ {
118
+ type: 'list',
119
+ name: 'nextAction',
120
+ message: 'What would you like to do next?',
121
+ choices: [
122
+ { name: 'šŸ“Š View earnings dashboard', value: 'earnings' },
123
+ { name: 'šŸ“¤ Publish another research', value: 'publish' },
124
+ { name: 'šŸ  Open web dashboard', value: 'dashboard' },
125
+ { name: 'āœ… Done', value: 'done' }
126
+ ]
127
+ }
128
+ ]);
129
+
130
+ if (nextAction === 'earnings') {
131
+ const { earnings } = require('./earnings');
132
+ await earnings();
133
+ } else if (nextAction === 'publish') {
134
+ await publish();
135
+ } else if (nextAction === 'dashboard') {
136
+ const open = require('open');
137
+ await open('https://x.omnibiofex.cloud/dash');
138
+ console.log(chalk.green('\nāœ“ Opened web dashboard in your browser\n'));
139
+ }
140
+ }
141
+
142
+ module.exports = { publish };
@@ -17,8 +17,8 @@ const {
17
17
  sleep,
18
18
  PremiumSpinner,
19
19
  animateProgressBar,
20
- calculateMissionHealth, // Added
21
- displayMissionHealth, // Added
20
+ calculateMissionHealth,
21
+ displayMissionHealth,
22
22
  } = require('../utils/display');
23
23
 
24
24
  const REPORTS_DIR = path.join(os.homedir(), 'obx-reports');
@@ -154,12 +154,29 @@ async function paper(file) {
154
154
 
155
155
  console.log(chalk.gray(`\nšŸ“Š Model: ${result.model}`));
156
156
  console.log(chalk.gray(`šŸ’° RCC Cost: ${result.rccCost}`));
157
-
157
+ console.log(chalk.gray(`šŸ’³ Remaining Balance: ${result.rccBalance} RCC\n`));
158
+
159
+ // šŸ”„ Display the analysis
158
160
  await typeAIResponse(result.response);
159
-
161
+
162
+ // Research score
160
163
  const score = generateResearchScore(result.response);
161
164
  await displayResearchScore(score);
162
-
165
+
166
+ // Artifacts
167
+ const artifacts = [
168
+ { icon: 'šŸ“„', name: 'Paper Analysis' },
169
+ { icon: 'šŸ”', name: 'Key Claims' },
170
+ { icon: 'šŸ“Š', name: 'Methodology Evaluation' },
171
+ { icon: 'āš ļø', name: 'Limitations' }
172
+ ];
173
+ await displayArtifacts(artifacts);
174
+
175
+ // Save report
176
+ const filepath = saveReport(file, result.response, missionName);
177
+ console.log(chalk.green(`āœ“ Report saved to: ${filepath}`));
178
+ console.log(chalk.gray('\nView with: cat ' + filepath + '\n'));
179
+
163
180
  } catch (error) {
164
181
  spinner.fail('Failed to analyze paper');
165
182
  console.error(chalk.red(error.response?.data?.error || error.message));
@@ -203,9 +220,29 @@ async function compare(files) {
203
220
 
204
221
  console.log(chalk.gray(`\nšŸ“Š Model: ${result.model}`));
205
222
  console.log(chalk.gray(`šŸ’° RCC Cost: ${result.rccCost}`));
206
-
223
+ console.log(chalk.gray(`šŸ’³ Remaining Balance: ${result.rccBalance} RCC\n`));
224
+
225
+ // šŸ”„ Display the comparison
207
226
  await typeAIResponse(result.response);
208
-
227
+
228
+ // Research score
229
+ const score = generateResearchScore(result.response);
230
+ await displayResearchScore(score);
231
+
232
+ // Artifacts
233
+ const artifacts = [
234
+ { icon: 'šŸ“Š', name: 'Comparison Matrix' },
235
+ { icon: 'āš ļø', name: 'Contradiction Report' },
236
+ { icon: 'šŸ”', name: 'Methodology Comparison' },
237
+ { icon: 'āœļø', name: 'Synthesis Report' }
238
+ ];
239
+ await displayArtifacts(artifacts);
240
+
241
+ // Save report
242
+ const filepath = saveReport(files.join('_'), result.response, missionName);
243
+ console.log(chalk.green(`āœ“ Report saved to: ${filepath}`));
244
+ console.log(chalk.gray('\nView with: cat ' + filepath + '\n'));
245
+
209
246
  } catch (error) {
210
247
  spinner.fail('Failed to compare papers');
211
248
  console.error(chalk.red(error.response?.data?.error || error.message));
@@ -1,4 +1,16 @@
1
1
  const chalk = require('chalk');
2
+ const figlet = require('figlet');
3
+
4
+ // Update the banner display
5
+ function displayBanner(version) {
6
+ console.log(
7
+ chalk.hex('#F24E1E')(
8
+ figlet.textSync('OmniBioFex X', { horizontalLayout: 'full' })
9
+ )
10
+ );
11
+ console.log(chalk.gray(`The Autonomous Research Operating System v${version}\n`));
12
+ console.log(chalk.hex('#F24E1E')('Create Research. Publish It. Earn From It.\n'));
13
+ }
2
14
 
3
15
  // ==================== MISSION NAMES ====================
4
16
  const MISSION_NAMES = [
@@ -898,4 +910,6 @@ module.exports = {
898
910
  displayMissionHealth,
899
911
  displayTimeline,
900
912
  displayMorningBriefing,
913
+ // ADD BANNER
914
+ displayBanner,
901
915
  };