agentic-qe 3.2.3 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/v3/qe-accessibility-auditor.md +90 -0
- package/README.md +49 -7
- package/package.json +8 -2
- package/scripts/cloud-db-config.json +37 -0
- package/scripts/cloud-db-connect.sh +37 -0
- package/scripts/cloud-db-tunnel.sh +23 -0
- package/v3/CHANGELOG.md +253 -0
- package/v3/README.md +59 -1
- package/v3/assets/agents/v3/qe-accessibility-auditor.md +90 -0
- package/v3/dist/adapters/claude-flow/index.d.ts +54 -0
- package/v3/dist/adapters/claude-flow/index.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/index.js +79 -0
- package/v3/dist/adapters/claude-flow/index.js.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js +203 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts +73 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js +276 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js +205 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/types.d.ts +99 -0
- package/v3/dist/adapters/claude-flow/types.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/types.js +6 -0
- package/v3/dist/adapters/claude-flow/types.js.map +1 -0
- package/v3/dist/causal-discovery/causal-graph.d.ts +80 -1
- package/v3/dist/causal-discovery/causal-graph.d.ts.map +1 -1
- package/v3/dist/causal-discovery/causal-graph.js +111 -1
- package/v3/dist/causal-discovery/causal-graph.js.map +1 -1
- package/v3/dist/cli/bundle.js +25321 -15378
- package/v3/dist/cli/command-registry.d.ts +55 -0
- package/v3/dist/cli/command-registry.d.ts.map +1 -0
- package/v3/dist/cli/command-registry.js +103 -0
- package/v3/dist/cli/command-registry.js.map +1 -0
- package/v3/dist/cli/commands/claude-flow-setup.d.ts +82 -0
- package/v3/dist/cli/commands/claude-flow-setup.d.ts.map +1 -0
- package/v3/dist/cli/commands/claude-flow-setup.js +334 -0
- package/v3/dist/cli/commands/claude-flow-setup.js.map +1 -0
- package/v3/dist/cli/commands/code.d.ts +9 -0
- package/v3/dist/cli/commands/code.d.ts.map +1 -0
- package/v3/dist/cli/commands/code.js +254 -0
- package/v3/dist/cli/commands/code.js.map +1 -0
- package/v3/dist/cli/commands/completions.d.ts +8 -0
- package/v3/dist/cli/commands/completions.d.ts.map +1 -0
- package/v3/dist/cli/commands/completions.js +99 -0
- package/v3/dist/cli/commands/completions.js.map +1 -0
- package/v3/dist/cli/commands/coverage.d.ts +9 -0
- package/v3/dist/cli/commands/coverage.d.ts.map +1 -0
- package/v3/dist/cli/commands/coverage.js +208 -0
- package/v3/dist/cli/commands/coverage.js.map +1 -0
- package/v3/dist/cli/commands/fleet.d.ts +11 -0
- package/v3/dist/cli/commands/fleet.d.ts.map +1 -0
- package/v3/dist/cli/commands/fleet.js +338 -0
- package/v3/dist/cli/commands/fleet.js.map +1 -0
- package/v3/dist/cli/commands/hooks.d.ts +2 -0
- package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
- package/v3/dist/cli/commands/hooks.js +13 -2
- package/v3/dist/cli/commands/hooks.js.map +1 -1
- package/v3/dist/cli/commands/init.d.ts +19 -0
- package/v3/dist/cli/commands/init.d.ts.map +1 -0
- package/v3/dist/cli/commands/init.js +345 -0
- package/v3/dist/cli/commands/init.js.map +1 -0
- package/v3/dist/cli/commands/migrate.d.ts +9 -0
- package/v3/dist/cli/commands/migrate.d.ts.map +1 -0
- package/v3/dist/cli/commands/migrate.js +566 -0
- package/v3/dist/cli/commands/migrate.js.map +1 -0
- package/v3/dist/cli/commands/quality.d.ts +9 -0
- package/v3/dist/cli/commands/quality.d.ts.map +1 -0
- package/v3/dist/cli/commands/quality.js +40 -0
- package/v3/dist/cli/commands/quality.js.map +1 -0
- package/v3/dist/cli/commands/security.d.ts +9 -0
- package/v3/dist/cli/commands/security.d.ts.map +1 -0
- package/v3/dist/cli/commands/security.js +124 -0
- package/v3/dist/cli/commands/security.js.map +1 -0
- package/v3/dist/cli/commands/sync.d.ts +19 -0
- package/v3/dist/cli/commands/sync.d.ts.map +1 -0
- package/v3/dist/cli/commands/sync.js +283 -0
- package/v3/dist/cli/commands/sync.js.map +1 -0
- package/v3/dist/cli/commands/test.d.ts +9 -0
- package/v3/dist/cli/commands/test.d.ts.map +1 -0
- package/v3/dist/cli/commands/test.js +166 -0
- package/v3/dist/cli/commands/test.js.map +1 -0
- package/v3/dist/cli/handlers/agent-handler.d.ts +20 -0
- package/v3/dist/cli/handlers/agent-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/agent-handler.js +158 -0
- package/v3/dist/cli/handlers/agent-handler.js.map +1 -0
- package/v3/dist/cli/handlers/domain-handler.d.ts +20 -0
- package/v3/dist/cli/handlers/domain-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/domain-handler.js +115 -0
- package/v3/dist/cli/handlers/domain-handler.js.map +1 -0
- package/v3/dist/cli/handlers/index.d.ts +13 -0
- package/v3/dist/cli/handlers/index.d.ts.map +1 -0
- package/v3/dist/cli/handlers/index.js +15 -0
- package/v3/dist/cli/handlers/index.js.map +1 -0
- package/v3/dist/cli/handlers/init-handler.d.ts +38 -0
- package/v3/dist/cli/handlers/init-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/init-handler.js +288 -0
- package/v3/dist/cli/handlers/init-handler.js.map +1 -0
- package/v3/dist/cli/handlers/interfaces.d.ts +104 -0
- package/v3/dist/cli/handlers/interfaces.d.ts.map +1 -0
- package/v3/dist/cli/handlers/interfaces.js +109 -0
- package/v3/dist/cli/handlers/interfaces.js.map +1 -0
- package/v3/dist/cli/handlers/protocol-handler.d.ts +19 -0
- package/v3/dist/cli/handlers/protocol-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/protocol-handler.js +79 -0
- package/v3/dist/cli/handlers/protocol-handler.js.map +1 -0
- package/v3/dist/cli/handlers/status-handler.d.ts +30 -0
- package/v3/dist/cli/handlers/status-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/status-handler.js +218 -0
- package/v3/dist/cli/handlers/status-handler.js.map +1 -0
- package/v3/dist/cli/handlers/task-handler.d.ts +22 -0
- package/v3/dist/cli/handlers/task-handler.d.ts.map +1 -0
- package/v3/dist/cli/handlers/task-handler.js +271 -0
- package/v3/dist/cli/handlers/task-handler.js.map +1 -0
- package/v3/dist/cli/index.d.ts +4 -0
- package/v3/dist/cli/index.d.ts.map +1 -1
- package/v3/dist/cli/index.js +62 -2583
- package/v3/dist/cli/index.js.map +1 -1
- package/v3/dist/cli/wizards/core/index.d.ts +11 -0
- package/v3/dist/cli/wizards/core/index.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/index.js +15 -0
- package/v3/dist/cli/wizards/core/index.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-base.d.ts +87 -0
- package/v3/dist/cli/wizards/core/wizard-base.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-base.js +120 -0
- package/v3/dist/cli/wizards/core/wizard-base.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-command.d.ts +182 -0
- package/v3/dist/cli/wizards/core/wizard-command.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-command.js +45 -0
- package/v3/dist/cli/wizards/core/wizard-command.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-step.d.ts +109 -0
- package/v3/dist/cli/wizards/core/wizard-step.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-step.js +384 -0
- package/v3/dist/cli/wizards/core/wizard-step.js.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-utils.d.ts +117 -0
- package/v3/dist/cli/wizards/core/wizard-utils.d.ts.map +1 -0
- package/v3/dist/cli/wizards/core/wizard-utils.js +291 -0
- package/v3/dist/cli/wizards/core/wizard-utils.js.map +1 -0
- package/v3/dist/cli/wizards/coverage-wizard.d.ts +13 -68
- package/v3/dist/cli/wizards/coverage-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/coverage-wizard.js +127 -391
- package/v3/dist/cli/wizards/coverage-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/fleet-wizard.d.ts +13 -64
- package/v3/dist/cli/wizards/fleet-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/fleet-wizard.js +150 -363
- package/v3/dist/cli/wizards/fleet-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/index.d.ts +2 -0
- package/v3/dist/cli/wizards/index.d.ts.map +1 -1
- package/v3/dist/cli/wizards/index.js +3 -0
- package/v3/dist/cli/wizards/index.js.map +1 -1
- package/v3/dist/cli/wizards/security-wizard.d.ts +13 -64
- package/v3/dist/cli/wizards/security-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/security-wizard.js +152 -395
- package/v3/dist/cli/wizards/security-wizard.js.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.d.ts +13 -77
- package/v3/dist/cli/wizards/test-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.js +196 -328
- package/v3/dist/cli/wizards/test-wizard.js.map +1 -1
- package/v3/dist/coordination/mincut/interfaces.d.ts +8 -2
- package/v3/dist/coordination/mincut/interfaces.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/interfaces.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts +8 -0
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.js +26 -4
- package/v3/dist/coordination/mincut/mincut-health-monitor.js.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.d.ts +7 -0
- package/v3/dist/coordination/mincut/queen-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.js +19 -1
- package/v3/dist/coordination/mincut/queen-integration.js.map +1 -1
- package/v3/dist/coordination/queen-coordinator.d.ts +5 -0
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +45 -7
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/coordination/task-executor.js +2 -2
- package/v3/dist/coordination/task-executor.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.js +2 -2
- package/v3/dist/domains/chaos-resilience/plugin.js.map +1 -1
- package/v3/dist/domains/code-intelligence/plugin.js +2 -2
- package/v3/dist/domains/code-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/contract-testing/plugin.js +2 -2
- package/v3/dist/domains/contract-testing/plugin.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.js +2 -1
- package/v3/dist/domains/coverage-analysis/plugin.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/plugin.js +2 -2
- package/v3/dist/domains/defect-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/domain-interface.d.ts.map +1 -1
- package/v3/dist/domains/domain-interface.js +3 -1
- package/v3/dist/domains/domain-interface.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +5 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +79 -0
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/plugin.js +2 -2
- package/v3/dist/domains/learning-optimization/plugin.js.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.js +2 -2
- package/v3/dist/domains/quality-assessment/plugin.js.map +1 -1
- package/v3/dist/domains/requirements-validation/plugin.js +2 -2
- package/v3/dist/domains/requirements-validation/plugin.js.map +1 -1
- package/v3/dist/domains/security-compliance/plugin.js +2 -2
- package/v3/dist/domains/security-compliance/plugin.js.map +1 -1
- package/v3/dist/domains/test-execution/index.d.ts +2 -1
- package/v3/dist/domains/test-execution/index.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/index.js +0 -2
- package/v3/dist/domains/test-execution/index.js.map +1 -1
- package/v3/dist/domains/test-execution/interfaces.d.ts +222 -25
- package/v3/dist/domains/test-execution/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/interfaces.js +130 -3
- package/v3/dist/domains/test-execution/interfaces.js.map +1 -1
- package/v3/dist/domains/test-execution/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/plugin.js +2 -1
- package/v3/dist/domains/test-execution/plugin.js.map +1 -1
- package/v3/dist/domains/test-execution/test-prioritization-types.d.ts +5 -172
- package/v3/dist/domains/test-execution/test-prioritization-types.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/test-prioritization-types.js +6 -129
- package/v3/dist/domains/test-execution/test-prioritization-types.js.map +1 -1
- package/v3/dist/domains/test-execution/types/index.d.ts +7 -3
- package/v3/dist/domains/test-execution/types/index.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/types/index.js +7 -17
- package/v3/dist/domains/test-execution/types/index.js.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts +32 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +72 -3
- package/v3/dist/domains/test-generation/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/factories/index.d.ts +8 -0
- package/v3/dist/domains/test-generation/factories/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/factories/index.js +8 -0
- package/v3/dist/domains/test-generation/factories/index.js.map +1 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.d.ts +108 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.js +158 -0
- package/v3/dist/domains/test-generation/factories/test-generator-factory.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts +79 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.js +252 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/index.d.ts +11 -0
- package/v3/dist/domains/test-generation/generators/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/index.js +13 -0
- package/v3/dist/domains/test-generation/generators/index.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.d.ts +77 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js +365 -0
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts +56 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.js +197 -0
- package/v3/dist/domains/test-generation/generators/mocha-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts +66 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.js +240 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/index.d.ts +2 -1
- package/v3/dist/domains/test-generation/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/index.js +5 -1
- package/v3/dist/domains/test-generation/index.js.map +1 -1
- package/v3/dist/domains/test-generation/interfaces/index.d.ts +9 -0
- package/v3/dist/domains/test-generation/interfaces/index.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/index.js +9 -0
- package/v3/dist/domains/test-generation/interfaces/index.js.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.d.ts +166 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.js +8 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.js.map +1 -0
- package/v3/dist/domains/test-generation/interfaces.d.ts +163 -24
- package/v3/dist/domains/test-generation/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/interfaces.js +2 -2
- package/v3/dist/domains/test-generation/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/plugin.js +6 -5
- package/v3/dist/domains/test-generation/plugin.js.map +1 -1
- package/v3/dist/domains/test-generation/services/coherence-gate-service.d.ts +245 -0
- package/v3/dist/domains/test-generation/services/coherence-gate-service.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/coherence-gate-service.js +454 -0
- package/v3/dist/domains/test-generation/services/coherence-gate-service.js.map +1 -0
- package/v3/dist/domains/test-generation/services/index.d.ts +8 -1
- package/v3/dist/domains/test-generation/services/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/index.js +10 -1
- package/v3/dist/domains/test-generation/services/index.js.map +1 -1
- package/v3/dist/domains/test-generation/services/property-test-generator.d.ts +34 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.js +306 -0
- package/v3/dist/domains/test-generation/services/property-test-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.d.ts +33 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.js +342 -0
- package/v3/dist/domains/test-generation/services/tdd-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts +34 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.js +245 -0
- package/v3/dist/domains/test-generation/services/test-data-generator.js.map +1 -0
- package/v3/dist/domains/test-generation/services/test-generator.d.ts +51 -160
- package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.js +101 -1858
- package/v3/dist/domains/test-generation/services/test-generator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/index.d.ts +2 -1
- package/v3/dist/domains/visual-accessibility/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/index.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts +131 -0
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.d.ts +26 -0
- package/v3/dist/domains/visual-accessibility/plugin.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +153 -2
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +42 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js +69 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts +138 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js +830 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.js.map +1 -1
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts +84 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts.map +1 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js +250 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js.map +1 -0
- package/v3/dist/init/enhancements/detector.d.ts +10 -0
- package/v3/dist/init/enhancements/detector.d.ts.map +1 -0
- package/v3/dist/init/enhancements/detector.js +87 -0
- package/v3/dist/init/enhancements/detector.js.map +1 -0
- package/v3/dist/init/enhancements/index.d.ts +13 -0
- package/v3/dist/init/enhancements/index.d.ts.map +1 -0
- package/v3/dist/init/enhancements/index.js +25 -0
- package/v3/dist/init/enhancements/index.js.map +1 -0
- package/v3/dist/init/enhancements/types.d.ts +93 -0
- package/v3/dist/init/enhancements/types.d.ts.map +1 -0
- package/v3/dist/init/enhancements/types.js +6 -0
- package/v3/dist/init/enhancements/types.js.map +1 -0
- package/v3/dist/init/index.d.ts +8 -0
- package/v3/dist/init/index.d.ts.map +1 -1
- package/v3/dist/init/index.js +4 -0
- package/v3/dist/init/index.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts +31 -0
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/config-migrator.js +133 -0
- package/v3/dist/init/migration/config-migrator.js.map +1 -0
- package/v3/dist/init/migration/data-migrator.d.ts +72 -0
- package/v3/dist/init/migration/data-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/data-migrator.js +233 -0
- package/v3/dist/init/migration/data-migrator.js.map +1 -0
- package/v3/dist/init/migration/detector.d.ts +44 -0
- package/v3/dist/init/migration/detector.d.ts.map +1 -0
- package/v3/dist/init/migration/detector.js +106 -0
- package/v3/dist/init/migration/detector.js.map +1 -0
- package/v3/dist/init/migration/index.d.ts +8 -0
- package/v3/dist/init/migration/index.d.ts.map +1 -0
- package/v3/dist/init/migration/index.js +8 -0
- package/v3/dist/init/migration/index.js.map +1 -0
- package/v3/dist/init/orchestrator.d.ts +68 -0
- package/v3/dist/init/orchestrator.d.ts.map +1 -0
- package/v3/dist/init/orchestrator.js +239 -0
- package/v3/dist/init/orchestrator.js.map +1 -0
- package/v3/dist/init/phases/01-detection.d.ts +30 -0
- package/v3/dist/init/phases/01-detection.d.ts.map +1 -0
- package/v3/dist/init/phases/01-detection.js +143 -0
- package/v3/dist/init/phases/01-detection.js.map +1 -0
- package/v3/dist/init/phases/02-analysis.d.ts +18 -0
- package/v3/dist/init/phases/02-analysis.d.ts.map +1 -0
- package/v3/dist/init/phases/02-analysis.js +28 -0
- package/v3/dist/init/phases/02-analysis.js.map +1 -0
- package/v3/dist/init/phases/03-configuration.d.ts +26 -0
- package/v3/dist/init/phases/03-configuration.d.ts.map +1 -0
- package/v3/dist/init/phases/03-configuration.js +98 -0
- package/v3/dist/init/phases/03-configuration.js.map +1 -0
- package/v3/dist/init/phases/04-database.d.ts +22 -0
- package/v3/dist/init/phases/04-database.d.ts.map +1 -0
- package/v3/dist/init/phases/04-database.js +88 -0
- package/v3/dist/init/phases/04-database.js.map +1 -0
- package/v3/dist/init/phases/05-learning.d.ts +28 -0
- package/v3/dist/init/phases/05-learning.d.ts.map +1 -0
- package/v3/dist/init/phases/05-learning.js +98 -0
- package/v3/dist/init/phases/05-learning.js.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts +33 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.js +115 -0
- package/v3/dist/init/phases/06-code-intelligence.js.map +1 -0
- package/v3/dist/init/phases/07-hooks.d.ts +27 -0
- package/v3/dist/init/phases/07-hooks.d.ts.map +1 -0
- package/v3/dist/init/phases/07-hooks.js +209 -0
- package/v3/dist/init/phases/07-hooks.js.map +1 -0
- package/v3/dist/init/phases/08-mcp.d.ts +22 -0
- package/v3/dist/init/phases/08-mcp.d.ts.map +1 -0
- package/v3/dist/init/phases/08-mcp.js +62 -0
- package/v3/dist/init/phases/08-mcp.js.map +1 -0
- package/v3/dist/init/phases/09-assets.d.ts +23 -0
- package/v3/dist/init/phases/09-assets.d.ts.map +1 -0
- package/v3/dist/init/phases/09-assets.js +82 -0
- package/v3/dist/init/phases/09-assets.js.map +1 -0
- package/v3/dist/init/phases/10-workers.d.ts +23 -0
- package/v3/dist/init/phases/10-workers.d.ts.map +1 -0
- package/v3/dist/init/phases/10-workers.js +111 -0
- package/v3/dist/init/phases/10-workers.js.map +1 -0
- package/v3/dist/init/phases/11-claude-md.d.ts +26 -0
- package/v3/dist/init/phases/11-claude-md.d.ts.map +1 -0
- package/v3/dist/init/phases/11-claude-md.js +121 -0
- package/v3/dist/init/phases/11-claude-md.js.map +1 -0
- package/v3/dist/init/phases/12-verification.d.ts +61 -0
- package/v3/dist/init/phases/12-verification.d.ts.map +1 -0
- package/v3/dist/init/phases/12-verification.js +370 -0
- package/v3/dist/init/phases/12-verification.js.map +1 -0
- package/v3/dist/init/phases/index.d.ts +46 -0
- package/v3/dist/init/phases/index.d.ts.map +1 -0
- package/v3/dist/init/phases/index.js +64 -0
- package/v3/dist/init/phases/index.js.map +1 -0
- package/v3/dist/init/phases/phase-interface.d.ts +193 -0
- package/v3/dist/init/phases/phase-interface.d.ts.map +1 -0
- package/v3/dist/init/phases/phase-interface.js +119 -0
- package/v3/dist/init/phases/phase-interface.js.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.d.ts +24 -62
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.js +45 -497
- package/v3/dist/integrations/agentic-flow/model-router/complexity-analyzer.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/router.js +2 -2
- package/v3/dist/integrations/agentic-flow/model-router/router.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.d.ts +98 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.js +197 -0
- package/v3/dist/integrations/agentic-flow/model-router/score-calculator.js.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.d.ts +102 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.js +372 -0
- package/v3/dist/integrations/agentic-flow/model-router/signal-collector.js.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.d.ts +64 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.d.ts.map +1 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.js +120 -0
- package/v3/dist/integrations/agentic-flow/model-router/tier-recommender.js.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts +323 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.js +856 -0
- package/v3/dist/integrations/coherence/coherence-service.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts +170 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js +403 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts +159 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js +348 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts +174 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js +401 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts +201 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js +324 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts +20 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.js +26 -0
- package/v3/dist/integrations/coherence/engines/index.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts +193 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js +565 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts +175 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js +377 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/index.d.ts +84 -0
- package/v3/dist/integrations/coherence/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/index.js +114 -0
- package/v3/dist/integrations/coherence/index.js.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts +396 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js +538 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js.map +1 -0
- package/v3/dist/integrations/coherence/types.d.ts +879 -0
- package/v3/dist/integrations/coherence/types.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/types.js +134 -0
- package/v3/dist/integrations/coherence/types.js.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts +351 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.js +842 -0
- package/v3/dist/integrations/coherence/wasm-loader.js.map +1 -0
- package/v3/dist/integrations/embeddings/index/HNSWIndex.d.ts.map +1 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js +4 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +8 -1
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.d.ts +272 -0
- package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -0
- package/v3/dist/learning/aqe-learning-engine.js +708 -0
- package/v3/dist/learning/aqe-learning-engine.js.map +1 -0
- package/v3/dist/learning/causal-verifier.d.ts +244 -0
- package/v3/dist/learning/causal-verifier.d.ts.map +1 -0
- package/v3/dist/learning/causal-verifier.js +300 -0
- package/v3/dist/learning/causal-verifier.js.map +1 -0
- package/v3/dist/learning/experience-capture.d.ts +266 -0
- package/v3/dist/learning/experience-capture.d.ts.map +1 -0
- package/v3/dist/learning/experience-capture.js +647 -0
- package/v3/dist/learning/experience-capture.js.map +1 -0
- package/v3/dist/learning/index.d.ts +8 -0
- package/v3/dist/learning/index.d.ts.map +1 -1
- package/v3/dist/learning/index.js +16 -0
- package/v3/dist/learning/index.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts +235 -0
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -0
- package/v3/dist/learning/memory-auditor.js +480 -0
- package/v3/dist/learning/memory-auditor.js.map +1 -0
- package/v3/dist/learning/pattern-store.d.ts.map +1 -1
- package/v3/dist/learning/pattern-store.js +27 -6
- package/v3/dist/learning/pattern-store.js.map +1 -1
- package/v3/dist/learning/qe-patterns.d.ts +15 -1
- package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
- package/v3/dist/learning/qe-patterns.js +26 -5
- package/v3/dist/learning/qe-patterns.js.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.d.ts +38 -2
- package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.js +86 -4
- package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts +32 -2
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +61 -6
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/mcp/bundle.js +8786 -1737
- package/v3/dist/mcp/security/cve-prevention.d.ts +31 -134
- package/v3/dist/mcp/security/cve-prevention.d.ts.map +1 -1
- package/v3/dist/mcp/security/cve-prevention.js +37 -562
- package/v3/dist/mcp/security/cve-prevention.js.map +1 -1
- package/v3/dist/mcp/security/index.d.ts +5 -1
- package/v3/dist/mcp/security/index.d.ts.map +1 -1
- package/v3/dist/mcp/security/validators/command-validator.d.ts +41 -0
- package/v3/dist/mcp/security/validators/command-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/command-validator.js +123 -0
- package/v3/dist/mcp/security/validators/command-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/crypto-validator.d.ts +40 -0
- package/v3/dist/mcp/security/validators/crypto-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/crypto-validator.js +72 -0
- package/v3/dist/mcp/security/validators/crypto-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/index.d.ts +12 -0
- package/v3/dist/mcp/security/validators/index.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/index.js +22 -0
- package/v3/dist/mcp/security/validators/index.js.map +1 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.d.ts +56 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.js +157 -0
- package/v3/dist/mcp/security/validators/input-sanitizer.js.map +1 -0
- package/v3/dist/mcp/security/validators/interfaces.d.ts +164 -0
- package/v3/dist/mcp/security/validators/interfaces.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/interfaces.js +6 -0
- package/v3/dist/mcp/security/validators/interfaces.js.map +1 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.d.ts +50 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.js +242 -0
- package/v3/dist/mcp/security/validators/path-traversal-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.d.ts +50 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.js +183 -0
- package/v3/dist/mcp/security/validators/regex-safety-validator.js.map +1 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.d.ts +66 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.d.ts.map +1 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.js +146 -0
- package/v3/dist/mcp/security/validators/validation-orchestrator.js.map +1 -0
- package/v3/dist/mcp/server.d.ts.map +1 -1
- package/v3/dist/mcp/server.js +1 -0
- package/v3/dist/mcp/server.js.map +1 -1
- package/v3/dist/mcp/tool-registry.d.ts +3 -1
- package/v3/dist/mcp/tool-registry.d.ts.map +1 -1
- package/v3/dist/mcp/tool-registry.js +155 -2
- package/v3/dist/mcp/tool-registry.js.map +1 -1
- package/v3/dist/mcp/tools/coherence/audit.d.ts +107 -0
- package/v3/dist/mcp/tools/coherence/audit.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/audit.js +236 -0
- package/v3/dist/mcp/tools/coherence/audit.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts +106 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.js +205 -0
- package/v3/dist/mcp/tools/coherence/check.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts +123 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.js +279 -0
- package/v3/dist/mcp/tools/coherence/collapse.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts +100 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.js +201 -0
- package/v3/dist/mcp/tools/coherence/consensus.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts +31 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.js +42 -0
- package/v3/dist/mcp/tools/coherence/index.js.map +1 -0
- package/v3/dist/mcp/tools/index.d.ts +6 -1
- package/v3/dist/mcp/tools/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/index.js +9 -1
- package/v3/dist/mcp/tools/index.js.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.js.map +1 -1
- package/v3/dist/mcp/tools/registry.d.ts +4 -0
- package/v3/dist/mcp/tools/registry.d.ts.map +1 -1
- package/v3/dist/mcp/tools/registry.js +5 -0
- package/v3/dist/mcp/tools/registry.js.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.d.ts +1 -0
- package/v3/dist/mcp/tools/test-generation/generate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.js +3 -2
- package/v3/dist/mcp/tools/test-generation/generate.js.map +1 -1
- package/v3/dist/mcp/types.d.ts +1 -1
- package/v3/dist/mcp/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/belief-reconciler.d.ts +357 -0
- package/v3/dist/strange-loop/belief-reconciler.d.ts.map +1 -0
- package/v3/dist/strange-loop/belief-reconciler.js +696 -0
- package/v3/dist/strange-loop/belief-reconciler.js.map +1 -0
- package/v3/dist/strange-loop/index.d.ts +1 -0
- package/v3/dist/strange-loop/index.d.ts.map +1 -1
- package/v3/dist/strange-loop/index.js +2 -0
- package/v3/dist/strange-loop/index.js.map +1 -1
- package/v3/dist/strange-loop/strange-loop.d.ts +177 -5
- package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
- package/v3/dist/strange-loop/strange-loop.js +452 -9
- package/v3/dist/strange-loop/strange-loop.js.map +1 -1
- package/v3/dist/strange-loop/types.d.ts +205 -1
- package/v3/dist/strange-loop/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/types.js +5 -0
- package/v3/dist/strange-loop/types.js.map +1 -1
- package/v3/dist/sync/cloud/index.d.ts +8 -0
- package/v3/dist/sync/cloud/index.d.ts.map +1 -0
- package/v3/dist/sync/cloud/index.js +8 -0
- package/v3/dist/sync/cloud/index.js.map +1 -0
- package/v3/dist/sync/cloud/postgres-writer.d.ts +88 -0
- package/v3/dist/sync/cloud/postgres-writer.d.ts.map +1 -0
- package/v3/dist/sync/cloud/postgres-writer.js +319 -0
- package/v3/dist/sync/cloud/postgres-writer.js.map +1 -0
- package/v3/dist/sync/cloud/tunnel-manager.d.ts +75 -0
- package/v3/dist/sync/cloud/tunnel-manager.d.ts.map +1 -0
- package/v3/dist/sync/cloud/tunnel-manager.js +221 -0
- package/v3/dist/sync/cloud/tunnel-manager.js.map +1 -0
- package/v3/dist/sync/index.d.ts +35 -0
- package/v3/dist/sync/index.d.ts.map +1 -0
- package/v3/dist/sync/index.js +35 -0
- package/v3/dist/sync/index.js.map +1 -0
- package/v3/dist/sync/interfaces.d.ts +245 -0
- package/v3/dist/sync/interfaces.d.ts.map +1 -0
- package/v3/dist/sync/interfaces.js +160 -0
- package/v3/dist/sync/interfaces.js.map +1 -0
- package/v3/dist/sync/readers/index.d.ts +8 -0
- package/v3/dist/sync/readers/index.d.ts.map +1 -0
- package/v3/dist/sync/readers/index.js +8 -0
- package/v3/dist/sync/readers/index.js.map +1 -0
- package/v3/dist/sync/readers/json-reader.d.ts +95 -0
- package/v3/dist/sync/readers/json-reader.d.ts.map +1 -0
- package/v3/dist/sync/readers/json-reader.js +306 -0
- package/v3/dist/sync/readers/json-reader.js.map +1 -0
- package/v3/dist/sync/readers/sqlite-reader.d.ts +88 -0
- package/v3/dist/sync/readers/sqlite-reader.d.ts.map +1 -0
- package/v3/dist/sync/readers/sqlite-reader.js +255 -0
- package/v3/dist/sync/readers/sqlite-reader.js.map +1 -0
- package/v3/dist/sync/sync-agent.d.ts +116 -0
- package/v3/dist/sync/sync-agent.d.ts.map +1 -0
- package/v3/dist/sync/sync-agent.js +416 -0
- package/v3/dist/sync/sync-agent.js.map +1 -0
- package/v3/package.json +17 -2
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Agentic QE v3 - MCP Security: CVE Prevention Utilities
|
|
3
3
|
* Security utilities for preventing common vulnerabilities (ADR-012)
|
|
4
4
|
*
|
|
5
|
+
* This file serves as a facade that maintains backward compatibility
|
|
6
|
+
* while the actual implementations are organized using the Strategy Pattern
|
|
7
|
+
* in the validators/ directory.
|
|
8
|
+
*
|
|
5
9
|
* Features:
|
|
6
10
|
* - Path traversal protection (no ../ in paths)
|
|
7
11
|
* - ReDoS prevention with regex escaping
|
|
@@ -9,579 +13,50 @@
|
|
|
9
13
|
* - Input sanitization utilities
|
|
10
14
|
* - Command injection prevention
|
|
11
15
|
*/
|
|
12
|
-
import { createHash, timingSafeEqual, randomBytes } from 'crypto';
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Path Traversal Protection
|
|
15
16
|
// ============================================================================
|
|
16
|
-
|
|
17
|
-
* Path traversal patterns to detect
|
|
18
|
-
*/
|
|
19
|
-
const PATH_TRAVERSAL_PATTERNS = [
|
|
20
|
-
/\.\./, // Basic traversal
|
|
21
|
-
/%2e%2e/i, // URL encoded ..
|
|
22
|
-
/%252e%252e/i, // Double URL encoded
|
|
23
|
-
/\.\.%2f/i, // Mixed encoding
|
|
24
|
-
/%2f\.\./i, // Forward slash + ..
|
|
25
|
-
/\.\.%5c/i, // Backslash + ..
|
|
26
|
-
/\.\.\\/, // Windows backslash traversal
|
|
27
|
-
/%c0%ae/i, // UTF-8 overlong encoding
|
|
28
|
-
/%c0%2f/i, // UTF-8 overlong /
|
|
29
|
-
/%c1%9c/i, // UTF-8 overlong \
|
|
30
|
-
/\0/, // Null byte injection
|
|
31
|
-
/%00/i, // URL encoded null
|
|
32
|
-
];
|
|
33
|
-
/**
|
|
34
|
-
* Dangerous path components
|
|
35
|
-
*/
|
|
36
|
-
const DANGEROUS_PATH_COMPONENTS = [
|
|
37
|
-
/^\/etc\//i,
|
|
38
|
-
/^\/proc\//i,
|
|
39
|
-
/^\/sys\//i,
|
|
40
|
-
/^\/dev\//i,
|
|
41
|
-
/^\/root\//i,
|
|
42
|
-
/^\/home\/.+\/\./i,
|
|
43
|
-
/^[A-Z]:\\Windows/i,
|
|
44
|
-
/^[A-Z]:\\System/i,
|
|
45
|
-
/^[A-Z]:\\Users\\.+\\AppData/i,
|
|
46
|
-
];
|
|
47
|
-
/**
|
|
48
|
-
* Validate and sanitize a file path to prevent traversal attacks
|
|
49
|
-
*/
|
|
50
|
-
export function validatePath(path, options = {}) {
|
|
51
|
-
const { basePath = '', allowAbsolute = false, allowedExtensions = [], deniedExtensions = ['.exe', '.bat', '.cmd', '.sh', '.ps1', '.dll', '.so'], maxDepth = 10, maxLength = 4096, } = options;
|
|
52
|
-
// Check length
|
|
53
|
-
if (path.length > maxLength) {
|
|
54
|
-
return {
|
|
55
|
-
valid: false,
|
|
56
|
-
error: `Path exceeds maximum length of ${maxLength}`,
|
|
57
|
-
riskLevel: 'medium',
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
// Check for traversal patterns
|
|
61
|
-
for (const pattern of PATH_TRAVERSAL_PATTERNS) {
|
|
62
|
-
if (pattern.test(path)) {
|
|
63
|
-
return {
|
|
64
|
-
valid: false,
|
|
65
|
-
error: 'Path traversal attempt detected',
|
|
66
|
-
riskLevel: 'critical',
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Check for absolute paths
|
|
71
|
-
if (!allowAbsolute && (path.startsWith('/') || /^[A-Z]:/i.test(path))) {
|
|
72
|
-
return {
|
|
73
|
-
valid: false,
|
|
74
|
-
error: 'Absolute paths are not allowed',
|
|
75
|
-
riskLevel: 'high',
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
// Check for dangerous path components
|
|
79
|
-
for (const pattern of DANGEROUS_PATH_COMPONENTS) {
|
|
80
|
-
if (pattern.test(path)) {
|
|
81
|
-
return {
|
|
82
|
-
valid: false,
|
|
83
|
-
error: 'Access to system paths is not allowed',
|
|
84
|
-
riskLevel: 'critical',
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Normalize the path
|
|
89
|
-
const normalizedPath = normalizePath(path);
|
|
90
|
-
// Re-check for traversal after normalization
|
|
91
|
-
if (normalizedPath.includes('..')) {
|
|
92
|
-
return {
|
|
93
|
-
valid: false,
|
|
94
|
-
error: 'Path traversal detected after normalization',
|
|
95
|
-
riskLevel: 'critical',
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
// Check depth
|
|
99
|
-
const depth = normalizedPath.split('/').filter(Boolean).length;
|
|
100
|
-
if (depth > maxDepth) {
|
|
101
|
-
return {
|
|
102
|
-
valid: false,
|
|
103
|
-
error: `Path depth exceeds maximum of ${maxDepth}`,
|
|
104
|
-
riskLevel: 'low',
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
// Check extension
|
|
108
|
-
const ext = getExtension(normalizedPath);
|
|
109
|
-
if (ext) {
|
|
110
|
-
const extWithDot = `.${ext.toLowerCase()}`;
|
|
111
|
-
const extWithoutDot = ext.toLowerCase();
|
|
112
|
-
// Check denied extensions (support both .exe and exe formats)
|
|
113
|
-
if (deniedExtensions.length > 0) {
|
|
114
|
-
const isDenied = deniedExtensions.some(denied => denied.toLowerCase() === extWithDot || denied.toLowerCase() === extWithoutDot);
|
|
115
|
-
if (isDenied) {
|
|
116
|
-
return {
|
|
117
|
-
valid: false,
|
|
118
|
-
error: `File extension '${ext}' is not allowed`,
|
|
119
|
-
riskLevel: 'high',
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Check allowed extensions (support both .ts and ts formats)
|
|
124
|
-
if (allowedExtensions.length > 0) {
|
|
125
|
-
const isAllowed = allowedExtensions.some(allowed => allowed.toLowerCase() === extWithDot || allowed.toLowerCase() === extWithoutDot);
|
|
126
|
-
if (!isAllowed) {
|
|
127
|
-
return {
|
|
128
|
-
valid: false,
|
|
129
|
-
error: `File extension '${ext}' is not in allowed list`,
|
|
130
|
-
riskLevel: 'medium',
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
// Combine with base path if provided
|
|
136
|
-
const finalPath = basePath
|
|
137
|
-
? joinPathsAbsolute(basePath, normalizedPath)
|
|
138
|
-
: normalizedPath;
|
|
139
|
-
// Verify final path doesn't escape base (use normalized base for comparison)
|
|
140
|
-
const normalizedBase = basePath.startsWith('/')
|
|
141
|
-
? `/${normalizePath(basePath)}`
|
|
142
|
-
: normalizePath(basePath);
|
|
143
|
-
if (basePath && !finalPath.startsWith(normalizedBase)) {
|
|
144
|
-
return {
|
|
145
|
-
valid: false,
|
|
146
|
-
error: 'Path escapes base directory',
|
|
147
|
-
riskLevel: 'critical',
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return {
|
|
151
|
-
valid: true,
|
|
152
|
-
normalizedPath: finalPath,
|
|
153
|
-
riskLevel: 'none',
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Normalize a path by resolving . and .. components
|
|
158
|
-
*/
|
|
159
|
-
export function normalizePath(path) {
|
|
160
|
-
// Replace backslashes with forward slashes
|
|
161
|
-
let normalized = path.replace(/\\/g, '/');
|
|
162
|
-
// Remove multiple consecutive slashes
|
|
163
|
-
normalized = normalized.replace(/\/+/g, '/');
|
|
164
|
-
// Split and resolve
|
|
165
|
-
const parts = normalized.split('/');
|
|
166
|
-
const result = [];
|
|
167
|
-
for (const part of parts) {
|
|
168
|
-
if (part === '.' || part === '') {
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
if (part === '..') {
|
|
172
|
-
// Don't allow going above root
|
|
173
|
-
if (result.length > 0 && result[result.length - 1] !== '..') {
|
|
174
|
-
result.pop();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
result.push(part);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return result.join('/');
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Safely join path components (strips leading/trailing slashes from all parts)
|
|
185
|
-
*/
|
|
186
|
-
export function joinPaths(...paths) {
|
|
187
|
-
if (paths.length === 0)
|
|
188
|
-
return '';
|
|
189
|
-
return paths
|
|
190
|
-
.map(p => p.replace(/^\/+|\/+$/g, ''))
|
|
191
|
-
.filter(Boolean)
|
|
192
|
-
.join('/');
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Join paths preserving absolute path from first component
|
|
196
|
-
*/
|
|
197
|
-
export function joinPathsAbsolute(...paths) {
|
|
198
|
-
if (paths.length === 0)
|
|
199
|
-
return '';
|
|
200
|
-
// Check if the first path is absolute
|
|
201
|
-
const isAbsolute = paths[0].startsWith('/');
|
|
202
|
-
const result = paths
|
|
203
|
-
// Use non-backtracking patterns with possessive-like behavior via split/join
|
|
204
|
-
.map(p => {
|
|
205
|
-
// Remove leading slashes by splitting and rejoining
|
|
206
|
-
while (p.startsWith('/'))
|
|
207
|
-
p = p.slice(1);
|
|
208
|
-
// Remove trailing slashes
|
|
209
|
-
while (p.endsWith('/'))
|
|
210
|
-
p = p.slice(0, -1);
|
|
211
|
-
return p;
|
|
212
|
-
})
|
|
213
|
-
.filter(Boolean)
|
|
214
|
-
.join('/');
|
|
215
|
-
// Preserve leading slash for absolute paths
|
|
216
|
-
return isAbsolute ? `/${result}` : result;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Get file extension
|
|
220
|
-
*/
|
|
221
|
-
export function getExtension(path) {
|
|
222
|
-
const match = path.match(/\.([^./\\]+)$/);
|
|
223
|
-
return match ? match[1] : null;
|
|
224
|
-
}
|
|
17
|
+
// Re-export Validators and Functions
|
|
225
18
|
// ============================================================================
|
|
19
|
+
// Path Traversal Protection
|
|
20
|
+
export { validatePath, normalizePath, joinPaths, joinPathsAbsolute, getExtension, PathTraversalValidator, PATH_TRAVERSAL_PATTERNS, DANGEROUS_PATH_COMPONENTS, } from './validators/path-traversal-validator';
|
|
226
21
|
// ReDoS Prevention
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Patterns that can cause ReDoS
|
|
230
|
-
*/
|
|
231
|
-
const REDOS_PATTERNS = [
|
|
232
|
-
/\(\.\*\)\+/, // (.*)+
|
|
233
|
-
/\(\.\+\)\+/, // (.+)+
|
|
234
|
-
/\([^)]*\?\)\+/, // (...?)+
|
|
235
|
-
/\([^)]*\*\)\+/, // (...*)+
|
|
236
|
-
/\([^)]*\+\)\+/, // (...+)+
|
|
237
|
-
/\(\[.*?\]\+\)\+/, // ([...]+)+
|
|
238
|
-
/\(\[.*?\]\*\)\+/, // ([...]*)+
|
|
239
|
-
/\(\[.*?\]\?\)\+/, // ([...]?)+
|
|
240
|
-
/\(\[.*?\]\*\)\*/, // ([...]*)*
|
|
241
|
-
/\.\*\.\*/, // .*.*
|
|
242
|
-
/\.\+\.\+/, // .+.+
|
|
243
|
-
/\(\.\|\.\)/, // (.|.)
|
|
244
|
-
];
|
|
245
|
-
/**
|
|
246
|
-
* Maximum allowed regex complexity (nested quantifiers)
|
|
247
|
-
*/
|
|
248
|
-
const MAX_REGEX_COMPLEXITY = 3;
|
|
249
|
-
/**
|
|
250
|
-
* Check if a regex pattern is safe from ReDoS
|
|
251
|
-
*/
|
|
252
|
-
export function isRegexSafe(pattern) {
|
|
253
|
-
const riskyPatterns = [];
|
|
254
|
-
// Check for known ReDoS patterns
|
|
255
|
-
for (const redosPattern of REDOS_PATTERNS) {
|
|
256
|
-
if (redosPattern.test(pattern)) {
|
|
257
|
-
riskyPatterns.push(redosPattern.source);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
// Check nesting depth of quantifiers
|
|
261
|
-
const quantifierDepth = countQuantifierNesting(pattern);
|
|
262
|
-
if (quantifierDepth > MAX_REGEX_COMPLEXITY) {
|
|
263
|
-
riskyPatterns.push(`Quantifier nesting depth: ${quantifierDepth} (max: ${MAX_REGEX_COMPLEXITY})`);
|
|
264
|
-
}
|
|
265
|
-
// Check for exponential backtracking potential
|
|
266
|
-
if (hasExponentialBacktracking(pattern)) {
|
|
267
|
-
riskyPatterns.push('Exponential backtracking potential detected');
|
|
268
|
-
}
|
|
269
|
-
return {
|
|
270
|
-
safe: riskyPatterns.length === 0,
|
|
271
|
-
pattern,
|
|
272
|
-
escapedPattern: escapeRegex(pattern),
|
|
273
|
-
riskyPatterns,
|
|
274
|
-
error: riskyPatterns.length > 0 ? 'Pattern may cause ReDoS' : undefined,
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Count nested quantifier depth
|
|
279
|
-
*/
|
|
280
|
-
function countQuantifierNesting(pattern) {
|
|
281
|
-
let maxDepth = 0;
|
|
282
|
-
let currentDepth = 0;
|
|
283
|
-
let inGroup = false;
|
|
284
|
-
let escaped = false;
|
|
285
|
-
for (let i = 0; i < pattern.length; i++) {
|
|
286
|
-
const char = pattern[i];
|
|
287
|
-
if (escaped) {
|
|
288
|
-
escaped = false;
|
|
289
|
-
continue;
|
|
290
|
-
}
|
|
291
|
-
if (char === '\\') {
|
|
292
|
-
escaped = true;
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
if (char === '(') {
|
|
296
|
-
inGroup = true;
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
if (char === ')') {
|
|
300
|
-
inGroup = false;
|
|
301
|
-
// Check if followed by quantifier
|
|
302
|
-
const next = pattern[i + 1];
|
|
303
|
-
if (next === '*' || next === '+' || next === '?' || next === '{') {
|
|
304
|
-
currentDepth++;
|
|
305
|
-
maxDepth = Math.max(maxDepth, currentDepth);
|
|
306
|
-
}
|
|
307
|
-
continue;
|
|
308
|
-
}
|
|
309
|
-
if ((char === '*' || char === '+' || char === '?') && !inGroup) {
|
|
310
|
-
currentDepth = 1;
|
|
311
|
-
maxDepth = Math.max(maxDepth, currentDepth);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return maxDepth;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Check for exponential backtracking potential
|
|
318
|
-
*/
|
|
319
|
-
function hasExponentialBacktracking(pattern) {
|
|
320
|
-
// Simplified check for common exponential patterns
|
|
321
|
-
const dangerous = [
|
|
322
|
-
/\(\[^\\]*\]\+\)\+/, // ([...]+)+
|
|
323
|
-
/\(\[^\\]*\]\*\)\*/, // ([...]*)*
|
|
324
|
-
/\([^)]+\|[^)]+\)\+/, // (a|b)+
|
|
325
|
-
/\(\.\*\)[*+]/, // (.*)+, (.*)*
|
|
326
|
-
/\(\.\+\)[*+]/, // (.+)+, (.+)*
|
|
327
|
-
];
|
|
328
|
-
return dangerous.some(d => d.test(pattern));
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Escape special regex characters in a string
|
|
332
|
-
*/
|
|
333
|
-
export function escapeRegex(str) {
|
|
334
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Create a safe regex with timeout
|
|
338
|
-
*/
|
|
339
|
-
export function createSafeRegex(pattern, flags, maxLength = 10000) {
|
|
340
|
-
const safety = isRegexSafe(pattern);
|
|
341
|
-
if (!safety.safe) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
if (pattern.length > maxLength) {
|
|
345
|
-
return null;
|
|
346
|
-
}
|
|
347
|
-
try {
|
|
348
|
-
return new RegExp(pattern, flags);
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
// ============================================================================
|
|
22
|
+
export { isRegexSafe, escapeRegex, createSafeRegex, RegexSafetyValidator, REDOS_PATTERNS, countQuantifierNesting, hasExponentialBacktracking, } from './validators/regex-safety-validator';
|
|
355
23
|
// Timing-Safe Comparison
|
|
24
|
+
export { timingSafeCompare, timingSafeHashCompare, generateSecureToken, secureHash, CryptoValidator, } from './validators/crypto-validator';
|
|
25
|
+
// Input Sanitization
|
|
26
|
+
export { sanitizeInput, escapeHtml, stripHtmlTags, InputSanitizer, HTML_ESCAPE_MAP, SQL_INJECTION_PATTERNS, SHELL_METACHARACTERS, DANGEROUS_CONTROL_CHARS, } from './validators/input-sanitizer';
|
|
27
|
+
// Command Injection Prevention
|
|
28
|
+
export { validateCommand, escapeShellArg, CommandValidator, DEFAULT_ALLOWED_COMMANDS, BLOCKED_COMMAND_PATTERNS, } from './validators/command-validator';
|
|
356
29
|
// ============================================================================
|
|
357
|
-
|
|
358
|
-
* Perform a timing-safe string comparison
|
|
359
|
-
*/
|
|
360
|
-
export function timingSafeCompare(a, b) {
|
|
361
|
-
// Pad shorter string to prevent length-based timing attacks
|
|
362
|
-
const maxLen = Math.max(a.length, b.length);
|
|
363
|
-
const paddedA = a.padEnd(maxLen, '\0');
|
|
364
|
-
const paddedB = b.padEnd(maxLen, '\0');
|
|
365
|
-
try {
|
|
366
|
-
return timingSafeEqual(Buffer.from(paddedA), Buffer.from(paddedB));
|
|
367
|
-
}
|
|
368
|
-
catch {
|
|
369
|
-
return false;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Timing-safe comparison for hashed values
|
|
374
|
-
*/
|
|
375
|
-
export function timingSafeHashCompare(value, expectedHash) {
|
|
376
|
-
const hash = createHash('sha256').update(value).digest('hex');
|
|
377
|
-
return timingSafeCompare(hash, expectedHash);
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Generate a secure random token
|
|
381
|
-
*/
|
|
382
|
-
export function generateSecureToken(length = 32) {
|
|
383
|
-
return randomBytes(length)
|
|
384
|
-
.toString('base64')
|
|
385
|
-
.replace(/\+/g, '-')
|
|
386
|
-
.replace(/\//g, '_')
|
|
387
|
-
.replace(/=/g, '');
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Hash a value securely
|
|
391
|
-
*/
|
|
392
|
-
export function secureHash(value, salt) {
|
|
393
|
-
const data = salt ? `${salt}:${value}` : value;
|
|
394
|
-
return createHash('sha256').update(data).digest('hex');
|
|
395
|
-
}
|
|
30
|
+
// Re-export Orchestrator
|
|
396
31
|
// ============================================================================
|
|
397
|
-
|
|
32
|
+
export { ValidationOrchestrator, getOrchestrator, createOrchestrator, } from './validators/validation-orchestrator';
|
|
398
33
|
// ============================================================================
|
|
399
|
-
|
|
400
|
-
* HTML escape characters
|
|
401
|
-
*/
|
|
402
|
-
const HTML_ESCAPE_MAP = {
|
|
403
|
-
'&': '&',
|
|
404
|
-
'<': '<',
|
|
405
|
-
'>': '>',
|
|
406
|
-
'"': '"',
|
|
407
|
-
"'": ''',
|
|
408
|
-
'/': '/',
|
|
409
|
-
'`': '`',
|
|
410
|
-
'=': '=',
|
|
411
|
-
};
|
|
412
|
-
/**
|
|
413
|
-
* SQL injection patterns
|
|
414
|
-
*/
|
|
415
|
-
const SQL_INJECTION_PATTERNS = [
|
|
416
|
-
/('|")\s*;\s*--/i,
|
|
417
|
-
/'\s*OR\s+'1'\s*=\s*'1/i,
|
|
418
|
-
/"\s*OR\s+"1"\s*=\s*"1/i,
|
|
419
|
-
/UNION\s+SELECT/i,
|
|
420
|
-
/INSERT\s+INTO/i,
|
|
421
|
-
/DROP\s+TABLE/i,
|
|
422
|
-
/DELETE\s+FROM/i,
|
|
423
|
-
/UPDATE\s+.*\s+SET/i,
|
|
424
|
-
/EXEC(\s+|\()sp_/i,
|
|
425
|
-
/xp_cmdshell/i,
|
|
426
|
-
];
|
|
427
|
-
/**
|
|
428
|
-
* Shell metacharacters (excludes parentheses which are common in normal text)
|
|
429
|
-
*/
|
|
430
|
-
const SHELL_METACHARACTERS = /[|;&$`<>{}[\]!#*?~]/g;
|
|
431
|
-
/**
|
|
432
|
-
* Sanitize input string
|
|
433
|
-
*/
|
|
434
|
-
export function sanitizeInput(input, options = {}) {
|
|
435
|
-
const { maxLength = 10000, allowedChars, stripHtml = true, stripSql = true, escapeShell = true, trim = true, } = options;
|
|
436
|
-
let result = input;
|
|
437
|
-
// Trim
|
|
438
|
-
if (trim) {
|
|
439
|
-
result = result.trim();
|
|
440
|
-
}
|
|
441
|
-
// Max length
|
|
442
|
-
if (result.length > maxLength) {
|
|
443
|
-
result = result.substring(0, maxLength);
|
|
444
|
-
}
|
|
445
|
-
// Strip HTML
|
|
446
|
-
if (stripHtml) {
|
|
447
|
-
result = stripHtmlTags(result);
|
|
448
|
-
}
|
|
449
|
-
// Strip SQL injection attempts
|
|
450
|
-
if (stripSql) {
|
|
451
|
-
for (const pattern of SQL_INJECTION_PATTERNS) {
|
|
452
|
-
result = result.replace(pattern, '');
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
// Escape shell metacharacters
|
|
456
|
-
if (escapeShell) {
|
|
457
|
-
result = result.replace(SHELL_METACHARACTERS, '');
|
|
458
|
-
}
|
|
459
|
-
// Filter to allowed characters
|
|
460
|
-
if (allowedChars) {
|
|
461
|
-
// Filter character by character to respect the provided regex
|
|
462
|
-
result = result.split('').filter(char => allowedChars.test(char)).join('');
|
|
463
|
-
}
|
|
464
|
-
return result;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Escape HTML special characters
|
|
468
|
-
*/
|
|
469
|
-
export function escapeHtml(str) {
|
|
470
|
-
return str.replace(/[&<>"'`=/]/g, char => HTML_ESCAPE_MAP[char] || char);
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Strip HTML tags from a string
|
|
474
|
-
* Handles both complete tags and incomplete/malformed tags to prevent XSS
|
|
475
|
-
*/
|
|
476
|
-
export function stripHtmlTags(str) {
|
|
477
|
-
// Limit input length to prevent ReDoS
|
|
478
|
-
const MAX_LENGTH = 100000;
|
|
479
|
-
if (str.length > MAX_LENGTH) {
|
|
480
|
-
str = str.slice(0, MAX_LENGTH);
|
|
481
|
-
}
|
|
482
|
-
let result = str;
|
|
483
|
-
let prevLength;
|
|
484
|
-
// Loop until no more changes (handles nested/malformed tags like <script<script>>)
|
|
485
|
-
do {
|
|
486
|
-
prevLength = result.length;
|
|
487
|
-
// Remove complete HTML tags using a non-backtracking approach
|
|
488
|
-
// Process character by character to avoid regex backtracking
|
|
489
|
-
let cleaned = '';
|
|
490
|
-
let inTag = false;
|
|
491
|
-
for (let i = 0; i < result.length; i++) {
|
|
492
|
-
const char = result[i];
|
|
493
|
-
if (char === '<') {
|
|
494
|
-
inTag = true;
|
|
495
|
-
}
|
|
496
|
-
else if (char === '>' && inTag) {
|
|
497
|
-
inTag = false;
|
|
498
|
-
}
|
|
499
|
-
else if (!inTag) {
|
|
500
|
-
cleaned += char;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
result = cleaned;
|
|
504
|
-
} while (result.length < prevLength && result.length > 0);
|
|
505
|
-
// Encode any remaining angle brackets
|
|
506
|
-
result = result.replace(/</g, '<').replace(/>/g, '>');
|
|
507
|
-
return result;
|
|
508
|
-
}
|
|
34
|
+
// Import for CVEPrevention Object
|
|
509
35
|
// ============================================================================
|
|
510
|
-
|
|
36
|
+
import { validatePath } from './validators/path-traversal-validator';
|
|
37
|
+
import { normalizePath } from './validators/path-traversal-validator';
|
|
38
|
+
import { joinPaths } from './validators/path-traversal-validator';
|
|
39
|
+
import { joinPathsAbsolute } from './validators/path-traversal-validator';
|
|
40
|
+
import { getExtension } from './validators/path-traversal-validator';
|
|
41
|
+
import { isRegexSafe } from './validators/regex-safety-validator';
|
|
42
|
+
import { escapeRegex } from './validators/regex-safety-validator';
|
|
43
|
+
import { createSafeRegex } from './validators/regex-safety-validator';
|
|
44
|
+
import { timingSafeCompare } from './validators/crypto-validator';
|
|
45
|
+
import { timingSafeHashCompare } from './validators/crypto-validator';
|
|
46
|
+
import { generateSecureToken } from './validators/crypto-validator';
|
|
47
|
+
import { secureHash } from './validators/crypto-validator';
|
|
48
|
+
import { sanitizeInput } from './validators/input-sanitizer';
|
|
49
|
+
import { escapeHtml } from './validators/input-sanitizer';
|
|
50
|
+
import { stripHtmlTags } from './validators/input-sanitizer';
|
|
51
|
+
import { validateCommand } from './validators/command-validator';
|
|
52
|
+
import { escapeShellArg } from './validators/command-validator';
|
|
53
|
+
// ============================================================================
|
|
54
|
+
// Export Utilities Object (Backward Compatibility)
|
|
511
55
|
// ============================================================================
|
|
512
56
|
/**
|
|
513
|
-
*
|
|
514
|
-
|
|
515
|
-
const DEFAULT_ALLOWED_COMMANDS = [
|
|
516
|
-
'ls', 'cat', 'echo', 'grep', 'find', 'head', 'tail', 'wc',
|
|
517
|
-
'npm', 'node', 'yarn', 'pnpm',
|
|
518
|
-
'git', 'jest', 'vitest', 'playwright',
|
|
519
|
-
];
|
|
520
|
-
/**
|
|
521
|
-
* Blocked command patterns
|
|
522
|
-
*/
|
|
523
|
-
const BLOCKED_COMMAND_PATTERNS = [
|
|
524
|
-
/;/, // Command chaining with semicolon
|
|
525
|
-
/&&/, // Command chaining with AND
|
|
526
|
-
/\|\|/, // Command chaining with OR
|
|
527
|
-
/\|/, // Piping
|
|
528
|
-
/`.*`/, // Backtick command substitution
|
|
529
|
-
/\$\(.*\)/, // $() command substitution
|
|
530
|
-
/>\s*\/dev\/sd/i, // Writing to block devices
|
|
531
|
-
/>\s*\/etc\//i, // Writing to /etc
|
|
532
|
-
];
|
|
533
|
-
/**
|
|
534
|
-
* Validate and sanitize a command
|
|
535
|
-
*/
|
|
536
|
-
export function validateCommand(command, allowedCommands = DEFAULT_ALLOWED_COMMANDS) {
|
|
537
|
-
const blockedPatterns = [];
|
|
538
|
-
// Check for blocked patterns
|
|
539
|
-
for (const pattern of BLOCKED_COMMAND_PATTERNS) {
|
|
540
|
-
if (pattern.test(command)) {
|
|
541
|
-
blockedPatterns.push(pattern.source);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
if (blockedPatterns.length > 0) {
|
|
545
|
-
return {
|
|
546
|
-
valid: false,
|
|
547
|
-
error: 'Command contains blocked patterns',
|
|
548
|
-
blockedPatterns,
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
// Extract base command
|
|
552
|
-
const parts = command.trim().split(/\s+/);
|
|
553
|
-
const baseCommand = parts[0].split('/').pop() || '';
|
|
554
|
-
// Check against whitelist
|
|
555
|
-
if (!allowedCommands.includes(baseCommand)) {
|
|
556
|
-
return {
|
|
557
|
-
valid: false,
|
|
558
|
-
error: `Command '${baseCommand}' is not in the allowed list`,
|
|
559
|
-
blockedPatterns: [],
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
// Sanitize arguments
|
|
563
|
-
const sanitizedParts = parts.map((part, i) => {
|
|
564
|
-
if (i === 0)
|
|
565
|
-
return part;
|
|
566
|
-
// Remove shell metacharacters from arguments
|
|
567
|
-
return part.replace(SHELL_METACHARACTERS, '');
|
|
568
|
-
});
|
|
569
|
-
return {
|
|
570
|
-
valid: true,
|
|
571
|
-
sanitizedCommand: sanitizedParts.join(' '),
|
|
572
|
-
blockedPatterns: [],
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Escape a string for safe shell usage
|
|
57
|
+
* CVEPrevention - Main security utilities object
|
|
58
|
+
* Provides backward-compatible access to all security functions
|
|
577
59
|
*/
|
|
578
|
-
export function escapeShellArg(arg) {
|
|
579
|
-
// Wrap in single quotes and escape any internal single quotes
|
|
580
|
-
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
581
|
-
}
|
|
582
|
-
// ============================================================================
|
|
583
|
-
// Export Utilities Object
|
|
584
|
-
// ============================================================================
|
|
585
60
|
export const CVEPrevention = {
|
|
586
61
|
// Path traversal
|
|
587
62
|
validatePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
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B;IACrB,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAC3C,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACzB,6CAA6C;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1C,eAAe,EAAE,EAAE;KACpB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,8DAA8D;IAC9D,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC3C,CAAC;AAED,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,iBAAiB;IACjB,YAAY;IACZ,aAAa;IACb,SAAS;IACT,iBAAiB;IACjB,YAAY;IAEZ,QAAQ;IACR,WAAW;IACX,WAAW;IACX,eAAe;IAEf,cAAc;IACd,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;IACnB,UAAU;IAEV,qBAAqB;IACrB,aAAa;IACb,UAAU;IACV,aAAa;IAEb,oBAAoB;IACpB,eAAe;IACf,cAAc;CACf,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"cve-prevention.js","sourceRoot":"","sources":["../../../src/mcp/security/cve-prevention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,+EAA+E;AAC/E,qCAAqC;AACrC,+EAA+E;AAE/E,4BAA4B;AAC5B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,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B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,+EAA+E;AAC/E,mDAAmD;AACnD,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,iBAAiB;IACjB,YAAY;IACZ,aAAa;IACb,SAAS;IACT,iBAAiB;IACjB,YAAY;IAEZ,QAAQ;IACR,WAAW;IACX,WAAW;IACX,eAAe;IAEf,cAAc;IACd,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;IACnB,UAAU;IAEV,qBAAqB;IACrB,aAAa;IACb,UAAU;IACV,aAAa;IAEb,oBAAoB;IACpB,eAAe;IACf,cAAc;CACf,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -99,7 +99,11 @@ export declare function createSecurityMiddleware(config?: SecurityMiddlewareConf
|
|
|
99
99
|
/**
|
|
100
100
|
* Validate command for execution
|
|
101
101
|
*/
|
|
102
|
-
validateShellCommand(command: string, allowedCommands?: string[]): import("./cve-prevention").CommandValidationResult
|
|
102
|
+
validateShellCommand(command: string, allowedCommands?: string[]): import("./cve-prevention").CommandValidationResult | {
|
|
103
|
+
valid: boolean;
|
|
104
|
+
sanitizedCommand: string;
|
|
105
|
+
blockedPatterns: never[];
|
|
106
|
+
};
|
|
103
107
|
/**
|
|
104
108
|
* Run all security checks
|
|
105
109
|
*/
|