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