@vibecheckai/cli 3.2.6 → 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 (84) hide show
  1. package/bin/registry.js +192 -5
  2. package/bin/runners/lib/agent-firewall/change-packet/builder.js +280 -6
  3. package/bin/runners/lib/agent-firewall/critic/index.js +151 -0
  4. package/bin/runners/lib/agent-firewall/critic/judge.js +432 -0
  5. package/bin/runners/lib/agent-firewall/critic/prompts.js +305 -0
  6. package/bin/runners/lib/agent-firewall/lawbook/distributor.js +465 -0
  7. package/bin/runners/lib/agent-firewall/lawbook/evaluator.js +604 -0
  8. package/bin/runners/lib/agent-firewall/lawbook/index.js +304 -0
  9. package/bin/runners/lib/agent-firewall/lawbook/registry.js +514 -0
  10. package/bin/runners/lib/agent-firewall/lawbook/schema.js +420 -0
  11. package/bin/runners/lib/agent-firewall/logger.js +141 -0
  12. package/bin/runners/lib/agent-firewall/policy/loader.js +312 -4
  13. package/bin/runners/lib/agent-firewall/policy/rules/ghost-env.js +113 -1
  14. package/bin/runners/lib/agent-firewall/policy/rules/ghost-route.js +133 -6
  15. package/bin/runners/lib/agent-firewall/proposal/extractor.js +394 -0
  16. package/bin/runners/lib/agent-firewall/proposal/index.js +212 -0
  17. package/bin/runners/lib/agent-firewall/proposal/schema.js +251 -0
  18. package/bin/runners/lib/agent-firewall/proposal/validator.js +386 -0
  19. package/bin/runners/lib/agent-firewall/reality/index.js +332 -0
  20. package/bin/runners/lib/agent-firewall/reality/state.js +625 -0
  21. package/bin/runners/lib/agent-firewall/reality/watcher.js +322 -0
  22. package/bin/runners/lib/agent-firewall/risk/index.js +173 -0
  23. package/bin/runners/lib/agent-firewall/risk/scorer.js +328 -0
  24. package/bin/runners/lib/agent-firewall/risk/thresholds.js +321 -0
  25. package/bin/runners/lib/agent-firewall/risk/vectors.js +421 -0
  26. package/bin/runners/lib/agent-firewall/simulator/diff-simulator.js +472 -0
  27. package/bin/runners/lib/agent-firewall/simulator/import-resolver.js +346 -0
  28. package/bin/runners/lib/agent-firewall/simulator/index.js +181 -0
  29. package/bin/runners/lib/agent-firewall/simulator/route-validator.js +380 -0
  30. package/bin/runners/lib/agent-firewall/time-machine/incident-correlator.js +661 -0
  31. package/bin/runners/lib/agent-firewall/time-machine/index.js +267 -0
  32. package/bin/runners/lib/agent-firewall/time-machine/replay-engine.js +436 -0
  33. package/bin/runners/lib/agent-firewall/time-machine/state-reconstructor.js +490 -0
  34. package/bin/runners/lib/agent-firewall/time-machine/timeline-builder.js +530 -0
  35. package/bin/runners/lib/analyzers.js +81 -18
  36. package/bin/runners/lib/authority-badge.js +425 -0
  37. package/bin/runners/lib/cli-output.js +7 -1
  38. package/bin/runners/lib/error-handler.js +16 -9
  39. package/bin/runners/lib/exit-codes.js +275 -0
  40. package/bin/runners/lib/global-flags.js +37 -0
  41. package/bin/runners/lib/help-formatter.js +413 -0
  42. package/bin/runners/lib/logger.js +38 -0
  43. package/bin/runners/lib/unified-cli-output.js +604 -0
  44. package/bin/runners/lib/upsell.js +148 -0
  45. package/bin/runners/runApprove.js +1200 -0
  46. package/bin/runners/runAuth.js +324 -95
  47. package/bin/runners/runCheckpoint.js +39 -21
  48. package/bin/runners/runClassify.js +859 -0
  49. package/bin/runners/runContext.js +136 -24
  50. package/bin/runners/runDoctor.js +108 -68
  51. package/bin/runners/runFix.js +6 -5
  52. package/bin/runners/runGuard.js +212 -118
  53. package/bin/runners/runInit.js +3 -2
  54. package/bin/runners/runMcp.js +130 -52
  55. package/bin/runners/runPolish.js +43 -20
  56. package/bin/runners/runProve.js +1 -2
  57. package/bin/runners/runReport.js +3 -2
  58. package/bin/runners/runScan.js +63 -44
  59. package/bin/runners/runShip.js +3 -4
  60. package/bin/runners/runValidate.js +19 -2
  61. package/bin/runners/runWatch.js +104 -53
  62. package/bin/vibecheck.js +106 -19
  63. package/mcp-server/HARDENING_SUMMARY.md +299 -0
  64. package/mcp-server/agent-firewall-interceptor.js +367 -31
  65. package/mcp-server/authority-tools.js +569 -0
  66. package/mcp-server/conductor/conflict-resolver.js +588 -0
  67. package/mcp-server/conductor/execution-planner.js +544 -0
  68. package/mcp-server/conductor/index.js +377 -0
  69. package/mcp-server/conductor/lock-manager.js +615 -0
  70. package/mcp-server/conductor/request-queue.js +550 -0
  71. package/mcp-server/conductor/session-manager.js +500 -0
  72. package/mcp-server/conductor/tools.js +510 -0
  73. package/mcp-server/index.js +1149 -243
  74. package/mcp-server/lib/{api-client.js → api-client.cjs} +40 -4
  75. package/mcp-server/lib/logger.cjs +30 -0
  76. package/mcp-server/logger.js +173 -0
  77. package/mcp-server/package.json +2 -2
  78. package/mcp-server/premium-tools.js +2 -2
  79. package/mcp-server/tier-auth.js +245 -35
  80. package/mcp-server/truth-firewall-tools.js +145 -15
  81. package/mcp-server/vibecheck-tools.js +2 -2
  82. package/package.json +2 -3
  83. package/mcp-server/index.old.js +0 -4137
  84. package/mcp-server/package-lock.json +0 -165
