@agentic-qe/v3 3.0.0-alpha.3
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 +429 -0
- package/dist/benchmarks/performance-benchmarks.d.ts +92 -0
- package/dist/benchmarks/performance-benchmarks.d.ts.map +1 -0
- package/dist/benchmarks/performance-benchmarks.js +477 -0
- package/dist/benchmarks/performance-benchmarks.js.map +1 -0
- package/dist/benchmarks/run-benchmarks.d.ts +12 -0
- package/dist/benchmarks/run-benchmarks.d.ts.map +1 -0
- package/dist/benchmarks/run-benchmarks.js +260 -0
- package/dist/benchmarks/run-benchmarks.js.map +1 -0
- package/dist/causal-discovery/causal-graph.d.ts +104 -0
- package/dist/causal-discovery/causal-graph.d.ts.map +1 -0
- package/dist/causal-discovery/causal-graph.js +384 -0
- package/dist/causal-discovery/causal-graph.js.map +1 -0
- package/dist/causal-discovery/discovery-engine.d.ts +120 -0
- package/dist/causal-discovery/discovery-engine.d.ts.map +1 -0
- package/dist/causal-discovery/discovery-engine.js +332 -0
- package/dist/causal-discovery/discovery-engine.js.map +1 -0
- package/dist/causal-discovery/index.d.ts +50 -0
- package/dist/causal-discovery/index.d.ts.map +1 -0
- package/dist/causal-discovery/index.js +69 -0
- package/dist/causal-discovery/index.js.map +1 -0
- package/dist/causal-discovery/types.d.ts +257 -0
- package/dist/causal-discovery/types.d.ts.map +1 -0
- package/dist/causal-discovery/types.js +72 -0
- package/dist/causal-discovery/types.js.map +1 -0
- package/dist/causal-discovery/weight-matrix.d.ts +130 -0
- package/dist/causal-discovery/weight-matrix.d.ts.map +1 -0
- package/dist/causal-discovery/weight-matrix.js +380 -0
- package/dist/causal-discovery/weight-matrix.js.map +1 -0
- package/dist/cli/commands/qe-tools.d.ts +27 -0
- package/dist/cli/commands/qe-tools.d.ts.map +1 -0
- package/dist/cli/commands/qe-tools.js +524 -0
- package/dist/cli/commands/qe-tools.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +1725 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compatibility/agent-mapper.d.ts +45 -0
- package/dist/compatibility/agent-mapper.d.ts.map +1 -0
- package/dist/compatibility/agent-mapper.js +256 -0
- package/dist/compatibility/agent-mapper.js.map +1 -0
- package/dist/compatibility/cli-adapter.d.ts +53 -0
- package/dist/compatibility/cli-adapter.d.ts.map +1 -0
- package/dist/compatibility/cli-adapter.js +247 -0
- package/dist/compatibility/cli-adapter.js.map +1 -0
- package/dist/compatibility/config-migrator.d.ts +42 -0
- package/dist/compatibility/config-migrator.d.ts.map +1 -0
- package/dist/compatibility/config-migrator.js +280 -0
- package/dist/compatibility/config-migrator.js.map +1 -0
- package/dist/compatibility/index.d.ts +58 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +90 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/mcp-adapter.d.ts +38 -0
- package/dist/compatibility/mcp-adapter.d.ts.map +1 -0
- package/dist/compatibility/mcp-adapter.js +202 -0
- package/dist/compatibility/mcp-adapter.js.map +1 -0
- package/dist/compatibility/types.d.ts +161 -0
- package/dist/compatibility/types.d.ts.map +1 -0
- package/dist/compatibility/types.js +5 -0
- package/dist/compatibility/types.js.map +1 -0
- package/dist/coordination/claims/claim-repository.d.ts +64 -0
- package/dist/coordination/claims/claim-repository.d.ts.map +1 -0
- package/dist/coordination/claims/claim-repository.js +524 -0
- package/dist/coordination/claims/claim-repository.js.map +1 -0
- package/dist/coordination/claims/claim-service.d.ts +45 -0
- package/dist/coordination/claims/claim-service.d.ts.map +1 -0
- package/dist/coordination/claims/claim-service.js +523 -0
- package/dist/coordination/claims/claim-service.js.map +1 -0
- package/dist/coordination/claims/handoff-manager.d.ts +95 -0
- package/dist/coordination/claims/handoff-manager.d.ts.map +1 -0
- package/dist/coordination/claims/handoff-manager.js +380 -0
- package/dist/coordination/claims/handoff-manager.js.map +1 -0
- package/dist/coordination/claims/index.d.ts +121 -0
- package/dist/coordination/claims/index.d.ts.map +1 -0
- package/dist/coordination/claims/index.js +129 -0
- package/dist/coordination/claims/index.js.map +1 -0
- package/dist/coordination/claims/interfaces.d.ts +471 -0
- package/dist/coordination/claims/interfaces.d.ts.map +1 -0
- package/dist/coordination/claims/interfaces.js +14 -0
- package/dist/coordination/claims/interfaces.js.map +1 -0
- package/dist/coordination/claims/work-stealing.d.ts +88 -0
- package/dist/coordination/claims/work-stealing.d.ts.map +1 -0
- package/dist/coordination/claims/work-stealing.js +335 -0
- package/dist/coordination/claims/work-stealing.js.map +1 -0
- package/dist/coordination/cross-domain-router.d.ts +104 -0
- package/dist/coordination/cross-domain-router.d.ts.map +1 -0
- package/dist/coordination/cross-domain-router.js +365 -0
- package/dist/coordination/cross-domain-router.js.map +1 -0
- package/dist/coordination/index.d.ts +14 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +29 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/interfaces.d.ts +482 -0
- package/dist/coordination/interfaces.d.ts.map +1 -0
- package/dist/coordination/interfaces.js +6 -0
- package/dist/coordination/interfaces.js.map +1 -0
- package/dist/coordination/protocol-executor.d.ts +119 -0
- package/dist/coordination/protocol-executor.d.ts.map +1 -0
- package/dist/coordination/protocol-executor.js +528 -0
- package/dist/coordination/protocol-executor.js.map +1 -0
- package/dist/coordination/protocols/code-intelligence-index.d.ts +204 -0
- package/dist/coordination/protocols/code-intelligence-index.d.ts.map +1 -0
- package/dist/coordination/protocols/code-intelligence-index.js +568 -0
- package/dist/coordination/protocols/code-intelligence-index.js.map +1 -0
- package/dist/coordination/protocols/defect-investigation.d.ts +202 -0
- package/dist/coordination/protocols/defect-investigation.d.ts.map +1 -0
- package/dist/coordination/protocols/defect-investigation.js +734 -0
- package/dist/coordination/protocols/defect-investigation.js.map +1 -0
- package/dist/coordination/protocols/index.d.ts +11 -0
- package/dist/coordination/protocols/index.d.ts.map +1 -0
- package/dist/coordination/protocols/index.js +11 -0
- package/dist/coordination/protocols/index.js.map +1 -0
- package/dist/coordination/protocols/learning-consolidation.d.ts +249 -0
- package/dist/coordination/protocols/learning-consolidation.d.ts.map +1 -0
- package/dist/coordination/protocols/learning-consolidation.js +811 -0
- package/dist/coordination/protocols/learning-consolidation.js.map +1 -0
- package/dist/coordination/protocols/morning-sync.d.ts +255 -0
- package/dist/coordination/protocols/morning-sync.d.ts.map +1 -0
- package/dist/coordination/protocols/morning-sync.js +730 -0
- package/dist/coordination/protocols/morning-sync.js.map +1 -0
- package/dist/coordination/protocols/quality-gate.d.ts +303 -0
- package/dist/coordination/protocols/quality-gate.d.ts.map +1 -0
- package/dist/coordination/protocols/quality-gate.js +924 -0
- package/dist/coordination/protocols/quality-gate.js.map +1 -0
- package/dist/coordination/protocols/security-audit.d.ts +263 -0
- package/dist/coordination/protocols/security-audit.d.ts.map +1 -0
- package/dist/coordination/protocols/security-audit.js +1159 -0
- package/dist/coordination/protocols/security-audit.js.map +1 -0
- package/dist/coordination/queen-coordinator.d.ts +214 -0
- package/dist/coordination/queen-coordinator.d.ts.map +1 -0
- package/dist/coordination/queen-coordinator.js +808 -0
- package/dist/coordination/queen-coordinator.js.map +1 -0
- package/dist/coordination/result-saver.d.ts +82 -0
- package/dist/coordination/result-saver.d.ts.map +1 -0
- package/dist/coordination/result-saver.js +536 -0
- package/dist/coordination/result-saver.js.map +1 -0
- package/dist/coordination/task-executor.d.ts +50 -0
- package/dist/coordination/task-executor.d.ts.map +1 -0
- package/dist/coordination/task-executor.js +965 -0
- package/dist/coordination/task-executor.js.map +1 -0
- package/dist/coordination/workflow-orchestrator.d.ts +362 -0
- package/dist/coordination/workflow-orchestrator.d.ts.map +1 -0
- package/dist/coordination/workflow-orchestrator.js +1298 -0
- package/dist/coordination/workflow-orchestrator.js.map +1 -0
- package/dist/domains/chaos-resilience/coordinator.d.ts +108 -0
- package/dist/domains/chaos-resilience/coordinator.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/coordinator.js +775 -0
- package/dist/domains/chaos-resilience/coordinator.js.map +1 -0
- package/dist/domains/chaos-resilience/index.d.ts +13 -0
- package/dist/domains/chaos-resilience/index.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/index.js +21 -0
- package/dist/domains/chaos-resilience/index.js.map +1 -0
- package/dist/domains/chaos-resilience/interfaces.d.ts +528 -0
- package/dist/domains/chaos-resilience/interfaces.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/interfaces.js +8 -0
- package/dist/domains/chaos-resilience/interfaces.js.map +1 -0
- package/dist/domains/chaos-resilience/plugin.d.ts +97 -0
- package/dist/domains/chaos-resilience/plugin.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/plugin.js +466 -0
- package/dist/domains/chaos-resilience/plugin.js.map +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +97 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +875 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js.map +1 -0
- package/dist/domains/chaos-resilience/services/index.d.ts +8 -0
- package/dist/domains/chaos-resilience/services/index.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/index.js +8 -0
- package/dist/domains/chaos-resilience/services/index.js.map +1 -0
- package/dist/domains/chaos-resilience/services/load-tester.d.ts +71 -0
- package/dist/domains/chaos-resilience/services/load-tester.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/load-tester.js +588 -0
- package/dist/domains/chaos-resilience/services/load-tester.js.map +1 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts +70 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.js +642 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.js.map +1 -0
- package/dist/domains/code-intelligence/coordinator.d.ts +104 -0
- package/dist/domains/code-intelligence/coordinator.d.ts.map +1 -0
- package/dist/domains/code-intelligence/coordinator.js +436 -0
- package/dist/domains/code-intelligence/coordinator.js.map +1 -0
- package/dist/domains/code-intelligence/index.d.ts +13 -0
- package/dist/domains/code-intelligence/index.d.ts.map +1 -0
- package/dist/domains/code-intelligence/index.js +21 -0
- package/dist/domains/code-intelligence/index.js.map +1 -0
- package/dist/domains/code-intelligence/interfaces.d.ts +130 -0
- package/dist/domains/code-intelligence/interfaces.d.ts.map +1 -0
- package/dist/domains/code-intelligence/interfaces.js +6 -0
- package/dist/domains/code-intelligence/interfaces.js.map +1 -0
- package/dist/domains/code-intelligence/plugin.d.ts +75 -0
- package/dist/domains/code-intelligence/plugin.d.ts.map +1 -0
- package/dist/domains/code-intelligence/plugin.js +279 -0
- package/dist/domains/code-intelligence/plugin.js.map +1 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.d.ts +80 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.js +391 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.js.map +1 -0
- package/dist/domains/code-intelligence/services/index.d.ts +8 -0
- package/dist/domains/code-intelligence/services/index.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/index.js +8 -0
- package/dist/domains/code-intelligence/services/index.js.map +1 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +101 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js +822 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js.map +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +141 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +661 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.js.map +1 -0
- package/dist/domains/contract-testing/coordinator.d.ts +114 -0
- package/dist/domains/contract-testing/coordinator.d.ts.map +1 -0
- package/dist/domains/contract-testing/coordinator.js +805 -0
- package/dist/domains/contract-testing/coordinator.js.map +1 -0
- package/dist/domains/contract-testing/index.d.ts +13 -0
- package/dist/domains/contract-testing/index.d.ts.map +1 -0
- package/dist/domains/contract-testing/index.js +21 -0
- package/dist/domains/contract-testing/index.js.map +1 -0
- package/dist/domains/contract-testing/interfaces.d.ts +344 -0
- package/dist/domains/contract-testing/interfaces.d.ts.map +1 -0
- package/dist/domains/contract-testing/interfaces.js +8 -0
- package/dist/domains/contract-testing/interfaces.js.map +1 -0
- package/dist/domains/contract-testing/plugin.d.ts +112 -0
- package/dist/domains/contract-testing/plugin.d.ts.map +1 -0
- package/dist/domains/contract-testing/plugin.js +491 -0
- package/dist/domains/contract-testing/plugin.js.map +1 -0
- package/dist/domains/contract-testing/services/api-compatibility.d.ts +53 -0
- package/dist/domains/contract-testing/services/api-compatibility.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/api-compatibility.js +535 -0
- package/dist/domains/contract-testing/services/api-compatibility.js.map +1 -0
- package/dist/domains/contract-testing/services/contract-validator.d.ts +100 -0
- package/dist/domains/contract-testing/services/contract-validator.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/contract-validator.js +1398 -0
- package/dist/domains/contract-testing/services/contract-validator.js.map +1 -0
- package/dist/domains/contract-testing/services/index.d.ts +8 -0
- package/dist/domains/contract-testing/services/index.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/index.js +8 -0
- package/dist/domains/contract-testing/services/index.js.map +1 -0
- package/dist/domains/contract-testing/services/schema-validator.d.ts +65 -0
- package/dist/domains/contract-testing/services/schema-validator.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/schema-validator.js +860 -0
- package/dist/domains/contract-testing/services/schema-validator.js.map +1 -0
- package/dist/domains/coverage-analysis/coordinator.d.ts +66 -0
- package/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/coordinator.js +353 -0
- package/dist/domains/coverage-analysis/coordinator.js.map +1 -0
- package/dist/domains/coverage-analysis/index.d.ts +33 -0
- package/dist/domains/coverage-analysis/index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/index.js +39 -0
- package/dist/domains/coverage-analysis/index.js.map +1 -0
- package/dist/domains/coverage-analysis/interfaces.d.ts +134 -0
- package/dist/domains/coverage-analysis/interfaces.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/interfaces.js +6 -0
- package/dist/domains/coverage-analysis/interfaces.js.map +1 -0
- package/dist/domains/coverage-analysis/plugin.d.ts +37 -0
- package/dist/domains/coverage-analysis/plugin.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/plugin.js +133 -0
- package/dist/domains/coverage-analysis/plugin.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts +49 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +342 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.d.ts +165 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.js +550 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.d.ts +203 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.js +506 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.js.map +1 -0
- package/dist/domains/coverage-analysis/services/gap-detector.d.ts +61 -0
- package/dist/domains/coverage-analysis/services/gap-detector.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/gap-detector.js +474 -0
- package/dist/domains/coverage-analysis/services/gap-detector.js.map +1 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +260 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.js +482 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.js.map +1 -0
- package/dist/domains/coverage-analysis/services/index.d.ts +13 -0
- package/dist/domains/coverage-analysis/services/index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/index.js +16 -0
- package/dist/domains/coverage-analysis/services/index.js.map +1 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.d.ts +62 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.js +412 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.js.map +1 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +237 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +499 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js.map +1 -0
- package/dist/domains/defect-intelligence/coordinator.d.ts +104 -0
- package/dist/domains/defect-intelligence/coordinator.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/coordinator.js +423 -0
- package/dist/domains/defect-intelligence/coordinator.js.map +1 -0
- package/dist/domains/defect-intelligence/index.d.ts +13 -0
- package/dist/domains/defect-intelligence/index.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/index.js +21 -0
- package/dist/domains/defect-intelligence/index.js.map +1 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts +127 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/interfaces.js +6 -0
- package/dist/domains/defect-intelligence/interfaces.js.map +1 -0
- package/dist/domains/defect-intelligence/plugin.d.ts +76 -0
- package/dist/domains/defect-intelligence/plugin.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/plugin.js +287 -0
- package/dist/domains/defect-intelligence/plugin.js.map +1 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts +188 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +298 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js.map +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +129 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +674 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js.map +1 -0
- package/dist/domains/defect-intelligence/services/index.d.ts +9 -0
- package/dist/domains/defect-intelligence/services/index.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/index.js +10 -0
- package/dist/domains/defect-intelligence/services/index.js.map +1 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts +96 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.js +548 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.js.map +1 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +60 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +465 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js.map +1 -0
- package/dist/domains/domain-interface.d.ts +32 -0
- package/dist/domains/domain-interface.d.ts.map +1 -0
- package/dist/domains/domain-interface.js +61 -0
- package/dist/domains/domain-interface.js.map +1 -0
- package/dist/domains/index.d.ts +20 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/index.js +22 -0
- package/dist/domains/index.js.map +1 -0
- package/dist/domains/learning-optimization/coordinator.d.ts +107 -0
- package/dist/domains/learning-optimization/coordinator.d.ts.map +1 -0
- package/dist/domains/learning-optimization/coordinator.js +849 -0
- package/dist/domains/learning-optimization/coordinator.js.map +1 -0
- package/dist/domains/learning-optimization/index.d.ts +14 -0
- package/dist/domains/learning-optimization/index.d.ts.map +1 -0
- package/dist/domains/learning-optimization/index.js +22 -0
- package/dist/domains/learning-optimization/index.js.map +1 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +453 -0
- package/dist/domains/learning-optimization/interfaces.d.ts.map +1 -0
- package/dist/domains/learning-optimization/interfaces.js +8 -0
- package/dist/domains/learning-optimization/interfaces.js.map +1 -0
- package/dist/domains/learning-optimization/plugin.d.ts +116 -0
- package/dist/domains/learning-optimization/plugin.d.ts.map +1 -0
- package/dist/domains/learning-optimization/plugin.js +523 -0
- package/dist/domains/learning-optimization/plugin.js.map +1 -0
- package/dist/domains/learning-optimization/services/index.d.ts +9 -0
- package/dist/domains/learning-optimization/services/index.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/index.js +9 -0
- package/dist/domains/learning-optimization/services/index.js.map +1 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +98 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +730 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.d.ts +89 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.js +598 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.js.map +1 -0
- package/dist/domains/learning-optimization/services/production-intel.d.ts +137 -0
- package/dist/domains/learning-optimization/services/production-intel.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/production-intel.js +649 -0
- package/dist/domains/learning-optimization/services/production-intel.js.map +1 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.d.ts +86 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.js +495 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +117 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.js +414 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts +102 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/index.js +122 -0
- package/dist/domains/quality-assessment/coherence/index.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts +93 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.js +293 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.d.ts +109 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.js +338 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/types.d.ts +239 -0
- package/dist/domains/quality-assessment/coherence/types.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/types.js +62 -0
- package/dist/domains/quality-assessment/coherence/types.js.map +1 -0
- package/dist/domains/quality-assessment/coordinator.d.ts +98 -0
- package/dist/domains/quality-assessment/coordinator.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coordinator.js +391 -0
- package/dist/domains/quality-assessment/coordinator.js.map +1 -0
- package/dist/domains/quality-assessment/index.d.ts +15 -0
- package/dist/domains/quality-assessment/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/index.js +27 -0
- package/dist/domains/quality-assessment/index.js.map +1 -0
- package/dist/domains/quality-assessment/interfaces.d.ts +140 -0
- package/dist/domains/quality-assessment/interfaces.d.ts.map +1 -0
- package/dist/domains/quality-assessment/interfaces.js +6 -0
- package/dist/domains/quality-assessment/interfaces.js.map +1 -0
- package/dist/domains/quality-assessment/plugin.d.ts +75 -0
- package/dist/domains/quality-assessment/plugin.d.ts.map +1 -0
- package/dist/domains/quality-assessment/plugin.js +294 -0
- package/dist/domains/quality-assessment/plugin.js.map +1 -0
- package/dist/domains/quality-assessment/services/coherence-gate.d.ts +109 -0
- package/dist/domains/quality-assessment/services/coherence-gate.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/coherence-gate.js +234 -0
- package/dist/domains/quality-assessment/services/coherence-gate.js.map +1 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts +83 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.js +384 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.js.map +1 -0
- package/dist/domains/quality-assessment/services/index.d.ts +9 -0
- package/dist/domains/quality-assessment/services/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/index.js +12 -0
- package/dist/domains/quality-assessment/services/index.js.map +1 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +74 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js +518 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js.map +1 -0
- package/dist/domains/quality-assessment/services/quality-gate.d.ts +57 -0
- package/dist/domains/quality-assessment/services/quality-gate.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/quality-gate.js +244 -0
- package/dist/domains/quality-assessment/services/quality-gate.js.map +1 -0
- package/dist/domains/requirements-validation/coordinator.d.ts +89 -0
- package/dist/domains/requirements-validation/coordinator.d.ts.map +1 -0
- package/dist/domains/requirements-validation/coordinator.js +574 -0
- package/dist/domains/requirements-validation/coordinator.js.map +1 -0
- package/dist/domains/requirements-validation/index.d.ts +13 -0
- package/dist/domains/requirements-validation/index.d.ts.map +1 -0
- package/dist/domains/requirements-validation/index.js +21 -0
- package/dist/domains/requirements-validation/index.js.map +1 -0
- package/dist/domains/requirements-validation/interfaces.d.ts +236 -0
- package/dist/domains/requirements-validation/interfaces.d.ts.map +1 -0
- package/dist/domains/requirements-validation/interfaces.js +8 -0
- package/dist/domains/requirements-validation/interfaces.js.map +1 -0
- package/dist/domains/requirements-validation/plugin.d.ts +103 -0
- package/dist/domains/requirements-validation/plugin.d.ts.map +1 -0
- package/dist/domains/requirements-validation/plugin.js +351 -0
- package/dist/domains/requirements-validation/plugin.js.map +1 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.d.ts +58 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.js +521 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.js.map +1 -0
- package/dist/domains/requirements-validation/services/index.d.ts +8 -0
- package/dist/domains/requirements-validation/services/index.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/index.js +8 -0
- package/dist/domains/requirements-validation/services/index.js.map +1 -0
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts +51 -0
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/requirements-validator.js +423 -0
- package/dist/domains/requirements-validation/services/requirements-validator.js.map +1 -0
- package/dist/domains/requirements-validation/services/testability-scorer.d.ts +79 -0
- package/dist/domains/requirements-validation/services/testability-scorer.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/testability-scorer.js +502 -0
- package/dist/domains/requirements-validation/services/testability-scorer.js.map +1 -0
- package/dist/domains/security-compliance/coordinator.d.ts +91 -0
- package/dist/domains/security-compliance/coordinator.d.ts.map +1 -0
- package/dist/domains/security-compliance/coordinator.js +497 -0
- package/dist/domains/security-compliance/coordinator.js.map +1 -0
- package/dist/domains/security-compliance/index.d.ts +13 -0
- package/dist/domains/security-compliance/index.d.ts.map +1 -0
- package/dist/domains/security-compliance/index.js +21 -0
- package/dist/domains/security-compliance/index.js.map +1 -0
- package/dist/domains/security-compliance/interfaces.d.ts +342 -0
- package/dist/domains/security-compliance/interfaces.d.ts.map +1 -0
- package/dist/domains/security-compliance/interfaces.js +8 -0
- package/dist/domains/security-compliance/interfaces.js.map +1 -0
- package/dist/domains/security-compliance/plugin.d.ts +81 -0
- package/dist/domains/security-compliance/plugin.d.ts.map +1 -0
- package/dist/domains/security-compliance/plugin.js +302 -0
- package/dist/domains/security-compliance/plugin.js.map +1 -0
- package/dist/domains/security-compliance/services/compliance-validator.d.ts +102 -0
- package/dist/domains/security-compliance/services/compliance-validator.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/compliance-validator.js +925 -0
- package/dist/domains/security-compliance/services/compliance-validator.js.map +1 -0
- package/dist/domains/security-compliance/services/index.d.ts +8 -0
- package/dist/domains/security-compliance/services/index.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/index.js +8 -0
- package/dist/domains/security-compliance/services/index.js.map +1 -0
- package/dist/domains/security-compliance/services/security-auditor.d.ts +174 -0
- package/dist/domains/security-compliance/services/security-auditor.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/security-auditor.js +1763 -0
- package/dist/domains/security-compliance/services/security-auditor.js.map +1 -0
- package/dist/domains/security-compliance/services/security-scanner.d.ts +185 -0
- package/dist/domains/security-compliance/services/security-scanner.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/security-scanner.js +1911 -0
- package/dist/domains/security-compliance/services/security-scanner.js.map +1 -0
- package/dist/domains/security-compliance/services/semgrep-integration.d.ts +95 -0
- package/dist/domains/security-compliance/services/semgrep-integration.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/semgrep-integration.js +209 -0
- package/dist/domains/security-compliance/services/semgrep-integration.js.map +1 -0
- package/dist/domains/test-execution/coordinator.d.ts +91 -0
- package/dist/domains/test-execution/coordinator.d.ts.map +1 -0
- package/dist/domains/test-execution/coordinator.js +280 -0
- package/dist/domains/test-execution/coordinator.js.map +1 -0
- package/dist/domains/test-execution/index.d.ts +11 -0
- package/dist/domains/test-execution/index.d.ts.map +1 -0
- package/dist/domains/test-execution/index.js +19 -0
- package/dist/domains/test-execution/index.js.map +1 -0
- package/dist/domains/test-execution/interfaces.d.ts +95 -0
- package/dist/domains/test-execution/interfaces.d.ts.map +1 -0
- package/dist/domains/test-execution/interfaces.js +6 -0
- package/dist/domains/test-execution/interfaces.js.map +1 -0
- package/dist/domains/test-execution/plugin.d.ts +27 -0
- package/dist/domains/test-execution/plugin.d.ts.map +1 -0
- package/dist/domains/test-execution/plugin.js +137 -0
- package/dist/domains/test-execution/plugin.js.map +1 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts +189 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts.map +1 -0
- package/dist/domains/test-execution/services/flaky-detector.js +834 -0
- package/dist/domains/test-execution/services/flaky-detector.js.map +1 -0
- package/dist/domains/test-execution/services/index.d.ts +8 -0
- package/dist/domains/test-execution/services/index.d.ts.map +1 -0
- package/dist/domains/test-execution/services/index.js +8 -0
- package/dist/domains/test-execution/services/index.js.map +1 -0
- package/dist/domains/test-execution/services/retry-handler.d.ts +169 -0
- package/dist/domains/test-execution/services/retry-handler.d.ts.map +1 -0
- package/dist/domains/test-execution/services/retry-handler.js +536 -0
- package/dist/domains/test-execution/services/retry-handler.js.map +1 -0
- package/dist/domains/test-execution/services/test-executor.d.ts +112 -0
- package/dist/domains/test-execution/services/test-executor.d.ts.map +1 -0
- package/dist/domains/test-execution/services/test-executor.js +657 -0
- package/dist/domains/test-execution/services/test-executor.js.map +1 -0
- package/dist/domains/test-generation/coordinator.d.ts +104 -0
- package/dist/domains/test-generation/coordinator.d.ts.map +1 -0
- package/dist/domains/test-generation/coordinator.js +446 -0
- package/dist/domains/test-generation/coordinator.js.map +1 -0
- package/dist/domains/test-generation/index.d.ts +12 -0
- package/dist/domains/test-generation/index.d.ts.map +1 -0
- package/dist/domains/test-generation/index.js +20 -0
- package/dist/domains/test-generation/index.js.map +1 -0
- package/dist/domains/test-generation/interfaces.d.ts +92 -0
- package/dist/domains/test-generation/interfaces.d.ts.map +1 -0
- package/dist/domains/test-generation/interfaces.js +6 -0
- package/dist/domains/test-generation/interfaces.js.map +1 -0
- package/dist/domains/test-generation/plugin.d.ts +70 -0
- package/dist/domains/test-generation/plugin.d.ts.map +1 -0
- package/dist/domains/test-generation/plugin.js +240 -0
- package/dist/domains/test-generation/plugin.js.map +1 -0
- package/dist/domains/test-generation/services/index.d.ts +7 -0
- package/dist/domains/test-generation/services/index.d.ts.map +1 -0
- package/dist/domains/test-generation/services/index.js +7 -0
- package/dist/domains/test-generation/services/index.js.map +1 -0
- package/dist/domains/test-generation/services/pattern-matcher.d.ts +276 -0
- package/dist/domains/test-generation/services/pattern-matcher.d.ts.map +1 -0
- package/dist/domains/test-generation/services/pattern-matcher.js +1271 -0
- package/dist/domains/test-generation/services/pattern-matcher.js.map +1 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +226 -0
- package/dist/domains/test-generation/services/test-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/services/test-generator.js +2230 -0
- package/dist/domains/test-generation/services/test-generator.js.map +1 -0
- package/dist/domains/visual-accessibility/coordinator.d.ts +118 -0
- package/dist/domains/visual-accessibility/coordinator.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/coordinator.js +623 -0
- package/dist/domains/visual-accessibility/coordinator.js.map +1 -0
- package/dist/domains/visual-accessibility/index.d.ts +13 -0
- package/dist/domains/visual-accessibility/index.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/index.js +21 -0
- package/dist/domains/visual-accessibility/index.js.map +1 -0
- package/dist/domains/visual-accessibility/interfaces.d.ts +360 -0
- package/dist/domains/visual-accessibility/interfaces.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/interfaces.js +8 -0
- package/dist/domains/visual-accessibility/interfaces.js.map +1 -0
- package/dist/domains/visual-accessibility/plugin.d.ts +92 -0
- package/dist/domains/visual-accessibility/plugin.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/plugin.js +343 -0
- package/dist/domains/visual-accessibility/plugin.js.map +1 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +115 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +794 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +219 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +427 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.js.map +1 -0
- package/dist/domains/visual-accessibility/services/index.d.ts +8 -0
- package/dist/domains/visual-accessibility/services/index.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/index.js +8 -0
- package/dist/domains/visual-accessibility/services/index.js.map +1 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.d.ts +149 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.js +667 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.js.map +1 -0
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts +78 -0
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/visual-tester.js +335 -0
- package/dist/domains/visual-accessibility/services/visual-tester.js.map +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +158 -0
- package/dist/early-exit/early-exit-controller.d.ts.map +1 -0
- package/dist/early-exit/early-exit-controller.js +354 -0
- package/dist/early-exit/early-exit-controller.js.map +1 -0
- package/dist/early-exit/early-exit-decision.d.ts +110 -0
- package/dist/early-exit/early-exit-decision.d.ts.map +1 -0
- package/dist/early-exit/early-exit-decision.js +241 -0
- package/dist/early-exit/early-exit-decision.js.map +1 -0
- package/dist/early-exit/index.d.ts +38 -0
- package/dist/early-exit/index.d.ts.map +1 -0
- package/dist/early-exit/index.js +53 -0
- package/dist/early-exit/index.js.map +1 -0
- package/dist/early-exit/quality-signal.d.ts +61 -0
- package/dist/early-exit/quality-signal.d.ts.map +1 -0
- package/dist/early-exit/quality-signal.js +306 -0
- package/dist/early-exit/quality-signal.js.map +1 -0
- package/dist/early-exit/speculative-executor.d.ts +131 -0
- package/dist/early-exit/speculative-executor.d.ts.map +1 -0
- package/dist/early-exit/speculative-executor.js +385 -0
- package/dist/early-exit/speculative-executor.js.map +1 -0
- package/dist/early-exit/types.d.ts +271 -0
- package/dist/early-exit/types.d.ts.map +1 -0
- package/dist/early-exit/types.js +69 -0
- package/dist/early-exit/types.js.map +1 -0
- package/dist/feedback/coverage-learner.d.ts +117 -0
- package/dist/feedback/coverage-learner.d.ts.map +1 -0
- package/dist/feedback/coverage-learner.js +367 -0
- package/dist/feedback/coverage-learner.js.map +1 -0
- package/dist/feedback/feedback-loop.d.ts +170 -0
- package/dist/feedback/feedback-loop.d.ts.map +1 -0
- package/dist/feedback/feedback-loop.js +281 -0
- package/dist/feedback/feedback-loop.js.map +1 -0
- package/dist/feedback/index.d.ts +17 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +20 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/pattern-promotion.d.ts +126 -0
- package/dist/feedback/pattern-promotion.d.ts.map +1 -0
- package/dist/feedback/pattern-promotion.js +282 -0
- package/dist/feedback/pattern-promotion.js.map +1 -0
- package/dist/feedback/quality-score-calculator.d.ts +93 -0
- package/dist/feedback/quality-score-calculator.d.ts.map +1 -0
- package/dist/feedback/quality-score-calculator.js +285 -0
- package/dist/feedback/quality-score-calculator.js.map +1 -0
- package/dist/feedback/test-outcome-tracker.d.ts +103 -0
- package/dist/feedback/test-outcome-tracker.d.ts.map +1 -0
- package/dist/feedback/test-outcome-tracker.js +347 -0
- package/dist/feedback/test-outcome-tracker.js.map +1 -0
- package/dist/feedback/types.d.ts +322 -0
- package/dist/feedback/types.d.ts.map +1 -0
- package/dist/feedback/types.js +60 -0
- package/dist/feedback/types.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/init/agents-installer.d.ts +88 -0
- package/dist/init/agents-installer.d.ts.map +1 -0
- package/dist/init/agents-installer.js +441 -0
- package/dist/init/agents-installer.js.map +1 -0
- package/dist/init/index.d.ts +18 -0
- package/dist/init/index.d.ts.map +1 -0
- package/dist/init/index.js +14 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/init-wizard.d.ts +107 -0
- package/dist/init/init-wizard.d.ts.map +1 -0
- package/dist/init/init-wizard.js +906 -0
- package/dist/init/init-wizard.js.map +1 -0
- package/dist/init/project-analyzer.d.ts +95 -0
- package/dist/init/project-analyzer.d.ts.map +1 -0
- package/dist/init/project-analyzer.js +608 -0
- package/dist/init/project-analyzer.js.map +1 -0
- package/dist/init/self-configurator.d.ts +74 -0
- package/dist/init/self-configurator.d.ts.map +1 -0
- package/dist/init/self-configurator.js +384 -0
- package/dist/init/self-configurator.js.map +1 -0
- package/dist/init/skills-installer.d.ts +88 -0
- package/dist/init/skills-installer.d.ts.map +1 -0
- package/dist/init/skills-installer.js +386 -0
- package/dist/init/skills-installer.js.map +1 -0
- package/dist/init/types.d.ts +280 -0
- package/dist/init/types.d.ts.map +1 -0
- package/dist/init/types.js +110 -0
- package/dist/init/types.js.map +1 -0
- package/dist/integrations/ruvector/ast-complexity.d.ts +134 -0
- package/dist/integrations/ruvector/ast-complexity.d.ts.map +1 -0
- package/dist/integrations/ruvector/ast-complexity.js +383 -0
- package/dist/integrations/ruvector/ast-complexity.js.map +1 -0
- package/dist/integrations/ruvector/coverage-router.d.ts +128 -0
- package/dist/integrations/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/integrations/ruvector/coverage-router.js +463 -0
- package/dist/integrations/ruvector/coverage-router.js.map +1 -0
- package/dist/integrations/ruvector/diff-risk-classifier.d.ts +129 -0
- package/dist/integrations/ruvector/diff-risk-classifier.d.ts.map +1 -0
- package/dist/integrations/ruvector/diff-risk-classifier.js +569 -0
- package/dist/integrations/ruvector/diff-risk-classifier.js.map +1 -0
- package/dist/integrations/ruvector/fallback.d.ts +138 -0
- package/dist/integrations/ruvector/fallback.d.ts.map +1 -0
- package/dist/integrations/ruvector/fallback.js +737 -0
- package/dist/integrations/ruvector/fallback.js.map +1 -0
- package/dist/integrations/ruvector/graph-boundaries.d.ts +151 -0
- package/dist/integrations/ruvector/graph-boundaries.d.ts.map +1 -0
- package/dist/integrations/ruvector/graph-boundaries.js +627 -0
- package/dist/integrations/ruvector/graph-boundaries.js.map +1 -0
- package/dist/integrations/ruvector/index.d.ts +82 -0
- package/dist/integrations/ruvector/index.d.ts.map +1 -0
- package/dist/integrations/ruvector/index.js +254 -0
- package/dist/integrations/ruvector/index.js.map +1 -0
- package/dist/integrations/ruvector/interfaces.d.ts +488 -0
- package/dist/integrations/ruvector/interfaces.d.ts.map +1 -0
- package/dist/integrations/ruvector/interfaces.js +64 -0
- package/dist/integrations/ruvector/interfaces.js.map +1 -0
- package/dist/integrations/ruvector/q-learning-router.d.ts +128 -0
- package/dist/integrations/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/integrations/ruvector/q-learning-router.js +427 -0
- package/dist/integrations/ruvector/q-learning-router.js.map +1 -0
- package/dist/kernel/agent-coordinator.d.ts +22 -0
- package/dist/kernel/agent-coordinator.d.ts.map +1 -0
- package/dist/kernel/agent-coordinator.js +113 -0
- package/dist/kernel/agent-coordinator.js.map +1 -0
- package/dist/kernel/agentdb-backend.d.ts +131 -0
- package/dist/kernel/agentdb-backend.d.ts.map +1 -0
- package/dist/kernel/agentdb-backend.js +359 -0
- package/dist/kernel/agentdb-backend.js.map +1 -0
- package/dist/kernel/event-bus.d.ts +18 -0
- package/dist/kernel/event-bus.d.ts.map +1 -0
- package/dist/kernel/event-bus.js +99 -0
- package/dist/kernel/event-bus.js.map +1 -0
- package/dist/kernel/hybrid-backend.d.ts +124 -0
- package/dist/kernel/hybrid-backend.d.ts.map +1 -0
- package/dist/kernel/hybrid-backend.js +395 -0
- package/dist/kernel/hybrid-backend.js.map +1 -0
- package/dist/kernel/index.d.ts +16 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +17 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/kernel/interfaces.d.ts +174 -0
- package/dist/kernel/interfaces.d.ts.map +1 -0
- package/dist/kernel/interfaces.js +6 -0
- package/dist/kernel/interfaces.js.map +1 -0
- package/dist/kernel/kernel.d.ts +50 -0
- package/dist/kernel/kernel.d.ts.map +1 -0
- package/dist/kernel/kernel.js +228 -0
- package/dist/kernel/kernel.js.map +1 -0
- package/dist/kernel/memory-backend.d.ts +28 -0
- package/dist/kernel/memory-backend.d.ts.map +1 -0
- package/dist/kernel/memory-backend.js +126 -0
- package/dist/kernel/memory-backend.js.map +1 -0
- package/dist/kernel/memory-factory.d.ts +100 -0
- package/dist/kernel/memory-factory.d.ts.map +1 -0
- package/dist/kernel/memory-factory.js +209 -0
- package/dist/kernel/memory-factory.js.map +1 -0
- package/dist/kernel/plugin-loader.d.ts +36 -0
- package/dist/kernel/plugin-loader.d.ts.map +1 -0
- package/dist/kernel/plugin-loader.js +145 -0
- package/dist/kernel/plugin-loader.js.map +1 -0
- package/dist/learning/index.d.ts +58 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +90 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/pattern-store.d.ts +242 -0
- package/dist/learning/pattern-store.d.ts.map +1 -0
- package/dist/learning/pattern-store.js +657 -0
- package/dist/learning/pattern-store.js.map +1 -0
- package/dist/learning/qe-guidance.d.ts +125 -0
- package/dist/learning/qe-guidance.d.ts.map +1 -0
- package/dist/learning/qe-guidance.js +712 -0
- package/dist/learning/qe-guidance.js.map +1 -0
- package/dist/learning/qe-hooks.d.ts +111 -0
- package/dist/learning/qe-hooks.d.ts.map +1 -0
- package/dist/learning/qe-hooks.js +475 -0
- package/dist/learning/qe-hooks.js.map +1 -0
- package/dist/learning/qe-patterns.d.ts +203 -0
- package/dist/learning/qe-patterns.d.ts.map +1 -0
- package/dist/learning/qe-patterns.js +181 -0
- package/dist/learning/qe-patterns.js.map +1 -0
- package/dist/learning/qe-reasoning-bank.d.ts +263 -0
- package/dist/learning/qe-reasoning-bank.d.ts.map +1 -0
- package/dist/learning/qe-reasoning-bank.js +617 -0
- package/dist/learning/qe-reasoning-bank.js.map +1 -0
- package/dist/learning/real-embeddings.d.ts +61 -0
- package/dist/learning/real-embeddings.d.ts.map +1 -0
- package/dist/learning/real-embeddings.js +219 -0
- package/dist/learning/real-embeddings.js.map +1 -0
- package/dist/learning/real-qe-reasoning-bank.d.ts +182 -0
- package/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -0
- package/dist/learning/real-qe-reasoning-bank.js +597 -0
- package/dist/learning/real-qe-reasoning-bank.js.map +1 -0
- package/dist/learning/sqlite-persistence.d.ts +121 -0
- package/dist/learning/sqlite-persistence.d.ts.map +1 -0
- package/dist/learning/sqlite-persistence.js +438 -0
- package/dist/learning/sqlite-persistence.js.map +1 -0
- package/dist/mcp/entry.d.ts +13 -0
- package/dist/mcp/entry.d.ts.map +1 -0
- package/dist/mcp/entry.js +53 -0
- package/dist/mcp/entry.js.map +1 -0
- package/dist/mcp/handlers/agent-handlers.d.ts +62 -0
- package/dist/mcp/handlers/agent-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/agent-handlers.js +173 -0
- package/dist/mcp/handlers/agent-handlers.js.map +1 -0
- package/dist/mcp/handlers/core-handlers.d.ts +30 -0
- package/dist/mcp/handlers/core-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/core-handlers.js +250 -0
- package/dist/mcp/handlers/core-handlers.js.map +1 -0
- package/dist/mcp/handlers/domain-handlers.d.ts +135 -0
- package/dist/mcp/handlers/domain-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/domain-handlers.js +990 -0
- package/dist/mcp/handlers/domain-handlers.js.map +1 -0
- package/dist/mcp/handlers/index.d.ts +10 -0
- package/dist/mcp/handlers/index.d.ts.map +1 -0
- package/dist/mcp/handlers/index.js +15 -0
- package/dist/mcp/handlers/index.js.map +1 -0
- package/dist/mcp/handlers/memory-handlers.d.ts +53 -0
- package/dist/mcp/handlers/memory-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/memory-handlers.js +228 -0
- package/dist/mcp/handlers/memory-handlers.js.map +1 -0
- package/dist/mcp/handlers/task-handlers.d.ts +26 -0
- package/dist/mcp/handlers/task-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/task-handlers.js +293 -0
- package/dist/mcp/handlers/task-handlers.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/metrics/index.d.ts +6 -0
- package/dist/mcp/metrics/index.d.ts.map +1 -0
- package/dist/mcp/metrics/index.js +6 -0
- package/dist/mcp/metrics/index.js.map +1 -0
- package/dist/mcp/metrics/metrics-collector.d.ts +154 -0
- package/dist/mcp/metrics/metrics-collector.d.ts.map +1 -0
- package/dist/mcp/metrics/metrics-collector.js +377 -0
- package/dist/mcp/metrics/metrics-collector.js.map +1 -0
- package/dist/mcp/protocol-server.d.ts +66 -0
- package/dist/mcp/protocol-server.d.ts.map +1 -0
- package/dist/mcp/protocol-server.js +600 -0
- package/dist/mcp/protocol-server.js.map +1 -0
- package/dist/mcp/security/cve-prevention.d.ts +150 -0
- package/dist/mcp/security/cve-prevention.d.ts.map +1 -0
- package/dist/mcp/security/cve-prevention.js +570 -0
- package/dist/mcp/security/cve-prevention.js.map +1 -0
- package/dist/mcp/security/index.d.ts +116 -0
- package/dist/mcp/security/index.d.ts.map +1 -0
- package/dist/mcp/security/index.js +184 -0
- package/dist/mcp/security/index.js.map +1 -0
- package/dist/mcp/security/oauth21-provider.d.ts +229 -0
- package/dist/mcp/security/oauth21-provider.d.ts.map +1 -0
- package/dist/mcp/security/oauth21-provider.js +558 -0
- package/dist/mcp/security/oauth21-provider.js.map +1 -0
- package/dist/mcp/security/rate-limiter.d.ts +191 -0
- package/dist/mcp/security/rate-limiter.d.ts.map +1 -0
- package/dist/mcp/security/rate-limiter.js +437 -0
- package/dist/mcp/security/rate-limiter.js.map +1 -0
- package/dist/mcp/security/sampling-server.d.ts +289 -0
- package/dist/mcp/security/sampling-server.d.ts.map +1 -0
- package/dist/mcp/security/sampling-server.js +450 -0
- package/dist/mcp/security/sampling-server.js.map +1 -0
- package/dist/mcp/security/schema-validator.d.ts +197 -0
- package/dist/mcp/security/schema-validator.d.ts.map +1 -0
- package/dist/mcp/security/schema-validator.js +633 -0
- package/dist/mcp/security/schema-validator.js.map +1 -0
- package/dist/mcp/server.d.ts +46 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +576 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +98 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +321 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/base.d.ts +186 -0
- package/dist/mcp/tools/base.d.ts.map +1 -0
- package/dist/mcp/tools/base.js +249 -0
- package/dist/mcp/tools/base.js.map +1 -0
- package/dist/mcp/tools/chaos-resilience/inject.d.ts +61 -0
- package/dist/mcp/tools/chaos-resilience/inject.d.ts.map +1 -0
- package/dist/mcp/tools/chaos-resilience/inject.js +520 -0
- package/dist/mcp/tools/chaos-resilience/inject.js.map +1 -0
- package/dist/mcp/tools/code-intelligence/analyze.d.ts +140 -0
- package/dist/mcp/tools/code-intelligence/analyze.d.ts.map +1 -0
- package/dist/mcp/tools/code-intelligence/analyze.js +570 -0
- package/dist/mcp/tools/code-intelligence/analyze.js.map +1 -0
- package/dist/mcp/tools/contract-testing/validate.d.ts +90 -0
- package/dist/mcp/tools/contract-testing/validate.d.ts.map +1 -0
- package/dist/mcp/tools/contract-testing/validate.js +515 -0
- package/dist/mcp/tools/contract-testing/validate.js.map +1 -0
- package/dist/mcp/tools/coverage-analysis/index.d.ts +111 -0
- package/dist/mcp/tools/coverage-analysis/index.d.ts.map +1 -0
- package/dist/mcp/tools/coverage-analysis/index.js +577 -0
- package/dist/mcp/tools/coverage-analysis/index.js.map +1 -0
- package/dist/mcp/tools/defect-intelligence/predict.d.ts +67 -0
- package/dist/mcp/tools/defect-intelligence/predict.d.ts.map +1 -0
- package/dist/mcp/tools/defect-intelligence/predict.js +359 -0
- package/dist/mcp/tools/defect-intelligence/predict.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +40 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +82 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/learning-optimization/optimize.d.ts +123 -0
- package/dist/mcp/tools/learning-optimization/optimize.d.ts.map +1 -0
- package/dist/mcp/tools/learning-optimization/optimize.js +563 -0
- package/dist/mcp/tools/learning-optimization/optimize.js.map +1 -0
- package/dist/mcp/tools/quality-assessment/evaluate.d.ts +83 -0
- package/dist/mcp/tools/quality-assessment/evaluate.d.ts.map +1 -0
- package/dist/mcp/tools/quality-assessment/evaluate.js +277 -0
- package/dist/mcp/tools/quality-assessment/evaluate.js.map +1 -0
- package/dist/mcp/tools/registry.d.ts +79 -0
- package/dist/mcp/tools/registry.d.ts.map +1 -0
- package/dist/mcp/tools/registry.js +181 -0
- package/dist/mcp/tools/registry.js.map +1 -0
- package/dist/mcp/tools/requirements-validation/validate.d.ts +81 -0
- package/dist/mcp/tools/requirements-validation/validate.d.ts.map +1 -0
- package/dist/mcp/tools/requirements-validation/validate.js +270 -0
- package/dist/mcp/tools/requirements-validation/validate.js.map +1 -0
- package/dist/mcp/tools/security-compliance/scan.d.ts +75 -0
- package/dist/mcp/tools/security-compliance/scan.d.ts.map +1 -0
- package/dist/mcp/tools/security-compliance/scan.js +258 -0
- package/dist/mcp/tools/security-compliance/scan.js.map +1 -0
- package/dist/mcp/tools/test-execution/execute.d.ts +65 -0
- package/dist/mcp/tools/test-execution/execute.d.ts.map +1 -0
- package/dist/mcp/tools/test-execution/execute.js +196 -0
- package/dist/mcp/tools/test-execution/execute.js.map +1 -0
- package/dist/mcp/tools/test-generation/generate.d.ts +53 -0
- package/dist/mcp/tools/test-generation/generate.d.ts.map +1 -0
- package/dist/mcp/tools/test-generation/generate.js +437 -0
- package/dist/mcp/tools/test-generation/generate.js.map +1 -0
- package/dist/mcp/tools/visual-accessibility/index.d.ts +144 -0
- package/dist/mcp/tools/visual-accessibility/index.d.ts.map +1 -0
- package/dist/mcp/tools/visual-accessibility/index.js +562 -0
- package/dist/mcp/tools/visual-accessibility/index.js.map +1 -0
- package/dist/mcp/transport/index.d.ts +12 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +21 -0
- package/dist/mcp/transport/index.js.map +1 -0
- package/dist/mcp/transport/stdio.d.ts +95 -0
- package/dist/mcp/transport/stdio.d.ts.map +1 -0
- package/dist/mcp/transport/stdio.js +226 -0
- package/dist/mcp/transport/stdio.js.map +1 -0
- package/dist/mcp/types.d.ts +455 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/neural-optimizer/index.d.ts +55 -0
- package/dist/neural-optimizer/index.d.ts.map +1 -0
- package/dist/neural-optimizer/index.js +57 -0
- package/dist/neural-optimizer/index.js.map +1 -0
- package/dist/neural-optimizer/replay-buffer.d.ts +126 -0
- package/dist/neural-optimizer/replay-buffer.d.ts.map +1 -0
- package/dist/neural-optimizer/replay-buffer.js +355 -0
- package/dist/neural-optimizer/replay-buffer.js.map +1 -0
- package/dist/neural-optimizer/swarm-topology.d.ts +157 -0
- package/dist/neural-optimizer/swarm-topology.d.ts.map +1 -0
- package/dist/neural-optimizer/swarm-topology.js +384 -0
- package/dist/neural-optimizer/swarm-topology.js.map +1 -0
- package/dist/neural-optimizer/topology-optimizer.d.ts +137 -0
- package/dist/neural-optimizer/topology-optimizer.d.ts.map +1 -0
- package/dist/neural-optimizer/topology-optimizer.js +656 -0
- package/dist/neural-optimizer/topology-optimizer.js.map +1 -0
- package/dist/neural-optimizer/types.d.ts +333 -0
- package/dist/neural-optimizer/types.d.ts.map +1 -0
- package/dist/neural-optimizer/types.js +57 -0
- package/dist/neural-optimizer/types.js.map +1 -0
- package/dist/neural-optimizer/value-network.d.ts +129 -0
- package/dist/neural-optimizer/value-network.d.ts.map +1 -0
- package/dist/neural-optimizer/value-network.js +278 -0
- package/dist/neural-optimizer/value-network.js.map +1 -0
- package/dist/optimization/auto-tuner.d.ts +207 -0
- package/dist/optimization/auto-tuner.d.ts.map +1 -0
- package/dist/optimization/auto-tuner.js +641 -0
- package/dist/optimization/auto-tuner.js.map +1 -0
- package/dist/optimization/index.d.ts +16 -0
- package/dist/optimization/index.d.ts.map +1 -0
- package/dist/optimization/index.js +14 -0
- package/dist/optimization/index.js.map +1 -0
- package/dist/optimization/metric-collectors.d.ts +145 -0
- package/dist/optimization/metric-collectors.d.ts.map +1 -0
- package/dist/optimization/metric-collectors.js +401 -0
- package/dist/optimization/metric-collectors.js.map +1 -0
- package/dist/optimization/qe-workers.d.ts +143 -0
- package/dist/optimization/qe-workers.d.ts.map +1 -0
- package/dist/optimization/qe-workers.js +510 -0
- package/dist/optimization/qe-workers.js.map +1 -0
- package/dist/optimization/tuning-algorithm.d.ts +93 -0
- package/dist/optimization/tuning-algorithm.d.ts.map +1 -0
- package/dist/optimization/tuning-algorithm.js +278 -0
- package/dist/optimization/tuning-algorithm.js.map +1 -0
- package/dist/optimization/types.d.ts +211 -0
- package/dist/optimization/types.d.ts.map +1 -0
- package/dist/optimization/types.js +81 -0
- package/dist/optimization/types.js.map +1 -0
- package/dist/routing/index.d.ts +15 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +17 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/qe-agent-registry.d.ts +58 -0
- package/dist/routing/qe-agent-registry.d.ts.map +1 -0
- package/dist/routing/qe-agent-registry.js +909 -0
- package/dist/routing/qe-agent-registry.js.map +1 -0
- package/dist/routing/qe-task-router.d.ts +82 -0
- package/dist/routing/qe-task-router.d.ts.map +1 -0
- package/dist/routing/qe-task-router.js +453 -0
- package/dist/routing/qe-task-router.js.map +1 -0
- package/dist/routing/routing-feedback.d.ts +82 -0
- package/dist/routing/routing-feedback.d.ts.map +1 -0
- package/dist/routing/routing-feedback.js +272 -0
- package/dist/routing/routing-feedback.js.map +1 -0
- package/dist/routing/types.d.ts +225 -0
- package/dist/routing/types.d.ts.map +1 -0
- package/dist/routing/types.js +27 -0
- package/dist/routing/types.js.map +1 -0
- package/dist/shared/embeddings/embedding-cache.d.ts +62 -0
- package/dist/shared/embeddings/embedding-cache.d.ts.map +1 -0
- package/dist/shared/embeddings/embedding-cache.js +136 -0
- package/dist/shared/embeddings/embedding-cache.js.map +1 -0
- package/dist/shared/embeddings/index.d.ts +35 -0
- package/dist/shared/embeddings/index.d.ts.map +1 -0
- package/dist/shared/embeddings/index.js +33 -0
- package/dist/shared/embeddings/index.js.map +1 -0
- package/dist/shared/embeddings/nomic-embedder.d.ts +128 -0
- package/dist/shared/embeddings/nomic-embedder.d.ts.map +1 -0
- package/dist/shared/embeddings/nomic-embedder.js +322 -0
- package/dist/shared/embeddings/nomic-embedder.js.map +1 -0
- package/dist/shared/embeddings/ollama-client.d.ts +40 -0
- package/dist/shared/embeddings/ollama-client.d.ts.map +1 -0
- package/dist/shared/embeddings/ollama-client.js +140 -0
- package/dist/shared/embeddings/ollama-client.js.map +1 -0
- package/dist/shared/embeddings/types.d.ts +136 -0
- package/dist/shared/embeddings/types.d.ts.map +1 -0
- package/dist/shared/embeddings/types.js +26 -0
- package/dist/shared/embeddings/types.js.map +1 -0
- package/dist/shared/entities/agent.d.ts +40 -0
- package/dist/shared/entities/agent.d.ts.map +1 -0
- package/dist/shared/entities/agent.js +107 -0
- package/dist/shared/entities/agent.js.map +1 -0
- package/dist/shared/entities/base-entity.d.ts +37 -0
- package/dist/shared/entities/base-entity.d.ts.map +1 -0
- package/dist/shared/entities/base-entity.js +56 -0
- package/dist/shared/entities/base-entity.js.map +1 -0
- package/dist/shared/entities/index.d.ts +6 -0
- package/dist/shared/entities/index.d.ts.map +1 -0
- package/dist/shared/entities/index.js +6 -0
- package/dist/shared/entities/index.js.map +1 -0
- package/dist/shared/events/domain-events.d.ts +194 -0
- package/dist/shared/events/domain-events.d.ts.map +1 -0
- package/dist/shared/events/domain-events.js +74 -0
- package/dist/shared/events/domain-events.js.map +1 -0
- package/dist/shared/events/index.d.ts +5 -0
- package/dist/shared/events/index.d.ts.map +1 -0
- package/dist/shared/events/index.js +5 -0
- package/dist/shared/events/index.js.map +1 -0
- package/dist/shared/git/git-analyzer.d.ts +135 -0
- package/dist/shared/git/git-analyzer.d.ts.map +1 -0
- package/dist/shared/git/git-analyzer.js +562 -0
- package/dist/shared/git/git-analyzer.js.map +1 -0
- package/dist/shared/git/index.d.ts +6 -0
- package/dist/shared/git/index.d.ts.map +1 -0
- package/dist/shared/git/index.js +5 -0
- package/dist/shared/git/index.js.map +1 -0
- package/dist/shared/http/http-client.d.ts +92 -0
- package/dist/shared/http/http-client.d.ts.map +1 -0
- package/dist/shared/http/http-client.js +295 -0
- package/dist/shared/http/http-client.js.map +1 -0
- package/dist/shared/http/index.d.ts +5 -0
- package/dist/shared/http/index.d.ts.map +1 -0
- package/dist/shared/http/index.js +5 -0
- package/dist/shared/http/index.js.map +1 -0
- package/dist/shared/index.d.ts +18 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/io/file-reader.d.ts +107 -0
- package/dist/shared/io/file-reader.d.ts.map +1 -0
- package/dist/shared/io/file-reader.js +408 -0
- package/dist/shared/io/file-reader.js.map +1 -0
- package/dist/shared/io/index.d.ts +6 -0
- package/dist/shared/io/index.d.ts.map +1 -0
- package/dist/shared/io/index.js +12 -0
- package/dist/shared/io/index.js.map +1 -0
- package/dist/shared/llm/cache.d.ts +163 -0
- package/dist/shared/llm/cache.d.ts.map +1 -0
- package/dist/shared/llm/cache.js +368 -0
- package/dist/shared/llm/cache.js.map +1 -0
- package/dist/shared/llm/circuit-breaker.d.ts +117 -0
- package/dist/shared/llm/circuit-breaker.d.ts.map +1 -0
- package/dist/shared/llm/circuit-breaker.js +294 -0
- package/dist/shared/llm/circuit-breaker.js.map +1 -0
- package/dist/shared/llm/cost-tracker.d.ts +133 -0
- package/dist/shared/llm/cost-tracker.d.ts.map +1 -0
- package/dist/shared/llm/cost-tracker.js +342 -0
- package/dist/shared/llm/cost-tracker.js.map +1 -0
- package/dist/shared/llm/index.d.ts +50 -0
- package/dist/shared/llm/index.d.ts.map +1 -0
- package/dist/shared/llm/index.js +56 -0
- package/dist/shared/llm/index.js.map +1 -0
- package/dist/shared/llm/interfaces.d.ts +503 -0
- package/dist/shared/llm/interfaces.d.ts.map +1 -0
- package/dist/shared/llm/interfaces.js +33 -0
- package/dist/shared/llm/interfaces.js.map +1 -0
- package/dist/shared/llm/provider-manager.d.ts +158 -0
- package/dist/shared/llm/provider-manager.d.ts.map +1 -0
- package/dist/shared/llm/provider-manager.js +527 -0
- package/dist/shared/llm/provider-manager.js.map +1 -0
- package/dist/shared/llm/providers/claude.d.ts +99 -0
- package/dist/shared/llm/providers/claude.d.ts.map +1 -0
- package/dist/shared/llm/providers/claude.js +394 -0
- package/dist/shared/llm/providers/claude.js.map +1 -0
- package/dist/shared/llm/providers/index.d.ts +8 -0
- package/dist/shared/llm/providers/index.d.ts.map +1 -0
- package/dist/shared/llm/providers/index.js +8 -0
- package/dist/shared/llm/providers/index.js.map +1 -0
- package/dist/shared/llm/providers/ollama.d.ts +91 -0
- package/dist/shared/llm/providers/ollama.d.ts.map +1 -0
- package/dist/shared/llm/providers/ollama.js +391 -0
- package/dist/shared/llm/providers/ollama.js.map +1 -0
- package/dist/shared/llm/providers/openai.d.ts +98 -0
- package/dist/shared/llm/providers/openai.d.ts.map +1 -0
- package/dist/shared/llm/providers/openai.js +440 -0
- package/dist/shared/llm/providers/openai.js.map +1 -0
- package/dist/shared/metrics/code-metrics.d.ts +75 -0
- package/dist/shared/metrics/code-metrics.d.ts.map +1 -0
- package/dist/shared/metrics/code-metrics.js +395 -0
- package/dist/shared/metrics/code-metrics.js.map +1 -0
- package/dist/shared/metrics/index.d.ts +9 -0
- package/dist/shared/metrics/index.d.ts.map +1 -0
- package/dist/shared/metrics/index.js +7 -0
- package/dist/shared/metrics/index.js.map +1 -0
- package/dist/shared/metrics/system-metrics.d.ts +109 -0
- package/dist/shared/metrics/system-metrics.d.ts.map +1 -0
- package/dist/shared/metrics/system-metrics.js +267 -0
- package/dist/shared/metrics/system-metrics.js.map +1 -0
- package/dist/shared/parsers/index.d.ts +6 -0
- package/dist/shared/parsers/index.d.ts.map +1 -0
- package/dist/shared/parsers/index.js +6 -0
- package/dist/shared/parsers/index.js.map +1 -0
- package/dist/shared/parsers/typescript-parser.d.ts +211 -0
- package/dist/shared/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/shared/parsers/typescript-parser.js +561 -0
- package/dist/shared/parsers/typescript-parser.js.map +1 -0
- package/dist/shared/security/compliance-patterns.d.ts +78 -0
- package/dist/shared/security/compliance-patterns.d.ts.map +1 -0
- package/dist/shared/security/compliance-patterns.js +543 -0
- package/dist/shared/security/compliance-patterns.js.map +1 -0
- package/dist/shared/security/index.d.ts +8 -0
- package/dist/shared/security/index.d.ts.map +1 -0
- package/dist/shared/security/index.js +6 -0
- package/dist/shared/security/index.js.map +1 -0
- package/dist/shared/security/osv-client.d.ts +191 -0
- package/dist/shared/security/osv-client.d.ts.map +1 -0
- package/dist/shared/security/osv-client.js +256 -0
- package/dist/shared/security/osv-client.js.map +1 -0
- package/dist/shared/types/index.d.ts +66 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/index.js +25 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/value-objects/index.d.ts +73 -0
- package/dist/shared/value-objects/index.d.ts.map +1 -0
- package/dist/shared/value-objects/index.js +229 -0
- package/dist/shared/value-objects/index.js.map +1 -0
- package/dist/strange-loop/healing-controller.d.ts +125 -0
- package/dist/strange-loop/healing-controller.d.ts.map +1 -0
- package/dist/strange-loop/healing-controller.js +648 -0
- package/dist/strange-loop/healing-controller.js.map +1 -0
- package/dist/strange-loop/index.d.ts +26 -0
- package/dist/strange-loop/index.d.ts.map +1 -0
- package/dist/strange-loop/index.js +30 -0
- package/dist/strange-loop/index.js.map +1 -0
- package/dist/strange-loop/self-model.d.ts +84 -0
- package/dist/strange-loop/self-model.d.ts.map +1 -0
- package/dist/strange-loop/self-model.js +378 -0
- package/dist/strange-loop/self-model.js.map +1 -0
- package/dist/strange-loop/strange-loop.d.ts +112 -0
- package/dist/strange-loop/strange-loop.d.ts.map +1 -0
- package/dist/strange-loop/strange-loop.js +354 -0
- package/dist/strange-loop/strange-loop.js.map +1 -0
- package/dist/strange-loop/swarm-observer.d.ts +89 -0
- package/dist/strange-loop/swarm-observer.d.ts.map +1 -0
- package/dist/strange-loop/swarm-observer.js +341 -0
- package/dist/strange-loop/swarm-observer.js.map +1 -0
- package/dist/strange-loop/topology-analyzer.d.ts +87 -0
- package/dist/strange-loop/topology-analyzer.d.ts.map +1 -0
- package/dist/strange-loop/topology-analyzer.js +441 -0
- package/dist/strange-loop/topology-analyzer.js.map +1 -0
- package/dist/strange-loop/types.d.ts +425 -0
- package/dist/strange-loop/types.d.ts.map +1 -0
- package/dist/strange-loop/types.js +22 -0
- package/dist/strange-loop/types.js.map +1 -0
- package/dist/time-crystal/default-phases.d.ts +95 -0
- package/dist/time-crystal/default-phases.d.ts.map +1 -0
- package/dist/time-crystal/default-phases.js +456 -0
- package/dist/time-crystal/default-phases.js.map +1 -0
- package/dist/time-crystal/index.d.ts +28 -0
- package/dist/time-crystal/index.d.ts.map +1 -0
- package/dist/time-crystal/index.js +55 -0
- package/dist/time-crystal/index.js.map +1 -0
- package/dist/time-crystal/oscillator.d.ts +195 -0
- package/dist/time-crystal/oscillator.d.ts.map +1 -0
- package/dist/time-crystal/oscillator.js +358 -0
- package/dist/time-crystal/oscillator.js.map +1 -0
- package/dist/time-crystal/phase-executor.d.ts +212 -0
- package/dist/time-crystal/phase-executor.d.ts.map +1 -0
- package/dist/time-crystal/phase-executor.js +327 -0
- package/dist/time-crystal/phase-executor.js.map +1 -0
- package/dist/time-crystal/scheduler.d.ts +239 -0
- package/dist/time-crystal/scheduler.d.ts.map +1 -0
- package/dist/time-crystal/scheduler.js +860 -0
- package/dist/time-crystal/scheduler.js.map +1 -0
- package/dist/time-crystal/test-runner.d.ts +141 -0
- package/dist/time-crystal/test-runner.d.ts.map +1 -0
- package/dist/time-crystal/test-runner.js +529 -0
- package/dist/time-crystal/test-runner.js.map +1 -0
- package/dist/time-crystal/types.d.ts +269 -0
- package/dist/time-crystal/types.d.ts.map +1 -0
- package/dist/time-crystal/types.js +51 -0
- package/dist/time-crystal/types.js.map +1 -0
- package/dist/workers/base-worker.d.ts +83 -0
- package/dist/workers/base-worker.d.ts.map +1 -0
- package/dist/workers/base-worker.js +235 -0
- package/dist/workers/base-worker.js.map +1 -0
- package/dist/workers/daemon.d.ts +73 -0
- package/dist/workers/daemon.d.ts.map +1 -0
- package/dist/workers/daemon.js +193 -0
- package/dist/workers/daemon.js.map +1 -0
- package/dist/workers/index.d.ts +91 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +95 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/interfaces.d.ts +270 -0
- package/dist/workers/interfaces.d.ts.map +1 -0
- package/dist/workers/interfaces.js +9 -0
- package/dist/workers/interfaces.js.map +1 -0
- package/dist/workers/worker-manager.d.ts +87 -0
- package/dist/workers/worker-manager.d.ts.map +1 -0
- package/dist/workers/worker-manager.js +345 -0
- package/dist/workers/worker-manager.js.map +1 -0
- package/dist/workers/workers/compliance-checker.d.ts +28 -0
- package/dist/workers/workers/compliance-checker.d.ts.map +1 -0
- package/dist/workers/workers/compliance-checker.js +334 -0
- package/dist/workers/workers/compliance-checker.js.map +1 -0
- package/dist/workers/workers/coverage-tracker.d.ts +24 -0
- package/dist/workers/workers/coverage-tracker.d.ts.map +1 -0
- package/dist/workers/workers/coverage-tracker.js +265 -0
- package/dist/workers/workers/coverage-tracker.js.map +1 -0
- package/dist/workers/workers/defect-predictor.d.ts +22 -0
- package/dist/workers/workers/defect-predictor.d.ts.map +1 -0
- package/dist/workers/workers/defect-predictor.js +292 -0
- package/dist/workers/workers/defect-predictor.js.map +1 -0
- package/dist/workers/workers/flaky-detector.d.ts +25 -0
- package/dist/workers/workers/flaky-detector.d.ts.map +1 -0
- package/dist/workers/workers/flaky-detector.js +288 -0
- package/dist/workers/workers/flaky-detector.js.map +1 -0
- package/dist/workers/workers/index.d.ts +17 -0
- package/dist/workers/workers/index.d.ts.map +1 -0
- package/dist/workers/workers/index.js +17 -0
- package/dist/workers/workers/index.js.map +1 -0
- package/dist/workers/workers/learning-consolidation.d.ts +25 -0
- package/dist/workers/workers/learning-consolidation.d.ts.map +1 -0
- package/dist/workers/workers/learning-consolidation.js +324 -0
- package/dist/workers/workers/learning-consolidation.js.map +1 -0
- package/dist/workers/workers/performance-baseline.d.ts +25 -0
- package/dist/workers/workers/performance-baseline.d.ts.map +1 -0
- package/dist/workers/workers/performance-baseline.js +315 -0
- package/dist/workers/workers/performance-baseline.js.map +1 -0
- package/dist/workers/workers/quality-gate.d.ts +23 -0
- package/dist/workers/workers/quality-gate.d.ts.map +1 -0
- package/dist/workers/workers/quality-gate.js +348 -0
- package/dist/workers/workers/quality-gate.js.map +1 -0
- package/dist/workers/workers/regression-monitor.d.ts +24 -0
- package/dist/workers/workers/regression-monitor.d.ts.map +1 -0
- package/dist/workers/workers/regression-monitor.js +280 -0
- package/dist/workers/workers/regression-monitor.js.map +1 -0
- package/dist/workers/workers/security-scan.d.ts +22 -0
- package/dist/workers/workers/security-scan.d.ts.map +1 -0
- package/dist/workers/workers/security-scan.js +264 -0
- package/dist/workers/workers/security-scan.js.map +1 -0
- package/dist/workers/workers/test-health.d.ts +26 -0
- package/dist/workers/workers/test-health.d.ts.map +1 -0
- package/dist/workers/workers/test-health.js +258 -0
- package/dist/workers/workers/test-health.js.map +1 -0
- package/docs/analysis/V3-INIT-REQUIREMENTS-ANALYSIS.md +352 -0
- package/implementation/README.md +90 -0
- package/implementation/adrs/ADR-030-coherence-gated-quality-gates.md +312 -0
- package/implementation/adrs/ADR-031-strange-loop-self-awareness.md +484 -0
- package/implementation/adrs/ADR-032-time-crystal-scheduling.md +530 -0
- package/implementation/adrs/ADR-033-early-exit-testing.md +634 -0
- package/implementation/adrs/ADR-034-neural-topology-optimizer.md +589 -0
- package/implementation/adrs/ADR-035-causal-discovery.md +610 -0
- package/implementation/adrs/ADR-036-result-persistence.md +326 -0
- package/implementation/adrs/ADR-037-v3-qe-agent-naming.md +105 -0
- package/implementation/adrs/ADR-038-v3-qe-memory-unification.md +154 -0
- package/implementation/adrs/ADR-039-v3-qe-mcp-optimization.md +179 -0
- package/implementation/adrs/ADR-040-v3-qe-agentic-flow-integration.md +240 -0
- package/implementation/adrs/ADR-041-v3-qe-cli-enhancement.md +296 -0
- package/implementation/adrs/ADR-042-v3-qe-token-tracking-integration.md +517 -0
- package/implementation/adrs/v3-adrs.md +2783 -0
- package/implementation/planning/AQE-V3-MASTER-PLAN.md +815 -0
- package/package.json +88 -0
- package/security-scan-report-2026-01-11.md +410 -0
- package/security-verification-report-2026-01-11.md +278 -0
- package/src/benchmarks/performance-benchmarks.ts +646 -0
- package/src/benchmarks/run-benchmarks.ts +324 -0
- package/src/causal-discovery/causal-graph.ts +450 -0
- package/src/causal-discovery/discovery-engine.ts +438 -0
- package/src/causal-discovery/index.ts +117 -0
- package/src/causal-discovery/types.ts +456 -0
- package/src/causal-discovery/weight-matrix.ts +453 -0
- package/src/cli/commands/qe-tools.ts +634 -0
- package/src/cli/index.ts +1976 -0
- package/src/compatibility/agent-mapper.ts +291 -0
- package/src/compatibility/cli-adapter.ts +277 -0
- package/src/compatibility/config-migrator.ts +334 -0
- package/src/compatibility/index.ts +112 -0
- package/src/compatibility/mcp-adapter.ts +248 -0
- package/src/compatibility/types.ts +156 -0
- package/src/coordination/claims/claim-repository.ts +636 -0
- package/src/coordination/claims/claim-service.ts +675 -0
- package/src/coordination/claims/handoff-manager.ts +535 -0
- package/src/coordination/claims/index.ts +276 -0
- package/src/coordination/claims/interfaces.ts +687 -0
- package/src/coordination/claims/work-stealing.ts +436 -0
- package/src/coordination/cross-domain-router.ts +492 -0
- package/src/coordination/index.ts +127 -0
- package/src/coordination/interfaces.ts +691 -0
- package/src/coordination/protocol-executor.ts +760 -0
- package/src/coordination/protocols/code-intelligence-index.ts +855 -0
- package/src/coordination/protocols/defect-investigation.ts +1184 -0
- package/src/coordination/protocols/index.ts +11 -0
- package/src/coordination/protocols/learning-consolidation.ts +1181 -0
- package/src/coordination/protocols/morning-sync.ts +1055 -0
- package/src/coordination/protocols/quality-gate.ts +1566 -0
- package/src/coordination/protocols/security-audit.ts +1587 -0
- package/src/coordination/queen-coordinator.ts +1176 -0
- package/src/coordination/result-saver.ts +780 -0
- package/src/coordination/task-executor.ts +1146 -0
- package/src/coordination/workflow-orchestrator.ts +1917 -0
- package/src/domains/chaos-resilience/coordinator.ts +1032 -0
- package/src/domains/chaos-resilience/index.ts +143 -0
- package/src/domains/chaos-resilience/interfaces.ts +659 -0
- package/src/domains/chaos-resilience/plugin.ts +691 -0
- package/src/domains/chaos-resilience/services/chaos-engineer.ts +1097 -0
- package/src/domains/chaos-resilience/services/index.ts +19 -0
- package/src/domains/chaos-resilience/services/load-tester.ts +799 -0
- package/src/domains/chaos-resilience/services/performance-profiler.ts +792 -0
- package/src/domains/code-intelligence/coordinator.ts +631 -0
- package/src/domains/code-intelligence/index.ts +86 -0
- package/src/domains/code-intelligence/interfaces.ts +162 -0
- package/src/domains/code-intelligence/plugin.ts +451 -0
- package/src/domains/code-intelligence/services/impact-analyzer.ts +567 -0
- package/src/domains/code-intelligence/services/index.ts +26 -0
- package/src/domains/code-intelligence/services/knowledge-graph.ts +1067 -0
- package/src/domains/code-intelligence/services/semantic-analyzer.ts +901 -0
- package/src/domains/contract-testing/coordinator.ts +1038 -0
- package/src/domains/contract-testing/index.ts +122 -0
- package/src/domains/contract-testing/interfaces.ts +458 -0
- package/src/domains/contract-testing/plugin.ts +746 -0
- package/src/domains/contract-testing/services/api-compatibility.ts +748 -0
- package/src/domains/contract-testing/services/contract-validator.ts +1700 -0
- package/src/domains/contract-testing/services/index.ts +19 -0
- package/src/domains/contract-testing/services/schema-validator.ts +1102 -0
- package/src/domains/coverage-analysis/coordinator.ts +485 -0
- package/src/domains/coverage-analysis/index.ts +114 -0
- package/src/domains/coverage-analysis/interfaces.ts +142 -0
- package/src/domains/coverage-analysis/plugin.ts +172 -0
- package/src/domains/coverage-analysis/services/coverage-analyzer.ts +449 -0
- package/src/domains/coverage-analysis/services/coverage-embedder.ts +733 -0
- package/src/domains/coverage-analysis/services/coverage-parser.ts +753 -0
- package/src/domains/coverage-analysis/services/gap-detector.ts +592 -0
- package/src/domains/coverage-analysis/services/hnsw-index.ts +728 -0
- package/src/domains/coverage-analysis/services/index.ts +61 -0
- package/src/domains/coverage-analysis/services/risk-scorer.ts +540 -0
- package/src/domains/coverage-analysis/services/sublinear-analyzer.ts +747 -0
- package/src/domains/defect-intelligence/coordinator.ts +635 -0
- package/src/domains/defect-intelligence/index.ts +83 -0
- package/src/domains/defect-intelligence/interfaces.ts +152 -0
- package/src/domains/defect-intelligence/plugin.ts +483 -0
- package/src/domains/defect-intelligence/services/causal-root-cause-analyzer.ts +494 -0
- package/src/domains/defect-intelligence/services/defect-predictor.ts +852 -0
- package/src/domains/defect-intelligence/services/index.ts +37 -0
- package/src/domains/defect-intelligence/services/pattern-learner.ts +738 -0
- package/src/domains/defect-intelligence/services/root-cause-analyzer.ts +637 -0
- package/src/domains/domain-interface.ts +77 -0
- package/src/domains/index.ts +23 -0
- package/src/domains/learning-optimization/coordinator.ts +1215 -0
- package/src/domains/learning-optimization/index.ts +127 -0
- package/src/domains/learning-optimization/interfaces.ts +570 -0
- package/src/domains/learning-optimization/plugin.ts +851 -0
- package/src/domains/learning-optimization/services/index.ts +29 -0
- package/src/domains/learning-optimization/services/learning-coordinator.ts +972 -0
- package/src/domains/learning-optimization/services/metrics-optimizer.ts +915 -0
- package/src/domains/learning-optimization/services/production-intel.ts +971 -0
- package/src/domains/learning-optimization/services/transfer-specialist.ts +723 -0
- package/src/domains/quality-assessment/coherence/gate-controller.ts +549 -0
- package/src/domains/quality-assessment/coherence/index.ts +211 -0
- package/src/domains/quality-assessment/coherence/lambda-calculator.ts +384 -0
- package/src/domains/quality-assessment/coherence/partition-detector.ts +469 -0
- package/src/domains/quality-assessment/coherence/types.ts +384 -0
- package/src/domains/quality-assessment/coordinator.ts +605 -0
- package/src/domains/quality-assessment/index.ts +97 -0
- package/src/domains/quality-assessment/interfaces.ts +152 -0
- package/src/domains/quality-assessment/plugin.ts +496 -0
- package/src/domains/quality-assessment/services/coherence-gate.ts +358 -0
- package/src/domains/quality-assessment/services/deployment-advisor.ts +571 -0
- package/src/domains/quality-assessment/services/index.ts +34 -0
- package/src/domains/quality-assessment/services/quality-analyzer.ts +670 -0
- package/src/domains/quality-assessment/services/quality-gate.ts +384 -0
- package/src/domains/requirements-validation/coordinator.ts +812 -0
- package/src/domains/requirements-validation/index.ts +92 -0
- package/src/domains/requirements-validation/interfaces.ts +303 -0
- package/src/domains/requirements-validation/plugin.ts +576 -0
- package/src/domains/requirements-validation/services/bdd-scenario-writer.ts +676 -0
- package/src/domains/requirements-validation/services/index.ts +20 -0
- package/src/domains/requirements-validation/services/requirements-validator.ts +559 -0
- package/src/domains/requirements-validation/services/testability-scorer.ts +639 -0
- package/src/domains/security-compliance/coordinator.ts +757 -0
- package/src/domains/security-compliance/index.ts +120 -0
- package/src/domains/security-compliance/interfaces.ts +434 -0
- package/src/domains/security-compliance/plugin.ts +509 -0
- package/src/domains/security-compliance/services/compliance-validator.ts +1226 -0
- package/src/domains/security-compliance/services/index.ts +31 -0
- package/src/domains/security-compliance/services/security-auditor.ts +2227 -0
- package/src/domains/security-compliance/services/security-scanner.ts +2354 -0
- package/src/domains/security-compliance/services/semgrep-integration.ts +289 -0
- package/src/domains/test-execution/coordinator.ts +426 -0
- package/src/domains/test-execution/index.ts +76 -0
- package/src/domains/test-execution/interfaces.ts +119 -0
- package/src/domains/test-execution/plugin.ts +208 -0
- package/src/domains/test-execution/services/flaky-detector.ts +1240 -0
- package/src/domains/test-execution/services/index.ts +8 -0
- package/src/domains/test-execution/services/retry-handler.ts +820 -0
- package/src/domains/test-execution/services/test-executor.ts +885 -0
- package/src/domains/test-generation/coordinator.ts +656 -0
- package/src/domains/test-generation/index.ts +77 -0
- package/src/domains/test-generation/interfaces.ts +118 -0
- package/src/domains/test-generation/plugin.ts +397 -0
- package/src/domains/test-generation/services/index.ts +23 -0
- package/src/domains/test-generation/services/pattern-matcher.ts +1725 -0
- package/src/domains/test-generation/services/test-generator.ts +2750 -0
- package/src/domains/visual-accessibility/coordinator.ts +860 -0
- package/src/domains/visual-accessibility/index.ts +116 -0
- package/src/domains/visual-accessibility/interfaces.ts +435 -0
- package/src/domains/visual-accessibility/plugin.ts +568 -0
- package/src/domains/visual-accessibility/services/accessibility-tester.ts +982 -0
- package/src/domains/visual-accessibility/services/axe-core-audit.ts +630 -0
- package/src/domains/visual-accessibility/services/index.ts +28 -0
- package/src/domains/visual-accessibility/services/responsive-tester.ts +934 -0
- package/src/domains/visual-accessibility/services/visual-tester.ts +458 -0
- package/src/early-exit/early-exit-controller.ts +490 -0
- package/src/early-exit/early-exit-decision.ts +391 -0
- package/src/early-exit/index.ts +115 -0
- package/src/early-exit/quality-signal.ts +389 -0
- package/src/early-exit/speculative-executor.ts +505 -0
- package/src/early-exit/types.ts +407 -0
- package/src/feedback/coverage-learner.ts +456 -0
- package/src/feedback/feedback-loop.ts +426 -0
- package/src/feedback/index.ts +72 -0
- package/src/feedback/pattern-promotion.ts +373 -0
- package/src/feedback/quality-score-calculator.ts +334 -0
- package/src/feedback/test-outcome-tracker.ts +450 -0
- package/src/feedback/types.ts +497 -0
- package/src/index.ts +224 -0
- package/src/init/agents-installer.ts +536 -0
- package/src/init/index.ts +80 -0
- package/src/init/init-wizard.ts +1061 -0
- package/src/init/project-analyzer.ts +696 -0
- package/src/init/self-configurator.ts +488 -0
- package/src/init/skills-installer.ts +467 -0
- package/src/init/types.ts +432 -0
- package/src/integrations/ruvector/ast-complexity.ts +470 -0
- package/src/integrations/ruvector/coverage-router.ts +594 -0
- package/src/integrations/ruvector/diff-risk-classifier.ts +759 -0
- package/src/integrations/ruvector/fallback.ts +942 -0
- package/src/integrations/ruvector/graph-boundaries.ts +809 -0
- package/src/integrations/ruvector/index.ts +363 -0
- package/src/integrations/ruvector/interfaces.ts +609 -0
- package/src/integrations/ruvector/q-learning-router.ts +550 -0
- package/src/kernel/agent-coordinator.ts +165 -0
- package/src/kernel/agentdb-backend.ts +504 -0
- package/src/kernel/event-bus.ts +129 -0
- package/src/kernel/hybrid-backend.ts +538 -0
- package/src/kernel/index.ts +28 -0
- package/src/kernel/interfaces.ts +257 -0
- package/src/kernel/kernel.ts +285 -0
- package/src/kernel/memory-backend.ts +169 -0
- package/src/kernel/memory-factory.ts +293 -0
- package/src/kernel/plugin-loader.ts +179 -0
- package/src/learning/index.ts +219 -0
- package/src/learning/pattern-store.ts +990 -0
- package/src/learning/qe-guidance.ts +832 -0
- package/src/learning/qe-hooks.ts +644 -0
- package/src/learning/qe-patterns.ts +449 -0
- package/src/learning/qe-reasoning-bank.ts +951 -0
- package/src/learning/real-embeddings.ts +277 -0
- package/src/learning/real-qe-reasoning-bank.ts +833 -0
- package/src/learning/sqlite-persistence.ts +554 -0
- package/src/mcp/entry.ts +59 -0
- package/src/mcp/handlers/agent-handlers.ts +285 -0
- package/src/mcp/handlers/core-handlers.ts +317 -0
- package/src/mcp/handlers/domain-handlers.ts +1444 -0
- package/src/mcp/handlers/index.ts +57 -0
- package/src/mcp/handlers/memory-handlers.ts +338 -0
- package/src/mcp/handlers/task-handlers.ts +363 -0
- package/src/mcp/index.ts +30 -0
- package/src/mcp/metrics/index.ts +14 -0
- package/src/mcp/metrics/metrics-collector.ts +503 -0
- package/src/mcp/protocol-server.ts +752 -0
- package/src/mcp/security/cve-prevention.ts +742 -0
- package/src/mcp/security/index.ts +356 -0
- package/src/mcp/security/oauth21-provider.ts +821 -0
- package/src/mcp/security/rate-limiter.ts +615 -0
- package/src/mcp/security/sampling-server.ts +662 -0
- package/src/mcp/security/schema-validator.ts +855 -0
- package/src/mcp/server.ts +657 -0
- package/src/mcp/tool-registry.ts +391 -0
- package/src/mcp/tools/base.ts +399 -0
- package/src/mcp/tools/chaos-resilience/inject.ts +699 -0
- package/src/mcp/tools/code-intelligence/analyze.ts +745 -0
- package/src/mcp/tools/contract-testing/validate.ts +708 -0
- package/src/mcp/tools/coverage-analysis/index.ts +770 -0
- package/src/mcp/tools/defect-intelligence/predict.ts +466 -0
- package/src/mcp/tools/index.ts +214 -0
- package/src/mcp/tools/learning-optimization/optimize.ts +772 -0
- package/src/mcp/tools/quality-assessment/evaluate.ts +385 -0
- package/src/mcp/tools/registry.ts +248 -0
- package/src/mcp/tools/requirements-validation/validate.ts +394 -0
- package/src/mcp/tools/security-compliance/scan.ts +365 -0
- package/src/mcp/tools/test-execution/execute.ts +291 -0
- package/src/mcp/tools/test-generation/generate.ts +544 -0
- package/src/mcp/tools/visual-accessibility/index.ts +791 -0
- package/src/mcp/transport/index.ts +31 -0
- package/src/mcp/transport/stdio.ts +318 -0
- package/src/mcp/types.ts +543 -0
- package/src/neural-optimizer/index.ts +111 -0
- package/src/neural-optimizer/replay-buffer.ts +455 -0
- package/src/neural-optimizer/swarm-topology.ts +508 -0
- package/src/neural-optimizer/topology-optimizer.ts +828 -0
- package/src/neural-optimizer/types.ts +481 -0
- package/src/neural-optimizer/value-network.ts +351 -0
- package/src/optimization/auto-tuner.ts +817 -0
- package/src/optimization/index.ts +77 -0
- package/src/optimization/metric-collectors.ts +474 -0
- package/src/optimization/qe-workers.ts +704 -0
- package/src/optimization/tuning-algorithm.ts +401 -0
- package/src/optimization/types.ts +314 -0
- package/src/routing/index.ts +51 -0
- package/src/routing/qe-agent-registry.ts +963 -0
- package/src/routing/qe-task-router.ts +564 -0
- package/src/routing/routing-feedback.ts +365 -0
- package/src/routing/types.ts +406 -0
- package/src/shared/embeddings/embedding-cache.ts +157 -0
- package/src/shared/embeddings/index.ts +50 -0
- package/src/shared/embeddings/nomic-embedder.ts +404 -0
- package/src/shared/embeddings/ollama-client.ts +195 -0
- package/src/shared/embeddings/types.ts +147 -0
- package/src/shared/entities/agent.ts +141 -0
- package/src/shared/entities/base-entity.ts +79 -0
- package/src/shared/entities/index.ts +6 -0
- package/src/shared/events/domain-events.ts +259 -0
- package/src/shared/events/index.ts +5 -0
- package/src/shared/git/git-analyzer.ts +656 -0
- package/src/shared/git/index.ts +11 -0
- package/src/shared/http/http-client.ts +420 -0
- package/src/shared/http/index.ts +13 -0
- package/src/shared/index.ts +41 -0
- package/src/shared/io/file-reader.ts +525 -0
- package/src/shared/io/index.ts +25 -0
- package/src/shared/llm/cache.ts +473 -0
- package/src/shared/llm/circuit-breaker.ts +369 -0
- package/src/shared/llm/cost-tracker.ts +460 -0
- package/src/shared/llm/index.ts +140 -0
- package/src/shared/llm/interfaces.ts +629 -0
- package/src/shared/llm/provider-manager.ts +685 -0
- package/src/shared/llm/providers/claude.ts +524 -0
- package/src/shared/llm/providers/index.ts +8 -0
- package/src/shared/llm/providers/ollama.ts +575 -0
- package/src/shared/llm/providers/openai.ts +609 -0
- package/src/shared/metrics/code-metrics.ts +520 -0
- package/src/shared/metrics/index.ts +23 -0
- package/src/shared/metrics/system-metrics.ts +353 -0
- package/src/shared/parsers/index.ts +6 -0
- package/src/shared/parsers/typescript-parser.ts +841 -0
- package/src/shared/security/compliance-patterns.ts +666 -0
- package/src/shared/security/index.ts +30 -0
- package/src/shared/security/osv-client.ts +468 -0
- package/src/shared/types/index.ts +150 -0
- package/src/shared/value-objects/index.ts +273 -0
- package/src/strange-loop/healing-controller.ts +833 -0
- package/src/strange-loop/index.ts +104 -0
- package/src/strange-loop/self-model.ts +494 -0
- package/src/strange-loop/strange-loop.ts +446 -0
- package/src/strange-loop/swarm-observer.ts +448 -0
- package/src/strange-loop/topology-analyzer.ts +565 -0
- package/src/strange-loop/types.ts +640 -0
- package/src/time-crystal/default-phases.ts +520 -0
- package/src/time-crystal/index.ts +164 -0
- package/src/time-crystal/oscillator.ts +425 -0
- package/src/time-crystal/phase-executor.ts +521 -0
- package/src/time-crystal/scheduler.ts +1025 -0
- package/src/time-crystal/test-runner.ts +787 -0
- package/src/time-crystal/types.ts +421 -0
- package/src/workers/base-worker.ts +304 -0
- package/src/workers/daemon.ts +264 -0
- package/src/workers/index.ts +119 -0
- package/src/workers/interfaces.ts +393 -0
- package/src/workers/worker-manager.ts +424 -0
- package/src/workers/workers/compliance-checker.ts +445 -0
- package/src/workers/workers/coverage-tracker.ts +344 -0
- package/src/workers/workers/defect-predictor.ts +375 -0
- package/src/workers/workers/flaky-detector.ts +390 -0
- package/src/workers/workers/index.ts +17 -0
- package/src/workers/workers/learning-consolidation.ts +442 -0
- package/src/workers/workers/performance-baseline.ts +434 -0
- package/src/workers/workers/quality-gate.ts +419 -0
- package/src/workers/workers/regression-monitor.ts +357 -0
- package/src/workers/workers/security-scan.ts +349 -0
- package/src/workers/workers/test-health.ts +359 -0
- package/tests/integration/code-intelligence/knowledge-graph-real.test.ts +540 -0
- package/tests/integration/coordination/cross-domain-router.test.ts +403 -0
- package/tests/integration/coordination/protocol-executor.test.ts +454 -0
- package/tests/integration/coordination/workflow-orchestrator.test.ts +418 -0
- package/tests/integration/feedback/feedback-loop-integration.test.ts +560 -0
- package/tests/integration/migration/v2-to-v3-migration.test.ts +471 -0
- package/tests/integration/parsers/typescript-parser.test.ts +463 -0
- package/tests/integration/security/vulnerability-detection.test.ts +628 -0
- package/tests/integration/test-execution/coordinator.test.ts +410 -0
- package/tests/integration/test-generation/coordinator.test.ts +361 -0
- package/tests/mocks/index.ts +228 -0
- package/tests/time-crystal/default-phases.test.ts +476 -0
- package/tests/time-crystal/oscillator.test.ts +541 -0
- package/tests/time-crystal/phase-executor.test.ts +653 -0
- package/tests/time-crystal/scheduler.test.ts +626 -0
- package/tests/time-crystal/test-runner.test.ts +594 -0
- package/tests/unit/causal-discovery/causal-graph.test.ts +504 -0
- package/tests/unit/causal-discovery/causal-root-cause-analyzer.test.ts +347 -0
- package/tests/unit/causal-discovery/discovery-engine.test.ts +435 -0
- package/tests/unit/causal-discovery/weight-matrix.test.ts +328 -0
- package/tests/unit/cli/cli.test.ts +341 -0
- package/tests/unit/cli/commands.test.ts +414 -0
- package/tests/unit/cli/init-command.test.ts +274 -0
- package/tests/unit/cli/migrate-command.test.ts +396 -0
- package/tests/unit/coordination/claims/claim-service.test.ts +949 -0
- package/tests/unit/coordination/claims/handoff-manager.test.ts +773 -0
- package/tests/unit/coordination/claims/work-stealing.test.ts +492 -0
- package/tests/unit/coordination/queen-coordinator.test.ts +966 -0
- package/tests/unit/coordination/result-saver.test.ts +653 -0
- package/tests/unit/coordination/task-executor.test.ts +810 -0
- package/tests/unit/domains/chaos-resilience/chaos-engineer.test.ts +484 -0
- package/tests/unit/domains/chaos-resilience/load-tester.test.ts +559 -0
- package/tests/unit/domains/chaos-resilience/performance-profiler.test.ts +490 -0
- package/tests/unit/domains/code-intelligence/impact-analyzer.test.ts +560 -0
- package/tests/unit/domains/code-intelligence/knowledge-graph.test.ts +460 -0
- package/tests/unit/domains/code-intelligence/semantic-analyzer.test.ts +584 -0
- package/tests/unit/domains/contract-testing/api-compatibility.test.ts +483 -0
- package/tests/unit/domains/contract-testing/contract-validator.test.ts +370 -0
- package/tests/unit/domains/contract-testing/schema-validator.test.ts +610 -0
- package/tests/unit/domains/coverage-analysis/coverage-embedder.test.ts +298 -0
- package/tests/unit/domains/coverage-analysis/hnsw-index.test.ts +292 -0
- package/tests/unit/domains/coverage-analysis/sublinear-analyzer.test.ts +506 -0
- package/tests/unit/domains/defect-intelligence/defect-predictor.test.ts +370 -0
- package/tests/unit/domains/defect-intelligence/pattern-learner.test.ts +546 -0
- package/tests/unit/domains/defect-intelligence/root-cause-analyzer.test.ts +534 -0
- package/tests/unit/domains/learning-optimization/learning-coordinator.test.ts +541 -0
- package/tests/unit/domains/learning-optimization/metrics-optimizer.test.ts +552 -0
- package/tests/unit/domains/learning-optimization/production-intel.test.ts +589 -0
- package/tests/unit/domains/learning-optimization/transfer-specialist.test.ts +453 -0
- package/tests/unit/domains/quality-assessment/coherence-gate.test.ts +1006 -0
- package/tests/unit/domains/quality-assessment/deployment-advisor.test.ts +515 -0
- package/tests/unit/domains/quality-assessment/quality-analyzer.test.ts +401 -0
- package/tests/unit/domains/quality-assessment/quality-gate.test.ts +324 -0
- package/tests/unit/domains/requirements-validation/bdd-scenario-writer.test.ts +479 -0
- package/tests/unit/domains/requirements-validation/requirements-validator.test.ts +452 -0
- package/tests/unit/domains/requirements-validation/testability-scorer.test.ts +505 -0
- package/tests/unit/domains/security-compliance/compliance-validator.test.ts +500 -0
- package/tests/unit/domains/security-compliance/security-auditor.test.ts +498 -0
- package/tests/unit/domains/security-compliance/security-scanner.test.ts +412 -0
- package/tests/unit/domains/visual-accessibility/accessibility-tester.test.ts +432 -0
- package/tests/unit/domains/visual-accessibility/responsive-tester.test.ts +506 -0
- package/tests/unit/domains/visual-accessibility/visual-tester.test.ts +412 -0
- package/tests/unit/early-exit/early-exit-controller.test.ts +548 -0
- package/tests/unit/early-exit/early-exit-decision.test.ts +617 -0
- package/tests/unit/early-exit/index.test.ts +254 -0
- package/tests/unit/early-exit/quality-signal.test.ts +589 -0
- package/tests/unit/early-exit/speculative-executor.test.ts +453 -0
- package/tests/unit/feedback/coverage-learner.test.ts +288 -0
- package/tests/unit/feedback/feedback-loop.test.ts +458 -0
- package/tests/unit/feedback/pattern-promotion.test.ts +390 -0
- package/tests/unit/feedback/quality-score-calculator.test.ts +364 -0
- package/tests/unit/feedback/test-outcome-tracker.test.ts +243 -0
- package/tests/unit/init/init-wizard.test.ts +881 -0
- package/tests/unit/init/project-analyzer.test.ts +807 -0
- package/tests/unit/init/self-configurator.test.ts +493 -0
- package/tests/unit/integrations/ruvector/ast-complexity.test.ts +240 -0
- package/tests/unit/integrations/ruvector/coverage-router.test.ts +366 -0
- package/tests/unit/integrations/ruvector/diff-risk-classifier.test.ts +340 -0
- package/tests/unit/integrations/ruvector/graph-boundaries.test.ts +355 -0
- package/tests/unit/integrations/ruvector/q-learning-router.test.ts +314 -0
- package/tests/unit/kernel/agent-coordinator.test.ts +220 -0
- package/tests/unit/kernel/event-bus.test.ts +197 -0
- package/tests/unit/learning/qe-reasoning-bank.test.ts +666 -0
- package/tests/unit/learning/real-qe-reasoning-bank.benchmark.test.ts +415 -0
- package/tests/unit/mcp/mcp-server.test.ts +544 -0
- package/tests/unit/mcp/metrics/metrics-collector.test.ts +340 -0
- package/tests/unit/mcp/security/cve-prevention.test.ts +512 -0
- package/tests/unit/mcp/security/oauth21-provider.test.ts +624 -0
- package/tests/unit/mcp/security/rate-limiter.test.ts +410 -0
- package/tests/unit/mcp/security/sampling-server.test.ts +420 -0
- package/tests/unit/mcp/security/schema-validator.test.ts +494 -0
- package/tests/unit/mcp/tools/base.test.ts +336 -0
- package/tests/unit/mcp/tools/domain-tools.test.ts +759 -0
- package/tests/unit/mcp/tools/registry.test.ts +240 -0
- package/tests/unit/neural-optimizer/replay-buffer.test.ts +403 -0
- package/tests/unit/neural-optimizer/swarm-topology.test.ts +473 -0
- package/tests/unit/neural-optimizer/topology-optimizer.test.ts +595 -0
- package/tests/unit/neural-optimizer/value-network.test.ts +343 -0
- package/tests/unit/optimization/auto-tuner.test.ts +506 -0
- package/tests/unit/optimization/metric-collectors.test.ts +352 -0
- package/tests/unit/optimization/qe-workers.test.ts +407 -0
- package/tests/unit/optimization/tuning-algorithm.test.ts +467 -0
- package/tests/unit/routing/qe-agent-registry.test.ts +229 -0
- package/tests/unit/routing/qe-task-router.test.ts +390 -0
- package/tests/unit/routing/routing-feedback.test.ts +339 -0
- package/tests/unit/shared/embeddings/nomic-embedder.test.ts +419 -0
- package/tests/unit/shared/http/http-client.test.ts +719 -0
- package/tests/unit/shared/io/file-reader.test.ts +511 -0
- package/tests/unit/shared/llm/cache.test.ts +391 -0
- package/tests/unit/shared/llm/circuit-breaker.test.ts +293 -0
- package/tests/unit/shared/llm/cost-tracker.test.ts +431 -0
- package/tests/unit/shared/llm/provider-manager.test.ts +550 -0
- package/tests/unit/shared/llm/providers.test.ts +532 -0
- package/tests/unit/shared/parsers/typescript-parser.test.ts +693 -0
- package/tests/unit/shared/value-objects.test.ts +184 -0
- package/tests/unit/strange-loop/strange-loop.test.ts +1170 -0
- package/tests/unit/workers/base-worker.test.ts +341 -0
- package/tests/unit/workers/daemon.test.ts +291 -0
- package/tests/unit/workers/worker-manager.test.ts +284 -0
- package/tsconfig.json +32 -0
- package/vitest.config.ts +27 -0
|
@@ -0,0 +1,1700 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Contract Validator Service
|
|
3
|
+
* Implements IContractValidationService for API contract validation (Pact-style)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Result, ok, err } from '../../../shared/types/index.js';
|
|
7
|
+
import type { MemoryBackend } from '../../../kernel/interfaces.js';
|
|
8
|
+
import type {
|
|
9
|
+
IContractValidationService,
|
|
10
|
+
ApiContract,
|
|
11
|
+
SchemaDefinition,
|
|
12
|
+
ValidationReport,
|
|
13
|
+
ValidationError,
|
|
14
|
+
SchemaValidationResult,
|
|
15
|
+
SchemaError,
|
|
16
|
+
OpenAPIValidationResult,
|
|
17
|
+
ContractEndpoint,
|
|
18
|
+
} from '../interfaces.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for the contract validator
|
|
22
|
+
*/
|
|
23
|
+
export interface ContractValidatorConfig {
|
|
24
|
+
strictMode: boolean;
|
|
25
|
+
validateExamples: boolean;
|
|
26
|
+
maxSchemaDepth: number;
|
|
27
|
+
cacheValidations: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const DEFAULT_CONFIG: ContractValidatorConfig = {
|
|
31
|
+
strictMode: true,
|
|
32
|
+
validateExamples: true,
|
|
33
|
+
maxSchemaDepth: 20,
|
|
34
|
+
cacheValidations: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* GraphQL schema parsing types
|
|
39
|
+
*/
|
|
40
|
+
interface GraphQLSchemaInfo {
|
|
41
|
+
types: Record<string, GraphQLTypeDef>;
|
|
42
|
+
queryType: string | null;
|
|
43
|
+
mutationType: string | null;
|
|
44
|
+
subscriptionType: string | null;
|
|
45
|
+
errors: string[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface GraphQLTypeDef {
|
|
49
|
+
kind: 'type' | 'input' | 'interface' | 'enum';
|
|
50
|
+
fields: Record<string, GraphQLFieldDef>;
|
|
51
|
+
implements: string | null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface GraphQLFieldDef {
|
|
55
|
+
type: string;
|
|
56
|
+
arguments?: Record<string, { type: string }>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface GraphQLOperationInfo {
|
|
60
|
+
type: 'query' | 'mutation' | 'subscription';
|
|
61
|
+
name: string | null;
|
|
62
|
+
fields: GraphQLField[];
|
|
63
|
+
variableDefinitions: Record<string, { type: string; required: boolean }>;
|
|
64
|
+
errors: string[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface GraphQLField {
|
|
68
|
+
name: string;
|
|
69
|
+
alias?: string;
|
|
70
|
+
arguments?: Record<string, unknown>;
|
|
71
|
+
selections?: GraphQLField[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Contract Validation Service Implementation
|
|
76
|
+
* Validates API contracts against schemas and specifications
|
|
77
|
+
*/
|
|
78
|
+
export class ContractValidatorService implements IContractValidationService {
|
|
79
|
+
private readonly config: ContractValidatorConfig;
|
|
80
|
+
private readonly validationCache: Map<string, ValidationReport> = new Map();
|
|
81
|
+
|
|
82
|
+
constructor(
|
|
83
|
+
private readonly memory: MemoryBackend,
|
|
84
|
+
config: Partial<ContractValidatorConfig> = {}
|
|
85
|
+
) {
|
|
86
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Validate contract structure
|
|
91
|
+
*/
|
|
92
|
+
async validateContract(contract: ApiContract): Promise<Result<ValidationReport>> {
|
|
93
|
+
try {
|
|
94
|
+
// Check cache first
|
|
95
|
+
const cacheKey = this.getCacheKey(contract);
|
|
96
|
+
if (this.config.cacheValidations && this.validationCache.has(cacheKey)) {
|
|
97
|
+
return ok(this.validationCache.get(cacheKey)!);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const errors: ValidationError[] = [];
|
|
101
|
+
const warnings: string[] = [];
|
|
102
|
+
|
|
103
|
+
// Validate basic contract structure
|
|
104
|
+
this.validateContractStructure(contract, errors, warnings);
|
|
105
|
+
|
|
106
|
+
// Validate provider info
|
|
107
|
+
this.validateServiceInfo(contract.provider, 'provider', errors);
|
|
108
|
+
|
|
109
|
+
// Validate consumers
|
|
110
|
+
for (const consumer of contract.consumers) {
|
|
111
|
+
this.validateServiceInfo(consumer, `consumer:${consumer.name}`, errors);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Validate endpoints
|
|
115
|
+
for (const endpoint of contract.endpoints) {
|
|
116
|
+
await this.validateEndpoint(endpoint, contract.schemas, errors, warnings);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Validate schemas
|
|
120
|
+
for (const schema of contract.schemas) {
|
|
121
|
+
await this.validateSchemaDefinition(schema, errors, warnings);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Validate examples if enabled
|
|
125
|
+
if (this.config.validateExamples) {
|
|
126
|
+
await this.validateEndpointExamples(contract, errors, warnings);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const report: ValidationReport = {
|
|
130
|
+
isValid: errors.length === 0,
|
|
131
|
+
errors,
|
|
132
|
+
warnings,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Cache the result
|
|
136
|
+
if (this.config.cacheValidations) {
|
|
137
|
+
this.validationCache.set(cacheKey, report);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Store validation history
|
|
141
|
+
await this.storeValidationHistory(contract.id, report);
|
|
142
|
+
|
|
143
|
+
return ok(report);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Validate request against schema
|
|
151
|
+
*/
|
|
152
|
+
async validateRequest(
|
|
153
|
+
request: unknown,
|
|
154
|
+
schema: SchemaDefinition
|
|
155
|
+
): Promise<Result<SchemaValidationResult>> {
|
|
156
|
+
try {
|
|
157
|
+
const errors: SchemaError[] = [];
|
|
158
|
+
|
|
159
|
+
switch (schema.type) {
|
|
160
|
+
case 'json-schema':
|
|
161
|
+
await this.validateAgainstJsonSchema(request, schema.content, errors);
|
|
162
|
+
break;
|
|
163
|
+
case 'openapi':
|
|
164
|
+
await this.validateAgainstOpenAPISchema(request, schema.content, errors);
|
|
165
|
+
break;
|
|
166
|
+
case 'graphql':
|
|
167
|
+
await this.validateAgainstGraphQLSchema(request, schema.content, errors);
|
|
168
|
+
break;
|
|
169
|
+
default:
|
|
170
|
+
errors.push({
|
|
171
|
+
path: '',
|
|
172
|
+
keyword: 'unsupported',
|
|
173
|
+
message: `Schema type '${schema.type}' is not supported for request validation`,
|
|
174
|
+
params: { schemaType: schema.type },
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return ok({
|
|
179
|
+
isValid: errors.length === 0,
|
|
180
|
+
errors,
|
|
181
|
+
});
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Validate response against schema
|
|
189
|
+
*/
|
|
190
|
+
async validateResponse(
|
|
191
|
+
response: unknown,
|
|
192
|
+
schema: SchemaDefinition
|
|
193
|
+
): Promise<Result<SchemaValidationResult>> {
|
|
194
|
+
try {
|
|
195
|
+
const errors: SchemaError[] = [];
|
|
196
|
+
|
|
197
|
+
switch (schema.type) {
|
|
198
|
+
case 'json-schema':
|
|
199
|
+
await this.validateAgainstJsonSchema(response, schema.content, errors);
|
|
200
|
+
break;
|
|
201
|
+
case 'openapi':
|
|
202
|
+
await this.validateAgainstOpenAPISchema(response, schema.content, errors);
|
|
203
|
+
break;
|
|
204
|
+
case 'graphql':
|
|
205
|
+
await this.validateAgainstGraphQLSchema(response, schema.content, errors);
|
|
206
|
+
break;
|
|
207
|
+
default:
|
|
208
|
+
errors.push({
|
|
209
|
+
path: '',
|
|
210
|
+
keyword: 'unsupported',
|
|
211
|
+
message: `Schema type '${schema.type}' is not supported for response validation`,
|
|
212
|
+
params: { schemaType: schema.type },
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return ok({
|
|
217
|
+
isValid: errors.length === 0,
|
|
218
|
+
errors,
|
|
219
|
+
});
|
|
220
|
+
} catch (error) {
|
|
221
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Validate OpenAPI/Swagger specification
|
|
227
|
+
*/
|
|
228
|
+
async validateOpenAPI(spec: string): Promise<Result<OpenAPIValidationResult>> {
|
|
229
|
+
try {
|
|
230
|
+
const errors: ValidationError[] = [];
|
|
231
|
+
const warnings: string[] = [];
|
|
232
|
+
let specVersion = 'unknown';
|
|
233
|
+
let endpointCount = 0;
|
|
234
|
+
let schemaCount = 0;
|
|
235
|
+
|
|
236
|
+
// Parse the spec
|
|
237
|
+
let parsedSpec: Record<string, unknown>;
|
|
238
|
+
try {
|
|
239
|
+
parsedSpec = JSON.parse(spec);
|
|
240
|
+
} catch {
|
|
241
|
+
// Try YAML parsing
|
|
242
|
+
// For now, we'll treat it as JSON
|
|
243
|
+
return ok({
|
|
244
|
+
isValid: false,
|
|
245
|
+
specVersion: 'unknown',
|
|
246
|
+
errors: [
|
|
247
|
+
{
|
|
248
|
+
path: '',
|
|
249
|
+
message: 'Failed to parse OpenAPI specification',
|
|
250
|
+
code: 'PARSE_ERROR',
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
warnings: [],
|
|
254
|
+
endpointCount: 0,
|
|
255
|
+
schemaCount: 0,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Detect spec version
|
|
260
|
+
if (parsedSpec.openapi) {
|
|
261
|
+
specVersion = parsedSpec.openapi as string;
|
|
262
|
+
} else if (parsedSpec.swagger) {
|
|
263
|
+
specVersion = `swagger-${parsedSpec.swagger}`;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Validate OpenAPI 3.x structure
|
|
267
|
+
if (specVersion.startsWith('3.')) {
|
|
268
|
+
this.validateOpenAPI3Structure(parsedSpec, errors, warnings);
|
|
269
|
+
} else if (specVersion.startsWith('swagger-2')) {
|
|
270
|
+
this.validateSwagger2Structure(parsedSpec, errors, warnings);
|
|
271
|
+
} else {
|
|
272
|
+
errors.push({
|
|
273
|
+
path: '',
|
|
274
|
+
message: `Unsupported OpenAPI version: ${specVersion}`,
|
|
275
|
+
code: 'UNSUPPORTED_VERSION',
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Count endpoints
|
|
280
|
+
const paths = (parsedSpec.paths as Record<string, unknown>) || {};
|
|
281
|
+
for (const [_path, methods] of Object.entries(paths)) {
|
|
282
|
+
if (typeof methods === 'object' && methods !== null) {
|
|
283
|
+
const httpMethods = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options'];
|
|
284
|
+
for (const method of httpMethods) {
|
|
285
|
+
if (method in methods) {
|
|
286
|
+
endpointCount++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Count schemas
|
|
293
|
+
const components = parsedSpec.components as Record<string, unknown> | undefined;
|
|
294
|
+
const schemas = (components?.schemas as Record<string, unknown>) || {};
|
|
295
|
+
schemaCount = Object.keys(schemas).length;
|
|
296
|
+
|
|
297
|
+
// Also count definitions for Swagger 2
|
|
298
|
+
const definitions = (parsedSpec.definitions as Record<string, unknown>) || {};
|
|
299
|
+
schemaCount += Object.keys(definitions).length;
|
|
300
|
+
|
|
301
|
+
return ok({
|
|
302
|
+
isValid: errors.length === 0,
|
|
303
|
+
specVersion,
|
|
304
|
+
errors,
|
|
305
|
+
warnings,
|
|
306
|
+
endpointCount,
|
|
307
|
+
schemaCount,
|
|
308
|
+
});
|
|
309
|
+
} catch (error) {
|
|
310
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ============================================================================
|
|
315
|
+
// Private Helper Methods
|
|
316
|
+
// ============================================================================
|
|
317
|
+
|
|
318
|
+
private getCacheKey(contract: ApiContract): string {
|
|
319
|
+
return `${contract.id}:${contract.version.toString()}`;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
private validateContractStructure(
|
|
323
|
+
contract: ApiContract,
|
|
324
|
+
errors: ValidationError[],
|
|
325
|
+
warnings: string[]
|
|
326
|
+
): void {
|
|
327
|
+
if (!contract.id || contract.id.trim() === '') {
|
|
328
|
+
errors.push({
|
|
329
|
+
path: 'id',
|
|
330
|
+
message: 'Contract ID is required',
|
|
331
|
+
code: 'REQUIRED_FIELD',
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (!contract.name || contract.name.trim() === '') {
|
|
336
|
+
errors.push({
|
|
337
|
+
path: 'name',
|
|
338
|
+
message: 'Contract name is required',
|
|
339
|
+
code: 'REQUIRED_FIELD',
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (!contract.type) {
|
|
344
|
+
errors.push({
|
|
345
|
+
path: 'type',
|
|
346
|
+
message: 'Contract type is required',
|
|
347
|
+
code: 'REQUIRED_FIELD',
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (contract.endpoints.length === 0) {
|
|
352
|
+
if (this.config.strictMode) {
|
|
353
|
+
errors.push({
|
|
354
|
+
path: 'endpoints',
|
|
355
|
+
message: 'Contract must have at least one endpoint',
|
|
356
|
+
code: 'EMPTY_ENDPOINTS',
|
|
357
|
+
});
|
|
358
|
+
} else {
|
|
359
|
+
warnings.push('Contract has no endpoints defined');
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (contract.consumers.length === 0) {
|
|
364
|
+
warnings.push('No consumers defined for contract');
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
private validateServiceInfo(
|
|
369
|
+
info: { name: string; version: string; team?: string },
|
|
370
|
+
path: string,
|
|
371
|
+
errors: ValidationError[]
|
|
372
|
+
): void {
|
|
373
|
+
if (!info.name || info.name.trim() === '') {
|
|
374
|
+
errors.push({
|
|
375
|
+
path: `${path}.name`,
|
|
376
|
+
message: 'Service name is required',
|
|
377
|
+
code: 'REQUIRED_FIELD',
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (!info.version || info.version.trim() === '') {
|
|
382
|
+
errors.push({
|
|
383
|
+
path: `${path}.version`,
|
|
384
|
+
message: 'Service version is required',
|
|
385
|
+
code: 'REQUIRED_FIELD',
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
private async validateEndpoint(
|
|
391
|
+
endpoint: ContractEndpoint,
|
|
392
|
+
schemas: SchemaDefinition[],
|
|
393
|
+
errors: ValidationError[],
|
|
394
|
+
warnings: string[]
|
|
395
|
+
): Promise<void> {
|
|
396
|
+
if (!endpoint.path || endpoint.path.trim() === '') {
|
|
397
|
+
errors.push({
|
|
398
|
+
path: 'endpoint.path',
|
|
399
|
+
message: 'Endpoint path is required',
|
|
400
|
+
code: 'REQUIRED_FIELD',
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (!endpoint.method) {
|
|
405
|
+
errors.push({
|
|
406
|
+
path: 'endpoint.method',
|
|
407
|
+
message: 'HTTP method is required',
|
|
408
|
+
code: 'REQUIRED_FIELD',
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Validate schema references
|
|
413
|
+
if (endpoint.requestSchema) {
|
|
414
|
+
const found = schemas.some((s) => s.id === endpoint.requestSchema);
|
|
415
|
+
if (!found) {
|
|
416
|
+
errors.push({
|
|
417
|
+
path: `endpoint.${endpoint.path}.requestSchema`,
|
|
418
|
+
message: `Request schema '${endpoint.requestSchema}' not found`,
|
|
419
|
+
code: 'INVALID_REFERENCE',
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (endpoint.responseSchema) {
|
|
425
|
+
const found = schemas.some((s) => s.id === endpoint.responseSchema);
|
|
426
|
+
if (!found) {
|
|
427
|
+
errors.push({
|
|
428
|
+
path: `endpoint.${endpoint.path}.responseSchema`,
|
|
429
|
+
message: `Response schema '${endpoint.responseSchema}' not found`,
|
|
430
|
+
code: 'INVALID_REFERENCE',
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// Warn about missing examples
|
|
436
|
+
if (endpoint.examples.length === 0) {
|
|
437
|
+
warnings.push(`Endpoint ${endpoint.method} ${endpoint.path} has no examples`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
private async validateSchemaDefinition(
|
|
442
|
+
schema: SchemaDefinition,
|
|
443
|
+
errors: ValidationError[],
|
|
444
|
+
warnings: string[]
|
|
445
|
+
): Promise<void> {
|
|
446
|
+
if (!schema.id || schema.id.trim() === '') {
|
|
447
|
+
errors.push({
|
|
448
|
+
path: 'schema.id',
|
|
449
|
+
message: 'Schema ID is required',
|
|
450
|
+
code: 'REQUIRED_FIELD',
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
if (!schema.content || schema.content.trim() === '') {
|
|
455
|
+
errors.push({
|
|
456
|
+
path: `schema.${schema.id}.content`,
|
|
457
|
+
message: 'Schema content is required',
|
|
458
|
+
code: 'REQUIRED_FIELD',
|
|
459
|
+
});
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// Validate schema based on type
|
|
464
|
+
switch (schema.type) {
|
|
465
|
+
case 'json-schema':
|
|
466
|
+
this.validateJsonSchemaContent(schema.content, schema.id, errors, warnings);
|
|
467
|
+
break;
|
|
468
|
+
case 'openapi':
|
|
469
|
+
// OpenAPI schemas are validated as JSON Schema subset
|
|
470
|
+
this.validateJsonSchemaContent(schema.content, schema.id, errors, warnings);
|
|
471
|
+
break;
|
|
472
|
+
case 'graphql':
|
|
473
|
+
this.validateGraphQLSchemaContent(schema.content, schema.id, errors, warnings);
|
|
474
|
+
break;
|
|
475
|
+
case 'protobuf':
|
|
476
|
+
this.validateProtobufContent(schema.content, schema.id, errors, warnings);
|
|
477
|
+
break;
|
|
478
|
+
case 'avro':
|
|
479
|
+
this.validateAvroContent(schema.content, schema.id, errors, warnings);
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
private validateJsonSchemaContent(
|
|
485
|
+
content: string,
|
|
486
|
+
schemaId: string,
|
|
487
|
+
errors: ValidationError[],
|
|
488
|
+
_warnings: string[]
|
|
489
|
+
): void {
|
|
490
|
+
try {
|
|
491
|
+
const parsed = JSON.parse(content);
|
|
492
|
+
|
|
493
|
+
// Basic JSON Schema validation
|
|
494
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
495
|
+
errors.push({
|
|
496
|
+
path: `schema.${schemaId}`,
|
|
497
|
+
message: 'JSON Schema must be an object',
|
|
498
|
+
code: 'INVALID_SCHEMA',
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
} catch {
|
|
502
|
+
errors.push({
|
|
503
|
+
path: `schema.${schemaId}`,
|
|
504
|
+
message: 'Invalid JSON in schema content',
|
|
505
|
+
code: 'INVALID_JSON',
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
private validateGraphQLSchemaContent(
|
|
511
|
+
content: string,
|
|
512
|
+
schemaId: string,
|
|
513
|
+
errors: ValidationError[],
|
|
514
|
+
warnings: string[]
|
|
515
|
+
): void {
|
|
516
|
+
// GraphQL schema validation with syntax checking
|
|
517
|
+
const lines = content.split('\n');
|
|
518
|
+
let braceDepth = 0;
|
|
519
|
+
let hasTypeDefinition = false;
|
|
520
|
+
let hasQueryType = false;
|
|
521
|
+
|
|
522
|
+
for (let lineNum = 0; lineNum < lines.length; lineNum++) {
|
|
523
|
+
const line = lines[lineNum].trim();
|
|
524
|
+
|
|
525
|
+
// Skip comments and empty lines
|
|
526
|
+
if (line.startsWith('#') || line === '') continue;
|
|
527
|
+
|
|
528
|
+
// Check for type definitions
|
|
529
|
+
if (line.startsWith('type ') || line.startsWith('input ') || line.startsWith('interface ') || line.startsWith('enum ')) {
|
|
530
|
+
hasTypeDefinition = true;
|
|
531
|
+
if (line.startsWith('type Query')) {
|
|
532
|
+
hasQueryType = true;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Check for schema definition
|
|
537
|
+
if (line.startsWith('schema ') || line.startsWith('schema{')) {
|
|
538
|
+
hasTypeDefinition = true;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Track brace depth for balance check
|
|
542
|
+
braceDepth += (line.match(/{/g) || []).length;
|
|
543
|
+
braceDepth -= (line.match(/}/g) || []).length;
|
|
544
|
+
|
|
545
|
+
// Check for invalid syntax patterns
|
|
546
|
+
if (line.includes('::')) {
|
|
547
|
+
errors.push({
|
|
548
|
+
path: `schema.${schemaId}.line${lineNum + 1}`,
|
|
549
|
+
message: 'Invalid double colon in GraphQL schema',
|
|
550
|
+
code: 'INVALID_GRAPHQL_SYNTAX',
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// Check for field definitions without type
|
|
555
|
+
if (line.includes(':') && !line.includes('type ') && !line.includes('schema')) {
|
|
556
|
+
const colonIndex = line.indexOf(':');
|
|
557
|
+
const afterColon = line.slice(colonIndex + 1).trim();
|
|
558
|
+
if (afterColon === '' || afterColon === '{') {
|
|
559
|
+
errors.push({
|
|
560
|
+
path: `schema.${schemaId}.line${lineNum + 1}`,
|
|
561
|
+
message: 'Field definition missing type',
|
|
562
|
+
code: 'INVALID_GRAPHQL_FIELD',
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// Check for required elements
|
|
569
|
+
if (!hasTypeDefinition) {
|
|
570
|
+
errors.push({
|
|
571
|
+
path: `schema.${schemaId}`,
|
|
572
|
+
message: 'GraphQL schema must contain type definitions',
|
|
573
|
+
code: 'INVALID_GRAPHQL',
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// Check for balanced braces
|
|
578
|
+
if (braceDepth !== 0) {
|
|
579
|
+
errors.push({
|
|
580
|
+
path: `schema.${schemaId}`,
|
|
581
|
+
message: 'GraphQL schema has unbalanced braces',
|
|
582
|
+
code: 'INVALID_GRAPHQL_BRACES',
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Warn if no Query type
|
|
587
|
+
if (hasTypeDefinition && !hasQueryType && !content.includes('schema {')) {
|
|
588
|
+
warnings.push(`Schema ${schemaId} has no Query type defined`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
private validateProtobufContent(
|
|
593
|
+
content: string,
|
|
594
|
+
schemaId: string,
|
|
595
|
+
errors: ValidationError[],
|
|
596
|
+
warnings: string[]
|
|
597
|
+
): void {
|
|
598
|
+
// Protobuf schema validation with syntax checking
|
|
599
|
+
const lines = content.split('\n');
|
|
600
|
+
let braceDepth = 0;
|
|
601
|
+
let hasMessage = false;
|
|
602
|
+
let hasSyntax = false;
|
|
603
|
+
let syntaxVersion: string | null = null;
|
|
604
|
+
|
|
605
|
+
for (let lineNum = 0; lineNum < lines.length; lineNum++) {
|
|
606
|
+
const line = lines[lineNum].trim();
|
|
607
|
+
|
|
608
|
+
// Skip comments and empty lines
|
|
609
|
+
if (line.startsWith('//') || line === '') continue;
|
|
610
|
+
|
|
611
|
+
// Check for syntax declaration
|
|
612
|
+
const syntaxMatch = line.match(/^syntax\s*=\s*["']proto(\d)["']\s*;?/);
|
|
613
|
+
if (syntaxMatch) {
|
|
614
|
+
hasSyntax = true;
|
|
615
|
+
syntaxVersion = syntaxMatch[1];
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// Check for message definitions
|
|
619
|
+
if (line.startsWith('message ')) {
|
|
620
|
+
hasMessage = true;
|
|
621
|
+
// Check for valid message name
|
|
622
|
+
const msgMatch = line.match(/^message\s+([A-Z][a-zA-Z0-9_]*)\s*\{?/);
|
|
623
|
+
if (!msgMatch) {
|
|
624
|
+
warnings.push(`Message name should start with uppercase letter at line ${lineNum + 1}`);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Check for enum definitions
|
|
629
|
+
if (line.startsWith('enum ')) {
|
|
630
|
+
hasMessage = true; // Enums are also valid definitions
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// Check for service definitions
|
|
634
|
+
if (line.startsWith('service ')) {
|
|
635
|
+
hasMessage = true;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// Track brace depth
|
|
639
|
+
braceDepth += (line.match(/{/g) || []).length;
|
|
640
|
+
braceDepth -= (line.match(/}/g) || []).length;
|
|
641
|
+
|
|
642
|
+
// Check for field definitions (inside messages)
|
|
643
|
+
const fieldMatch = line.match(/^\s*(optional|required|repeated)?\s*(\w+)\s+(\w+)\s*=\s*(\d+)/);
|
|
644
|
+
if (fieldMatch) {
|
|
645
|
+
const [, modifier, , , fieldNum] = fieldMatch;
|
|
646
|
+
const num = parseInt(fieldNum, 10);
|
|
647
|
+
|
|
648
|
+
// Field numbers should be positive and within valid range
|
|
649
|
+
if (num <= 0 || num > 536870911) {
|
|
650
|
+
errors.push({
|
|
651
|
+
path: `schema.${schemaId}.line${lineNum + 1}`,
|
|
652
|
+
message: `Invalid field number ${num}`,
|
|
653
|
+
code: 'INVALID_PROTOBUF_FIELD_NUMBER',
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Warn about reserved field numbers
|
|
658
|
+
if (num >= 19000 && num <= 19999) {
|
|
659
|
+
warnings.push(`Field number ${num} is in reserved range (19000-19999) at line ${lineNum + 1}`);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// Check for required in proto3
|
|
663
|
+
if (modifier === 'required' && syntaxVersion === '3') {
|
|
664
|
+
errors.push({
|
|
665
|
+
path: `schema.${schemaId}.line${lineNum + 1}`,
|
|
666
|
+
message: 'Required fields are not allowed in proto3',
|
|
667
|
+
code: 'INVALID_PROTOBUF_REQUIRED',
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// Check for required elements
|
|
674
|
+
if (!hasMessage) {
|
|
675
|
+
errors.push({
|
|
676
|
+
path: `schema.${schemaId}`,
|
|
677
|
+
message: 'Protobuf schema must contain message, enum, or service definitions',
|
|
678
|
+
code: 'INVALID_PROTOBUF',
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// Check for balanced braces
|
|
683
|
+
if (braceDepth !== 0) {
|
|
684
|
+
errors.push({
|
|
685
|
+
path: `schema.${schemaId}`,
|
|
686
|
+
message: 'Protobuf schema has unbalanced braces',
|
|
687
|
+
code: 'INVALID_PROTOBUF_BRACES',
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// Warn if no syntax declaration
|
|
692
|
+
if (!hasSyntax) {
|
|
693
|
+
warnings.push(`Schema ${schemaId} has no syntax declaration (defaults to proto2)`);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
private validateAvroContent(
|
|
698
|
+
content: string,
|
|
699
|
+
schemaId: string,
|
|
700
|
+
errors: ValidationError[],
|
|
701
|
+
_warnings: string[]
|
|
702
|
+
): void {
|
|
703
|
+
try {
|
|
704
|
+
const parsed = JSON.parse(content);
|
|
705
|
+
if (!parsed.type) {
|
|
706
|
+
errors.push({
|
|
707
|
+
path: `schema.${schemaId}`,
|
|
708
|
+
message: 'Avro schema must have a type field',
|
|
709
|
+
code: 'INVALID_AVRO',
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
} catch {
|
|
713
|
+
errors.push({
|
|
714
|
+
path: `schema.${schemaId}`,
|
|
715
|
+
message: 'Invalid JSON in Avro schema',
|
|
716
|
+
code: 'INVALID_JSON',
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
private async validateEndpointExamples(
|
|
722
|
+
contract: ApiContract,
|
|
723
|
+
errors: ValidationError[],
|
|
724
|
+
_warnings: string[]
|
|
725
|
+
): Promise<void> {
|
|
726
|
+
for (const endpoint of contract.endpoints) {
|
|
727
|
+
for (const example of endpoint.examples) {
|
|
728
|
+
// Validate request example against schema
|
|
729
|
+
if (endpoint.requestSchema && example.request !== undefined) {
|
|
730
|
+
const schema = contract.schemas.find((s) => s.id === endpoint.requestSchema);
|
|
731
|
+
if (schema) {
|
|
732
|
+
const result = await this.validateRequest(example.request, schema);
|
|
733
|
+
if (result.success && !result.value.isValid) {
|
|
734
|
+
errors.push({
|
|
735
|
+
path: `endpoint.${endpoint.path}.example.${example.name}.request`,
|
|
736
|
+
message: `Request example does not match schema: ${result.value.errors.map((e) => e.message).join(', ')}`,
|
|
737
|
+
code: 'EXAMPLE_VALIDATION_FAILED',
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// Validate response example against schema
|
|
744
|
+
if (endpoint.responseSchema && example.response !== undefined) {
|
|
745
|
+
const schema = contract.schemas.find((s) => s.id === endpoint.responseSchema);
|
|
746
|
+
if (schema) {
|
|
747
|
+
const result = await this.validateResponse(example.response, schema);
|
|
748
|
+
if (result.success && !result.value.isValid) {
|
|
749
|
+
errors.push({
|
|
750
|
+
path: `endpoint.${endpoint.path}.example.${example.name}.response`,
|
|
751
|
+
message: `Response example does not match schema: ${result.value.errors.map((e) => e.message).join(', ')}`,
|
|
752
|
+
code: 'EXAMPLE_VALIDATION_FAILED',
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
private async validateAgainstJsonSchema(
|
|
762
|
+
data: unknown,
|
|
763
|
+
schemaContent: string,
|
|
764
|
+
errors: SchemaError[]
|
|
765
|
+
): Promise<void> {
|
|
766
|
+
try {
|
|
767
|
+
const schema = JSON.parse(schemaContent);
|
|
768
|
+
|
|
769
|
+
// JSON Schema validation with type, required, constraints, and nested object/array support
|
|
770
|
+
this.basicTypeValidation(data, schema, '', errors);
|
|
771
|
+
} catch {
|
|
772
|
+
errors.push({
|
|
773
|
+
path: '',
|
|
774
|
+
keyword: 'parse',
|
|
775
|
+
message: 'Failed to parse JSON Schema',
|
|
776
|
+
params: {},
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
private async validateAgainstOpenAPISchema(
|
|
782
|
+
data: unknown,
|
|
783
|
+
schemaContent: string,
|
|
784
|
+
errors: SchemaError[]
|
|
785
|
+
): Promise<void> {
|
|
786
|
+
// OpenAPI schemas are a subset of JSON Schema
|
|
787
|
+
await this.validateAgainstJsonSchema(data, schemaContent, errors);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
private async validateAgainstGraphQLSchema(
|
|
791
|
+
data: unknown,
|
|
792
|
+
schemaContent: string,
|
|
793
|
+
errors: SchemaError[]
|
|
794
|
+
): Promise<void> {
|
|
795
|
+
// Parse the GraphQL schema to extract type definitions
|
|
796
|
+
const schemaInfo = this.parseGraphQLSchema(schemaContent);
|
|
797
|
+
if (schemaInfo.errors.length > 0) {
|
|
798
|
+
for (const schemaError of schemaInfo.errors) {
|
|
799
|
+
errors.push({
|
|
800
|
+
path: '',
|
|
801
|
+
keyword: 'schema',
|
|
802
|
+
message: schemaError,
|
|
803
|
+
params: {},
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// Validate the data (expected to be a GraphQL operation)
|
|
810
|
+
if (typeof data !== 'object' || data === null) {
|
|
811
|
+
errors.push({
|
|
812
|
+
path: '',
|
|
813
|
+
keyword: 'type',
|
|
814
|
+
message: 'GraphQL request must be an object with query/mutation',
|
|
815
|
+
params: {},
|
|
816
|
+
});
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
const request = data as Record<string, unknown>;
|
|
821
|
+
const query = request.query as string | undefined;
|
|
822
|
+
const variables = request.variables as Record<string, unknown> | undefined;
|
|
823
|
+
|
|
824
|
+
if (!query || typeof query !== 'string') {
|
|
825
|
+
errors.push({
|
|
826
|
+
path: 'query',
|
|
827
|
+
keyword: 'required',
|
|
828
|
+
message: 'GraphQL request must contain a query string',
|
|
829
|
+
params: {},
|
|
830
|
+
});
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// Parse and validate the operation
|
|
835
|
+
const operationInfo = this.parseGraphQLOperation(query);
|
|
836
|
+
if (operationInfo.errors.length > 0) {
|
|
837
|
+
for (const opError of operationInfo.errors) {
|
|
838
|
+
errors.push({
|
|
839
|
+
path: 'query',
|
|
840
|
+
keyword: 'syntax',
|
|
841
|
+
message: opError,
|
|
842
|
+
params: {},
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// Validate operation type exists in schema
|
|
849
|
+
const operationType = operationInfo.type; // 'query' | 'mutation' | 'subscription'
|
|
850
|
+
const rootType = this.getRootTypeForOperation(operationType, schemaInfo);
|
|
851
|
+
if (!rootType) {
|
|
852
|
+
errors.push({
|
|
853
|
+
path: 'query',
|
|
854
|
+
keyword: 'operation',
|
|
855
|
+
message: `Schema does not support ${operationType} operations`,
|
|
856
|
+
params: { operationType },
|
|
857
|
+
});
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// Validate selected fields exist on the root type
|
|
862
|
+
for (const field of operationInfo.fields) {
|
|
863
|
+
const fieldDef = schemaInfo.types[rootType]?.fields[field.name];
|
|
864
|
+
if (!fieldDef) {
|
|
865
|
+
errors.push({
|
|
866
|
+
path: `query.${field.name}`,
|
|
867
|
+
keyword: 'field',
|
|
868
|
+
message: `Field '${field.name}' does not exist on type '${rootType}'`,
|
|
869
|
+
params: { field: field.name, type: rootType },
|
|
870
|
+
});
|
|
871
|
+
} else {
|
|
872
|
+
// Validate arguments if provided
|
|
873
|
+
if (field.arguments) {
|
|
874
|
+
for (const [argName, _argValue] of Object.entries(field.arguments)) {
|
|
875
|
+
if (!fieldDef.arguments?.[argName]) {
|
|
876
|
+
errors.push({
|
|
877
|
+
path: `query.${field.name}.${argName}`,
|
|
878
|
+
keyword: 'argument',
|
|
879
|
+
message: `Unknown argument '${argName}' on field '${field.name}'`,
|
|
880
|
+
params: { argument: argName, field: field.name },
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Validate nested field selections
|
|
887
|
+
if (field.selections && field.selections.length > 0) {
|
|
888
|
+
const fieldType = this.unwrapGraphQLType(fieldDef.type);
|
|
889
|
+
this.validateGraphQLSelections(
|
|
890
|
+
field.selections,
|
|
891
|
+
fieldType,
|
|
892
|
+
schemaInfo,
|
|
893
|
+
`query.${field.name}`,
|
|
894
|
+
errors
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// Validate variables against operation variable definitions
|
|
901
|
+
if (variables && operationInfo.variableDefinitions) {
|
|
902
|
+
for (const [varName, varDef] of Object.entries(operationInfo.variableDefinitions)) {
|
|
903
|
+
if (varDef.required && !(varName in variables)) {
|
|
904
|
+
errors.push({
|
|
905
|
+
path: `variables.${varName}`,
|
|
906
|
+
keyword: 'required',
|
|
907
|
+
message: `Required variable '${varName}' is missing`,
|
|
908
|
+
params: { variable: varName },
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
if (varName in variables) {
|
|
912
|
+
this.validateGraphQLVariableType(variables[varName], varDef.type, `variables.${varName}`, errors);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Parse GraphQL schema to extract type definitions
|
|
920
|
+
*/
|
|
921
|
+
private parseGraphQLSchema(schemaContent: string): GraphQLSchemaInfo {
|
|
922
|
+
const info: GraphQLSchemaInfo = {
|
|
923
|
+
types: {},
|
|
924
|
+
queryType: null,
|
|
925
|
+
mutationType: null,
|
|
926
|
+
subscriptionType: null,
|
|
927
|
+
errors: [],
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
const lines = schemaContent.split('\n');
|
|
931
|
+
let currentType: string | null = null;
|
|
932
|
+
let currentTypeKind: 'type' | 'input' | 'interface' | 'enum' | null = null;
|
|
933
|
+
let braceDepth = 0;
|
|
934
|
+
|
|
935
|
+
for (let i = 0; i < lines.length; i++) {
|
|
936
|
+
const line = lines[i].trim();
|
|
937
|
+
|
|
938
|
+
// Skip comments and empty lines
|
|
939
|
+
if (line.startsWith('#') || line === '') continue;
|
|
940
|
+
|
|
941
|
+
// Detect schema definition
|
|
942
|
+
const schemaMatch = line.match(/^schema\s*\{?/);
|
|
943
|
+
if (schemaMatch) {
|
|
944
|
+
// Parse schema block to find root types
|
|
945
|
+
let schemaBlock = line;
|
|
946
|
+
if (!line.includes('}')) {
|
|
947
|
+
for (let j = i + 1; j < lines.length; j++) {
|
|
948
|
+
schemaBlock += ' ' + lines[j].trim();
|
|
949
|
+
if (lines[j].includes('}')) break;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
const queryMatch = schemaBlock.match(/query\s*:\s*(\w+)/);
|
|
953
|
+
const mutationMatch = schemaBlock.match(/mutation\s*:\s*(\w+)/);
|
|
954
|
+
const subscriptionMatch = schemaBlock.match(/subscription\s*:\s*(\w+)/);
|
|
955
|
+
if (queryMatch) info.queryType = queryMatch[1];
|
|
956
|
+
if (mutationMatch) info.mutationType = mutationMatch[1];
|
|
957
|
+
if (subscriptionMatch) info.subscriptionType = subscriptionMatch[1];
|
|
958
|
+
continue;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// Detect type definitions
|
|
962
|
+
const typeMatch = line.match(/^(type|input|interface|enum)\s+(\w+)(?:\s+implements\s+(\w+))?\s*\{?/);
|
|
963
|
+
if (typeMatch) {
|
|
964
|
+
currentTypeKind = typeMatch[1] as 'type' | 'input' | 'interface' | 'enum';
|
|
965
|
+
currentType = typeMatch[2];
|
|
966
|
+
info.types[currentType] = {
|
|
967
|
+
kind: currentTypeKind,
|
|
968
|
+
fields: {},
|
|
969
|
+
implements: typeMatch[3] || null,
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
// Default Query/Mutation/Subscription types
|
|
973
|
+
if (currentType === 'Query' && !info.queryType) info.queryType = 'Query';
|
|
974
|
+
if (currentType === 'Mutation' && !info.mutationType) info.mutationType = 'Mutation';
|
|
975
|
+
if (currentType === 'Subscription' && !info.subscriptionType) info.subscriptionType = 'Subscription';
|
|
976
|
+
|
|
977
|
+
if (line.includes('{')) braceDepth++;
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// Track brace depth
|
|
982
|
+
if (line.includes('{')) braceDepth++;
|
|
983
|
+
if (line.includes('}')) {
|
|
984
|
+
braceDepth--;
|
|
985
|
+
if (braceDepth === 0) {
|
|
986
|
+
currentType = null;
|
|
987
|
+
currentTypeKind = null;
|
|
988
|
+
}
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// Parse field definitions within a type
|
|
993
|
+
if (currentType && currentTypeKind !== 'enum') {
|
|
994
|
+
const fieldMatch = line.match(/^(\w+)(?:\s*\(([^)]*)\))?\s*:\s*(.+?)(?:\s*@.*)?$/);
|
|
995
|
+
if (fieldMatch) {
|
|
996
|
+
const fieldName = fieldMatch[1];
|
|
997
|
+
const argsStr = fieldMatch[2];
|
|
998
|
+
const fieldType = fieldMatch[3].trim();
|
|
999
|
+
|
|
1000
|
+
const fieldDef: GraphQLFieldDef = {
|
|
1001
|
+
type: fieldType,
|
|
1002
|
+
arguments: {},
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
// Parse arguments
|
|
1006
|
+
if (argsStr) {
|
|
1007
|
+
const argMatches = argsStr.matchAll(/(\w+)\s*:\s*([^,\)]+)/g);
|
|
1008
|
+
for (const argMatch of argMatches) {
|
|
1009
|
+
fieldDef.arguments![argMatch[1]] = { type: argMatch[2].trim() };
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
info.types[currentType].fields[fieldName] = fieldDef;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// Parse enum values
|
|
1018
|
+
if (currentType && currentTypeKind === 'enum') {
|
|
1019
|
+
const enumValue = line.match(/^(\w+)(?:\s*@.*)?$/);
|
|
1020
|
+
if (enumValue) {
|
|
1021
|
+
info.types[currentType].fields[enumValue[1]] = { type: 'EnumValue' };
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// Validate schema has at least a query type
|
|
1027
|
+
if (!info.queryType && Object.keys(info.types).length > 0) {
|
|
1028
|
+
// Check if there's a Query type defined
|
|
1029
|
+
if (!info.types['Query']) {
|
|
1030
|
+
info.errors.push('GraphQL schema must define a Query type or schema definition');
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
return info;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Parse GraphQL operation (query/mutation/subscription)
|
|
1039
|
+
*/
|
|
1040
|
+
private parseGraphQLOperation(query: string): GraphQLOperationInfo {
|
|
1041
|
+
const info: GraphQLOperationInfo = {
|
|
1042
|
+
type: 'query',
|
|
1043
|
+
name: null,
|
|
1044
|
+
fields: [],
|
|
1045
|
+
variableDefinitions: {},
|
|
1046
|
+
errors: [],
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
// Remove comments
|
|
1050
|
+
const cleanQuery = query.replace(/#[^\n]*/g, '').trim();
|
|
1051
|
+
|
|
1052
|
+
// Detect operation type
|
|
1053
|
+
const operationMatch = cleanQuery.match(/^(query|mutation|subscription)(?:\s+(\w+))?\s*(?:\(([^)]*)\))?\s*\{/);
|
|
1054
|
+
if (operationMatch) {
|
|
1055
|
+
info.type = operationMatch[1] as 'query' | 'mutation' | 'subscription';
|
|
1056
|
+
info.name = operationMatch[2] || null;
|
|
1057
|
+
|
|
1058
|
+
// Parse variable definitions
|
|
1059
|
+
if (operationMatch[3]) {
|
|
1060
|
+
const varMatches = operationMatch[3].matchAll(/\$(\w+)\s*:\s*([^,\)!]+)(!)?/g);
|
|
1061
|
+
for (const varMatch of varMatches) {
|
|
1062
|
+
info.variableDefinitions[varMatch[1]] = {
|
|
1063
|
+
type: varMatch[2].trim(),
|
|
1064
|
+
required: !!varMatch[3],
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
} else if (cleanQuery.startsWith('{')) {
|
|
1069
|
+
// Anonymous query
|
|
1070
|
+
info.type = 'query';
|
|
1071
|
+
} else if (!cleanQuery.includes('{')) {
|
|
1072
|
+
info.errors.push('Invalid GraphQL operation: missing selection set');
|
|
1073
|
+
return info;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
// Extract the selection set
|
|
1077
|
+
const selectionSetMatch = cleanQuery.match(/\{([\s\S]*)\}/);
|
|
1078
|
+
if (!selectionSetMatch) {
|
|
1079
|
+
info.errors.push('Invalid GraphQL operation: could not parse selection set');
|
|
1080
|
+
return info;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// Parse fields from selection set
|
|
1084
|
+
info.fields = this.parseGraphQLSelectionSet(selectionSetMatch[1]);
|
|
1085
|
+
|
|
1086
|
+
return info;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Parse GraphQL selection set into field list
|
|
1091
|
+
*/
|
|
1092
|
+
private parseGraphQLSelectionSet(selectionSet: string): GraphQLField[] {
|
|
1093
|
+
const fields: GraphQLField[] = [];
|
|
1094
|
+
let depth = 0;
|
|
1095
|
+
let currentField = '';
|
|
1096
|
+
let i = 0;
|
|
1097
|
+
|
|
1098
|
+
while (i < selectionSet.length) {
|
|
1099
|
+
const char = selectionSet[i];
|
|
1100
|
+
|
|
1101
|
+
if (char === '{') {
|
|
1102
|
+
depth++;
|
|
1103
|
+
currentField += char;
|
|
1104
|
+
} else if (char === '}') {
|
|
1105
|
+
depth--;
|
|
1106
|
+
currentField += char;
|
|
1107
|
+
} else if ((char === '\n' || char === ' ' || char === ',') && depth === 0) {
|
|
1108
|
+
if (currentField.trim()) {
|
|
1109
|
+
const field = this.parseGraphQLField(currentField.trim());
|
|
1110
|
+
if (field) fields.push(field);
|
|
1111
|
+
}
|
|
1112
|
+
currentField = '';
|
|
1113
|
+
} else {
|
|
1114
|
+
currentField += char;
|
|
1115
|
+
}
|
|
1116
|
+
i++;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// Handle last field
|
|
1120
|
+
if (currentField.trim()) {
|
|
1121
|
+
const field = this.parseGraphQLField(currentField.trim());
|
|
1122
|
+
if (field) fields.push(field);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
return fields;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Parse a single GraphQL field
|
|
1130
|
+
*/
|
|
1131
|
+
private parseGraphQLField(fieldStr: string): GraphQLField | null {
|
|
1132
|
+
// Handle alias
|
|
1133
|
+
const aliasMatch = fieldStr.match(/^(\w+)\s*:\s*(.+)$/);
|
|
1134
|
+
let fieldContent = fieldStr;
|
|
1135
|
+
let alias: string | undefined;
|
|
1136
|
+
if (aliasMatch && !aliasMatch[2].includes('(') && !aliasMatch[2].includes('{')) {
|
|
1137
|
+
// This might be a type annotation in variable, not an alias - skip
|
|
1138
|
+
} else if (aliasMatch && (aliasMatch[2].match(/^\w/) || aliasMatch[2].includes('('))) {
|
|
1139
|
+
alias = aliasMatch[1];
|
|
1140
|
+
fieldContent = aliasMatch[2];
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
// Parse field name and arguments
|
|
1144
|
+
const fieldMatch = fieldContent.match(/^(\w+)(?:\s*\(([^)]*)\))?(?:\s*\{([\s\S]*)\})?$/);
|
|
1145
|
+
if (!fieldMatch) {
|
|
1146
|
+
// Try without nested selection
|
|
1147
|
+
const simpleMatch = fieldContent.match(/^(\w+)(?:\s*\(([^)]*)\))?/);
|
|
1148
|
+
if (simpleMatch) {
|
|
1149
|
+
return {
|
|
1150
|
+
name: simpleMatch[1],
|
|
1151
|
+
alias,
|
|
1152
|
+
arguments: simpleMatch[2] ? this.parseGraphQLArguments(simpleMatch[2]) : undefined,
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
return null;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
const field: GraphQLField = {
|
|
1159
|
+
name: fieldMatch[1],
|
|
1160
|
+
alias,
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1163
|
+
// Parse arguments
|
|
1164
|
+
if (fieldMatch[2]) {
|
|
1165
|
+
field.arguments = this.parseGraphQLArguments(fieldMatch[2]);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// Parse nested selections
|
|
1169
|
+
if (fieldMatch[3]) {
|
|
1170
|
+
field.selections = this.parseGraphQLSelectionSet(fieldMatch[3]);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
return field;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Parse GraphQL arguments
|
|
1178
|
+
*/
|
|
1179
|
+
private parseGraphQLArguments(argsStr: string): Record<string, unknown> {
|
|
1180
|
+
const args: Record<string, unknown> = {};
|
|
1181
|
+
const argMatches = argsStr.matchAll(/(\w+)\s*:\s*([^,\)]+)/g);
|
|
1182
|
+
for (const match of argMatches) {
|
|
1183
|
+
const value = match[2].trim();
|
|
1184
|
+
// Parse value (handle variables, strings, numbers, booleans)
|
|
1185
|
+
if (value.startsWith('$')) {
|
|
1186
|
+
args[match[1]] = { _variable: value.substring(1) };
|
|
1187
|
+
} else if (value.startsWith('"') || value.startsWith("'")) {
|
|
1188
|
+
args[match[1]] = value.slice(1, -1);
|
|
1189
|
+
} else if (value === 'true') {
|
|
1190
|
+
args[match[1]] = true;
|
|
1191
|
+
} else if (value === 'false') {
|
|
1192
|
+
args[match[1]] = false;
|
|
1193
|
+
} else if (value === 'null') {
|
|
1194
|
+
args[match[1]] = null;
|
|
1195
|
+
} else if (!isNaN(Number(value))) {
|
|
1196
|
+
args[match[1]] = Number(value);
|
|
1197
|
+
} else {
|
|
1198
|
+
args[match[1]] = value; // Enum value
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return args;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Get root type name for operation type
|
|
1206
|
+
*/
|
|
1207
|
+
private getRootTypeForOperation(
|
|
1208
|
+
operationType: 'query' | 'mutation' | 'subscription',
|
|
1209
|
+
schemaInfo: GraphQLSchemaInfo
|
|
1210
|
+
): string | null {
|
|
1211
|
+
switch (operationType) {
|
|
1212
|
+
case 'query':
|
|
1213
|
+
return schemaInfo.queryType;
|
|
1214
|
+
case 'mutation':
|
|
1215
|
+
return schemaInfo.mutationType;
|
|
1216
|
+
case 'subscription':
|
|
1217
|
+
return schemaInfo.subscriptionType;
|
|
1218
|
+
default:
|
|
1219
|
+
return null;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* Unwrap GraphQL type (remove [], !)
|
|
1225
|
+
*/
|
|
1226
|
+
private unwrapGraphQLType(type: string): string {
|
|
1227
|
+
return type.replace(/[\[\]!]/g, '').trim();
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* Validate nested field selections
|
|
1232
|
+
*/
|
|
1233
|
+
private validateGraphQLSelections(
|
|
1234
|
+
selections: GraphQLField[],
|
|
1235
|
+
typeName: string,
|
|
1236
|
+
schemaInfo: GraphQLSchemaInfo,
|
|
1237
|
+
path: string,
|
|
1238
|
+
errors: SchemaError[]
|
|
1239
|
+
): void {
|
|
1240
|
+
const typeDef = schemaInfo.types[typeName];
|
|
1241
|
+
if (!typeDef) {
|
|
1242
|
+
// Could be a scalar type, skip validation
|
|
1243
|
+
if (['String', 'Int', 'Float', 'Boolean', 'ID'].includes(typeName)) {
|
|
1244
|
+
if (selections.length > 0) {
|
|
1245
|
+
errors.push({
|
|
1246
|
+
path,
|
|
1247
|
+
keyword: 'selection',
|
|
1248
|
+
message: `Cannot select fields on scalar type '${typeName}'`,
|
|
1249
|
+
params: { type: typeName },
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
for (const selection of selections) {
|
|
1257
|
+
const fieldDef = typeDef.fields[selection.name];
|
|
1258
|
+
if (!fieldDef) {
|
|
1259
|
+
errors.push({
|
|
1260
|
+
path: `${path}.${selection.name}`,
|
|
1261
|
+
keyword: 'field',
|
|
1262
|
+
message: `Field '${selection.name}' does not exist on type '${typeName}'`,
|
|
1263
|
+
params: { field: selection.name, type: typeName },
|
|
1264
|
+
});
|
|
1265
|
+
} else if (selection.selections && selection.selections.length > 0) {
|
|
1266
|
+
const nestedType = this.unwrapGraphQLType(fieldDef.type);
|
|
1267
|
+
this.validateGraphQLSelections(
|
|
1268
|
+
selection.selections,
|
|
1269
|
+
nestedType,
|
|
1270
|
+
schemaInfo,
|
|
1271
|
+
`${path}.${selection.name}`,
|
|
1272
|
+
errors
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Validate variable type matches expected GraphQL type
|
|
1280
|
+
*/
|
|
1281
|
+
private validateGraphQLVariableType(
|
|
1282
|
+
value: unknown,
|
|
1283
|
+
expectedType: string,
|
|
1284
|
+
path: string,
|
|
1285
|
+
errors: SchemaError[]
|
|
1286
|
+
): void {
|
|
1287
|
+
const baseType = this.unwrapGraphQLType(expectedType);
|
|
1288
|
+
const isNonNull = expectedType.endsWith('!');
|
|
1289
|
+
const isList = expectedType.includes('[');
|
|
1290
|
+
|
|
1291
|
+
if (value === null || value === undefined) {
|
|
1292
|
+
if (isNonNull) {
|
|
1293
|
+
errors.push({
|
|
1294
|
+
path,
|
|
1295
|
+
keyword: 'type',
|
|
1296
|
+
message: `Variable cannot be null (expected ${expectedType})`,
|
|
1297
|
+
params: { expectedType },
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
if (isList) {
|
|
1304
|
+
if (!Array.isArray(value)) {
|
|
1305
|
+
errors.push({
|
|
1306
|
+
path,
|
|
1307
|
+
keyword: 'type',
|
|
1308
|
+
message: `Expected array for type ${expectedType}`,
|
|
1309
|
+
params: { expectedType, actualType: typeof value },
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// Validate scalar types
|
|
1316
|
+
switch (baseType) {
|
|
1317
|
+
case 'String':
|
|
1318
|
+
case 'ID':
|
|
1319
|
+
if (typeof value !== 'string') {
|
|
1320
|
+
errors.push({
|
|
1321
|
+
path,
|
|
1322
|
+
keyword: 'type',
|
|
1323
|
+
message: `Expected string for type ${baseType}`,
|
|
1324
|
+
params: { expectedType: baseType, actualType: typeof value },
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
break;
|
|
1328
|
+
case 'Int':
|
|
1329
|
+
if (typeof value !== 'number' || !Number.isInteger(value)) {
|
|
1330
|
+
errors.push({
|
|
1331
|
+
path,
|
|
1332
|
+
keyword: 'type',
|
|
1333
|
+
message: `Expected integer for type Int`,
|
|
1334
|
+
params: { expectedType: 'Int', actualType: typeof value },
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
break;
|
|
1338
|
+
case 'Float':
|
|
1339
|
+
if (typeof value !== 'number') {
|
|
1340
|
+
errors.push({
|
|
1341
|
+
path,
|
|
1342
|
+
keyword: 'type',
|
|
1343
|
+
message: `Expected number for type Float`,
|
|
1344
|
+
params: { expectedType: 'Float', actualType: typeof value },
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
break;
|
|
1348
|
+
case 'Boolean':
|
|
1349
|
+
if (typeof value !== 'boolean') {
|
|
1350
|
+
errors.push({
|
|
1351
|
+
path,
|
|
1352
|
+
keyword: 'type',
|
|
1353
|
+
message: `Expected boolean for type Boolean`,
|
|
1354
|
+
params: { expectedType: 'Boolean', actualType: typeof value },
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
break;
|
|
1358
|
+
// Custom types - basic object validation
|
|
1359
|
+
default:
|
|
1360
|
+
if (typeof value !== 'object') {
|
|
1361
|
+
errors.push({
|
|
1362
|
+
path,
|
|
1363
|
+
keyword: 'type',
|
|
1364
|
+
message: `Expected object for type ${baseType}`,
|
|
1365
|
+
params: { expectedType: baseType, actualType: typeof value },
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
private basicTypeValidation(
|
|
1372
|
+
data: unknown,
|
|
1373
|
+
schema: Record<string, unknown>,
|
|
1374
|
+
path: string,
|
|
1375
|
+
errors: SchemaError[],
|
|
1376
|
+
depth: number = 0
|
|
1377
|
+
): void {
|
|
1378
|
+
if (depth > this.config.maxSchemaDepth) {
|
|
1379
|
+
errors.push({
|
|
1380
|
+
path,
|
|
1381
|
+
keyword: 'maxDepth',
|
|
1382
|
+
message: 'Maximum schema depth exceeded',
|
|
1383
|
+
params: { maxDepth: this.config.maxSchemaDepth },
|
|
1384
|
+
});
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
const type = schema.type as string | undefined;
|
|
1389
|
+
if (!type) return;
|
|
1390
|
+
|
|
1391
|
+
const actualType = this.getJsonType(data);
|
|
1392
|
+
|
|
1393
|
+
if (type === 'object' && actualType === 'object') {
|
|
1394
|
+
const properties = (schema.properties as Record<string, unknown>) || {};
|
|
1395
|
+
const required = (schema.required as string[]) || [];
|
|
1396
|
+
const dataObj = data as Record<string, unknown>;
|
|
1397
|
+
|
|
1398
|
+
// Check required properties
|
|
1399
|
+
for (const prop of required) {
|
|
1400
|
+
if (!(prop in dataObj)) {
|
|
1401
|
+
errors.push({
|
|
1402
|
+
path: path ? `${path}.${prop}` : prop,
|
|
1403
|
+
keyword: 'required',
|
|
1404
|
+
message: `Required property '${prop}' is missing`,
|
|
1405
|
+
params: { missingProperty: prop },
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
// Validate each property
|
|
1411
|
+
for (const [prop, propSchema] of Object.entries(properties)) {
|
|
1412
|
+
if (prop in dataObj) {
|
|
1413
|
+
this.basicTypeValidation(
|
|
1414
|
+
dataObj[prop],
|
|
1415
|
+
propSchema as Record<string, unknown>,
|
|
1416
|
+
path ? `${path}.${prop}` : prop,
|
|
1417
|
+
errors,
|
|
1418
|
+
depth + 1
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
} else if (type === 'array' && actualType === 'array') {
|
|
1423
|
+
const items = schema.items as Record<string, unknown> | undefined;
|
|
1424
|
+
const dataArr = data as unknown[];
|
|
1425
|
+
|
|
1426
|
+
// Validate array constraints
|
|
1427
|
+
this.validateArrayConstraints(dataArr, schema, path, errors);
|
|
1428
|
+
|
|
1429
|
+
// Validate each item
|
|
1430
|
+
if (items) {
|
|
1431
|
+
for (let i = 0; i < dataArr.length; i++) {
|
|
1432
|
+
this.basicTypeValidation(
|
|
1433
|
+
dataArr[i],
|
|
1434
|
+
items,
|
|
1435
|
+
`${path}[${i}]`,
|
|
1436
|
+
errors,
|
|
1437
|
+
depth + 1
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
} else if (type === 'string' && actualType === 'string') {
|
|
1442
|
+
// Validate string constraints
|
|
1443
|
+
this.validateStringConstraints(data as string, schema, path, errors);
|
|
1444
|
+
} else if ((type === 'number' || type === 'integer') && (actualType === 'number' || actualType === 'integer')) {
|
|
1445
|
+
// Validate number constraints
|
|
1446
|
+
this.validateNumberConstraints(data as number, schema, path, errors);
|
|
1447
|
+
} else if (type !== actualType) {
|
|
1448
|
+
// Allow integer as number
|
|
1449
|
+
if (!(type === 'number' && actualType === 'integer')) {
|
|
1450
|
+
errors.push({
|
|
1451
|
+
path,
|
|
1452
|
+
keyword: 'type',
|
|
1453
|
+
message: `Expected type '${type}' but got '${actualType}'`,
|
|
1454
|
+
params: { expectedType: type, actualType },
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
// Check enum constraint (applies to any type)
|
|
1460
|
+
if (schema.enum) {
|
|
1461
|
+
const enumValues = schema.enum as unknown[];
|
|
1462
|
+
if (!enumValues.some((v) => JSON.stringify(v) === JSON.stringify(data))) {
|
|
1463
|
+
errors.push({
|
|
1464
|
+
path,
|
|
1465
|
+
keyword: 'enum',
|
|
1466
|
+
message: `Value must be one of: ${enumValues.map((v) => JSON.stringify(v)).join(', ')}`,
|
|
1467
|
+
params: { allowedValues: enumValues },
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
private validateStringConstraints(
|
|
1474
|
+
data: string,
|
|
1475
|
+
schema: Record<string, unknown>,
|
|
1476
|
+
path: string,
|
|
1477
|
+
errors: SchemaError[]
|
|
1478
|
+
): void {
|
|
1479
|
+
const minLength = schema.minLength as number | undefined;
|
|
1480
|
+
const maxLength = schema.maxLength as number | undefined;
|
|
1481
|
+
const pattern = schema.pattern as string | undefined;
|
|
1482
|
+
|
|
1483
|
+
if (minLength !== undefined && data.length < minLength) {
|
|
1484
|
+
errors.push({
|
|
1485
|
+
path,
|
|
1486
|
+
keyword: 'minLength',
|
|
1487
|
+
message: `String must be at least ${minLength} characters`,
|
|
1488
|
+
params: { limit: minLength, actual: data.length },
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
if (maxLength !== undefined && data.length > maxLength) {
|
|
1493
|
+
errors.push({
|
|
1494
|
+
path,
|
|
1495
|
+
keyword: 'maxLength',
|
|
1496
|
+
message: `String must be at most ${maxLength} characters`,
|
|
1497
|
+
params: { limit: maxLength, actual: data.length },
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (pattern) {
|
|
1502
|
+
try {
|
|
1503
|
+
const regex = new RegExp(pattern);
|
|
1504
|
+
if (!regex.test(data)) {
|
|
1505
|
+
errors.push({
|
|
1506
|
+
path,
|
|
1507
|
+
keyword: 'pattern',
|
|
1508
|
+
message: `String must match pattern: ${pattern}`,
|
|
1509
|
+
params: { pattern },
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
} catch {
|
|
1513
|
+
// Invalid regex pattern, skip validation
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
private validateNumberConstraints(
|
|
1519
|
+
data: number,
|
|
1520
|
+
schema: Record<string, unknown>,
|
|
1521
|
+
path: string,
|
|
1522
|
+
errors: SchemaError[]
|
|
1523
|
+
): void {
|
|
1524
|
+
const minimum = schema.minimum as number | undefined;
|
|
1525
|
+
const maximum = schema.maximum as number | undefined;
|
|
1526
|
+
const exclusiveMinimum = schema.exclusiveMinimum as number | undefined;
|
|
1527
|
+
const exclusiveMaximum = schema.exclusiveMaximum as number | undefined;
|
|
1528
|
+
const multipleOf = schema.multipleOf as number | undefined;
|
|
1529
|
+
|
|
1530
|
+
if (minimum !== undefined && data < minimum) {
|
|
1531
|
+
errors.push({
|
|
1532
|
+
path,
|
|
1533
|
+
keyword: 'minimum',
|
|
1534
|
+
message: `Number must be >= ${minimum}`,
|
|
1535
|
+
params: { limit: minimum, actual: data },
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
if (maximum !== undefined && data > maximum) {
|
|
1540
|
+
errors.push({
|
|
1541
|
+
path,
|
|
1542
|
+
keyword: 'maximum',
|
|
1543
|
+
message: `Number must be <= ${maximum}`,
|
|
1544
|
+
params: { limit: maximum, actual: data },
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (exclusiveMinimum !== undefined && data <= exclusiveMinimum) {
|
|
1549
|
+
errors.push({
|
|
1550
|
+
path,
|
|
1551
|
+
keyword: 'exclusiveMinimum',
|
|
1552
|
+
message: `Number must be > ${exclusiveMinimum}`,
|
|
1553
|
+
params: { limit: exclusiveMinimum, actual: data },
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
if (exclusiveMaximum !== undefined && data >= exclusiveMaximum) {
|
|
1558
|
+
errors.push({
|
|
1559
|
+
path,
|
|
1560
|
+
keyword: 'exclusiveMaximum',
|
|
1561
|
+
message: `Number must be < ${exclusiveMaximum}`,
|
|
1562
|
+
params: { limit: exclusiveMaximum, actual: data },
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
if (multipleOf !== undefined && data % multipleOf !== 0) {
|
|
1567
|
+
errors.push({
|
|
1568
|
+
path,
|
|
1569
|
+
keyword: 'multipleOf',
|
|
1570
|
+
message: `Number must be a multiple of ${multipleOf}`,
|
|
1571
|
+
params: { multipleOf, actual: data },
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
private validateArrayConstraints(
|
|
1577
|
+
data: unknown[],
|
|
1578
|
+
schema: Record<string, unknown>,
|
|
1579
|
+
path: string,
|
|
1580
|
+
errors: SchemaError[]
|
|
1581
|
+
): void {
|
|
1582
|
+
const minItems = schema.minItems as number | undefined;
|
|
1583
|
+
const maxItems = schema.maxItems as number | undefined;
|
|
1584
|
+
const uniqueItems = schema.uniqueItems as boolean | undefined;
|
|
1585
|
+
|
|
1586
|
+
if (minItems !== undefined && data.length < minItems) {
|
|
1587
|
+
errors.push({
|
|
1588
|
+
path,
|
|
1589
|
+
keyword: 'minItems',
|
|
1590
|
+
message: `Array must have at least ${minItems} items`,
|
|
1591
|
+
params: { limit: minItems, actual: data.length },
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
if (maxItems !== undefined && data.length > maxItems) {
|
|
1596
|
+
errors.push({
|
|
1597
|
+
path,
|
|
1598
|
+
keyword: 'maxItems',
|
|
1599
|
+
message: `Array must have at most ${maxItems} items`,
|
|
1600
|
+
params: { limit: maxItems, actual: data.length },
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
if (uniqueItems) {
|
|
1605
|
+
const seen = new Set<string>();
|
|
1606
|
+
for (let i = 0; i < data.length; i++) {
|
|
1607
|
+
const serialized = JSON.stringify(data[i]);
|
|
1608
|
+
if (seen.has(serialized)) {
|
|
1609
|
+
errors.push({
|
|
1610
|
+
path: `${path}[${i}]`,
|
|
1611
|
+
keyword: 'uniqueItems',
|
|
1612
|
+
message: 'Array items must be unique',
|
|
1613
|
+
params: { duplicateIndex: i },
|
|
1614
|
+
});
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
seen.add(serialized);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
private getJsonType(value: unknown): string {
|
|
1623
|
+
if (value === null) return 'null';
|
|
1624
|
+
if (Array.isArray(value)) return 'array';
|
|
1625
|
+
if (typeof value === 'number') {
|
|
1626
|
+
return Number.isInteger(value) ? 'integer' : 'number';
|
|
1627
|
+
}
|
|
1628
|
+
return typeof value;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
private validateOpenAPI3Structure(
|
|
1632
|
+
spec: Record<string, unknown>,
|
|
1633
|
+
errors: ValidationError[],
|
|
1634
|
+
warnings: string[]
|
|
1635
|
+
): void {
|
|
1636
|
+
// Required fields for OpenAPI 3.x
|
|
1637
|
+
if (!spec.info) {
|
|
1638
|
+
errors.push({
|
|
1639
|
+
path: 'info',
|
|
1640
|
+
message: 'OpenAPI 3.x requires info object',
|
|
1641
|
+
code: 'REQUIRED_FIELD',
|
|
1642
|
+
});
|
|
1643
|
+
} else {
|
|
1644
|
+
const info = spec.info as Record<string, unknown>;
|
|
1645
|
+
if (!info.title) {
|
|
1646
|
+
errors.push({
|
|
1647
|
+
path: 'info.title',
|
|
1648
|
+
message: 'API title is required',
|
|
1649
|
+
code: 'REQUIRED_FIELD',
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
if (!info.version) {
|
|
1653
|
+
errors.push({
|
|
1654
|
+
path: 'info.version',
|
|
1655
|
+
message: 'API version is required',
|
|
1656
|
+
code: 'REQUIRED_FIELD',
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
if (!spec.paths) {
|
|
1662
|
+
warnings.push('No paths defined in OpenAPI specification');
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
private validateSwagger2Structure(
|
|
1667
|
+
spec: Record<string, unknown>,
|
|
1668
|
+
errors: ValidationError[],
|
|
1669
|
+
warnings: string[]
|
|
1670
|
+
): void {
|
|
1671
|
+
// Required fields for Swagger 2
|
|
1672
|
+
if (!spec.info) {
|
|
1673
|
+
errors.push({
|
|
1674
|
+
path: 'info',
|
|
1675
|
+
message: 'Swagger 2 requires info object',
|
|
1676
|
+
code: 'REQUIRED_FIELD',
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
if (!spec.paths) {
|
|
1681
|
+
warnings.push('No paths defined in Swagger specification');
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
// Swagger 2 requires host or basePath for some operations
|
|
1685
|
+
if (!spec.host && !spec.basePath) {
|
|
1686
|
+
warnings.push('No host or basePath defined in Swagger specification');
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
private async storeValidationHistory(
|
|
1691
|
+
contractId: string,
|
|
1692
|
+
report: ValidationReport
|
|
1693
|
+
): Promise<void> {
|
|
1694
|
+
const historyKey = `contract-testing:validation:${contractId}:${Date.now()}`;
|
|
1695
|
+
await this.memory.set(historyKey, report, {
|
|
1696
|
+
namespace: 'contract-testing',
|
|
1697
|
+
ttl: 86400 * 30, // 30 days
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
}
|