50c 3.2.0 → 3.3.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.
Files changed (2) hide show
  1. package/bin/50c.js +107 -2
  2. package/package.json +1 -1
package/bin/50c.js CHANGED
@@ -13,6 +13,25 @@ const path = require('path');
13
13
  const os = require('os');
14
14
  const { spawn } = require('child_process');
15
15
 
16
+ // Early imports for CLI commands that need these
17
+ let call50cTool, subagent, httpFetch, sshExec, localExec, KNOWN_SERVERS;
18
+ let team, matchTaskToTools;
19
+ try {
20
+ const subagentModule = require('../lib/subagent.js');
21
+ call50cTool = subagentModule.call50cTool;
22
+ subagent = subagentModule.subagent;
23
+ httpFetch = subagentModule.httpFetch;
24
+ sshExec = subagentModule.sshExec;
25
+ localExec = subagentModule.localExec;
26
+ KNOWN_SERVERS = subagentModule.KNOWN_SERVERS;
27
+
28
+ const teamModule = require('../lib/team.js');
29
+ team = teamModule.team;
30
+ matchTaskToTools = teamModule.matchTaskToTools;
31
+ } catch (e) {
32
+ // Graceful fallback if libs not available (shouldn't happen in normal install)
33
+ }
34
+
16
35
  const VERSION = require('../package.json').version;
17
36
  const HOME = os.homedir();
18
37
  const HUB_DIR = path.join(HOME, '.50c');
@@ -104,6 +123,7 @@ const TOOL_COMMANDS = {
104
123
  'compute': { tool: 'compute', arg: 'code', cost: '$0.02' },
105
124
  'chat': { tool: 'ide_conversation', special: 'chat' },
106
125
  'refocus': { tool: 'llm_refocus', special: 'refocus' },
126
+ 'invent': { tool: 'auto_invent', special: 'invent', cost: '$2.00' },
107
127
  };
108
128
 
109
129
  // Route command
@@ -501,6 +521,85 @@ async function runToolCommand(cmd, args) {
501
521
  return;
502
522
  }
503
523
 