@@ -485,6 +485,152 @@ function formatNextSteps(cmd, verdict, currentTier = "free") {
485
485
  return msg;
486
486
  }
487
487
 
488
+ // ═══════════════════════════════════════════════════════════════════════════════
489
+ // formatSoftUpsell() - Non-intrusive end-of-run upsell
490
+ // ═══════════════════════════════════════════════════════════════════════════════
491
+ /**
492
+ * Format a soft upsell shown at end of any command.
493
+ * Less intrusive than formatEarnedUpsell - single line.
494
+ *
495
+ * @param {string} cmd - The command that was run
496
+ * @param {object} opts - Options
497
+ * @param {string} opts.currentTier - User's current tier
498
+ * @param {string} opts.feature - Feature to upsell
499
+ * @param {string} opts.upgradeTier - Tier to suggest
500
+ * @returns {string} Formatted soft upsell (single line)
501
+ */
502
+ function formatSoftUpsell(cmd, opts = {}) {
503
+ const { currentTier = "free", feature, upgradeTier = "starter" } = opts;
504
+
505
+ // Don't show upsells to paid users for starter features
506
+ if (currentTier !== "free" && upgradeTier === "starter") return "";
507
+ if (currentTier === "pro" || currentTier === "complete") return "";
508
+
509
+ const tierColor = TIER_COLORS[upgradeTier] || c.cyan;
510
+ const tierLabel = TIER_LABELS[upgradeTier] || upgradeTier.toUpperCase();
511
+
512
+ // Command-specific soft upsells
513
+ const SOFT_UPSELLS = {
514
+ context: {
515
+ feature: "AI rule sync",
516
+ benefit: "sync rules across team + auto-update",
517
+ tier: "starter",
518
+ },
519
+ guard: {
520
+ feature: "advanced hallucination detection",
521
+ benefit: "deep claim verification + policy engine",
522
+ tier: "starter",
523
+ },
524
+ whoami: {
525
+ feature: "team dashboard",
526
+ benefit: "shared findings + team policies",
527
+ tier: "starter",
528
+ },
529
+ login: {
530
+ feature: "dashboard sync",
531
+ benefit: "findings sync to web dashboard",
532
+ tier: "starter",
533
+ },
534
+ logout: null, // No upsell on logout
535
+ validate: {
536
+ feature: "continuous validation",
537
+ benefit: "watch mode + CI integration",
538
+ tier: "starter",
539
+ },
540
+ truth: {
541
+ feature: "truthpack sync",
542
+ benefit: "team-shared truthpacks",
543
+ tier: "pro",
544
+ },
545
+ firewall: {
546
+ feature: "policy enforcement",
547
+ benefit: "custom rules + block patterns",
548
+ tier: "starter",
549
+ },
550
+ agent: {
551
+ feature: "agent firewall",
552
+ benefit: "real-time AI action blocking",
553
+ tier: "pro",
554
+ },
555
+ };
556
+
557
+ const upsellCopy = feature ? { feature, benefit: feature, tier: upgradeTier } : SOFT_UPSELLS[cmd];
558
+ if (!upsellCopy) return "";
559
+
560
+ const targetTier = upsellCopy.tier || upgradeTier;
561
+ const targetColor = TIER_COLORS[targetTier] || c.cyan;
562
+ const targetLabel = TIER_LABELS[targetTier] || targetTier.toUpperCase();
563
+
564
+ return `${c.dim}${sym.star} ${targetColor}${targetLabel}${c.reset}${c.dim}: ${upsellCopy.benefit} ${sym.arrow} ${PRICING_URL}${c.reset}`;
565
+ }
566
+
567
+ /**
568
+ * Format a workflow upsell - suggests next command with tier context.
569
+ *
570
+ * @param {string} completedCmd - Command just completed
571
+ * @param {string} currentTier - User's tier
572
+ * @returns {string} Formatted workflow suggestion with upsell
573
+ */
574
+ function formatWorkflowUpsell(completedCmd, currentTier = "free") {
575
+ const WORKFLOWS = {
576
+ scan: {
577
+ next: "ship",
578
+ freeCmd: "vibecheck ship",
579
+ paidCmd: "vibecheck ship --runtime",
580
+ paidBenefit: "includes runtime verification",
581
+ tier: "starter",
582
+ },
583
+ context: {
584
+ next: "scan",
585
+ freeCmd: "vibecheck scan",
586
+ paidCmd: "vibecheck scan --autofix",
587
+ paidBenefit: "auto-fix findings",
588
+ tier: "starter",
589
+ },
590
+ guard: {
591
+ next: "scan",
592
+ freeCmd: "vibecheck scan",
593
+ paidCmd: "vibecheck prove",
594
+ paidBenefit: "full proof loop",
595
+ tier: "pro",
596
+ },
597
+ doctor: {
598
+ next: "scan",
599
+ freeCmd: "vibecheck scan",
600
+ paidCmd: "vibecheck fix",
601
+ paidBenefit: "auto-fix issues found",
602
+ tier: "starter",
603
+ },
604
+ checkpoint: {
605
+ next: "fix",
606
+ freeCmd: "vibecheck fix --plan-only",
607
+ paidCmd: "vibecheck fix --apply",
608
+ paidBenefit: "apply patches automatically",
609
+ tier: "starter",
610
+ },
611
+ validate: {
612
+ next: "ship",
613
+ freeCmd: "vibecheck ship",
614
+ paidCmd: "vibecheck prove",
615
+ paidBenefit: "verified proof artifacts",
616
+ tier: "pro",
617
+ },
618
+ };
619
+
620
+ const workflow = WORKFLOWS[completedCmd];
621
+ if (!workflow) return "";
622
+
623
+ const isPaid = currentTier !== "free";
624
+ const tierColor = TIER_COLORS[workflow.tier] || c.cyan;
625
+ const tierLabel = TIER_LABELS[workflow.tier] || workflow.tier.toUpperCase();
626
+
627
+ if (isPaid) {
628
+ return `${c.dim}Next:${c.reset} ${c.cyan}${workflow.paidCmd}${c.reset}`;
629
+ }
630
+
631
+ return `${c.dim}Next:${c.reset} ${c.cyan}${workflow.freeCmd}${c.reset} ${c.dim}or${c.reset} ${tierColor}${tierLabel}${c.reset}${c.dim}: ${workflow.paidCmd} (${workflow.paidBenefit})${c.reset}`;
632
+ }
633
+
488
634
  // ═══════════════════════════════════════════════════════════════════════════════
489
635
  // EXPORTS
490
636
  // ═══════════════════════════════════════════════════════════════════════════════
@@ -496,6 +642,8 @@ module.exports = {
496
642
  formatEarnedUpsell,
497
643
  formatBadgeWithheld,
498
644
  formatNextSteps,
645
+ formatSoftUpsell,
646
+ formatWorkflowUpsell,
499
647
 
500
648
  // Copy data (for testing/docs)
501
649
  DENIAL_COPY,