genesis-ai-cli 11.2.0 → 11.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.
@@ -69,6 +69,7 @@ export declare class GenesisMCPServer extends EventEmitter {
69
69
  private matchesPattern;
70
70
  private getDefaultAuthContext;
71
71
  private registerDefaultTools;
72
+ private registerCompIntelTools;
72
73
  registerTool(config: ExposedToolConfig): void;
73
74
  registerResource(config: ExposedResourceConfig): void;
74
75
  registerPrompt(config: ExposedPromptConfig): void;
@@ -353,6 +353,7 @@ class GenesisMCPServer extends events_1.EventEmitter {
353
353
  this.metering = new MeteringService(this.config.metering);
354
354
  this.setupHandlers();
355
355
  this.registerDefaultTools();
356
+ this.registerCompIntelTools();
356
357
  }
357
358
  setupHandlers() {
358
359
  // List tools
@@ -547,6 +548,312 @@ class GenesisMCPServer extends events_1.EventEmitter {
547
548
  handler: this.handleCreate.bind(this),
548
549
  });
549
550
  }
551
+ // ============================================================================
552
+ // v11.2: CompIntel + Revenue + Daemon Tools
553
+ // ============================================================================
554
+ registerCompIntelTools() {
555
+ // genesis.compintel.scan - Run competitive intelligence scan
556
+ this.registerTool({
557
+ name: 'genesis.compintel.scan',
558
+ description: 'Run a competitive intelligence scan on specified competitors. Scrapes their pages, detects changes from baseline, and analyzes significance.',
559
+ inputSchema: {
560
+ type: 'object',
561
+ properties: {
562
+ competitors: {
563
+ type: 'array',
564
+ items: {
565
+ type: 'object',
566
+ properties: {
567
+ name: { type: 'string', description: 'Competitor name' },
568
+ domain: { type: 'string', description: 'Competitor domain (e.g. cursor.com)' },
569
+ pages: { type: 'array', items: { type: 'string' }, description: 'Specific URLs to monitor (optional, auto-inferred if empty)' },
570
+ },
571
+ required: ['name', 'domain'],
572
+ },
573
+ description: 'Competitors to scan',
574
+ },
575
+ },
576
+ required: ['competitors'],
577
+ },
578
+ requiredScopes: ['compintel'],
579
+ baseCost: 0.10,
580
+ supportsStreaming: false,
581
+ maxExecutionTime: 120000,
582
+ annotations: { readOnlyHint: true, longRunningHint: true },
583
+ handler: async (input) => {
584
+ const { createCompetitiveIntelService } = await import('../services/competitive-intel.js');
585
+ const service = createCompetitiveIntelService({ competitors: input.competitors });
586
+ const changes = await service.checkAll();
587
+ let digest;
588
+ if (changes.length > 0) {
589
+ digest = await service.generateDigest(24);
590
+ }
591
+ return {
592
+ success: true,
593
+ data: {
594
+ competitors: input.competitors.length,
595
+ pagesScraped: service.getCompetitors().reduce((sum, c) => sum + c.pages.filter((p) => p.lastContent).length, 0),
596
+ changes: changes.map((c) => ({
597
+ competitor: c.pageUrl,
598
+ type: c.changeType,
599
+ significance: c.significance,
600
+ summary: c.summary,
601
+ analysis: c.analysis,
602
+ })),
603
+ digest: digest ? {
604
+ insights: digest.keyInsights,
605
+ recommendations: digest.recommendations,
606
+ } : null,
607
+ },
608
+ };
609
+ },
610
+ });
611
+ // genesis.compintel.digest - Generate intelligence digest
612
+ this.registerTool({
613
+ name: 'genesis.compintel.digest',
614
+ description: 'Generate a strategic intelligence digest from recent competitor changes. Provides key insights and actionable recommendations.',
615
+ inputSchema: {
616
+ type: 'object',
617
+ properties: {
618
+ competitors: {
619
+ type: 'array',
620
+ items: {
621
+ type: 'object',
622
+ properties: {
623
+ name: { type: 'string' },
624
+ domain: { type: 'string' },
625
+ pages: { type: 'array', items: { type: 'string' } },
626
+ },
627
+ required: ['name', 'domain'],
628
+ },
629
+ },
630
+ periodHours: { type: 'number', description: 'Hours to look back (default: 24)', default: 24 },
631
+ },
632
+ required: ['competitors'],
633
+ },
634
+ requiredScopes: ['compintel'],
635
+ baseCost: 0.08,
636
+ supportsStreaming: false,
637
+ maxExecutionTime: 60000,
638
+ annotations: { readOnlyHint: true },
639
+ handler: async (input) => {
640
+ const { createCompetitiveIntelService } = await import('../services/competitive-intel.js');
641
+ const service = createCompetitiveIntelService({ competitors: input.competitors });
642
+ await service.checkAll();
643
+ const digest = await service.generateDigest(input.periodHours || 24);
644
+ return {
645
+ success: true,
646
+ data: digest,
647
+ };
648
+ },
649
+ });
650
+ // genesis.revenue.setup - Setup Stripe revenue loop
651
+ this.registerTool({
652
+ name: 'genesis.revenue.setup',
653
+ description: 'Initialize the Stripe revenue loop: creates product, prices ($49/$99/$199), and payment links for CompIntel subscriptions.',
654
+ inputSchema: {
655
+ type: 'object',
656
+ properties: {},
657
+ },
658
+ requiredScopes: ['revenue'],
659
+ baseCost: 0,
660
+ supportsStreaming: false,
661
+ maxExecutionTime: 30000,
662
+ annotations: { readOnlyHint: false, idempotentHint: true },
663
+ handler: async () => {
664
+ const { createRevenueLoop } = await import('../services/revenue-loop.js');
665
+ const loop = createRevenueLoop();
666
+ const { product, prices, paymentLinks } = await loop.setup();
667
+ return {
668
+ success: true,
669
+ data: {
670
+ product: { id: product.id, name: product.name },
671
+ prices: Object.fromEntries(Object.entries(prices).map(([plan, p]) => [plan, { id: p.id, amount: p.unit_amount, interval: p.recurring?.interval }])),
672
+ paymentLinks: Object.fromEntries(Object.entries(paymentLinks).map(([plan, l]) => [plan, l.url])),
673
+ },
674
+ };
675
+ },
676
+ });
677
+ // genesis.revenue.subscribe_url - Get payment link
678
+ this.registerTool({
679
+ name: 'genesis.revenue.subscribe_url',
680
+ description: 'Get the Stripe payment link for a CompIntel subscription plan.',
681
+ inputSchema: {
682
+ type: 'object',
683
+ properties: {
684
+ plan: { type: 'string', enum: ['starter', 'pro', 'enterprise'], description: 'Subscription plan' },
685
+ },
686
+ required: ['plan'],
687
+ },
688
+ requiredScopes: ['revenue'],
689
+ baseCost: 0,
690
+ supportsStreaming: false,
691
+ maxExecutionTime: 5000,
692
+ annotations: { readOnlyHint: true },
693
+ handler: async (input) => {
694
+ const { getRevenueLoop } = await import('../services/revenue-loop.js');
695
+ const loop = getRevenueLoop();
696
+ const url = loop.getPaymentUrl(input.plan);
697
+ return { success: true, data: { plan: input.plan, url } };
698
+ },
699
+ });
700
+ // genesis.revenue.check - Check subscription status
701
+ this.registerTool({
702
+ name: 'genesis.revenue.check',
703
+ description: 'Check if a Stripe customer has an active CompIntel subscription.',
704
+ inputSchema: {
705
+ type: 'object',
706
+ properties: {
707
+ customerId: { type: 'string', description: 'Stripe customer ID (cus_...)' },
708
+ },
709
+ required: ['customerId'],
710
+ },
711
+ requiredScopes: ['revenue'],
712
+ baseCost: 0,
713
+ supportsStreaming: false,
714
+ maxExecutionTime: 10000,
715
+ annotations: { readOnlyHint: true },
716
+ handler: async (input) => {
717
+ const { getRevenueLoop } = await import('../services/revenue-loop.js');
718
+ const loop = getRevenueLoop();
719
+ const check = await loop.checkSubscription(input.customerId);
720
+ return { success: true, data: check };
721
+ },
722
+ });
723
+ // genesis.revenue.paid_scan - Run a paid CompIntel scan
724
+ this.registerTool({
725
+ name: 'genesis.revenue.paid_scan',
726
+ description: 'Run a CompIntel scan gated behind Stripe subscription. Checks payment, runs scan, tracks revenue.',
727
+ inputSchema: {
728
+ type: 'object',
729
+ properties: {
730
+ customerId: { type: 'string', description: 'Stripe customer ID' },
731
+ competitors: {
732
+ type: 'array',
733
+ items: {
734
+ type: 'object',
735
+ properties: {
736
+ name: { type: 'string' },
737
+ domain: { type: 'string' },
738
+ pages: { type: 'array', items: { type: 'string' } },
739
+ },
740
+ required: ['name', 'domain'],
741
+ },
742
+ },
743
+ },
744
+ required: ['customerId', 'competitors'],
745
+ },
746
+ requiredScopes: ['revenue', 'compintel'],
747
+ baseCost: 0.10,
748
+ supportsStreaming: false,
749
+ maxExecutionTime: 120000,
750
+ annotations: { readOnlyHint: true, longRunningHint: true },
751
+ handler: async (input) => {
752
+ const { getRevenueLoop } = await import('../services/revenue-loop.js');
753
+ const loop = getRevenueLoop();
754
+ const result = await loop.runPaidScan(input.customerId, input.competitors);
755
+ return { success: result.success, data: result, error: result.error };
756
+ },
757
+ });
758
+ // genesis.daemon.compintel_start - Start daemon with CompIntel
759
+ this.registerTool({
760
+ name: 'genesis.daemon.compintel_start',
761
+ description: 'Start the Genesis daemon with CompIntel scheduled scans. Monitors competitors on interval.',
762
+ inputSchema: {
763
+ type: 'object',
764
+ properties: {
765
+ competitors: {
766
+ type: 'array',
767
+ items: {
768
+ type: 'object',
769
+ properties: {
770
+ name: { type: 'string' },
771
+ domain: { type: 'string' },
772
+ pages: { type: 'array', items: { type: 'string' } },
773
+ },
774
+ required: ['name', 'domain'],
775
+ },
776
+ },
777
+ checkIntervalMs: { type: 'number', description: 'Scan interval in ms (default: 6 hours)', default: 21600000 },
778
+ requireSubscription: { type: 'boolean', description: 'Gate behind Stripe subscription', default: false },
779
+ customerId: { type: 'string', description: 'Stripe customer ID (if requireSubscription=true)' },
780
+ },
781
+ required: ['competitors'],
782
+ },
783
+ requiredScopes: ['daemon'],
784
+ baseCost: 0,
785
+ supportsStreaming: false,
786
+ maxExecutionTime: 10000,
787
+ annotations: { readOnlyHint: false },
788
+ handler: async (input) => {
789
+ const { Daemon } = await import('../daemon/index.js');
790
+ const daemon = new Daemon({}, {
791
+ competitiveIntel: {
792
+ enabled: true,
793
+ checkIntervalMs: input.checkIntervalMs || 21600000,
794
+ digestIntervalMs: 86400000,
795
+ competitors: input.competitors,
796
+ requireSubscription: input.requireSubscription || false,
797
+ customerId: input.customerId,
798
+ },
799
+ maintenance: { enabled: false, intervalMs: 999999, healthCheckIntervalMs: 999999, memoryCleanupIntervalMs: 999999, autoRepair: false, maxConcurrentTasks: 1, unhealthyAgentThreshold: 30, memoryRetentionThreshold: 0.1, resourceUsageThreshold: 0.9 },
800
+ dream: { enabled: false, autoTrigger: false, inactivityThresholdMs: 999999, minDreamDurationMs: 60000, maxDreamDurationMs: 600000, lightSleepRatio: 0.1, deepSleepRatio: 0.6, remSleepRatio: 0.3, episodicConsolidationThreshold: 10, patternExtractionThreshold: 3, creativityTemperature: 0.7 },
801
+ selfImprovement: { enabled: false, intervalMs: 999999, autoApply: false, minPhiThreshold: 0.3, maxImprovementsPerCycle: 3 },
802
+ });
803
+ daemon.start();
804
+ // Store reference for stop
805
+ globalThis.__genesisDaemon = daemon;
806
+ return {
807
+ success: true,
808
+ data: {
809
+ state: 'running',
810
+ competitors: input.competitors.length,
811
+ intervalMs: input.checkIntervalMs || 21600000,
812
+ requireSubscription: input.requireSubscription || false,
813
+ },
814
+ };
815
+ },
816
+ });
817
+ // genesis.daemon.stop - Stop running daemon
818
+ this.registerTool({
819
+ name: 'genesis.daemon.stop',
820
+ description: 'Stop the running Genesis daemon.',
821
+ inputSchema: { type: 'object', properties: {} },
822
+ requiredScopes: ['daemon'],
823
+ baseCost: 0,
824
+ supportsStreaming: false,
825
+ maxExecutionTime: 5000,
826
+ annotations: { readOnlyHint: false },
827
+ handler: async () => {
828
+ const daemon = globalThis.__genesisDaemon;
829
+ if (daemon) {
830
+ daemon.stop();
831
+ globalThis.__genesisDaemon = null;
832
+ return { success: true, data: { state: 'stopped' } };
833
+ }
834
+ return { success: false, error: 'No daemon running' };
835
+ },
836
+ });
837
+ // genesis.daemon.status - Get daemon status
838
+ this.registerTool({
839
+ name: 'genesis.daemon.status',
840
+ description: 'Get the current status of the Genesis daemon.',
841
+ inputSchema: { type: 'object', properties: {} },
842
+ requiredScopes: ['daemon'],
843
+ baseCost: 0,
844
+ supportsStreaming: false,
845
+ maxExecutionTime: 5000,
846
+ annotations: { readOnlyHint: true },
847
+ handler: async () => {
848
+ const daemon = globalThis.__genesisDaemon;
849
+ if (daemon) {
850
+ const status = daemon.status();
851
+ return { success: true, data: status };
852
+ }
853
+ return { success: true, data: { state: 'stopped' } };
854
+ },
855
+ });
856
+ }
550
857
  registerTool(config) {
551
858
  this.tools.set(config.name, config);
552
859
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis-ai-cli",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "Fully Autonomous AI System - Self-funding, Self-deploying, Production Memory, A2A Protocol & Governance",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",