monomind 1.6.0 → 1.6.1
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/monomind.js +50 -0
- package/package.json +10 -69
- package/.claude/agents/academic/academic-anthropologist.md +0 -126
- package/.claude/agents/academic/academic-geographer.md +0 -128
- package/.claude/agents/academic/academic-historian.md +0 -124
- package/.claude/agents/academic/academic-narratologist.md +0 -119
- package/.claude/agents/academic/academic-psychologist.md +0 -119
- package/.claude/agents/analysis/analyze-code-quality.md +0 -58
- package/.claude/agents/analysis/code-analyzer.md +0 -189
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +0 -58
- package/.claude/agents/architecture/system-design/arch-system-design.md +0 -54
- package/.claude/agents/consensus/crdt-synchronizer.md +0 -977
- package/.claude/agents/consensus/performance-benchmarker.md +0 -831
- package/.claude/agents/consensus/quorum-manager.md +0 -803
- package/.claude/agents/consensus/security-manager.md +0 -602
- package/.claude/agents/core/coder.md +0 -262
- package/.claude/agents/core/planner.md +0 -170
- package/.claude/agents/core/researcher.md +0 -192
- package/.claude/agents/core/reviewer.md +0 -327
- package/.claude/agents/core/tester.md +0 -318
- package/.claude/agents/data/ml/data-ml-model.md +0 -76
- package/.claude/agents/design/design-brand-guardian.md +0 -323
- package/.claude/agents/design/design-image-prompt-engineer.md +0 -237
- package/.claude/agents/design/design-inclusive-visuals-specialist.md +0 -72
- package/.claude/agents/design/design-ui-designer.md +0 -384
- package/.claude/agents/design/design-ux-architect.md +0 -470
- package/.claude/agents/design/design-ux-researcher.md +0 -330
- package/.claude/agents/design/design-visual-storyteller.md +0 -150
- package/.claude/agents/design/design-whimsy-injector.md +0 -439
- package/.claude/agents/development/dev-backend-api.md +0 -178
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -52
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -63
- package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -212
- package/.claude/agents/engineering/engineering-ai-engineer.md +0 -165
- package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -108
- package/.claude/agents/engineering/engineering-backend-architect.md +0 -254
- package/.claude/agents/engineering/engineering-code-reviewer.md +0 -95
- package/.claude/agents/engineering/engineering-data-engineer.md +0 -307
- package/.claude/agents/engineering/engineering-database-optimizer.md +0 -200
- package/.claude/agents/engineering/engineering-devops-automator.md +0 -430
- package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -174
- package/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -607
- package/.claude/agents/engineering/engineering-frontend-developer.md +0 -249
- package/.claude/agents/engineering/engineering-git-workflow-master.md +0 -108
- package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -482
- package/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -499
- package/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -463
- package/.claude/agents/engineering/engineering-security-engineer.md +0 -303
- package/.claude/agents/engineering/engineering-senior-developer.md +0 -195
- package/.claude/agents/engineering/engineering-software-architect.md +0 -100
- package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -528
- package/.claude/agents/engineering/engineering-sre.md +0 -114
- package/.claude/agents/engineering/engineering-technical-writer.md +0 -412
- package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -540
- package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -351
- package/.claude/agents/game-development/blender/blender-addon-engineer.md +0 -235
- package/.claude/agents/game-development/game-audio-engineer.md +0 -265
- package/.claude/agents/game-development/game-designer.md +0 -168
- package/.claude/agents/game-development/godot/godot-gameplay-scripter.md +0 -335
- package/.claude/agents/game-development/godot/godot-multiplayer-engineer.md +0 -298
- package/.claude/agents/game-development/godot/godot-shader-developer.md +0 -267
- package/.claude/agents/game-development/level-designer.md +0 -209
- package/.claude/agents/game-development/narrative-designer.md +0 -244
- package/.claude/agents/game-development/roblox-studio/roblox-avatar-creator.md +0 -298
- package/.claude/agents/game-development/roblox-studio/roblox-experience-designer.md +0 -306
- package/.claude/agents/game-development/roblox-studio/roblox-systems-scripter.md +0 -326
- package/.claude/agents/game-development/technical-artist.md +0 -230
- package/.claude/agents/game-development/unity/unity-architect.md +0 -272
- package/.claude/agents/game-development/unity/unity-editor-tool-developer.md +0 -311
- package/.claude/agents/game-development/unity/unity-multiplayer-engineer.md +0 -322
- package/.claude/agents/game-development/unity/unity-shader-graph-artist.md +0 -270
- package/.claude/agents/game-development/unreal-engine/unreal-multiplayer-architect.md +0 -314
- package/.claude/agents/game-development/unreal-engine/unreal-systems-engineer.md +0 -311
- package/.claude/agents/game-development/unreal-engine/unreal-technical-artist.md +0 -257
- package/.claude/agents/game-development/unreal-engine/unreal-world-builder.md +0 -274
- package/.claude/agents/github/code-review-swarm.md +0 -557
- package/.claude/agents/github/github-modes.md +0 -154
- package/.claude/agents/github/issue-tracker.md +0 -299
- package/.claude/agents/github/multi-repo-swarm.md +0 -525
- package/.claude/agents/github/pr-manager.md +0 -163
- package/.claude/agents/github/project-board-sync.md +0 -478
- package/.claude/agents/github/release-manager.md +0 -352
- package/.claude/agents/github/release-swarm.md +0 -597
- package/.claude/agents/github/repo-architect.md +0 -378
- package/.claude/agents/github/swarm-issue.md +0 -548
- package/.claude/agents/github/swarm-pr.md +0 -427
- package/.claude/agents/github/sync-coordinator.md +0 -423
- package/.claude/agents/github/workflow-automation.md +0 -640
- package/.claude/agents/goal/agent.md +0 -804
- package/.claude/agents/goal/code-goal-planner.md +0 -445
- package/.claude/agents/goal/goal-planner.md +0 -168
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -129
- package/.claude/agents/hive-mind/queen-coordinator.md +0 -202
- package/.claude/agents/hive-mind/scout-explorer.md +0 -241
- package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -192
- package/.claude/agents/hive-mind/worker-specialist.md +0 -216
- package/.claude/agents/marketing/marketing-ai-citation-strategist.md +0 -171
- package/.claude/agents/marketing/marketing-app-store-optimizer.md +0 -322
- package/.claude/agents/marketing/marketing-baidu-seo-specialist.md +0 -227
- package/.claude/agents/marketing/marketing-bilibili-content-strategist.md +0 -200
- package/.claude/agents/marketing/marketing-book-co-author.md +0 -111
- package/.claude/agents/marketing/marketing-carousel-growth-engine.md +0 -200
- package/.claude/agents/marketing/marketing-china-ecommerce-operator.md +0 -284
- package/.claude/agents/marketing/marketing-content-creator.md +0 -54
- package/.claude/agents/marketing/marketing-cross-border-ecommerce.md +0 -260
- package/.claude/agents/marketing/marketing-douyin-strategist.md +0 -150
- package/.claude/agents/marketing/marketing-growth-hacker.md +0 -54
- package/.claude/agents/marketing/marketing-instagram-curator.md +0 -114
- package/.claude/agents/marketing/marketing-kuaishou-strategist.md +0 -224
- package/.claude/agents/marketing/marketing-linkedin-content-creator.md +0 -215
- package/.claude/agents/marketing/marketing-livestream-commerce-coach.md +0 -306
- package/.claude/agents/marketing/marketing-podcast-strategist.md +0 -278
- package/.claude/agents/marketing/marketing-private-domain-operator.md +0 -309
- package/.claude/agents/marketing/marketing-reddit-community-builder.md +0 -124
- package/.claude/agents/marketing/marketing-seo-specialist.md +0 -279
- package/.claude/agents/marketing/marketing-short-video-editing-coach.md +0 -413
- package/.claude/agents/marketing/marketing-social-media-strategist.md +0 -125
- package/.claude/agents/marketing/marketing-tiktok-strategist.md +0 -126
- package/.claude/agents/marketing/marketing-twitter-engager.md +0 -127
- package/.claude/agents/marketing/marketing-wechat-official-account.md +0 -146
- package/.claude/agents/marketing/marketing-weibo-strategist.md +0 -241
- package/.claude/agents/marketing/marketing-xiaohongshu-specialist.md +0 -139
- package/.claude/agents/marketing/marketing-zhihu-strategist.md +0 -163
- package/.claude/agents/neural/safla-neural.md +0 -74
- package/.claude/agents/optimization/benchmark-suite.md +0 -663
- package/.claude/agents/optimization/load-balancer.md +0 -429
- package/.claude/agents/optimization/performance-monitor.md +0 -670
- package/.claude/agents/optimization/resource-allocator.md +0 -672
- package/.claude/agents/optimization/topology-optimizer.md +0 -806
- package/.claude/agents/paid-media/paid-media-auditor.md +0 -71
- package/.claude/agents/paid-media/paid-media-creative-strategist.md +0 -71
- package/.claude/agents/paid-media/paid-media-paid-social-strategist.md +0 -71
- package/.claude/agents/paid-media/paid-media-ppc-strategist.md +0 -71
- package/.claude/agents/paid-media/paid-media-programmatic-buyer.md +0 -71
- package/.claude/agents/paid-media/paid-media-search-query-analyst.md +0 -71
- package/.claude/agents/paid-media/paid-media-tracking-specialist.md +0 -71
- package/.claude/agents/payments/agentic-payments.md +0 -126
- package/.claude/agents/product/product-behavioral-nudge-engine.md +0 -81
- package/.claude/agents/product/product-feedback-synthesizer.md +0 -119
- package/.claude/agents/product/product-manager.md +0 -469
- package/.claude/agents/product/product-sprint-prioritizer.md +0 -154
- package/.claude/agents/product/product-trend-researcher.md +0 -159
- package/.claude/agents/project-management/project-management-experiment-tracker.md +0 -199
- package/.claude/agents/project-management/project-management-jira-workflow-steward.md +0 -231
- package/.claude/agents/project-management/project-management-project-shepherd.md +0 -195
- package/.claude/agents/project-management/project-management-studio-operations.md +0 -201
- package/.claude/agents/project-management/project-management-studio-producer.md +0 -204
- package/.claude/agents/project-management/project-manager-senior.md +0 -136
- package/.claude/agents/reasoning/agent.md +0 -804
- package/.claude/agents/reasoning/goal-planner.md +0 -73
- package/.claude/agents/sales/sales-account-strategist.md +0 -228
- package/.claude/agents/sales/sales-coach.md +0 -272
- package/.claude/agents/sales/sales-deal-strategist.md +0 -181
- package/.claude/agents/sales/sales-discovery-coach.md +0 -226
- package/.claude/agents/sales/sales-engineer.md +0 -183
- package/.claude/agents/sales/sales-outbound-strategist.md +0 -202
- package/.claude/agents/sales/sales-pipeline-analyst.md +0 -268
- package/.claude/agents/sales/sales-proposal-strategist.md +0 -218
- package/.claude/agents/schemas/architecture-output.json +0 -43
- package/.claude/agents/schemas/code-review-output.json +0 -28
- package/.claude/agents/schemas/generic-task-input.json +0 -12
- package/.claude/agents/schemas/implementation-output.json +0 -18
- package/.claude/agents/schemas/research-output.json +0 -31
- package/.claude/agents/schemas/security-audit-output.json +0 -29
- package/.claude/agents/schemas/test-report-output.json +0 -29
- package/.claude/agents/sona/sona-learning-optimizer.md +0 -65
- package/.claude/agents/sparc/architecture.md +0 -453
- package/.claude/agents/sparc/pseudocode.md +0 -299
- package/.claude/agents/sparc/refinement.md +0 -504
- package/.claude/agents/sparc/specification.md +0 -258
- package/.claude/agents/spatial-computing/macos-spatial-metal-engineer.md +0 -338
- package/.claude/agents/spatial-computing/terminal-integration-specialist.md +0 -71
- package/.claude/agents/spatial-computing/visionos-spatial-engineer.md +0 -55
- package/.claude/agents/specialized/accounts-payable-agent.md +0 -186
- package/.claude/agents/specialized/agentic-identity-trust.md +0 -388
- package/.claude/agents/specialized/agents-orchestrator.md +0 -368
- package/.claude/agents/specialized/automation-governance-architect.md +0 -217
- package/.claude/agents/specialized/blockchain-security-auditor.md +0 -497
- package/.claude/agents/specialized/compliance-auditor.md +0 -159
- package/.claude/agents/specialized/corporate-training-designer.md +0 -193
- package/.claude/agents/specialized/data-consolidation-agent.md +0 -61
- package/.claude/agents/specialized/government-digital-presales-consultant.md +0 -364
- package/.claude/agents/specialized/healthcare-marketing-compliance.md +0 -396
- package/.claude/agents/specialized/identity-graph-operator.md +0 -261
- package/.claude/agents/specialized/lsp-index-engineer.md +0 -315
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -89
- package/.claude/agents/specialized/recruitment-specialist.md +0 -510
- package/.claude/agents/specialized/report-distribution-agent.md +0 -66
- package/.claude/agents/specialized/sales-data-extraction-agent.md +0 -68
- package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -89
- package/.claude/agents/specialized/specialized-developer-advocate.md +0 -318
- package/.claude/agents/specialized/specialized-document-generator.md +0 -56
- package/.claude/agents/specialized/specialized-french-consulting-market.md +0 -193
- package/.claude/agents/specialized/specialized-korean-business-navigator.md +0 -217
- package/.claude/agents/specialized/specialized-mcp-builder.md +0 -64
- package/.claude/agents/specialized/specialized-model-qa.md +0 -489
- package/.claude/agents/specialized/specialized-salesforce-architect.md +0 -181
- package/.claude/agents/specialized/specialized-workflow-architect.md +0 -598
- package/.claude/agents/specialized/study-abroad-advisor.md +0 -283
- package/.claude/agents/specialized/supply-chain-strategist.md +0 -583
- package/.claude/agents/specialized/zk-steward.md +0 -212
- package/.claude/agents/sublinear/consensus-coordinator.md +0 -333
- package/.claude/agents/sublinear/matrix-optimizer.md +0 -180
- package/.claude/agents/sublinear/pagerank-analyzer.md +0 -295
- package/.claude/agents/sublinear/performance-optimizer.md +0 -363
- package/.claude/agents/sublinear/trading-predictor.md +0 -242
- package/.claude/agents/support/support-analytics-reporter.md +0 -366
- package/.claude/agents/support/support-executive-summary-generator.md +0 -213
- package/.claude/agents/support/support-finance-tracker.md +0 -443
- package/.claude/agents/support/support-infrastructure-maintainer.md +0 -619
- package/.claude/agents/support/support-legal-compliance-checker.md +0 -589
- package/.claude/agents/support/support-support-responder.md +0 -586
- package/.claude/agents/swarm/adaptive-coordinator.md +0 -364
- package/.claude/agents/swarm/hierarchical-coordinator.md +0 -318
- package/.claude/agents/swarm/mesh-coordinator.md +0 -363
- package/.claude/agents/templates/automation-smart-agent.md +0 -185
- package/.claude/agents/templates/coordinator-swarm-init.md +0 -83
- package/.claude/agents/templates/github-pr-manager.md +0 -155
- package/.claude/agents/templates/implementer-sparc-coder.md +0 -231
- package/.claude/agents/templates/memory-coordinator.md +0 -163
- package/.claude/agents/templates/migration-plan.md +0 -724
- package/.claude/agents/templates/orchestrator-task.md +0 -120
- package/.claude/agents/templates/performance-analyzer.md +0 -179
- package/.claude/agents/templates/sparc-coordinator.md +0 -163
- package/.claude/agents/testing/production-validator.md +0 -374
- package/.claude/agents/testing/tdd-london-swarm.md +0 -241
- package/.claude/agents/testing/testing-accessibility-auditor.md +0 -322
- package/.claude/agents/testing/testing-api-tester.md +0 -307
- package/.claude/agents/testing/testing-evidence-collector.md +0 -211
- package/.claude/agents/testing/testing-performance-benchmarker.md +0 -269
- package/.claude/agents/testing/testing-reality-checker.md +0 -237
- package/.claude/agents/testing/testing-test-results-analyzer.md +0 -306
- package/.claude/agents/testing/testing-tool-evaluator.md +0 -395
- package/.claude/agents/testing/testing-workflow-optimizer.md +0 -451
- package/.claude/agents/v3/integration-architect.md +0 -338
- package/.claude/agents/v3/memory-specialist.md +0 -298
- package/.claude/agents/v3/performance-engineer.md +0 -387
- package/.claude/agents/v3/queen-coordinator.md +0 -67
- package/.claude/agents/v3/security-architect.md +0 -154
- package/.claude/checkpoints/1767754460.json +0 -8
- package/.claude/commands/agents/README.md +0 -10
- package/.claude/commands/agents/agent-capabilities.md +0 -21
- package/.claude/commands/agents/agent-coordination.md +0 -28
- package/.claude/commands/agents/agent-spawning.md +0 -28
- package/.claude/commands/agents/agent-types.md +0 -26
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
- package/.claude/commands/analysis/README.md +0 -9
- package/.claude/commands/analysis/bottleneck-detect.md +0 -162
- package/.claude/commands/analysis/performance-bottlenecks.md +0 -59
- package/.claude/commands/analysis/performance-report.md +0 -25
- package/.claude/commands/analysis/token-efficiency.md +0 -45
- package/.claude/commands/analysis/token-usage.md +0 -25
- package/.claude/commands/automation/README.md +0 -9
- package/.claude/commands/automation/auto-agent.md +0 -122
- package/.claude/commands/automation/self-healing.md +0 -106
- package/.claude/commands/automation/session-memory.md +0 -90
- package/.claude/commands/automation/smart-agents.md +0 -73
- package/.claude/commands/automation/smart-spawn.md +0 -25
- package/.claude/commands/automation/workflow-select.md +0 -25
- package/.claude/commands/browse.md +0 -27
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/github/README.md +0 -11
- package/.claude/commands/github/code-review-swarm.md +0 -550
- package/.claude/commands/github/code-review.md +0 -25
- package/.claude/commands/github/github-modes.md +0 -147
- package/.claude/commands/github/github-swarm.md +0 -121
- package/.claude/commands/github/issue-tracker.md +0 -292
- package/.claude/commands/github/issue-triage.md +0 -25
- package/.claude/commands/github/multi-repo-swarm.md +0 -519
- package/.claude/commands/github/pr-enhance.md +0 -26
- package/.claude/commands/github/pr-manager.md +0 -170
- package/.claude/commands/github/project-board-sync.md +0 -471
- package/.claude/commands/github/release-manager.md +0 -355
- package/.claude/commands/github/release-swarm.md +0 -590
- package/.claude/commands/github/repo-analyze.md +0 -25
- package/.claude/commands/github/repo-architect.md +0 -381
- package/.claude/commands/github/swarm-issue.md +0 -482
- package/.claude/commands/github/swarm-pr.md +0 -310
- package/.claude/commands/github/sync-coordinator.md +0 -301
- package/.claude/commands/github/workflow-automation.md +0 -468
- package/.claude/commands/hive-mind/README.md +0 -17
- package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-init.md +0 -18
- package/.claude/commands/hive-mind/hive-mind-memory.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-metrics.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-resume.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-sessions.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -21
- package/.claude/commands/hive-mind/hive-mind-status.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-stop.md +0 -8
- package/.claude/commands/hive-mind/hive-mind-wizard.md +0 -8
- package/.claude/commands/hive-mind/hive-mind.md +0 -27
- package/.claude/commands/hooks/README.md +0 -11
- package/.claude/commands/hooks/overview.md +0 -58
- package/.claude/commands/hooks/post-edit.md +0 -117
- package/.claude/commands/hooks/post-task.md +0 -112
- package/.claude/commands/hooks/pre-edit.md +0 -113
- package/.claude/commands/hooks/pre-task.md +0 -111
- package/.claude/commands/hooks/session-end.md +0 -118
- package/.claude/commands/hooks/setup.md +0 -103
- package/.claude/commands/list-agents.md +0 -17
- package/.claude/commands/mastermind.md +0 -121
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/metrics.md +0 -11
- package/.claude/commands/monitoring/README.md +0 -9
- package/.claude/commands/monitoring/agent-metrics.md +0 -25
- package/.claude/commands/monitoring/agents.md +0 -44
- package/.claude/commands/monitoring/real-time-view.md +0 -25
- package/.claude/commands/monitoring/status.md +0 -46
- package/.claude/commands/monitoring/swarm-monitor.md +0 -25
- package/.claude/commands/monobrain-help.md +0 -103
- package/.claude/commands/monobrain-memory.md +0 -107
- package/.claude/commands/monobrain-swarm.md +0 -205
- package/.claude/commands/monomind-do.md +0 -276
- package/.claude/commands/monomind-idea.md +0 -269
- package/.claude/commands/monomind-repeat.md +0 -95
- package/.claude/commands/optimization/README.md +0 -9
- package/.claude/commands/optimization/auto-topology.md +0 -62
- package/.claude/commands/optimization/cache-manage.md +0 -25
- package/.claude/commands/optimization/parallel-execution.md +0 -50
- package/.claude/commands/optimization/topology-optimize.md +0 -25
- package/.claude/commands/pair/README.md +0 -261
- package/.claude/commands/pair/commands.md +0 -546
- package/.claude/commands/pair/config.md +0 -510
- package/.claude/commands/pair/examples.md +0 -512
- package/.claude/commands/pair/modes.md +0 -348
- package/.claude/commands/pair/session.md +0 -407
- package/.claude/commands/pair/start.md +0 -209
- package/.claude/commands/sparc/analyzer.md +0 -52
- package/.claude/commands/sparc/architect.md +0 -53
- package/.claude/commands/sparc/ask.md +0 -97
- package/.claude/commands/sparc/batch-executor.md +0 -54
- package/.claude/commands/sparc/code.md +0 -89
- package/.claude/commands/sparc/coder.md +0 -54
- package/.claude/commands/sparc/debug.md +0 -83
- package/.claude/commands/sparc/debugger.md +0 -54
- package/.claude/commands/sparc/designer.md +0 -53
- package/.claude/commands/sparc/devops.md +0 -109
- package/.claude/commands/sparc/docs-writer.md +0 -80
- package/.claude/commands/sparc/documenter.md +0 -54
- package/.claude/commands/sparc/innovator.md +0 -54
- package/.claude/commands/sparc/integration.md +0 -83
- package/.claude/commands/sparc/mcp.md +0 -117
- package/.claude/commands/sparc/memory-manager.md +0 -54
- package/.claude/commands/sparc/optimizer.md +0 -54
- package/.claude/commands/sparc/orchestrator.md +0 -132
- package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -83
- package/.claude/commands/sparc/refinement-optimization-mode.md +0 -83
- package/.claude/commands/sparc/researcher.md +0 -54
- package/.claude/commands/sparc/reviewer.md +0 -54
- package/.claude/commands/sparc/security-review.md +0 -80
- package/.claude/commands/sparc/sparc-modes.md +0 -174
- package/.claude/commands/sparc/sparc.md +0 -111
- package/.claude/commands/sparc/spec-pseudocode.md +0 -80
- package/.claude/commands/sparc/supabase-admin.md +0 -348
- package/.claude/commands/sparc/swarm-coordinator.md +0 -54
- package/.claude/commands/sparc/tdd.md +0 -54
- package/.claude/commands/sparc/tester.md +0 -54
- package/.claude/commands/sparc/tutorial.md +0 -79
- package/.claude/commands/sparc/workflow-manager.md +0 -54
- package/.claude/commands/sparc.md +0 -166
- package/.claude/commands/stream-chain/pipeline.md +0 -121
- package/.claude/commands/stream-chain/run.md +0 -70
- package/.claude/commands/swarm/README.md +0 -15
- package/.claude/commands/swarm/analysis.md +0 -95
- package/.claude/commands/swarm/development.md +0 -96
- package/.claude/commands/swarm/examples.md +0 -168
- package/.claude/commands/swarm/maintenance.md +0 -102
- package/.claude/commands/swarm/optimization.md +0 -117
- package/.claude/commands/swarm/research.md +0 -136
- package/.claude/commands/swarm/swarm-analysis.md +0 -8
- package/.claude/commands/swarm/swarm-background.md +0 -8
- package/.claude/commands/swarm/swarm-modes.md +0 -8
- package/.claude/commands/swarm/swarm-monitor.md +0 -8
- package/.claude/commands/swarm/swarm-status.md +0 -8
- package/.claude/commands/swarm/swarm-strategies.md +0 -8
- package/.claude/commands/swarm/swarm.md +0 -27
- package/.claude/commands/swarm/testing.md +0 -131
- package/.claude/commands/tokens.md +0 -13
- package/.claude/commands/training/README.md +0 -9
- package/.claude/commands/training/model-update.md +0 -25
- package/.claude/commands/training/neural-patterns.md +0 -74
- package/.claude/commands/training/neural-train.md +0 -25
- package/.claude/commands/training/pattern-learn.md +0 -25
- package/.claude/commands/training/specialization.md +0 -63
- package/.claude/commands/truth/start.md +0 -143
- package/.claude/commands/ts.md +0 -9
- package/.claude/commands/use-agent.md +0 -67
- package/.claude/commands/verify/check.md +0 -50
- package/.claude/commands/verify/start.md +0 -128
- package/.claude/commands/workflows/README.md +0 -9
- package/.claude/commands/workflows/development.md +0 -78
- package/.claude/commands/workflows/research.md +0 -63
- package/.claude/commands/workflows/workflow-create.md +0 -25
- package/.claude/commands/workflows/workflow-execute.md +0 -25
- package/.claude/commands/workflows/workflow-export.md +0 -25
- package/.claude/config/v1-dependency-optimization.json +0 -266
- package/.claude/config/v1-performance-targets.json +0 -251
- package/.claude/helpers/README.md +0 -105
- package/.claude/helpers/auto-memory-hook.mjs +0 -369
- package/.claude/helpers/context-persistence-hook.mjs +0 -1988
- package/.claude/helpers/extras-registry.json +0 -3028
- package/.claude/helpers/graphify-freshen.cjs +0 -109
- package/.claude/helpers/hook-handler.cjs +0 -1446
- package/.claude/helpers/intelligence.cjs +0 -227
- package/.claude/helpers/learning-service.mjs +0 -1144
- package/.claude/helpers/memory-palace.cjs +0 -401
- package/.claude/helpers/memory.cjs +0 -84
- package/.claude/helpers/metrics-db.mjs +0 -488
- package/.claude/helpers/router.cjs +0 -306
- package/.claude/helpers/session.cjs +0 -125
- package/.claude/helpers/skill-registry.json +0 -961
- package/.claude/helpers/statusline.cjs +0 -1276
- package/.claude/helpers/swarm-hooks.sh +0 -761
- package/.claude/helpers/toggle-statusline.cjs +0 -58
- package/.claude/helpers/token-tracker.cjs +0 -934
- package/.claude/mcp.json +0 -3
- package/.claude/settings.json +0 -303
- package/.claude/settings.local.json +0 -48
- package/.claude/skills/agent-browser-testing/SKILL.md +0 -312
- package/.claude/skills/agentdb-advanced/SKILL.md +0 -550
- package/.claude/skills/agentdb-learning/SKILL.md +0 -545
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +0 -339
- package/.claude/skills/agentdb-optimization/SKILL.md +0 -509
- package/.claude/skills/agentdb-vector-search/SKILL.md +0 -339
- package/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
- package/.claude/skills/github-code-review/SKILL.md +0 -1148
- package/.claude/skills/github-multi-repo/SKILL.md +0 -916
- package/.claude/skills/github-project-management/SKILL.md +0 -1250
- package/.claude/skills/github-release-management/SKILL.md +0 -1124
- package/.claude/skills/github-workflow-automation/SKILL.md +0 -1111
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -709
- package/.claude/skills/hooks-automation/SKILL.md +0 -1200
- package/.claude/skills/pair-programming/SKILL.md +0 -1202
- package/.claude/skills/performance-analysis/SKILL.md +0 -560
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +0 -446
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +0 -201
- package/.claude/skills/skill-builder/SKILL.md +0 -910
- package/.claude/skills/sparc-methodology/SKILL.md +0 -1106
- package/.claude/skills/specialagent/SKILL.md +0 -208
- package/.claude/skills/stream-chain/SKILL.md +0 -560
- package/.claude/skills/swarm-advanced/SKILL.md +0 -970
- package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
- package/.claude/skills/v3-cli-modernization/SKILL.md +0 -941
- package/.claude/skills/v3-core-implementation/SKILL.md +0 -867
- package/.claude/skills/v3-ddd-architecture/SKILL.md +0 -451
- package/.claude/skills/v3-integration-deep/SKILL.md +0 -258
- package/.claude/skills/v3-mcp-optimization/SKILL.md +0 -816
- package/.claude/skills/v3-memory-unification/SKILL.md +0 -180
- package/.claude/skills/v3-performance-optimization/SKILL.md +0 -408
- package/.claude/skills/v3-security-overhaul/SKILL.md +0 -91
- package/.claude/skills/v3-swarm-coordination/SKILL.md +0 -433
- package/.claude/skills/verification-quality/SKILL.md +0 -674
- package/.claude/statusline-command.sh +0 -176
- package/.claude/statusline.mjs +0 -109
- package/.claude/statusline.sh +0 -431
- package/.claude/workflows/feature-dev.yaml +0 -18
- package/.claude/workflows/security-audit.yaml +0 -10
- package/.claude-plugin/README.md +0 -705
- package/.claude-plugin/docs/INSTALLATION.md +0 -258
- package/.claude-plugin/docs/PLUGIN_SUMMARY.md +0 -359
- package/.claude-plugin/docs/QUICKSTART.md +0 -360
- package/.claude-plugin/docs/STRUCTURE.md +0 -126
- package/.claude-plugin/hooks/hooks.json +0 -74
- package/.claude-plugin/marketplace.json +0 -98
- package/.claude-plugin/plugin.json +0 -70
- package/.claude-plugin/scripts/install.sh +0 -234
- package/.claude-plugin/scripts/uninstall.sh +0 -36
- package/.claude-plugin/scripts/verify.sh +0 -108
- package/LICENSE +0 -21
- package/README.md +0 -687
- package/bin/cli.js +0 -11
- package/bin/npx-safe-launch.js +0 -9
- package/packages/@monomind/cli/README.md +0 -687
- package/packages/@monomind/cli/bin/cli.js +0 -156
- package/packages/@monomind/cli/bin/mcp-server.js +0 -189
- package/packages/@monomind/cli/bin/preinstall.cjs +0 -2
- package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -50
- package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
- package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -66
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -58
- package/packages/@monomind/cli/dist/src/agents/registry-builder.d.ts +0 -36
- package/packages/@monomind/cli/dist/src/agents/registry-builder.js +0 -200
- package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
- package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
- package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -204
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
- package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
- package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -62
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -260
- package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
- package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -61
- package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -212
- package/packages/@monomind/cli/dist/src/autopilot-state.d.ts +0 -77
- package/packages/@monomind/cli/dist/src/autopilot-state.js +0 -279
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.d.ts +0 -82
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +0 -261
- package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.d.ts +0 -35
- package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.js +0 -91
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -58
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
- package/packages/@monomind/cli/dist/src/commands/agent.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/agent.js +0 -941
- package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/commands/analyze.js +0 -2048
- package/packages/@monomind/cli/dist/src/commands/appliance-advanced.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/appliance-advanced.js +0 -215
- package/packages/@monomind/cli/dist/src/commands/appliance.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/appliance.js +0 -406
- package/packages/@monomind/cli/dist/src/commands/autopilot.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/commands/autopilot.js +0 -362
- package/packages/@monomind/cli/dist/src/commands/benchmark.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/benchmark.js +0 -460
- package/packages/@monomind/cli/dist/src/commands/claims.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/claims.js +0 -624
- package/packages/@monomind/cli/dist/src/commands/cleanup.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/commands/cleanup.js +0 -218
- package/packages/@monomind/cli/dist/src/commands/completions.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/completions.js +0 -539
- package/packages/@monomind/cli/dist/src/commands/config.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/config.js +0 -428
- package/packages/@monomind/cli/dist/src/commands/daemon.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/daemon.js +0 -669
- package/packages/@monomind/cli/dist/src/commands/deployment.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/deployment.js +0 -672
- package/packages/@monomind/cli/dist/src/commands/doctor.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/doctor.js +0 -619
- package/packages/@monomind/cli/dist/src/commands/embeddings.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/embeddings.js +0 -1576
- package/packages/@monomind/cli/dist/src/commands/guidance.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/guidance.js +0 -560
- package/packages/@monomind/cli/dist/src/commands/hive-mind.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/hive-mind.js +0 -1237
- package/packages/@monomind/cli/dist/src/commands/hooks.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/hooks.js +0 -4442
- package/packages/@monomind/cli/dist/src/commands/index.d.ts +0 -117
- package/packages/@monomind/cli/dist/src/commands/index.js +0 -391
- package/packages/@monomind/cli/dist/src/commands/init.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/init.js +0 -817
- package/packages/@monomind/cli/dist/src/commands/issues.d.ts +0 -21
- package/packages/@monomind/cli/dist/src/commands/issues.js +0 -567
- package/packages/@monomind/cli/dist/src/commands/mcp.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/mcp.js +0 -718
- package/packages/@monomind/cli/dist/src/commands/memory.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/memory.js +0 -1565
- package/packages/@monomind/cli/dist/src/commands/migrate.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/migrate.js +0 -742
- package/packages/@monomind/cli/dist/src/commands/neural.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/neural.js +0 -1454
- package/packages/@monomind/cli/dist/src/commands/performance.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/performance.js +0 -579
- package/packages/@monomind/cli/dist/src/commands/plugins.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/plugins.js +0 -820
- package/packages/@monomind/cli/dist/src/commands/process.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/process.js +0 -695
- package/packages/@monomind/cli/dist/src/commands/progress.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/progress.js +0 -259
- package/packages/@monomind/cli/dist/src/commands/providers.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/providers.js +0 -359
- package/packages/@monomind/cli/dist/src/commands/replay.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/replay.js +0 -60
- package/packages/@monomind/cli/dist/src/commands/route.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/commands/route.js +0 -907
- package/packages/@monomind/cli/dist/src/commands/ruvector/backup.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/backup.js +0 -746
- package/packages/@monomind/cli/dist/src/commands/ruvector/benchmark.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/benchmark.js +0 -489
- package/packages/@monomind/cli/dist/src/commands/ruvector/import.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/ruvector/import.js +0 -349
- package/packages/@monomind/cli/dist/src/commands/ruvector/index.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/commands/ruvector/index.js +0 -129
- package/packages/@monomind/cli/dist/src/commands/ruvector/init.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/init.js +0 -466
- package/packages/@monomind/cli/dist/src/commands/ruvector/migrate.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/migrate.js +0 -497
- package/packages/@monomind/cli/dist/src/commands/ruvector/optimize.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/optimize.js +0 -504
- package/packages/@monomind/cli/dist/src/commands/ruvector/setup.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/ruvector/setup.js +0 -765
- package/packages/@monomind/cli/dist/src/commands/ruvector/status.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/status.js +0 -478
- package/packages/@monomind/cli/dist/src/commands/security.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/security.js +0 -794
- package/packages/@monomind/cli/dist/src/commands/session.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/session.js +0 -750
- package/packages/@monomind/cli/dist/src/commands/start.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/start.js +0 -418
- package/packages/@monomind/cli/dist/src/commands/status.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/status.js +0 -591
- package/packages/@monomind/cli/dist/src/commands/swarm.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/swarm.js +0 -801
- package/packages/@monomind/cli/dist/src/commands/task.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/task.js +0 -671
- package/packages/@monomind/cli/dist/src/commands/tokens.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/tokens.js +0 -107
- package/packages/@monomind/cli/dist/src/commands/transfer-store.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/commands/transfer-store.js +0 -428
- package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
- package/packages/@monomind/cli/dist/src/commands/update.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/update.js +0 -276
- package/packages/@monomind/cli/dist/src/commands/workflow.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/workflow.js +0 -617
- package/packages/@monomind/cli/dist/src/config-adapter.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/config-adapter.js +0 -186
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.d.ts +0 -50
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.js +0 -109
- package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
- package/packages/@monomind/cli/dist/src/consensus/vote-signer.d.ts +0 -39
- package/packages/@monomind/cli/dist/src/consensus/vote-signer.js +0 -63
- package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
- package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
- package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/index.js +0 -12
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
- package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -64
- package/packages/@monomind/cli/dist/src/dlq/dlq-replayer.d.ts +0 -20
- package/packages/@monomind/cli/dist/src/dlq/dlq-replayer.js +0 -56
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -43
- package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -97
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
- package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -82
- package/packages/@monomind/cli/dist/src/index.d.ts +0 -82
- package/packages/@monomind/cli/dist/src/index.js +0 -578
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
- package/packages/@monomind/cli/dist/src/init/claudemd-generator.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +0 -522
- package/packages/@monomind/cli/dist/src/init/executor.d.ts +0 -38
- package/packages/@monomind/cli/dist/src/init/executor.js +0 -1919
- package/packages/@monomind/cli/dist/src/init/helpers-generator.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/init/helpers-generator.js +0 -1222
- package/packages/@monomind/cli/dist/src/init/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/init/index.js +0 -15
- package/packages/@monomind/cli/dist/src/init/mcp-generator.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/init/mcp-generator.js +0 -99
- package/packages/@monomind/cli/dist/src/init/settings-generator.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -392
- package/packages/@monomind/cli/dist/src/init/statusline-generator.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/init/statusline-generator.js +0 -1157
- package/packages/@monomind/cli/dist/src/init/types.d.ts +0 -291
- package/packages/@monomind/cli/dist/src/init/types.js +0 -258
- package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -66
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -212
- package/packages/@monomind/cli/dist/src/mcp-client.d.ts +0 -92
- package/packages/@monomind/cli/dist/src/mcp-client.js +0 -261
- package/packages/@monomind/cli/dist/src/mcp-server.d.ts +0 -163
- package/packages/@monomind/cli/dist/src/mcp-server.js +0 -682
- package/packages/@monomind/cli/dist/src/mcp-tools/a2a-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/a2a-tools.js +0 -244
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +0 -564
- package/packages/@monomind/cli/dist/src/mcp-tools/agentdb-tools.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/mcp-tools/agentdb-tools.js +0 -569
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.d.ts +0 -38
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.js +0 -317
- package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.d.ts +0 -83
- package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.js +0 -131
- package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.js +0 -227
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +0 -550
- package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.js +0 -747
- package/packages/@monomind/cli/dist/src/mcp-tools/config-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/config-tools.js +0 -353
- package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.js +0 -673
- package/packages/@monomind/cli/dist/src/mcp-tools/daa-tools.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/daa-tools.js +0 -473
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +0 -782
- package/packages/@monomind/cli/dist/src/mcp-tools/github-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/github-tools.js +0 -472
- package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.d.ts +0 -73
- package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.js +0 -1235
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +0 -618
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +0 -877
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +0 -3397
- package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -38
- package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -40
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +0 -514
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +0 -634
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +0 -643
- package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.js +0 -348
- package/packages/@monomind/cli/dist/src/mcp-tools/request-tracker.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/request-tracker.js +0 -27
- package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.js +0 -284
- package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.js +0 -434
- package/packages/@monomind/cli/dist/src/mcp-tools/session-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/session-tools.js +0 -338
- package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.js +0 -289
- package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.js +0 -551
- package/packages/@monomind/cli/dist/src/mcp-tools/task-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/task-tools.js +0 -406
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.js +0 -260
- package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.js +0 -396
- package/packages/@monomind/cli/dist/src/mcp-tools/types.d.ts +0 -37
- package/packages/@monomind/cli/dist/src/mcp-tools/types.js +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
- package/packages/@monomind/cli/dist/src/mcp-tools/workflow-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/workflow-tools.js +0 -562
- package/packages/@monomind/cli/dist/src/memory/ewc-consolidation.d.ts +0 -295
- package/packages/@monomind/cli/dist/src/memory/ewc-consolidation.js +0 -601
- package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +0 -338
- package/packages/@monomind/cli/dist/src/memory/intelligence.js +0 -1023
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +0 -409
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +0 -1561
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.d.ts +0 -414
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +0 -2222
- package/packages/@monomind/cli/dist/src/memory/sona-optimizer.d.ts +0 -227
- package/packages/@monomind/cli/dist/src/memory/sona-optimizer.js +0 -633
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
- package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/model/index.js +0 -4
- package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
- package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -150
- package/packages/@monomind/cli/dist/src/output.d.ts +0 -133
- package/packages/@monomind/cli/dist/src/output.js +0 -514
- package/packages/@monomind/cli/dist/src/parser.d.ts +0 -51
- package/packages/@monomind/cli/dist/src/parser.js +0 -425
- package/packages/@monomind/cli/dist/src/plugins/manager.d.ts +0 -133
- package/packages/@monomind/cli/dist/src/plugins/manager.js +0 -400
- package/packages/@monomind/cli/dist/src/plugins/store/discovery.d.ts +0 -88
- package/packages/@monomind/cli/dist/src/plugins/store/discovery.js +0 -841
- package/packages/@monomind/cli/dist/src/plugins/store/index.d.ts +0 -76
- package/packages/@monomind/cli/dist/src/plugins/store/index.js +0 -141
- package/packages/@monomind/cli/dist/src/plugins/store/search.d.ts +0 -46
- package/packages/@monomind/cli/dist/src/plugins/store/search.js +0 -230
- package/packages/@monomind/cli/dist/src/plugins/store/types.d.ts +0 -274
- package/packages/@monomind/cli/dist/src/plugins/store/types.js +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.d.ts +0 -101
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.js +0 -241
- package/packages/@monomind/cli/dist/src/production/error-handler.d.ts +0 -92
- package/packages/@monomind/cli/dist/src/production/error-handler.js +0 -299
- package/packages/@monomind/cli/dist/src/production/index.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/production/index.js +0 -18
- package/packages/@monomind/cli/dist/src/production/monitoring.d.ts +0 -161
- package/packages/@monomind/cli/dist/src/production/monitoring.js +0 -356
- package/packages/@monomind/cli/dist/src/production/rate-limiter.d.ts +0 -80
- package/packages/@monomind/cli/dist/src/production/rate-limiter.js +0 -201
- package/packages/@monomind/cli/dist/src/production/retry.d.ts +0 -48
- package/packages/@monomind/cli/dist/src/production/retry.js +0 -179
- package/packages/@monomind/cli/dist/src/prompt.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/prompt.js +0 -501
- package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
- package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.d.ts +0 -182
- package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.js +0 -316
- package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.js +0 -277
- package/packages/@monomind/cli/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/packages/@monomind/cli/dist/src/ruvector/coverage-router.js +0 -529
- package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.js +0 -157
- package/packages/@monomind/cli/dist/src/ruvector/diff-classifier.d.ts +0 -175
- package/packages/@monomind/cli/dist/src/ruvector/diff-classifier.js +0 -698
- package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.js +0 -529
- package/packages/@monomind/cli/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/packages/@monomind/cli/dist/src/ruvector/flash-attention.js +0 -643
- package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.js +0 -929
- package/packages/@monomind/cli/dist/src/ruvector/index.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/ruvector/index.js +0 -76
- package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.js +0 -455
- package/packages/@monomind/cli/dist/src/ruvector/model-router.d.ts +0 -220
- package/packages/@monomind/cli/dist/src/ruvector/model-router.js +0 -488
- package/packages/@monomind/cli/dist/src/ruvector/moe-router.d.ts +0 -206
- package/packages/@monomind/cli/dist/src/ruvector/moe-router.js +0 -626
- package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.d.ts +0 -211
- package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.js +0 -681
- package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
- package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.js +0 -363
- package/packages/@monomind/cli/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/packages/@monomind/cli/dist/src/ruvector/semantic-router.js +0 -178
- package/packages/@monomind/cli/dist/src/ruvector/vector-db.d.ts +0 -69
- package/packages/@monomind/cli/dist/src/ruvector/vector-db.js +0 -243
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
- package/packages/@monomind/cli/dist/src/services/claim-service.d.ts +0 -204
- package/packages/@monomind/cli/dist/src/services/claim-service.js +0 -818
- package/packages/@monomind/cli/dist/src/services/config-file-manager.d.ts +0 -37
- package/packages/@monomind/cli/dist/src/services/config-file-manager.js +0 -224
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -583
- package/packages/@monomind/cli/dist/src/services/headless-worker-executor.d.ts +0 -304
- package/packages/@monomind/cli/dist/src/services/headless-worker-executor.js +0 -1024
- package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/services/index.js +0 -11
- package/packages/@monomind/cli/dist/src/services/registry-api.d.ts +0 -58
- package/packages/@monomind/cli/dist/src/services/registry-api.js +0 -146
- package/packages/@monomind/cli/dist/src/services/ruvector-training.d.ts +0 -222
- package/packages/@monomind/cli/dist/src/services/ruvector-training.js +0 -688
- package/packages/@monomind/cli/dist/src/services/worker-daemon.d.ts +0 -245
- package/packages/@monomind/cli/dist/src/services/worker-daemon.js +0 -999
- package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -194
- package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -513
- package/packages/@monomind/cli/dist/src/suggest.d.ts +0 -53
- package/packages/@monomind/cli/dist/src/suggest.js +0 -200
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -49
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -44
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.js +0 -175
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
- package/packages/@monomind/cli/dist/src/transfer/export.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/transfer/export.js +0 -113
- package/packages/@monomind/cli/dist/src/transfer/index.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/transfer/index.js +0 -31
- package/packages/@monomind/cli/dist/src/transfer/ipfs/client.d.ts +0 -109
- package/packages/@monomind/cli/dist/src/transfer/ipfs/client.js +0 -307
- package/packages/@monomind/cli/dist/src/transfer/ipfs/upload.d.ts +0 -95
- package/packages/@monomind/cli/dist/src/transfer/ipfs/upload.js +0 -411
- package/packages/@monomind/cli/dist/src/transfer/models/seraphine.d.ts +0 -72
- package/packages/@monomind/cli/dist/src/transfer/models/seraphine.js +0 -373
- package/packages/@monomind/cli/dist/src/transfer/serialization/cfp.d.ts +0 -49
- package/packages/@monomind/cli/dist/src/transfer/serialization/cfp.js +0 -183
- package/packages/@monomind/cli/dist/src/transfer/storage/gcs.d.ts +0 -82
- package/packages/@monomind/cli/dist/src/transfer/storage/gcs.js +0 -272
- package/packages/@monomind/cli/dist/src/transfer/storage/index.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/transfer/storage/index.js +0 -6
- package/packages/@monomind/cli/dist/src/transfer/store/discovery.d.ts +0 -84
- package/packages/@monomind/cli/dist/src/transfer/store/discovery.js +0 -382
- package/packages/@monomind/cli/dist/src/transfer/store/download.d.ts +0 -70
- package/packages/@monomind/cli/dist/src/transfer/store/download.js +0 -334
- package/packages/@monomind/cli/dist/src/transfer/store/index.d.ts +0 -84
- package/packages/@monomind/cli/dist/src/transfer/store/index.js +0 -153
- package/packages/@monomind/cli/dist/src/transfer/store/publish.d.ts +0 -76
- package/packages/@monomind/cli/dist/src/transfer/store/publish.js +0 -294
- package/packages/@monomind/cli/dist/src/transfer/store/registry.d.ts +0 -58
- package/packages/@monomind/cli/dist/src/transfer/store/registry.js +0 -285
- package/packages/@monomind/cli/dist/src/transfer/store/search.d.ts +0 -54
- package/packages/@monomind/cli/dist/src/transfer/store/search.js +0 -232
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
- package/packages/@monomind/cli/dist/src/transfer/store/types.d.ts +0 -193
- package/packages/@monomind/cli/dist/src/transfer/store/types.js +0 -6
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
- package/packages/@monomind/cli/dist/src/transfer/types.d.ts +0 -245
- package/packages/@monomind/cli/dist/src/transfer/types.js +0 -6
- package/packages/@monomind/cli/dist/src/types.d.ts +0 -198
- package/packages/@monomind/cli/dist/src/types.js +0 -38
- package/packages/@monomind/cli/dist/src/update/checker.d.ts +0 -34
- package/packages/@monomind/cli/dist/src/update/checker.js +0 -185
- package/packages/@monomind/cli/dist/src/update/executor.d.ts +0 -32
- package/packages/@monomind/cli/dist/src/update/executor.js +0 -181
- package/packages/@monomind/cli/dist/src/update/index.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/update/index.js +0 -64
- package/packages/@monomind/cli/dist/src/update/rate-limiter.d.ts +0 -20
- package/packages/@monomind/cli/dist/src/update/rate-limiter.js +0 -96
- package/packages/@monomind/cli/dist/src/update/validator.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/update/validator.js +0 -118
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -48
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -113
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -78
- package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -162
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -78
- package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -33
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -146
- package/packages/@monomind/cli/package.json +0 -105
- package/packages/@monomind/guidance/README.md +0 -1195
- package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
- package/packages/@monomind/guidance/dist/adversarial.js +0 -572
- package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
- package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
- package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
- package/packages/@monomind/guidance/dist/artifacts.js +0 -356
- package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
- package/packages/@monomind/guidance/dist/authority.js +0 -558
- package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
- package/packages/@monomind/guidance/dist/capabilities.js +0 -485
- package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
- package/packages/@monomind/guidance/dist/coherence.js +0 -372
- package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
- package/packages/@monomind/guidance/dist/compiler.js +0 -419
- package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
- package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
- package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
- package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
- package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
- package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
- package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
- package/packages/@monomind/guidance/dist/evolution.js +0 -500
- package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
- package/packages/@monomind/guidance/dist/gates.js +0 -302
- package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
- package/packages/@monomind/guidance/dist/gateway.js +0 -452
- package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
- package/packages/@monomind/guidance/dist/generators.js +0 -682
- package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
- package/packages/@monomind/guidance/dist/headless.js +0 -342
- package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
- package/packages/@monomind/guidance/dist/hooks.js +0 -347
- package/packages/@monomind/guidance/dist/index.d.ts +0 -205
- package/packages/@monomind/guidance/dist/index.js +0 -321
- package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
- package/packages/@monomind/guidance/dist/ledger.js +0 -375
- package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
- package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
- package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
- package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
- package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
- package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
- package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
- package/packages/@monomind/guidance/dist/optimizer.js +0 -329
- package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
- package/packages/@monomind/guidance/dist/persistence.js +0 -464
- package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
- package/packages/@monomind/guidance/dist/proof.js +0 -238
- package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
- package/packages/@monomind/guidance/dist/retriever.js +0 -394
- package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
- package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
- package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
- package/packages/@monomind/guidance/dist/temporal.js +0 -658
- package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
- package/packages/@monomind/guidance/dist/trust.js +0 -473
- package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
- package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
- package/packages/@monomind/guidance/dist/types.d.ts +0 -378
- package/packages/@monomind/guidance/dist/types.js +0 -10
- package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
- package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
- package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
- package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
- package/packages/@monomind/guidance/package.json +0 -198
- package/packages/@monomind/shared/README.md +0 -323
- package/packages/@monomind/shared/dist/agent-contract.d.ts +0 -28
- package/packages/@monomind/shared/dist/agent-contract.js +0 -57
- package/packages/@monomind/shared/dist/agent-error-result.d.ts +0 -17
- package/packages/@monomind/shared/dist/agent-error-result.js +0 -23
- package/packages/@monomind/shared/dist/core/config/defaults.d.ts +0 -41
- package/packages/@monomind/shared/dist/core/config/defaults.js +0 -186
- package/packages/@monomind/shared/dist/core/config/index.d.ts +0 -8
- package/packages/@monomind/shared/dist/core/config/index.js +0 -12
- package/packages/@monomind/shared/dist/core/config/loader.d.ts +0 -45
- package/packages/@monomind/shared/dist/core/config/loader.js +0 -238
- package/packages/@monomind/shared/dist/core/config/schema.d.ts +0 -324
- package/packages/@monomind/shared/dist/core/config/schema.js +0 -160
- package/packages/@monomind/shared/dist/core/config/validator.d.ts +0 -92
- package/packages/@monomind/shared/dist/core/config/validator.js +0 -147
- package/packages/@monomind/shared/dist/core/event-bus.d.ts +0 -31
- package/packages/@monomind/shared/dist/core/event-bus.js +0 -197
- package/packages/@monomind/shared/dist/core/index.d.ts +0 -15
- package/packages/@monomind/shared/dist/core/index.js +0 -19
- package/packages/@monomind/shared/dist/core/interfaces/agent.interface.d.ts +0 -200
- package/packages/@monomind/shared/dist/core/interfaces/agent.interface.js +0 -6
- package/packages/@monomind/shared/dist/core/interfaces/coordinator.interface.d.ts +0 -310
- package/packages/@monomind/shared/dist/core/interfaces/coordinator.interface.js +0 -7
- package/packages/@monomind/shared/dist/core/interfaces/event.interface.d.ts +0 -224
- package/packages/@monomind/shared/dist/core/interfaces/event.interface.js +0 -46
- package/packages/@monomind/shared/dist/core/interfaces/index.d.ts +0 -10
- package/packages/@monomind/shared/dist/core/interfaces/index.js +0 -15
- package/packages/@monomind/shared/dist/core/interfaces/memory.interface.d.ts +0 -298
- package/packages/@monomind/shared/dist/core/interfaces/memory.interface.js +0 -7
- package/packages/@monomind/shared/dist/core/interfaces/task.interface.d.ts +0 -185
- package/packages/@monomind/shared/dist/core/interfaces/task.interface.js +0 -6
- package/packages/@monomind/shared/dist/core/orchestrator/event-coordinator.d.ts +0 -35
- package/packages/@monomind/shared/dist/core/orchestrator/event-coordinator.js +0 -101
- package/packages/@monomind/shared/dist/core/orchestrator/health-monitor.d.ts +0 -60
- package/packages/@monomind/shared/dist/core/orchestrator/health-monitor.js +0 -166
- package/packages/@monomind/shared/dist/core/orchestrator/index.d.ts +0 -46
- package/packages/@monomind/shared/dist/core/orchestrator/index.js +0 -64
- package/packages/@monomind/shared/dist/core/orchestrator/lifecycle-manager.d.ts +0 -56
- package/packages/@monomind/shared/dist/core/orchestrator/lifecycle-manager.js +0 -195
- package/packages/@monomind/shared/dist/core/orchestrator/session-manager.d.ts +0 -83
- package/packages/@monomind/shared/dist/core/orchestrator/session-manager.js +0 -193
- package/packages/@monomind/shared/dist/core/orchestrator/task-manager.d.ts +0 -49
- package/packages/@monomind/shared/dist/core/orchestrator/task-manager.js +0 -253
- package/packages/@monomind/shared/dist/events/domain-events.d.ts +0 -282
- package/packages/@monomind/shared/dist/events/domain-events.js +0 -165
- package/packages/@monomind/shared/dist/events/event-store.d.ts +0 -126
- package/packages/@monomind/shared/dist/events/event-store.js +0 -416
- package/packages/@monomind/shared/dist/events/event-store.test.d.ts +0 -8
- package/packages/@monomind/shared/dist/events/event-store.test.js +0 -293
- package/packages/@monomind/shared/dist/events/example-usage.d.ts +0 -10
- package/packages/@monomind/shared/dist/events/example-usage.js +0 -193
- package/packages/@monomind/shared/dist/events/index.d.ts +0 -21
- package/packages/@monomind/shared/dist/events/index.js +0 -22
- package/packages/@monomind/shared/dist/events/projections.d.ts +0 -177
- package/packages/@monomind/shared/dist/events/projections.js +0 -421
- package/packages/@monomind/shared/dist/events/rvf-event-log.d.ts +0 -82
- package/packages/@monomind/shared/dist/events/rvf-event-log.js +0 -340
- package/packages/@monomind/shared/dist/events/state-reconstructor.d.ts +0 -101
- package/packages/@monomind/shared/dist/events/state-reconstructor.js +0 -263
- package/packages/@monomind/shared/dist/events.d.ts +0 -80
- package/packages/@monomind/shared/dist/events.js +0 -249
- package/packages/@monomind/shared/dist/hooks/example-usage.d.ts +0 -42
- package/packages/@monomind/shared/dist/hooks/example-usage.js +0 -351
- package/packages/@monomind/shared/dist/hooks/executor.d.ts +0 -100
- package/packages/@monomind/shared/dist/hooks/executor.js +0 -264
- package/packages/@monomind/shared/dist/hooks/hooks.test.d.ts +0 -9
- package/packages/@monomind/shared/dist/hooks/hooks.test.js +0 -322
- package/packages/@monomind/shared/dist/hooks/index.d.ts +0 -52
- package/packages/@monomind/shared/dist/hooks/index.js +0 -51
- package/packages/@monomind/shared/dist/hooks/registry.d.ts +0 -133
- package/packages/@monomind/shared/dist/hooks/registry.js +0 -277
- package/packages/@monomind/shared/dist/hooks/safety/bash-safety.d.ts +0 -105
- package/packages/@monomind/shared/dist/hooks/safety/bash-safety.js +0 -481
- package/packages/@monomind/shared/dist/hooks/safety/file-organization.d.ts +0 -144
- package/packages/@monomind/shared/dist/hooks/safety/file-organization.js +0 -328
- package/packages/@monomind/shared/dist/hooks/safety/git-commit.d.ts +0 -158
- package/packages/@monomind/shared/dist/hooks/safety/git-commit.js +0 -450
- package/packages/@monomind/shared/dist/hooks/safety/index.d.ts +0 -17
- package/packages/@monomind/shared/dist/hooks/safety/index.js +0 -17
- package/packages/@monomind/shared/dist/hooks/session-hooks.d.ts +0 -234
- package/packages/@monomind/shared/dist/hooks/session-hooks.js +0 -334
- package/packages/@monomind/shared/dist/hooks/task-hooks.d.ts +0 -163
- package/packages/@monomind/shared/dist/hooks/task-hooks.js +0 -326
- package/packages/@monomind/shared/dist/hooks/types.d.ts +0 -267
- package/packages/@monomind/shared/dist/hooks/types.js +0 -62
- package/packages/@monomind/shared/dist/hooks/verify-exports.test.d.ts +0 -9
- package/packages/@monomind/shared/dist/hooks/verify-exports.test.js +0 -93
- package/packages/@monomind/shared/dist/index.d.ts +0 -46
- package/packages/@monomind/shared/dist/index.js +0 -77
- package/packages/@monomind/shared/dist/mcp/connection-pool.d.ts +0 -98
- package/packages/@monomind/shared/dist/mcp/connection-pool.js +0 -364
- package/packages/@monomind/shared/dist/mcp/index.d.ts +0 -69
- package/packages/@monomind/shared/dist/mcp/index.js +0 -84
- package/packages/@monomind/shared/dist/mcp/server.d.ts +0 -166
- package/packages/@monomind/shared/dist/mcp/server.js +0 -593
- package/packages/@monomind/shared/dist/mcp/session-manager.d.ts +0 -136
- package/packages/@monomind/shared/dist/mcp/session-manager.js +0 -335
- package/packages/@monomind/shared/dist/mcp/tool-registry.d.ts +0 -178
- package/packages/@monomind/shared/dist/mcp/tool-registry.js +0 -439
- package/packages/@monomind/shared/dist/mcp/transport/http.d.ts +0 -104
- package/packages/@monomind/shared/dist/mcp/transport/http.js +0 -476
- package/packages/@monomind/shared/dist/mcp/transport/index.d.ts +0 -102
- package/packages/@monomind/shared/dist/mcp/transport/index.js +0 -238
- package/packages/@monomind/shared/dist/mcp/transport/stdio.d.ts +0 -104
- package/packages/@monomind/shared/dist/mcp/transport/stdio.js +0 -263
- package/packages/@monomind/shared/dist/mcp/transport/websocket.d.ts +0 -133
- package/packages/@monomind/shared/dist/mcp/transport/websocket.js +0 -396
- package/packages/@monomind/shared/dist/mcp/types.d.ts +0 -438
- package/packages/@monomind/shared/dist/mcp/types.js +0 -54
- package/packages/@monomind/shared/dist/plugin-interface.d.ts +0 -544
- package/packages/@monomind/shared/dist/plugin-interface.js +0 -23
- package/packages/@monomind/shared/dist/plugin-loader.d.ts +0 -139
- package/packages/@monomind/shared/dist/plugin-loader.js +0 -434
- package/packages/@monomind/shared/dist/plugin-registry.d.ts +0 -183
- package/packages/@monomind/shared/dist/plugin-registry.js +0 -457
- package/packages/@monomind/shared/dist/plugins/index.d.ts +0 -10
- package/packages/@monomind/shared/dist/plugins/index.js +0 -10
- package/packages/@monomind/shared/dist/plugins/official/hive-mind-plugin.d.ts +0 -106
- package/packages/@monomind/shared/dist/plugins/official/hive-mind-plugin.js +0 -241
- package/packages/@monomind/shared/dist/plugins/official/index.d.ts +0 -10
- package/packages/@monomind/shared/dist/plugins/official/index.js +0 -10
- package/packages/@monomind/shared/dist/plugins/official/maestro-plugin.d.ts +0 -121
- package/packages/@monomind/shared/dist/plugins/official/maestro-plugin.js +0 -355
- package/packages/@monomind/shared/dist/plugins/types.d.ts +0 -93
- package/packages/@monomind/shared/dist/plugins/types.js +0 -9
- package/packages/@monomind/shared/dist/reducers.d.ts +0 -33
- package/packages/@monomind/shared/dist/reducers.js +0 -89
- package/packages/@monomind/shared/dist/resilience/bulkhead.d.ts +0 -105
- package/packages/@monomind/shared/dist/resilience/bulkhead.js +0 -206
- package/packages/@monomind/shared/dist/resilience/circuit-breaker.d.ts +0 -132
- package/packages/@monomind/shared/dist/resilience/circuit-breaker.js +0 -233
- package/packages/@monomind/shared/dist/resilience/index.d.ts +0 -19
- package/packages/@monomind/shared/dist/resilience/index.js +0 -19
- package/packages/@monomind/shared/dist/resilience/rate-limiter.d.ts +0 -168
- package/packages/@monomind/shared/dist/resilience/rate-limiter.js +0 -314
- package/packages/@monomind/shared/dist/resilience/retry.d.ts +0 -91
- package/packages/@monomind/shared/dist/resilience/retry.js +0 -159
- package/packages/@monomind/shared/dist/retry-policy.d.ts +0 -14
- package/packages/@monomind/shared/dist/retry-policy.js +0 -23
- package/packages/@monomind/shared/dist/retry-runner.d.ts +0 -21
- package/packages/@monomind/shared/dist/retry-runner.js +0 -57
- package/packages/@monomind/shared/dist/schema-validator.d.ts +0 -46
- package/packages/@monomind/shared/dist/schema-validator.js +0 -133
- package/packages/@monomind/shared/dist/scratchpad.d.ts +0 -23
- package/packages/@monomind/shared/dist/scratchpad.js +0 -32
- package/packages/@monomind/shared/dist/security/index.d.ts +0 -10
- package/packages/@monomind/shared/dist/security/index.js +0 -12
- package/packages/@monomind/shared/dist/security/input-validation.d.ts +0 -73
- package/packages/@monomind/shared/dist/security/input-validation.js +0 -201
- package/packages/@monomind/shared/dist/security/secure-random.d.ts +0 -92
- package/packages/@monomind/shared/dist/security/secure-random.js +0 -142
- package/packages/@monomind/shared/dist/services/index.d.ts +0 -7
- package/packages/@monomind/shared/dist/services/index.js +0 -7
- package/packages/@monomind/shared/dist/services/progress.service.d.ts +0 -124
- package/packages/@monomind/shared/dist/services/progress.service.js +0 -402
- package/packages/@monomind/shared/dist/state-manager.d.ts +0 -34
- package/packages/@monomind/shared/dist/state-manager.js +0 -73
- package/packages/@monomind/shared/dist/state-validator.d.ts +0 -20
- package/packages/@monomind/shared/dist/state-validator.js +0 -49
- package/packages/@monomind/shared/dist/swarm-state.d.ts +0 -52
- package/packages/@monomind/shared/dist/swarm-state.js +0 -18
- package/packages/@monomind/shared/dist/testing/fixture-builder.d.ts +0 -14
- package/packages/@monomind/shared/dist/testing/fixture-builder.js +0 -32
- package/packages/@monomind/shared/dist/testing/index.d.ts +0 -2
- package/packages/@monomind/shared/dist/testing/index.js +0 -2
- package/packages/@monomind/shared/dist/testing/test-model.d.ts +0 -29
- package/packages/@monomind/shared/dist/testing/test-model.js +0 -53
- package/packages/@monomind/shared/dist/types/agent-registry.d.ts +0 -62
- package/packages/@monomind/shared/dist/types/agent-registry.js +0 -8
- package/packages/@monomind/shared/dist/types/agent-version.d.ts +0 -49
- package/packages/@monomind/shared/dist/types/agent-version.js +0 -7
- package/packages/@monomind/shared/dist/types/agent.types.d.ts +0 -137
- package/packages/@monomind/shared/dist/types/agent.types.js +0 -6
- package/packages/@monomind/shared/dist/types/benchmark.d.ts +0 -39
- package/packages/@monomind/shared/dist/types/benchmark.js +0 -6
- package/packages/@monomind/shared/dist/types/communication-flow.d.ts +0 -25
- package/packages/@monomind/shared/dist/types/communication-flow.js +0 -7
- package/packages/@monomind/shared/dist/types/consensus-audit.d.ts +0 -38
- package/packages/@monomind/shared/dist/types/consensus-audit.js +0 -7
- package/packages/@monomind/shared/dist/types/dlq.d.ts +0 -40
- package/packages/@monomind/shared/dist/types/dlq.js +0 -7
- package/packages/@monomind/shared/dist/types/eval.d.ts +0 -59
- package/packages/@monomind/shared/dist/types/eval.js +0 -6
- package/packages/@monomind/shared/dist/types/index.d.ts +0 -19
- package/packages/@monomind/shared/dist/types/index.js +0 -33
- package/packages/@monomind/shared/dist/types/mcp.types.d.ts +0 -266
- package/packages/@monomind/shared/dist/types/mcp.types.js +0 -7
- package/packages/@monomind/shared/dist/types/memory.types.d.ts +0 -236
- package/packages/@monomind/shared/dist/types/memory.types.js +0 -7
- package/packages/@monomind/shared/dist/types/retry.d.ts +0 -72
- package/packages/@monomind/shared/dist/types/retry.js +0 -40
- package/packages/@monomind/shared/dist/types/specialization.d.ts +0 -27
- package/packages/@monomind/shared/dist/types/specialization.js +0 -8
- package/packages/@monomind/shared/dist/types/swarm.types.d.ts +0 -186
- package/packages/@monomind/shared/dist/types/swarm.types.js +0 -65
- package/packages/@monomind/shared/dist/types/task.types.d.ts +0 -178
- package/packages/@monomind/shared/dist/types/task.types.js +0 -32
- package/packages/@monomind/shared/dist/types/termination.d.ts +0 -29
- package/packages/@monomind/shared/dist/types/termination.js +0 -14
- package/packages/@monomind/shared/dist/types/tool-version.d.ts +0 -41
- package/packages/@monomind/shared/dist/types/tool-version.js +0 -8
- package/packages/@monomind/shared/dist/types/trigger.d.ts +0 -40
- package/packages/@monomind/shared/dist/types/trigger.js +0 -8
- package/packages/@monomind/shared/dist/types.d.ts +0 -197
- package/packages/@monomind/shared/dist/types.js +0 -21
- package/packages/@monomind/shared/dist/utils/secure-logger.d.ts +0 -69
- package/packages/@monomind/shared/dist/utils/secure-logger.js +0 -208
- package/packages/@monomind/shared/package.json +0 -42
- package/packages/README.md +0 -514
|
@@ -1,2048 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Analyze Command
|
|
3
|
-
* Code analysis, diff classification, AST analysis, and change risk assessment
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - AST analysis using ruvector (tree-sitter) with graceful fallback
|
|
7
|
-
* - Symbol extraction (functions, classes, variables, types)
|
|
8
|
-
* - Cyclomatic complexity scoring
|
|
9
|
-
* - Diff classification and risk assessment
|
|
10
|
-
* - Graph boundaries using MinCut algorithm
|
|
11
|
-
* - Module communities using Louvain algorithm
|
|
12
|
-
* - Circular dependency detection
|
|
13
|
-
*
|
|
14
|
-
* github.com/nokhodian/monomind
|
|
15
|
-
*/
|
|
16
|
-
import { output } from '../output.js';
|
|
17
|
-
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
18
|
-
import * as path from 'path';
|
|
19
|
-
import * as fs from 'fs/promises';
|
|
20
|
-
import { writeFile } from 'fs/promises';
|
|
21
|
-
import { resolve } from 'path';
|
|
22
|
-
import { execSync } from 'child_process';
|
|
23
|
-
// Dynamic import for AST analyzer
|
|
24
|
-
async function getASTAnalyzer() {
|
|
25
|
-
try {
|
|
26
|
-
return await import('../ruvector/ast-analyzer.js');
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// Dynamic import for graph analyzer
|
|
33
|
-
async function getGraphAnalyzer() {
|
|
34
|
-
try {
|
|
35
|
-
return await import('../ruvector/graph-analyzer.js');
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Diff subcommand
|
|
42
|
-
const diffCommand = {
|
|
43
|
-
name: 'diff',
|
|
44
|
-
description: 'Analyze git diff for change risk assessment and classification',
|
|
45
|
-
options: [
|
|
46
|
-
{
|
|
47
|
-
name: 'risk',
|
|
48
|
-
short: 'r',
|
|
49
|
-
description: 'Show risk assessment',
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'classify',
|
|
55
|
-
short: 'c',
|
|
56
|
-
description: 'Classify change type',
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'reviewers',
|
|
62
|
-
description: 'Show recommended reviewers',
|
|
63
|
-
type: 'boolean',
|
|
64
|
-
default: false,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'format',
|
|
68
|
-
short: 'f',
|
|
69
|
-
description: 'Output format: text, json, table',
|
|
70
|
-
type: 'string',
|
|
71
|
-
default: 'text',
|
|
72
|
-
choices: ['text', 'json', 'table'],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'verbose',
|
|
76
|
-
short: 'v',
|
|
77
|
-
description: 'Show detailed file-level analysis',
|
|
78
|
-
type: 'boolean',
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
examples: [
|
|
83
|
-
{ command: 'monomind analyze diff --risk', description: 'Analyze current diff with risk assessment' },
|
|
84
|
-
{ command: 'monomind analyze diff HEAD~1 --classify', description: 'Classify changes from last commit' },
|
|
85
|
-
{ command: 'monomind analyze diff main..feature --format json', description: 'Compare branches with JSON output' },
|
|
86
|
-
{ command: 'monomind analyze diff --reviewers', description: 'Get recommended reviewers for changes' },
|
|
87
|
-
],
|
|
88
|
-
action: async (ctx) => {
|
|
89
|
-
const ref = ctx.args[0] || 'HEAD';
|
|
90
|
-
const showRisk = ctx.flags.risk;
|
|
91
|
-
const showClassify = ctx.flags.classify;
|
|
92
|
-
const showReviewers = ctx.flags.reviewers;
|
|
93
|
-
const formatType = ctx.flags.format || 'text';
|
|
94
|
-
const verbose = ctx.flags.verbose;
|
|
95
|
-
// If no specific flag, show all
|
|
96
|
-
const showAll = !showRisk && !showClassify && !showReviewers;
|
|
97
|
-
output.printInfo(`Analyzing diff: ${output.highlight(ref)}`);
|
|
98
|
-
try {
|
|
99
|
-
// Call MCP tool for diff analysis
|
|
100
|
-
const result = await callMCPTool('analyze_diff', {
|
|
101
|
-
ref,
|
|
102
|
-
includeFileRisks: verbose,
|
|
103
|
-
includeReviewers: showReviewers || showAll,
|
|
104
|
-
});
|
|
105
|
-
// JSON output
|
|
106
|
-
if (formatType === 'json') {
|
|
107
|
-
output.printJson(result);
|
|
108
|
-
return { success: true, data: result };
|
|
109
|
-
}
|
|
110
|
-
output.writeln();
|
|
111
|
-
// Summary box
|
|
112
|
-
const files = result.files || [];
|
|
113
|
-
const risk = result.risk || { overall: 'unknown', score: 0, breakdown: { fileCount: 0, totalChanges: 0, highRiskFiles: [], securityConcerns: [], breakingChanges: [], testCoverage: 'unknown' } };
|
|
114
|
-
const classification = result.classification || { category: 'unknown', confidence: 0, reasoning: '' };
|
|
115
|
-
output.printBox([
|
|
116
|
-
`Ref: ${result.ref || 'HEAD'}`,
|
|
117
|
-
`Files: ${files.length}`,
|
|
118
|
-
`Risk: ${getRiskDisplay(risk.overall)} (${risk.score}/100)`,
|
|
119
|
-
`Type: ${classification.category}${classification.subcategory ? ` (${classification.subcategory})` : ''}`,
|
|
120
|
-
``,
|
|
121
|
-
result.summary || 'No summary available',
|
|
122
|
-
].join('\n'), 'Diff Analysis');
|
|
123
|
-
// Risk assessment
|
|
124
|
-
if (showRisk || showAll) {
|
|
125
|
-
output.writeln();
|
|
126
|
-
output.writeln(output.bold('Risk Assessment'));
|
|
127
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
128
|
-
output.printTable({
|
|
129
|
-
columns: [
|
|
130
|
-
{ key: 'metric', header: 'Metric', width: 25 },
|
|
131
|
-
{ key: 'value', header: 'Value', width: 30 },
|
|
132
|
-
],
|
|
133
|
-
data: [
|
|
134
|
-
{ metric: 'Overall Risk', value: getRiskDisplay(risk.overall) },
|
|
135
|
-
{ metric: 'Risk Score', value: `${risk.score}/100` },
|
|
136
|
-
{ metric: 'Files Changed', value: risk.breakdown.fileCount },
|
|
137
|
-
{ metric: 'Total Lines Changed', value: risk.breakdown.totalChanges },
|
|
138
|
-
{ metric: 'Test Coverage', value: risk.breakdown.testCoverage },
|
|
139
|
-
],
|
|
140
|
-
});
|
|
141
|
-
// Security concerns
|
|
142
|
-
if (risk.breakdown.securityConcerns.length > 0) {
|
|
143
|
-
output.writeln();
|
|
144
|
-
output.writeln(output.bold(output.warning('Security Concerns')));
|
|
145
|
-
output.printList(risk.breakdown.securityConcerns.map(c => output.warning(c)));
|
|
146
|
-
}
|
|
147
|
-
// Breaking changes
|
|
148
|
-
if (risk.breakdown.breakingChanges.length > 0) {
|
|
149
|
-
output.writeln();
|
|
150
|
-
output.writeln(output.bold(output.error('Potential Breaking Changes')));
|
|
151
|
-
output.printList(risk.breakdown.breakingChanges.map(c => output.error(c)));
|
|
152
|
-
}
|
|
153
|
-
// High risk files
|
|
154
|
-
if (risk.breakdown.highRiskFiles.length > 0) {
|
|
155
|
-
output.writeln();
|
|
156
|
-
output.writeln(output.bold('High Risk Files'));
|
|
157
|
-
output.printList(risk.breakdown.highRiskFiles.map(f => output.warning(f)));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
// Classification
|
|
161
|
-
if (showClassify || showAll) {
|
|
162
|
-
output.writeln();
|
|
163
|
-
output.writeln(output.bold('Classification'));
|
|
164
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
165
|
-
output.printTable({
|
|
166
|
-
columns: [
|
|
167
|
-
{ key: 'field', header: 'Field', width: 15 },
|
|
168
|
-
{ key: 'value', header: 'Value', width: 40 },
|
|
169
|
-
],
|
|
170
|
-
data: [
|
|
171
|
-
{ field: 'Category', value: classification.category },
|
|
172
|
-
{ field: 'Subcategory', value: classification.subcategory || '-' },
|
|
173
|
-
{ field: 'Confidence', value: `${(classification.confidence * 100).toFixed(0)}%` },
|
|
174
|
-
],
|
|
175
|
-
});
|
|
176
|
-
output.writeln();
|
|
177
|
-
output.writeln(output.dim(`Reasoning: ${classification.reasoning}`));
|
|
178
|
-
}
|
|
179
|
-
// Reviewers
|
|
180
|
-
if (showReviewers || showAll) {
|
|
181
|
-
output.writeln();
|
|
182
|
-
output.writeln(output.bold('Recommended Reviewers'));
|
|
183
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
184
|
-
const reviewers = result.recommendedReviewers || [];
|
|
185
|
-
if (reviewers.length > 0) {
|
|
186
|
-
output.printNumberedList(reviewers.map(r => output.highlight(r)));
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
output.writeln(output.dim('No specific reviewers recommended'));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
// Verbose file-level details
|
|
193
|
-
if (verbose && result.fileRisks) {
|
|
194
|
-
output.writeln();
|
|
195
|
-
output.writeln(output.bold('File-Level Analysis'));
|
|
196
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
197
|
-
output.printTable({
|
|
198
|
-
columns: [
|
|
199
|
-
{ key: 'path', header: 'File', width: 40 },
|
|
200
|
-
{ key: 'risk', header: 'Risk', width: 12, format: (v) => getRiskDisplay(String(v)) },
|
|
201
|
-
{ key: 'score', header: 'Score', width: 8, align: 'right' },
|
|
202
|
-
{ key: 'reasons', header: 'Reasons', width: 30, format: (v) => {
|
|
203
|
-
const reasons = v;
|
|
204
|
-
return reasons.slice(0, 2).join('; ');
|
|
205
|
-
} },
|
|
206
|
-
],
|
|
207
|
-
data: result.fileRisks,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
// Files changed table
|
|
211
|
-
if (formatType === 'table' || showAll) {
|
|
212
|
-
output.writeln();
|
|
213
|
-
output.writeln(output.bold('Files Changed'));
|
|
214
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
215
|
-
output.printTable({
|
|
216
|
-
columns: [
|
|
217
|
-
{ key: 'status', header: 'Status', width: 10, format: (v) => getStatusDisplay(String(v)) },
|
|
218
|
-
{ key: 'path', header: 'File', width: 45 },
|
|
219
|
-
{ key: 'additions', header: '+', width: 8, align: 'right', format: (v) => output.success(`+${v}`) },
|
|
220
|
-
{ key: 'deletions', header: '-', width: 8, align: 'right', format: (v) => output.error(`-${v}`) },
|
|
221
|
-
],
|
|
222
|
-
data: files.slice(0, 20),
|
|
223
|
-
});
|
|
224
|
-
if (files.length > 20) {
|
|
225
|
-
output.writeln(output.dim(` ... and ${files.length - 20} more files`));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return { success: true, data: result };
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
if (error instanceof MCPClientError) {
|
|
232
|
-
output.printError(`Diff analysis failed: ${error.message}`);
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
236
|
-
}
|
|
237
|
-
return { success: false, exitCode: 1 };
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
// Code subcommand (placeholder for future code analysis)
|
|
242
|
-
const codeCommand = {
|
|
243
|
-
name: 'code',
|
|
244
|
-
description: 'Static code analysis and quality assessment',
|
|
245
|
-
options: [
|
|
246
|
-
{ name: 'path', short: 'p', type: 'string', description: 'Path to analyze', default: '.' },
|
|
247
|
-
{ name: 'type', short: 't', type: 'string', description: 'Analysis type: quality, complexity, security', default: 'quality' },
|
|
248
|
-
{ name: 'format', short: 'f', type: 'string', description: 'Output format: text, json', default: 'text' },
|
|
249
|
-
],
|
|
250
|
-
examples: [
|
|
251
|
-
{ command: 'monomind analyze code -p ./src', description: 'Analyze source directory' },
|
|
252
|
-
{ command: 'monomind analyze code --type complexity', description: 'Run complexity analysis' },
|
|
253
|
-
],
|
|
254
|
-
action: async (ctx) => {
|
|
255
|
-
const targetPath = resolve(ctx.flags.path || '.');
|
|
256
|
-
const analysisType = ctx.flags.type || 'quality';
|
|
257
|
-
const formatJson = ctx.flags.format === 'json';
|
|
258
|
-
output.writeln();
|
|
259
|
-
output.writeln(output.bold('Code Analysis'));
|
|
260
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
261
|
-
const spinner = output.createSpinner({ text: `Analyzing ${targetPath}...`, spinner: 'dots' });
|
|
262
|
-
spinner.start();
|
|
263
|
-
try {
|
|
264
|
-
const files = await scanSourceFiles(targetPath);
|
|
265
|
-
if (files.length === 0) {
|
|
266
|
-
spinner.stop();
|
|
267
|
-
output.printWarning('No source files found');
|
|
268
|
-
return { success: true };
|
|
269
|
-
}
|
|
270
|
-
const fileStats = [];
|
|
271
|
-
for (const filePath of files) {
|
|
272
|
-
const content = await fs.readFile(filePath, 'utf-8');
|
|
273
|
-
const lines = content.split('\n');
|
|
274
|
-
const nonEmpty = lines.filter(l => l.trim().length > 0 && !/^\s*(\/\/|\/\*|\*\s|#)/.test(l)).length;
|
|
275
|
-
const todos = (content.match(/\b(TODO|FIXME|HACK|XXX)\b/gi) || []).length;
|
|
276
|
-
const fns = (content.match(/(?:export\s+)?(?:async\s+)?function\s+\w+|(?:const|let|var)\s+\w+\s*=\s*(?:async\s+)?\([^)]*\)\s*=>/g) || []).length;
|
|
277
|
-
const imps = (content.match(/^import\s+/gm) || []).length + (content.match(/require\s*\(/g) || []).length;
|
|
278
|
-
let maxNesting = 0;
|
|
279
|
-
let nesting = 0;
|
|
280
|
-
for (const line of lines) {
|
|
281
|
-
nesting += (line.match(/\{/g) || []).length;
|
|
282
|
-
nesting -= (line.match(/\}/g) || []).length;
|
|
283
|
-
if (nesting > maxNesting)
|
|
284
|
-
maxNesting = nesting;
|
|
285
|
-
}
|
|
286
|
-
const securityIssues = [];
|
|
287
|
-
if (/\beval\s*\(/.test(content))
|
|
288
|
-
securityIssues.push('eval()');
|
|
289
|
-
if (/\bexec\s*\(/.test(content))
|
|
290
|
-
securityIssues.push('exec()');
|
|
291
|
-
if (/\.innerHTML\s*=/.test(content))
|
|
292
|
-
securityIssues.push('innerHTML');
|
|
293
|
-
if (/dangerouslySetInnerHTML/.test(content))
|
|
294
|
-
securityIssues.push('dangerouslySetInnerHTML');
|
|
295
|
-
if (/['"](?:password|secret|api[_-]?key|token)\s*[:=]\s*['"][^'"]{3,}['"]/i.test(content))
|
|
296
|
-
securityIssues.push('hardcoded secret');
|
|
297
|
-
if (/new\s+Function\s*\(/.test(content))
|
|
298
|
-
securityIssues.push('new Function()');
|
|
299
|
-
fileStats.push({
|
|
300
|
-
file: filePath,
|
|
301
|
-
loc: nonEmpty,
|
|
302
|
-
todos,
|
|
303
|
-
functions: fns,
|
|
304
|
-
imports: imps,
|
|
305
|
-
maxNesting,
|
|
306
|
-
securityIssues,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
spinner.stop();
|
|
310
|
-
const totalLoc = fileStats.reduce((s, f) => s + f.loc, 0);
|
|
311
|
-
const totalTodos = fileStats.reduce((s, f) => s + f.todos, 0);
|
|
312
|
-
const totalFunctions = fileStats.reduce((s, f) => s + f.functions, 0);
|
|
313
|
-
const totalImports = fileStats.reduce((s, f) => s + f.imports, 0);
|
|
314
|
-
const avgFileSize = Math.round(totalLoc / files.length);
|
|
315
|
-
const longestFile = fileStats.reduce((a, b) => a.loc > b.loc ? a : b);
|
|
316
|
-
const avgFnPerFile = (totalFunctions / files.length).toFixed(1);
|
|
317
|
-
const deepestNesting = fileStats.reduce((a, b) => a.maxNesting > b.maxNesting ? a : b);
|
|
318
|
-
const allSecurityIssues = fileStats.filter(f => f.securityIssues.length > 0);
|
|
319
|
-
if (formatJson) {
|
|
320
|
-
const jsonData = { type: analysisType, path: targetPath, files: files.length, totalLoc, totalTodos, totalFunctions, totalImports, avgFileSize, fileStats: fileStats.map(f => ({ relativePath: path.relative(targetPath, f.file), loc: f.loc, todos: f.todos, functions: f.functions, imports: f.imports, maxNesting: f.maxNesting, securityIssues: f.securityIssues })) };
|
|
321
|
-
output.printJson(jsonData);
|
|
322
|
-
return { success: true, data: jsonData };
|
|
323
|
-
}
|
|
324
|
-
if (analysisType === 'quality') {
|
|
325
|
-
output.printBox([`Files: ${files.length}`, `Lines of Code: ${totalLoc.toLocaleString()}`, `Avg File Size: ${avgFileSize} LOC`, `TODO/FIXME: ${totalTodos}`, `Functions: ${totalFunctions}`, `Imports: ${totalImports}`].join('\n'), 'Quality Summary');
|
|
326
|
-
output.writeln();
|
|
327
|
-
output.writeln(output.bold('Largest Files'));
|
|
328
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
329
|
-
const top10 = [...fileStats].sort((a, b) => b.loc - a.loc).slice(0, 10);
|
|
330
|
-
output.printTable({
|
|
331
|
-
columns: [
|
|
332
|
-
{ key: 'file', header: 'File', width: 45 },
|
|
333
|
-
{ key: 'loc', header: 'LOC', width: 8, align: 'right' },
|
|
334
|
-
{ key: 'fns', header: 'Fns', width: 6, align: 'right' },
|
|
335
|
-
{ key: 'todos', header: 'TODOs', width: 7, align: 'right' },
|
|
336
|
-
],
|
|
337
|
-
data: top10.map(f => ({ file: path.relative(targetPath, f.file), loc: f.loc, fns: f.functions, todos: f.todos })),
|
|
338
|
-
});
|
|
339
|
-
if (totalTodos > 0) {
|
|
340
|
-
output.writeln();
|
|
341
|
-
output.printWarning(`${totalTodos} TODO/FIXME comments found across ${fileStats.filter(f => f.todos > 0).length} files`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
else if (analysisType === 'complexity') {
|
|
345
|
-
output.printBox([`Files: ${files.length}`, `Total Functions: ${totalFunctions}`, `Avg Functions/File: ${avgFnPerFile}`, `Deepest Nesting: ${deepestNesting.maxNesting} levels (${path.relative(targetPath, deepestNesting.file)})`, `Longest File: ${longestFile.loc} LOC (${path.relative(targetPath, longestFile.file)})`].join('\n'), 'Complexity Summary');
|
|
346
|
-
output.writeln();
|
|
347
|
-
output.writeln(output.bold('High Complexity Files (nesting > 5)'));
|
|
348
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
349
|
-
const complex = fileStats.filter(f => f.maxNesting > 5).sort((a, b) => b.maxNesting - a.maxNesting);
|
|
350
|
-
if (complex.length === 0) {
|
|
351
|
-
output.printSuccess('No files with excessive nesting detected');
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
output.printTable({
|
|
355
|
-
columns: [
|
|
356
|
-
{ key: 'file', header: 'File', width: 45 },
|
|
357
|
-
{ key: 'nesting', header: 'Max Nest', width: 10, align: 'right' },
|
|
358
|
-
{ key: 'fns', header: 'Fns', width: 6, align: 'right' },
|
|
359
|
-
{ key: 'loc', header: 'LOC', width: 8, align: 'right' },
|
|
360
|
-
],
|
|
361
|
-
data: complex.slice(0, 15).map(f => ({ file: path.relative(targetPath, f.file), nesting: f.maxNesting, fns: f.functions, loc: f.loc })),
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
else if (analysisType === 'security') {
|
|
366
|
-
output.printBox([`Files Scanned: ${files.length}`, `Files with Issues: ${allSecurityIssues.length}`, `Total Issues: ${allSecurityIssues.reduce((s, f) => s + f.securityIssues.length, 0)}`].join('\n'), 'Security Summary');
|
|
367
|
-
if (allSecurityIssues.length === 0) {
|
|
368
|
-
output.writeln();
|
|
369
|
-
output.printSuccess('No common security patterns detected');
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
output.writeln();
|
|
373
|
-
output.writeln(output.bold('Security Concerns'));
|
|
374
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
375
|
-
output.printTable({
|
|
376
|
-
columns: [
|
|
377
|
-
{ key: 'file', header: 'File', width: 40 },
|
|
378
|
-
{ key: 'issues', header: 'Issues', width: 35 },
|
|
379
|
-
],
|
|
380
|
-
data: allSecurityIssues.map(f => ({ file: path.relative(targetPath, f.file), issues: f.securityIssues.join(', ') })),
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
output.printWarning(`Unknown analysis type: ${analysisType}. Use quality, complexity, or security.`);
|
|
386
|
-
}
|
|
387
|
-
return { success: true };
|
|
388
|
-
}
|
|
389
|
-
catch (error) {
|
|
390
|
-
spinner.stop();
|
|
391
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
392
|
-
output.printError(`Code analysis failed: ${message}`);
|
|
393
|
-
return { success: false, exitCode: 1 };
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
};
|
|
397
|
-
// ============================================================================
|
|
398
|
-
// AST Analysis Subcommands (using ruvector tree-sitter with fallback)
|
|
399
|
-
// ============================================================================
|
|
400
|
-
/**
|
|
401
|
-
* Helper: Truncate file path for display
|
|
402
|
-
*/
|
|
403
|
-
function truncatePathAst(filePath, maxLen = 45) {
|
|
404
|
-
if (filePath.length <= maxLen)
|
|
405
|
-
return filePath;
|
|
406
|
-
return '...' + filePath.slice(-(maxLen - 3));
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Helper: Format complexity value with color coding
|
|
410
|
-
*/
|
|
411
|
-
function formatComplexityValueAst(value) {
|
|
412
|
-
if (value <= 5)
|
|
413
|
-
return output.success(String(value));
|
|
414
|
-
if (value <= 10)
|
|
415
|
-
return output.warning(String(value));
|
|
416
|
-
return output.error(String(value));
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Helper: Get type marker for symbols
|
|
420
|
-
*/
|
|
421
|
-
function getTypeMarkerAst(type) {
|
|
422
|
-
switch (type) {
|
|
423
|
-
case 'function': return output.success('fn');
|
|
424
|
-
case 'class': return output.info('class');
|
|
425
|
-
case 'variable': return output.dim('var');
|
|
426
|
-
case 'type': return output.highlight('type');
|
|
427
|
-
case 'interface': return output.highlight('iface');
|
|
428
|
-
default: return output.dim(type.slice(0, 5));
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Helper: Get complexity rating text
|
|
433
|
-
*/
|
|
434
|
-
function getComplexityRatingAst(value) {
|
|
435
|
-
if (value <= 5)
|
|
436
|
-
return output.success('Simple');
|
|
437
|
-
if (value <= 10)
|
|
438
|
-
return output.warning('Moderate');
|
|
439
|
-
if (value <= 20)
|
|
440
|
-
return output.error('Complex');
|
|
441
|
-
return output.error(output.bold('Very Complex'));
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* AST analysis subcommand
|
|
445
|
-
*/
|
|
446
|
-
const astCommand = {
|
|
447
|
-
name: 'ast',
|
|
448
|
-
description: 'Analyze code using AST parsing (tree-sitter via ruvector)',
|
|
449
|
-
options: [
|
|
450
|
-
{
|
|
451
|
-
name: 'complexity',
|
|
452
|
-
short: 'c',
|
|
453
|
-
description: 'Include complexity metrics',
|
|
454
|
-
type: 'boolean',
|
|
455
|
-
default: false,
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
name: 'symbols',
|
|
459
|
-
short: 's',
|
|
460
|
-
description: 'Include symbol extraction',
|
|
461
|
-
type: 'boolean',
|
|
462
|
-
default: false,
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
name: 'format',
|
|
466
|
-
short: 'f',
|
|
467
|
-
description: 'Output format (text, json, table)',
|
|
468
|
-
type: 'string',
|
|
469
|
-
default: 'text',
|
|
470
|
-
choices: ['text', 'json', 'table'],
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
name: 'output',
|
|
474
|
-
short: 'o',
|
|
475
|
-
description: 'Output file path',
|
|
476
|
-
type: 'string',
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
name: 'verbose',
|
|
480
|
-
short: 'v',
|
|
481
|
-
description: 'Show detailed analysis',
|
|
482
|
-
type: 'boolean',
|
|
483
|
-
default: false,
|
|
484
|
-
},
|
|
485
|
-
],
|
|
486
|
-
examples: [
|
|
487
|
-
{ command: 'monomind analyze ast src/', description: 'Analyze all files in src/' },
|
|
488
|
-
{ command: 'monomind analyze ast src/index.ts --complexity', description: 'Analyze with complexity' },
|
|
489
|
-
{ command: 'monomind analyze ast . --format json', description: 'JSON output' },
|
|
490
|
-
{ command: 'monomind analyze ast src/ --symbols', description: 'Extract symbols' },
|
|
491
|
-
],
|
|
492
|
-
action: async (ctx) => {
|
|
493
|
-
const targetPath = ctx.args[0] || ctx.cwd;
|
|
494
|
-
const showComplexity = ctx.flags.complexity;
|
|
495
|
-
const showSymbols = ctx.flags.symbols;
|
|
496
|
-
const formatType = ctx.flags.format || 'text';
|
|
497
|
-
const outputFile = ctx.flags.output;
|
|
498
|
-
const verbose = ctx.flags.verbose;
|
|
499
|
-
// If no specific flags, show summary
|
|
500
|
-
const showAll = !showComplexity && !showSymbols;
|
|
501
|
-
output.printInfo(`Analyzing: ${output.highlight(targetPath)}`);
|
|
502
|
-
output.writeln();
|
|
503
|
-
const spinner = output.createSpinner({ text: 'Parsing AST...', spinner: 'dots' });
|
|
504
|
-
spinner.start();
|
|
505
|
-
try {
|
|
506
|
-
const astModule = await getASTAnalyzer();
|
|
507
|
-
if (!astModule) {
|
|
508
|
-
spinner.stop();
|
|
509
|
-
output.printWarning('AST analyzer not available, using regex fallback');
|
|
510
|
-
}
|
|
511
|
-
// Resolve path and check if file or directory
|
|
512
|
-
const resolvedPath = resolve(targetPath);
|
|
513
|
-
const stat = await fs.stat(resolvedPath);
|
|
514
|
-
const isDirectory = stat.isDirectory();
|
|
515
|
-
let results = [];
|
|
516
|
-
if (isDirectory) {
|
|
517
|
-
// Scan directory for source files
|
|
518
|
-
const files = await scanSourceFiles(resolvedPath);
|
|
519
|
-
spinner.stop();
|
|
520
|
-
output.printInfo(`Found ${files.length} source files`);
|
|
521
|
-
spinner.start();
|
|
522
|
-
for (const file of files.slice(0, 100)) {
|
|
523
|
-
try {
|
|
524
|
-
const content = await fs.readFile(file, 'utf-8');
|
|
525
|
-
if (astModule) {
|
|
526
|
-
const analyzer = astModule.createASTAnalyzer();
|
|
527
|
-
const analysis = analyzer.analyze(content, file);
|
|
528
|
-
results.push(analysis);
|
|
529
|
-
}
|
|
530
|
-
else {
|
|
531
|
-
// Fallback analysis
|
|
532
|
-
results.push(fallbackAnalyze(content, file));
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
catch {
|
|
536
|
-
// Skip files that can't be analyzed
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
else {
|
|
541
|
-
// Single file
|
|
542
|
-
const content = await fs.readFile(resolvedPath, 'utf-8');
|
|
543
|
-
if (astModule) {
|
|
544
|
-
const analyzer = astModule.createASTAnalyzer();
|
|
545
|
-
const analysis = analyzer.analyze(content, resolvedPath);
|
|
546
|
-
results.push(analysis);
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
results.push(fallbackAnalyze(content, resolvedPath));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
spinner.stop();
|
|
553
|
-
if (results.length === 0) {
|
|
554
|
-
output.printWarning('No files analyzed');
|
|
555
|
-
return { success: true };
|
|
556
|
-
}
|
|
557
|
-
// Calculate totals
|
|
558
|
-
const totals = {
|
|
559
|
-
files: results.length,
|
|
560
|
-
functions: results.reduce((sum, r) => sum + r.functions.length, 0),
|
|
561
|
-
classes: results.reduce((sum, r) => sum + r.classes.length, 0),
|
|
562
|
-
imports: results.reduce((sum, r) => sum + r.imports.length, 0),
|
|
563
|
-
avgComplexity: results.reduce((sum, r) => sum + r.complexity.cyclomatic, 0) / results.length,
|
|
564
|
-
totalLoc: results.reduce((sum, r) => sum + r.complexity.loc, 0),
|
|
565
|
-
};
|
|
566
|
-
// JSON output
|
|
567
|
-
if (formatType === 'json') {
|
|
568
|
-
const jsonOutput = { files: results, totals };
|
|
569
|
-
if (outputFile) {
|
|
570
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
571
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
572
|
-
}
|
|
573
|
-
else {
|
|
574
|
-
output.printJson(jsonOutput);
|
|
575
|
-
}
|
|
576
|
-
return { success: true, data: jsonOutput };
|
|
577
|
-
}
|
|
578
|
-
// Summary box
|
|
579
|
-
output.printBox([
|
|
580
|
-
`Files analyzed: ${totals.files}`,
|
|
581
|
-
`Functions: ${totals.functions}`,
|
|
582
|
-
`Classes: ${totals.classes}`,
|
|
583
|
-
`Total LOC: ${totals.totalLoc}`,
|
|
584
|
-
`Avg Complexity: ${formatComplexityValueAst(Math.round(totals.avgComplexity))}`,
|
|
585
|
-
].join('\n'), 'AST Analysis Summary');
|
|
586
|
-
// Complexity view
|
|
587
|
-
if (showComplexity || showAll) {
|
|
588
|
-
output.writeln();
|
|
589
|
-
output.writeln(output.bold('Complexity by File'));
|
|
590
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
591
|
-
const complexityData = results
|
|
592
|
-
.map(r => ({
|
|
593
|
-
file: truncatePathAst(r.filePath),
|
|
594
|
-
cyclomatic: r.complexity.cyclomatic,
|
|
595
|
-
cognitive: r.complexity.cognitive,
|
|
596
|
-
loc: r.complexity.loc,
|
|
597
|
-
rating: getComplexityRatingAst(r.complexity.cyclomatic),
|
|
598
|
-
}))
|
|
599
|
-
.sort((a, b) => b.cyclomatic - a.cyclomatic)
|
|
600
|
-
.slice(0, 15);
|
|
601
|
-
output.printTable({
|
|
602
|
-
columns: [
|
|
603
|
-
{ key: 'file', header: 'File', width: 40 },
|
|
604
|
-
{ key: 'cyclomatic', header: 'Cyclo', width: 8, align: 'right', format: (v) => formatComplexityValueAst(v) },
|
|
605
|
-
{ key: 'cognitive', header: 'Cogni', width: 8, align: 'right' },
|
|
606
|
-
{ key: 'loc', header: 'LOC', width: 8, align: 'right' },
|
|
607
|
-
{ key: 'rating', header: 'Rating', width: 15 },
|
|
608
|
-
],
|
|
609
|
-
data: complexityData,
|
|
610
|
-
});
|
|
611
|
-
if (results.length > 15) {
|
|
612
|
-
output.writeln(output.dim(` ... and ${results.length - 15} more files`));
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
// Symbols view
|
|
616
|
-
if (showSymbols || showAll) {
|
|
617
|
-
output.writeln();
|
|
618
|
-
output.writeln(output.bold('Extracted Symbols'));
|
|
619
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
620
|
-
const allSymbols = [];
|
|
621
|
-
for (const r of results) {
|
|
622
|
-
for (const fn of r.functions) {
|
|
623
|
-
allSymbols.push({ name: fn.name, type: 'function', file: truncatePathAst(r.filePath, 30), line: fn.startLine });
|
|
624
|
-
}
|
|
625
|
-
for (const cls of r.classes) {
|
|
626
|
-
allSymbols.push({ name: cls.name, type: 'class', file: truncatePathAst(r.filePath, 30), line: cls.startLine });
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
const displaySymbols = allSymbols.slice(0, 20);
|
|
630
|
-
output.printTable({
|
|
631
|
-
columns: [
|
|
632
|
-
{ key: 'type', header: 'Type', width: 8, format: (v) => getTypeMarkerAst(v) },
|
|
633
|
-
{ key: 'name', header: 'Symbol', width: 30 },
|
|
634
|
-
{ key: 'file', header: 'File', width: 35 },
|
|
635
|
-
{ key: 'line', header: 'Line', width: 8, align: 'right' },
|
|
636
|
-
],
|
|
637
|
-
data: displaySymbols,
|
|
638
|
-
});
|
|
639
|
-
if (allSymbols.length > 20) {
|
|
640
|
-
output.writeln(output.dim(` ... and ${allSymbols.length - 20} more symbols`));
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
// Verbose output
|
|
644
|
-
if (verbose) {
|
|
645
|
-
output.writeln();
|
|
646
|
-
output.writeln(output.bold('Import Analysis'));
|
|
647
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
648
|
-
const importCounts = new Map();
|
|
649
|
-
for (const r of results) {
|
|
650
|
-
for (const imp of r.imports) {
|
|
651
|
-
importCounts.set(imp, (importCounts.get(imp) || 0) + 1);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
const topImports = Array.from(importCounts.entries())
|
|
655
|
-
.sort((a, b) => b[1] - a[1])
|
|
656
|
-
.slice(0, 10);
|
|
657
|
-
for (const [imp, count] of topImports) {
|
|
658
|
-
output.writeln(` ${output.highlight(count.toString().padStart(3))} ${imp}`);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
if (outputFile) {
|
|
662
|
-
await writeFile(outputFile, JSON.stringify({ files: results, totals }, null, 2));
|
|
663
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
664
|
-
}
|
|
665
|
-
return { success: true, data: { files: results, totals } };
|
|
666
|
-
}
|
|
667
|
-
catch (error) {
|
|
668
|
-
spinner.stop();
|
|
669
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
670
|
-
output.printError(`AST analysis failed: ${message}`);
|
|
671
|
-
return { success: false, exitCode: 1 };
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
};
|
|
675
|
-
/**
|
|
676
|
-
* Complexity analysis subcommand
|
|
677
|
-
*/
|
|
678
|
-
const complexityAstCommand = {
|
|
679
|
-
name: 'complexity',
|
|
680
|
-
aliases: ['cx'],
|
|
681
|
-
description: 'Analyze code complexity metrics',
|
|
682
|
-
options: [
|
|
683
|
-
{
|
|
684
|
-
name: 'threshold',
|
|
685
|
-
short: 't',
|
|
686
|
-
description: 'Complexity threshold to flag (default: 10)',
|
|
687
|
-
type: 'number',
|
|
688
|
-
default: 10,
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
name: 'format',
|
|
692
|
-
short: 'f',
|
|
693
|
-
description: 'Output format (text, json)',
|
|
694
|
-
type: 'string',
|
|
695
|
-
default: 'text',
|
|
696
|
-
choices: ['text', 'json'],
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
name: 'output',
|
|
700
|
-
short: 'o',
|
|
701
|
-
description: 'Output file path',
|
|
702
|
-
type: 'string',
|
|
703
|
-
},
|
|
704
|
-
],
|
|
705
|
-
examples: [
|
|
706
|
-
{ command: 'monomind analyze complexity src/', description: 'Analyze complexity' },
|
|
707
|
-
{ command: 'monomind analyze complexity src/ --threshold 15', description: 'Flag high complexity' },
|
|
708
|
-
],
|
|
709
|
-
action: async (ctx) => {
|
|
710
|
-
const targetPath = ctx.args[0] || ctx.cwd;
|
|
711
|
-
const threshold = ctx.flags.threshold || 10;
|
|
712
|
-
const formatType = ctx.flags.format || 'text';
|
|
713
|
-
const outputFile = ctx.flags.output;
|
|
714
|
-
output.printInfo(`Analyzing complexity: ${output.highlight(targetPath)}`);
|
|
715
|
-
output.writeln();
|
|
716
|
-
const spinner = output.createSpinner({ text: 'Calculating complexity...', spinner: 'dots' });
|
|
717
|
-
spinner.start();
|
|
718
|
-
try {
|
|
719
|
-
const astModule = await getASTAnalyzer();
|
|
720
|
-
const resolvedPath = resolve(targetPath);
|
|
721
|
-
const stat = await fs.stat(resolvedPath);
|
|
722
|
-
const files = stat.isDirectory() ? await scanSourceFiles(resolvedPath) : [resolvedPath];
|
|
723
|
-
const results = [];
|
|
724
|
-
for (const file of files.slice(0, 100)) {
|
|
725
|
-
try {
|
|
726
|
-
const content = await fs.readFile(file, 'utf-8');
|
|
727
|
-
let analysis;
|
|
728
|
-
if (astModule) {
|
|
729
|
-
const analyzer = astModule.createASTAnalyzer();
|
|
730
|
-
analysis = analyzer.analyze(content, file);
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
analysis = fallbackAnalyze(content, file);
|
|
734
|
-
}
|
|
735
|
-
const flagged = analysis.complexity.cyclomatic > threshold;
|
|
736
|
-
const rating = analysis.complexity.cyclomatic <= 5 ? 'Simple' :
|
|
737
|
-
analysis.complexity.cyclomatic <= 10 ? 'Moderate' :
|
|
738
|
-
analysis.complexity.cyclomatic <= 20 ? 'Complex' : 'Very Complex';
|
|
739
|
-
results.push({
|
|
740
|
-
file: file,
|
|
741
|
-
cyclomatic: analysis.complexity.cyclomatic,
|
|
742
|
-
cognitive: analysis.complexity.cognitive,
|
|
743
|
-
loc: analysis.complexity.loc,
|
|
744
|
-
commentDensity: analysis.complexity.commentDensity,
|
|
745
|
-
rating,
|
|
746
|
-
flagged,
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
catch {
|
|
750
|
-
// Skip files that can't be analyzed
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
spinner.stop();
|
|
754
|
-
// Sort by complexity descending
|
|
755
|
-
results.sort((a, b) => b.cyclomatic - a.cyclomatic);
|
|
756
|
-
const flaggedCount = results.filter(r => r.flagged).length;
|
|
757
|
-
const avgComplexity = results.length > 0
|
|
758
|
-
? results.reduce((sum, r) => sum + r.cyclomatic, 0) / results.length
|
|
759
|
-
: 0;
|
|
760
|
-
if (formatType === 'json') {
|
|
761
|
-
const jsonOutput = { files: results, summary: { total: results.length, flagged: flaggedCount, avgComplexity, threshold } };
|
|
762
|
-
if (outputFile) {
|
|
763
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
764
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
765
|
-
}
|
|
766
|
-
else {
|
|
767
|
-
output.printJson(jsonOutput);
|
|
768
|
-
}
|
|
769
|
-
return { success: true, data: jsonOutput };
|
|
770
|
-
}
|
|
771
|
-
// Summary
|
|
772
|
-
output.printBox([
|
|
773
|
-
`Files analyzed: ${results.length}`,
|
|
774
|
-
`Threshold: ${threshold}`,
|
|
775
|
-
`Flagged files: ${flaggedCount > 0 ? output.error(String(flaggedCount)) : output.success('0')}`,
|
|
776
|
-
`Average complexity: ${formatComplexityValueAst(Math.round(avgComplexity))}`,
|
|
777
|
-
].join('\n'), 'Complexity Analysis');
|
|
778
|
-
// Show flagged files first
|
|
779
|
-
if (flaggedCount > 0) {
|
|
780
|
-
output.writeln();
|
|
781
|
-
output.writeln(output.bold(output.warning(`High Complexity Files (>${threshold})`)));
|
|
782
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
783
|
-
const flaggedFiles = results.filter(r => r.flagged).slice(0, 10);
|
|
784
|
-
output.printTable({
|
|
785
|
-
columns: [
|
|
786
|
-
{ key: 'file', header: 'File', width: 40, format: (v) => truncatePathAst(v) },
|
|
787
|
-
{ key: 'cyclomatic', header: 'Cyclo', width: 8, align: 'right', format: (v) => output.error(String(v)) },
|
|
788
|
-
{ key: 'cognitive', header: 'Cogni', width: 8, align: 'right' },
|
|
789
|
-
{ key: 'loc', header: 'LOC', width: 8, align: 'right' },
|
|
790
|
-
{ key: 'rating', header: 'Rating', width: 15 },
|
|
791
|
-
],
|
|
792
|
-
data: flaggedFiles,
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
// Show all files in table format
|
|
796
|
-
output.writeln();
|
|
797
|
-
output.writeln(output.bold('All Files'));
|
|
798
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
799
|
-
const displayFiles = results.slice(0, 15);
|
|
800
|
-
output.printTable({
|
|
801
|
-
columns: [
|
|
802
|
-
{ key: 'file', header: 'File', width: 40, format: (v) => truncatePathAst(v) },
|
|
803
|
-
{ key: 'cyclomatic', header: 'Cyclo', width: 8, align: 'right', format: (v) => formatComplexityValueAst(v) },
|
|
804
|
-
{ key: 'cognitive', header: 'Cogni', width: 8, align: 'right' },
|
|
805
|
-
{ key: 'loc', header: 'LOC', width: 8, align: 'right' },
|
|
806
|
-
],
|
|
807
|
-
data: displayFiles,
|
|
808
|
-
});
|
|
809
|
-
if (results.length > 15) {
|
|
810
|
-
output.writeln(output.dim(` ... and ${results.length - 15} more files`));
|
|
811
|
-
}
|
|
812
|
-
if (outputFile) {
|
|
813
|
-
await writeFile(outputFile, JSON.stringify({ files: results, summary: { total: results.length, flagged: flaggedCount, avgComplexity, threshold } }, null, 2));
|
|
814
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
815
|
-
}
|
|
816
|
-
return { success: true, data: { files: results, flaggedCount } };
|
|
817
|
-
}
|
|
818
|
-
catch (error) {
|
|
819
|
-
spinner.stop();
|
|
820
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
821
|
-
output.printError(`Complexity analysis failed: ${message}`);
|
|
822
|
-
return { success: false, exitCode: 1 };
|
|
823
|
-
}
|
|
824
|
-
},
|
|
825
|
-
};
|
|
826
|
-
/**
|
|
827
|
-
* Symbol extraction subcommand
|
|
828
|
-
*/
|
|
829
|
-
const symbolsCommand = {
|
|
830
|
-
name: 'symbols',
|
|
831
|
-
aliases: ['sym'],
|
|
832
|
-
description: 'Extract and list code symbols (functions, classes, types)',
|
|
833
|
-
options: [
|
|
834
|
-
{
|
|
835
|
-
name: 'type',
|
|
836
|
-
short: 't',
|
|
837
|
-
description: 'Filter by symbol type (function, class, all)',
|
|
838
|
-
type: 'string',
|
|
839
|
-
default: 'all',
|
|
840
|
-
choices: ['function', 'class', 'all'],
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
name: 'format',
|
|
844
|
-
short: 'f',
|
|
845
|
-
description: 'Output format (text, json)',
|
|
846
|
-
type: 'string',
|
|
847
|
-
default: 'text',
|
|
848
|
-
choices: ['text', 'json'],
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
name: 'output',
|
|
852
|
-
short: 'o',
|
|
853
|
-
description: 'Output file path',
|
|
854
|
-
type: 'string',
|
|
855
|
-
},
|
|
856
|
-
],
|
|
857
|
-
examples: [
|
|
858
|
-
{ command: 'monomind analyze symbols src/', description: 'Extract all symbols' },
|
|
859
|
-
{ command: 'monomind analyze symbols src/ --type function', description: 'Only functions' },
|
|
860
|
-
{ command: 'monomind analyze symbols src/ --format json', description: 'JSON output' },
|
|
861
|
-
],
|
|
862
|
-
action: async (ctx) => {
|
|
863
|
-
const targetPath = ctx.args[0] || ctx.cwd;
|
|
864
|
-
const symbolType = ctx.flags.type || 'all';
|
|
865
|
-
const formatType = ctx.flags.format || 'text';
|
|
866
|
-
const outputFile = ctx.flags.output;
|
|
867
|
-
output.printInfo(`Extracting symbols: ${output.highlight(targetPath)}`);
|
|
868
|
-
output.writeln();
|
|
869
|
-
const spinner = output.createSpinner({ text: 'Parsing code...', spinner: 'dots' });
|
|
870
|
-
spinner.start();
|
|
871
|
-
try {
|
|
872
|
-
const astModule = await getASTAnalyzer();
|
|
873
|
-
const resolvedPath = resolve(targetPath);
|
|
874
|
-
const stat = await fs.stat(resolvedPath);
|
|
875
|
-
const files = stat.isDirectory() ? await scanSourceFiles(resolvedPath) : [resolvedPath];
|
|
876
|
-
const symbols = [];
|
|
877
|
-
for (const file of files.slice(0, 100)) {
|
|
878
|
-
try {
|
|
879
|
-
const content = await fs.readFile(file, 'utf-8');
|
|
880
|
-
let analysis;
|
|
881
|
-
if (astModule) {
|
|
882
|
-
const analyzer = astModule.createASTAnalyzer();
|
|
883
|
-
analysis = analyzer.analyze(content, file);
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
analysis = fallbackAnalyze(content, file);
|
|
887
|
-
}
|
|
888
|
-
if (symbolType === 'all' || symbolType === 'function') {
|
|
889
|
-
for (const fn of analysis.functions) {
|
|
890
|
-
symbols.push({
|
|
891
|
-
name: fn.name,
|
|
892
|
-
type: 'function',
|
|
893
|
-
file,
|
|
894
|
-
startLine: fn.startLine,
|
|
895
|
-
endLine: fn.endLine,
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
if (symbolType === 'all' || symbolType === 'class') {
|
|
900
|
-
for (const cls of analysis.classes) {
|
|
901
|
-
symbols.push({
|
|
902
|
-
name: cls.name,
|
|
903
|
-
type: 'class',
|
|
904
|
-
file,
|
|
905
|
-
startLine: cls.startLine,
|
|
906
|
-
endLine: cls.endLine,
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
catch {
|
|
912
|
-
// Skip files that can't be parsed
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
spinner.stop();
|
|
916
|
-
// Sort by file then name
|
|
917
|
-
symbols.sort((a, b) => a.file.localeCompare(b.file) || a.name.localeCompare(b.name));
|
|
918
|
-
if (formatType === 'json') {
|
|
919
|
-
if (outputFile) {
|
|
920
|
-
await writeFile(outputFile, JSON.stringify(symbols, null, 2));
|
|
921
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
924
|
-
output.printJson(symbols);
|
|
925
|
-
}
|
|
926
|
-
return { success: true, data: symbols };
|
|
927
|
-
}
|
|
928
|
-
// Summary
|
|
929
|
-
const functionCount = symbols.filter(s => s.type === 'function').length;
|
|
930
|
-
const classCount = symbols.filter(s => s.type === 'class').length;
|
|
931
|
-
output.printBox([
|
|
932
|
-
`Total symbols: ${symbols.length}`,
|
|
933
|
-
`Functions: ${functionCount}`,
|
|
934
|
-
`Classes: ${classCount}`,
|
|
935
|
-
`Files: ${files.length}`,
|
|
936
|
-
].join('\n'), 'Symbol Extraction');
|
|
937
|
-
output.writeln();
|
|
938
|
-
output.writeln(output.bold('Symbols'));
|
|
939
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
940
|
-
const displaySymbols = symbols.slice(0, 30);
|
|
941
|
-
output.printTable({
|
|
942
|
-
columns: [
|
|
943
|
-
{ key: 'type', header: 'Type', width: 10, format: (v) => getTypeMarkerAst(v) },
|
|
944
|
-
{ key: 'name', header: 'Name', width: 30 },
|
|
945
|
-
{ key: 'file', header: 'File', width: 35, format: (v) => truncatePathAst(v, 33) },
|
|
946
|
-
{ key: 'startLine', header: 'Line', width: 8, align: 'right' },
|
|
947
|
-
],
|
|
948
|
-
data: displaySymbols,
|
|
949
|
-
});
|
|
950
|
-
if (symbols.length > 30) {
|
|
951
|
-
output.writeln(output.dim(` ... and ${symbols.length - 30} more symbols`));
|
|
952
|
-
}
|
|
953
|
-
if (outputFile) {
|
|
954
|
-
await writeFile(outputFile, JSON.stringify(symbols, null, 2));
|
|
955
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
956
|
-
}
|
|
957
|
-
return { success: true, data: symbols };
|
|
958
|
-
}
|
|
959
|
-
catch (error) {
|
|
960
|
-
spinner.stop();
|
|
961
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
962
|
-
output.printError(`Symbol extraction failed: ${message}`);
|
|
963
|
-
return { success: false, exitCode: 1 };
|
|
964
|
-
}
|
|
965
|
-
},
|
|
966
|
-
};
|
|
967
|
-
/**
|
|
968
|
-
* Imports analysis subcommand
|
|
969
|
-
*/
|
|
970
|
-
const importsCommand = {
|
|
971
|
-
name: 'imports',
|
|
972
|
-
aliases: ['imp'],
|
|
973
|
-
description: 'Analyze import dependencies across files',
|
|
974
|
-
options: [
|
|
975
|
-
{
|
|
976
|
-
name: 'format',
|
|
977
|
-
short: 'f',
|
|
978
|
-
description: 'Output format (text, json)',
|
|
979
|
-
type: 'string',
|
|
980
|
-
default: 'text',
|
|
981
|
-
choices: ['text', 'json'],
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
name: 'output',
|
|
985
|
-
short: 'o',
|
|
986
|
-
description: 'Output file path',
|
|
987
|
-
type: 'string',
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
name: 'external',
|
|
991
|
-
short: 'e',
|
|
992
|
-
description: 'Show only external (npm) imports',
|
|
993
|
-
type: 'boolean',
|
|
994
|
-
default: false,
|
|
995
|
-
},
|
|
996
|
-
],
|
|
997
|
-
examples: [
|
|
998
|
-
{ command: 'monomind analyze imports src/', description: 'Analyze all imports' },
|
|
999
|
-
{ command: 'monomind analyze imports src/ --external', description: 'Only npm packages' },
|
|
1000
|
-
],
|
|
1001
|
-
action: async (ctx) => {
|
|
1002
|
-
const targetPath = ctx.args[0] || ctx.cwd;
|
|
1003
|
-
const formatType = ctx.flags.format || 'text';
|
|
1004
|
-
const outputFile = ctx.flags.output;
|
|
1005
|
-
const externalOnly = ctx.flags.external;
|
|
1006
|
-
output.printInfo(`Analyzing imports: ${output.highlight(targetPath)}`);
|
|
1007
|
-
output.writeln();
|
|
1008
|
-
const spinner = output.createSpinner({ text: 'Scanning imports...', spinner: 'dots' });
|
|
1009
|
-
spinner.start();
|
|
1010
|
-
try {
|
|
1011
|
-
const astModule = await getASTAnalyzer();
|
|
1012
|
-
const resolvedPath = resolve(targetPath);
|
|
1013
|
-
const stat = await fs.stat(resolvedPath);
|
|
1014
|
-
const files = stat.isDirectory() ? await scanSourceFiles(resolvedPath) : [resolvedPath];
|
|
1015
|
-
const importCounts = new Map();
|
|
1016
|
-
const fileImports = new Map();
|
|
1017
|
-
for (const file of files.slice(0, 100)) {
|
|
1018
|
-
try {
|
|
1019
|
-
const content = await fs.readFile(file, 'utf-8');
|
|
1020
|
-
let analysis;
|
|
1021
|
-
if (astModule) {
|
|
1022
|
-
const analyzer = astModule.createASTAnalyzer();
|
|
1023
|
-
analysis = analyzer.analyze(content, file);
|
|
1024
|
-
}
|
|
1025
|
-
else {
|
|
1026
|
-
analysis = fallbackAnalyze(content, file);
|
|
1027
|
-
}
|
|
1028
|
-
const imports = analysis.imports.filter(imp => {
|
|
1029
|
-
if (externalOnly) {
|
|
1030
|
-
return !imp.startsWith('.') && !imp.startsWith('/');
|
|
1031
|
-
}
|
|
1032
|
-
return true;
|
|
1033
|
-
});
|
|
1034
|
-
fileImports.set(file, imports);
|
|
1035
|
-
for (const imp of imports) {
|
|
1036
|
-
const existing = importCounts.get(imp) || { count: 0, files: [] };
|
|
1037
|
-
existing.count++;
|
|
1038
|
-
existing.files.push(file);
|
|
1039
|
-
importCounts.set(imp, existing);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
catch {
|
|
1043
|
-
// Skip files that can't be parsed
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
spinner.stop();
|
|
1047
|
-
// Sort by count
|
|
1048
|
-
const sortedImports = Array.from(importCounts.entries())
|
|
1049
|
-
.sort((a, b) => b[1].count - a[1].count);
|
|
1050
|
-
if (formatType === 'json') {
|
|
1051
|
-
const jsonOutput = {
|
|
1052
|
-
imports: Object.fromEntries(sortedImports),
|
|
1053
|
-
fileImports: Object.fromEntries(fileImports),
|
|
1054
|
-
};
|
|
1055
|
-
if (outputFile) {
|
|
1056
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1057
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1058
|
-
}
|
|
1059
|
-
else {
|
|
1060
|
-
output.printJson(jsonOutput);
|
|
1061
|
-
}
|
|
1062
|
-
return { success: true, data: jsonOutput };
|
|
1063
|
-
}
|
|
1064
|
-
// Summary
|
|
1065
|
-
const externalImports = sortedImports.filter(([imp]) => !imp.startsWith('.') && !imp.startsWith('/'));
|
|
1066
|
-
const localImports = sortedImports.filter(([imp]) => imp.startsWith('.') || imp.startsWith('/'));
|
|
1067
|
-
output.printBox([
|
|
1068
|
-
`Total unique imports: ${sortedImports.length}`,
|
|
1069
|
-
`External (npm): ${externalImports.length}`,
|
|
1070
|
-
`Local (relative): ${localImports.length}`,
|
|
1071
|
-
`Files scanned: ${files.length}`,
|
|
1072
|
-
].join('\n'), 'Import Analysis');
|
|
1073
|
-
// Most used imports
|
|
1074
|
-
output.writeln();
|
|
1075
|
-
output.writeln(output.bold('Most Used Imports'));
|
|
1076
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
1077
|
-
const topImports = sortedImports.slice(0, 20);
|
|
1078
|
-
output.printTable({
|
|
1079
|
-
columns: [
|
|
1080
|
-
{ key: 'count', header: 'Uses', width: 8, align: 'right' },
|
|
1081
|
-
{ key: 'import', header: 'Import', width: 50 },
|
|
1082
|
-
{ key: 'type', header: 'Type', width: 10 },
|
|
1083
|
-
],
|
|
1084
|
-
data: topImports.map(([imp, data]) => ({
|
|
1085
|
-
count: data.count,
|
|
1086
|
-
import: imp,
|
|
1087
|
-
type: imp.startsWith('.') || imp.startsWith('/') ? output.dim('local') : output.highlight('npm'),
|
|
1088
|
-
})),
|
|
1089
|
-
});
|
|
1090
|
-
if (sortedImports.length > 20) {
|
|
1091
|
-
output.writeln(output.dim(` ... and ${sortedImports.length - 20} more imports`));
|
|
1092
|
-
}
|
|
1093
|
-
if (outputFile) {
|
|
1094
|
-
await writeFile(outputFile, JSON.stringify({
|
|
1095
|
-
imports: Object.fromEntries(sortedImports),
|
|
1096
|
-
fileImports: Object.fromEntries(fileImports),
|
|
1097
|
-
}, null, 2));
|
|
1098
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1099
|
-
}
|
|
1100
|
-
return { success: true, data: { imports: sortedImports } };
|
|
1101
|
-
}
|
|
1102
|
-
catch (error) {
|
|
1103
|
-
spinner.stop();
|
|
1104
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1105
|
-
output.printError(`Import analysis failed: ${message}`);
|
|
1106
|
-
return { success: false, exitCode: 1 };
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
};
|
|
1110
|
-
/**
|
|
1111
|
-
* Helper: Scan directory for source files
|
|
1112
|
-
*/
|
|
1113
|
-
async function scanSourceFiles(dir, maxDepth = 10) {
|
|
1114
|
-
const files = [];
|
|
1115
|
-
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'];
|
|
1116
|
-
const excludeDirs = ['node_modules', 'dist', 'build', '.git', 'coverage', '__pycache__'];
|
|
1117
|
-
async function scan(currentDir, depth) {
|
|
1118
|
-
if (depth > maxDepth)
|
|
1119
|
-
return;
|
|
1120
|
-
try {
|
|
1121
|
-
const entries = await fs.readdir(currentDir, { withFileTypes: true });
|
|
1122
|
-
for (const entry of entries) {
|
|
1123
|
-
const fullPath = path.join(currentDir, entry.name);
|
|
1124
|
-
if (entry.isDirectory()) {
|
|
1125
|
-
if (!excludeDirs.includes(entry.name)) {
|
|
1126
|
-
await scan(fullPath, depth + 1);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
else if (entry.isFile()) {
|
|
1130
|
-
const ext = path.extname(entry.name);
|
|
1131
|
-
if (extensions.includes(ext)) {
|
|
1132
|
-
files.push(fullPath);
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
catch {
|
|
1138
|
-
// Skip directories we can't read
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
await scan(dir, 0);
|
|
1142
|
-
return files;
|
|
1143
|
-
}
|
|
1144
|
-
/**
|
|
1145
|
-
* Fallback analysis when ruvector is not available
|
|
1146
|
-
*/
|
|
1147
|
-
function fallbackAnalyze(code, filePath) {
|
|
1148
|
-
const lines = code.split('\n');
|
|
1149
|
-
const functions = [];
|
|
1150
|
-
const classes = [];
|
|
1151
|
-
const imports = [];
|
|
1152
|
-
const exports = [];
|
|
1153
|
-
// Extract functions
|
|
1154
|
-
const funcPattern = /(?:export\s+)?(?:async\s+)?function\s+(\w+)|(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?\([^)]*\)\s*=>|^\s*(?:async\s+)?(\w+)\s*\([^)]*\)\s*(?::\s*\w+)?\s*\{/gm;
|
|
1155
|
-
let match;
|
|
1156
|
-
while ((match = funcPattern.exec(code)) !== null) {
|
|
1157
|
-
const name = match[1] || match[2] || match[3];
|
|
1158
|
-
if (name && !['if', 'while', 'for', 'switch'].includes(name)) {
|
|
1159
|
-
const lineNum = code.substring(0, match.index).split('\n').length;
|
|
1160
|
-
functions.push({ name, startLine: lineNum, endLine: lineNum + 10 });
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
// Extract classes
|
|
1164
|
-
const classPattern = /(?:export\s+)?class\s+(\w+)/gm;
|
|
1165
|
-
while ((match = classPattern.exec(code)) !== null) {
|
|
1166
|
-
const lineNum = code.substring(0, match.index).split('\n').length;
|
|
1167
|
-
classes.push({ name: match[1], startLine: lineNum, endLine: lineNum + 20 });
|
|
1168
|
-
}
|
|
1169
|
-
// Extract imports
|
|
1170
|
-
const importPattern = /import\s+(?:.*\s+from\s+)?['"]([^'"]+)['"]/gm;
|
|
1171
|
-
while ((match = importPattern.exec(code)) !== null) {
|
|
1172
|
-
imports.push(match[1]);
|
|
1173
|
-
}
|
|
1174
|
-
const requirePattern = /require\s*\(\s*['"]([^'"]+)['"]\s*\)/gm;
|
|
1175
|
-
while ((match = requirePattern.exec(code)) !== null) {
|
|
1176
|
-
imports.push(match[1]);
|
|
1177
|
-
}
|
|
1178
|
-
// Extract exports
|
|
1179
|
-
const exportPattern = /export\s+(?:default\s+)?(?:const|let|var|function|class|interface|type|enum)\s+(\w+)/gm;
|
|
1180
|
-
while ((match = exportPattern.exec(code)) !== null) {
|
|
1181
|
-
exports.push(match[1]);
|
|
1182
|
-
}
|
|
1183
|
-
// Calculate complexity
|
|
1184
|
-
const nonEmptyLines = lines.filter(l => l.trim().length > 0).length;
|
|
1185
|
-
const commentLines = lines.filter(l => /^\s*(\/\/|\/\*|\*|#)/.test(l)).length;
|
|
1186
|
-
const decisionPoints = (code.match(/\b(if|else|for|while|switch|case|catch|&&|\|\||\?)\b/g) || []).length;
|
|
1187
|
-
let cognitive = 0;
|
|
1188
|
-
let nestingLevel = 0;
|
|
1189
|
-
for (const line of lines) {
|
|
1190
|
-
const opens = (line.match(/\{/g) || []).length;
|
|
1191
|
-
const closes = (line.match(/\}/g) || []).length;
|
|
1192
|
-
if (/\b(if|for|while|switch)\b/.test(line)) {
|
|
1193
|
-
cognitive += 1 + nestingLevel;
|
|
1194
|
-
}
|
|
1195
|
-
nestingLevel = Math.max(0, nestingLevel + opens - closes);
|
|
1196
|
-
}
|
|
1197
|
-
// Detect language
|
|
1198
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
1199
|
-
const language = ext === '.ts' || ext === '.tsx' ? 'typescript' :
|
|
1200
|
-
ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs' ? 'javascript' :
|
|
1201
|
-
ext === '.py' ? 'python' : 'unknown';
|
|
1202
|
-
return {
|
|
1203
|
-
filePath,
|
|
1204
|
-
language,
|
|
1205
|
-
functions,
|
|
1206
|
-
classes,
|
|
1207
|
-
imports,
|
|
1208
|
-
exports,
|
|
1209
|
-
complexity: {
|
|
1210
|
-
cyclomatic: decisionPoints + 1,
|
|
1211
|
-
cognitive,
|
|
1212
|
-
loc: nonEmptyLines,
|
|
1213
|
-
commentDensity: lines.length > 0 ? commentLines / lines.length : 0,
|
|
1214
|
-
},
|
|
1215
|
-
};
|
|
1216
|
-
}
|
|
1217
|
-
// Dependencies subcommand
|
|
1218
|
-
const depsCommand = {
|
|
1219
|
-
name: 'deps',
|
|
1220
|
-
description: 'Analyze project dependencies',
|
|
1221
|
-
options: [
|
|
1222
|
-
{ name: 'outdated', short: 'o', type: 'boolean', description: 'Show only outdated dependencies' },
|
|
1223
|
-
{ name: 'security', short: 's', type: 'boolean', description: 'Check for security vulnerabilities' },
|
|
1224
|
-
{ name: 'format', short: 'f', type: 'string', description: 'Output format: text, json', default: 'text' },
|
|
1225
|
-
],
|
|
1226
|
-
examples: [
|
|
1227
|
-
{ command: 'monomind analyze deps --outdated', description: 'Show outdated dependencies' },
|
|
1228
|
-
{ command: 'monomind analyze deps --security', description: 'Check for vulnerabilities' },
|
|
1229
|
-
],
|
|
1230
|
-
action: async (ctx) => {
|
|
1231
|
-
const showOutdated = ctx.flags.outdated;
|
|
1232
|
-
const checkSecurity = ctx.flags.security;
|
|
1233
|
-
const formatJson = ctx.flags.format === 'json';
|
|
1234
|
-
output.writeln();
|
|
1235
|
-
output.writeln(output.bold('Dependency Analysis'));
|
|
1236
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
1237
|
-
try {
|
|
1238
|
-
const pkgPath = resolve('package.json');
|
|
1239
|
-
let pkgContent;
|
|
1240
|
-
try {
|
|
1241
|
-
pkgContent = await fs.readFile(pkgPath, 'utf-8');
|
|
1242
|
-
}
|
|
1243
|
-
catch {
|
|
1244
|
-
output.printError('No package.json found in current directory');
|
|
1245
|
-
return { success: false, exitCode: 1 };
|
|
1246
|
-
}
|
|
1247
|
-
const pkg = JSON.parse(pkgContent);
|
|
1248
|
-
const deps = Object.entries(pkg.dependencies || {});
|
|
1249
|
-
const devDeps = Object.entries(pkg.devDependencies || {});
|
|
1250
|
-
const optDeps = Object.entries(pkg.optionalDependencies || {});
|
|
1251
|
-
const peerDeps = Object.entries(pkg.peerDependencies || {});
|
|
1252
|
-
const total = deps.length + devDeps.length + optDeps.length + peerDeps.length;
|
|
1253
|
-
if (formatJson && !showOutdated && !checkSecurity) {
|
|
1254
|
-
const jsonData = { name: pkg.name, version: pkg.version, dependencies: deps.length, devDependencies: devDeps.length, optionalDependencies: optDeps.length, peerDependencies: peerDeps.length, total };
|
|
1255
|
-
output.printJson(jsonData);
|
|
1256
|
-
return { success: true, data: jsonData };
|
|
1257
|
-
}
|
|
1258
|
-
output.printBox([`Package: ${pkg.name || 'unknown'} @ ${pkg.version || '0.0.0'}`, `Dependencies: ${deps.length}`, `Dev Dependencies: ${devDeps.length}`, `Optional: ${optDeps.length}`, `Peer: ${peerDeps.length}`, `Total: ${total}`].join('\n'), 'Dependency Summary');
|
|
1259
|
-
if (showOutdated) {
|
|
1260
|
-
output.writeln();
|
|
1261
|
-
output.writeln(output.bold('Outdated Check'));
|
|
1262
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
1263
|
-
const outdated = [];
|
|
1264
|
-
const checkDeps = async (entries, category) => {
|
|
1265
|
-
for (const [name, declared] of entries) {
|
|
1266
|
-
try {
|
|
1267
|
-
const installedPkg = resolve('node_modules', name, 'package.json');
|
|
1268
|
-
const raw = await fs.readFile(installedPkg, 'utf-8');
|
|
1269
|
-
const installedContent = JSON.parse(raw);
|
|
1270
|
-
const installed = installedContent.version || 'unknown';
|
|
1271
|
-
const cleanDeclared = declared.replace(/^[\^~>=<]+/, '');
|
|
1272
|
-
if (installed !== cleanDeclared) {
|
|
1273
|
-
outdated.push({ name, declared: declared, installed, category });
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
catch {
|
|
1277
|
-
outdated.push({ name, declared: declared, installed: 'not installed', category });
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
await checkDeps(deps, 'prod');
|
|
1282
|
-
await checkDeps(devDeps, 'dev');
|
|
1283
|
-
if (outdated.length === 0) {
|
|
1284
|
-
output.printSuccess('All dependencies match declared versions');
|
|
1285
|
-
}
|
|
1286
|
-
else {
|
|
1287
|
-
output.printTable({
|
|
1288
|
-
columns: [
|
|
1289
|
-
{ key: 'name', header: 'Package', width: 30 },
|
|
1290
|
-
{ key: 'declared', header: 'Declared', width: 14 },
|
|
1291
|
-
{ key: 'installed', header: 'Installed', width: 14 },
|
|
1292
|
-
{ key: 'category', header: 'Type', width: 6 },
|
|
1293
|
-
],
|
|
1294
|
-
data: outdated.slice(0, 30),
|
|
1295
|
-
});
|
|
1296
|
-
if (outdated.length > 30) {
|
|
1297
|
-
output.writeln(output.dim(` ... and ${outdated.length - 30} more`));
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
if (checkSecurity) {
|
|
1302
|
-
output.writeln();
|
|
1303
|
-
output.writeln(output.bold('Security Audit'));
|
|
1304
|
-
output.writeln(output.dim('-'.repeat(60)));
|
|
1305
|
-
try {
|
|
1306
|
-
const auditRaw = execSync('npm audit --json 2>/dev/null', { encoding: 'utf-8', maxBuffer: 10 * 1024 * 1024 });
|
|
1307
|
-
const audit = JSON.parse(auditRaw);
|
|
1308
|
-
const vulns = audit.metadata?.vulnerabilities || audit.vulnerabilities || {};
|
|
1309
|
-
const info = vulns.info || 0;
|
|
1310
|
-
const low = vulns.low || 0;
|
|
1311
|
-
const moderate = vulns.moderate || 0;
|
|
1312
|
-
const high = vulns.high || 0;
|
|
1313
|
-
const critical = vulns.critical || 0;
|
|
1314
|
-
const totalVulns = info + low + moderate + high + critical;
|
|
1315
|
-
if (totalVulns === 0) {
|
|
1316
|
-
output.printSuccess('No known vulnerabilities found');
|
|
1317
|
-
}
|
|
1318
|
-
else {
|
|
1319
|
-
output.printTable({
|
|
1320
|
-
columns: [
|
|
1321
|
-
{ key: 'severity', header: 'Severity', width: 12 },
|
|
1322
|
-
{ key: 'count', header: 'Count', width: 8, align: 'right' },
|
|
1323
|
-
],
|
|
1324
|
-
data: [
|
|
1325
|
-
...(critical > 0 ? [{ severity: 'Critical', count: critical }] : []),
|
|
1326
|
-
...(high > 0 ? [{ severity: 'High', count: high }] : []),
|
|
1327
|
-
...(moderate > 0 ? [{ severity: 'Moderate', count: moderate }] : []),
|
|
1328
|
-
...(low > 0 ? [{ severity: 'Low', count: low }] : []),
|
|
1329
|
-
...(info > 0 ? [{ severity: 'Info', count: info }] : []),
|
|
1330
|
-
{ severity: 'Total', count: totalVulns },
|
|
1331
|
-
],
|
|
1332
|
-
});
|
|
1333
|
-
if (critical > 0 || high > 0) {
|
|
1334
|
-
output.printWarning(`${critical + high} high/critical vulnerabilities found. Run 'npm audit' for details.`);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
catch {
|
|
1339
|
-
output.printWarning('npm audit failed. Ensure npm is available and node_modules is installed.');
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
return { success: true };
|
|
1343
|
-
}
|
|
1344
|
-
catch (error) {
|
|
1345
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1346
|
-
output.printError(`Dependency analysis failed: ${message}`);
|
|
1347
|
-
return { success: false, exitCode: 1 };
|
|
1348
|
-
}
|
|
1349
|
-
},
|
|
1350
|
-
};
|
|
1351
|
-
// ============================================================================
|
|
1352
|
-
// Graph Analysis Subcommands (MinCut, Louvain, Circular Dependencies)
|
|
1353
|
-
// ============================================================================
|
|
1354
|
-
/**
|
|
1355
|
-
* Analyze code boundaries using MinCut algorithm
|
|
1356
|
-
*/
|
|
1357
|
-
const boundariesCommand = {
|
|
1358
|
-
name: 'boundaries',
|
|
1359
|
-
aliases: ['boundary', 'mincut'],
|
|
1360
|
-
description: 'Find natural code boundaries using MinCut algorithm',
|
|
1361
|
-
options: [
|
|
1362
|
-
{
|
|
1363
|
-
name: 'partitions',
|
|
1364
|
-
short: 'p',
|
|
1365
|
-
description: 'Number of partitions to find',
|
|
1366
|
-
type: 'number',
|
|
1367
|
-
default: 2,
|
|
1368
|
-
},
|
|
1369
|
-
{
|
|
1370
|
-
name: 'output',
|
|
1371
|
-
short: 'o',
|
|
1372
|
-
description: 'Output file path',
|
|
1373
|
-
type: 'string',
|
|
1374
|
-
},
|
|
1375
|
-
{
|
|
1376
|
-
name: 'format',
|
|
1377
|
-
short: 'f',
|
|
1378
|
-
description: 'Output format (text, json, dot)',
|
|
1379
|
-
type: 'string',
|
|
1380
|
-
default: 'text',
|
|
1381
|
-
choices: ['text', 'json', 'dot'],
|
|
1382
|
-
},
|
|
1383
|
-
],
|
|
1384
|
-
examples: [
|
|
1385
|
-
{ command: 'monomind analyze boundaries src/', description: 'Find code boundaries in src/' },
|
|
1386
|
-
{ command: 'monomind analyze boundaries -p 3 src/', description: 'Find 3 partitions' },
|
|
1387
|
-
{ command: 'monomind analyze boundaries -f dot -o graph.dot src/', description: 'Export to DOT format' },
|
|
1388
|
-
],
|
|
1389
|
-
action: async (ctx) => {
|
|
1390
|
-
const targetDir = ctx.args[0] || ctx.cwd;
|
|
1391
|
-
const numPartitions = ctx.flags.partitions || 2;
|
|
1392
|
-
const outputFile = ctx.flags.output;
|
|
1393
|
-
const format = ctx.flags.format || 'text';
|
|
1394
|
-
output.printInfo(`Analyzing code boundaries in: ${output.highlight(targetDir)}`);
|
|
1395
|
-
output.writeln();
|
|
1396
|
-
const spinner = output.createSpinner({ text: 'Building dependency graph...', spinner: 'dots' });
|
|
1397
|
-
spinner.start();
|
|
1398
|
-
try {
|
|
1399
|
-
const analyzer = await getGraphAnalyzer();
|
|
1400
|
-
if (!analyzer) {
|
|
1401
|
-
spinner.stop();
|
|
1402
|
-
output.printError('Graph analyzer module not available');
|
|
1403
|
-
return { success: false, exitCode: 1 };
|
|
1404
|
-
}
|
|
1405
|
-
const result = await analyzer.analyzeGraph(resolve(targetDir), {
|
|
1406
|
-
includeBoundaries: true,
|
|
1407
|
-
includeModules: false,
|
|
1408
|
-
numPartitions,
|
|
1409
|
-
});
|
|
1410
|
-
spinner.stop();
|
|
1411
|
-
// Handle different output formats
|
|
1412
|
-
if (format === 'json') {
|
|
1413
|
-
const jsonOutput = {
|
|
1414
|
-
boundaries: result.boundaries,
|
|
1415
|
-
statistics: result.statistics,
|
|
1416
|
-
circularDependencies: result.circularDependencies,
|
|
1417
|
-
};
|
|
1418
|
-
if (outputFile) {
|
|
1419
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1420
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1421
|
-
}
|
|
1422
|
-
else {
|
|
1423
|
-
output.printJson(jsonOutput);
|
|
1424
|
-
}
|
|
1425
|
-
return { success: true, data: jsonOutput };
|
|
1426
|
-
}
|
|
1427
|
-
if (format === 'dot') {
|
|
1428
|
-
const dotOutput = analyzer.exportToDot(result, {
|
|
1429
|
-
includeLabels: true,
|
|
1430
|
-
highlightCycles: true,
|
|
1431
|
-
});
|
|
1432
|
-
if (outputFile) {
|
|
1433
|
-
await writeFile(outputFile, dotOutput);
|
|
1434
|
-
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1435
|
-
output.writeln(output.dim('Visualize with: dot -Tpng -o graph.png ' + outputFile));
|
|
1436
|
-
}
|
|
1437
|
-
else {
|
|
1438
|
-
output.writeln(dotOutput);
|
|
1439
|
-
}
|
|
1440
|
-
return { success: true };
|
|
1441
|
-
}
|
|
1442
|
-
// Text format (default)
|
|
1443
|
-
output.printBox([
|
|
1444
|
-
`Files analyzed: ${result.statistics.nodeCount}`,
|
|
1445
|
-
`Dependencies: ${result.statistics.edgeCount}`,
|
|
1446
|
-
`Avg degree: ${result.statistics.avgDegree.toFixed(2)}`,
|
|
1447
|
-
`Density: ${(result.statistics.density * 100).toFixed(2)}%`,
|
|
1448
|
-
`Components: ${result.statistics.componentCount}`,
|
|
1449
|
-
].join('\n'), 'Graph Statistics');
|
|
1450
|
-
if (result.boundaries && result.boundaries.length > 0) {
|
|
1451
|
-
output.writeln();
|
|
1452
|
-
output.writeln(output.bold('MinCut Boundaries'));
|
|
1453
|
-
output.writeln();
|
|
1454
|
-
for (let i = 0; i < result.boundaries.length; i++) {
|
|
1455
|
-
const boundary = result.boundaries[i];
|
|
1456
|
-
output.writeln(output.bold(`Boundary ${i + 1} (cut value: ${boundary.cutValue})`));
|
|
1457
|
-
output.writeln();
|
|
1458
|
-
output.writeln(output.dim('Partition 1:'));
|
|
1459
|
-
const p1Display = boundary.partition1.slice(0, 10);
|
|
1460
|
-
output.printList(p1Display);
|
|
1461
|
-
if (boundary.partition1.length > 10) {
|
|
1462
|
-
output.writeln(output.dim(` ... and ${boundary.partition1.length - 10} more files`));
|
|
1463
|
-
}
|
|
1464
|
-
output.writeln();
|
|
1465
|
-
output.writeln(output.dim('Partition 2:'));
|
|
1466
|
-
const p2Display = boundary.partition2.slice(0, 10);
|
|
1467
|
-
output.printList(p2Display);
|
|
1468
|
-
if (boundary.partition2.length > 10) {
|
|
1469
|
-
output.writeln(output.dim(` ... and ${boundary.partition2.length - 10} more files`));
|
|
1470
|
-
}
|
|
1471
|
-
output.writeln();
|
|
1472
|
-
output.writeln(output.success('Suggestion:'));
|
|
1473
|
-
output.writeln(` ${boundary.suggestion}`);
|
|
1474
|
-
output.writeln();
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
// Show circular dependencies
|
|
1478
|
-
if (result.circularDependencies.length > 0) {
|
|
1479
|
-
output.writeln();
|
|
1480
|
-
output.writeln(output.bold(output.warning('Circular Dependencies Detected')));
|
|
1481
|
-
output.writeln();
|
|
1482
|
-
for (const cycle of result.circularDependencies.slice(0, 5)) {
|
|
1483
|
-
const severityColor = cycle.severity === 'high' ? output.error : cycle.severity === 'medium' ? output.warning : output.dim;
|
|
1484
|
-
output.writeln(`${severityColor(`[${cycle.severity.toUpperCase()}]`)} ${cycle.cycle.join(' -> ')}`);
|
|
1485
|
-
output.writeln(output.dim(` ${cycle.suggestion}`));
|
|
1486
|
-
output.writeln();
|
|
1487
|
-
}
|
|
1488
|
-
if (result.circularDependencies.length > 5) {
|
|
1489
|
-
output.writeln(output.dim(`... and ${result.circularDependencies.length - 5} more cycles`));
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
if (outputFile) {
|
|
1493
|
-
await writeFile(outputFile, JSON.stringify(result, null, 2));
|
|
1494
|
-
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1495
|
-
}
|
|
1496
|
-
return { success: true, data: result };
|
|
1497
|
-
}
|
|
1498
|
-
catch (error) {
|
|
1499
|
-
spinner.stop();
|
|
1500
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1501
|
-
output.printError(`Analysis failed: ${message}`);
|
|
1502
|
-
return { success: false, exitCode: 1 };
|
|
1503
|
-
}
|
|
1504
|
-
},
|
|
1505
|
-
};
|
|
1506
|
-
/**
|
|
1507
|
-
* Analyze modules/communities using Louvain algorithm
|
|
1508
|
-
*/
|
|
1509
|
-
const modulesCommand = {
|
|
1510
|
-
name: 'modules',
|
|
1511
|
-
aliases: ['communities', 'louvain'],
|
|
1512
|
-
description: 'Detect module communities using Louvain algorithm',
|
|
1513
|
-
options: [
|
|
1514
|
-
{
|
|
1515
|
-
name: 'output',
|
|
1516
|
-
short: 'o',
|
|
1517
|
-
description: 'Output file path',
|
|
1518
|
-
type: 'string',
|
|
1519
|
-
},
|
|
1520
|
-
{
|
|
1521
|
-
name: 'format',
|
|
1522
|
-
short: 'f',
|
|
1523
|
-
description: 'Output format (text, json, dot)',
|
|
1524
|
-
type: 'string',
|
|
1525
|
-
default: 'text',
|
|
1526
|
-
choices: ['text', 'json', 'dot'],
|
|
1527
|
-
},
|
|
1528
|
-
{
|
|
1529
|
-
name: 'min-size',
|
|
1530
|
-
short: 'm',
|
|
1531
|
-
description: 'Minimum community size to display',
|
|
1532
|
-
type: 'number',
|
|
1533
|
-
default: 2,
|
|
1534
|
-
},
|
|
1535
|
-
],
|
|
1536
|
-
examples: [
|
|
1537
|
-
{ command: 'monomind analyze modules src/', description: 'Detect module communities' },
|
|
1538
|
-
{ command: 'monomind analyze modules -f dot -o modules.dot src/', description: 'Export colored DOT graph' },
|
|
1539
|
-
{ command: 'monomind analyze modules -m 3 src/', description: 'Only show communities with 3+ files' },
|
|
1540
|
-
],
|
|
1541
|
-
action: async (ctx) => {
|
|
1542
|
-
const targetDir = ctx.args[0] || ctx.cwd;
|
|
1543
|
-
const outputFile = ctx.flags.output;
|
|
1544
|
-
const format = ctx.flags.format || 'text';
|
|
1545
|
-
const minSize = ctx.flags['min-size'] || 2;
|
|
1546
|
-
output.printInfo(`Detecting module communities in: ${output.highlight(targetDir)}`);
|
|
1547
|
-
output.writeln();
|
|
1548
|
-
const spinner = output.createSpinner({ text: 'Building dependency graph...', spinner: 'dots' });
|
|
1549
|
-
spinner.start();
|
|
1550
|
-
try {
|
|
1551
|
-
const analyzer = await getGraphAnalyzer();
|
|
1552
|
-
if (!analyzer) {
|
|
1553
|
-
spinner.stop();
|
|
1554
|
-
output.printError('Graph analyzer module not available');
|
|
1555
|
-
return { success: false, exitCode: 1 };
|
|
1556
|
-
}
|
|
1557
|
-
const result = await analyzer.analyzeGraph(resolve(targetDir), {
|
|
1558
|
-
includeBoundaries: false,
|
|
1559
|
-
includeModules: true,
|
|
1560
|
-
});
|
|
1561
|
-
spinner.stop();
|
|
1562
|
-
// Filter communities by size
|
|
1563
|
-
const communities = result.communities?.filter(c => c.members.length >= minSize) || [];
|
|
1564
|
-
// Handle different output formats
|
|
1565
|
-
if (format === 'json') {
|
|
1566
|
-
const jsonOutput = {
|
|
1567
|
-
communities,
|
|
1568
|
-
statistics: result.statistics,
|
|
1569
|
-
};
|
|
1570
|
-
if (outputFile) {
|
|
1571
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1572
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1573
|
-
}
|
|
1574
|
-
else {
|
|
1575
|
-
output.printJson(jsonOutput);
|
|
1576
|
-
}
|
|
1577
|
-
return { success: true, data: jsonOutput };
|
|
1578
|
-
}
|
|
1579
|
-
if (format === 'dot') {
|
|
1580
|
-
const dotOutput = analyzer.exportToDot(result, {
|
|
1581
|
-
includeLabels: true,
|
|
1582
|
-
colorByCommunity: true,
|
|
1583
|
-
highlightCycles: true,
|
|
1584
|
-
});
|
|
1585
|
-
if (outputFile) {
|
|
1586
|
-
await writeFile(outputFile, dotOutput);
|
|
1587
|
-
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1588
|
-
output.writeln(output.dim('Visualize with: dot -Tpng -o modules.png ' + outputFile));
|
|
1589
|
-
}
|
|
1590
|
-
else {
|
|
1591
|
-
output.writeln(dotOutput);
|
|
1592
|
-
}
|
|
1593
|
-
return { success: true };
|
|
1594
|
-
}
|
|
1595
|
-
// Text format (default)
|
|
1596
|
-
output.printBox([
|
|
1597
|
-
`Files analyzed: ${result.statistics.nodeCount}`,
|
|
1598
|
-
`Dependencies: ${result.statistics.edgeCount}`,
|
|
1599
|
-
`Communities found: ${result.communities?.length || 0}`,
|
|
1600
|
-
`Showing: ${communities.length} (min size: ${minSize})`,
|
|
1601
|
-
].join('\n'), 'Module Detection Results');
|
|
1602
|
-
if (communities.length > 0) {
|
|
1603
|
-
output.writeln();
|
|
1604
|
-
output.writeln(output.bold('Detected Communities'));
|
|
1605
|
-
output.writeln();
|
|
1606
|
-
for (const community of communities.slice(0, 10)) {
|
|
1607
|
-
const cohesionIndicator = community.cohesion > 0.5 ? output.success('High') :
|
|
1608
|
-
community.cohesion > 0.2 ? output.warning('Medium') : output.dim('Low');
|
|
1609
|
-
output.writeln(output.bold(`Community ${community.id}: ${community.suggestedName || 'unnamed'}`));
|
|
1610
|
-
output.writeln(` ${output.dim('Cohesion:')} ${cohesionIndicator} (${(community.cohesion * 100).toFixed(1)}%)`);
|
|
1611
|
-
output.writeln(` ${output.dim('Central node:')} ${community.centralNode || 'none'}`);
|
|
1612
|
-
output.writeln(` ${output.dim('Members:')} ${community.members.length} files`);
|
|
1613
|
-
const displayMembers = community.members.slice(0, 5);
|
|
1614
|
-
for (const member of displayMembers) {
|
|
1615
|
-
output.writeln(` - ${member}`);
|
|
1616
|
-
}
|
|
1617
|
-
if (community.members.length > 5) {
|
|
1618
|
-
output.writeln(output.dim(` ... and ${community.members.length - 5} more`));
|
|
1619
|
-
}
|
|
1620
|
-
output.writeln();
|
|
1621
|
-
}
|
|
1622
|
-
if (communities.length > 10) {
|
|
1623
|
-
output.writeln(output.dim(`... and ${communities.length - 10} more communities`));
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
if (outputFile) {
|
|
1627
|
-
await writeFile(outputFile, JSON.stringify(result, null, 2));
|
|
1628
|
-
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1629
|
-
}
|
|
1630
|
-
return { success: true, data: result };
|
|
1631
|
-
}
|
|
1632
|
-
catch (error) {
|
|
1633
|
-
spinner.stop();
|
|
1634
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1635
|
-
output.printError(`Analysis failed: ${message}`);
|
|
1636
|
-
return { success: false, exitCode: 1 };
|
|
1637
|
-
}
|
|
1638
|
-
},
|
|
1639
|
-
};
|
|
1640
|
-
/**
|
|
1641
|
-
* Build and export dependency graph
|
|
1642
|
-
*/
|
|
1643
|
-
const dependenciesCommand = {
|
|
1644
|
-
name: 'dependencies',
|
|
1645
|
-
aliases: ['graph'],
|
|
1646
|
-
description: 'Build and export full dependency graph',
|
|
1647
|
-
options: [
|
|
1648
|
-
{
|
|
1649
|
-
name: 'output',
|
|
1650
|
-
short: 'o',
|
|
1651
|
-
description: 'Output file path',
|
|
1652
|
-
type: 'string',
|
|
1653
|
-
},
|
|
1654
|
-
{
|
|
1655
|
-
name: 'format',
|
|
1656
|
-
short: 'f',
|
|
1657
|
-
description: 'Output format (text, json, dot)',
|
|
1658
|
-
type: 'string',
|
|
1659
|
-
default: 'text',
|
|
1660
|
-
choices: ['text', 'json', 'dot'],
|
|
1661
|
-
},
|
|
1662
|
-
{
|
|
1663
|
-
name: 'include',
|
|
1664
|
-
short: 'i',
|
|
1665
|
-
description: 'File extensions to include (comma-separated)',
|
|
1666
|
-
type: 'string',
|
|
1667
|
-
default: '.ts,.tsx,.js,.jsx,.mjs,.cjs',
|
|
1668
|
-
},
|
|
1669
|
-
{
|
|
1670
|
-
name: 'exclude',
|
|
1671
|
-
short: 'e',
|
|
1672
|
-
description: 'Patterns to exclude (comma-separated)',
|
|
1673
|
-
type: 'string',
|
|
1674
|
-
default: 'node_modules,dist,build,.git',
|
|
1675
|
-
},
|
|
1676
|
-
{
|
|
1677
|
-
name: 'depth',
|
|
1678
|
-
short: 'd',
|
|
1679
|
-
description: 'Maximum directory depth',
|
|
1680
|
-
type: 'number',
|
|
1681
|
-
default: 10,
|
|
1682
|
-
},
|
|
1683
|
-
],
|
|
1684
|
-
examples: [
|
|
1685
|
-
{ command: 'monomind analyze dependencies src/', description: 'Build dependency graph' },
|
|
1686
|
-
{ command: 'monomind analyze dependencies -f dot -o deps.dot src/', description: 'Export to DOT' },
|
|
1687
|
-
{ command: 'monomind analyze dependencies -i .ts,.tsx src/', description: 'Only TypeScript files' },
|
|
1688
|
-
],
|
|
1689
|
-
action: async (ctx) => {
|
|
1690
|
-
const targetDir = ctx.args[0] || ctx.cwd;
|
|
1691
|
-
const outputFile = ctx.flags.output;
|
|
1692
|
-
const format = ctx.flags.format || 'text';
|
|
1693
|
-
const include = (ctx.flags.include || '.ts,.tsx,.js,.jsx,.mjs,.cjs').split(',');
|
|
1694
|
-
const exclude = (ctx.flags.exclude || 'node_modules,dist,build,.git').split(',');
|
|
1695
|
-
const maxDepth = ctx.flags.depth || 10;
|
|
1696
|
-
output.printInfo(`Building dependency graph for: ${output.highlight(targetDir)}`);
|
|
1697
|
-
output.writeln();
|
|
1698
|
-
const spinner = output.createSpinner({ text: 'Scanning files...', spinner: 'dots' });
|
|
1699
|
-
spinner.start();
|
|
1700
|
-
try {
|
|
1701
|
-
const analyzer = await getGraphAnalyzer();
|
|
1702
|
-
if (!analyzer) {
|
|
1703
|
-
spinner.stop();
|
|
1704
|
-
output.printError('Graph analyzer module not available');
|
|
1705
|
-
return { success: false, exitCode: 1 };
|
|
1706
|
-
}
|
|
1707
|
-
const graph = await analyzer.buildDependencyGraph(resolve(targetDir), {
|
|
1708
|
-
include,
|
|
1709
|
-
exclude,
|
|
1710
|
-
maxDepth,
|
|
1711
|
-
});
|
|
1712
|
-
spinner.stop();
|
|
1713
|
-
// Detect circular dependencies
|
|
1714
|
-
const circularDeps = analyzer.detectCircularDependencies(graph);
|
|
1715
|
-
// Handle different output formats
|
|
1716
|
-
if (format === 'json') {
|
|
1717
|
-
const jsonOutput = {
|
|
1718
|
-
nodes: Array.from(graph.nodes.values()),
|
|
1719
|
-
edges: graph.edges,
|
|
1720
|
-
metadata: graph.metadata,
|
|
1721
|
-
circularDependencies: circularDeps,
|
|
1722
|
-
};
|
|
1723
|
-
if (outputFile) {
|
|
1724
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1725
|
-
output.printSuccess(`Graph written to ${outputFile}`);
|
|
1726
|
-
}
|
|
1727
|
-
else {
|
|
1728
|
-
output.printJson(jsonOutput);
|
|
1729
|
-
}
|
|
1730
|
-
return { success: true, data: jsonOutput };
|
|
1731
|
-
}
|
|
1732
|
-
if (format === 'dot') {
|
|
1733
|
-
const result = { graph, circularDependencies: circularDeps, statistics: {
|
|
1734
|
-
nodeCount: graph.nodes.size,
|
|
1735
|
-
edgeCount: graph.edges.length,
|
|
1736
|
-
avgDegree: 0,
|
|
1737
|
-
maxDegree: 0,
|
|
1738
|
-
density: 0,
|
|
1739
|
-
componentCount: 0,
|
|
1740
|
-
} };
|
|
1741
|
-
const dotOutput = analyzer.exportToDot(result, {
|
|
1742
|
-
includeLabels: true,
|
|
1743
|
-
highlightCycles: true,
|
|
1744
|
-
});
|
|
1745
|
-
if (outputFile) {
|
|
1746
|
-
await writeFile(outputFile, dotOutput);
|
|
1747
|
-
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1748
|
-
output.writeln(output.dim('Visualize with: dot -Tpng -o deps.png ' + outputFile));
|
|
1749
|
-
}
|
|
1750
|
-
else {
|
|
1751
|
-
output.writeln(dotOutput);
|
|
1752
|
-
}
|
|
1753
|
-
return { success: true };
|
|
1754
|
-
}
|
|
1755
|
-
// Text format (default)
|
|
1756
|
-
output.printBox([
|
|
1757
|
-
`Files: ${graph.metadata.totalFiles}`,
|
|
1758
|
-
`Dependencies: ${graph.metadata.totalEdges}`,
|
|
1759
|
-
`Build time: ${graph.metadata.buildTime}ms`,
|
|
1760
|
-
`Root: ${graph.metadata.rootDir}`,
|
|
1761
|
-
].join('\n'), 'Dependency Graph');
|
|
1762
|
-
// Show top files by imports
|
|
1763
|
-
output.writeln();
|
|
1764
|
-
output.writeln(output.bold('Most Connected Files'));
|
|
1765
|
-
output.writeln();
|
|
1766
|
-
const nodesByDegree = Array.from(graph.nodes.values())
|
|
1767
|
-
.map(n => ({
|
|
1768
|
-
...n,
|
|
1769
|
-
degree: graph.edges.filter(e => e.source === n.id || e.target === n.id).length,
|
|
1770
|
-
}))
|
|
1771
|
-
.sort((a, b) => b.degree - a.degree)
|
|
1772
|
-
.slice(0, 10);
|
|
1773
|
-
output.printTable({
|
|
1774
|
-
columns: [
|
|
1775
|
-
{ key: 'path', header: 'File', width: 50 },
|
|
1776
|
-
{ key: 'degree', header: 'Connections', width: 12, align: 'right' },
|
|
1777
|
-
{ key: 'complexity', header: 'Complexity', width: 12, align: 'right' },
|
|
1778
|
-
],
|
|
1779
|
-
data: nodesByDegree.map(n => ({
|
|
1780
|
-
path: n.path.length > 48 ? '...' + n.path.slice(-45) : n.path,
|
|
1781
|
-
degree: n.degree,
|
|
1782
|
-
complexity: n.complexity || 0,
|
|
1783
|
-
})),
|
|
1784
|
-
});
|
|
1785
|
-
// Show circular dependencies
|
|
1786
|
-
if (circularDeps.length > 0) {
|
|
1787
|
-
output.writeln();
|
|
1788
|
-
output.writeln(output.bold(output.warning(`Circular Dependencies: ${circularDeps.length}`)));
|
|
1789
|
-
output.writeln();
|
|
1790
|
-
for (const cycle of circularDeps.slice(0, 3)) {
|
|
1791
|
-
output.writeln(` ${cycle.cycle.join(' -> ')}`);
|
|
1792
|
-
}
|
|
1793
|
-
if (circularDeps.length > 3) {
|
|
1794
|
-
output.writeln(output.dim(` ... and ${circularDeps.length - 3} more`));
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
if (outputFile) {
|
|
1798
|
-
const fullOutput = {
|
|
1799
|
-
nodes: Array.from(graph.nodes.values()),
|
|
1800
|
-
edges: graph.edges,
|
|
1801
|
-
metadata: graph.metadata,
|
|
1802
|
-
circularDependencies: circularDeps,
|
|
1803
|
-
};
|
|
1804
|
-
await writeFile(outputFile, JSON.stringify(fullOutput, null, 2));
|
|
1805
|
-
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1806
|
-
}
|
|
1807
|
-
return { success: true };
|
|
1808
|
-
}
|
|
1809
|
-
catch (error) {
|
|
1810
|
-
spinner.stop();
|
|
1811
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1812
|
-
output.printError(`Analysis failed: ${message}`);
|
|
1813
|
-
return { success: false, exitCode: 1 };
|
|
1814
|
-
}
|
|
1815
|
-
},
|
|
1816
|
-
};
|
|
1817
|
-
/**
|
|
1818
|
-
* Detect circular dependencies
|
|
1819
|
-
*/
|
|
1820
|
-
const circularCommand = {
|
|
1821
|
-
name: 'circular',
|
|
1822
|
-
aliases: ['cycles'],
|
|
1823
|
-
description: 'Detect circular dependencies in codebase',
|
|
1824
|
-
options: [
|
|
1825
|
-
{
|
|
1826
|
-
name: 'output',
|
|
1827
|
-
short: 'o',
|
|
1828
|
-
description: 'Output file path',
|
|
1829
|
-
type: 'string',
|
|
1830
|
-
},
|
|
1831
|
-
{
|
|
1832
|
-
name: 'format',
|
|
1833
|
-
short: 'f',
|
|
1834
|
-
description: 'Output format (text, json)',
|
|
1835
|
-
type: 'string',
|
|
1836
|
-
default: 'text',
|
|
1837
|
-
choices: ['text', 'json'],
|
|
1838
|
-
},
|
|
1839
|
-
{
|
|
1840
|
-
name: 'severity',
|
|
1841
|
-
short: 's',
|
|
1842
|
-
description: 'Minimum severity to show (low, medium, high)',
|
|
1843
|
-
type: 'string',
|
|
1844
|
-
default: 'low',
|
|
1845
|
-
choices: ['low', 'medium', 'high'],
|
|
1846
|
-
},
|
|
1847
|
-
],
|
|
1848
|
-
examples: [
|
|
1849
|
-
{ command: 'monomind analyze circular src/', description: 'Find circular dependencies' },
|
|
1850
|
-
{ command: 'monomind analyze circular -s high src/', description: 'Only high severity cycles' },
|
|
1851
|
-
],
|
|
1852
|
-
action: async (ctx) => {
|
|
1853
|
-
const targetDir = ctx.args[0] || ctx.cwd;
|
|
1854
|
-
const outputFile = ctx.flags.output;
|
|
1855
|
-
const format = ctx.flags.format || 'text';
|
|
1856
|
-
const minSeverity = ctx.flags.severity || 'low';
|
|
1857
|
-
output.printInfo(`Detecting circular dependencies in: ${output.highlight(targetDir)}`);
|
|
1858
|
-
output.writeln();
|
|
1859
|
-
const spinner = output.createSpinner({ text: 'Analyzing dependencies...', spinner: 'dots' });
|
|
1860
|
-
spinner.start();
|
|
1861
|
-
try {
|
|
1862
|
-
const analyzer = await getGraphAnalyzer();
|
|
1863
|
-
if (!analyzer) {
|
|
1864
|
-
spinner.stop();
|
|
1865
|
-
output.printError('Graph analyzer module not available');
|
|
1866
|
-
return { success: false, exitCode: 1 };
|
|
1867
|
-
}
|
|
1868
|
-
const graph = await analyzer.buildDependencyGraph(resolve(targetDir));
|
|
1869
|
-
const cycles = analyzer.detectCircularDependencies(graph);
|
|
1870
|
-
spinner.stop();
|
|
1871
|
-
// Filter by severity
|
|
1872
|
-
const severityOrder = { low: 0, medium: 1, high: 2 };
|
|
1873
|
-
const minLevel = severityOrder[minSeverity] || 0;
|
|
1874
|
-
const filtered = cycles.filter(c => severityOrder[c.severity] >= minLevel);
|
|
1875
|
-
if (format === 'json') {
|
|
1876
|
-
const jsonOutput = { cycles: filtered, total: cycles.length, filtered: filtered.length };
|
|
1877
|
-
if (outputFile) {
|
|
1878
|
-
await writeFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1879
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1880
|
-
}
|
|
1881
|
-
else {
|
|
1882
|
-
output.printJson(jsonOutput);
|
|
1883
|
-
}
|
|
1884
|
-
return { success: true, data: jsonOutput };
|
|
1885
|
-
}
|
|
1886
|
-
// Text format
|
|
1887
|
-
if (filtered.length === 0) {
|
|
1888
|
-
output.printSuccess('No circular dependencies found!');
|
|
1889
|
-
return { success: true };
|
|
1890
|
-
}
|
|
1891
|
-
output.printBox([
|
|
1892
|
-
`Total cycles: ${cycles.length}`,
|
|
1893
|
-
`Shown (${minSeverity}+): ${filtered.length}`,
|
|
1894
|
-
`High severity: ${cycles.filter(c => c.severity === 'high').length}`,
|
|
1895
|
-
`Medium severity: ${cycles.filter(c => c.severity === 'medium').length}`,
|
|
1896
|
-
`Low severity: ${cycles.filter(c => c.severity === 'low').length}`,
|
|
1897
|
-
].join('\n'), 'Circular Dependencies');
|
|
1898
|
-
output.writeln();
|
|
1899
|
-
// Group by severity
|
|
1900
|
-
const grouped = {
|
|
1901
|
-
high: filtered.filter(c => c.severity === 'high'),
|
|
1902
|
-
medium: filtered.filter(c => c.severity === 'medium'),
|
|
1903
|
-
low: filtered.filter(c => c.severity === 'low'),
|
|
1904
|
-
};
|
|
1905
|
-
for (const [severity, items] of Object.entries(grouped)) {
|
|
1906
|
-
if (items.length === 0)
|
|
1907
|
-
continue;
|
|
1908
|
-
const color = severity === 'high' ? output.error : severity === 'medium' ? output.warning : output.dim;
|
|
1909
|
-
output.writeln(color(output.bold(`${severity.toUpperCase()} SEVERITY (${items.length})`)));
|
|
1910
|
-
output.writeln();
|
|
1911
|
-
for (const cycle of items.slice(0, 5)) {
|
|
1912
|
-
output.writeln(` ${cycle.cycle.join(' -> ')}`);
|
|
1913
|
-
output.writeln(output.dim(` Fix: ${cycle.suggestion}`));
|
|
1914
|
-
output.writeln();
|
|
1915
|
-
}
|
|
1916
|
-
if (items.length > 5) {
|
|
1917
|
-
output.writeln(output.dim(` ... and ${items.length - 5} more ${severity} cycles`));
|
|
1918
|
-
output.writeln();
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
if (outputFile) {
|
|
1922
|
-
await writeFile(outputFile, JSON.stringify({ cycles: filtered }, null, 2));
|
|
1923
|
-
output.printSuccess(`Results written to ${outputFile}`);
|
|
1924
|
-
}
|
|
1925
|
-
return { success: true, data: { cycles: filtered } };
|
|
1926
|
-
}
|
|
1927
|
-
catch (error) {
|
|
1928
|
-
spinner.stop();
|
|
1929
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1930
|
-
output.printError(`Analysis failed: ${message}`);
|
|
1931
|
-
return { success: false, exitCode: 1 };
|
|
1932
|
-
}
|
|
1933
|
-
},
|
|
1934
|
-
};
|
|
1935
|
-
// Helper functions
|
|
1936
|
-
function getRiskDisplay(risk) {
|
|
1937
|
-
switch (risk) {
|
|
1938
|
-
case 'critical':
|
|
1939
|
-
return output.color(output.bold('CRITICAL'), 'bgRed', 'white');
|
|
1940
|
-
case 'high-risk':
|
|
1941
|
-
return output.error('HIGH');
|
|
1942
|
-
case 'medium-risk':
|
|
1943
|
-
return output.warning('MEDIUM');
|
|
1944
|
-
case 'low-risk':
|
|
1945
|
-
return output.success('LOW');
|
|
1946
|
-
default:
|
|
1947
|
-
return risk;
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
function getStatusDisplay(status) {
|
|
1951
|
-
switch (status) {
|
|
1952
|
-
case 'added':
|
|
1953
|
-
return output.success('A');
|
|
1954
|
-
case 'modified':
|
|
1955
|
-
return output.warning('M');
|
|
1956
|
-
case 'deleted':
|
|
1957
|
-
return output.error('D');
|
|
1958
|
-
case 'renamed':
|
|
1959
|
-
return output.info('R');
|
|
1960
|
-
default:
|
|
1961
|
-
return status;
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
// Main analyze command
|
|
1965
|
-
export const analyzeCommand = {
|
|
1966
|
-
name: 'analyze',
|
|
1967
|
-
description: 'Code analysis, diff classification, graph boundaries, and change risk assessment',
|
|
1968
|
-
aliases: ['an'],
|
|
1969
|
-
subcommands: [
|
|
1970
|
-
diffCommand,
|
|
1971
|
-
codeCommand,
|
|
1972
|
-
depsCommand,
|
|
1973
|
-
astCommand,
|
|
1974
|
-
complexityAstCommand,
|
|
1975
|
-
symbolsCommand,
|
|
1976
|
-
importsCommand,
|
|
1977
|
-
boundariesCommand,
|
|
1978
|
-
modulesCommand,
|
|
1979
|
-
dependenciesCommand,
|
|
1980
|
-
circularCommand,
|
|
1981
|
-
],
|
|
1982
|
-
options: [
|
|
1983
|
-
{
|
|
1984
|
-
name: 'format',
|
|
1985
|
-
short: 'f',
|
|
1986
|
-
description: 'Output format: text, json, table',
|
|
1987
|
-
type: 'string',
|
|
1988
|
-
default: 'text',
|
|
1989
|
-
},
|
|
1990
|
-
],
|
|
1991
|
-
examples: [
|
|
1992
|
-
{ command: 'monomind analyze ast src/', description: 'Analyze code with AST parsing' },
|
|
1993
|
-
{ command: 'monomind analyze complexity src/ --threshold 15', description: 'Find high-complexity files' },
|
|
1994
|
-
{ command: 'monomind analyze symbols src/ --type function', description: 'Extract all functions' },
|
|
1995
|
-
{ command: 'monomind analyze imports src/ --external', description: 'List npm dependencies' },
|
|
1996
|
-
{ command: 'monomind analyze diff --risk', description: 'Analyze diff with risk assessment' },
|
|
1997
|
-
{ command: 'monomind analyze boundaries src/', description: 'Find code boundaries using MinCut' },
|
|
1998
|
-
{ command: 'monomind analyze modules src/', description: 'Detect module communities with Louvain' },
|
|
1999
|
-
{ command: 'monomind analyze dependencies src/ --format dot', description: 'Export dependency graph as DOT' },
|
|
2000
|
-
{ command: 'monomind analyze circular src/', description: 'Find circular dependencies' },
|
|
2001
|
-
{ command: 'monomind analyze deps --security', description: 'Check dependency vulnerabilities' },
|
|
2002
|
-
],
|
|
2003
|
-
action: async (ctx) => {
|
|
2004
|
-
// If no subcommand, show help
|
|
2005
|
-
output.writeln();
|
|
2006
|
-
output.writeln(output.bold('Analyze Commands'));
|
|
2007
|
-
output.writeln(output.dim('-'.repeat(50)));
|
|
2008
|
-
output.writeln();
|
|
2009
|
-
output.writeln(output.bold('Available subcommands:'));
|
|
2010
|
-
output.writeln();
|
|
2011
|
-
output.writeln(` ${output.highlight('diff')} Analyze git diff for change risk and classification`);
|
|
2012
|
-
output.writeln(` ${output.highlight('code')} Static code analysis and quality assessment`);
|
|
2013
|
-
output.writeln(` ${output.highlight('deps')} Analyze project dependencies`);
|
|
2014
|
-
output.writeln(` ${output.highlight('ast')} AST analysis with symbol extraction and complexity`);
|
|
2015
|
-
output.writeln(` ${output.highlight('complexity')} Analyze cyclomatic and cognitive complexity`);
|
|
2016
|
-
output.writeln(` ${output.highlight('symbols')} Extract functions, classes, and types`);
|
|
2017
|
-
output.writeln(` ${output.highlight('imports')} Analyze import dependencies`);
|
|
2018
|
-
output.writeln(` ${output.highlight('boundaries')} Find code boundaries using MinCut algorithm`);
|
|
2019
|
-
output.writeln(` ${output.highlight('modules')} Detect module communities using Louvain algorithm`);
|
|
2020
|
-
output.writeln(` ${output.highlight('dependencies')} Build and export full dependency graph`);
|
|
2021
|
-
output.writeln(` ${output.highlight('circular')} Detect circular dependencies in codebase`);
|
|
2022
|
-
output.writeln();
|
|
2023
|
-
output.writeln(output.bold('AST Analysis Examples:'));
|
|
2024
|
-
output.writeln();
|
|
2025
|
-
output.writeln(` ${output.dim('monomind analyze ast src/')} # Full AST analysis`);
|
|
2026
|
-
output.writeln(` ${output.dim('monomind analyze ast src/index.ts -c')} # Include complexity`);
|
|
2027
|
-
output.writeln(` ${output.dim('monomind analyze complexity src/ -t 15')} # Flag high complexity`);
|
|
2028
|
-
output.writeln(` ${output.dim('monomind analyze symbols src/ --type fn')} # Extract functions`);
|
|
2029
|
-
output.writeln(` ${output.dim('monomind analyze imports src/ --external')} # Only npm imports`);
|
|
2030
|
-
output.writeln();
|
|
2031
|
-
output.writeln(output.bold('Graph Analysis Examples:'));
|
|
2032
|
-
output.writeln();
|
|
2033
|
-
output.writeln(` ${output.dim('monomind analyze boundaries src/')} # Find natural code boundaries`);
|
|
2034
|
-
output.writeln(` ${output.dim('monomind analyze modules src/')} # Detect module communities`);
|
|
2035
|
-
output.writeln(` ${output.dim('monomind analyze dependencies -f dot src/')} # Export to DOT format`);
|
|
2036
|
-
output.writeln(` ${output.dim('monomind analyze circular src/')} # Find circular deps`);
|
|
2037
|
-
output.writeln();
|
|
2038
|
-
output.writeln(output.bold('Diff Analysis Examples:'));
|
|
2039
|
-
output.writeln();
|
|
2040
|
-
output.writeln(` ${output.dim('monomind analyze diff --risk')} # Risk assessment`);
|
|
2041
|
-
output.writeln(` ${output.dim('monomind analyze diff HEAD~1 --classify')} # Classify changes`);
|
|
2042
|
-
output.writeln(` ${output.dim('monomind analyze diff main..feature')} # Compare branches`);
|
|
2043
|
-
output.writeln();
|
|
2044
|
-
return { success: true };
|
|
2045
|
-
},
|
|
2046
|
-
};
|
|
2047
|
-
export default analyzeCommand;
|
|
2048
|
-
//# sourceMappingURL=analyze.js.map
|