agentic-qe 3.2.3 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/v3/qe-accessibility-auditor.md +90 -0
- package/README.md +49 -7
- package/package.json +8 -2
- package/scripts/cloud-db-config.json +37 -0
- package/scripts/cloud-db-connect.sh +37 -0
- package/scripts/cloud-db-tunnel.sh +23 -0
- package/v3/CHANGELOG.md +253 -0
- package/v3/README.md +59 -1
- package/v3/assets/agents/v3/qe-accessibility-auditor.md +90 -0
- package/v3/dist/adapters/claude-flow/index.d.ts +54 -0
- package/v3/dist/adapters/claude-flow/index.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/index.js +79 -0
- package/v3/dist/adapters/claude-flow/index.js.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js +203 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts +73 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js +276 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js +205 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/types.d.ts +99 -0
- package/v3/dist/adapters/claude-flow/types.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/types.js +6 -0
- package/v3/dist/adapters/claude-flow/types.js.map +1 -0
- package/v3/dist/causal-discovery/causal-graph.d.ts +80 -1
- package/v3/dist/causal-discovery/causal-graph.d.ts.map +1 -1
- package/v3/dist/causal-discovery/causal-graph.js +111 -1
- package/v3/dist/causal-discovery/causal-graph.js.map +1 -1
- package/v3/dist/cli/bundle.js +25321 -15378
- 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/claude-flow-setup.d.ts +82 -0
- package/v3/dist/cli/commands/claude-flow-setup.d.ts.map +1 -0
- package/v3/dist/cli/commands/claude-flow-setup.js +334 -0
- package/v3/dist/cli/commands/claude-flow-setup.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/hooks.d.ts +2 -0
- package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
- package/v3/dist/cli/commands/hooks.js +13 -2
- package/v3/dist/cli/commands/hooks.js.map +1 -1
- package/v3/dist/cli/commands/init.d.ts +19 -0
- package/v3/dist/cli/commands/init.d.ts.map +1 -0
- package/v3/dist/cli/commands/init.js +345 -0
- package/v3/dist/cli/commands/init.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 +62 -2583
- 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/interfaces.d.ts +8 -2
- package/v3/dist/coordination/mincut/interfaces.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/interfaces.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts +8 -0
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.js +26 -4
- package/v3/dist/coordination/mincut/mincut-health-monitor.js.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.d.ts +7 -0
- package/v3/dist/coordination/mincut/queen-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.js +19 -1
- package/v3/dist/coordination/mincut/queen-integration.js.map +1 -1
- package/v3/dist/coordination/queen-coordinator.d.ts +5 -0
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +45 -7
- 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.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.js +2 -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.map +1 -1
- package/v3/dist/domains/domain-interface.js +3 -1
- package/v3/dist/domains/domain-interface.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +5 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +79 -0
- package/v3/dist/domains/learning-optimization/coordinator.js.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/plugin.js +2 -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.map +1 -1
- package/v3/dist/domains/test-execution/plugin.js +2 -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 +32 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +72 -3
- 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 -1
- package/v3/dist/domains/test-generation/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/index.js +5 -1
- 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.map +1 -1
- package/v3/dist/domains/test-generation/plugin.js +6 -5
- package/v3/dist/domains/test-generation/plugin.js.map +1 -1
- package/v3/dist/domains/test-generation/services/coherence-gate-service.d.ts +245 -0
- package/v3/dist/domains/test-generation/services/coherence-gate-service.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/coherence-gate-service.js +454 -0
- 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 -1
- package/v3/dist/domains/test-generation/services/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/index.js +10 -1
- 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/index.d.ts +2 -1
- package/v3/dist/domains/visual-accessibility/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/index.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts +131 -0
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.d.ts +26 -0
- package/v3/dist/domains/visual-accessibility/plugin.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +153 -2
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +42 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js +69 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts +138 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js +830 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.js.map +1 -1
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts +84 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts.map +1 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js +250 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js.map +1 -0
- package/v3/dist/init/enhancements/detector.d.ts +10 -0
- package/v3/dist/init/enhancements/detector.d.ts.map +1 -0
- package/v3/dist/init/enhancements/detector.js +87 -0
- package/v3/dist/init/enhancements/detector.js.map +1 -0
- package/v3/dist/init/enhancements/index.d.ts +13 -0
- package/v3/dist/init/enhancements/index.d.ts.map +1 -0
- package/v3/dist/init/enhancements/index.js +25 -0
- package/v3/dist/init/enhancements/index.js.map +1 -0
- package/v3/dist/init/enhancements/types.d.ts +93 -0
- package/v3/dist/init/enhancements/types.d.ts.map +1 -0
- package/v3/dist/init/enhancements/types.js +6 -0
- package/v3/dist/init/enhancements/types.js.map +1 -0
- package/v3/dist/init/index.d.ts +8 -0
- package/v3/dist/init/index.d.ts.map +1 -1
- package/v3/dist/init/index.js +4 -0
- package/v3/dist/init/index.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts +31 -0
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/config-migrator.js +133 -0
- package/v3/dist/init/migration/config-migrator.js.map +1 -0
- package/v3/dist/init/migration/data-migrator.d.ts +72 -0
- package/v3/dist/init/migration/data-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/data-migrator.js +233 -0
- package/v3/dist/init/migration/data-migrator.js.map +1 -0
- package/v3/dist/init/migration/detector.d.ts +44 -0
- package/v3/dist/init/migration/detector.d.ts.map +1 -0
- package/v3/dist/init/migration/detector.js +106 -0
- package/v3/dist/init/migration/detector.js.map +1 -0
- package/v3/dist/init/migration/index.d.ts +8 -0
- package/v3/dist/init/migration/index.d.ts.map +1 -0
- package/v3/dist/init/migration/index.js +8 -0
- package/v3/dist/init/migration/index.js.map +1 -0
- package/v3/dist/init/orchestrator.d.ts +68 -0
- package/v3/dist/init/orchestrator.d.ts.map +1 -0
- package/v3/dist/init/orchestrator.js +239 -0
- package/v3/dist/init/orchestrator.js.map +1 -0
- package/v3/dist/init/phases/01-detection.d.ts +30 -0
- package/v3/dist/init/phases/01-detection.d.ts.map +1 -0
- package/v3/dist/init/phases/01-detection.js +143 -0
- package/v3/dist/init/phases/01-detection.js.map +1 -0
- package/v3/dist/init/phases/02-analysis.d.ts +18 -0
- package/v3/dist/init/phases/02-analysis.d.ts.map +1 -0
- package/v3/dist/init/phases/02-analysis.js +28 -0
- package/v3/dist/init/phases/02-analysis.js.map +1 -0
- package/v3/dist/init/phases/03-configuration.d.ts +26 -0
- package/v3/dist/init/phases/03-configuration.d.ts.map +1 -0
- package/v3/dist/init/phases/03-configuration.js +98 -0
- package/v3/dist/init/phases/03-configuration.js.map +1 -0
- package/v3/dist/init/phases/04-database.d.ts +22 -0
- package/v3/dist/init/phases/04-database.d.ts.map +1 -0
- package/v3/dist/init/phases/04-database.js +88 -0
- package/v3/dist/init/phases/04-database.js.map +1 -0
- package/v3/dist/init/phases/05-learning.d.ts +28 -0
- package/v3/dist/init/phases/05-learning.d.ts.map +1 -0
- package/v3/dist/init/phases/05-learning.js +98 -0
- package/v3/dist/init/phases/05-learning.js.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts +33 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.js +115 -0
- package/v3/dist/init/phases/06-code-intelligence.js.map +1 -0
- package/v3/dist/init/phases/07-hooks.d.ts +27 -0
- package/v3/dist/init/phases/07-hooks.d.ts.map +1 -0
- package/v3/dist/init/phases/07-hooks.js +209 -0
- package/v3/dist/init/phases/07-hooks.js.map +1 -0
- package/v3/dist/init/phases/08-mcp.d.ts +22 -0
- package/v3/dist/init/phases/08-mcp.d.ts.map +1 -0
- package/v3/dist/init/phases/08-mcp.js +62 -0
- package/v3/dist/init/phases/08-mcp.js.map +1 -0
- package/v3/dist/init/phases/09-assets.d.ts +23 -0
- package/v3/dist/init/phases/09-assets.d.ts.map +1 -0
- package/v3/dist/init/phases/09-assets.js +82 -0
- package/v3/dist/init/phases/09-assets.js.map +1 -0
- package/v3/dist/init/phases/10-workers.d.ts +23 -0
- package/v3/dist/init/phases/10-workers.d.ts.map +1 -0
- package/v3/dist/init/phases/10-workers.js +111 -0
- package/v3/dist/init/phases/10-workers.js.map +1 -0
- package/v3/dist/init/phases/11-claude-md.d.ts +26 -0
- package/v3/dist/init/phases/11-claude-md.d.ts.map +1 -0
- package/v3/dist/init/phases/11-claude-md.js +121 -0
- package/v3/dist/init/phases/11-claude-md.js.map +1 -0
- package/v3/dist/init/phases/12-verification.d.ts +61 -0
- package/v3/dist/init/phases/12-verification.d.ts.map +1 -0
- package/v3/dist/init/phases/12-verification.js +370 -0
- package/v3/dist/init/phases/12-verification.js.map +1 -0
- package/v3/dist/init/phases/index.d.ts +46 -0
- package/v3/dist/init/phases/index.d.ts.map +1 -0
- package/v3/dist/init/phases/index.js +64 -0
- package/v3/dist/init/phases/index.js.map +1 -0
- package/v3/dist/init/phases/phase-interface.d.ts +193 -0
- package/v3/dist/init/phases/phase-interface.d.ts.map +1 -0
- package/v3/dist/init/phases/phase-interface.js +119 -0
- package/v3/dist/init/phases/phase-interface.js.map +1 -0
- 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 +323 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.js +856 -0
- package/v3/dist/integrations/coherence/coherence-service.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts +170 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js +403 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts +159 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js +348 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts +174 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js +401 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts +201 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js +324 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts +20 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.js +26 -0
- package/v3/dist/integrations/coherence/engines/index.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts +193 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js +565 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts +175 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js +377 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/index.d.ts +84 -0
- package/v3/dist/integrations/coherence/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/index.js +114 -0
- package/v3/dist/integrations/coherence/index.js.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts +396 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js +538 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js.map +1 -0
- package/v3/dist/integrations/coherence/types.d.ts +879 -0
- package/v3/dist/integrations/coherence/types.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/types.js +134 -0
- package/v3/dist/integrations/coherence/types.js.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts +351 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.js +842 -0
- package/v3/dist/integrations/coherence/wasm-loader.js.map +1 -0
- package/v3/dist/integrations/embeddings/index/HNSWIndex.d.ts.map +1 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js +4 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +8 -1
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.d.ts +272 -0
- package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -0
- package/v3/dist/learning/aqe-learning-engine.js +708 -0
- package/v3/dist/learning/aqe-learning-engine.js.map +1 -0
- package/v3/dist/learning/causal-verifier.d.ts +244 -0
- package/v3/dist/learning/causal-verifier.d.ts.map +1 -0
- package/v3/dist/learning/causal-verifier.js +300 -0
- package/v3/dist/learning/causal-verifier.js.map +1 -0
- package/v3/dist/learning/experience-capture.d.ts +266 -0
- package/v3/dist/learning/experience-capture.d.ts.map +1 -0
- package/v3/dist/learning/experience-capture.js +647 -0
- package/v3/dist/learning/experience-capture.js.map +1 -0
- package/v3/dist/learning/index.d.ts +8 -0
- package/v3/dist/learning/index.d.ts.map +1 -1
- package/v3/dist/learning/index.js +16 -0
- package/v3/dist/learning/index.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts +235 -0
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -0
- package/v3/dist/learning/memory-auditor.js +480 -0
- package/v3/dist/learning/memory-auditor.js.map +1 -0
- package/v3/dist/learning/pattern-store.d.ts.map +1 -1
- package/v3/dist/learning/pattern-store.js +27 -6
- package/v3/dist/learning/pattern-store.js.map +1 -1
- package/v3/dist/learning/qe-patterns.d.ts +15 -1
- package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
- package/v3/dist/learning/qe-patterns.js +26 -5
- package/v3/dist/learning/qe-patterns.js.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.d.ts +38 -2
- package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.js +86 -4
- package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts +32 -2
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +61 -6
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/mcp/bundle.js +8786 -1737
- 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/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/coherence/audit.d.ts +107 -0
- package/v3/dist/mcp/tools/coherence/audit.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/audit.js +236 -0
- package/v3/dist/mcp/tools/coherence/audit.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts +106 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.js +205 -0
- package/v3/dist/mcp/tools/coherence/check.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts +123 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.js +279 -0
- package/v3/dist/mcp/tools/coherence/collapse.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts +100 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.js +201 -0
- package/v3/dist/mcp/tools/coherence/consensus.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts +31 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.js +42 -0
- package/v3/dist/mcp/tools/coherence/index.js.map +1 -0
- package/v3/dist/mcp/tools/index.d.ts +6 -1
- package/v3/dist/mcp/tools/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/index.js +9 -1
- package/v3/dist/mcp/tools/index.js.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.js.map +1 -1
- package/v3/dist/mcp/tools/registry.d.ts +4 -0
- package/v3/dist/mcp/tools/registry.d.ts.map +1 -1
- package/v3/dist/mcp/tools/registry.js +5 -0
- package/v3/dist/mcp/tools/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/mcp/types.d.ts +1 -1
- package/v3/dist/mcp/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/belief-reconciler.d.ts +357 -0
- package/v3/dist/strange-loop/belief-reconciler.d.ts.map +1 -0
- package/v3/dist/strange-loop/belief-reconciler.js +696 -0
- package/v3/dist/strange-loop/belief-reconciler.js.map +1 -0
- package/v3/dist/strange-loop/index.d.ts +1 -0
- package/v3/dist/strange-loop/index.d.ts.map +1 -1
- package/v3/dist/strange-loop/index.js +2 -0
- package/v3/dist/strange-loop/index.js.map +1 -1
- package/v3/dist/strange-loop/strange-loop.d.ts +177 -5
- package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
- package/v3/dist/strange-loop/strange-loop.js +452 -9
- package/v3/dist/strange-loop/strange-loop.js.map +1 -1
- package/v3/dist/strange-loop/types.d.ts +205 -1
- package/v3/dist/strange-loop/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/types.js +5 -0
- package/v3/dist/strange-loop/types.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 +17 -2
|
@@ -0,0 +1,365 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* JestVitestGenerator - Test generator for Jest and Vitest frameworks
|
|
16
|
+
*
|
|
17
|
+
* Both frameworks share nearly identical APIs, so this single generator
|
|
18
|
+
* handles both by adjusting minor differences (e.g., vi vs jest mocking).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const generator = new JestVitestGenerator('vitest');
|
|
23
|
+
* const testCode = generator.generateTests({
|
|
24
|
+
* moduleName: 'userService',
|
|
25
|
+
* importPath: './user-service',
|
|
26
|
+
* testType: 'unit',
|
|
27
|
+
* patterns: [],
|
|
28
|
+
* analysis: { functions: [...], classes: [...] }
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class JestVitestGenerator extends BaseTestGenerator {
|
|
33
|
+
framework;
|
|
34
|
+
constructor(framework = 'vitest') {
|
|
35
|
+
super();
|
|
36
|
+
this.framework = framework;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the mock utility name (vi for vitest, jest for jest)
|
|
40
|
+
*/
|
|
41
|
+
get mockUtil() {
|
|
42
|
+
return this.framework === 'vitest' ? 'vi' : 'jest';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Generate complete test file from analysis
|
|
46
|
+
*/
|
|
47
|
+
generateTests(context) {
|
|
48
|
+
const { moduleName, importPath, testType, patterns, analysis } = context;
|
|
49
|
+
if (!analysis || (analysis.functions.length === 0 && analysis.classes.length === 0)) {
|
|
50
|
+
return this.generateStubTests(context);
|
|
51
|
+
}
|
|
52
|
+
const patternComment = this.generatePatternComment(patterns);
|
|
53
|
+
const exports = this.extractExports(analysis.functions, analysis.classes);
|
|
54
|
+
const importStatement = this.generateImportStatement(exports, importPath, moduleName);
|
|
55
|
+
const mockImport = this.framework === 'vitest' ? ', vi' : '';
|
|
56
|
+
let testCode = `${patternComment}import { describe, it, expect, beforeEach${mockImport} } from '${this.framework}';
|
|
57
|
+
${importStatement}
|
|
58
|
+
|
|
59
|
+
`;
|
|
60
|
+
// Generate tests for each function
|
|
61
|
+
for (const fn of analysis.functions) {
|
|
62
|
+
testCode += this.generateFunctionTests(fn, testType);
|
|
63
|
+
}
|
|
64
|
+
// Generate tests for each class
|
|
65
|
+
for (const cls of analysis.classes) {
|
|
66
|
+
testCode += this.generateClassTests(cls, testType);
|
|
67
|
+
}
|
|
68
|
+
return testCode;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Generate tests for a standalone function
|
|
72
|
+
*/
|
|
73
|
+
generateFunctionTests(fn, _testType) {
|
|
74
|
+
const testCases = this.generateTestCasesForFunction(fn);
|
|
75
|
+
let code = `describe('${fn.name}', () => {\n`;
|
|
76
|
+
for (const testCase of testCases) {
|
|
77
|
+
if (testCase.setup) {
|
|
78
|
+
code += ` ${testCase.setup}\n\n`;
|
|
79
|
+
}
|
|
80
|
+
const asyncPrefix = fn.isAsync ? 'async ' : '';
|
|
81
|
+
code += ` it('${testCase.description}', ${asyncPrefix}() => {\n`;
|
|
82
|
+
code += ` ${testCase.action}\n`;
|
|
83
|
+
code += ` ${testCase.assertion}\n`;
|
|
84
|
+
code += ` });\n\n`;
|
|
85
|
+
}
|
|
86
|
+
code += `});\n\n`;
|
|
87
|
+
return code;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Generate tests for a class
|
|
91
|
+
*/
|
|
92
|
+
generateClassTests(cls, testType) {
|
|
93
|
+
let code = `describe('${cls.name}', () => {\n`;
|
|
94
|
+
code += ` let instance: ${cls.name};\n\n`;
|
|
95
|
+
// Setup with beforeEach
|
|
96
|
+
if (cls.hasConstructor && cls.constructorParams) {
|
|
97
|
+
const constructorArgs = cls.constructorParams
|
|
98
|
+
.map((p) => this.generateTestValue(p))
|
|
99
|
+
.join(', ');
|
|
100
|
+
code += ` beforeEach(() => {\n`;
|
|
101
|
+
code += ` instance = new ${cls.name}(${constructorArgs});\n`;
|
|
102
|
+
code += ` });\n\n`;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
code += ` beforeEach(() => {\n`;
|
|
106
|
+
code += ` instance = new ${cls.name}();\n`;
|
|
107
|
+
code += ` });\n\n`;
|
|
108
|
+
}
|
|
109
|
+
// Constructor test
|
|
110
|
+
code += ` it('should instantiate correctly', () => {\n`;
|
|
111
|
+
code += ` expect(instance).toBeInstanceOf(${cls.name});\n`;
|
|
112
|
+
code += ` });\n\n`;
|
|
113
|
+
// Generate tests for each public method
|
|
114
|
+
for (const method of cls.methods) {
|
|
115
|
+
if (!method.name.startsWith('_') && !method.name.startsWith('#')) {
|
|
116
|
+
code += this.generateMethodTests(method, cls.name, testType);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
code += `});\n\n`;
|
|
120
|
+
return code;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Generate tests for a class method
|
|
124
|
+
*/
|
|
125
|
+
generateMethodTests(method, _className, _testType) {
|
|
126
|
+
let code = ` describe('${method.name}', () => {\n`;
|
|
127
|
+
const validParams = method.parameters.map((p) => this.generateTestValue(p)).join(', ');
|
|
128
|
+
const methodCall = method.isAsync
|
|
129
|
+
? `await instance.${method.name}(${validParams})`
|
|
130
|
+
: `instance.${method.name}(${validParams})`;
|
|
131
|
+
// Happy path test
|
|
132
|
+
const asyncPrefix = method.isAsync ? 'async ' : '';
|
|
133
|
+
code += ` it('should execute successfully', ${asyncPrefix}() => {\n`;
|
|
134
|
+
code += ` const result = ${methodCall};\n`;
|
|
135
|
+
code += ` expect(result).toBeDefined();\n`;
|
|
136
|
+
code += ` });\n`;
|
|
137
|
+
// Error handling tests for non-optional params
|
|
138
|
+
for (const param of method.parameters) {
|
|
139
|
+
if (!param.optional) {
|
|
140
|
+
const paramsWithUndefined = method.parameters
|
|
141
|
+
.map((p) => (p.name === param.name ? 'undefined as any' : this.generateTestValue(p)))
|
|
142
|
+
.join(', ');
|
|
143
|
+
code += `\n it('should handle invalid ${param.name}', () => {\n`;
|
|
144
|
+
code += ` expect(() => instance.${method.name}(${paramsWithUndefined})).toThrow();\n`;
|
|
145
|
+
code += ` });\n`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
code += ` });\n\n`;
|
|
149
|
+
return code;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Generate stub tests when no AST analysis is available
|
|
153
|
+
*/
|
|
154
|
+
generateStubTests(context) {
|
|
155
|
+
const { moduleName, importPath, testType, patterns } = context;
|
|
156
|
+
const patternComment = this.generatePatternComment(patterns);
|
|
157
|
+
const basicOpsTest = this.generateBasicOpsTest(moduleName, patterns);
|
|
158
|
+
const edgeCaseTest = this.generateEdgeCaseTest(moduleName, patterns);
|
|
159
|
+
const errorHandlingTest = this.generateErrorHandlingTest(moduleName, patterns);
|
|
160
|
+
return `${patternComment}import { ${moduleName} } from '${importPath}';
|
|
161
|
+
|
|
162
|
+
describe('${moduleName}', () => {
|
|
163
|
+
describe('${testType} tests', () => {
|
|
164
|
+
it('should be defined', () => {
|
|
165
|
+
expect(${moduleName}).toBeDefined();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
${basicOpsTest}
|
|
169
|
+
${edgeCaseTest}
|
|
170
|
+
${errorHandlingTest}
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Generate coverage-focused tests for specific lines
|
|
177
|
+
*/
|
|
178
|
+
generateCoverageTests(moduleName, importPath, lines) {
|
|
179
|
+
const funcName = this.camelCase(moduleName);
|
|
180
|
+
const lineRange = this.formatLineRange(lines);
|
|
181
|
+
return `// Coverage test for ${lineRange} in ${moduleName}
|
|
182
|
+
import { ${funcName} } from '${importPath}';
|
|
183
|
+
|
|
184
|
+
describe('${moduleName} coverage', () => {
|
|
185
|
+
describe('${lineRange}', () => {
|
|
186
|
+
it('should execute code path covering ${lineRange}', () => {
|
|
187
|
+
// Arrange: Set up test inputs to reach uncovered lines
|
|
188
|
+
const testInput = undefined; // Replace with appropriate input
|
|
189
|
+
|
|
190
|
+
// Act: Execute the code path
|
|
191
|
+
const result = ${funcName}(testInput);
|
|
192
|
+
|
|
193
|
+
// Assert: Verify the code was reached and behaves correctly
|
|
194
|
+
expect(result).toBeDefined();
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('should handle edge case for ${lineRange}', () => {
|
|
198
|
+
// Arrange: Set up edge case input
|
|
199
|
+
const edgeCaseInput = null;
|
|
200
|
+
|
|
201
|
+
// Act & Assert: Verify edge case handling
|
|
202
|
+
expect(() => ${funcName}(edgeCaseInput)).not.toThrow();
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
// ============================================================================
|
|
209
|
+
// Pattern-Aware Stub Test Generators
|
|
210
|
+
// ============================================================================
|
|
211
|
+
/**
|
|
212
|
+
* Generate basic operations test based on detected patterns
|
|
213
|
+
*/
|
|
214
|
+
generateBasicOpsTest(moduleName, patterns) {
|
|
215
|
+
const isService = patterns.some((p) => p.name.toLowerCase().includes('service') ||
|
|
216
|
+
p.name.toLowerCase().includes('repository'));
|
|
217
|
+
const isFactory = patterns.some((p) => p.name.toLowerCase().includes('factory'));
|
|
218
|
+
const hasAsyncPattern = patterns.some((p) => p.name.toLowerCase().includes('async') || p.name.toLowerCase().includes('promise'));
|
|
219
|
+
if (isService) {
|
|
220
|
+
return ` it('should handle basic operations', async () => {
|
|
221
|
+
// Service pattern: test core functionality
|
|
222
|
+
const instance = new ${moduleName}();
|
|
223
|
+
expect(instance).toBeInstanceOf(${moduleName});
|
|
224
|
+
|
|
225
|
+
// Verify service is properly initialized
|
|
226
|
+
const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance))
|
|
227
|
+
.filter(m => m !== 'constructor');
|
|
228
|
+
expect(methods.length).toBeGreaterThan(0);
|
|
229
|
+
});`;
|
|
230
|
+
}
|
|
231
|
+
if (isFactory) {
|
|
232
|
+
return ` it('should handle basic operations', () => {
|
|
233
|
+
// Factory pattern: test object creation
|
|
234
|
+
const result = ${moduleName}.create ? ${moduleName}.create() : new ${moduleName}();
|
|
235
|
+
expect(result).toBeDefined();
|
|
236
|
+
expect(typeof result).not.toBe('undefined');
|
|
237
|
+
});`;
|
|
238
|
+
}
|
|
239
|
+
if (hasAsyncPattern) {
|
|
240
|
+
return ` it('should handle basic operations', async () => {
|
|
241
|
+
// Async pattern: test promise resolution
|
|
242
|
+
const instance = typeof ${moduleName} === 'function'
|
|
243
|
+
? new ${moduleName}()
|
|
244
|
+
: ${moduleName};
|
|
245
|
+
|
|
246
|
+
// Verify async methods resolve properly
|
|
247
|
+
if (typeof instance.execute === 'function') {
|
|
248
|
+
await expect(instance.execute()).resolves.toBeDefined();
|
|
249
|
+
}
|
|
250
|
+
});`;
|
|
251
|
+
}
|
|
252
|
+
// Default implementation
|
|
253
|
+
return ` it('should handle basic operations', () => {
|
|
254
|
+
// Verify module exports expected interface
|
|
255
|
+
const moduleType = typeof ${moduleName};
|
|
256
|
+
expect(['function', 'object']).toContain(moduleType);
|
|
257
|
+
|
|
258
|
+
if (moduleType === 'function') {
|
|
259
|
+
// Class or function: verify instantiation
|
|
260
|
+
const instance = new ${moduleName}();
|
|
261
|
+
expect(instance).toBeDefined();
|
|
262
|
+
} else {
|
|
263
|
+
// Object module: verify properties exist
|
|
264
|
+
expect(Object.keys(${moduleName}).length).toBeGreaterThan(0);
|
|
265
|
+
}
|
|
266
|
+
});`;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Generate edge case test based on detected patterns
|
|
270
|
+
*/
|
|
271
|
+
generateEdgeCaseTest(moduleName, patterns) {
|
|
272
|
+
const hasValidation = patterns.some((p) => p.name.toLowerCase().includes('validation') ||
|
|
273
|
+
p.name.toLowerCase().includes('validator'));
|
|
274
|
+
const hasCollection = patterns.some((p) => p.name.toLowerCase().includes('collection') ||
|
|
275
|
+
p.name.toLowerCase().includes('list'));
|
|
276
|
+
if (hasValidation) {
|
|
277
|
+
return ` it('should handle edge cases', () => {
|
|
278
|
+
// Validation pattern: test boundary conditions
|
|
279
|
+
const instance = new ${moduleName}();
|
|
280
|
+
|
|
281
|
+
// Test with empty values
|
|
282
|
+
if (typeof instance.validate === 'function') {
|
|
283
|
+
expect(() => instance.validate('')).toBeDefined();
|
|
284
|
+
expect(() => instance.validate(null)).toBeDefined();
|
|
285
|
+
}
|
|
286
|
+
});`;
|
|
287
|
+
}
|
|
288
|
+
if (hasCollection) {
|
|
289
|
+
return ` it('should handle edge cases', () => {
|
|
290
|
+
// Collection pattern: test empty and large datasets
|
|
291
|
+
const instance = new ${moduleName}();
|
|
292
|
+
|
|
293
|
+
// Empty collection should be handled gracefully
|
|
294
|
+
if (typeof instance.add === 'function') {
|
|
295
|
+
expect(() => instance.add(undefined)).toBeDefined();
|
|
296
|
+
}
|
|
297
|
+
if (typeof instance.get === 'function') {
|
|
298
|
+
expect(instance.get('nonexistent')).toBeUndefined();
|
|
299
|
+
}
|
|
300
|
+
});`;
|
|
301
|
+
}
|
|
302
|
+
// Default edge case test
|
|
303
|
+
return ` it('should handle edge cases', () => {
|
|
304
|
+
// Test null/undefined handling
|
|
305
|
+
const instance = typeof ${moduleName} === 'function'
|
|
306
|
+
? new ${moduleName}()
|
|
307
|
+
: ${moduleName};
|
|
308
|
+
|
|
309
|
+
// Module should handle edge case inputs gracefully
|
|
310
|
+
expect(instance).toBeDefined();
|
|
311
|
+
expect(() => JSON.stringify(instance)).not.toThrow();
|
|
312
|
+
});`;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Generate error handling test based on detected patterns
|
|
316
|
+
*/
|
|
317
|
+
generateErrorHandlingTest(moduleName, patterns) {
|
|
318
|
+
const hasErrorPattern = patterns.some((p) => p.name.toLowerCase().includes('error') ||
|
|
319
|
+
p.name.toLowerCase().includes('exception'));
|
|
320
|
+
const hasAsyncPattern = patterns.some((p) => p.name.toLowerCase().includes('async') || p.name.toLowerCase().includes('promise'));
|
|
321
|
+
if (hasAsyncPattern) {
|
|
322
|
+
return ` it('should handle error conditions', async () => {
|
|
323
|
+
// Async error handling: verify rejections are caught
|
|
324
|
+
const instance = typeof ${moduleName} === 'function'
|
|
325
|
+
? new ${moduleName}()
|
|
326
|
+
: ${moduleName};
|
|
327
|
+
|
|
328
|
+
// Async operations should reject gracefully on invalid input
|
|
329
|
+
const asyncMethods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance) || {})
|
|
330
|
+
.filter(m => m !== 'constructor');
|
|
331
|
+
|
|
332
|
+
// At minimum, module should be stable
|
|
333
|
+
expect(instance).toBeDefined();
|
|
334
|
+
});`;
|
|
335
|
+
}
|
|
336
|
+
if (hasErrorPattern) {
|
|
337
|
+
return ` it('should handle error conditions', () => {
|
|
338
|
+
// Error pattern: verify custom error types
|
|
339
|
+
try {
|
|
340
|
+
const instance = new ${moduleName}();
|
|
341
|
+
// Trigger error condition if possible
|
|
342
|
+
if (typeof instance.throwError === 'function') {
|
|
343
|
+
expect(() => instance.throwError()).toThrow();
|
|
344
|
+
}
|
|
345
|
+
} catch (error) {
|
|
346
|
+
expect(error).toBeInstanceOf(Error);
|
|
347
|
+
}
|
|
348
|
+
});`;
|
|
349
|
+
}
|
|
350
|
+
// Default error handling test
|
|
351
|
+
return ` it('should handle error conditions', () => {
|
|
352
|
+
// Verify error resilience
|
|
353
|
+
expect(() => {
|
|
354
|
+
const instance = typeof ${moduleName} === 'function'
|
|
355
|
+
? new ${moduleName}()
|
|
356
|
+
: ${moduleName};
|
|
357
|
+
return instance;
|
|
358
|
+
}).not.toThrow();
|
|
359
|
+
|
|
360
|
+
// Module should not throw on inspection
|
|
361
|
+
expect(() => Object.keys(${moduleName})).not.toThrow();
|
|
362
|
+
});`;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=jest-vitest-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest-vitest-generator.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/jest-vitest-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAU1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IAC/C,SAAS,CAAgB;IAElC,YAAY,YAA+B,QAAQ;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,OAA8B;QAC1C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CA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C,UAAkB,EAAE,QAAmB;QACvE,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CACnC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;YACtC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAC7C,CAAC;QAEF,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CACnC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CACrF,CAAC;QAEF,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO;;gCAEmB,UAAU;gBAC1B,UAAU;YACd,UAAU;;;;;;;;QAQd,CAAC;QACL,CAAC;QAED,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO;;;+BAGkB,UAAU;;;;;;;;QAQjC,CAAC;QACL,CAAC;QAED,8BAA8B;QAC9B,OAAO;;;kCAGuB,UAAU;kBAC1B,UAAU;cACd,UAAU;;;;;iCAKS,UAAU;QACnC,CAAC;IACP,CAAC;CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Mocha Test Generator
|
|
3
|
+
* Strategy implementation for Mocha test framework with Chai assertions
|
|
4
|
+
*
|
|
5
|
+
* Generates test code using:
|
|
6
|
+
* - describe/it blocks (Mocha)
|
|
7
|
+
* - expect().to.be/to.equal assertions (Chai)
|
|
8
|
+
* - function() {} style for this context
|
|
9
|
+
* - beforeEach/afterEach hooks
|
|
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
|
+
* MochaGenerator - Test generator for Mocha framework with Chai
|
|
17
|
+
*
|
|
18
|
+
* Uses traditional function() syntax to preserve Mocha's this context
|
|
19
|
+
* for features like this.timeout() and this.retries().
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const generator = new MochaGenerator();
|
|
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 MochaGenerator extends BaseTestGenerator {
|
|
34
|
+
readonly framework: TestFramework;
|
|
35
|
+
/**
|
|
36
|
+
* Generate complete test file from analysis
|
|
37
|
+
*/
|
|
38
|
+
generateTests(context: TestGenerationContext): string;
|
|
39
|
+
/**
|
|
40
|
+
* Generate tests for a standalone function
|
|
41
|
+
*/
|
|
42
|
+
generateFunctionTests(fn: FunctionInfo, _testType: TestType): string;
|
|
43
|
+
/**
|
|
44
|
+
* Generate tests for a class
|
|
45
|
+
*/
|
|
46
|
+
generateClassTests(cls: ClassInfo, _testType: TestType): string;
|
|
47
|
+
/**
|
|
48
|
+
* Generate stub tests when no AST analysis is available
|
|
49
|
+
*/
|
|
50
|
+
generateStubTests(context: TestGenerationContext): string;
|
|
51
|
+
/**
|
|
52
|
+
* Generate coverage-focused tests for specific lines
|
|
53
|
+
*/
|
|
54
|
+
generateCoverageTests(moduleName: string, importPath: string, lines: number[]): string;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=mocha-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocha-generator.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/mocha-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,cAAe,SAAQ,iBAAiB;IACnD,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAW;IAE5C;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IA6BrD;;OAEG;IACH,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,GAAG,MAAM;IA2BpE;;OAEG;IACH,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,MAAM;IA2B/D;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAwDzD;;OAEG;IACH,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM;CAgCV"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Mocha Test Generator
|
|
3
|
+
* Strategy implementation for Mocha test framework with Chai assertions
|
|
4
|
+
*
|
|
5
|
+
* Generates test code using:
|
|
6
|
+
* - describe/it blocks (Mocha)
|
|
7
|
+
* - expect().to.be/to.equal assertions (Chai)
|
|
8
|
+
* - function() {} style for this context
|
|
9
|
+
* - beforeEach/afterEach hooks
|
|
10
|
+
*
|
|
11
|
+
* @module test-generation/generators
|
|
12
|
+
*/
|
|
13
|
+
import { BaseTestGenerator } from './base-test-generator';
|
|
14
|
+
/**
|
|
15
|
+
* MochaGenerator - Test generator for Mocha framework with Chai
|
|
16
|
+
*
|
|
17
|
+
* Uses traditional function() syntax to preserve Mocha's this context
|
|
18
|
+
* for features like this.timeout() and this.retries().
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const generator = new MochaGenerator();
|
|
23
|
+
* const testCode = generator.generateTests({
|
|
24
|
+
* moduleName: 'userService',
|
|
25
|
+
* importPath: './user-service',
|
|
26
|
+
* testType: 'unit',
|
|
27
|
+
* patterns: [],
|
|
28
|
+
* analysis: { functions: [...], classes: [...] }
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class MochaGenerator extends BaseTestGenerator {
|
|
33
|
+
framework = 'mocha';
|
|
34
|
+
/**
|
|
35
|
+
* Generate complete test file from analysis
|
|
36
|
+
*/
|
|
37
|
+
generateTests(context) {
|
|
38
|
+
const { moduleName, importPath, testType, patterns, analysis } = context;
|
|
39
|
+
if (!analysis || (analysis.functions.length === 0 && analysis.classes.length === 0)) {
|
|
40
|
+
return this.generateStubTests(context);
|
|
41
|
+
}
|
|
42
|
+
const patternComment = this.generatePatternComment(patterns);
|
|
43
|
+
const exports = this.extractExports(analysis.functions, analysis.classes);
|
|
44
|
+
const importStatement = this.generateImportStatement(exports, importPath, moduleName);
|
|
45
|
+
let code = `${patternComment}import { expect } from 'chai';
|
|
46
|
+
${importStatement}
|
|
47
|
+
|
|
48
|
+
describe('${moduleName} - ${testType} tests', function() {
|
|
49
|
+
`;
|
|
50
|
+
for (const fn of analysis.functions) {
|
|
51
|
+
code += this.generateFunctionTests(fn, testType);
|
|
52
|
+
}
|
|
53
|
+
for (const cls of analysis.classes) {
|
|
54
|
+
code += this.generateClassTests(cls, testType);
|
|
55
|
+
}
|
|
56
|
+
code += `});\n`;
|
|
57
|
+
return code;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate tests for a standalone function
|
|
61
|
+
*/
|
|
62
|
+
generateFunctionTests(fn, _testType) {
|
|
63
|
+
const validParams = fn.parameters.map((p) => this.generateTestValue(p)).join(', ');
|
|
64
|
+
const fnCall = fn.isAsync ? `await ${fn.name}(${validParams})` : `${fn.name}(${validParams})`;
|
|
65
|
+
let code = ` describe('${fn.name}', function() {\n`;
|
|
66
|
+
code += ` it('should handle valid input', ${fn.isAsync ? 'async ' : ''}function() {\n`;
|
|
67
|
+
code += ` const result = ${fnCall};\n`;
|
|
68
|
+
code += ` expect(result).to.not.be.undefined;\n`;
|
|
69
|
+
code += ` });\n`;
|
|
70
|
+
// Test for undefined parameters
|
|
71
|
+
for (const param of fn.parameters) {
|
|
72
|
+
if (!param.optional) {
|
|
73
|
+
const paramsWithUndefined = fn.parameters
|
|
74
|
+
.map((p) => (p.name === param.name ? 'undefined' : this.generateTestValue(p)))
|
|
75
|
+
.join(', ');
|
|
76
|
+
code += `\n it('should handle undefined ${param.name}', function() {\n`;
|
|
77
|
+
code += ` expect(function() { ${fn.name}(${paramsWithUndefined}); }).to.throw();\n`;
|
|
78
|
+
code += ` });\n`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
code += ` });\n\n`;
|
|
82
|
+
return code;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Generate tests for a class
|
|
86
|
+
*/
|
|
87
|
+
generateClassTests(cls, _testType) {
|
|
88
|
+
const constructorArgs = cls.constructorParams?.map((p) => this.generateTestValue(p)).join(', ') || '';
|
|
89
|
+
let code = ` describe('${cls.name}', function() {\n`;
|
|
90
|
+
code += ` let instance;\n\n`;
|
|
91
|
+
code += ` beforeEach(function() {\n`;
|
|
92
|
+
code += ` instance = new ${cls.name}(${constructorArgs});\n`;
|
|
93
|
+
code += ` });\n\n`;
|
|
94
|
+
code += ` it('should instantiate correctly', function() {\n`;
|
|
95
|
+
code += ` expect(instance).to.be.instanceOf(${cls.name});\n`;
|
|
96
|
+
code += ` });\n`;
|
|
97
|
+
for (const method of cls.methods) {
|
|
98
|
+
if (!method.name.startsWith('_')) {
|
|
99
|
+
const methodParams = method.parameters.map((p) => this.generateTestValue(p)).join(', ');
|
|
100
|
+
code += `\n it('${method.name} should work', ${method.isAsync ? 'async ' : ''}function() {\n`;
|
|
101
|
+
code += ` const result = ${method.isAsync ? 'await ' : ''}instance.${method.name}(${methodParams});\n`;
|
|
102
|
+
code += ` expect(result).to.not.be.undefined;\n`;
|
|
103
|
+
code += ` });\n`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
code += ` });\n\n`;
|
|
107
|
+
return code;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Generate stub tests when no AST analysis is available
|
|
111
|
+
*/
|
|
112
|
+
generateStubTests(context) {
|
|
113
|
+
const { moduleName, importPath, testType, patterns } = context;
|
|
114
|
+
const patternComment = this.generatePatternComment(patterns);
|
|
115
|
+
// Determine if async tests needed based on patterns
|
|
116
|
+
const isAsync = patterns.some((p) => p.name.toLowerCase().includes('async') || p.name.toLowerCase().includes('promise'));
|
|
117
|
+
const asyncSetup = isAsync ? 'async ' : '';
|
|
118
|
+
return `${patternComment}import { expect } from 'chai';
|
|
119
|
+
import { ${moduleName} } from '${importPath}';
|
|
120
|
+
|
|
121
|
+
describe('${moduleName}', function() {
|
|
122
|
+
describe('${testType} tests', function() {
|
|
123
|
+
it('should be defined', function() {
|
|
124
|
+
expect(${moduleName}).to.not.be.undefined;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('should handle basic operations', ${asyncSetup}function() {
|
|
128
|
+
// Verify module exports expected interface
|
|
129
|
+
const moduleType = typeof ${moduleName};
|
|
130
|
+
expect(['function', 'object']).to.include(moduleType);
|
|
131
|
+
|
|
132
|
+
if (moduleType === 'function') {
|
|
133
|
+
const instance = new ${moduleName}();
|
|
134
|
+
expect(instance).to.exist;
|
|
135
|
+
} else {
|
|
136
|
+
expect(Object.keys(${moduleName})).to.have.length.greaterThan(0);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should handle edge cases', function() {
|
|
141
|
+
// Verify resilience to edge inputs
|
|
142
|
+
const instance = typeof ${moduleName} === 'function'
|
|
143
|
+
? new ${moduleName}()
|
|
144
|
+
: ${moduleName};
|
|
145
|
+
expect(instance).to.exist;
|
|
146
|
+
expect(function() { JSON.stringify(instance); }).to.not.throw();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should handle error conditions', function() {
|
|
150
|
+
// Verify error resilience
|
|
151
|
+
expect(function() {
|
|
152
|
+
const instance = typeof ${moduleName} === 'function'
|
|
153
|
+
? new ${moduleName}()
|
|
154
|
+
: ${moduleName};
|
|
155
|
+
return instance;
|
|
156
|
+
}).to.not.throw();
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Generate coverage-focused tests for specific lines
|
|
164
|
+
*/
|
|
165
|
+
generateCoverageTests(moduleName, importPath, lines) {
|
|
166
|
+
const funcName = this.camelCase(moduleName);
|
|
167
|
+
const lineRange = this.formatLineRange(lines);
|
|
168
|
+
return `// Coverage test for ${lineRange} in ${moduleName}
|
|
169
|
+
import { expect } from 'chai';
|
|
170
|
+
import { ${funcName} } from '${importPath}';
|
|
171
|
+
|
|
172
|
+
describe('${moduleName} coverage', function() {
|
|
173
|
+
describe('${lineRange}', function() {
|
|
174
|
+
it('should execute code path covering ${lineRange}', function() {
|
|
175
|
+
// Arrange: Set up test inputs to reach uncovered lines
|
|
176
|
+
const testInput = undefined; // Replace with appropriate input
|
|
177
|
+
|
|
178
|
+
// Act: Execute the code path
|
|
179
|
+
const result = ${funcName}(testInput);
|
|
180
|
+
|
|
181
|
+
// Assert: Verify the code was reached and behaves correctly
|
|
182
|
+
expect(result).to.not.be.undefined;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should handle edge case for ${lineRange}', function() {
|
|
186
|
+
// Arrange: Set up edge case input
|
|
187
|
+
const edgeCaseInput = null;
|
|
188
|
+
|
|
189
|
+
// Act & Assert: Verify edge case handling
|
|
190
|
+
expect(function() { ${funcName}(edgeCaseInput); }).to.not.throw();
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=mocha-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocha-generator.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/generators/mocha-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAU1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IAC1C,SAAS,GAAkB,OAAO,CAAC;IAE5C;;OAEG;IACH,aAAa,CAAC,OAA8B;QAC1C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAEzE,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC1E,MAAM,eAAe,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAEtF,IAAI,IAAI,GAAG,GAAG,cAAc;EAC9B,eAAe;;YAEL,UAAU,MAAM,QAAQ;CACnC,CAAC;QAEE,KAAK,MAAM,EAAE,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;YACpC,IAAI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