@dcyfr/ai 1.0.4 → 2.1.0
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/CHANGELOG.md +106 -0
- package/README.md +381 -9
- package/dist/ai/agents/agent-loader.d.ts +12 -0
- package/dist/ai/agents/agent-loader.d.ts.map +1 -1
- package/dist/ai/agents/agent-loader.js +74 -65
- package/dist/ai/agents/agent-loader.js.map +1 -1
- package/dist/ai/agents/agent-registry.d.ts +2 -0
- package/dist/ai/agents/agent-registry.d.ts.map +1 -1
- package/dist/ai/agents/agent-registry.js +15 -14
- package/dist/ai/agents/agent-registry.js.map +1 -1
- package/dist/ai/agents/agent-router.d.ts +20 -5
- package/dist/ai/agents/agent-router.d.ts.map +1 -1
- package/dist/ai/agents/agent-router.js +89 -43
- package/dist/ai/agents/agent-router.js.map +1 -1
- package/dist/ai/agents/index.d.ts +6 -1
- package/dist/ai/agents/index.d.ts.map +1 -1
- package/dist/ai/agents/index.js +9 -3
- package/dist/ai/agents/index.js.map +1 -1
- package/dist/ai/agents/instruction-template.d.ts +45 -0
- package/dist/ai/agents/instruction-template.d.ts.map +1 -0
- package/dist/ai/agents/instruction-template.js +197 -0
- package/dist/ai/agents/instruction-template.js.map +1 -0
- package/dist/ai/agents/persona-resolver.d.ts +90 -0
- package/dist/ai/agents/persona-resolver.d.ts.map +1 -0
- package/dist/ai/agents/persona-resolver.js +121 -0
- package/dist/ai/agents/persona-resolver.js.map +1 -0
- package/dist/ai/agents/schema.d.ts +166 -0
- package/dist/ai/agents/schema.d.ts.map +1 -0
- package/dist/ai/agents/schema.js +94 -0
- package/dist/ai/agents/schema.js.map +1 -0
- package/dist/ai/agents/types.d.ts +102 -0
- package/dist/ai/agents/types.d.ts.map +1 -1
- package/dist/ai/agents-builtin/architecture/index.js +3 -3
- package/dist/ai/agents-builtin/content/index.js +1 -1
- package/dist/ai/agents-builtin/data/index.js +1 -1
- package/dist/ai/agents-builtin/development/index.js +4 -4
- package/dist/ai/agents-builtin/devops/index.js +1 -1
- package/dist/ai/agents-builtin/index.js +33 -33
- package/dist/ai/agents-builtin/performance/index.js +1 -1
- package/dist/ai/agents-builtin/research/index.js +1 -1
- package/dist/ai/agents-builtin/security/index.js +1 -1
- package/dist/ai/agents-builtin/testing/index.js +2 -2
- package/dist/ai/config/loader.d.ts.map +1 -1
- package/dist/ai/config/loader.js +6 -3
- package/dist/ai/config/loader.js.map +1 -1
- package/dist/ai/config/schema.d.ts +242 -1156
- package/dist/ai/config/schema.d.ts.map +1 -1
- package/dist/ai/config/schema.js +69 -20
- package/dist/ai/config/schema.js.map +1 -1
- package/dist/ai/core/provider-registry.d.ts +32 -0
- package/dist/ai/core/provider-registry.d.ts.map +1 -1
- package/dist/ai/core/provider-registry.js +189 -14
- package/dist/ai/core/provider-registry.js.map +1 -1
- package/dist/ai/core/telemetry-engine.d.ts +26 -0
- package/dist/ai/core/telemetry-engine.d.ts.map +1 -1
- package/dist/ai/core/telemetry-engine.js +81 -1
- package/dist/ai/core/telemetry-engine.js.map +1 -1
- package/dist/ai/delegation/agent-registry.d.ts +143 -0
- package/dist/ai/delegation/agent-registry.d.ts.map +1 -0
- package/dist/ai/delegation/agent-registry.js +231 -0
- package/dist/ai/delegation/agent-registry.js.map +1 -0
- package/dist/ai/delegation/blast-radius-tracker.d.ts +65 -0
- package/dist/ai/delegation/blast-radius-tracker.d.ts.map +1 -0
- package/dist/ai/delegation/blast-radius-tracker.js +81 -0
- package/dist/ai/delegation/blast-radius-tracker.js.map +1 -0
- package/dist/ai/delegation/capability-bootstrap.d.ts +40 -0
- package/dist/ai/delegation/capability-bootstrap.d.ts.map +1 -0
- package/dist/ai/delegation/capability-bootstrap.js +431 -0
- package/dist/ai/delegation/capability-bootstrap.js.map +1 -0
- package/dist/ai/delegation/capability-registry.d.ts +81 -0
- package/dist/ai/delegation/capability-registry.d.ts.map +1 -0
- package/dist/ai/delegation/capability-registry.js +339 -0
- package/dist/ai/delegation/capability-registry.js.map +1 -0
- package/dist/ai/delegation/chain-tracker.d.ts +152 -0
- package/dist/ai/delegation/chain-tracker.d.ts.map +1 -0
- package/dist/ai/delegation/chain-tracker.js +336 -0
- package/dist/ai/delegation/chain-tracker.js.map +1 -0
- package/dist/ai/delegation/circuit-breaker.d.ts +59 -0
- package/dist/ai/delegation/circuit-breaker.d.ts.map +1 -0
- package/dist/ai/delegation/circuit-breaker.js +153 -0
- package/dist/ai/delegation/circuit-breaker.js.map +1 -0
- package/dist/ai/delegation/contract-manager.d.ts +415 -0
- package/dist/ai/delegation/contract-manager.d.ts.map +1 -0
- package/dist/ai/delegation/contract-manager.js +1258 -0
- package/dist/ai/delegation/contract-manager.js.map +1 -0
- package/dist/ai/delegation/delegation-manager.d.ts +505 -0
- package/dist/ai/delegation/delegation-manager.d.ts.map +1 -0
- package/dist/ai/delegation/delegation-manager.js +773 -0
- package/dist/ai/delegation/delegation-manager.js.map +1 -0
- package/dist/ai/delegation/event-schemas.d.ts +101 -0
- package/dist/ai/delegation/event-schemas.d.ts.map +1 -0
- package/dist/ai/delegation/event-schemas.js +59 -0
- package/dist/ai/delegation/event-schemas.js.map +1 -0
- package/dist/ai/delegation/execution-mode-dashboard.d.ts +109 -0
- package/dist/ai/delegation/execution-mode-dashboard.d.ts.map +1 -0
- package/dist/ai/delegation/execution-mode-dashboard.js +167 -0
- package/dist/ai/delegation/execution-mode-dashboard.js.map +1 -0
- package/dist/ai/delegation/feature-flags.d.ts +191 -0
- package/dist/ai/delegation/feature-flags.d.ts.map +1 -0
- package/dist/ai/delegation/feature-flags.js +332 -0
- package/dist/ai/delegation/feature-flags.js.map +1 -0
- package/dist/ai/delegation/index.d.ts +51 -0
- package/dist/ai/delegation/index.d.ts.map +1 -0
- package/dist/ai/delegation/index.js +39 -0
- package/dist/ai/delegation/index.js.map +1 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.d.ts +39 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.js +77 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.d.ts +46 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.js +89 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.d.ts +31 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.js +82 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.d.ts +46 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.js +59 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/identity-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/identity-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/identity-middleware.js +64 -0
- package/dist/ai/delegation/middleware/identity-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/permissions-middleware.d.ts +48 -0
- package/dist/ai/delegation/middleware/permissions-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/permissions-middleware.js +107 -0
- package/dist/ai/delegation/middleware/permissions-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.d.ts +38 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.js +65 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/reputation-middleware.d.ts +39 -0
- package/dist/ai/delegation/middleware/reputation-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/reputation-middleware.js +75 -0
- package/dist/ai/delegation/middleware/reputation-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.d.ts +52 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.js +112 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.js +83 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/tlp-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/tlp-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/tlp-middleware.js +59 -0
- package/dist/ai/delegation/middleware/tlp-middleware.js.map +1 -0
- package/dist/ai/delegation/monitoring.d.ts +298 -0
- package/dist/ai/delegation/monitoring.d.ts.map +1 -0
- package/dist/ai/delegation/monitoring.js +584 -0
- package/dist/ai/delegation/monitoring.js.map +1 -0
- package/dist/ai/delegation/security-middleware-chain.d.ts +71 -0
- package/dist/ai/delegation/security-middleware-chain.d.ts.map +1 -0
- package/dist/ai/delegation/security-middleware-chain.js +163 -0
- package/dist/ai/delegation/security-middleware-chain.js.map +1 -0
- package/dist/ai/delegation/session-checkpoint.d.ts +77 -0
- package/dist/ai/delegation/session-checkpoint.d.ts.map +1 -0
- package/dist/ai/delegation/session-checkpoint.js +131 -0
- package/dist/ai/delegation/session-checkpoint.js.map +1 -0
- package/dist/ai/delegation/session-manager.d.ts +131 -0
- package/dist/ai/delegation/session-manager.d.ts.map +1 -0
- package/dist/ai/delegation/session-manager.js +243 -0
- package/dist/ai/delegation/session-manager.js.map +1 -0
- package/dist/ai/delegation/session-queue.d.ts +95 -0
- package/dist/ai/delegation/session-queue.d.ts.map +1 -0
- package/dist/ai/delegation/session-queue.js +136 -0
- package/dist/ai/delegation/session-queue.js.map +1 -0
- package/dist/ai/delegation/timeout-watchdog.d.ts +60 -0
- package/dist/ai/delegation/timeout-watchdog.d.ts.map +1 -0
- package/dist/ai/delegation/timeout-watchdog.js +100 -0
- package/dist/ai/delegation/timeout-watchdog.js.map +1 -0
- package/dist/ai/examples/integration-demo.d.ts +27 -0
- package/dist/ai/examples/integration-demo.d.ts.map +1 -0
- package/dist/ai/examples/integration-demo.js +536 -0
- package/dist/ai/examples/integration-demo.js.map +1 -0
- package/dist/ai/index.d.ts +25 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +31 -11
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/mcp/servers/analytics/index.js +67 -11
- package/dist/ai/mcp/servers/analytics/index.js.map +1 -1
- package/dist/ai/mcp/servers/content-manager/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/content-manager/index.js +50 -4
- package/dist/ai/mcp/servers/content-manager/index.js.map +1 -1
- package/dist/ai/mcp/servers/delegation-monitor/index.d.ts +36 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.js +757 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.js.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/design-tokens/index.js +62 -39
- package/dist/ai/mcp/servers/design-tokens/index.js.map +1 -1
- package/dist/ai/mcp/servers/promptintel/index.js +15 -3
- package/dist/ai/mcp/servers/promptintel/index.js.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.js +3 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.js.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.js +54 -47
- package/dist/ai/mcp/servers/shared/redis-client.js.map +1 -1
- package/dist/ai/mcp/servers/shared/types.d.ts +9 -0
- package/dist/ai/mcp/servers/shared/types.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/utils.d.ts +9 -1
- package/dist/ai/mcp/servers/shared/utils.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/utils.js +52 -2
- package/dist/ai/mcp/servers/shared/utils.js.map +1 -1
- package/dist/ai/memory/config.d.ts +18 -3
- package/dist/ai/memory/config.d.ts.map +1 -1
- package/dist/ai/memory/config.js +61 -15
- package/dist/ai/memory/config.js.map +1 -1
- package/dist/ai/memory/dcyfr-memory.d.ts +4 -0
- package/dist/ai/memory/dcyfr-memory.d.ts.map +1 -1
- package/dist/ai/memory/dcyfr-memory.js +44 -6
- package/dist/ai/memory/dcyfr-memory.js.map +1 -1
- package/dist/ai/memory/mem0-client.d.ts.map +1 -1
- package/dist/ai/memory/mem0-client.js +53 -14
- package/dist/ai/memory/mem0-client.js.map +1 -1
- package/dist/ai/permissions/attenuation-engine.d.ts +159 -0
- package/dist/ai/permissions/attenuation-engine.d.ts.map +1 -0
- package/dist/ai/permissions/attenuation-engine.js +511 -0
- package/dist/ai/permissions/attenuation-engine.js.map +1 -0
- package/dist/ai/plugins/plugin-loader.d.ts +4 -0
- package/dist/ai/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/ai/plugins/plugin-loader.js +28 -28
- package/dist/ai/plugins/plugin-loader.js.map +1 -1
- package/dist/ai/reputation/execution-mode-reputation.d.ts +104 -0
- package/dist/ai/reputation/execution-mode-reputation.d.ts.map +1 -0
- package/dist/ai/reputation/execution-mode-reputation.js +142 -0
- package/dist/ai/reputation/execution-mode-reputation.js.map +1 -0
- package/dist/ai/reputation/reputation-engine.d.ts +204 -0
- package/dist/ai/reputation/reputation-engine.d.ts.map +1 -0
- package/dist/ai/reputation/reputation-engine.js +426 -0
- package/dist/ai/reputation/reputation-engine.js.map +1 -0
- package/dist/ai/runtime/agent-runtime.d.ts +193 -0
- package/dist/ai/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/ai/runtime/agent-runtime.js +1009 -0
- package/dist/ai/runtime/agent-runtime.js.map +1 -0
- package/dist/ai/runtime/index.d.ts +11 -0
- package/dist/ai/runtime/index.d.ts.map +1 -0
- package/dist/ai/runtime/index.js +9 -0
- package/dist/ai/runtime/index.js.map +1 -0
- package/dist/ai/runtime/telemetry-schema.d.ts +192 -0
- package/dist/ai/runtime/telemetry-schema.d.ts.map +1 -0
- package/dist/ai/runtime/telemetry-schema.js +200 -0
- package/dist/ai/runtime/telemetry-schema.js.map +1 -0
- package/dist/ai/runtime/types.d.ts +236 -0
- package/dist/ai/runtime/types.d.ts.map +1 -0
- package/dist/ai/runtime/types.js +10 -0
- package/dist/ai/runtime/types.js.map +1 -0
- package/dist/ai/src/batch-processor.d.ts +298 -0
- package/dist/ai/src/batch-processor.d.ts.map +1 -0
- package/dist/ai/src/batch-processor.js +520 -0
- package/dist/ai/src/batch-processor.js.map +1 -0
- package/dist/ai/src/capability-bootstrap.d.ts +222 -0
- package/dist/ai/src/capability-bootstrap.d.ts.map +1 -0
- package/dist/ai/src/capability-bootstrap.js +421 -0
- package/dist/ai/src/capability-bootstrap.js.map +1 -0
- package/dist/ai/src/capability-manifest-generator.d.ts +52 -0
- package/dist/ai/src/capability-manifest-generator.d.ts.map +1 -0
- package/dist/ai/src/capability-manifest-generator.js +691 -0
- package/dist/ai/src/capability-manifest-generator.js.map +1 -0
- package/dist/ai/src/capability-registry.d.ts +157 -0
- package/dist/ai/src/capability-registry.d.ts.map +1 -0
- package/dist/ai/src/capability-registry.js +577 -0
- package/dist/ai/src/capability-registry.js.map +1 -0
- package/dist/ai/src/cli/telemetry-dashboard.d.ts +132 -0
- package/dist/ai/src/cli/telemetry-dashboard.d.ts.map +1 -0
- package/dist/ai/src/cli/telemetry-dashboard.js +565 -0
- package/dist/ai/src/cli/telemetry-dashboard.js.map +1 -0
- package/dist/ai/src/delegation/feature-flags.d.ts +213 -0
- package/dist/ai/src/delegation/feature-flags.d.ts.map +1 -0
- package/dist/ai/src/delegation/feature-flags.js +395 -0
- package/dist/ai/src/delegation/feature-flags.js.map +1 -0
- package/dist/ai/src/delegation/liability-firebreak.d.ts +303 -0
- package/dist/ai/src/delegation/liability-firebreak.d.ts.map +1 -0
- package/dist/ai/src/delegation/liability-firebreak.js +643 -0
- package/dist/ai/src/delegation/liability-firebreak.js.map +1 -0
- package/dist/ai/src/delegation/security-threat-model.d.ts +171 -0
- package/dist/ai/src/delegation/security-threat-model.d.ts.map +1 -0
- package/dist/ai/src/delegation/security-threat-model.js +723 -0
- package/dist/ai/src/delegation/security-threat-model.js.map +1 -0
- package/dist/ai/src/delegation/tlp-enforcement.d.ts +146 -0
- package/dist/ai/src/delegation/tlp-enforcement.d.ts.map +1 -0
- package/dist/ai/src/delegation/tlp-enforcement.js +382 -0
- package/dist/ai/src/delegation/tlp-enforcement.js.map +1 -0
- package/dist/ai/src/delegation-capability-integration.d.ts +154 -0
- package/dist/ai/src/delegation-capability-integration.d.ts.map +1 -0
- package/dist/ai/src/delegation-capability-integration.js +351 -0
- package/dist/ai/src/delegation-capability-integration.js.map +1 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.d.ts +325 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.d.ts.map +1 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.js +801 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.js.map +1 -0
- package/dist/ai/src/enhanced-capability-detection.d.ts +237 -0
- package/dist/ai/src/enhanced-capability-detection.d.ts.map +1 -0
- package/dist/ai/src/enhanced-capability-detection.js +448 -0
- package/dist/ai/src/enhanced-capability-detection.js.map +1 -0
- package/dist/ai/src/intelligent-cache-manager.d.ts +327 -0
- package/dist/ai/src/intelligent-cache-manager.d.ts.map +1 -0
- package/dist/ai/src/intelligent-cache-manager.js +634 -0
- package/dist/ai/src/intelligent-cache-manager.js.map +1 -0
- package/dist/ai/src/mcp-auto-configuration.d.ts +232 -0
- package/dist/ai/src/mcp-auto-configuration.d.ts.map +1 -0
- package/dist/ai/src/mcp-auto-configuration.js +445 -0
- package/dist/ai/src/mcp-auto-configuration.js.map +1 -0
- package/dist/ai/src/performance-profiler.d.ts +351 -0
- package/dist/ai/src/performance-profiler.d.ts.map +1 -0
- package/dist/ai/src/performance-profiler.js +475 -0
- package/dist/ai/src/performance-profiler.js.map +1 -0
- package/dist/ai/src/personas/hooks/before-llm-call.d.ts +96 -0
- package/dist/ai/src/personas/hooks/before-llm-call.d.ts.map +1 -0
- package/dist/ai/src/personas/hooks/before-llm-call.js +83 -0
- package/dist/ai/src/personas/hooks/before-llm-call.js.map +1 -0
- package/dist/ai/src/personas/index.d.ts +10 -0
- package/dist/ai/src/personas/index.d.ts.map +1 -0
- package/dist/ai/src/personas/index.js +10 -0
- package/dist/ai/src/personas/index.js.map +1 -0
- package/dist/ai/src/personas/persona-loader.d.ts +42 -0
- package/dist/ai/src/personas/persona-loader.d.ts.map +1 -0
- package/dist/ai/src/personas/persona-loader.js +162 -0
- package/dist/ai/src/personas/persona-loader.js.map +1 -0
- package/dist/ai/src/personas/types.d.ts +199 -0
- package/dist/ai/src/personas/types.d.ts.map +1 -0
- package/dist/ai/src/personas/types.js +7 -0
- package/dist/ai/src/personas/types.js.map +1 -0
- package/dist/ai/src/personas/voice-resolver.d.ts +40 -0
- package/dist/ai/src/personas/voice-resolver.d.ts.map +1 -0
- package/dist/ai/src/personas/voice-resolver.js +201 -0
- package/dist/ai/src/personas/voice-resolver.js.map +1 -0
- package/dist/ai/src/resource-monitor.d.ts +311 -0
- package/dist/ai/src/resource-monitor.d.ts.map +1 -0
- package/dist/ai/src/resource-monitor.js +475 -0
- package/dist/ai/src/resource-monitor.js.map +1 -0
- package/dist/ai/src/runtime/agent-runtime.d.ts +340 -0
- package/dist/ai/src/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/ai/src/runtime/agent-runtime.js +1084 -0
- package/dist/ai/src/runtime/agent-runtime.js.map +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.d.ts +287 -0
- package/dist/ai/src/telemetry/delegation-telemetry.d.ts.map +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.js +389 -0
- package/dist/ai/src/telemetry/delegation-telemetry.js.map +1 -0
- package/dist/ai/src/telemetry/index.d.ts +48 -0
- package/dist/ai/src/telemetry/index.d.ts.map +1 -0
- package/dist/ai/src/telemetry/index.js +48 -0
- package/dist/ai/src/telemetry/index.js.map +1 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts +67 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts.map +1 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js +415 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js.map +1 -0
- package/dist/ai/src/telemetry/telemetry-utils.d.ts +119 -0
- package/dist/ai/src/telemetry/telemetry-utils.d.ts.map +1 -0
- package/dist/ai/src/telemetry/telemetry-utils.js +250 -0
- package/dist/ai/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/ai/src/types/agent-capabilities.d.ts +227 -0
- package/dist/ai/src/types/agent-capabilities.d.ts.map +1 -0
- package/dist/ai/src/types/agent-capabilities.js +11 -0
- package/dist/ai/src/types/agent-capabilities.js.map +1 -0
- package/dist/ai/src/types/context-verification.d.ts +158 -0
- package/dist/ai/src/types/context-verification.d.ts.map +1 -0
- package/dist/ai/src/types/context-verification.js +73 -0
- package/dist/ai/src/types/context-verification.js.map +1 -0
- package/dist/ai/src/types/delegation-contracts.d.ts +296 -0
- package/dist/ai/src/types/delegation-contracts.d.ts.map +1 -0
- package/dist/ai/src/types/delegation-contracts.js +17 -0
- package/dist/ai/src/types/delegation-contracts.js.map +1 -0
- package/dist/ai/src/validation-pipeline-integration.d.ts +266 -0
- package/dist/ai/src/validation-pipeline-integration.d.ts.map +1 -0
- package/dist/ai/src/validation-pipeline-integration.js +695 -0
- package/dist/ai/src/validation-pipeline-integration.js.map +1 -0
- package/dist/ai/src/verification/multi-modal-formatters.d.ts +57 -0
- package/dist/ai/src/verification/multi-modal-formatters.d.ts.map +1 -0
- package/dist/ai/src/verification/multi-modal-formatters.js +655 -0
- package/dist/ai/src/verification/multi-modal-formatters.js.map +1 -0
- package/dist/ai/src/verification/output-formatter.d.ts +186 -0
- package/dist/ai/src/verification/output-formatter.d.ts.map +1 -0
- package/dist/ai/src/verification/output-formatter.js +296 -0
- package/dist/ai/src/verification/output-formatter.js.map +1 -0
- package/dist/ai/src/verification/parser-integration.d.ts +137 -0
- package/dist/ai/src/verification/parser-integration.d.ts.map +1 -0
- package/dist/ai/src/verification/parser-integration.js +273 -0
- package/dist/ai/src/verification/parser-integration.js.map +1 -0
- package/dist/ai/types/agent-capabilities.d.ts +387 -0
- package/dist/ai/types/agent-capabilities.d.ts.map +1 -0
- package/dist/ai/types/agent-capabilities.js +32 -0
- package/dist/ai/types/agent-capabilities.js.map +1 -0
- package/dist/ai/types/delegation-contracts.d.ts +291 -0
- package/dist/ai/types/delegation-contracts.d.ts.map +1 -0
- package/dist/ai/types/delegation-contracts.js +14 -0
- package/dist/ai/types/delegation-contracts.js.map +1 -0
- package/dist/ai/types/index.d.ts +4 -1
- package/dist/ai/types/index.d.ts.map +1 -1
- package/dist/ai/types/index.js +4 -1
- package/dist/ai/types/index.js.map +1 -1
- package/dist/ai/types/permission-tokens.d.ts +365 -0
- package/dist/ai/types/permission-tokens.d.ts.map +1 -0
- package/dist/ai/types/permission-tokens.js +13 -0
- package/dist/ai/types/permission-tokens.js.map +1 -0
- package/dist/ai/types/security-middleware.d.ts +130 -0
- package/dist/ai/types/security-middleware.d.ts.map +1 -0
- package/dist/ai/types/security-middleware.js +13 -0
- package/dist/ai/types/security-middleware.js.map +1 -0
- package/dist/ai/utils/storage.d.ts.map +1 -1
- package/dist/ai/utils/storage.js +6 -3
- package/dist/ai/utils/storage.js.map +1 -1
- package/dist/ai/validation/validation-framework.js +1 -1
- package/dist/ai/verification/policy-framework.d.ts +161 -0
- package/dist/ai/verification/policy-framework.d.ts.map +1 -0
- package/dist/ai/verification/policy-framework.js +436 -0
- package/dist/ai/verification/policy-framework.js.map +1 -0
- package/package.json +35 -7
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Pipeline Integration System
|
|
3
|
+
* TLP:CLEAR
|
|
4
|
+
*
|
|
5
|
+
* Comprehensive validation pipeline that ensures proper integration between
|
|
6
|
+
* capability detection, delegation engine, MCP auto-configuration, and
|
|
7
|
+
* performance tracking components. Provides end-to-end validation workflows.
|
|
8
|
+
*
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
* @date 2026-02-14
|
|
11
|
+
* @module dcyfr-ai/validation-pipeline-integration
|
|
12
|
+
*/
|
|
13
|
+
import { EventEmitter } from 'events';
|
|
14
|
+
import { DelegationCapabilityIntegration } from './delegation-capability-integration.js';
|
|
15
|
+
import { EnhancedCapabilityDetection } from './enhanced-capability-detection.js';
|
|
16
|
+
import { MCPAutoConfiguration } from './mcp-auto-configuration.js';
|
|
17
|
+
function getErrorMessage(error) {
|
|
18
|
+
return error instanceof Error ? error.message : String(error);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Validation Pipeline Integration System
|
|
22
|
+
*
|
|
23
|
+
* Orchestrates comprehensive validation of all integration components
|
|
24
|
+
* with detailed reporting and continuous monitoring capabilities.
|
|
25
|
+
*/
|
|
26
|
+
export class ValidationPipelineIntegration extends EventEmitter {
|
|
27
|
+
delegationIntegration;
|
|
28
|
+
capabilityDetection;
|
|
29
|
+
mcpAutoConfig;
|
|
30
|
+
config;
|
|
31
|
+
systemStartTime;
|
|
32
|
+
monitoringTimer;
|
|
33
|
+
constructor(config) {
|
|
34
|
+
super();
|
|
35
|
+
this.config = {
|
|
36
|
+
enableIntegrationTests: true,
|
|
37
|
+
enablePerformanceValidation: true,
|
|
38
|
+
enableMCPValidation: true,
|
|
39
|
+
validationTimeout: 300000, // 5 minutes
|
|
40
|
+
minConfidenceThreshold: 0.7,
|
|
41
|
+
enableContinuousMonitoring: false,
|
|
42
|
+
reportOutputDir: './validation-reports',
|
|
43
|
+
...config,
|
|
44
|
+
};
|
|
45
|
+
this.systemStartTime = new Date();
|
|
46
|
+
// Initialize integrated systems
|
|
47
|
+
this.delegationIntegration = new DelegationCapabilityIntegration({
|
|
48
|
+
autoRegisterAgents: true,
|
|
49
|
+
minimumDelegationConfidence: this.config.minConfidenceThreshold,
|
|
50
|
+
enableCapabilityValidation: true,
|
|
51
|
+
enableTelemetry: true,
|
|
52
|
+
});
|
|
53
|
+
this.capabilityDetection = new EnhancedCapabilityDetection({
|
|
54
|
+
enableDynamicLearning: true,
|
|
55
|
+
enableConfidenceUpdates: true,
|
|
56
|
+
enablePerformanceTracking: true,
|
|
57
|
+
enableMCPIntegration: true,
|
|
58
|
+
workspaceRoot: this.config.workspaceRoot,
|
|
59
|
+
});
|
|
60
|
+
this.mcpAutoConfig = new MCPAutoConfiguration({
|
|
61
|
+
workspaceRoot: this.config.workspaceRoot,
|
|
62
|
+
autoStartServers: true,
|
|
63
|
+
healthMonitoring: true,
|
|
64
|
+
});
|
|
65
|
+
this.setupEventHandlers();
|
|
66
|
+
if (this.config.enableContinuousMonitoring) {
|
|
67
|
+
this.startContinuousMonitoring();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Setup inter-system event handlers
|
|
72
|
+
*/
|
|
73
|
+
setupEventHandlers() {
|
|
74
|
+
// Capability detection events
|
|
75
|
+
this.capabilityDetection.on('capability_detection_complete', ({ agentId, detectedCapabilities }) => {
|
|
76
|
+
this.emit('validation_event', {
|
|
77
|
+
type: 'capability_detection',
|
|
78
|
+
agentId,
|
|
79
|
+
details: `Detected ${detectedCapabilities} capabilities`,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
// Delegation integration events
|
|
83
|
+
this.delegationIntegration.on('delegation_contract_created', ({ contractId, assignedAgent }) => {
|
|
84
|
+
this.emit('validation_event', {
|
|
85
|
+
type: 'delegation_created',
|
|
86
|
+
contractId,
|
|
87
|
+
agentId: assignedAgent,
|
|
88
|
+
details: 'Delegation contract successfully created',
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
// MCP configuration events
|
|
92
|
+
this.mcpAutoConfig.on('mcp_server_configured', ({ serverName }) => {
|
|
93
|
+
this.emit('validation_event', {
|
|
94
|
+
type: 'mcp_configured',
|
|
95
|
+
serverName,
|
|
96
|
+
details: 'MCP server successfully configured',
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Run comprehensive pipeline validation
|
|
102
|
+
*/
|
|
103
|
+
async validatePipeline() {
|
|
104
|
+
const startTime = Date.now();
|
|
105
|
+
const testResults = [];
|
|
106
|
+
const warnings = [];
|
|
107
|
+
const errors = [];
|
|
108
|
+
const recommendations = [];
|
|
109
|
+
this.emit('validation_started', { timestamp: new Date() });
|
|
110
|
+
try {
|
|
111
|
+
// Test 1: Capability Detection Validation
|
|
112
|
+
if (this.config.enableIntegrationTests) {
|
|
113
|
+
const capabilityTests = await this.validateCapabilityDetection();
|
|
114
|
+
testResults.push(...capabilityTests);
|
|
115
|
+
}
|
|
116
|
+
// Test 2: Delegation Integration Validation
|
|
117
|
+
if (this.config.enableIntegrationTests) {
|
|
118
|
+
const delegationTests = await this.validateDelegationIntegration();
|
|
119
|
+
testResults.push(...delegationTests);
|
|
120
|
+
}
|
|
121
|
+
// Test 3: MCP Auto-Configuration Validation
|
|
122
|
+
if (this.config.enableMCPValidation) {
|
|
123
|
+
const mcpTests = await this.validateMCPAutoConfiguration();
|
|
124
|
+
testResults.push(...mcpTests);
|
|
125
|
+
}
|
|
126
|
+
// Test 4: End-to-End Integration Validation
|
|
127
|
+
if (this.config.enableIntegrationTests) {
|
|
128
|
+
const e2eTests = await this.validateEndToEndIntegration();
|
|
129
|
+
testResults.push(...e2eTests);
|
|
130
|
+
}
|
|
131
|
+
// Test 5: Performance Validation
|
|
132
|
+
if (this.config.enablePerformanceValidation) {
|
|
133
|
+
const performanceTests = await this.validatePerformance();
|
|
134
|
+
testResults.push(...performanceTests);
|
|
135
|
+
}
|
|
136
|
+
// Collect system health metrics
|
|
137
|
+
const systemHealth = await this.collectSystemHealthMetrics();
|
|
138
|
+
// Collect performance metrics
|
|
139
|
+
const performanceMetrics = await this.collectPerformanceMetrics();
|
|
140
|
+
// Analyze results and generate recommendations
|
|
141
|
+
const analysisResult = this.analyzeValidationResults(testResults, systemHealth, performanceMetrics);
|
|
142
|
+
warnings.push(...analysisResult.warnings);
|
|
143
|
+
errors.push(...analysisResult.errors);
|
|
144
|
+
recommendations.push(...analysisResult.recommendations);
|
|
145
|
+
const endTime = Date.now();
|
|
146
|
+
const validationDuration = endTime - startTime;
|
|
147
|
+
// Determine overall status
|
|
148
|
+
const failedTests = testResults.filter(test => test.status === 'failed').length;
|
|
149
|
+
const overallStatus = failedTests > 0 ? 'failed' :
|
|
150
|
+
warnings.length > 0 ? 'warning' : 'passed';
|
|
151
|
+
const result = {
|
|
152
|
+
overallStatus,
|
|
153
|
+
testResults,
|
|
154
|
+
systemHealth,
|
|
155
|
+
performanceMetrics,
|
|
156
|
+
warnings,
|
|
157
|
+
errors,
|
|
158
|
+
recommendations,
|
|
159
|
+
validatedAt: new Date(),
|
|
160
|
+
validationDuration,
|
|
161
|
+
};
|
|
162
|
+
this.emit('validation_completed', { result });
|
|
163
|
+
// Write validation report if configured
|
|
164
|
+
if (this.config.reportOutputDir) {
|
|
165
|
+
await this.writeValidationReport(result);
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
const endTime = Date.now();
|
|
171
|
+
const validationDuration = endTime - startTime;
|
|
172
|
+
const errorMessage = getErrorMessage(error);
|
|
173
|
+
errors.push(`Validation failed with error: ${errorMessage}`);
|
|
174
|
+
this.emit('validation_failed', { error: errorMessage });
|
|
175
|
+
return {
|
|
176
|
+
overallStatus: 'failed',
|
|
177
|
+
testResults,
|
|
178
|
+
systemHealth: await this.collectSystemHealthMetrics(),
|
|
179
|
+
performanceMetrics: await this.collectPerformanceMetrics(),
|
|
180
|
+
warnings,
|
|
181
|
+
errors,
|
|
182
|
+
recommendations,
|
|
183
|
+
validatedAt: new Date(),
|
|
184
|
+
validationDuration,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Validate capability detection system
|
|
190
|
+
*/
|
|
191
|
+
async validateCapabilityDetection() {
|
|
192
|
+
const tests = [];
|
|
193
|
+
// Test 1: Basic capability detection
|
|
194
|
+
const startTime1 = Date.now();
|
|
195
|
+
try {
|
|
196
|
+
const mockAgent = {
|
|
197
|
+
type: 'markdown',
|
|
198
|
+
content: `
|
|
199
|
+
---
|
|
200
|
+
name: test-agent
|
|
201
|
+
description: A test agent for validation
|
|
202
|
+
tools: ['read', 'edit', 'execute']
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
# Test Agent
|
|
206
|
+
|
|
207
|
+
This agent specializes in design token compliance and production testing.
|
|
208
|
+
It ensures 95%+ design token adherence and maintains 99% test pass rates.
|
|
209
|
+
`,
|
|
210
|
+
};
|
|
211
|
+
const detection = await this.capabilityDetection.detectAndRegisterCapabilities(mockAgent, 'test-validation-agent');
|
|
212
|
+
const detectedCapabilities = detection.bootstrapResult.detectedCapabilities;
|
|
213
|
+
const hasDesignTokens = detectedCapabilities.some(cap => cap.capabilityId.includes('design_token'));
|
|
214
|
+
const hasProductionTesting = detectedCapabilities.some(cap => cap.capabilityId.includes('production_testing'));
|
|
215
|
+
tests.push({
|
|
216
|
+
testName: 'Capability Detection - Basic Keywords',
|
|
217
|
+
status: hasDesignTokens && hasProductionTesting ? 'passed' : 'failed',
|
|
218
|
+
description: 'Validates that capability detection correctly identifies agent capabilities from content',
|
|
219
|
+
executionTime: Date.now() - startTime1,
|
|
220
|
+
category: 'capability',
|
|
221
|
+
details: `Detected ${detectedCapabilities.length} capabilities: ${detectedCapabilities.map(c => c.capabilityId).join(', ')}`,
|
|
222
|
+
errorMessage: hasDesignTokens && hasProductionTesting ? undefined : 'Failed to detect expected capabilities',
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
tests.push({
|
|
227
|
+
testName: 'Capability Detection - Basic Keywords',
|
|
228
|
+
status: 'failed',
|
|
229
|
+
description: 'Validates that capability detection correctly identifies agent capabilities from content',
|
|
230
|
+
executionTime: Date.now() - startTime1,
|
|
231
|
+
category: 'capability',
|
|
232
|
+
errorMessage: getErrorMessage(error),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// Test 2: Performance tracking initialization
|
|
236
|
+
const startTime2 = Date.now();
|
|
237
|
+
try {
|
|
238
|
+
const analysis = await this.capabilityDetection.getCapabilityAnalysis('test-validation-agent');
|
|
239
|
+
const hasPerformanceMetrics = analysis.performanceMetrics.length > 0;
|
|
240
|
+
tests.push({
|
|
241
|
+
testName: 'Performance Tracking - Initialization',
|
|
242
|
+
status: hasPerformanceMetrics ? 'passed' : 'failed',
|
|
243
|
+
description: 'Validates that performance tracking is initialized for detected capabilities',
|
|
244
|
+
executionTime: Date.now() - startTime2,
|
|
245
|
+
category: 'capability',
|
|
246
|
+
details: `Initialized ${analysis.performanceMetrics.length} performance metrics`,
|
|
247
|
+
errorMessage: hasPerformanceMetrics ? undefined : 'Performance metrics not initialized',
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
tests.push({
|
|
252
|
+
testName: 'Performance Tracking - Initialization',
|
|
253
|
+
status: 'failed',
|
|
254
|
+
description: 'Validates that performance tracking is initialized for detected capabilities',
|
|
255
|
+
executionTime: Date.now() - startTime2,
|
|
256
|
+
category: 'capability',
|
|
257
|
+
errorMessage: getErrorMessage(error),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return tests;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Validate delegation integration system
|
|
264
|
+
*/
|
|
265
|
+
async validateDelegationIntegration() {
|
|
266
|
+
const tests = [];
|
|
267
|
+
// Test 1: Agent onboarding integration
|
|
268
|
+
const startTime1 = Date.now();
|
|
269
|
+
try {
|
|
270
|
+
const mockAgent = {
|
|
271
|
+
type: 'json',
|
|
272
|
+
definition: {
|
|
273
|
+
name: 'delegation-test-agent',
|
|
274
|
+
description: 'Agent for testing delegation integration',
|
|
275
|
+
capabilities: ['pattern_enforcement', 'code_generation'],
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
const onboardingResult = await this.delegationIntegration.onboardAgent(mockAgent, 'delegation-test-agent');
|
|
279
|
+
tests.push({
|
|
280
|
+
testName: 'Delegation Integration - Agent Onboarding',
|
|
281
|
+
status: onboardingResult.registered ? 'passed' : 'failed',
|
|
282
|
+
description: 'Validates that agents are properly onboarded into delegation system',
|
|
283
|
+
executionTime: Date.now() - startTime1,
|
|
284
|
+
category: 'delegation',
|
|
285
|
+
details: `Agent registered: ${onboardingResult.registered}, Suggestions: ${onboardingResult.suggestions.length}`,
|
|
286
|
+
errorMessage: onboardingResult.registered ? undefined : onboardingResult.errors?.[0],
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
tests.push({
|
|
291
|
+
testName: 'Delegation Integration - Agent Onboarding',
|
|
292
|
+
status: 'failed',
|
|
293
|
+
description: 'Validates that agents are properly onboarded into delegation system',
|
|
294
|
+
executionTime: Date.now() - startTime1,
|
|
295
|
+
category: 'delegation',
|
|
296
|
+
errorMessage: getErrorMessage(error),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
// Test 2: Agent selection for delegation
|
|
300
|
+
const startTime2 = Date.now();
|
|
301
|
+
try {
|
|
302
|
+
const requiredCapabilities = [
|
|
303
|
+
{
|
|
304
|
+
capability_id: 'pattern_enforcement',
|
|
305
|
+
name: 'Pattern Enforcement',
|
|
306
|
+
description: 'Enforce coding patterns and conventions',
|
|
307
|
+
priority: 5,
|
|
308
|
+
},
|
|
309
|
+
];
|
|
310
|
+
const recommendations = await this.delegationIntegration.findOptimalAgent(requiredCapabilities);
|
|
311
|
+
tests.push({
|
|
312
|
+
testName: 'Delegation Integration - Agent Selection',
|
|
313
|
+
status: recommendations.length > 0 ? 'passed' : 'failed',
|
|
314
|
+
description: 'Validates that appropriate agents are selected for delegation tasks',
|
|
315
|
+
executionTime: Date.now() - startTime2,
|
|
316
|
+
category: 'delegation',
|
|
317
|
+
details: `Found ${recommendations.length} agent recommendations`,
|
|
318
|
+
errorMessage: recommendations.length > 0 ? undefined : 'No suitable agents found for delegation',
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
tests.push({
|
|
323
|
+
testName: 'Delegation Integration - Agent Selection',
|
|
324
|
+
status: 'failed',
|
|
325
|
+
description: 'Validates that appropriate agents are selected for delegation tasks',
|
|
326
|
+
executionTime: Date.now() - startTime2,
|
|
327
|
+
category: 'delegation',
|
|
328
|
+
errorMessage: getErrorMessage(error),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
return tests;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Validate MCP auto-configuration system
|
|
335
|
+
*/
|
|
336
|
+
async validateMCPAutoConfiguration() {
|
|
337
|
+
const tests = [];
|
|
338
|
+
// Test 1: Configuration generation
|
|
339
|
+
const startTime1 = Date.now();
|
|
340
|
+
try {
|
|
341
|
+
const configResult = await this.mcpAutoConfig.generateConfiguration();
|
|
342
|
+
tests.push({
|
|
343
|
+
testName: 'MCP Auto-Configuration - Generation',
|
|
344
|
+
status: configResult.servers.length > 0 ? 'passed' : 'failed',
|
|
345
|
+
description: 'Validates that MCP servers are properly configured based on agent capabilities',
|
|
346
|
+
executionTime: Date.now() - startTime1,
|
|
347
|
+
category: 'mcp',
|
|
348
|
+
details: `Configured ${configResult.servers.length} MCP servers, Started ${configResult.startedServers.length} servers`,
|
|
349
|
+
errorMessage: configResult.servers.length > 0 ? undefined : 'No MCP servers configured',
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
tests.push({
|
|
354
|
+
testName: 'MCP Auto-Configuration - Generation',
|
|
355
|
+
status: 'failed',
|
|
356
|
+
description: 'Validates that MCP servers are properly configured based on agent capabilities',
|
|
357
|
+
executionTime: Date.now() - startTime1,
|
|
358
|
+
category: 'mcp',
|
|
359
|
+
errorMessage: getErrorMessage(error),
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
// Test 2: Health monitoring
|
|
363
|
+
const startTime2 = Date.now();
|
|
364
|
+
try {
|
|
365
|
+
const healthResults = await this.mcpAutoConfig.healthCheckServers();
|
|
366
|
+
const totalServers = healthResults.size;
|
|
367
|
+
const healthyServers = Array.from(healthResults.values()).filter(healthy => healthy).length;
|
|
368
|
+
tests.push({
|
|
369
|
+
testName: 'MCP Auto-Configuration - Health Monitoring',
|
|
370
|
+
status: healthyServers >= totalServers * 0.8 ? 'passed' : 'failed', // 80% healthy threshold
|
|
371
|
+
description: 'Validates that MCP server health monitoring is working correctly',
|
|
372
|
+
executionTime: Date.now() - startTime2,
|
|
373
|
+
category: 'mcp',
|
|
374
|
+
details: `${healthyServers}/${totalServers} servers healthy`,
|
|
375
|
+
errorMessage: healthyServers >= totalServers * 0.8 ? undefined : 'Too many unhealthy MCP servers',
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
tests.push({
|
|
380
|
+
testName: 'MCP Auto-Configuration - Health Monitoring',
|
|
381
|
+
status: 'failed',
|
|
382
|
+
description: 'Validates that MCP server health monitoring is working correctly',
|
|
383
|
+
executionTime: Date.now() - startTime2,
|
|
384
|
+
category: 'mcp',
|
|
385
|
+
errorMessage: getErrorMessage(error),
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
return tests;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Validate end-to-end integration workflow
|
|
392
|
+
*/
|
|
393
|
+
async validateEndToEndIntegration() {
|
|
394
|
+
const tests = [];
|
|
395
|
+
const startTime = Date.now();
|
|
396
|
+
try {
|
|
397
|
+
// End-to-end workflow:
|
|
398
|
+
// 1. Onboard agent → 2. Create delegation → 3. MCP auto-config → 4. Performance tracking
|
|
399
|
+
// Step 1: Onboard agent
|
|
400
|
+
const mockAgent = {
|
|
401
|
+
type: 'markdown',
|
|
402
|
+
content: `
|
|
403
|
+
---
|
|
404
|
+
name: e2e-test-agent
|
|
405
|
+
description: End-to-end validation agent
|
|
406
|
+
tools: ['read', 'edit', 'search']
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
# E2E Test Agent
|
|
410
|
+
|
|
411
|
+
This agent handles design token validation and security scanning.
|
|
412
|
+
`,
|
|
413
|
+
};
|
|
414
|
+
const onboardingResult = await this.delegationIntegration.onboardAgent(mockAgent, 'e2e-test-agent');
|
|
415
|
+
if (!onboardingResult.registered) {
|
|
416
|
+
throw new Error('Agent onboarding failed in E2E test');
|
|
417
|
+
}
|
|
418
|
+
// Step 2: Create delegation contract
|
|
419
|
+
const requiredCapabilities = [
|
|
420
|
+
{
|
|
421
|
+
capability_id: 'design_token_compliance',
|
|
422
|
+
name: 'Design Token Compliance',
|
|
423
|
+
description: 'Validate design token usage',
|
|
424
|
+
priority: 8,
|
|
425
|
+
},
|
|
426
|
+
];
|
|
427
|
+
const contractResult = await this.delegationIntegration.createDelegationContract('E2E validation task', requiredCapabilities, 'validation-delegator');
|
|
428
|
+
// Step 3: Verify MCP configuration updated
|
|
429
|
+
const mcpStatus = await this.mcpAutoConfig.getServerStatus();
|
|
430
|
+
const designTokenServer = mcpStatus.find(server => server.name === 'dcyfr-designtokens');
|
|
431
|
+
// Step 4: Check performance tracking
|
|
432
|
+
const capabilityAnalysis = await this.capabilityDetection.getCapabilityAnalysis('e2e-test-agent');
|
|
433
|
+
tests.push({
|
|
434
|
+
testName: 'End-to-End Integration - Complete Workflow',
|
|
435
|
+
status: 'passed',
|
|
436
|
+
description: 'Validates complete integration workflow from onboarding to delegation',
|
|
437
|
+
executionTime: Date.now() - startTime,
|
|
438
|
+
category: 'integration',
|
|
439
|
+
details: `Onboarded agent → Created contract ${contractResult.contractId} → MCP servers: ${mcpStatus.length} → Performance metrics: ${capabilityAnalysis.performanceMetrics.length}`,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
tests.push({
|
|
444
|
+
testName: 'End-to-End Integration - Complete Workflow',
|
|
445
|
+
status: 'failed',
|
|
446
|
+
description: 'Validates complete integration workflow from onboarding to delegation',
|
|
447
|
+
executionTime: Date.now() - startTime,
|
|
448
|
+
category: 'integration',
|
|
449
|
+
errorMessage: getErrorMessage(error),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
return tests;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Validate system performance
|
|
456
|
+
*/
|
|
457
|
+
async validatePerformance() {
|
|
458
|
+
const tests = [];
|
|
459
|
+
// Test 1: Response time validation
|
|
460
|
+
const startTime1 = Date.now();
|
|
461
|
+
try {
|
|
462
|
+
const systemMetrics = await this.capabilityDetection.getSystemMetrics();
|
|
463
|
+
const delegationMetrics = await this.delegationIntegration.getSystemMetrics();
|
|
464
|
+
const responseTime = Date.now() - startTime1;
|
|
465
|
+
const acceptable = responseTime < 5000; // 5 second max
|
|
466
|
+
tests.push({
|
|
467
|
+
testName: 'Performance - System Response Time',
|
|
468
|
+
status: acceptable ? 'passed' : 'failed',
|
|
469
|
+
description: 'Validates that system responds within acceptable time limits',
|
|
470
|
+
executionTime: responseTime,
|
|
471
|
+
category: 'performance',
|
|
472
|
+
details: `System metrics response: ${responseTime}ms, Agents: ${systemMetrics.totalAgents}, Contracts: ${delegationMetrics.activeContracts}`,
|
|
473
|
+
errorMessage: acceptable ? undefined : `Response time ${responseTime}ms exceeds 5000ms threshold`,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
catch (error) {
|
|
477
|
+
tests.push({
|
|
478
|
+
testName: 'Performance - System Response Time',
|
|
479
|
+
status: 'failed',
|
|
480
|
+
description: 'Validates that system responds within acceptable time limits',
|
|
481
|
+
executionTime: Date.now() - startTime1,
|
|
482
|
+
category: 'performance',
|
|
483
|
+
errorMessage: getErrorMessage(error),
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
return tests;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Collect system health metrics
|
|
490
|
+
*/
|
|
491
|
+
async collectSystemHealthMetrics() {
|
|
492
|
+
try {
|
|
493
|
+
const systemMetrics = await this.capabilityDetection.getSystemMetrics();
|
|
494
|
+
const delegationMetrics = await this.delegationIntegration.getSystemMetrics();
|
|
495
|
+
const mcpStatus = await this.mcpAutoConfig.getServerStatus();
|
|
496
|
+
const mcpHealthResults = await this.mcpAutoConfig.healthCheckServers();
|
|
497
|
+
return {
|
|
498
|
+
totalAgents: systemMetrics.totalAgents,
|
|
499
|
+
activeContracts: delegationMetrics.activeContracts,
|
|
500
|
+
mcpServersConfigured: mcpStatus.length,
|
|
501
|
+
mcpServersHealthy: Array.from(mcpHealthResults.values()).filter(healthy => healthy).length,
|
|
502
|
+
averageAgentConfidence: delegationMetrics.averageConfidence,
|
|
503
|
+
averageCapabilitySuccessRate: systemMetrics.averageSuccessRate,
|
|
504
|
+
systemUptime: Date.now() - this.systemStartTime.getTime(),
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
catch (error) {
|
|
508
|
+
return {
|
|
509
|
+
totalAgents: 0,
|
|
510
|
+
activeContracts: 0,
|
|
511
|
+
mcpServersConfigured: 0,
|
|
512
|
+
mcpServersHealthy: 0,
|
|
513
|
+
averageAgentConfidence: 0,
|
|
514
|
+
averageCapabilitySuccessRate: 0,
|
|
515
|
+
systemUptime: Date.now() - this.systemStartTime.getTime(),
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Collect integration performance metrics
|
|
521
|
+
*/
|
|
522
|
+
async collectPerformanceMetrics() {
|
|
523
|
+
// In a real implementation, these would be collected from performance monitoring
|
|
524
|
+
return {
|
|
525
|
+
averageOnboardingTime: 2500,
|
|
526
|
+
averageDelegationTime: 1800,
|
|
527
|
+
averageMCPConfigTime: 1200,
|
|
528
|
+
averageCapabilityDetectionTime: 800,
|
|
529
|
+
totalThroughput: 15,
|
|
530
|
+
systemResourceUtilization: 0.3,
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Analyze validation results and generate recommendations
|
|
535
|
+
*/
|
|
536
|
+
analyzeValidationResults(testResults, systemHealth, performanceMetrics) {
|
|
537
|
+
const warnings = [];
|
|
538
|
+
const errors = [];
|
|
539
|
+
const recommendations = [];
|
|
540
|
+
// Analyze test results
|
|
541
|
+
const failedTests = testResults.filter(test => test.status === 'failed');
|
|
542
|
+
const slowTests = testResults.filter(test => test.executionTime > 10000);
|
|
543
|
+
if (failedTests.length > 0) {
|
|
544
|
+
errors.push(`${failedTests.length} validation tests failed`);
|
|
545
|
+
recommendations.push('Review failed test details and fix underlying issues');
|
|
546
|
+
}
|
|
547
|
+
if (slowTests.length > 0) {
|
|
548
|
+
warnings.push(`${slowTests.length} tests executed slowly (>10s)`);
|
|
549
|
+
recommendations.push('Investigate performance bottlenecks in slow tests');
|
|
550
|
+
}
|
|
551
|
+
// Analyze system health
|
|
552
|
+
if (systemHealth.mcpServersHealthy < systemHealth.mcpServersConfigured * 0.8) {
|
|
553
|
+
warnings.push('Some MCP servers are unhealthy');
|
|
554
|
+
recommendations.push('Check MCP server configurations and network connectivity');
|
|
555
|
+
}
|
|
556
|
+
if (systemHealth.averageAgentConfidence < (this.config.minConfidenceThreshold ?? 0.7)) {
|
|
557
|
+
warnings.push('Average agent confidence below threshold');
|
|
558
|
+
recommendations.push('Consider additional training or capability refinement for agents');
|
|
559
|
+
}
|
|
560
|
+
// Analyze performance metrics
|
|
561
|
+
if (performanceMetrics && performanceMetrics.averageOnboardingTime && performanceMetrics.averageOnboardingTime > 5000) {
|
|
562
|
+
warnings.push('Agent onboarding time is high');
|
|
563
|
+
recommendations.push('Optimize capability detection algorithms for faster onboarding');
|
|
564
|
+
}
|
|
565
|
+
if (performanceMetrics && performanceMetrics.systemResourceUtilization && performanceMetrics.systemResourceUtilization > 0.8) {
|
|
566
|
+
warnings.push('High system resource utilization');
|
|
567
|
+
recommendations.push('Consider scaling resources or optimizing resource usage');
|
|
568
|
+
}
|
|
569
|
+
return { warnings, errors, recommendations };
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Write validation report to file
|
|
573
|
+
*/
|
|
574
|
+
async writeValidationReport(result) {
|
|
575
|
+
try {
|
|
576
|
+
const fs = await import('fs/promises');
|
|
577
|
+
const path = await import('path');
|
|
578
|
+
// Ensure output directory exists
|
|
579
|
+
await fs.mkdir(this.config.reportOutputDir, { recursive: true });
|
|
580
|
+
const timestamp = result.validatedAt.toISOString().replace(/[:.]/g, '-');
|
|
581
|
+
const reportPath = path.join(this.config.reportOutputDir, `validation-report-${timestamp}.json`);
|
|
582
|
+
await fs.writeFile(reportPath, JSON.stringify(result, null, 2), 'utf-8');
|
|
583
|
+
// Also write a human-readable summary
|
|
584
|
+
const summaryPath = path.join(this.config.reportOutputDir, `validation-summary-${timestamp}.md`);
|
|
585
|
+
const summary = this.generateReportSummary(result);
|
|
586
|
+
await fs.writeFile(summaryPath, summary, 'utf-8');
|
|
587
|
+
this.emit('validation_report_written', { reportPath, summaryPath });
|
|
588
|
+
}
|
|
589
|
+
catch (error) {
|
|
590
|
+
this.emit('validation_report_error', { error: getErrorMessage(error) });
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Generate human-readable validation report summary
|
|
595
|
+
*/
|
|
596
|
+
generateReportSummary(result) {
|
|
597
|
+
const { testResults, systemHealth, performanceMetrics } = result;
|
|
598
|
+
const passedTests = testResults.filter(test => test.status === 'passed').length;
|
|
599
|
+
const failedTests = testResults.filter(test => test.status === 'failed').length;
|
|
600
|
+
const totalTests = testResults.length;
|
|
601
|
+
return `# Validation Pipeline Report
|
|
602
|
+
|
|
603
|
+
**Status:** ${result.overallStatus.toUpperCase()}
|
|
604
|
+
**Validated:** ${result.validatedAt.toISOString()}
|
|
605
|
+
**Duration:** ${result.validationDuration}ms
|
|
606
|
+
|
|
607
|
+
## Test Results Summary
|
|
608
|
+
|
|
609
|
+
- **Total Tests:** ${totalTests}
|
|
610
|
+
- **Passed:** ${passedTests}
|
|
611
|
+
- **Failed:** ${failedTests}
|
|
612
|
+
- **Success Rate:** ${totalTests > 0 ? ((passedTests / totalTests) * 100).toFixed(1) : 0}%
|
|
613
|
+
|
|
614
|
+
## System Health
|
|
615
|
+
|
|
616
|
+
- **Total Agents:** ${systemHealth.totalAgents}
|
|
617
|
+
- **Active Contracts:** ${systemHealth.activeContracts}
|
|
618
|
+
- **MCP Servers:** ${systemHealth.mcpServersHealthy}/${systemHealth.mcpServersConfigured} healthy
|
|
619
|
+
- **Average Agent Confidence:** ${(systemHealth.averageAgentConfidence * 100).toFixed(1)}%
|
|
620
|
+
- **Average Success Rate:** ${(systemHealth.averageCapabilitySuccessRate * 100).toFixed(1)}%
|
|
621
|
+
|
|
622
|
+
## Performance Metrics
|
|
623
|
+
|
|
624
|
+
- **Onboarding Time:** ${performanceMetrics.averageOnboardingTime}ms
|
|
625
|
+
- **Delegation Time:** ${performanceMetrics.averageDelegationTime}ms
|
|
626
|
+
- **MCP Config Time:** ${performanceMetrics.averageMCPConfigTime}ms
|
|
627
|
+
- **Throughput:** ${performanceMetrics.totalThroughput} ops/min
|
|
628
|
+
- **Resource Utilization:** ${(performanceMetrics.systemResourceUtilization * 100).toFixed(1)}%
|
|
629
|
+
|
|
630
|
+
${result.warnings.length > 0 ? `## Warnings
|
|
631
|
+
|
|
632
|
+
${result.warnings.map(warning => `- ${warning}`).join('\n')}` : ''}
|
|
633
|
+
|
|
634
|
+
${result.errors.length > 0 ? `## Errors
|
|
635
|
+
|
|
636
|
+
${result.errors.map(error => `- ${error}`).join('\n')}` : ''}
|
|
637
|
+
|
|
638
|
+
${result.recommendations.length > 0 ? `## Recommendations
|
|
639
|
+
|
|
640
|
+
${result.recommendations.map(rec => `- ${rec}`).join('\n')}` : ''}
|
|
641
|
+
|
|
642
|
+
## Detailed Test Results
|
|
643
|
+
|
|
644
|
+
${testResults.map(test => `### ${test.testName} (${test.category})
|
|
645
|
+
- **Status:** ${test.status}
|
|
646
|
+
- **Description:** ${test.description}
|
|
647
|
+
- **Execution Time:** ${test.executionTime}ms
|
|
648
|
+
${test.details ? `- **Details:** ${test.details}` : ''}
|
|
649
|
+
${test.errorMessage ? `- **Error:** ${test.errorMessage}` : ''}
|
|
650
|
+
`).join('\n')}
|
|
651
|
+
`;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Start continuous monitoring
|
|
655
|
+
*/
|
|
656
|
+
startContinuousMonitoring() {
|
|
657
|
+
// Run validation every 30 minutes
|
|
658
|
+
this.monitoringTimer = setInterval(() => {
|
|
659
|
+
this.validatePipeline().catch(error => {
|
|
660
|
+
this.emit('monitoring_error', { error: getErrorMessage(error) });
|
|
661
|
+
});
|
|
662
|
+
}, 30 * 60 * 1000);
|
|
663
|
+
this.emit('continuous_monitoring_started');
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Stop continuous monitoring
|
|
667
|
+
*/
|
|
668
|
+
stopContinuousMonitoring() {
|
|
669
|
+
if (this.monitoringTimer) {
|
|
670
|
+
clearInterval(this.monitoringTimer);
|
|
671
|
+
this.monitoringTimer = undefined;
|
|
672
|
+
this.emit('continuous_monitoring_stopped');
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Cleanup and shutdown
|
|
677
|
+
*/
|
|
678
|
+
async shutdown() {
|
|
679
|
+
this.stopContinuousMonitoring();
|
|
680
|
+
this.removeAllListeners();
|
|
681
|
+
await Promise.all([
|
|
682
|
+
this.delegationIntegration.shutdown(),
|
|
683
|
+
this.capabilityDetection.shutdown(),
|
|
684
|
+
this.mcpAutoConfig.shutdown(),
|
|
685
|
+
]);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Factory function for validation pipeline integration
|
|
690
|
+
*/
|
|
691
|
+
export function createValidationPipelineIntegration(config) {
|
|
692
|
+
return new ValidationPipelineIntegration(config);
|
|
693
|
+
}
|
|
694
|
+
export default ValidationPipelineIntegration;
|
|
695
|
+
//# sourceMappingURL=validation-pipeline-integration.js.map
|