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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-generator-factory.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/factories/test-generator-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,oBAAoB,GAA6B;IACrD,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;CACA,CAAC;AAEX;;GAEG;AACH,MAAM,iBAAiB,GAAkB,QAAQ,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;OAEG;IACc,KAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IAElE;;;;;;OAMG;IACH,MAAM,CAAC,SAAwB;QAC7B,oBAAoB;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,uBAAuB;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,SAAiB;QACxB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAA0B,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,UAAU;QACR,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,sBAAsB;QACpB,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,SAAwB;QAC9C,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;YACzC,KAAK,QAAQ;gBACX,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YAC3C,KAAK,OAAO;gBACV,OAAO,IAAI,cAAc,EAAE,CAAC;YAC9B,KAAK,QAAQ;gBACX,OAAO,IAAI,eAAe,EAAE,CAAC;YAC/B;gBACE,oDAAoD;gBACpD,6CAA6C;gBAC7C,MAAM,IAAI,KAAK,CAAC,+BAA+B,SAAS,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAyB;IAC3D,OAAO,oBAAoB,CAAC,MAAM,CAAC,SAAS,IAAI,iBAAiB,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Base Test Generator
|
|
3
|
+
* Abstract base class providing shared utilities for all framework-specific generators
|
|
4
|
+
*
|
|
5
|
+
* Implements the Template Method pattern for common test generation logic,
|
|
6
|
+
* while allowing subclasses to override framework-specific details.
|
|
7
|
+
*
|
|
8
|
+
* @module test-generation/generators
|
|
9
|
+
*/
|
|
10
|
+
import type { ITestGenerator, TestFramework, TestType, FunctionInfo, ClassInfo, ParameterInfo, TestCase, TestGenerationContext, Pattern } from '../interfaces';
|
|
11
|
+
/**
|
|
12
|
+
* BaseTestGenerator - Abstract base class for test generators
|
|
13
|
+
*
|
|
14
|
+
* Provides common functionality for:
|
|
15
|
+
* - Test value generation based on parameter types
|
|
16
|
+
* - Test case generation from function signatures
|
|
17
|
+
* - Import statement extraction
|
|
18
|
+
* - Helper utilities for naming and formatting
|
|
19
|
+
*
|
|
20
|
+
* Subclasses must implement framework-specific methods:
|
|
21
|
+
* - generateTests()
|
|
22
|
+
* - generateFunctionTests()
|
|
23
|
+
* - generateClassTests()
|
|
24
|
+
* - generateStubTests()
|
|
25
|
+
* - generateCoverageTests()
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class BaseTestGenerator implements ITestGenerator {
|
|
28
|
+
abstract readonly framework: TestFramework;
|
|
29
|
+
abstract generateTests(context: TestGenerationContext): string;
|
|
30
|
+
abstract generateFunctionTests(fn: FunctionInfo, testType: TestType): string;
|
|
31
|
+
abstract generateClassTests(cls: ClassInfo, testType: TestType): string;
|
|
32
|
+
abstract generateStubTests(context: TestGenerationContext): string;
|
|
33
|
+
abstract generateCoverageTests(moduleName: string, importPath: string, lines: number[]): string;
|
|
34
|
+
/**
|
|
35
|
+
* Generate a test value for a parameter based on its type and name
|
|
36
|
+
* Uses @faker-js/faker for realistic test data
|
|
37
|
+
*
|
|
38
|
+
* @param param - Parameter information
|
|
39
|
+
* @returns Generated test value as a string
|
|
40
|
+
*/
|
|
41
|
+
protected generateTestValue(param: ParameterInfo): string;
|
|
42
|
+
/**
|
|
43
|
+
* Generate test cases for a function based on its signature
|
|
44
|
+
* Creates happy-path, edge-case, error-handling, and boundary tests
|
|
45
|
+
*
|
|
46
|
+
* @param fn - Function information from AST
|
|
47
|
+
* @returns Array of test cases
|
|
48
|
+
*/
|
|
49
|
+
protected generateTestCasesForFunction(fn: FunctionInfo): TestCase[];
|
|
50
|
+
/**
|
|
51
|
+
* Generate boundary test cases for a parameter based on its type
|
|
52
|
+
*/
|
|
53
|
+
protected generateBoundaryTestCases(fn: FunctionInfo, param: ParameterInfo): TestCase[];
|
|
54
|
+
/**
|
|
55
|
+
* Extract exports from code analysis for import statements
|
|
56
|
+
*/
|
|
57
|
+
protected extractExports(functions: FunctionInfo[], classes: ClassInfo[]): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Generate import statement based on exports
|
|
60
|
+
*/
|
|
61
|
+
protected generateImportStatement(exports: string[], importPath: string, moduleName: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Generate pattern comment header
|
|
64
|
+
*/
|
|
65
|
+
protected generatePatternComment(patterns: Pattern[]): string;
|
|
66
|
+
/**
|
|
67
|
+
* Convert string to camelCase
|
|
68
|
+
*/
|
|
69
|
+
protected camelCase(str: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Convert string to PascalCase
|
|
72
|
+
*/
|
|
73
|
+
protected pascalCase(str: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Format line range for display
|
|
76
|
+
*/
|
|
77
|
+
protected formatLineRange(lines: number[]): string;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=base-test-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-test-generator.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/base-test-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,qBAAqB,EACrB,OAAO,EACR,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,iBAAkB,YAAW,cAAc;IAC/D,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAM3C,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAC9D,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAC5E,QAAQ,CAAC,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM;IACvE,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAClE,QAAQ,CAAC,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAM/F;;;;;;OAMG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM;IA+BzD;;;;;;OAMG;IACH,SAAS,CAAC,4BAA4B,CAAC,EAAE,EAAE,YAAY,GAAG,QAAQ,EAAE;IAiDpE;;OAEG;IACH,SAAS,CAAC,yBAAyB,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,GAAG,QAAQ,EAAE;IA0EvF;;OAEG;IACH,SAAS,CAAC,cAAc,CACtB,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,EAAE,SAAS,EAAE,GACnB,MAAM,EAAE;IAaX;;OAEG;IACH,SAAS,CAAC,uBAAuB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM;IAOT;;OAEG;IACH,SAAS,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM;IAK7D;;OAEG;IACH,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAMxC;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAMzC;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;CAMnD"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Base Test Generator
|
|
3
|
+
* Abstract base class providing shared utilities for all framework-specific generators
|
|
4
|
+
*
|
|
5
|
+
* Implements the Template Method pattern for common test generation logic,
|
|
6
|
+
* while allowing subclasses to override framework-specific details.
|
|
7
|
+
*
|
|
8
|
+
* @module test-generation/generators
|
|
9
|
+
*/
|
|
10
|
+
import { faker } from '@faker-js/faker';
|
|
11
|
+
/**
|
|
12
|
+
* BaseTestGenerator - Abstract base class for test generators
|
|
13
|
+
*
|
|
14
|
+
* Provides common functionality for:
|
|
15
|
+
* - Test value generation based on parameter types
|
|
16
|
+
* - Test case generation from function signatures
|
|
17
|
+
* - Import statement extraction
|
|
18
|
+
* - Helper utilities for naming and formatting
|
|
19
|
+
*
|
|
20
|
+
* Subclasses must implement framework-specific methods:
|
|
21
|
+
* - generateTests()
|
|
22
|
+
* - generateFunctionTests()
|
|
23
|
+
* - generateClassTests()
|
|
24
|
+
* - generateStubTests()
|
|
25
|
+
* - generateCoverageTests()
|
|
26
|
+
*/
|
|
27
|
+
export class BaseTestGenerator {
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Shared Utilities - Available to all subclasses
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Generate a test value for a parameter based on its type and name
|
|
33
|
+
* Uses @faker-js/faker for realistic test data
|
|
34
|
+
*
|
|
35
|
+
* @param param - Parameter information
|
|
36
|
+
* @returns Generated test value as a string
|
|
37
|
+
*/
|
|
38
|
+
generateTestValue(param) {
|
|
39
|
+
if (param.defaultValue) {
|
|
40
|
+
return param.defaultValue;
|
|
41
|
+
}
|
|
42
|
+
const type = param.type?.toLowerCase() || 'unknown';
|
|
43
|
+
const name = param.name.toLowerCase();
|
|
44
|
+
// Infer from param name first (more specific)
|
|
45
|
+
if (name.includes('id'))
|
|
46
|
+
return `'${faker.string.uuid()}'`;
|
|
47
|
+
if (name.includes('email'))
|
|
48
|
+
return `'${faker.internet.email()}'`;
|
|
49
|
+
if (name.includes('name'))
|
|
50
|
+
return `'${faker.person.fullName()}'`;
|
|
51
|
+
if (name.includes('url'))
|
|
52
|
+
return `'${faker.internet.url()}'`;
|
|
53
|
+
if (name.includes('date'))
|
|
54
|
+
return `new Date('${faker.date.recent().toISOString()}')`;
|
|
55
|
+
if (name.includes('phone'))
|
|
56
|
+
return `'${faker.phone.number()}'`;
|
|
57
|
+
if (name.includes('address'))
|
|
58
|
+
return `'${faker.location.streetAddress()}'`;
|
|
59
|
+
// Then by type
|
|
60
|
+
if (type.includes('string'))
|
|
61
|
+
return `'${faker.lorem.word()}'`;
|
|
62
|
+
if (type.includes('number'))
|
|
63
|
+
return String(faker.number.int({ min: 1, max: 100 }));
|
|
64
|
+
if (type.includes('boolean'))
|
|
65
|
+
return 'true';
|
|
66
|
+
if (type.includes('[]') || type.includes('array'))
|
|
67
|
+
return '[]';
|
|
68
|
+
if (type.includes('object') || type.includes('{'))
|
|
69
|
+
return '{}';
|
|
70
|
+
if (type.includes('function'))
|
|
71
|
+
return '() => {}';
|
|
72
|
+
if (type.includes('promise'))
|
|
73
|
+
return 'Promise.resolve()';
|
|
74
|
+
if (type.includes('date'))
|
|
75
|
+
return 'new Date()';
|
|
76
|
+
// Default: generate a mock variable name
|
|
77
|
+
return `mock${param.name.charAt(0).toUpperCase() + param.name.slice(1)}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Generate test cases for a function based on its signature
|
|
81
|
+
* Creates happy-path, edge-case, error-handling, and boundary tests
|
|
82
|
+
*
|
|
83
|
+
* @param fn - Function information from AST
|
|
84
|
+
* @returns Array of test cases
|
|
85
|
+
*/
|
|
86
|
+
generateTestCasesForFunction(fn) {
|
|
87
|
+
const testCases = [];
|
|
88
|
+
// Generate valid input test (happy path)
|
|
89
|
+
const validParams = fn.parameters.map((p) => this.generateTestValue(p)).join(', ');
|
|
90
|
+
const fnCall = fn.isAsync ? `await ${fn.name}(${validParams})` : `${fn.name}(${validParams})`;
|
|
91
|
+
testCases.push({
|
|
92
|
+
description: 'should handle valid input correctly',
|
|
93
|
+
type: 'happy-path',
|
|
94
|
+
action: `const result = ${fnCall};`,
|
|
95
|
+
assertion: 'expect(result).toBeDefined();',
|
|
96
|
+
});
|
|
97
|
+
// Generate tests for each parameter
|
|
98
|
+
for (const param of fn.parameters) {
|
|
99
|
+
// Test with undefined for required parameters
|
|
100
|
+
if (!param.optional) {
|
|
101
|
+
const paramsWithUndefined = fn.parameters
|
|
102
|
+
.map((p) => (p.name === param.name ? 'undefined' : this.generateTestValue(p)))
|
|
103
|
+
.join(', ');
|
|
104
|
+
testCases.push({
|
|
105
|
+
description: `should handle undefined ${param.name}`,
|
|
106
|
+
type: 'error-handling',
|
|
107
|
+
action: fn.isAsync
|
|
108
|
+
? `const action = async () => await ${fn.name}(${paramsWithUndefined});`
|
|
109
|
+
: `const action = () => ${fn.name}(${paramsWithUndefined});`,
|
|
110
|
+
assertion: 'expect(action).toThrow();',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// Type-specific boundary tests
|
|
114
|
+
testCases.push(...this.generateBoundaryTestCases(fn, param));
|
|
115
|
+
}
|
|
116
|
+
// Async rejection test
|
|
117
|
+
if (fn.isAsync) {
|
|
118
|
+
testCases.push({
|
|
119
|
+
description: 'should handle async rejection gracefully',
|
|
120
|
+
type: 'error-handling',
|
|
121
|
+
action: `// Mock or setup to cause rejection`,
|
|
122
|
+
assertion: `// await expect(${fn.name}(invalidParams)).rejects.toThrow();`,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return testCases;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Generate boundary test cases for a parameter based on its type
|
|
129
|
+
*/
|
|
130
|
+
generateBoundaryTestCases(fn, param) {
|
|
131
|
+
const testCases = [];
|
|
132
|
+
const type = param.type?.toLowerCase() || '';
|
|
133
|
+
// String boundary tests
|
|
134
|
+
if (type.includes('string')) {
|
|
135
|
+
const paramsWithEmpty = fn.parameters
|
|
136
|
+
.map((p) => (p.name === param.name ? "''" : this.generateTestValue(p)))
|
|
137
|
+
.join(', ');
|
|
138
|
+
const emptyCall = fn.isAsync
|
|
139
|
+
? `await ${fn.name}(${paramsWithEmpty})`
|
|
140
|
+
: `${fn.name}(${paramsWithEmpty})`;
|
|
141
|
+
testCases.push({
|
|
142
|
+
description: `should handle empty string for ${param.name}`,
|
|
143
|
+
type: 'boundary',
|
|
144
|
+
action: `const result = ${emptyCall};`,
|
|
145
|
+
assertion: 'expect(result).toBeDefined();',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Number boundary tests
|
|
149
|
+
if (type.includes('number')) {
|
|
150
|
+
// Test with zero
|
|
151
|
+
const paramsWithZero = fn.parameters
|
|
152
|
+
.map((p) => (p.name === param.name ? '0' : this.generateTestValue(p)))
|
|
153
|
+
.join(', ');
|
|
154
|
+
const zeroCall = fn.isAsync
|
|
155
|
+
? `await ${fn.name}(${paramsWithZero})`
|
|
156
|
+
: `${fn.name}(${paramsWithZero})`;
|
|
157
|
+
testCases.push({
|
|
158
|
+
description: `should handle zero for ${param.name}`,
|
|
159
|
+
type: 'boundary',
|
|
160
|
+
action: `const result = ${zeroCall};`,
|
|
161
|
+
assertion: 'expect(result).toBeDefined();',
|
|
162
|
+
});
|
|
163
|
+
// Test with negative value
|
|
164
|
+
const paramsWithNegative = fn.parameters
|
|
165
|
+
.map((p) => (p.name === param.name ? '-1' : this.generateTestValue(p)))
|
|
166
|
+
.join(', ');
|
|
167
|
+
const negativeCall = fn.isAsync
|
|
168
|
+
? `await ${fn.name}(${paramsWithNegative})`
|
|
169
|
+
: `${fn.name}(${paramsWithNegative})`;
|
|
170
|
+
testCases.push({
|
|
171
|
+
description: `should handle negative value for ${param.name}`,
|
|
172
|
+
type: 'edge-case',
|
|
173
|
+
action: `const result = ${negativeCall};`,
|
|
174
|
+
assertion: 'expect(result).toBeDefined();',
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// Array boundary tests
|
|
178
|
+
if (type.includes('[]') || type.includes('array')) {
|
|
179
|
+
const paramsWithEmpty = fn.parameters
|
|
180
|
+
.map((p) => (p.name === param.name ? '[]' : this.generateTestValue(p)))
|
|
181
|
+
.join(', ');
|
|
182
|
+
const emptyCall = fn.isAsync
|
|
183
|
+
? `await ${fn.name}(${paramsWithEmpty})`
|
|
184
|
+
: `${fn.name}(${paramsWithEmpty})`;
|
|
185
|
+
testCases.push({
|
|
186
|
+
description: `should handle empty array for ${param.name}`,
|
|
187
|
+
type: 'boundary',
|
|
188
|
+
action: `const result = ${emptyCall};`,
|
|
189
|
+
assertion: 'expect(result).toBeDefined();',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return testCases;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Extract exports from code analysis for import statements
|
|
196
|
+
*/
|
|
197
|
+
extractExports(functions, classes) {
|
|
198
|
+
const exports = [];
|
|
199
|
+
for (const fn of functions) {
|
|
200
|
+
if (fn.isExported)
|
|
201
|
+
exports.push(fn.name);
|
|
202
|
+
}
|
|
203
|
+
for (const cls of classes) {
|
|
204
|
+
if (cls.isExported)
|
|
205
|
+
exports.push(cls.name);
|
|
206
|
+
}
|
|
207
|
+
return exports;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Generate import statement based on exports
|
|
211
|
+
*/
|
|
212
|
+
generateImportStatement(exports, importPath, moduleName) {
|
|
213
|
+
if (exports.length > 0) {
|
|
214
|
+
return `import { ${exports.join(', ')} } from '${importPath}';`;
|
|
215
|
+
}
|
|
216
|
+
return `import * as ${moduleName} from '${importPath}';`;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Generate pattern comment header
|
|
220
|
+
*/
|
|
221
|
+
generatePatternComment(patterns) {
|
|
222
|
+
if (patterns.length === 0)
|
|
223
|
+
return '';
|
|
224
|
+
return `// Applied patterns: ${patterns.map((p) => p.name).join(', ')}\n`;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Convert string to camelCase
|
|
228
|
+
*/
|
|
229
|
+
camelCase(str) {
|
|
230
|
+
return str
|
|
231
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase())
|
|
232
|
+
.replace(/^./, (chr) => chr.toLowerCase());
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Convert string to PascalCase
|
|
236
|
+
*/
|
|
237
|
+
pascalCase(str) {
|
|
238
|
+
return str
|
|
239
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase())
|
|
240
|
+
.replace(/^./, (chr) => chr.toUpperCase());
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Format line range for display
|
|
244
|
+
*/
|
|
245
|
+
formatLineRange(lines) {
|
|
246
|
+
if (lines.length === 1) {
|
|
247
|
+
return `line ${lines[0]}`;
|
|
248
|
+
}
|
|
249
|
+
return `lines ${lines[0]}-${lines[lines.length - 1]}`;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=base-test-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-test-generator.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/base-test-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAaxC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAgB,iBAAiB;IAarC,+EAA+E;IAC/E,iDAAiD;IACjD,+EAA+E;IAE/E;;;;;;OAMG;IACO,iBAAiB,CAAC,KAAoB;QAC9C,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC,YAAY,CAAC;QAC5B,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,CAAC;QACpD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAEtC,8CAA8C;QAC9C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;QAC3D,IAAI,IAAI,CAAC,QAAQ,C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,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5E,CAAC;IAED;;OAEG;IACO,SAAS,CAAC,GAAW;QAC7B,OAAO,GAAG;aACP,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;aAC3D,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACO,UAAU,CAAC,GAAW;QAC9B,OAAO,GAAG;aACP,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;aAC3D,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACO,eAAe,CAAC,KAAe;QACvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5B,CAAC;QACD,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Test Generators
|
|
3
|
+
* Central export point for all test generator implementations
|
|
4
|
+
*
|
|
5
|
+
* @module test-generation/generators
|
|
6
|
+
*/
|
|
7
|
+
export { BaseTestGenerator } from './base-test-generator';
|
|
8
|
+
export { JestVitestGenerator } from './jest-vitest-generator';
|
|
9
|
+
export { MochaGenerator } from './mocha-generator';
|
|
10
|
+
export { PytestGenerator } from './pytest-generator';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Test Generators
|
|
3
|
+
* Central export point for all test generator implementations
|
|
4
|
+
*
|
|
5
|
+
* @module test-generation/generators
|
|
6
|
+
*/
|
|
7
|
+
// Base class
|
|
8
|
+
export { BaseTestGenerator } from './base-test-generator';
|
|
9
|
+
// Framework-specific implementations
|
|
10
|
+
export { JestVitestGenerator } from './jest-vitest-generator';
|
|
11
|
+
export { MochaGenerator } from './mocha-generator';
|
|
12
|
+
export { PytestGenerator } from './pytest-generator';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,qCAAqC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Jest/Vitest Test Generator
|
|
3
|
+
* Strategy implementation for Jest and Vitest test frameworks
|
|
4
|
+
*
|
|
5
|
+
* Generates test code using:
|
|
6
|
+
* - describe/it blocks
|
|
7
|
+
* - expect().toBe/toEqual/toBeDefined assertions
|
|
8
|
+
* - beforeEach/afterEach hooks
|
|
9
|
+
* - async/await support
|
|
10
|
+
*
|
|
11
|
+
* @module test-generation/generators
|
|
12
|
+
*/
|
|
13
|
+
import { BaseTestGenerator } from './base-test-generator';
|
|
14
|
+
import type { TestFramework, TestType, FunctionInfo, ClassInfo, TestGenerationContext } from '../interfaces';
|
|
15
|
+
/**
|
|
16
|
+
* JestVitestGenerator - Test generator for Jest and Vitest frameworks
|
|
17
|
+
*
|
|
18
|
+
* Both frameworks share nearly identical APIs, so this single generator
|
|
19
|
+
* handles both by adjusting minor differences (e.g., vi vs jest mocking).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const generator = new JestVitestGenerator('vitest');
|
|
24
|
+
* const testCode = generator.generateTests({
|
|
25
|
+
* moduleName: 'userService',
|
|
26
|
+
* importPath: './user-service',
|
|
27
|
+
* testType: 'unit',
|
|
28
|
+
* patterns: [],
|
|
29
|
+
* analysis: { functions: [...], classes: [...] }
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class JestVitestGenerator extends BaseTestGenerator {
|
|
34
|
+
readonly framework: TestFramework;
|
|
35
|
+
constructor(framework?: 'jest' | 'vitest');
|
|
36
|
+
/**
|
|
37
|
+
* Get the mock utility name (vi for vitest, jest for jest)
|
|
38
|
+
*/
|
|
39
|
+
private get mockUtil();
|
|
40
|
+
/**
|
|
41
|
+
* Generate complete test file from analysis
|
|
42
|
+
*/
|
|
43
|
+
generateTests(context: TestGenerationContext): string;
|
|
44
|
+
/**
|
|
45
|
+
* Generate tests for a standalone function
|
|
46
|
+
*/
|
|
47
|
+
generateFunctionTests(fn: FunctionInfo, _testType: TestType): string;
|
|
48
|
+
/**
|
|
49
|
+
* Generate tests for a class
|
|
50
|
+
*/
|
|
51
|
+
generateClassTests(cls: ClassInfo, testType: TestType): string;
|
|
52
|
+
/**
|
|
53
|
+
* Generate tests for a class method
|
|
54
|
+
*/
|
|
55
|
+
private generateMethodTests;
|
|
56
|
+
/**
|
|
57
|
+
* Generate stub tests when no AST analysis is available
|
|
58
|
+
*/
|
|
59
|
+
generateStubTests(context: TestGenerationContext): string;
|
|
60
|
+
/**
|
|
61
|
+
* Generate coverage-focused tests for specific lines
|
|
62
|
+
*/
|
|
63
|
+
generateCoverageTests(moduleName: string, importPath: string, lines: number[]): string;
|
|
64
|
+
/**
|
|
65
|
+
* Generate basic operations test based on detected patterns
|
|
66
|
+
*/
|
|
67
|
+
private generateBasicOpsTest;
|
|
68
|
+
/**
|
|
69
|
+
* Generate edge case test based on detected patterns
|
|
70
|
+
*/
|
|
71
|
+
private generateEdgeCaseTest;
|
|
72
|
+
/**
|
|
73
|
+
* Generate error handling test based on detected patterns
|
|
74
|
+
*/
|
|
75
|
+
private generateErrorHandlingTest;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=jest-vitest-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest-vitest-generator.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/jest-vitest-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,qBAAqB,EAEtB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;gBAEtB,SAAS,GAAE,MAAM,GAAG,QAAmB;IAKnD;;OAEG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IA+BrD;;OAEG;IACH,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,GAAG,MAAM;IAqBpE;;OAEG;IACH,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAkC9D;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAoC3B;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAwBzD;;OAEG;IACH,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM;IAoCT;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmE5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAsD5B;;OAEG;IACH,OAAO,CAAC,yBAAyB;CAyDlC"}
|