agentic-qe 3.3.0 → 3.3.2
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/README.md +6 -2
- package/package.json +6 -1
- package/v3/CHANGELOG.md +134 -0
- package/v3/dist/cli/bundle.js +29332 -22739
- package/v3/dist/cli/command-registry.d.ts +55 -0
- package/v3/dist/cli/command-registry.d.ts.map +1 -0
- package/v3/dist/cli/command-registry.js +103 -0
- package/v3/dist/cli/command-registry.js.map +1 -0
- package/v3/dist/cli/commands/code.d.ts +9 -0
- package/v3/dist/cli/commands/code.d.ts.map +1 -0
- package/v3/dist/cli/commands/code.js +254 -0
- package/v3/dist/cli/commands/code.js.map +1 -0
- package/v3/dist/cli/commands/completions.d.ts +8 -0
- package/v3/dist/cli/commands/completions.d.ts.map +1 -0
- package/v3/dist/cli/commands/completions.js +99 -0
- package/v3/dist/cli/commands/completions.js.map +1 -0
- package/v3/dist/cli/commands/coverage.d.ts +9 -0
- package/v3/dist/cli/commands/coverage.d.ts.map +1 -0
- package/v3/dist/cli/commands/coverage.js +208 -0
- package/v3/dist/cli/commands/coverage.js.map +1 -0
- package/v3/dist/cli/commands/fleet.d.ts +11 -0
- package/v3/dist/cli/commands/fleet.d.ts.map +1 -0
- package/v3/dist/cli/commands/fleet.js +338 -0
- package/v3/dist/cli/commands/fleet.js.map +1 -0
- package/v3/dist/cli/commands/migrate.d.ts +9 -0
- package/v3/dist/cli/commands/migrate.d.ts.map +1 -0
- package/v3/dist/cli/commands/migrate.js +566 -0
- package/v3/dist/cli/commands/migrate.js.map +1 -0
- package/v3/dist/cli/commands/quality.d.ts +9 -0
- package/v3/dist/cli/commands/quality.d.ts.map +1 -0
- package/v3/dist/cli/commands/quality.js +40 -0
- package/v3/dist/cli/commands/quality.js.map +1 -0
- package/v3/dist/cli/commands/security.d.ts +9 -0
- package/v3/dist/cli/commands/security.d.ts.map +1 -0
- package/v3/dist/cli/commands/security.js +124 -0
- package/v3/dist/cli/commands/security.js.map +1 -0
- package/v3/dist/cli/commands/sync.d.ts +19 -0
- package/v3/dist/cli/commands/sync.d.ts.map +1 -0
- package/v3/dist/cli/commands/sync.js +283 -0
- package/v3/dist/cli/commands/sync.js.map +1 -0
- package/v3/dist/cli/commands/test.d.ts +9 -0
- package/v3/dist/cli/commands/test.d.ts.map +1 -0
- package/v3/dist/cli/commands/test.js +166 -0
- package/v3/dist/cli/commands/test.js.map +1 -0
- package/v3/dist/cli/handlers/agent-handler.d.ts +20 -0
- package/v3/dist/cli/handlers/agent-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/agent-handler.js +158 -0
- package/v3/dist/cli/handlers/agent-handler.js.map +1 -0
- package/v3/dist/cli/handlers/domain-handler.d.ts +20 -0
- package/v3/dist/cli/handlers/domain-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/domain-handler.js +115 -0
- package/v3/dist/cli/handlers/domain-handler.js.map +1 -0
- package/v3/dist/cli/handlers/index.d.ts +13 -0
- package/v3/dist/cli/handlers/index.d.ts.map +1 -0
- package/v3/dist/cli/handlers/index.js +15 -0
- package/v3/dist/cli/handlers/index.js.map +1 -0
- package/v3/dist/cli/handlers/init-handler.d.ts +38 -0
- package/v3/dist/cli/handlers/init-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/init-handler.js +288 -0
- package/v3/dist/cli/handlers/init-handler.js.map +1 -0
- package/v3/dist/cli/handlers/interfaces.d.ts +104 -0
- package/v3/dist/cli/handlers/interfaces.d.ts.map +1 -0
- package/v3/dist/cli/handlers/interfaces.js +109 -0
- package/v3/dist/cli/handlers/interfaces.js.map +1 -0
- package/v3/dist/cli/handlers/protocol-handler.d.ts +19 -0
- package/v3/dist/cli/handlers/protocol-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/protocol-handler.js +79 -0
- package/v3/dist/cli/handlers/protocol-handler.js.map +1 -0
- package/v3/dist/cli/handlers/status-handler.d.ts +30 -0
- package/v3/dist/cli/handlers/status-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/status-handler.js +218 -0
- package/v3/dist/cli/handlers/status-handler.js.map +1 -0
- package/v3/dist/cli/handlers/task-handler.d.ts +22 -0
- package/v3/dist/cli/handlers/task-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/task-handler.js +271 -0
- package/v3/dist/cli/handlers/task-handler.js.map +1 -0
- package/v3/dist/cli/index.d.ts +4 -0
- package/v3/dist/cli/index.d.ts.map +1 -1
- package/v3/dist/cli/index.js +48 -2677
- package/v3/dist/cli/index.js.map +1 -1
- package/v3/dist/cli/wizards/core/index.d.ts +11 -0
- package/v3/dist/cli/wizards/core/index.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/index.js +15 -0
- package/v3/dist/cli/wizards/core/index.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-base.d.ts +87 -0
- package/v3/dist/cli/wizards/core/wizard-base.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-base.js +120 -0
- package/v3/dist/cli/wizards/core/wizard-base.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-command.d.ts +182 -0
- package/v3/dist/cli/wizards/core/wizard-command.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-command.js +45 -0
- package/v3/dist/cli/wizards/core/wizard-command.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-step.d.ts +109 -0
- package/v3/dist/cli/wizards/core/wizard-step.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-step.js +384 -0
- package/v3/dist/cli/wizards/core/wizard-step.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-utils.d.ts +117 -0
- package/v3/dist/cli/wizards/core/wizard-utils.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-utils.js +291 -0
- package/v3/dist/cli/wizards/core/wizard-utils.js.map +1 -0
- package/v3/dist/cli/wizards/coverage-wizard.d.ts +13 -68
- package/v3/dist/cli/wizards/coverage-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/coverage-wizard.js +127 -391
- package/v3/dist/cli/wizards/coverage-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/fleet-wizard.d.ts +13 -64
- package/v3/dist/cli/wizards/fleet-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/fleet-wizard.js +150 -363
- package/v3/dist/cli/wizards/fleet-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/index.d.ts +2 -0
- package/v3/dist/cli/wizards/index.d.ts.map +1 -1
- package/v3/dist/cli/wizards/index.js +3 -0
- package/v3/dist/cli/wizards/index.js.map +1 -1
- package/v3/dist/cli/wizards/security-wizard.d.ts +13 -64
- package/v3/dist/cli/wizards/security-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/security-wizard.js +152 -395
- package/v3/dist/cli/wizards/security-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.d.ts +13 -77
- package/v3/dist/cli/wizards/test-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.js +196 -328
- package/v3/dist/cli/wizards/test-wizard.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts +3 -0
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.js +6 -2
- package/v3/dist/coordination/mincut/mincut-health-monitor.js.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.d.ts +3 -0
- package/v3/dist/coordination/mincut/queen-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.js +6 -1
- package/v3/dist/coordination/mincut/queen-integration.js.map +1 -1
- package/v3/dist/coordination/queen-coordinator.d.ts +13 -1
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +91 -3
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/coordination/task-executor.js +2 -2
- package/v3/dist/coordination/task-executor.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.js +2 -2
- package/v3/dist/domains/chaos-resilience/plugin.js.map +1 -1
- package/v3/dist/domains/code-intelligence/plugin.js +2 -2
- package/v3/dist/domains/code-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/contract-testing/plugin.js +2 -2
- package/v3/dist/domains/contract-testing/plugin.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts +6 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.js +75 -1
- package/v3/dist/domains/coverage-analysis/plugin.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/plugin.js +2 -2
- package/v3/dist/domains/defect-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/domain-interface.d.ts +39 -2
- package/v3/dist/domains/domain-interface.d.ts.map +1 -1
- package/v3/dist/domains/domain-interface.js +102 -1
- package/v3/dist/domains/domain-interface.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +83 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +174 -0
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/interfaces.d.ts +14 -0
- package/v3/dist/domains/learning-optimization/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/plugin.js +2 -2
- package/v3/dist/domains/learning-optimization/plugin.js.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.d.ts +23 -0
- package/v3/dist/domains/quality-assessment/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.js +139 -1
- package/v3/dist/domains/quality-assessment/coordinator.js.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.d.ts +6 -1
- package/v3/dist/domains/quality-assessment/plugin.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.js +69 -2
- package/v3/dist/domains/quality-assessment/plugin.js.map +1 -1
- package/v3/dist/domains/requirements-validation/plugin.js +2 -2
- package/v3/dist/domains/requirements-validation/plugin.js.map +1 -1
- package/v3/dist/domains/security-compliance/plugin.js +2 -2
- package/v3/dist/domains/security-compliance/plugin.js.map +1 -1
- package/v3/dist/domains/test-execution/index.d.ts +2 -1
- package/v3/dist/domains/test-execution/index.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/index.js +0 -2
- package/v3/dist/domains/test-execution/index.js.map +1 -1
- package/v3/dist/domains/test-execution/interfaces.d.ts +222 -25
- package/v3/dist/domains/test-execution/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/interfaces.js +130 -3
- package/v3/dist/domains/test-execution/interfaces.js.map +1 -1
- package/v3/dist/domains/test-execution/plugin.d.ts +6 -1
- package/v3/dist/domains/test-execution/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/plugin.js +79 -1
- package/v3/dist/domains/test-execution/plugin.js.map +1 -1
- package/v3/dist/domains/test-execution/test-prioritization-types.d.ts +5 -172
- package/v3/dist/domains/test-execution/test-prioritization-types.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/test-prioritization-types.js +6 -129
- package/v3/dist/domains/test-execution/test-prioritization-types.js.map +1 -1
- package/v3/dist/domains/test-execution/types/index.d.ts +7 -3
- package/v3/dist/domains/test-execution/types/index.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/types/index.js +7 -17
- package/v3/dist/domains/test-execution/types/index.js.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts +41 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +187 -4
- package/v3/dist/domains/test-generation/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/factories/index.d.ts +8 -0
- package/v3/dist/domains/test-generation/factories/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/factories/index.js +8 -0
- package/v3/dist/domains/test-generation/factories/index.js.map +1 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.d.ts +108 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.js +158 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts +79 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.js +252 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/index.d.ts +11 -0
- package/v3/dist/domains/test-generation/generators/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/index.js +13 -0
- package/v3/dist/domains/test-generation/generators/index.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.d.ts +77 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js +365 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts +56 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.js +197 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts +66 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.js +240 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/index.d.ts +2 -2
- package/v3/dist/domains/test-generation/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/index.js +3 -3
- package/v3/dist/domains/test-generation/index.js.map +1 -1
- package/v3/dist/domains/test-generation/interfaces/index.d.ts +9 -0
- package/v3/dist/domains/test-generation/interfaces/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/index.js +9 -0
- package/v3/dist/domains/test-generation/interfaces/index.js.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.d.ts +166 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.js +8 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.js.map +1 -0
- package/v3/dist/domains/test-generation/interfaces.d.ts +163 -24
- package/v3/dist/domains/test-generation/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/interfaces.js +2 -2
- package/v3/dist/domains/test-generation/plugin.d.ts +6 -1
- package/v3/dist/domains/test-generation/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/plugin.js +90 -5
- package/v3/dist/domains/test-generation/plugin.js.map +1 -1
- package/v3/dist/domains/test-generation/{coherence-gate.d.ts → services/coherence-gate-service.d.ts} +4 -4
- package/v3/dist/domains/test-generation/services/coherence-gate-service.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/{coherence-gate.js → services/coherence-gate-service.js} +2 -2
- package/v3/dist/domains/test-generation/services/coherence-gate-service.js.map +1 -0
- package/v3/dist/domains/test-generation/services/index.d.ts +8 -2
- package/v3/dist/domains/test-generation/services/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/index.js +10 -3
- package/v3/dist/domains/test-generation/services/index.js.map +1 -1
- package/v3/dist/domains/test-generation/services/property-test-generator.d.ts +34 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.js +306 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.d.ts +33 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.js +342 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts +34 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.js +245 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/test-generator.d.ts +51 -160
- package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.js +101 -1858
- package/v3/dist/domains/test-generation/services/test-generator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +2 -2
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/init/phases/12-verification.d.ts +23 -0
- package/v3/dist/init/phases/12-verification.d.ts.map +1 -1
- package/v3/dist/init/phases/12-verification.js +185 -2
- package/v3/dist/init/phases/12-verification.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.d.ts +24 -62
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.js +45 -497
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/router.js +2 -2
- package/v3/dist/integrations/agentic-flow/model-router/router.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.d.ts +98 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.js +197 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.js.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.d.ts +102 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.js +372 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.js.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.d.ts +64 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.js +120 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.js.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts.map +1 -1
- package/v3/dist/integrations/coherence/coherence-service.js +87 -30
- package/v3/dist/integrations/coherence/coherence-service.js.map +1 -1
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts.map +1 -1
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js +124 -35
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +54 -1
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/learning/dream/dream-scheduler.d.ts +302 -0
- package/v3/dist/learning/dream/dream-scheduler.d.ts.map +1 -0
- package/v3/dist/learning/dream/dream-scheduler.js +551 -0
- package/v3/dist/learning/dream/dream-scheduler.js.map +1 -0
- package/v3/dist/learning/dream/index.d.ts +1 -0
- package/v3/dist/learning/dream/index.d.ts.map +1 -1
- package/v3/dist/learning/dream/index.js +4 -0
- package/v3/dist/learning/dream/index.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -1
- package/v3/dist/learning/memory-auditor.js +3 -1
- package/v3/dist/learning/memory-auditor.js.map +1 -1
- package/v3/dist/mcp/bundle.js +30870 -23598
- package/v3/dist/mcp/handlers/core-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.js +16 -2
- package/v3/dist/mcp/handlers/core-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.d.ts +1 -0
- package/v3/dist/mcp/handlers/task-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.js +46 -12
- package/v3/dist/mcp/handlers/task-handlers.js.map +1 -1
- package/v3/dist/mcp/security/cve-prevention.d.ts +31 -134
- package/v3/dist/mcp/security/cve-prevention.d.ts.map +1 -1
- package/v3/dist/mcp/security/cve-prevention.js +37 -562
- package/v3/dist/mcp/security/cve-prevention.js.map +1 -1
- package/v3/dist/mcp/security/index.d.ts +5 -1
- package/v3/dist/mcp/security/index.d.ts.map +1 -1
- package/v3/dist/mcp/security/validators/command-validator.d.ts +41 -0
- package/v3/dist/mcp/security/validators/command-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/command-validator.js +123 -0
- package/v3/dist/mcp/security/validators/command-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/crypto-validator.d.ts +40 -0
- package/v3/dist/mcp/security/validators/crypto-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/crypto-validator.js +72 -0
- package/v3/dist/mcp/security/validators/crypto-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/index.d.ts +12 -0
- package/v3/dist/mcp/security/validators/index.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/index.js +22 -0
- package/v3/dist/mcp/security/validators/index.js.map +1 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.d.ts +56 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.js +157 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.js.map +1 -0
- package/v3/dist/mcp/security/validators/interfaces.d.ts +164 -0
- package/v3/dist/mcp/security/validators/interfaces.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/interfaces.js +6 -0
- package/v3/dist/mcp/security/validators/interfaces.js.map +1 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.d.ts +50 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.js +242 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.d.ts +50 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.js +183 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.d.ts +66 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.js +146 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.js.map +1 -0
- package/v3/dist/mcp/server.d.ts.map +1 -1
- package/v3/dist/mcp/server.js +1 -0
- package/v3/dist/mcp/server.js.map +1 -1
- package/v3/dist/mcp/services/reasoning-bank-service.d.ts +87 -13
- package/v3/dist/mcp/services/reasoning-bank-service.d.ts.map +1 -1
- package/v3/dist/mcp/services/reasoning-bank-service.js +291 -31
- package/v3/dist/mcp/services/reasoning-bank-service.js.map +1 -1
- package/v3/dist/mcp/tool-registry.d.ts +3 -1
- package/v3/dist/mcp/tool-registry.d.ts.map +1 -1
- package/v3/dist/mcp/tool-registry.js +155 -2
- package/v3/dist/mcp/tool-registry.js.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.d.ts +1 -0
- package/v3/dist/mcp/tools/test-generation/generate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.js +3 -2
- package/v3/dist/mcp/tools/test-generation/generate.js.map +1 -1
- package/v3/dist/routing/qe-agent-registry.d.ts +27 -0
- package/v3/dist/routing/qe-agent-registry.d.ts.map +1 -1
- package/v3/dist/routing/qe-agent-registry.js +96 -0
- package/v3/dist/routing/qe-agent-registry.js.map +1 -1
- package/v3/dist/shared/events/domain-events.d.ts +27 -0
- package/v3/dist/shared/events/domain-events.d.ts.map +1 -1
- package/v3/dist/shared/events/domain-events.js +1 -0
- package/v3/dist/shared/events/domain-events.js.map +1 -1
- package/v3/dist/sync/cloud/index.d.ts +8 -0
- package/v3/dist/sync/cloud/index.d.ts.map +1 -0
- package/v3/dist/sync/cloud/index.js +8 -0
- package/v3/dist/sync/cloud/index.js.map +1 -0
- package/v3/dist/sync/cloud/postgres-writer.d.ts +88 -0
- package/v3/dist/sync/cloud/postgres-writer.d.ts.map +1 -0
- package/v3/dist/sync/cloud/postgres-writer.js +319 -0
- package/v3/dist/sync/cloud/postgres-writer.js.map +1 -0
- package/v3/dist/sync/cloud/tunnel-manager.d.ts +75 -0
- package/v3/dist/sync/cloud/tunnel-manager.d.ts.map +1 -0
- package/v3/dist/sync/cloud/tunnel-manager.js +221 -0
- package/v3/dist/sync/cloud/tunnel-manager.js.map +1 -0
- package/v3/dist/sync/index.d.ts +35 -0
- package/v3/dist/sync/index.d.ts.map +1 -0
- package/v3/dist/sync/index.js +35 -0
- package/v3/dist/sync/index.js.map +1 -0
- package/v3/dist/sync/interfaces.d.ts +245 -0
- package/v3/dist/sync/interfaces.d.ts.map +1 -0
- package/v3/dist/sync/interfaces.js +160 -0
- package/v3/dist/sync/interfaces.js.map +1 -0
- package/v3/dist/sync/readers/index.d.ts +8 -0
- package/v3/dist/sync/readers/index.d.ts.map +1 -0
- package/v3/dist/sync/readers/index.js +8 -0
- package/v3/dist/sync/readers/index.js.map +1 -0
- package/v3/dist/sync/readers/json-reader.d.ts +95 -0
- package/v3/dist/sync/readers/json-reader.d.ts.map +1 -0
- package/v3/dist/sync/readers/json-reader.js +306 -0
- package/v3/dist/sync/readers/json-reader.js.map +1 -0
- package/v3/dist/sync/readers/sqlite-reader.d.ts +88 -0
- package/v3/dist/sync/readers/sqlite-reader.d.ts.map +1 -0
- package/v3/dist/sync/readers/sqlite-reader.js +255 -0
- package/v3/dist/sync/readers/sqlite-reader.js.map +1 -0
- package/v3/dist/sync/sync-agent.d.ts +116 -0
- package/v3/dist/sync/sync-agent.d.ts.map +1 -0
- package/v3/dist/sync/sync-agent.js +416 -0
- package/v3/dist/sync/sync-agent.js.map +1 -0
- package/v3/package.json +13 -2
- package/v3/dist/domains/test-generation/coherence-gate.d.ts.map +0 -1
- package/v3/dist/domains/test-generation/coherence-gate.js.map +0 -1
|
@@ -3,103 +3,38 @@
|
|
|
3
3
|
* ADR-041: V3 QE CLI Enhancement
|
|
4
4
|
*
|
|
5
5
|
* Interactive wizard for test generation with step-by-step configuration.
|
|
6
|
-
*
|
|
6
|
+
* Refactored to use Command Pattern for reduced complexity and better reusability.
|
|
7
7
|
*/
|
|
8
|
-
import { createInterface } from 'readline';
|
|
9
8
|
import chalk from 'chalk';
|
|
10
9
|
import { existsSync, readdirSync, statSync, readFileSync } from 'fs';
|
|
11
10
|
import { join, resolve, relative, extname, basename } from 'path';
|
|
11
|
+
import { BaseWizard, BaseWizardCommand, SingleSelectStep, BooleanStep, NumericStep, WizardPrompt, WizardFormat, WizardSuggestions, } from './core/index.js';
|
|
12
12
|
// ============================================================================
|
|
13
|
-
//
|
|
13
|
+
// Source Files Step (Custom)
|
|
14
14
|
// ============================================================================
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Custom step for source file selection with file resolution
|
|
17
|
+
*/
|
|
18
|
+
class SourceFilesStep extends BaseWizardCommand {
|
|
19
|
+
id = 'sourceFiles';
|
|
20
|
+
stepNumber = '1/6';
|
|
21
|
+
title = 'Source Files';
|
|
22
|
+
description = 'Enter file paths, glob patterns, or directory';
|
|
23
|
+
defaultSourceFiles;
|
|
24
|
+
constructor(defaultSourceFiles) {
|
|
25
|
+
super(defaultSourceFiles);
|
|
26
|
+
this.defaultSourceFiles = defaultSourceFiles;
|
|
21
27
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// Non-interactive mode returns defaults
|
|
27
|
-
if (this.options.nonInteractive) {
|
|
28
|
-
return this.getDefaults();
|
|
29
|
-
}
|
|
30
|
-
const rl = createInterface({
|
|
31
|
-
input: process.stdin,
|
|
32
|
-
output: process.stdout,
|
|
33
|
-
});
|
|
34
|
-
try {
|
|
35
|
-
// Print header
|
|
36
|
-
this.printHeader();
|
|
37
|
-
// Step 1: Source files
|
|
38
|
-
const sourceFiles = await this.promptSourceFiles(rl);
|
|
39
|
-
if (sourceFiles.length === 0) {
|
|
40
|
-
return this.getCancelled();
|
|
41
|
-
}
|
|
42
|
-
// Step 2: Test type
|
|
43
|
-
const testType = await this.promptTestType(rl);
|
|
44
|
-
// Step 3: Coverage target
|
|
45
|
-
const coverageTarget = await this.promptCoverageTarget(rl);
|
|
46
|
-
// Step 4: Framework
|
|
47
|
-
const framework = await this.promptFramework(rl);
|
|
48
|
-
// Step 5: AI enhancement level
|
|
49
|
-
const aiLevel = await this.promptAILevel(rl);
|
|
50
|
-
// Step 6: Anti-pattern detection
|
|
51
|
-
const detectAntiPatterns = await this.promptAntiPatternDetection(rl);
|
|
52
|
-
// Print summary
|
|
53
|
-
this.printSummary({
|
|
54
|
-
sourceFiles,
|
|
55
|
-
testType,
|
|
56
|
-
coverageTarget,
|
|
57
|
-
framework,
|
|
58
|
-
aiLevel,
|
|
59
|
-
detectAntiPatterns,
|
|
60
|
-
cancelled: false,
|
|
61
|
-
});
|
|
62
|
-
// Confirm
|
|
63
|
-
const confirmed = await this.promptConfirmation(rl);
|
|
64
|
-
if (!confirmed) {
|
|
65
|
-
return this.getCancelled();
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
sourceFiles,
|
|
69
|
-
testType,
|
|
70
|
-
coverageTarget,
|
|
71
|
-
framework,
|
|
72
|
-
aiLevel,
|
|
73
|
-
detectAntiPatterns,
|
|
74
|
-
cancelled: false,
|
|
75
|
-
};
|
|
28
|
+
async execute(context) {
|
|
29
|
+
if (context.nonInteractive) {
|
|
30
|
+
const resolved = this.resolveSourceFiles(this.defaultSourceFiles.join(', '), context.cwd);
|
|
31
|
+
return this.success(resolved.length > 0 ? resolved : this.defaultSourceFiles);
|
|
76
32
|
}
|
|
77
|
-
|
|
78
|
-
rl.close();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Print wizard header
|
|
83
|
-
*/
|
|
84
|
-
printHeader() {
|
|
85
|
-
console.log('');
|
|
86
|
-
console.log(chalk.blue('========================================'));
|
|
87
|
-
console.log(chalk.blue.bold(' Test Generation Wizard'));
|
|
88
|
-
console.log(chalk.blue('========================================'));
|
|
89
|
-
console.log(chalk.gray('Generate tests with AI-powered assistance'));
|
|
90
|
-
console.log(chalk.gray('Press Ctrl+C to cancel at any time'));
|
|
91
|
-
console.log('');
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Step 1: Prompt for source files
|
|
95
|
-
*/
|
|
96
|
-
async promptSourceFiles(rl) {
|
|
97
|
-
console.log(chalk.cyan('Step 1/6: Source Files'));
|
|
98
|
-
console.log(chalk.gray('Enter file paths, glob patterns, or directory'));
|
|
33
|
+
WizardPrompt.printStepHeader(this.stepNumber, this.title, this.description);
|
|
99
34
|
console.log(chalk.gray('Examples: src/services/*.ts, ./src/utils, src/auth.ts'));
|
|
100
35
|
console.log('');
|
|
101
|
-
// Show
|
|
102
|
-
const suggestions =
|
|
36
|
+
// Show suggestions
|
|
37
|
+
const suggestions = WizardSuggestions.getTestSourceFiles(context.cwd);
|
|
103
38
|
if (suggestions.length > 0) {
|
|
104
39
|
console.log(chalk.yellow('Suggestions:'));
|
|
105
40
|
suggestions.slice(0, 5).forEach((s, i) => {
|
|
@@ -107,247 +42,28 @@ export class TestGenerationWizard {
|
|
|
107
42
|
});
|
|
108
43
|
console.log('');
|
|
109
44
|
}
|
|
110
|
-
const defaultValue = this.
|
|
111
|
-
const input = await
|
|
45
|
+
const defaultValue = this.defaultSourceFiles.join(', ') || '.';
|
|
46
|
+
const input = await WizardPrompt.prompt(context.rl, `Source files [${chalk.gray(defaultValue)}]: `);
|
|
112
47
|
const value = input.trim() || defaultValue;
|
|
113
48
|
// Parse input into file list
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*/
|
|
119
|
-
async promptTestType(rl) {
|
|
120
|
-
console.log('');
|
|
121
|
-
console.log(chalk.cyan('Step 2/6: Test Type'));
|
|
122
|
-
console.log(chalk.gray('Select the type of tests to generate'));
|
|
123
|
-
console.log('');
|
|
124
|
-
const options = [
|
|
125
|
-
{ key: '1', value: 'unit', description: 'Unit tests - isolated component testing' },
|
|
126
|
-
{ key: '2', value: 'integration', description: 'Integration tests - module interaction testing' },
|
|
127
|
-
{ key: '3', value: 'e2e', description: 'End-to-end tests - full workflow testing' },
|
|
128
|
-
{ key: '4', value: 'property', description: 'Property-based tests - invariant testing' },
|
|
129
|
-
{ key: '5', value: 'contract', description: 'Contract tests - API contract validation' },
|
|
130
|
-
];
|
|
131
|
-
options.forEach(opt => {
|
|
132
|
-
const marker = opt.value === this.options.defaultTestType ? chalk.green(' (default)') : '';
|
|
133
|
-
console.log(chalk.white(` ${opt.key}. ${opt.value}${marker}`));
|
|
134
|
-
console.log(chalk.gray(` ${opt.description}`));
|
|
135
|
-
});
|
|
136
|
-
console.log('');
|
|
137
|
-
const defaultValue = this.options.defaultTestType || 'unit';
|
|
138
|
-
const input = await this.prompt(rl, `Select test type [${chalk.gray(defaultValue)}]: `);
|
|
139
|
-
const value = input.trim();
|
|
140
|
-
if (!value)
|
|
141
|
-
return defaultValue;
|
|
142
|
-
// Check if input is a number
|
|
143
|
-
const numInput = parseInt(value, 10);
|
|
144
|
-
if (numInput >= 1 && numInput <= options.length) {
|
|
145
|
-
return options[numInput - 1].value;
|
|
146
|
-
}
|
|
147
|
-
// Check if input is a valid test type
|
|
148
|
-
const validTypes = ['unit', 'integration', 'e2e', 'property', 'contract'];
|
|
149
|
-
if (validTypes.includes(value)) {
|
|
150
|
-
return value;
|
|
151
|
-
}
|
|
152
|
-
console.log(chalk.yellow(`Invalid input, using default: ${defaultValue}`));
|
|
153
|
-
return defaultValue;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Step 3: Prompt for coverage target
|
|
157
|
-
*/
|
|
158
|
-
async promptCoverageTarget(rl) {
|
|
159
|
-
console.log('');
|
|
160
|
-
console.log(chalk.cyan('Step 3/6: Coverage Target'));
|
|
161
|
-
console.log(chalk.gray('Target code coverage percentage (0-100)'));
|
|
162
|
-
console.log(chalk.gray('Recommended: 80% for new code, 60% for legacy'));
|
|
163
|
-
console.log('');
|
|
164
|
-
const defaultValue = this.options.defaultCoverageTarget || 80;
|
|
165
|
-
const input = await this.prompt(rl, `Coverage target % [${chalk.gray(defaultValue)}]: `);
|
|
166
|
-
const value = input.trim();
|
|
167
|
-
if (!value)
|
|
168
|
-
return defaultValue;
|
|
169
|
-
const numValue = parseInt(value, 10);
|
|
170
|
-
if (isNaN(numValue) || numValue < 0 || numValue > 100) {
|
|
171
|
-
console.log(chalk.yellow(`Invalid input, using default: ${defaultValue}%`));
|
|
172
|
-
return defaultValue;
|
|
173
|
-
}
|
|
174
|
-
return numValue;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Step 4: Prompt for test framework
|
|
178
|
-
*/
|
|
179
|
-
async promptFramework(rl) {
|
|
180
|
-
console.log('');
|
|
181
|
-
console.log(chalk.cyan('Step 4/6: Test Framework'));
|
|
182
|
-
console.log(chalk.gray('Select the testing framework to use'));
|
|
183
|
-
console.log('');
|
|
184
|
-
const options = [
|
|
185
|
-
{ key: '1', value: 'vitest', description: 'Vitest - Fast, Vite-native testing' },
|
|
186
|
-
{ key: '2', value: 'jest', description: 'Jest - Feature-rich, widely adopted' },
|
|
187
|
-
{ key: '3', value: 'mocha', description: 'Mocha - Flexible, configurable' },
|
|
188
|
-
{ key: '4', value: 'playwright', description: 'Playwright - Browser automation (for e2e)' },
|
|
189
|
-
];
|
|
190
|
-
// Detect framework from project
|
|
191
|
-
const detectedFramework = this.detectFramework();
|
|
192
|
-
const defaultValue = this.options.defaultFramework || detectedFramework || 'vitest';
|
|
193
|
-
options.forEach(opt => {
|
|
194
|
-
const marker = opt.value === detectedFramework ? chalk.green(' (detected)') :
|
|
195
|
-
opt.value === defaultValue ? chalk.gray(' (default)') : '';
|
|
196
|
-
console.log(chalk.white(` ${opt.key}. ${opt.value}${marker}`));
|
|
197
|
-
console.log(chalk.gray(` ${opt.description}`));
|
|
198
|
-
});
|
|
199
|
-
console.log('');
|
|
200
|
-
const input = await this.prompt(rl, `Select framework [${chalk.gray(defaultValue)}]: `);
|
|
201
|
-
const value = input.trim();
|
|
202
|
-
if (!value)
|
|
203
|
-
return defaultValue;
|
|
204
|
-
// Check if input is a number
|
|
205
|
-
const numInput = parseInt(value, 10);
|
|
206
|
-
if (numInput >= 1 && numInput <= options.length) {
|
|
207
|
-
return options[numInput - 1].value;
|
|
208
|
-
}
|
|
209
|
-
// Check if input is a valid framework
|
|
210
|
-
const validFrameworks = ['jest', 'vitest', 'mocha', 'playwright'];
|
|
211
|
-
if (validFrameworks.includes(value)) {
|
|
212
|
-
return value;
|
|
213
|
-
}
|
|
214
|
-
console.log(chalk.yellow(`Invalid input, using default: ${defaultValue}`));
|
|
215
|
-
return defaultValue;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Step 5: Prompt for AI enhancement level
|
|
219
|
-
*/
|
|
220
|
-
async promptAILevel(rl) {
|
|
221
|
-
console.log('');
|
|
222
|
-
console.log(chalk.cyan('Step 5/6: AI Enhancement Level'));
|
|
223
|
-
console.log(chalk.gray('Select the level of AI assistance for test generation'));
|
|
224
|
-
console.log('');
|
|
225
|
-
const options = [
|
|
226
|
-
{ key: '1', value: 'none', description: 'None - Template-based generation only' },
|
|
227
|
-
{ key: '2', value: 'basic', description: 'Basic - Simple pattern matching' },
|
|
228
|
-
{ key: '3', value: 'standard', description: 'Standard - AI-powered test suggestions' },
|
|
229
|
-
{ key: '4', value: 'advanced', description: 'Advanced - Full AI with edge case generation' },
|
|
230
|
-
];
|
|
231
|
-
const defaultValue = this.options.defaultAILevel || 'standard';
|
|
232
|
-
options.forEach(opt => {
|
|
233
|
-
const marker = opt.value === defaultValue ? chalk.green(' (recommended)') : '';
|
|
234
|
-
console.log(chalk.white(` ${opt.key}. ${opt.value}${marker}`));
|
|
235
|
-
console.log(chalk.gray(` ${opt.description}`));
|
|
236
|
-
});
|
|
237
|
-
console.log('');
|
|
238
|
-
const input = await this.prompt(rl, `Select AI level [${chalk.gray(defaultValue)}]: `);
|
|
239
|
-
const value = input.trim();
|
|
240
|
-
if (!value)
|
|
241
|
-
return defaultValue;
|
|
242
|
-
// Check if input is a number
|
|
243
|
-
const numInput = parseInt(value, 10);
|
|
244
|
-
if (numInput >= 1 && numInput <= options.length) {
|
|
245
|
-
return options[numInput - 1].value;
|
|
246
|
-
}
|
|
247
|
-
// Check if input is a valid level
|
|
248
|
-
const validLevels = ['none', 'basic', 'standard', 'advanced'];
|
|
249
|
-
if (validLevels.includes(value)) {
|
|
250
|
-
return value;
|
|
251
|
-
}
|
|
252
|
-
console.log(chalk.yellow(`Invalid input, using default: ${defaultValue}`));
|
|
253
|
-
return defaultValue;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Step 6: Prompt for anti-pattern detection
|
|
257
|
-
*/
|
|
258
|
-
async promptAntiPatternDetection(rl) {
|
|
259
|
-
console.log('');
|
|
260
|
-
console.log(chalk.cyan('Step 6/6: Anti-Pattern Detection'));
|
|
261
|
-
console.log(chalk.gray('Enable detection and avoidance of code anti-patterns'));
|
|
262
|
-
console.log('');
|
|
263
|
-
const input = await this.prompt(rl, `Enable anti-pattern detection? [${chalk.gray('Y/n')}]: `);
|
|
264
|
-
const value = input.trim().toLowerCase();
|
|
265
|
-
if (value === 'n' || value === 'no') {
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
return true; // Default to yes
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Prompt for final confirmation
|
|
272
|
-
*/
|
|
273
|
-
async promptConfirmation(rl) {
|
|
274
|
-
console.log('');
|
|
275
|
-
const input = await this.prompt(rl, `${chalk.green('Proceed with test generation?')} [${chalk.gray('Y/n')}]: `);
|
|
276
|
-
const value = input.trim().toLowerCase();
|
|
277
|
-
if (value === 'n' || value === 'no') {
|
|
278
|
-
console.log(chalk.yellow('\nWizard cancelled.'));
|
|
279
|
-
return false;
|
|
49
|
+
const files = this.resolveSourceFiles(value, context.cwd);
|
|
50
|
+
if (files.length === 0) {
|
|
51
|
+
console.log(chalk.yellow(' No matching files found, using provided patterns'));
|
|
52
|
+
return this.success(value.split(',').map(p => p.trim()).filter(p => p.length > 0));
|
|
280
53
|
}
|
|
281
|
-
return
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Print configuration summary
|
|
285
|
-
*/
|
|
286
|
-
printSummary(result) {
|
|
287
|
-
console.log('');
|
|
288
|
-
console.log(chalk.blue('========================================'));
|
|
289
|
-
console.log(chalk.blue.bold(' Configuration Summary'));
|
|
290
|
-
console.log(chalk.blue('========================================'));
|
|
291
|
-
console.log('');
|
|
292
|
-
console.log(chalk.white(' Source Files:'));
|
|
293
|
-
result.sourceFiles.slice(0, 5).forEach(f => {
|
|
294
|
-
const relativePath = relative(this.cwd, f);
|
|
295
|
-
console.log(chalk.gray(` - ${relativePath || f}`));
|
|
296
|
-
});
|
|
297
|
-
if (result.sourceFiles.length > 5) {
|
|
298
|
-
console.log(chalk.gray(` ... and ${result.sourceFiles.length - 5} more`));
|
|
299
|
-
}
|
|
300
|
-
console.log('');
|
|
301
|
-
console.log(chalk.white(` Test Type: ${chalk.cyan(result.testType)}`));
|
|
302
|
-
console.log(chalk.white(` Coverage Target: ${chalk.cyan(result.coverageTarget + '%')}`));
|
|
303
|
-
console.log(chalk.white(` Framework: ${chalk.cyan(result.framework)}`));
|
|
304
|
-
console.log(chalk.white(` AI Enhancement: ${chalk.cyan(result.aiLevel)}`));
|
|
305
|
-
console.log(chalk.white(` Anti-Patterns: ${chalk.cyan(result.detectAntiPatterns ? 'Enabled' : 'Disabled')}`));
|
|
306
|
-
console.log('');
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Generic prompt helper
|
|
310
|
-
*/
|
|
311
|
-
prompt(rl, question) {
|
|
312
|
-
return new Promise(resolve => {
|
|
313
|
-
rl.question(question, answer => {
|
|
314
|
-
resolve(answer);
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Get source file suggestions based on project structure
|
|
320
|
-
*/
|
|
321
|
-
getSourceFileSuggestions() {
|
|
322
|
-
const suggestions = [];
|
|
323
|
-
// Check common directories
|
|
324
|
-
const commonDirs = ['src', 'lib', 'app', 'packages'];
|
|
325
|
-
for (const dir of commonDirs) {
|
|
326
|
-
const dirPath = join(this.cwd, dir);
|
|
327
|
-
if (existsSync(dirPath) && statSync(dirPath).isDirectory()) {
|
|
328
|
-
suggestions.push(`${dir}/**/*.ts`);
|
|
329
|
-
suggestions.push(dir);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
// Add specific patterns for TypeScript projects
|
|
333
|
-
if (existsSync(join(this.cwd, 'src'))) {
|
|
334
|
-
suggestions.push('src/services/**/*.ts');
|
|
335
|
-
suggestions.push('src/utils/**/*.ts');
|
|
336
|
-
suggestions.push('src/components/**/*.tsx');
|
|
337
|
-
}
|
|
338
|
-
return suggestions;
|
|
54
|
+
return this.success(files);
|
|
339
55
|
}
|
|
340
56
|
/**
|
|
341
57
|
* Resolve source files from input (glob patterns, directories, files)
|
|
342
58
|
* Security: Validates that resolved paths stay within project directory to prevent path traversal
|
|
343
59
|
*/
|
|
344
|
-
resolveSourceFiles(input) {
|
|
60
|
+
resolveSourceFiles(input, cwd) {
|
|
345
61
|
const files = [];
|
|
346
62
|
const parts = input.split(',').map(p => p.trim()).filter(p => p.length > 0);
|
|
347
63
|
// Normalize cwd for consistent comparison (resolve removes trailing slashes and normalizes)
|
|
348
|
-
const normalizedCwd = resolve(
|
|
64
|
+
const normalizedCwd = resolve(cwd);
|
|
349
65
|
for (const part of parts) {
|
|
350
|
-
const resolved = resolve(
|
|
66
|
+
const resolved = resolve(cwd, part);
|
|
351
67
|
// Security: Prevent path traversal - ensure resolved path is within project directory
|
|
352
68
|
if (!resolved.startsWith(normalizedCwd + '/') && resolved !== normalizedCwd) {
|
|
353
69
|
console.warn(`Warning: Skipping path outside project directory: ${part}`);
|
|
@@ -366,7 +82,7 @@ export class TestGenerationWizard {
|
|
|
366
82
|
}
|
|
367
83
|
else if (part.includes('*')) {
|
|
368
84
|
// Handle glob pattern - for now, just expand common patterns
|
|
369
|
-
const baseDir = resolve(
|
|
85
|
+
const baseDir = resolve(cwd, part.split('*')[0]);
|
|
370
86
|
// Security: Validate glob base directory is within project
|
|
371
87
|
if (!baseDir.startsWith(normalizedCwd + '/') && baseDir !== normalizedCwd) {
|
|
372
88
|
console.warn(`Warning: Skipping glob pattern outside project directory: ${part}`);
|
|
@@ -431,12 +147,64 @@ export class TestGenerationWizard {
|
|
|
431
147
|
}
|
|
432
148
|
return files;
|
|
433
149
|
}
|
|
150
|
+
}
|
|
151
|
+
// ============================================================================
|
|
152
|
+
// Framework Detection Step (Custom)
|
|
153
|
+
// ============================================================================
|
|
154
|
+
/**
|
|
155
|
+
* Custom step for framework selection with auto-detection
|
|
156
|
+
*/
|
|
157
|
+
class FrameworkSelectStep extends SingleSelectStep {
|
|
158
|
+
cwd;
|
|
159
|
+
constructor(defaultFramework, cwd) {
|
|
160
|
+
const detectedFramework = FrameworkSelectStep.detectFramework(cwd);
|
|
161
|
+
const effectiveDefault = defaultFramework || detectedFramework || 'vitest';
|
|
162
|
+
super({
|
|
163
|
+
id: 'framework',
|
|
164
|
+
stepNumber: '4/6',
|
|
165
|
+
title: 'Test Framework',
|
|
166
|
+
description: 'Select the testing framework to use',
|
|
167
|
+
options: [
|
|
168
|
+
{
|
|
169
|
+
key: '1',
|
|
170
|
+
value: 'vitest',
|
|
171
|
+
label: 'vitest',
|
|
172
|
+
description: 'Vitest - Fast, Vite-native testing',
|
|
173
|
+
isRecommended: detectedFramework === 'vitest',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: '2',
|
|
177
|
+
value: 'jest',
|
|
178
|
+
label: 'jest',
|
|
179
|
+
description: 'Jest - Feature-rich, widely adopted',
|
|
180
|
+
isRecommended: detectedFramework === 'jest',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
key: '3',
|
|
184
|
+
value: 'mocha',
|
|
185
|
+
label: 'mocha',
|
|
186
|
+
description: 'Mocha - Flexible, configurable',
|
|
187
|
+
isRecommended: detectedFramework === 'mocha',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: '4',
|
|
191
|
+
value: 'playwright',
|
|
192
|
+
label: 'playwright',
|
|
193
|
+
description: 'Playwright - Browser automation (for e2e)',
|
|
194
|
+
isRecommended: detectedFramework === 'playwright',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
defaultValue: effectiveDefault,
|
|
198
|
+
validValues: ['jest', 'vitest', 'mocha', 'playwright'],
|
|
199
|
+
});
|
|
200
|
+
this.cwd = cwd;
|
|
201
|
+
}
|
|
434
202
|
/**
|
|
435
203
|
* Detect test framework from project configuration
|
|
436
204
|
* Security: Uses fs.readFileSync instead of require() to prevent code execution
|
|
437
205
|
*/
|
|
438
|
-
detectFramework() {
|
|
439
|
-
const packageJsonPath = join(
|
|
206
|
+
static detectFramework(cwd) {
|
|
207
|
+
const packageJsonPath = join(cwd, 'package.json');
|
|
440
208
|
if (!existsSync(packageJsonPath)) {
|
|
441
209
|
return null;
|
|
442
210
|
}
|
|
@@ -458,20 +226,123 @@ export class TestGenerationWizard {
|
|
|
458
226
|
// Ignore errors (file read or JSON parse failures)
|
|
459
227
|
}
|
|
460
228
|
// Check for config files
|
|
461
|
-
if (existsSync(join(
|
|
229
|
+
if (existsSync(join(cwd, 'vitest.config.ts')) || existsSync(join(cwd, 'vitest.config.js'))) {
|
|
462
230
|
return 'vitest';
|
|
463
231
|
}
|
|
464
|
-
if (existsSync(join(
|
|
232
|
+
if (existsSync(join(cwd, 'jest.config.ts')) || existsSync(join(cwd, 'jest.config.js'))) {
|
|
465
233
|
return 'jest';
|
|
466
234
|
}
|
|
467
|
-
if (existsSync(join(
|
|
235
|
+
if (existsSync(join(cwd, 'playwright.config.ts')) || existsSync(join(cwd, 'playwright.config.js'))) {
|
|
468
236
|
return 'playwright';
|
|
469
237
|
}
|
|
470
238
|
return null;
|
|
471
239
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
240
|
+
}
|
|
241
|
+
// ============================================================================
|
|
242
|
+
// Wizard Implementation
|
|
243
|
+
// ============================================================================
|
|
244
|
+
export class TestGenerationWizard extends BaseWizard {
|
|
245
|
+
constructor(options = {}) {
|
|
246
|
+
super(options);
|
|
247
|
+
}
|
|
248
|
+
getTitle() {
|
|
249
|
+
return 'Test Generation Wizard';
|
|
250
|
+
}
|
|
251
|
+
getSubtitle() {
|
|
252
|
+
return 'Generate tests with AI-powered assistance';
|
|
253
|
+
}
|
|
254
|
+
getConfirmationPrompt() {
|
|
255
|
+
return 'Proceed with test generation?';
|
|
256
|
+
}
|
|
257
|
+
isNonInteractive() {
|
|
258
|
+
return this.options.nonInteractive ?? false;
|
|
259
|
+
}
|
|
260
|
+
getCommands() {
|
|
261
|
+
return [
|
|
262
|
+
// Step 1: Source files
|
|
263
|
+
new SourceFilesStep(this.options.defaultSourceFiles || ['.']),
|
|
264
|
+
// Step 2: Test type
|
|
265
|
+
new SingleSelectStep({
|
|
266
|
+
id: 'testType',
|
|
267
|
+
stepNumber: '2/6',
|
|
268
|
+
title: 'Test Type',
|
|
269
|
+
description: 'Select the type of tests to generate',
|
|
270
|
+
options: [
|
|
271
|
+
{ key: '1', value: 'unit', label: 'unit', description: 'Unit tests - isolated component testing' },
|
|
272
|
+
{ key: '2', value: 'integration', label: 'integration', description: 'Integration tests - module interaction testing' },
|
|
273
|
+
{ key: '3', value: 'e2e', label: 'e2e', description: 'End-to-end tests - full workflow testing' },
|
|
274
|
+
{ key: '4', value: 'property', label: 'property', description: 'Property-based tests - invariant testing' },
|
|
275
|
+
{ key: '5', value: 'contract', label: 'contract', description: 'Contract tests - API contract validation' },
|
|
276
|
+
],
|
|
277
|
+
defaultValue: this.options.defaultTestType || 'unit',
|
|
278
|
+
validValues: ['unit', 'integration', 'e2e', 'property', 'contract'],
|
|
279
|
+
}),
|
|
280
|
+
// Step 3: Coverage target
|
|
281
|
+
new NumericStep({
|
|
282
|
+
id: 'coverageTarget',
|
|
283
|
+
stepNumber: '3/6',
|
|
284
|
+
title: 'Coverage target %',
|
|
285
|
+
description: 'Target code coverage percentage (0-100). Recommended: 80% for new code, 60% for legacy.',
|
|
286
|
+
defaultValue: this.options.defaultCoverageTarget || 80,
|
|
287
|
+
min: 0,
|
|
288
|
+
max: 100,
|
|
289
|
+
}),
|
|
290
|
+
// Step 4: Framework
|
|
291
|
+
new FrameworkSelectStep(this.options.defaultFramework, this.cwd),
|
|
292
|
+
// Step 5: AI enhancement level
|
|
293
|
+
new SingleSelectStep({
|
|
294
|
+
id: 'aiLevel',
|
|
295
|
+
stepNumber: '5/6',
|
|
296
|
+
title: 'AI Enhancement Level',
|
|
297
|
+
description: 'Select the level of AI assistance for test generation',
|
|
298
|
+
options: [
|
|
299
|
+
{ key: '1', value: 'none', label: 'none', description: 'None - Template-based generation only' },
|
|
300
|
+
{ key: '2', value: 'basic', label: 'basic', description: 'Basic - Simple pattern matching' },
|
|
301
|
+
{ key: '3', value: 'standard', label: 'standard', description: 'Standard - AI-powered test suggestions', isRecommended: true },
|
|
302
|
+
{ key: '4', value: 'advanced', label: 'advanced', description: 'Advanced - Full AI with edge case generation' },
|
|
303
|
+
],
|
|
304
|
+
defaultValue: this.options.defaultAILevel || 'standard',
|
|
305
|
+
validValues: ['none', 'basic', 'standard', 'advanced'],
|
|
306
|
+
}),
|
|
307
|
+
// Step 6: Anti-pattern detection
|
|
308
|
+
new BooleanStep({
|
|
309
|
+
id: 'detectAntiPatterns',
|
|
310
|
+
stepNumber: '6/6',
|
|
311
|
+
title: 'Enable anti-pattern detection',
|
|
312
|
+
description: 'Enable detection and avoidance of code anti-patterns',
|
|
313
|
+
defaultValue: true,
|
|
314
|
+
}),
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
buildResult(results) {
|
|
318
|
+
return {
|
|
319
|
+
sourceFiles: results.sourceFiles,
|
|
320
|
+
testType: results.testType,
|
|
321
|
+
coverageTarget: results.coverageTarget,
|
|
322
|
+
framework: results.framework,
|
|
323
|
+
aiLevel: results.aiLevel,
|
|
324
|
+
detectAntiPatterns: results.detectAntiPatterns,
|
|
325
|
+
cancelled: false,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
printSummary(result) {
|
|
329
|
+
WizardPrompt.printSummaryHeader();
|
|
330
|
+
console.log(chalk.white(' Source Files:'));
|
|
331
|
+
result.sourceFiles.slice(0, 5).forEach(f => {
|
|
332
|
+
const relativePath = relative(this.cwd, f);
|
|
333
|
+
console.log(chalk.gray(` - ${relativePath || f}`));
|
|
334
|
+
});
|
|
335
|
+
if (result.sourceFiles.length > 5) {
|
|
336
|
+
console.log(chalk.gray(` ... and ${result.sourceFiles.length - 5} more`));
|
|
337
|
+
}
|
|
338
|
+
console.log('');
|
|
339
|
+
WizardPrompt.printSummaryField('Test Type', result.testType);
|
|
340
|
+
WizardPrompt.printSummaryField('Coverage Target', WizardFormat.percentage(result.coverageTarget));
|
|
341
|
+
WizardPrompt.printSummaryField('Framework', result.framework);
|
|
342
|
+
WizardPrompt.printSummaryField('AI Enhancement', result.aiLevel);
|
|
343
|
+
WizardPrompt.printSummaryField('Anti-Patterns', WizardFormat.enabledDisabled(result.detectAntiPatterns));
|
|
344
|
+
console.log('');
|
|
345
|
+
}
|
|
475
346
|
getDefaults() {
|
|
476
347
|
return {
|
|
477
348
|
sourceFiles: this.options.defaultSourceFiles || ['.'],
|
|
@@ -483,9 +354,6 @@ export class TestGenerationWizard {
|
|
|
483
354
|
cancelled: false,
|
|
484
355
|
};
|
|
485
356
|
}
|
|
486
|
-
/**
|
|
487
|
-
* Get cancelled result
|
|
488
|
-
*/
|
|
489
357
|
getCancelled() {
|
|
490
358
|
return {
|
|
491
359
|
sourceFiles: [],
|