524
+ // INVENT: Enterprise invention pipeline
525
+ if (spec.special === 'invent') {
526
+ // Parse args: 50c invent "problem" --rigor=deep --domain=math --constraint="must be fast"
527
+ let problem = '';
528
+ let rigor = 'deep';
529
+ let domain = 'code';
530
+ const constraints = [];
531
+
532
+ for (const arg of args) {
533
+ if (arg.startsWith('--rigor=')) {
534
+ rigor = arg.split('=')[1];
535
+ } else if (arg.startsWith('--domain=')) {
536
+ domain = arg.split('=')[1];
537
+ } else if (arg.startsWith('--constraint=')) {
538
+ constraints.push(arg.split('=')[1].replace(/^["']|["']$/g, ''));
539
+ } else if (!arg.startsWith('--')) {
540
+ problem += (problem ? ' ' : '') + arg;
541
+ }
542
+ }
543
+
544
+ if (!problem) {
545
+ console.error('Usage: 50c invent "problem description" [options]');
546
+ console.error('Options:');
547
+ console.error(' --rigor=fast|standard|deep|exhaustive (default: deep)');
548
+ console.error(' --domain=math|physics|code|business (default: code)');
549
+ console.error(' --constraint="constraint text" (can repeat)');
550
+ console.error('');
551
+ console.error('Examples:');
552
+ console.error(' 50c invent "faster sorting algorithm" --rigor=deep');
553
+ console.error(' 50c invent "prove Riemann hypothesis" --domain=math --rigor=exhaustive');
554
+ console.error(' 50c invent "novel auth system" --constraint="must be passwordless"');
555
+ process.exit(1);
556
+ }
557
+
558
+ console.log(`\nšŸ”¬ 50c Auto-Invent Pipeline`);
559
+ console.log(` Problem: ${problem.slice(0, 60)}${problem.length > 60 ? '...' : ''}`);
560
+ console.log(` Rigor: ${rigor} | Domain: ${domain}`);
561
+ if (constraints.length) console.log(` Constraints: ${constraints.length}`);
562
+ console.log(` Cost: $2.00\n`);
563
+
564
+ // Call auto_invent directly (not via remote API - it's local)
565
+ const inventArgs = { problem, rigor, domain, constraints };
566
+ const result = await autoInvent(inventArgs);
567
+
568
+ // Format output
569
+ if (result.ok && result.invention) {
570
+ console.log('═══════════════════════════════════════════════════════════════');
571
+ console.log(' INVENTION RESULT');
572
+ console.log('═══════════════════════════════════════════════════════════════\n');
573
+
574
+ if (result.angles && result.angles.length > 0) {
575
+ console.log('šŸ“ CREATIVE ANGLES:');
576
+ result.angles.slice(0, 5).forEach((a, i) => console.log(` ${i+1}. ${a}`));
577
+ console.log('');
578
+ }
579
+
580
+ if (result.invention.solution) {
581
+ console.log('šŸ’” SOLUTION:');
582
+ console.log(result.invention.solution);
583
+ console.log('');
584
+ }
585
+
586
+ if (result.proofs && result.proofs.length > 0) {
587
+ console.log('āœ“ PROOFS:', result.proofs.length, 'verification(s)');
588
+ }
589
+
590
+ if (result.prior_art && result.prior_art.length > 0) {
591
+ console.log('šŸ“š PRIOR ART:', result.prior_art.length, 'related work(s) found');
592
+ }
593
+
594
+ console.log('\n═══════════════════════════════════════════════════════════════');
595
+ console.log(`ā± Duration: ${(result.total_duration_ms / 1000).toFixed(1)}s | Verified: ${result.verified ? 'āœ“' : 'ā—‹'}`);
596
+ console.log('═══════════════════════════════════════════════════════════════\n');
597
+ } else {
598
+ console.log('Result:', JSON.stringify(result, null, 2));
599
+ }
600
+ return;
601
+ }
602
+
504
603
  // Standard tool
505
604
  const input = args.join(' ');
506
605
  if (!input) {
@@ -645,8 +744,7 @@ async function handleMCPRequest(request) {
645
744
 
646
745
  // Local file-memory tools (FREE, runs on user machine)
647
746
  const { FILE_TOOLS, indexFile, findSymbol, getLines, searchFile, fileSummary } = require('../lib/file-memory.js');
648
- const { subagent, httpFetch, sshExec, localExec, call50cTool, KNOWN_SERVERS } = require('../lib/subagent.js');
649
- const { team, matchTaskToTools } = require('../lib/team.js');
747
+ // Note: subagent, team already imported at top for CLI commands
650
748
 
651
749
  const LOCAL_TOOLS = [
652
750
  // THE MAIN TOOL - Ask the 50c team to do anything
@@ -1451,6 +1549,12 @@ TOOLS (labs pack):
1451
1549
  genius <problem> Deep problem solving ($0.50)
1452
1550
  compute <code> Python sandbox ($0.02)
1453
1551
 
1552
+ ENTERPRISE (auto_invent):
1553
+ invent "problem" [options] Full invention pipeline ($2.00)
1554
+ --rigor=fast|standard|deep|exhaustive (default: deep)
1555
+ --domain=math|physics|code|business (default: code)
1556
+ --constraint="text" Add constraint (repeatable)
1557
+
1454
1558
  TOOLS (beacon pack):
1455
1559
  50c beacon.health Context health check (FREE)
1456
1560
  50c beacon.compress <text> Smart compression ($0.02)
@@ -1470,6 +1574,7 @@ SNAPSHOTS:
1470
1574
  EXAMPLES:
1471
1575
  50c hints "api design"
1472
1576
  50c genius "optimize this algorithm"
1577
+ 50c invent "novel sorting algorithm" --rigor=deep --domain=code
1473
1578
  50c beacon.compress "long context here..."
1474
1579
  50c tip 10 "saved my deploy"
1475
1580
  50c notip compress wrong_answer "output was garbage"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "50c",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "AI developer tools via MCP. Pay-per-use from $0.01. No subscriptions.",
5
5
  "bin": {
6
6
  "50c": "./bin/50c.js"