claude-flow-novice 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/cfn-loop/product-owner.md +54 -4
- package/.claude/commands/cfn-claude-sync.md +303 -0
- package/.claude/commands/cfn-loop-epic.md +290 -0
- package/.claude/commands/cfn-loop-single.md +168 -0
- package/.claude/commands/cfn-loop-sprints.md +384 -0
- package/.claude/commands/cfn-loop.md +180 -0
- package/.claude/commands/metrics-summary.md +58 -0
- package/.claude/commands/parse-epic.md +357 -0
- package/.claude/settings.json +5 -4
- package/.claude/settings.local.json +9 -2
- package/.claude-flow-novice/.claude/agents/cfn-loop/product-owner.md +792 -0
- package/.claude-flow-novice/dist/mcp/server.js +21 -2
- package/.claude-flow-novice/dist/src/api/auth-service.js +84 -38
- package/.claude-flow-novice/dist/src/api/auth-service.js.map +1 -1
- package/.claude-flow-novice/dist/src/api/claude-client.js +138 -3
- package/.claude-flow-novice/dist/src/api/claude-client.js.map +1 -1
- package/.claude-flow-novice/dist/src/cfn-loop/phase-orchestrator-example.js +1 -1
- package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js +247 -0
- package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js +32 -15
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/transparency.js +455 -0
- package/.claude-flow-novice/dist/src/cli/commands/transparency.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +129 -13
- package/.claude-flow-novice/dist/src/components/visualizations/index.js +9 -0
- package/.claude-flow-novice/dist/src/components/visualizations/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +462 -0
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js +248 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +287 -0
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js +68 -9
- package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/feature-flags.js +166 -0
- package/.claude-flow-novice/dist/src/coordination/feature-flags.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/queen-agent.js +18 -4
- package/.claude-flow-novice/dist/src/coordination/queen-agent.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/role-assignment.js +6 -110
- package/.claude-flow-novice/dist/src/coordination/role-assignment.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js +632 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js +11 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js +318 -0
- package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js +364 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js +492 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js +786 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js +601 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js +211 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/index.js +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js +365 -6
- package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js +478 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js +5 -2
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js +189 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js +669 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js +451 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js +271 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js +92 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js +21 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js +223 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js +436 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js +278 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js +317 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js +15 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js +512 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/index.js +6 -0
- package/.claude-flow-novice/dist/src/coordination/v2/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js +557 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js +212 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js +552 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js +367 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js +371 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js +355 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js +295 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js +411 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js +387 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js +589 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js +444 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js +29 -8
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js +470 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js +450 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js +5 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js +545 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js +44 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js +415 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js +615 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js +17 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js +357 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js +679 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/agent-manager.js +30 -0
- package/.claude-flow-novice/dist/src/core/agent-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/mcp/server.js +21 -2
- package/.claude-flow-novice/dist/src/mcp/server.js.map +1 -1
- package/.claude-flow-novice/dist/src/monitoring/apm/apm-integration.js +719 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/apm-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/datadog-collector.js +363 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/datadog-collector.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/index.js +97 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/newrelic-collector.js +384 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/newrelic-collector.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/performance-optimizer.js +612 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/performance-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/metrics-collector.js +282 -0
- package/.claude-flow-novice/dist/src/monitoring/metrics-collector.js.map +1 -0
- package/.claude-flow-novice/dist/src/observability/metrics-counter.js +268 -0
- package/.claude-flow-novice/dist/src/observability/metrics-counter.js.map +1 -0
- package/.claude-flow-novice/dist/src/observability/metrics-storage.js +265 -0
- package/.claude-flow-novice/dist/src/observability/metrics-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/observability/telemetry.js +26 -0
- package/.claude-flow-novice/dist/src/observability/telemetry.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/tiered-router.js +64 -10
- package/.claude-flow-novice/dist/src/providers/tiered-router.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/zai-provider.js +196 -97
- package/.claude-flow-novice/dist/src/providers/zai-provider.js.map +1 -1
- package/.claude-flow-novice/dist/src/slash-commands/cfn-claude-sync.js +533 -0
- package/.claude-flow-novice/dist/src/slash-commands/index.js +5 -0
- package/.claude-flow-novice/dist/src/slash-commands/metrics-summary-class.js +74 -0
- package/.claude-flow-novice/dist/src/slash-commands/metrics-summary.js +335 -0
- package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +12 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js +96 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js +406 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js +35 -5
- package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/web/api/apm-routes.js +355 -0
- package/.claude-flow-novice/dist/src/web/api/apm-routes.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/config/api-config.js +186 -0
- package/.claude-flow-novice/dist/src/web/api/config/api-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/auth.js +205 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/auth.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/cache.js +262 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/cache.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js +250 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js +217 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/validation.js +325 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/validation.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/events.js +465 -0
- package/.claude-flow-novice/dist/src/web/api/routes/events.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js +302 -0
- package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/index.js +14 -0
- package/.claude-flow-novice/dist/src/web/api/routes/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/metrics.js +561 -0
- package/.claude-flow-novice/dist/src/web/api/routes/metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/status.js +450 -0
- package/.claude-flow-novice/dist/src/web/api/routes/status.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/server.js +451 -0
- package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js +385 -0
- package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/index.js +87 -0
- package/.claude-flow-novice/dist/src/web/dashboard/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/types.js +6 -0
- package/.claude-flow-novice/dist/src/web/dashboard/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/frontend/src/utils/security.js +425 -0
- package/.claude-flow-novice/dist/src/web/frontend/src/utils/security.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/security/security-middleware.js +379 -0
- package/.claude-flow-novice/dist/src/web/security/security-middleware.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/websocket/apm-websocket-handler.js +441 -0
- package/.claude-flow-novice/dist/src/web/websocket/apm-websocket-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/websocket/websocket-manager.js +255 -1
- package/.claude-flow-novice/dist/src/web/websocket/websocket-manager.js.map +1 -1
- package/.claude-flow-novice/metrics.db +0 -0
- package/.claude-flow-novice/metrics.db-shm +0 -0
- package/.claude-flow-novice/metrics.db-wal +0 -0
- package/AGENT_PERFORMANCE_GUIDELINES.md +88 -0
- package/CLAUDE.md +60 -3
- package/MEMORY_LEAK_ROOT_CAUSE.md +149 -0
- package/README.md +27 -0
- package/config/hooks/post-edit-pipeline.js +36 -2
- package/examples/metrics-counter-demo.ts +106 -0
- package/examples/persistent-metrics-demo.ts +83 -0
- package/examples/phase-5-multi-level-control.ts +282 -0
- package/examples/session-pool-optimizer-example.ts +311 -0
- package/package.json +18 -4
- package/scripts/check-routing-stats.cjs +122 -0
- package/scripts/monitor-loop.sh +65 -0
- package/scripts/monitor-memory.sh +47 -0
- package/scripts/monitor.py +43 -0
- package/scripts/pre-publish-validation.cjs +212 -0
- package/scripts/test-provider-routing.cjs +228 -0
- package/scripts/test-routing-telemetry.cjs +147 -0
- package/scripts/test-zai-10k.cjs +81 -0
- package/scripts/test-zai-api.cjs +191 -0
- package/scripts/test-zai-diagnostic.cjs +151 -0
- package/scripts/test-zai-final.cjs +128 -0
- package/scripts/test-zai-with-env.cjs +85 -0
- package/scripts/validate-coordination-cli.js +69 -0
- package/scripts/validate-coordination-toggle-integration.cjs +501 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +29 -0
- package/src/observability/metrics-counter.ts +347 -0
- package/src/observability/metrics-storage.ts +356 -0
- package/src/observability/telemetry.ts +658 -0
- package/src/slash-commands/cfn-claude-sync.js +533 -0
- package/src/slash-commands/index.js +5 -0
- package/src/slash-commands/metrics-summary-class.js +74 -0
- package/src/slash-commands/metrics-summary.js +335 -0
- package/src/slash-commands/register-all-commands.js +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/coordination/adapters/v1-coordinator-adapter.ts"],"names":["AgentState","Logger","V1CoordinatorAdapter","logger","isInitialized","startTime","Date","now","spawnedAgents","Map","agentSessions","metrics","totalAgentsSpawned","totalTerminations","totalCheckpoints","totalRestores","checkpointLatencies","restoreLatencies","tokensSaved","totalTokensUsed","v1Coordinator","fallbackBehavior","validateCoordinatorObject","level","format","destination","component","coordinator","Error","dangerousKeys","key","Object","prototype","hasOwnProperty","call","requiredProps","prop","join","validTopologies","includes","topology","initialize","warn","info","cleanup","shutdown","clear","isReady","spawnAgent","config","debug","agentId","type","v1Result","agent","queenAgent","workerId","spawnWorker","skills","metadata","maxConcurrentTasks","priority","specializations","caller","task","id","description","dependencies","status","input","createdAt","delegateTask","mapV1DelegationResultToAgent","meshCoordinator","registerAgent","name","capabilities","taskId","coordinateTask","requiredCapabilities","mapV1MeshResultToAgent","set","session","sessionId","state","isPaused","checkpoints","pauseAgent","reason","resumeAgent","checkpointId","messageUUID","terminateAgent","get","delete","getAgentState","getAgentSession","createCheckpoint","stubCheckpoint","IDLE","timestamp","autoCheckpoint","context","v1Adapter","restoreCheckpoint","firstAgent","Array","from","values","listCheckpoints","limit","getMetrics","activeAgents","filter","TERMINATED","COMPLETED","length","pausedAgents","PAUSED","avgCheckpointTime","reduce","sum","val","avgRestoreTime","p99RestoreTime","Math","max","averageCheckpointTimeMs","averageRestoreTimeMs","p99RestoreTimeMs","uptimeMs","getActiveAgents","getPausedAgents","updateTokenUsage","tokensUsed","mapV1StatusToAgentState","v1WorkerId","v1TaskId","v1DelegatedAt","delegatedAt","WORKING","v1Status","WAITING","ERROR","getTopology","getA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gBACVC,aAAa,EAAE;gBACfzB,UAAUZ,OAAOY,QAAQ,IAAI;gBAC7BF,UAAU;oBACR,GAAGV,OAAOU,QAAQ;oBAClB8E,UAAU5D;gBACZ;YACF;YACAlB,UAAU;gBACR,GAAGV,OAAOU,QAAQ;gBAClB8E,UAAU5D;YACZ;QACF;IACF;IAEA;;GAEC,GACD,AAAQ0D,wBACNM,QAAqD,EACzC;QACZ,OAAQA;YACN,KAAK;gBACH,OAAO7I,WAAW4I,OAAO;YAC3B,KAAK;gBACH,OAAO5I,WAAW8I,OAAO;YAC3B,KAAK;gBACH,OAAO9I,WAAW+I,KAAK;YACzB;gBACE,OAAO/I,WAAWmG,IAAI;QAC1B;IACF;IAEA;;;GAGC,GACD6C,cAAuC;QACrC,MAAMxG,WAAW,IAAI,CAACpB,aAAa,CAACoB,QAAQ;QAC5C,8CAA8C;QAC9C,OAAOA,aAAa,WAAW,SAASA;IAC1C;IAEA;;GAEC,GACDyG,gBAAwB;QACtB,IAAI,IAAI,CAAC7H,aAAa,CAACoB,QAAQ,KAAK,gBAAgB;YAClD,MAAMe,aAAa,IAAI,CAACnC,aAAa,CAACO,WAAW;YACjD,MAAMuH,QAAQ3F,WAAW4F,cAAc;YACvC,OAAOD,MAAME,KAAK;QACpB,OAAO;YACL,MAAM3E,kBAAkB,IAAI,CAACrD,aAAa,CAACO,WAAW;YACtD,MAAMyC,SAASK,gBAAgB4E,oBAAoB;YACnD,OAAOjF,OAAOkF,UAAU;QAC1B;IACF;AACF"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfigTranslator - Unified configuration translation for V1/V2 coordination systems
|
|
3
|
+
*
|
|
4
|
+
* Provides bidirectional translation between unified configuration format
|
|
5
|
+
* and version-specific config structures for V1 (CoordinationTopologyConfig)
|
|
6
|
+
* and V2 (FactoryOptions).
|
|
7
|
+
*
|
|
8
|
+
* @module coordination/config-translator
|
|
9
|
+
*/ /**
|
|
10
|
+
* ConfigTranslator - Static utility class for config translation
|
|
11
|
+
*
|
|
12
|
+
* Handles bidirectional conversion between unified config and version-specific formats.
|
|
13
|
+
* Provides intelligent defaults based on topology and agent count.
|
|
14
|
+
*
|
|
15
|
+
* Key Translation Rules:
|
|
16
|
+
* - topology: 'mesh' → V1 mesh config / V2 SDK mode
|
|
17
|
+
* - topology: 'hierarchical' → V1 hierarchical config / V2 SDK mode
|
|
18
|
+
* - maxAgents → V1 maxAgents / V2 maxConcurrentAgents
|
|
19
|
+
* - strategy → V1 strategy / V2 enableDynamicAllocation
|
|
20
|
+
* - enableConsensus → V1 consensus config / V2 N/A (built-in)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const unified: UnifiedCoordinatorConfig = {
|
|
25
|
+
* topology: 'mesh',
|
|
26
|
+
* maxAgents: 5,
|
|
27
|
+
* strategy: 'balanced',
|
|
28
|
+
* enableConsensus: true
|
|
29
|
+
* };
|
|
30
|
+
*
|
|
31
|
+
* // Translate to V1
|
|
32
|
+
* const v1Config = ConfigTranslator.toV1Config(unified);
|
|
33
|
+
* const coordinator = await createTopologyCoordinator(v1Config, deps);
|
|
34
|
+
*
|
|
35
|
+
* // Translate to V2
|
|
36
|
+
* const v2Config = ConfigTranslator.toV2Config(unified);
|
|
37
|
+
* const coordinator = await CoordinatorFactory.create(v2Config);
|
|
38
|
+
* ```
|
|
39
|
+
*/ export class ConfigTranslator {
|
|
40
|
+
/**
|
|
41
|
+
* Translate unified config to V1 CoordinationTopologyConfig
|
|
42
|
+
*
|
|
43
|
+
* Generates topology-specific config objects for hierarchical or mesh modes.
|
|
44
|
+
* Applies intelligent defaults based on agent count and topology type.
|
|
45
|
+
*
|
|
46
|
+
* @param unified - Unified coordinator configuration
|
|
47
|
+
* @returns V1 CoordinationTopologyConfig
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const v1Config = ConfigTranslator.toV1Config({
|
|
52
|
+
* topology: 'hierarchical',
|
|
53
|
+
* maxAgents: 15,
|
|
54
|
+
* strategy: 'adaptive'
|
|
55
|
+
* });
|
|
56
|
+
* // Returns: { topology: 'hierarchical', maxAgents: 15, hierarchical: {...}, consensus: {...} }
|
|
57
|
+
* ```
|
|
58
|
+
*/ static toV1Config(unified) {
|
|
59
|
+
const topology = unified.topology || 'mesh';
|
|
60
|
+
const maxAgents = unified.maxAgents || 10;
|
|
61
|
+
const strategy = unified.strategy || 'balanced';
|
|
62
|
+
const config = {
|
|
63
|
+
topology,
|
|
64
|
+
maxAgents,
|
|
65
|
+
strategy
|
|
66
|
+
};
|
|
67
|
+
// Add hierarchical-specific config
|
|
68
|
+
if (topology === 'hierarchical') {
|
|
69
|
+
const hierarchicalConfig = {
|
|
70
|
+
minWorkers: Math.min(8, maxAgents),
|
|
71
|
+
maxWorkers: maxAgents,
|
|
72
|
+
autoScale: true,
|
|
73
|
+
scalingThreshold: 0.8,
|
|
74
|
+
healthCheckInterval: 30000,
|
|
75
|
+
taskTimeout: 120000,
|
|
76
|
+
workerRetryAttempts: 3
|
|
77
|
+
};
|
|
78
|
+
config.hierarchical = hierarchicalConfig;
|
|
79
|
+
}
|
|
80
|
+
// Add mesh-specific config
|
|
81
|
+
if (topology === 'mesh') {
|
|
82
|
+
const meshConfig = {
|
|
83
|
+
maxAgents,
|
|
84
|
+
maxConnections: Math.floor(maxAgents / 3),
|
|
85
|
+
taskDistributionStrategy: 'capability-based',
|
|
86
|
+
enableDependencyTracking: true,
|
|
87
|
+
completionTimeout: 60000,
|
|
88
|
+
rebalanceInterval: 15000,
|
|
89
|
+
memoryNamespace: 'mesh-coordination'
|
|
90
|
+
};
|
|
91
|
+
config.mesh = meshConfig;
|
|
92
|
+
}
|
|
93
|
+
// Add consensus config if enabled
|
|
94
|
+
if (unified.enableConsensus) {
|
|
95
|
+
const protocol = topology === 'hierarchical' ? 'raft' : 'quorum';
|
|
96
|
+
const consensusConfig = {
|
|
97
|
+
protocol,
|
|
98
|
+
timeout: 5000,
|
|
99
|
+
maxRetries: 3,
|
|
100
|
+
quorumSize: Math.ceil(maxAgents / 2) + 1
|
|
101
|
+
};
|
|
102
|
+
config.consensus = consensusConfig;
|
|
103
|
+
}
|
|
104
|
+
return config;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Translate unified config to V2 FactoryOptions
|
|
108
|
+
*
|
|
109
|
+
* Generates V2-compatible config with SDK mode defaults and modern features.
|
|
110
|
+
* Always defaults to SDK mode with dynamic allocation enabled.
|
|
111
|
+
*
|
|
112
|
+
* @param unified - Unified coordinator configuration
|
|
113
|
+
* @returns V2 FactoryOptions
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const v2Config = ConfigTranslator.toV2Config({
|
|
118
|
+
* topology: 'mesh',
|
|
119
|
+
* maxAgents: 5,
|
|
120
|
+
* tokenBudget: 50000
|
|
121
|
+
* });
|
|
122
|
+
* // Returns: { mode: 'sdk', maxConcurrentAgents: 5, defaultTokenBudget: 50000, ... }
|
|
123
|
+
* ```
|
|
124
|
+
*/ static toV2Config(unified) {
|
|
125
|
+
const maxAgents = unified.maxAgents || 10;
|
|
126
|
+
const tokenBudget = unified.tokenBudget || 20000;
|
|
127
|
+
return {
|
|
128
|
+
// V2 defaults to SDK mode
|
|
129
|
+
mode: 'sdk',
|
|
130
|
+
// Agent limits
|
|
131
|
+
maxConcurrentAgents: maxAgents,
|
|
132
|
+
defaultTokenBudget: tokenBudget,
|
|
133
|
+
// API credentials (from environment or unified config)
|
|
134
|
+
apiKey: unified.apiKey || process.env.ANTHROPIC_API_KEY,
|
|
135
|
+
// Dynamic allocation (maps from strategy)
|
|
136
|
+
enableDynamicAllocation: unified.strategy !== 'performance',
|
|
137
|
+
// Logging
|
|
138
|
+
verbose: unified.verbose || false
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Validate unified config for completeness
|
|
143
|
+
*
|
|
144
|
+
* Checks that required fields are present and values are within valid ranges.
|
|
145
|
+
*
|
|
146
|
+
* @param config - Unified config to validate
|
|
147
|
+
* @returns Validation errors (empty array if valid)
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const errors = ConfigTranslator.validate({ topology: 'mesh' });
|
|
152
|
+
* if (errors.length > 0) {
|
|
153
|
+
* console.error('Config validation failed:', errors);
|
|
154
|
+
* }
|
|
155
|
+
* ```
|
|
156
|
+
*/ static validate(config) {
|
|
157
|
+
const errors = [];
|
|
158
|
+
// Validate topology
|
|
159
|
+
if (config.topology && ![
|
|
160
|
+
'mesh',
|
|
161
|
+
'hierarchical'
|
|
162
|
+
].includes(config.topology)) {
|
|
163
|
+
errors.push(`Invalid topology: ${config.topology}. Must be 'mesh' or 'hierarchical'.`);
|
|
164
|
+
}
|
|
165
|
+
// Validate maxAgents
|
|
166
|
+
if (config.maxAgents !== undefined) {
|
|
167
|
+
if (config.maxAgents < 1) {
|
|
168
|
+
errors.push(`Invalid maxAgents: ${config.maxAgents}. Must be at least 1.`);
|
|
169
|
+
}
|
|
170
|
+
if (config.maxAgents > 100) {
|
|
171
|
+
errors.push(`Invalid maxAgents: ${config.maxAgents}. Maximum is 100.`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// Validate strategy
|
|
175
|
+
if (config.strategy && ![
|
|
176
|
+
'balanced',
|
|
177
|
+
'adaptive',
|
|
178
|
+
'performance'
|
|
179
|
+
].includes(config.strategy)) {
|
|
180
|
+
errors.push(`Invalid strategy: ${config.strategy}. Must be 'balanced', 'adaptive', or 'performance'.`);
|
|
181
|
+
}
|
|
182
|
+
// Validate tokenBudget
|
|
183
|
+
if (config.tokenBudget !== undefined && config.tokenBudget < 1000) {
|
|
184
|
+
errors.push(`Invalid tokenBudget: ${config.tokenBudget}. Must be at least 1000.`);
|
|
185
|
+
}
|
|
186
|
+
return errors;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Merge multiple unified configs with priority
|
|
190
|
+
*
|
|
191
|
+
* Combines multiple config objects, with later configs taking precedence.
|
|
192
|
+
* Useful for layering defaults, environment, and user configs.
|
|
193
|
+
*
|
|
194
|
+
* @param configs - Config objects to merge (in priority order)
|
|
195
|
+
* @returns Merged unified config
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* const defaults = { topology: 'mesh', maxAgents: 5 };
|
|
200
|
+
* const userConfig = { maxAgents: 10, strategy: 'adaptive' };
|
|
201
|
+
* const merged = ConfigTranslator.merge(defaults, userConfig);
|
|
202
|
+
* // Returns: { topology: 'mesh', maxAgents: 10, strategy: 'adaptive' }
|
|
203
|
+
* ```
|
|
204
|
+
*/ static merge(...configs) {
|
|
205
|
+
return configs.reduce((acc, config)=>{
|
|
206
|
+
return {
|
|
207
|
+
...acc,
|
|
208
|
+
...config
|
|
209
|
+
};
|
|
210
|
+
}, {});
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get default config for topology type
|
|
214
|
+
*
|
|
215
|
+
* Provides opinionated defaults optimized for each topology.
|
|
216
|
+
*
|
|
217
|
+
* @param topology - Topology type
|
|
218
|
+
* @returns Default unified config
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```typescript
|
|
222
|
+
* const meshDefaults = ConfigTranslator.getDefaults('mesh');
|
|
223
|
+
* // Returns: { topology: 'mesh', maxAgents: 7, strategy: 'balanced', ... }
|
|
224
|
+
* ```
|
|
225
|
+
*/ static getDefaults(topology) {
|
|
226
|
+
if (topology === 'mesh') {
|
|
227
|
+
return {
|
|
228
|
+
topology: 'mesh',
|
|
229
|
+
maxAgents: 7,
|
|
230
|
+
strategy: 'balanced',
|
|
231
|
+
enableConsensus: true,
|
|
232
|
+
tokenBudget: 20000,
|
|
233
|
+
verbose: false
|
|
234
|
+
};
|
|
235
|
+
} else {
|
|
236
|
+
return {
|
|
237
|
+
topology: 'hierarchical',
|
|
238
|
+
maxAgents: 15,
|
|
239
|
+
strategy: 'adaptive',
|
|
240
|
+
enableConsensus: true,
|
|
241
|
+
tokenBudget: 20000,
|
|
242
|
+
verbose: false
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//# sourceMappingURL=config-translator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/coordination/config-translator.ts"],"names":["ConfigTranslator","toV1Config","unified","topology","maxAgents","strategy","config","hierarchicalConfig","minWorkers","Math","min","maxWorkers","autoScale","scalingThreshold","healthCheckInterval","taskTimeout","workerRetryAttempts","hierarchical","meshConfig","maxConnections","floor","taskDistributionStrategy","enableDependencyTracking","completionTimeout","rebalanceInterval","memoryNamespace","mesh","enableConsensus","protocol","consensusConfig","timeout","maxRetries","quorumSize","ceil","consensus","toV2Config","tokenBudget","mode","maxConcurrentAgents","defaultTokenBudget","apiKey","process","env","ANTHROPIC_API_KEY","enableDynamicAllocation","verbose","validate","errors","includes","push","undefined","merge","configs","reduce","acc","getDefaults"],"mappings":"AAAA;;;;;;;;CAQC,GAqCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMA;IACX;;;;;;;;;;;;;;;;;;GAkBC,GACD,OAAOC,WAAWC,OAAiC,EAA8B;QAC/E,MAAMC,WAAWD,QAAQC,QAAQ,IAAI;QACrC,MAAMC,YAAYF,QAAQE,SAAS,IAAI;QACvC,MAAMC,WAAWH,QAAQG,QAAQ,IAAI;QAErC,MAAMC,SAAqC;YACzCH;YACAC;YACAC;QACF;QAEA,mCAAmC;QACnC,IAAIF,aAAa,gBAAgB;YAC/B,MAAMI,qBAAgD;gBACpDC,YAAYC,KAAKC,GAAG,CAAC,GAAGN;gBACxBO,YAAYP;gBACZQ,WAAW;gBACXC,kBAAkB;gBAClBC,qBAAqB;gBACrBC,aAAa;gBACbC,qBAAqB;YACvB;YACAV,OAAOW,YA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BACjBS,aAAa;gBACbS,SAAS;YACX;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CoordinationToggle - Version-aware coordinator factory
|
|
3
|
+
*
|
|
4
|
+
* Provides unified factory interface for V1/V2 coordination systems.
|
|
5
|
+
* Auto-detects version from environment and instantiates appropriate coordinator.
|
|
6
|
+
*
|
|
7
|
+
* @module coordination/coordination-toggle
|
|
8
|
+
*/ import { CoordinatorFactory } from './v2/coordinator-factory.js';
|
|
9
|
+
import { createTopologyCoordinator } from './index.js';
|
|
10
|
+
import { Logger } from '../core/logger.js';
|
|
11
|
+
import { V1CoordinatorAdapter } from './adapters/v1-coordinator-adapter.js';
|
|
12
|
+
import { ConfigTranslator } from './config-translator.js';
|
|
13
|
+
import { TelemetrySystem } from '../observability/telemetry.js';
|
|
14
|
+
// Re-export ConfigTranslator for test compatibility
|
|
15
|
+
export { ConfigTranslator } from './config-translator.js';
|
|
16
|
+
/**
|
|
17
|
+
* CoordinationToggle - Factory selector for V1/V2 coordinators
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Auto-detects coordination version from COORDINATION_VERSION env var
|
|
21
|
+
* - Translates unified config to version-specific formats
|
|
22
|
+
* - Returns ICoordinator interface regardless of version
|
|
23
|
+
* - Enables gradual V2 migration without breaking V1 usage
|
|
24
|
+
*
|
|
25
|
+
* Version Selection Priority:
|
|
26
|
+
* 1. Explicit config.version ('v1' | 'v2')
|
|
27
|
+
* 2. COORDINATION_VERSION environment variable
|
|
28
|
+
* 3. Default: 'v2' (current recommended version)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Auto-detect version (uses COORDINATION_VERSION env var or defaults to v2)
|
|
33
|
+
* const coordinator = await CoordinationToggle.create({
|
|
34
|
+
* topology: 'mesh',
|
|
35
|
+
* maxAgents: 5
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Explicit V1 coordinator
|
|
39
|
+
* const v1Coordinator = await CoordinationToggle.create({
|
|
40
|
+
* version: 'v1',
|
|
41
|
+
* topology: 'hierarchical',
|
|
42
|
+
* maxAgents: 12
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // Explicit V2 coordinator
|
|
46
|
+
* const v2Coordinator = await CoordinationToggle.create({
|
|
47
|
+
* version: 'v2',
|
|
48
|
+
* topology: 'mesh',
|
|
49
|
+
* maxAgents: 5,
|
|
50
|
+
* tokenBudget: 20000
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/ export class CoordinationToggle {
|
|
54
|
+
static logger = new Logger({
|
|
55
|
+
level: 'info',
|
|
56
|
+
format: 'text',
|
|
57
|
+
destination: 'console'
|
|
58
|
+
});
|
|
59
|
+
static telemetry = new TelemetrySystem({
|
|
60
|
+
enableMetrics: true,
|
|
61
|
+
enablePersistence: true
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Create coordinator instance based on version
|
|
65
|
+
*
|
|
66
|
+
* Auto-detects coordination version and instantiates appropriate coordinator:
|
|
67
|
+
* - V1: Legacy coordination system (QueenAgent/MeshCoordinator)
|
|
68
|
+
* - V2: Modern coordination system (SDK/CLI/Hybrid modes)
|
|
69
|
+
*
|
|
70
|
+
* @param config - Unified coordinator configuration
|
|
71
|
+
* @returns Promise resolving to ICoordinator instance
|
|
72
|
+
* @throws Error if version not supported or dependencies missing
|
|
73
|
+
*/ static async create(config = {}) {
|
|
74
|
+
const startTime = Date.now();
|
|
75
|
+
// Determine effective version
|
|
76
|
+
const version = this.detectVersion(config);
|
|
77
|
+
this.logger.info('CoordinationToggle: Creating coordinator', {
|
|
78
|
+
requestedVersion: config.version ?? 'auto',
|
|
79
|
+
detectedVersion: version,
|
|
80
|
+
topology: config.topology ?? 'mesh',
|
|
81
|
+
maxAgents: config.maxAgents ?? 10
|
|
82
|
+
});
|
|
83
|
+
// Create version-specific coordinator
|
|
84
|
+
let coordinator;
|
|
85
|
+
if (version === 'v1') {
|
|
86
|
+
coordinator = await this.createV1Coordinator(config);
|
|
87
|
+
} else {
|
|
88
|
+
coordinator = await this.createV2Coordinator(config);
|
|
89
|
+
}
|
|
90
|
+
const initTime = Date.now() - startTime;
|
|
91
|
+
this.logger.info('CoordinationToggle: Coordinator created', {
|
|
92
|
+
version,
|
|
93
|
+
initTimeMs: initTime
|
|
94
|
+
});
|
|
95
|
+
// Track coordinator initialization time
|
|
96
|
+
this.telemetry.recordTimer('coordination.initialization', initTime, {
|
|
97
|
+
version,
|
|
98
|
+
topology: config.topology || 'mesh',
|
|
99
|
+
maxAgents: String(config.maxAgents || 5)
|
|
100
|
+
});
|
|
101
|
+
return coordinator;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Detect coordination version from config or environment
|
|
105
|
+
*
|
|
106
|
+
* Priority:
|
|
107
|
+
* 1. Explicit config.version
|
|
108
|
+
* 2. COORDINATION_VERSION environment variable
|
|
109
|
+
* 3. Default: 'v2'
|
|
110
|
+
*
|
|
111
|
+
* @private
|
|
112
|
+
* @param config - Unified configuration
|
|
113
|
+
* @returns Detected version ('v1' | 'v2')
|
|
114
|
+
*/ static detectVersion(config) {
|
|
115
|
+
// Priority 1: Explicit version in config
|
|
116
|
+
if (config.version) {
|
|
117
|
+
return config.version;
|
|
118
|
+
}
|
|
119
|
+
// Priority 2: Environment variable (VUL-1 FIX: strict validation with case-insensitive support)
|
|
120
|
+
const envVersion = process.env.COORDINATION_VERSION;
|
|
121
|
+
if (envVersion) {
|
|
122
|
+
const normalized = envVersion.toLowerCase();
|
|
123
|
+
// Strict regex validation to prevent injection
|
|
124
|
+
if (!/^v[12]$/.test(normalized)) {
|
|
125
|
+
throw new Error(`Invalid COORDINATION_VERSION: "${envVersion}". Must be exactly 'v1' or 'v2' (case-insensitive).`);
|
|
126
|
+
}
|
|
127
|
+
return normalized;
|
|
128
|
+
}
|
|
129
|
+
// Priority 3: Default to v2
|
|
130
|
+
return 'v2';
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Create V1 coordinator (legacy system)
|
|
134
|
+
*
|
|
135
|
+
* Translates unified config to V1 CoordinationTopologyConfig format
|
|
136
|
+
* and wraps result in V1CoordinatorAdapter for ICoordinator compatibility.
|
|
137
|
+
*
|
|
138
|
+
* @private
|
|
139
|
+
* @param config - Unified configuration
|
|
140
|
+
* @returns Promise resolving to V1 coordinator wrapped in adapter
|
|
141
|
+
* @throws Error if V1 dependencies not provided
|
|
142
|
+
*/ static async createV1Coordinator(config) {
|
|
143
|
+
this.logger.debug('Creating V1 coordinator', {
|
|
144
|
+
topology: config.topology,
|
|
145
|
+
maxAgents: config.maxAgents
|
|
146
|
+
});
|
|
147
|
+
// Translate unified config to V1 format
|
|
148
|
+
const v1Config = ConfigTranslator.toV1Config(config);
|
|
149
|
+
// V1 requires dependencies (memory, broker, dependencyGraph, logger)
|
|
150
|
+
if (!config.dependencies) {
|
|
151
|
+
this.getDefaultV1Dependencies(); // Will throw error
|
|
152
|
+
}
|
|
153
|
+
// VUL-4 FIX: Validate dependency object structure
|
|
154
|
+
this.validateV1Dependencies(config.dependencies);
|
|
155
|
+
const dependencies = config.dependencies;
|
|
156
|
+
// VUL-5 FIX: Log selected version for transparency
|
|
157
|
+
this.logger.info('V1 coordinator selected', {
|
|
158
|
+
version: 'v1',
|
|
159
|
+
topology: config.topology,
|
|
160
|
+
source: config.version ? 'explicit' : 'environment/default'
|
|
161
|
+
});
|
|
162
|
+
// Track V1 coordinator usage metrics
|
|
163
|
+
this.telemetry.recordCounter('coordination.version.selected', 1, {
|
|
164
|
+
version: 'v1',
|
|
165
|
+
topology: config.topology || 'mesh',
|
|
166
|
+
source: config.version ? 'explicit' : 'environment'
|
|
167
|
+
});
|
|
168
|
+
// Create V1 topology coordinator
|
|
169
|
+
const v1Coordinator = await createTopologyCoordinator(v1Config, dependencies);
|
|
170
|
+
// Wrap V1 coordinator with adapter for ICoordinator compatibility
|
|
171
|
+
return new V1CoordinatorAdapter(v1Coordinator);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Create V2 coordinator (modern system)
|
|
175
|
+
*
|
|
176
|
+
* Translates unified config to V2 FactoryOptions format
|
|
177
|
+
* and uses CoordinatorFactory for instantiation.
|
|
178
|
+
*
|
|
179
|
+
* @private
|
|
180
|
+
* @param config - Unified configuration
|
|
181
|
+
* @returns Promise resolving to V2 coordinator
|
|
182
|
+
*/ static async createV2Coordinator(config) {
|
|
183
|
+
this.logger.debug('Creating V2 coordinator', {
|
|
184
|
+
topology: config.topology,
|
|
185
|
+
maxAgents: config.maxAgents,
|
|
186
|
+
tokenBudget: config.tokenBudget
|
|
187
|
+
});
|
|
188
|
+
// Translate unified config to V2 format
|
|
189
|
+
const v2Config = ConfigTranslator.toV2Config(config);
|
|
190
|
+
// VUL-5 FIX: Log selected version for transparency
|
|
191
|
+
this.logger.info('V2 coordinator selected', {
|
|
192
|
+
version: 'v2',
|
|
193
|
+
topology: config.topology,
|
|
194
|
+
source: config.version ? 'explicit' : 'environment/default'
|
|
195
|
+
});
|
|
196
|
+
// Track V2 coordinator usage metrics
|
|
197
|
+
this.telemetry.recordCounter('coordination.version.selected', 1, {
|
|
198
|
+
version: 'v2',
|
|
199
|
+
topology: config.topology || 'mesh',
|
|
200
|
+
source: config.version ? 'explicit' : 'environment',
|
|
201
|
+
mode: v2Config.mode || 'sdk'
|
|
202
|
+
});
|
|
203
|
+
// Use CoordinatorFactory to create V2 coordinator
|
|
204
|
+
return await CoordinatorFactory.create(v2Config);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Get default V1 dependencies for standalone usage
|
|
208
|
+
*
|
|
209
|
+
* Creates minimal dependency set when not provided in config.
|
|
210
|
+
* Uses in-memory implementations for testing/development.
|
|
211
|
+
*
|
|
212
|
+
* @private
|
|
213
|
+
* @returns Default V1 dependencies
|
|
214
|
+
*/ static getDefaultV1Dependencies() {
|
|
215
|
+
// TODO: Implement default in-memory dependencies
|
|
216
|
+
// For now, throw error requiring explicit dependencies
|
|
217
|
+
throw new Error('V1 coordination requires dependencies (memory, broker, dependencyGraph, logger).\n' + 'Provide via config.dependencies or use V2 mode: { version: "v2" }');
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Validate V1 dependencies for security (VUL-4 FIX)
|
|
221
|
+
*
|
|
222
|
+
* Prevents prototype pollution and ensures required keys exist.
|
|
223
|
+
*
|
|
224
|
+
* @private
|
|
225
|
+
* @param dependencies - Dependencies object to validate
|
|
226
|
+
* @throws Error if validation fails
|
|
227
|
+
*/ static validateV1Dependencies(dependencies) {
|
|
228
|
+
if (!dependencies || typeof dependencies !== 'object') {
|
|
229
|
+
throw new Error('V1 dependencies must be a valid object');
|
|
230
|
+
}
|
|
231
|
+
// VUL-4: Check for prototype pollution attack vectors
|
|
232
|
+
const dangerousKeys = [
|
|
233
|
+
'__proto__',
|
|
234
|
+
'constructor',
|
|
235
|
+
'prototype'
|
|
236
|
+
];
|
|
237
|
+
for (const key of dangerousKeys){
|
|
238
|
+
if (key in dependencies) {
|
|
239
|
+
throw new Error(`Security violation: Dependencies object contains dangerous key "${key}"`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// VUL-4: Validate required keys
|
|
243
|
+
const requiredKeys = [
|
|
244
|
+
'memory',
|
|
245
|
+
'broker',
|
|
246
|
+
'dependencyGraph',
|
|
247
|
+
'logger'
|
|
248
|
+
];
|
|
249
|
+
for (const key of requiredKeys){
|
|
250
|
+
if (!(key in dependencies)) {
|
|
251
|
+
throw new Error(`V1 dependencies missing required key: "${key}". Required: ${requiredKeys.join(', ')}`);
|
|
252
|
+
}
|
|
253
|
+
if (!dependencies[key]) {
|
|
254
|
+
throw new Error(`V1 dependency "${key}" is null or undefined. All dependencies must be valid objects.`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get version detection summary for debugging
|
|
260
|
+
*
|
|
261
|
+
* @returns Human-readable version detection info
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* console.log(CoordinationToggle.getVersionSummary());
|
|
266
|
+
* // Output:
|
|
267
|
+
* // Coordination Version Detection:
|
|
268
|
+
* // - COORDINATION_VERSION: v2
|
|
269
|
+
* // - Default Version: v2
|
|
270
|
+
* // - V1 Available: true
|
|
271
|
+
* // - V2 Available: true
|
|
272
|
+
* ```
|
|
273
|
+
*/ static getVersionSummary() {
|
|
274
|
+
const envVersion = process.env.COORDINATION_VERSION?.toLowerCase();
|
|
275
|
+
const defaultVersion = 'v2';
|
|
276
|
+
const lines = [
|
|
277
|
+
'Coordination Version Detection:',
|
|
278
|
+
`- COORDINATION_VERSION: ${envVersion ?? 'not set'}`,
|
|
279
|
+
`- Default Version: ${defaultVersion}`,
|
|
280
|
+
'- V1 Available: true (legacy)',
|
|
281
|
+
'- V2 Available: true (recommended)'
|
|
282
|
+
];
|
|
283
|
+
return lines.join('\n');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//# sourceMappingURL=coordination-toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/coordination/coordination-toggle.ts"],"names":["CoordinatorFactory","createTopologyCoordinator","Logger","V1CoordinatorAdapter","ConfigTranslator","TelemetrySystem","CoordinationToggle","logger","level","format","destination","telemetry","enableMetrics","enablePersistence","create","config","startTime","Date","now","version","detectVersion","info","requestedVersion","detectedVersion","topology","maxAgents","coordinator","createV1Coordinator","createV2Coordinator","initTime","initTimeMs","recordTimer","String","envVersion","process","env","COORDINATION_VERSION","normalized","toLowerCase","test","Error","debug","v1Config","toV1Config","dependencies","getDefaultV1Dependencies","validateV1Dependencies","source","recordCounter","v1Coordinator","tokenBudget","v2Config","toV2Config","mode","dangerousKeys","key","requiredKeys","join","getVersionSummary","defaultVersion","lines"],"mappings":"AAAA;;;;;;;CAOC,GAGD,SAASA,kBAA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